Page 1 of 1

Water-only map generation in 0.17

Posted: Wed Feb 27, 2019 4:28 am
by project6
Having a water-only map for the purposes of scenario-based world generation is great since it gives you a map in its (nearly) most basic form: everything is the same tile and the only entities on the map are fish. It seems the switch from 16 to 17's map generation has closed off that possibility and it would be nice if we could have water or even void (out-of-map) only maps by explicitly having treat_missing_as_default = false be respected in the most literal of ways.

In 0.16 we could create a water-only map by using the following map_gen_settings:

Code: Select all

{
	autoplace_controls = {
		desert = {
			frequency = 'normal',
			richness = 'normal',
			size = 'none'
		},
		dirt = {
			frequency = 'normal',
			richness = 'normal',
			size = 'none'
		},
		grass = {
			frequency = 'normal',
			richness = 'normal',
			size = 'none'
		},
		sand = {
			frequency = 'normal',
			richness = 'normal',
			size = 'none'
		}
	}
}
In 0.17 we cannot replicate this behaviour as the following code block actually gives us grass-1 tiles everywhere a ground-tile is expected:
We also tried explicitly setting grass tiles to size = 0.

Code: Select all

{
	autoplace_settings = {
		tile = {
			treat_missing_as_default = false,
			settings = {
				['deepwater'] = {frequency = 1, size = 1, richness = 1},
				['deepwater-green'] = {frequency = 1, size = 1, richness = 1},
				['water'] = {frequency = 1, size = 1, richness = 1},
				['water-green'] = {frequency = 1, size = 1, richness = 1},
				['water-mud'] = {frequency = 1, size = 1, richness = 1},
				['water-shallow'] = {frequency = 1, size = 1, richness = 1}
			}
		}
	}
}
Thanks.

Re: Water-only map generation in 0.17

Posted: Thu Feb 28, 2019 1:20 pm
by Boodals
I think the best behaviour for this would be to use out-of-map tiles if no tiles are valid, and fix(?) water generating when it's the only valid tile.

Re: Water-only map generation in 0.17

Posted: Mon Mar 11, 2019 2:12 pm
by Boodals
A way to do this, if you have access to the data stage, is to add a new noise expression that is used to replace the default elevation expression. I’ve been using it recently and it works great, but I’m on mobile so I can’t link any references.

Re: Water-only map generation in 0.17

Posted: Mon Mar 11, 2019 3:30 pm
by project6
No data stage access for my use case, but I appreciate the follow up.

Re: Water-only map generation in 0.17

Posted: Mon Mar 11, 2019 3:55 pm
by Klonan
You can use the island preset, and turn the scale down to 0.001 or something

Re: Water-only map generation in 0.17

Posted: Tue Apr 02, 2019 6:42 am
by Boodals
I'm looking into noise stuff again, and I found that you can use a constant in place of a noise expression in the property_expression_names of MapGenSettings, eg. elevation = "-10". that should generate you a water-only world without needing access to the data stage or using hacks like Klonans suggestion.

Re: Water-only map generation in 0.17

Posted: Wed May 29, 2019 10:34 am
by Bilka
Use something like this, as Boodals said:

Code: Select all

game.create_surface("my-surface", {  property_expression_names = {elevation = -10}})