Multi Mine

Multi Mine

16M Downloads

[Ruins] Possibly cascading world generation

keraldi opened this issue ยท 2 comments

commented

Could you please investigate this issue, I think your mod might be affected by it:

https://old.reddit.com/r/feedthebeast/comments/5x0twz/investigating_extreme_worldgen_lag/

The top comment of the thread suggests a system that could be used for large templates (bigger than a chunk) to prevent runaway chunks.

I.e. remember the block that the structure would be placed on, generate it once enough chunks are loaded to fit it in completely.

commented

Duplicate of #234

commented

Not all cascading worldgen is runaway worldgen. Ruins is guilty of the former, but isn't (generally) susceptible to the latter. While it's certainly possible to come up with pathological configuration settings or maliciously-designed templates to intentionally cause the mod to trigger runaway worldgen, any typical Ruins cascading is necessarily bounded by an imposed finite, rectangular footprint.

Granted, any cascading is slower than no cascading, even without runaway situations, but it only creates noticeable lag in the case of particularly large structures. Note deferring block placement doesn't address that at all...you're still populating multiple chunks at the same time, just later. The only real solution to avoiding cascade is by populating individual chunks on demand, one at a time. That's how vanilla Minecraft does it (and is essentially what Funwayguy describes in the aforementioned thread).

However, Ruins actually relies on cascading in order to provide some of the features it does, such as the ability to specify acceptable_target_blocks, the "settling" of structures into uneven terrain, and predictably configurable distance between instances. If it were to implement chunk-on-demand worldgen, it would become a very different mod with a very different feature set. I'm not saying that's a good or a bad thing, I'm just saying it would have a significant impact on the current user base.

I've experimented with ways to reduce lag spikes associated with large Ruins structure instantiation and technically eliminate (or--more accurately--hide) cascading. They all involve tradeoffs, though: loss of existing features, degraded performance in other respects, potential incompatibilities with other mods. The methods suggested in the OP thread aren't applicable to Ruins...not because they're too hard to implement, but because they either solve problems Ruins doesn't have (like runaway worldgen) or can't support things Ruins needs.

It's definitely a subject worth further investigation, and discussion among the Ruins user community, particularly template authors. It won't be a simple matter of rewriting a few pieces of code, however; it'll have fairly dramatic ramifications on how the mod behaves. At the very least, any changes along those lines will likely have to wait until well after Forge for 1.13 drops, since that's going to throw everything into the blender.

TL;DR--Cascading worldgen will continue to be an issue for the foreseeable future.