OTG + RC: Missing chunks in villages, "compatibility mode"
PG85 opened this issue ยท 4 comments
Hey Ivorius, I'm trying to hunt down a bug when using OTG + RC, for larger structures like villages chunks are missing so there's chunk-sized holes in villages (only the terrain is there, no structure).
I thought it might be a problem with things spawning in unloaded chunks, forcing those chunks to generate out of order. That doesn't seem to be the case though, looks like RC spawns things neatly within chunks that are already loaded or being populated.
The only other clue I have is a log message from RC: Chunk finished generating without Forge population being triggered (dimension 0). This is a bug with the dimension - please report this to the dimension's author. Recurrent Complex will proceed to generate in compatibility mode.
I took a quick look at GenerationSanityChecker.java but I don't understand exactly what it's checking for. I assume it should be possible to run RC without compatibility mode with a custom world gen? If so, what can I do to fix this? And could compatibility mode be the cause of the missing chunks in villages?
Thanks!
Has there been any progress on fixing this, by any chance...? OTG's Biome Bundle has finally updated to 1.12.2, yet this problem still persists and is causing a lot of headaches :(
Actually I've found the issue, will be fixed in the next release. The problem was that OTG detects cascading chunk population and in order to prevent further cascade as much as possible it does not spawn any of its resources (that are spawned in a 2x2 chunk area) in any chunks that have been "forcibly populated our of turn". These resources include villages and default structures though, and since RC doesn't replace villages but rather adds buildings to normal villages this meant that OTG wasn't placing villages in forcibly populated chunks, which means RC couldn't attach its village buildings either. For the next OTG release I've made it so that default structures are spawned in forcibly populated chunks, even though that may worsen lag spikes caused by cascading chunk population. OTG also allows other mods to spawn whatever they want in forcibly populated chunks btw, so this was never meant to be "cascading chunk population - proof", it was only meant to ensure that OTG itself doesn't cause cascading chunk population.
This does highlight an underlying problem though, apparently OTG villages + RC structures cause cascading chunk poputation. I still have to figure out whether this is a problem with OTG's villages only or if RC is really spawning things across chunk borders where it shouldn't be. All I know atm is that OTG village spawning without RC doesn't cause any cascading chunk population, that doesn't necessarily mean that all is good ofc. Big thanks to Ivorius for his advice with this problem btw, sorry it took so long to follow up.
As its primary structure generation time, ReC uses the PopulateChunkEvent.Pre event.
It's expected to be fired at the start of chunk population (e.g. ChunkGeneratorOverworld, via net.minecraftforge.event.ForgeEventFactory.onChunkPopulate(true, this, this.world, this.rand, x, z, flag);. If it is not being fired, ReC recognizes this and generates with a IWorldGenerator (in GenerationSanityChecker) instead - that way is not preferred though, so I call it compatibility mode.
So yeah, basically just start firing both PopulateChunkEvent.Pre and PopulateChunkEvent.Post :)
This is, however, unfortunately unrelated to the village generation problem. I've been told vanilla structures also sometimes have holes in them though. You might be able to extract some information from #197.
In general, all I can tell you there is if a chunk is generated, the village is expecting to be told so and wants to decorate itself with a generation bounding box of chunk.x + 8 -> chunk.x + 24, chunk.y + 8 -> chunk.y + 24.