Page 1 of 1

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

Posted: Sun Mar 07, 2021 3:35 pm
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 3386 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 3386 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 3386 times

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

Posted: Sun Mar 07, 2021 6:59 pm
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 3325 times
factorio-run_2021-03-07_19-42-31.png
factorio-run_2021-03-07_19-42-31.png (258.53 KiB) Viewed 3325 times
factorio-run_2021-03-07_19-41-44.png
factorio-run_2021-03-07_19-41-44.png (257.78 KiB) Viewed 3325 times
factorio-run_2021-03-07_19-40-51.png
factorio-run_2021-03-07_19-40-51.png (258.01 KiB) Viewed 3325 times
factorio-run_2021-03-07_19-39-55.png
factorio-run_2021-03-07_19-39-55.png (260.15 KiB) Viewed 3325 times

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

Posted: Mon Mar 08, 2021 2:01 am
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%.

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

Posted: Mon Mar 08, 2021 10:25 am
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

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

Posted: Tue Mar 29, 2022 7:41 pm
by fienxjox
Any chance this could be considered for 1.2?

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

Posted: Wed Mar 30, 2022 6:47 pm
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?

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

Posted: Sun Sep 17, 2023 5:28 pm
by Atraps003
Will this be fixed in 2.0?