Damocles,
Is there a specific distance that Towns/Cities have to be from each other? I'm trying to do something pretty specific and not getting quite what I want.
My server wants a single, large wasteland crater in the center of the map, surrounded by (all the) cities. Merged up together so they appear to be a single massive city with a nuked-out center. I'm using a custom height map and mask with City and Town seeds.
My problem is that when cities' seeds get close enough, it ignores them and places some of them elsewhere on the map. It looks like if they are closer than approx 1k or 1100 pixels on both x and y coordinates. I'm using a 4k map with Many, Large cities and Large Towns.
I can get pretty close by intermixing City and Town spawns, but its still not quite right. If you could tell me the actual distance required, I can map it out to the pixel and get what I need, I think.
In the meantime, keep up the awesome work!
Remember to only use SINGLE dots to mark a city.
Its a very simple system, it scans for all pixels, and considers those a new city. If there are several in a blob, the generator tries to create all cities on the same spot, thus pushing the other POIs out to free terrain. If all dots where "used" it will spawn new towns/cities at a random position.
The scanner will use the dots scanning from the top left corner... best is to only use as many dots as you want cities or towns to spawn, so you have more control.
The yellow color is just there for convenience to paint around the dots, to make them easier to see in the mask. Yellow gets ignored.
The generator spawn all POIs of a city/town at once, then continues with the next city/town. (first cities, then towns, then traders and smaller settlements)
The POIs in a settement will keep a distance from another settlements POIs. Dont remember now, something like 30 pixels or so (to keep between the POIs outer bounds). So the city centers should be something like 500 pixels apart at least from each others to have enough space. Else the POIs might wrap around the other settlement.
Its mainly depends on how much space the POIs use up (when selecting larger cities, they will use up more space on average then).
Those are the max elevations cities and towns want to spawn at (average hight of the area)
cityTerrainCheckMaxElevation=65;
townTerrainCheckMaxElevation=75;
so try to keep the elevation below 66 at the locations where you want your cities. (I think the spawn-mask overwrites that check for elevation)
Here the current raw values for the number of cities and towns to spawn:
tCities=new float[]{0,0.8f,1.4f,2f,3f,4.5f}; //rounded up
tTowns=new int[]{0,1,2,4,7,10};
"none","very few","few","default","many","lots"
-> per 4k area, so an 8k map has 4 times the amounts, etc
at "default", on an 8K map it would spawn 4 * 2 = 8 cities
and "default" for towns: 4 * 4 = 16 towns
"many" for towns = 4 * 7 = 28 towns