Tile Autoplace Help?
Posted: Sun Jun 25, 2017 12:19 am
I've been trying to make island-like terrain gen, but keep running into lots of problems. Mainly, the islands keep turning out either too big, or I can't even start a map because there are no walkable tiles within 200 tiles of start. Ideally, I want lots of spread out small islands, but instead I get rare massive islands.
The first thing I did was remove all tiles autoplace, by looping through data.raw.tile and setting the autoplace to nil. I then add my own tiles in using the same function as vanilla seems to use.
I then add in my tiles, setting their autoplace via
and
The result(after regenning the map like 10 times to get a walkable tile) being something like
The ideal result is
I think the problem is that I just don't understand the rectangles parameter of the autoplace_settings function, so any insight on that would be extremely helpful. Thanks in advance!
The first thing I did was remove all tiles autoplace, by looping through data.raw.tile and setting the autoplace to nil. I then add my own tiles in using the same function as vanilla seems to use.
Code: Select all
local autoplace_utils = require("autoplace_utils")
local function autoplace_settings(noise_layer, rectangles)
local ret = {}
if noise_layer then
ret = {
{
influence = 0.1,
noise_layer = noise_layer,
noise_persistence = 0.7,
octaves_difference = -1
}
}
end
autoplace_utils.peaks(rectangles, ret)
return { peaks = ret }
end
Code: Select all
--customfillertile
autoplace = autoplace_settings("fillertile", {{{10, 10}, {0, 0}}}),
Code: Select all
--customgroundtile
autoplace = autoplace_settings("walkabletile", {{{2, 2}, {0, 0}}}),