[Klonan] Resource generation ignores frequence values less than 0.17 but works at higher values

Post Reply
fienxjox
Burner Inserter
Burner Inserter
Posts: 12
Joined: Mon Dec 18, 2017 6:17 pm
Contact:

[Klonan] Resource generation ignores frequence values less than 0.17 but works at higher values

Post by fienxjox »

When attempting to generate a surface with very low ores, you can set the richness parameter in map_gen_settings.autoplace_controls to arbitrary low numbers (such as 0.001) and the game handles them correctly (making lower and lower richness patches until they evaporate), however attempting to alter frequency to a value less than 0.17 (but higher than "none") and the game ignores the value and seems to use a floor of 0.17.

Steps to reproduce - first generate a map (recommend no biters for this test) and expand out to some size to get a view, grab screenshot manually of the map. Use minimum frequency settings for resources

Code: Select all

/c game.speed = 10
/c game.forces.player.chart(game.player.surface, {{x = -2000, y = -2000}, {x = 2000, y = 2000}})
then we generate a new surface with what should be 5% values

Code: Select all

/c local map_gen_settings = game.surfaces["nauvis"].map_gen_settings
map_gen_settings.autoplace_controls["coal"] = {frequency=.05,size=1,richness=.05}
map_gen_settings.autoplace_controls["copper-ore"] = {frequency=.05,size=1,richness=.05}
map_gen_settings.autoplace_controls["iron-ore"] = {frequency=.05,size=1,richness=.05}
map_gen_settings.autoplace_controls["stone"] = {frequency=.05,size=1,richness=.05}
map_gen_settings.autoplace_controls["uranium-ore"] = {frequency=.05,size=1,richness=.05}
game.create_surface( "RePainter", map_gen_settings )
game.player.teleport({0, 0},"RePainter")
Grab another screenshot and compare, you get the same results.

Map exchange string used in my test
>>>eNpjZGBkkGIAgtWrVtkxMByw52BJzk/MWb1KC8hjcACK2nMl5xcU
pBbp5helIgtzJheVpqTq5mdCFTdAFKfmpeZW6iYlFqcChewZwKDBniO
zKD8P3QTW4pL8PLgIyHLWkqLU1GKIRgjmLi1KzMsszYXpBTkT7FTG9Y
e69Bta5BhA+H89g8L//yAMZD0AmgbCDIwNYFMYgWIwwJqck5mWxsCg4
AjETmBFDIzVIuvcH1ZNsWeEqNFzgDI+QEUOJMFEPGEMPwecUiowhgmS
OcZg8BmJAbG0BGgFVBWHA4IBkWwBSTIy9r7duuD7sQN2jH9Wfrzkm5R
gz2joKvLug9E6O6A0O8gLTHBi1kwQ2AnzCgPMzAf2UKmb9oxnz4DAG3
tGVpAOERDhYAEkDngzMzAK8AFZC3qAhIIMA8xpdjBjRBwY08DgG8wnj
2GMy/bo/gAGhA3IcDkQcQJEgC2Eu4wRwnTod2B0kIfJSiKUAPUbMSC7
IQXhw5Mwaw8j2Y/mEMyIQPYHmoiKA5Zo4AJZmAInXjDDXQMMzwvsMJ7
DfAdGZhADpOoLUAzCgyRqiFEQWsABHNzMDAjwwZ5B+qaYCAAEq637<<
<
Starting map with sliders at 17%, as low as they go for resources
17pct.PNG
17pct.PNG (994.69 KiB) Viewed 3327 times
New surface with settings changed to 5% - note the frequency does not change but richness does
5pct.PNG
5pct.PNG (990.16 KiB) Viewed 3327 times
To show this is inconsistent, the logic does work if you go higher than 17% - here's a 300% using exactly the same code which does work
300pct.PNG
300pct.PNG (1.05 MiB) Viewed 3327 times

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

Re: Resource generation ignores frequence values less than 0.17 but works at higher values

Post by Klonan »

Thanks for the report,

Its fixed for the next release, some screenshots:
factorio-run_2021-03-07_19-43-59.png
factorio-run_2021-03-07_19-43-59.png (261.39 KiB) Viewed 3266 times
factorio-run_2021-03-07_19-42-31.png
factorio-run_2021-03-07_19-42-31.png (258.53 KiB) Viewed 3266 times
factorio-run_2021-03-07_19-41-44.png
factorio-run_2021-03-07_19-41-44.png (257.78 KiB) Viewed 3266 times
factorio-run_2021-03-07_19-40-51.png
factorio-run_2021-03-07_19-40-51.png (258.01 KiB) Viewed 3266 times
factorio-run_2021-03-07_19-39-55.png
factorio-run_2021-03-07_19-39-55.png (260.15 KiB) Viewed 3266 times

User avatar
NotRexButCaesar
Smart Inserter
Smart Inserter
Posts: 1120
Joined: Sun Feb 16, 2020 12:47 am
Contact:

Re: [Klonan] Resource generation ignores frequence values less than 0.17 but works at higher values

Post by NotRexButCaesar »

Wasn’t this a “not a bug” only a month or two ago? Or am I just imagining things? I would have bet that there was some developer somewhere saying that you weren’t supposed to set the values lower than 17%.
—Crevez, chiens, si vous n'étes pas contents!

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

Re: [Klonan] Resource generation ignores frequence values less than 0.17 but works at higher values

Post by Klonan »

Unfortunately I have to keep this bugfix for another day,
I thought changing it would not affect older save games, but it turns out it does, I was mistaken when I thought the noise programs were saved in the save games,
So the fix would result if broken resource patches on the edge of the map, as well as changing resources on currently known seeds.

So, for now I will put this in minor issues

fienxjox
Burner Inserter
Burner Inserter
Posts: 12
Joined: Mon Dec 18, 2017 6:17 pm
Contact:

Re: [Klonan] Resource generation ignores frequence values less than 0.17 but works at higher values

Post by fienxjox »

Any chance this could be considered for 1.2?

quyxkh
Smart Inserter
Smart Inserter
Posts: 1028
Joined: Sun May 08, 2016 9:01 am
Contact:

Re: [Klonan] Resource generation ignores frequence values less than 0.17 but works at higher values

Post by quyxkh »

But map seeds are saved. Couldn't this have been (and couldn't it still be) fixed by marking map seeds and having the code use the old noise for the unmarked ones?

Atraps003
Long Handed Inserter
Long Handed Inserter
Posts: 64
Joined: Thu Jan 04, 2018 6:34 am
Contact:

Re: [Klonan] Resource generation ignores frequence values less than 0.17 but works at higher values

Post by Atraps003 »

Will this be fixed in 2.0?

Post Reply

Return to “Assigned”