Auto-Generated Battle Maps(A forgotten gamplay part)

Users who are viewing this thread

Current positions are not super fancy anyway.
True that :smile:
AAJMxve.png
 
I'm guessing you are not generating this on Bannerlord, right? Also, I wouldn't advise generating map from scratch polygon and adding into game.
Since game do have some form of "map" generation based on heightmap ( in game editor ), all we need is that particular code to generate the date and extract it. Then you can basically create an image with whatever the coding language you like ( you can bind your C++ dlls for heightmap generation, or even add some Python OpenCV to ease your pain ) and use that image data to generate a battlefield within the game engine and extract it's data. Still, too abstract since TW didn't share anything and I'm guessing that entire Modding Tools is embedded inside the engine so it's not written in C#, or at least that core functionality

Right now it's a separate codebase, my thought was that eventually when I get through the terrain generation process I integrate it with bannerlord though. The output of the code I'm envisioning right now would essentially be heightmaps/splatmaps that can be converted into the terrain_ed, terrain, and flora binaries once I figure out how those are packed. I've kind of ignored the scene editor for this purpose (though obviously that would be much more preferable) because it seems like it's separate from the game and looks like there won't be any way to interface with it from the game itself.
 
Right now it's a separate codebase, my thought was that eventually when I get through the terrain generation process I integrate it with bannerlord though. The output of the code I'm envisioning right now would essentially be heightmaps/splatmaps that can be converted into the terrain_ed, terrain, and flora binaries once I figure out how those are packed. I've kind of ignored the scene editor for this purpose (though obviously that would be much more preferable) because it seems like it's separate from the game and looks like there won't be any way to interface with it from the game itself.
That might be waste of time since decoding bin files can be impossible based on how they made it. Also I examined them today and they are usually 10MB for each terrain bin. So it's really not feasible to `decrypt` that by hand. Even if you are crazy enough and pull that off, converting whatever you have into to that format ( especially the texturing part ) can be super tricky.
I would advise checking how they do it for scene editor. If that part is written in C#, you can expose some C++ Interfaces to use it. I don't have Modding Tools installed at the moment so I can't check that. If not, you can reverse engineer the bulk C++ dll - but that might not give you an understandable result.
 
That might be waste of time since decoding bin files can be impossible based on how they made it. Also I examined them today and they are usually 10MB for each terrain bin. So it's really not feasible to `decrypt` that by hand. Even if you are crazy enough and pull that off, converting whatever you have into to that format ( especially the texturing part ) can be super tricky.
I would advise checking how they do it for scene editor. If that part is written in C#, you can expose some C++ Interfaces to use it. I don't have Modding Tools installed at the moment so I can't check that. If not, you can reverse engineer the bulk C++ dll - but that might not give you an understandable result.

Yeah, that's my worry too. Even the short binaries produced by simple scenes are head scratchers. I was generating a 1 node 4x4 scene and just raising and lowering the terrain plane and wasn't able to work out how it was getting packed... I think I have the header figured out but I'm not sure of much beyond that. I didn't want to do anything with their scene editor files, I don't have experience with C++ anyway so it probably wouldn't be super helpful for me.
 
I don't have experience with C++ anyway so it probably wouldn't be super helpful for me.
If their Modding Tools interface is written in C#, then you might have a shot on that. Since C# side have to communicate with C++ exposed interfaces, it should show where to call and what to do. Still, at best you can have a terrain and material map and that's all. I'm guessing all flora related stuff is simply not possible to add via using exposed interfaces. But still, better than nothing. If entire modding tools is inside the C++ core, then we are out of luck anyway.
 
does the Map editor currently use one big tile or is it splitup into smaller tiles if you know what i mean?
since if its mutiple tiles could you not have pre defined blocks that are built together randomly?
 
Any plan to have something where we can `read` the contents of the .bin files to create our own tools for scene creation? Since it's out of discussion for TW to have autogenerated maps, perhaps community create something like I mentioned above. But we need to decode those .bin files first.
@Dejan Any chance to check this/ask around? I'm genuinely wondering this.
Although I'm also able to guess the probable answer.
 
@Dejan Any chance to check this/ask around? I'm genuinely wondering this.
Although I'm also able to guess the probable answer.
There are currently no plans on doing something like that. I've brought this up internally though and we'll look into giving modders access to terrain data through the scripting interface in the editor so that you can run your own procedural generation codes and save the scene afterwards. Based on community feedback, we can look into other options further down the line.
 
...we'll look into giving modders access to terrain data through the scripting interface in the editor so that you can run your own procedural generation codes and save the scene afterwards.
Sounds like a step but I didn't get how this would help anyone at all. At the end, you still need to fire up Editor, create a scene, save it and so on. I guess it would only save you finding a heightmap so that you can procedurally generate the heightmap - but at the end, it's not saving up any time or adding randomness since procedural heightmap generation can be easy with even online tools anyway.
If possible, I'm wondering what exactly is the technical limitation of procedurally generated maps in the game? Was this decision purely cosmetic or were there major issues with this so that team decided to adopt premade maps?

Edit: Actually on second thought, I realized that this could be helpful. A single map for all battle terrains with random generation script attached to it, every time you load the scene, script runs and changes the terrain. That can be a good solution indeed ( if this is what you mean )
 
Last edited:
giphy.gif


I'm wondering what exactly is the technical limitation of procedurally generated maps in the game? Was this decision purely cosmetic or were there major issues with this so that team decided to adopt premade maps?

I'm curious about the reply
 
Procedural battle maps would be a major improvement. Fighting on the same small selection of battlefields is one big thing that makes the game feel so repetitive after awhile. It would be really nice if the battlefields actually related to the geography of the map. Of course, that means programming a good map generator that doesn't make the 90 degree slopes you'd often see in some Warband scenes, so I'm sure its not a small task. Still, I believe this is an area that's worth investing the time and effort into. I'd rather they focus on this than a more complex economy.

At the very least, they ought to reassign most of the sceners who are handcrafting unique scenes for every single village and put them to work cranking out more battle scenes. They should be releasing a few new battlefields with every patch.

The historical total war games have had dynamic maps based on the overworld ever since Medieval 2. In Attila, they even went so far to make it so that skirmish locations for Multiplayer could be chosen on the overworld map of the campaign. It should really not be all that hard, if the engine accommodates it in any way.
 
Sounds like a step but I didn't get how this would help anyone at all. At the end, you still need to fire up Editor, create a scene, save it and so on. I guess it would only save you finding a heightmap so that you can procedurally generate the heightmap - but at the end, it's not saving up any time or adding randomness since procedural heightmap generation can be easy with even online tools anyway.
Sorry for the late reply, no final decision has been brought about this yet. It's too early to discuss it at this point though, let's see how the proposed solution works out when implemented and take it from there.
 
Sorry for the late reply, no final decision has been brought about this yet. It's too early to discuss it at this point though, let's see how the proposed solution works out when implemented and take it from there.
I see thanks, I will check it out when that happens. Meanwhile, do you have the answer to this? - doesn't matter if the answer is too technical
If possible, I'm wondering what exactly is the technical limitation of procedurally generated maps in the game? Was this decision purely cosmetic or were there major issues with this so that team decided to adopt premade maps?
 
I have just remembered a public conversation on the discord server where zkh in his very personal opinion when asked about precisely this.

semi-procedural maps like Path of Exile has can be best of both options. you still get a map random enough to not remember last time it occurred and controlled enough to not have bugs/unplayable areas

However, as an official statement I also would like to know what technical impediments make it difficult to implement this.
 
I have just remembered a public conversation on the discord server where zkh in his very personal opinion when asked about precisely this.



However, as an official statement I also would like to know what technical impediments make it difficult to implement this.

Sorry for taking so long to get back to you, I'm not TW but I've spent time thinking about how to do it using the PoE method of procedural generation, and there are a number of impediments.

1) The first one is that I'd need to essentially sit down and make a bunch of scenes chunks where the edges of each scene chunk match EXACTLY with some combination of other chunks. Stitching these together in a procedural manner will then generate a terrain. I'm not sure how you would do that in something like WM for the terrains themselves, though I guess theoretically it's possible.

2) Once you get a library of terrain chunks set up (and presumably all the flora/splat layers can be generated in WM as well), you need to start working with Bannerlord, and that's where there's a huge disconnect at this point. Either you need to stitch the terrain up beforehand in a procedural manner, and then generate a nav mesh on top/drop paths/etc, or you need to place the nav mesh, paths, tactical areas, etc ON EACH CHUNK, and have them somehow stitched together after the fact.

3) I don't know how their scenes are packaged up, so I don't know if EITHER method is feasible but I'm not sure how else you'd make it work at this point... I've looked briefly at the portion of the terrain generation code which I think packs their terrain binaries but I'm not very good with C#, and I don't really understand it. If there's a dev or a C# coder who wants to break it down for me I'm happy to walk through what I know with them and try to sort it out.

4) Most of the work with regards to figuring out how to generate a bunch of terrain chunks that can be stitched together can be done outside of bannerlord. Anything relating to how to package those layers up and add meshes/etc to make something bannerlord will recognize will need knowledge of how bannerlords terrain binaries works, or will need some sort of API from TW. If a dev wants to comment that any of this will be/should be possible, and comment on which approach I should be working towards, then I am happy to start working on making chunks to fit together for the randomization algorithm. Until then I don't particularly want to start the hundreds of hours of work that will inevitably take.

The benefits of this method as opposed to other procedural approaches is that potentially I can make procedurally generated castles, towns, villages, etc at some point. All I need is to make some castle chunks that match up, village chunks that match up, etc, and then I can combine them in different ways. Obviously saying it like that makes it sound super easy but in reality that would be a ton of work even if I knew how I could stitch them all together in Bannerlord after the fact.
 
Back
Top Bottom