Page 1 of 1

[togos][0.16.20] regenerate_decorative don't match autoplace

Posted: Wed Jan 31, 2018 3:16 pm
by Earendel
LuaSurface.regenerate_decorative() has unexpected results. The resulting decoratives are far more dense than the original autoplacement and appear in areas that would normally be out of their autoplacement range.

Here is the original placement from the chunk generion:
decoratives_original.jpg
decoratives_original.jpg (479.64 KiB) Viewed 3247 times
Here the decoratives have been (mostly) removed from the chunk by overwriting the tiles.
decoratives_cleared.jpg
decoratives_cleared.jpg (433.2 KiB) Viewed 3247 times
Here surface.regenerate_decorative() was called. The regenerated decoratives are far more dense than the original spawn, plus red and yellow grass is spawning even though this region should be too cold for red grass to spawn.
decoratives_replaced.jpg
decoratives_replaced.jpg (582.86 KiB) Viewed 3247 times
The behaviour I was expecting is a similar placement pattern as the original chunk generation, perhaps with slight differences caused by things like random_probability_penalty.

Is it possible to have the decoratives regenerated to approximate the original distribution?

Re: [0.16.20] regenerate_decorative does not match autoplace

Posted: Mon Feb 05, 2018 4:58 pm
by TOGoS
Looks like you've found a bug. Adding to the lookinto list.

Re: [togos][0.16.20] regenerate_decorative don't match autoplace

Posted: Tue Feb 06, 2018 5:54 pm
by posila
Possibly duplicate report: 56883

Re: [togos][0.16.20] regenerate_decorative don't match autoplace

Posted: Wed Feb 07, 2018 12:05 pm
by Earendel
In the other tread there's a question about the use case for regenerating entities.

My Alien Biomes mod adds a lot of new biomes to the map. Snow, volcanic, lunar, and various color variations of grass dirt and sand.
When the mod is added, or when mod setting such as biome size, or planet climate controls are changed, or if I modify the biome placement rules, then newly generated chunks won't line up with the existing terrain.

I added an option to 'Regenerate the Terrain', the idea being that all player entities are kept, but all the terrain under them gets wiped and generated again. (This does mean that some things might end up under water but that's fine.)

Most chunks I just delete and those regenerate just fine. To deal with chunks I can't delete, I generate a new surface with the same settings and read the tiles from those, applying those tiles to Nauvis. Most decoratives get removed when I write the tile, which if fine they're probably not supposed to be there anyway. When I go to call regenerate_decorative on that area the generated decoratives are completely different to those in the deleted and regenerated chunks. I wouldn't mind if things were in slightly different places, but the density is way higher and the wrong types appear, so right now having no decoratives in those areas is the better compromise.

I was thinking that the problem might be because the placement was largely driven by the terrain dimensions and less by noise layers - the thought being that writing the tile doesn't update the tile dimension information. After testing though, even if the tiles do have the right dimension settings (because those didn't change) the decoratives are still wrong.

On the subject of dimensions though, are those saved to the tile or generated again from the noise expressions whenever they are needed?

Re: [togos][0.16.20] regenerate_decorative don't match autoplace

Posted: Wed Feb 07, 2018 7:07 pm
by posila
Thanks for the report.
ToGoS fixed it for 0.16.23

Thanks for your input. I didn't post the question here too, because from your first post I understood you don't need regenerate_decoratives() to generate exactly same thing as initial map generator would generate, but it should be somewhat similar.