Hi Peter,
Please discuss "live" map creation with people that understand the code better. I only make levels, and some lua code for e.g. AIs.

I would like to cooperate to create (offline) some maps to prove that the generator is able to do so. This might be a first step towards live maps, and your effort spent so far will bear at least some fruit.

If I understand right, we need a conversion script in lua from the textual output of the current generator to Boswar map format, i.e. a folder with 3 files: presentation.smp, setup.sms, terrain.lua. The "smalland" map is a good example of the correct file format - since many levels have a different file layout.

The simplest way of mapping the letter codes to patches would be to use the gosh colors 06 and 09 with the 3000 series exclusively - that would only give 2 terrain types. All the other gosh series can be combined with this (except the 9000 series), and could be added later.

I am not skilled enough to create such lua code. Can you help? I am able to build on example code, though.

The random seed for the lua random map generator can be set from the C code, although that is some effort.
If the lua random generator is not the same across platforms, then a software generator can be used.

While randomness reduces multiplayer fairness of maps, my lua map generator can be used to generate perfectly rotation-symmetric maps, that is as perfect as the extra randomness added in terrain blob generation intentionally allows.

If you want to work on terrain transitions, I will gladly cooperate in finding an automated solution. I still have to look at your patch to understand the task.

Already a long time ago, I implemented a randomly generated map, see patch #6857. I wanted to overcome the problem that you know where everything is on a map after a few times playing, which I find disturbing the fun.

The implementation of that patch was not suitable for Boswars, so I changed my idea to have some map generated in e.g. 10 variants, so that you can pick one to play.
Let's build on this idea: Can we generate a nice background with the "gosh" patches for the desert that is random, and then place the oases like I did in these levels?

Please download the zip from patch #6857 and look at the levels. Lacking is a nice background.

So, to answer your questions:
- I would like to create maps offline.
- The patches to use are the gosh and/or goshgeom patches.
- Buildings: Use one vault as HQ. No other buildings for now. Building positions are easily corrected manually, so no algorithm perfection is needed here.

I think the most difficult implementation detail will be regarding patches: the edges between soil types. Maybe, as a first step, we should do this manual.

I kind of thought that someone who had been working on BOS would tell me how to improve the generator to make it work for BOS. But to answer the question:

To make the generator create BOS-maps..
- the random map script authors, for example me, have to know which terrain to use, and how to write scripts

- improve rendering(thats the last step) such that all added "non-terrain" of the type building or unit or special is always placed on the map, even if displaced. This is necessary if you place initial buildings with the map generator, as currently it is possible that it attempts to place two in the same spot.

- This also might be improved further by having different buildings have different foundation. Currently one building is one map tile.

- optionally, render to more than one output map, i.e. have one level for terrain, one level for buildings and one level for units.

To create maps offline, and allow editors to improve these..
- have a conversion script to BOS map format, or create the BOS format directly from LUA.

To create maps live..
- call LUA map generator in the BOS executable. This should preload the map generator code, copy the lua state, and then run a random map script in that context.

I can help with some of these steps, but I need people to express their interest and point out the obvious things(to them) to get me started.

Running the lua code as follows generates a text file r1.txt:
lua generator_random_1.lua 7 200 r1.txt 56987
This text file contains letters that represent the patch type.
So far, great! The maps look fine, they may need some manual work, but may save me a lot of time while guaranteeing randomness and original shapes.

But how can we convert this text into a Boswars map?
What do we need to complete the work?

here is a LUA generic map generator, which might be useful for BOS.
It is intended to be used together with random map scripts written in LUA similar to the rms of the Age of Empires series. I realize there is work to do till it is useful for BOS, and I'm willing to invest some time in that.

The main interface is Generator.lua, the main files to execute are the generator_example files.

This release, v0.1.1 is under the terms of the GPLv2 or any later version.