How to prevent terrain from generating at the edges of the map

ogl1986

Chieftain
Joined
Mar 4, 2017
Messages
1
Hello

I really need your help. Could you please tell me how to prevent terrain from generating at the edges of the map.
Please find img enclosed.

How to prevent that? Is it possible to exclude two hexes from top and bottom to not generate any terrain on em?

I have found a thread with line to not generate ice next to coasts and that was great, but a lot of times map is generating like this one on enclsed image.

The same situation is with mountains sometimes there are too many of them in one place, like a cluster. Where and how can I change this?

I would really appreciate any help in this matter.

Thanks!

Peter
 

Attachments

  • edges.jpg
    edges.jpg
    171.4 KB · Views: 364
Last edited:
This question belongs in another section but I'll go ahead and answer it to the best of my ability here.

I'd need to see your code to advise a "best" option but in all cases you could always do a pass after initially generating tile types and set all of the tiles in the top and bottom rows to PlotTypes.PLOT_OCEAN. That might look something like this:

Code:
local y = 0
for x = 0,W - 1,1 do
           local plot = Map.GetPlot(x,y);
           plot:SetPlotType(PlotTypes.PLOT_OCEAN, false, false)
end

y = H - 1
for x = 0,W - 1,1 do
           local plot = Map.GetPlot(x,y);
           plot:SetPlotType(PlotTypes.PLOT_OCEAN, false, false)
end

Note, you'll need "W" and "H" variables setup as the mapconstants for width and height. Likely you already have them in your code somewhere under a different name but pulling them would look something like this:
Code:
local W,H = Map.GetGridSize()
 
Top Bottom