Water is generated last, overwriting essential resources

Bugs that are actually features.
scwizard
Burner Inserter
Burner Inserter
Posts: 14
Joined: Wed Apr 13, 2016 8:10 pm
Contact:

Water is generated last, overwriting essential resources

Post by scwizard »

Because of this, it's possible to get a start without copper or some other essential resource, if you end up starting with a lot of nearby water.

An example is attached.

A solution would be to generate water before placing resources, rather than after.
Attachments
copperwhere.png
copperwhere.png (157.63 KiB) Viewed 3734 times
Rseding91
Factorio Staff
Factorio Staff
Posts: 14265
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Water is generated last, overwriting essential resources

Post by Rseding91 »

Water overwriting resources, resources not being place-able because water is in the way.

Either way the result is the same.
If you want to get ahold of me I'm almost always on Discord.
scwizard
Burner Inserter
Burner Inserter
Posts: 14
Joined: Wed Apr 13, 2016 8:10 pm
Contact:

Re: Water is generated last, overwriting essential resources

Post by scwizard »

Rseding91 wrote:Water overwriting resources, resources not being place-able because water is in the way.

Either way the result is the same.
Resources not being placeable because water is in the way? That doesn't make sense.

Resources should only be distributed among "valid tiles." Of course you can't place resources on top of water, so the sensible thing would be to have a map of tiles where resources can be placed, and distribute them across that map.

Doing it this way has several advantages, not only do you fix the water issue, but you can also avoid resources overwriting other resources.

EDIT: Even though this might take some coding effort, it's worth it because it makes it easier to add additional types of resources in the future.
orzelek
Smart Inserter
Smart Inserter
Posts: 3923
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: Water is generated last, overwriting essential resources

Post by orzelek »

You should read up about resource generation on wiki.
The way it's done doesn't allow for something like you are describing.

Since resources are based on 2d Perlin noise functions there is no "valid" tile check. They have their pre-calculated locations based on the noise function and thats where they spawn. Since water works in similar way when they interesect water wins.
Algorithm like that is used to provide determinism.
scwizard
Burner Inserter
Burner Inserter
Posts: 14
Joined: Wed Apr 13, 2016 8:10 pm
Contact:

Re: Water is generated last, overwriting essential resources

Post by scwizard »

I don't understand.

Surely map generation allowing for "unplayable" maps is a bug...
aes
Manual Inserter
Manual Inserter
Posts: 2
Joined: Thu Apr 21, 2016 6:41 am
Contact:

Re: Water is generated last, overwriting essential resources

Post by aes »

scwizard wrote:I don't understand.

Surely map generation allowing for "unplayable" maps is a bug...
The problem is that the developer observes the code working as expected, and so does not have a bug, but you observe a bad experience, and that's only a problem if you're supposed to have a good time. Yes, that's harsh, but that's ok, you can thank me later.
orzelek
Smart Inserter
Smart Inserter
Posts: 3923
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: Water is generated last, overwriting essential resources

Post by orzelek »

It's potentially a design problem basically - resources genration works in certain way since it needs to be deterministic. Since existence of resource depends directly on x/y coordinates of tile moving resources areound to avoid water is not feasible.
User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3715
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Water is generated last, overwriting essential resources

Post by DaveMcW »

The ultimate solution will be an algorithm that scans the map for a good start position, and moves the start position or re-rolls the map. Unfortunately it is a low priority.
Aru
Fast Inserter
Fast Inserter
Posts: 212
Joined: Wed Apr 13, 2016 11:31 pm
Contact:

Re: Water is generated last, overwriting essential resources

Post by Aru »

orzelek wrote:It's potentially a design problem basically - resources genration works in certain way since it needs to be deterministic. Since existence of resource depends directly on x/y coordinates of tile moving resources areound to avoid water is not feasible.
Unless you have some kind of hardware encryption key generator installed, it's difficult or impossible for anything a computer does to be anything but deterministic.
Post Reply

Return to “Not a bug”