Map Generation - Is this possible?
Map Generation - Is this possible?
Hi all. I have particular tastes when it comes to the biomes. I only like playing in the green biome with lush, green trees. I dislike the desert, the brown grass, the biome with weird-looking red trees, the one with brown reeds growing everywhere, etc... Is there any file I can modify so that when I generate a map it's always only one particular biome? Thanks in advance!
Re: Map Generation - Is this possible?
Try this in a data-updates.lua:
Code: Select all
for _, name in pairs({"dirt", "dirt-dark", "sand", "sand-dark", "grass-dry"}) do
data.raw.tile[name] = nil
end
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!
Re: Map Generation - Is this possible?
That appears to give me green grass all the time, but doesn't change the biome itself. I still get the "lots of dead trees" biome, "weird twisty trees with red leaves" biome, etc... So basically left each biome vanilla, but changed the ground covering to green grass.
Re: Map Generation - Is this possible?
Try adding
Code: Select all
data.raw.decorative = nil
for _, tree in pairs(data.raw.tree) do
for _, badword in pairs({"dead", "dry", "red", "brown", "tree%-03", "tree%-07"}) do
if string.match(tree.name, badword) then
data.raw.tree[tree.name] = nil
end
end
end
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!
Re: Map Generation - Is this possible?
Unfortunately all that does is delete everything, so I end up with an empty map. I was wondering if there was a way to control which biome the map generator produces.
On a side note, I like the code for being able to delete objects! I can't figure out the correct command for "stone-rock" though. If anyone knows it, please post it. "stone-rock" (the rocks you have to shoot) is in \prototypes\entity\demo-doodads.lua.
On a side note, I like the code for being able to delete objects! I can't figure out the correct command for "stone-rock" though. If anyone knows it, please post it. "stone-rock" (the rocks you have to shoot) is in \prototypes\entity\demo-doodads.lua.
Code: Select all
type = "simple-entity",
name = "stone-rock",
Re: Map Generation - Is this possible?
This shouldn't remove everything, just all the decorations and a lot of types of trees so there might not be any in your starting area. If you want to keep some of the decorations, go through data/base/prototypes/entity/demo-doodads.lua to find the ones you don't like and only remove those instead of setting data.raw.decorative = nil. You could fiddle with the tree's autoplace settings to make the green ones spawn more often, but figuring out how that works would require some effort. So just regenerate the map till you're next to some trees. Don't have a better idea how to do this, sorry.
As for the stone-rock, you remove that with data.raw[type][name] like the other entities:
As for the stone-rock, you remove that with data.raw[type][name] like the other entities:
Code: Select all
data.raw["simple-entity"]["stone-rock"] = nil
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!
Re: Map Generation - Is this possible?
Code: Select all
data.raw["simple-entity"]["stone-rock"] = nil
As for my original question. I found this in data\prototypes\entity\demo-trees.lua:
Code: Select all
local biomes = autoplace_utils.biomes
With all the previous info given here, I will eventually be able to modify the game's starting maps to my liking. I think I may take your advice and mod demo-trees.lua's placement probabilities to prevent ugly trees from being spawned. Thanks again for all the help!
Re: Map Generation - Is this possible?
There's no mention of biomes in autoplace_utils.lua (or anywhere else in all of data/) and the biomes variable isn't actually used anywhere in demo-trees.lua. I have no idea what that line is supposed to accomplish. I almost think it simply does nothing.
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!