Water-only map generation in 0.17

Things that already exist in the current mod API
Post Reply
project6
Inserter
Inserter
Posts: 22
Joined: Sat Aug 15, 2015 10:31 pm
Contact:

Water-only map generation in 0.17

Post by project6 » Wed Feb 27, 2019 4:28 am

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.

Boodals
Fast Inserter
Fast Inserter
Posts: 121
Joined: Sun Feb 11, 2018 7:10 pm
Contact:

Re: Water-only map generation in 0.17

Post by Boodals » Thu Feb 28, 2019 1:20 pm

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.

Boodals
Fast Inserter
Fast Inserter
Posts: 121
Joined: Sun Feb 11, 2018 7:10 pm
Contact:

Re: Water-only map generation in 0.17

Post by Boodals » Mon Mar 11, 2019 2:12 pm

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.

project6
Inserter
Inserter
Posts: 22
Joined: Sat Aug 15, 2015 10:31 pm
Contact:

Re: Water-only map generation in 0.17

Post by project6 » Mon Mar 11, 2019 3:30 pm

No data stage access for my use case, but I appreciate the follow up.

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 3978
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: Water-only map generation in 0.17

Post by Klonan » Mon Mar 11, 2019 3:55 pm

You can use the island preset, and turn the scale down to 0.001 or something

Boodals
Fast Inserter
Fast Inserter
Posts: 121
Joined: Sun Feb 11, 2018 7:10 pm
Contact:

Re: Water-only map generation in 0.17

Post by Boodals » Tue Apr 02, 2019 6:42 am

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.

Bilka
Factorio Staff
Factorio Staff
Posts: 2338
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Water-only map generation in 0.17

Post by Bilka » Wed May 29, 2019 10:34 am

Use something like this, as Boodals said:

Code: Select all

game.create_surface("my-surface", {  property_expression_names = {elevation = -10}})
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

Post Reply

Return to “Already exists”

Who is online

Users browsing this forum: No registered users