Page 1 of 1

Enable/Disable Autoplace For Surfaces

Posted: Sun Aug 21, 2016 5:42 pm
by Sauerkraut
Currently all surfaces autogenerate similar "worlds". It would be nice if one could disable certain things on different surfaces. AFAIK tiles, trees, resources, biters(+spawner and worms) and doodads are autoplaced.

The specifications for a surface must be defined before the surface is generates, so I'd suggest an additional table as optional argument for the create_surface() function. I'd imagine something like this:

Code: Select all

game.create_surface("tatooine",game.surfaces["nauvis"].map_gen_settings,
{
    {
        to_set=game.tile_prototype["grass"]
        enable=false
    },
    {
        to_set=game.tile_prototype["grass-medium"]
        enable=false
    },
    {
        to_set=game.entity_prototype["tree-01"]
        enable=false
    },
    {
        to_set=game.entity_prototype["tree-02"]
        enable=false
    }
}    
)
So if I want to create a peaceful forest surface I'd disable desert-y tiles, enemies, dead trees, maybe even change resources.

I think the ability to change autoplace settings for different surfaces would be too much to ask for, but this should do it.

Re: Enable/Disable Autoplace For Surfaces

Posted: Mon Aug 22, 2016 1:36 am
by Rseding91

Re: Enable/Disable Autoplace For Surfaces

Posted: Mon Aug 22, 2016 10:27 am
by Sauerkraut
Yes, but those autoplace controls only contain data about resources and enemies, not about tiles, trees and doodads.

Re: Enable/Disable Autoplace For Surfaces

Posted: Thu May 25, 2017 8:06 pm
by StevilKnevil
It seems like a sensible extension would be to allow more types in the MapGenSettings autoplace_controls table so that you can include tile types and doodads.

Re: Enable/Disable Autoplace For Surfaces

Posted: Tue Nov 07, 2017 8:44 pm
by Rseding91
OK, in 0.16 you can configure all of the autoplace settings for a given surface. You can also change map gen settings runtime for a surface if you want.