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

This subforum contains all the issues which we already resolved.
Post Reply
User avatar
Earendel
Factorio Staff
Factorio Staff
Posts: 711
Joined: Sun Nov 23, 2014 11:57 am
Contact:

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

Post 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 3288 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 3288 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 3288 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?

TOGoS
Former Staff
Former Staff
Posts: 93
Joined: Fri Jun 24, 2016 2:29 pm
Contact:

Re: [0.16.20] regenerate_decorative does not match autoplace

Post by TOGoS »

Looks like you've found a bug. Adding to the lookinto list.

posila
Factorio Staff
Factorio Staff
Posts: 5201
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

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

Post by posila »

Possibly duplicate report: 56883

User avatar
Earendel
Factorio Staff
Factorio Staff
Posts: 711
Joined: Sun Nov 23, 2014 11:57 am
Contact:

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

Post 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?

posila
Factorio Staff
Factorio Staff
Posts: 5201
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

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

Post 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.

Post Reply

Return to “Resolved Problems and Bugs”