SP Native Medieval Mount and Blade II: Randomlord

Users who are viewing this thread

Announcing work beginning on a new mod, Mount and Blade II: Randomlord!


This mod is going to be an attempt at introducing some stochasticity into Bannerlord in a big way. I aim to add:

  • randomly generated battle scenes
  • randomly generated overworld map complete with:
    • new town/village/castle placements
    • new allocations of primary village resources and town characteristics (new economies and trade routes to discover each time! some of them hopelessly broken? hopefully not but probably!)
  • randomly generated lords/ladies (with backstories based on their traits)
  • randomly generated factions (with backstories based on their lords and ladies)
  • randomly generated wanderers (still generated within the bounds of various classes/stats)
  • random hideouts/unique locations
  • random late game events


Each of these that I am successful (and happy) with I am hoping to make into stand alone modules that I plan to release for anyone to use in their own projects however they see fit. I am thinking MIT license but I am not a lawyer so someone help me out if that's not the way to go.

If you are interested in helping with this admittedly ambitious project to bring stochasticity to the people, please feel free to reply here or shoot me a message and I can carve out a chunk for you to work on! I am happy to collaborate with others who maybe have an interest in doing the same or a similar thing.

Thank you for your time.

- Suspicious Man
 

Waybook

Sergeant
I think the RNG campaign map would be the most impactful, but do you have any idea how that could be pulled off?
 
I have some idea, yes. For the layers themselves, at the end of the day it's all just math. Some of the actual implementation for Bannerlord itself will have to wait until we see what tools are available in the modding kits (I am hopeful that there will be an API for the scene generation tools). Things like height maps, splat maps, etc can be generated with algorithms and then those outputs hopefully just plugged into the API. Generating those layers in a way that makes sense is not at all a trivial issue, so I'm working on algorithms for all of the needed layers at this point. Once the scene tools come out I will work on integrating the algorithms with Bannerlord. If we don't get an API there are probably other ways around it but it will involve a lot more coding and tearing their scene files apart to figure out exactly how they're built on my end.
 

Bjarkan

Recruit
I think your idea is awesome. I am a big fan of procedural generation.
But I think it will be difficult for you to achieve your ideas without relying on external software...
 
I'm pretty hopeful I can do everything in C#, what parts or external software do you think I would need to do this?

I'm writing a terrain generation algorithm for the height map, I will need to tie in some other stuff to make it high enough quality to not look terrible next to the native map (planchon-darboux, some sort of glacial or tectonic process, deposition, etc) which might be a little computationally intensive but I don't think it will be too bad. People will be willing to wait a little bit while the terrain is generated anyway, it's only at the start of a new game. Then I just need to add in rivers, moisture map based on that, splat map based on moisture/height, flora map based on those, so on and so forth. Those can all be generated based on the underlying height map, don't think I need anything external there. After those layers are put together I can identify city nodes with network linkages to drop in the cities, towns, castles, etc in places where they make sense, generate territories/cultures/names for them, create NPCs and fill in the relevant details for cities/villages/castles with notables, resources, etc.

The real hiccup (besides me not knowing C# well so I'll have to port a bunch of stuff from python to C# or use ironpython or something) is being able to import all those terrain layers into their map editor to generate the terrain and markers for the world map itself. If I can't do that with an API that I think I recall them saying they'd provide, I need to figure out how they compile it in their scene editor to generate the scene. I'd probably do that with their output files, or by looking at the code for their scene editor. It won't be fun though. Like in warband, you can go into the sco files and change stuff around and make the scene different, you can likely do the same thing with their flowmap, flora, and terrain files. This is where I'm concerned my idea will break, but hopefully where there's a will there's a way!
 

Waybook

Sergeant
Do you know how the pathfinding works in Mount and Blade games?
Skyrim did get some mods that added procedurally generated dungeons, but never got a mod for a procedurally generated world map, because making the pathfinding work for NPCs wasn't feasible. This would be my main concern.
Although, the campaign map for Bannerlord is less complex than Skyrim's world map and the battle scenes are smaller. So it should still be doable.
 
I haven't looked into pathfinding too much but I do know there are mods that edit settlement placements already at this point, I think there's a mod that adds a ton of new settlements and changes settlement locations and I'm pretty sure they made it work. There is a layer you need to add to the world map which determines where characters are able to go, that can just be generated from the heightmaps, and town/village locations updated in the xmls from the node/link network when they're generated. Hopefully that will solve most of the pathfinding issues if the AI pulls from that xml to calculate distances between their current location and a particular settlement.

Battle scene AI I'm not worried about at this point, that's just a pathfinding mesh which I believe can be autogenerated in the scene editor (though if it's like warbands it won't be fantastic and won't work for village/town/castle scenes), the bigger issue will be AI on the world map for decision making purposes.

edit: there's more information in this thread -

It looks like they planned for people adding new settlements, you need to edit the settlements_distance_cache.bin. Hopefully that will be sufficient and pathfinding won't be an issue.
 

madnes5

Recruit
this mod sounds pretty good, id download it!
but all these mods aremissing something imo..
a change in time scale?
do you know how to add more days to a month or more seasons to the year?
Would you want to add that to your mod or give players the ability to change the settings? if not would you know where to find the file that would need to be edited?
 
Top Bottom