Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Cascading Worldgen Lag #1715

Open
Zalnor opened this issue Sep 6, 2021 · 3 comments
Open

[BUG] Cascading Worldgen Lag #1715

Zalnor opened this issue Sep 6, 2021 · 3 comments
Labels
status: unverified type: bug Something isn't working

Comments

@Zalnor
Copy link

Zalnor commented Sep 6, 2021

Describe the bug
When Generating new chunks the mod can cause cascading worldgen lag. While if using the mod by itself its not big deal, but when using any sizeable mod pack it adds up a lot.

Versions
Forge: 1.12.2 - 14.23.5.2855
Magma: Magma 1.12.2 Version: vdd991e7-DEV
Modpack: https://www.technicpack.net/modpack/zelkyns-modded-mc.1878561

Setup
Magma on server side and forge on client side.

Steps To Reproduce
Explore to gen chunks or use chunk pregenerator.

Expected behavior
Not having cascading worldgen lag.

Additional context

For a clear explination of what cascading worldgen lag is and how to fix it read this post.
https://www.reddit.com/r/feedthebeast/comments/5x0twz/investigating_extreme_worldgen_lag/

@Zalnor Zalnor added status: unverified type: bug Something isn't working labels Sep 6, 2021
@warjort
Copy link
Contributor

warjort commented Sep 6, 2021

The reason for cascading world generation in GTCE is when an ore vein generates at the edge of a chunk at the side where the world isn't loaded. The ore vein being large will likely overflow into the neighbouring chunk and cause extra world gen.

You can reduce the chance of this happening with the following configuration option (turned off by default)
From config/gregtech.cfg

    # Whether veins should be generated in center of chunk. Default: false
    B:generateVeinsInCenterOfChunk=false

Actually, when Minecraft does world gen, it does it in 3x3 chunk "sections", and I believe this option puts it in the centre of one of those? Making it even less likely to cascade.

The rubber trees are hardwired to generate in the centre of a chunk.

@Zalnor
Copy link
Author

Zalnor commented Sep 6, 2021

This setting indeed did stop cascading worldgen lag caused by GTCE, but it remains that its not a proper fix to the issue and more of just a workaround. Should look into having a bigger offset most likely.

Edit: The mod still does cause cascading worldgen lag, its just very rare now it seems.

@warjort
Copy link
Contributor

warjort commented Sep 6, 2021

but it remains that its not a proper fix to the issue and more of just a workaround.

Its not a fix for anything.

You have the choice of

  • GT5 like world gen where the ore veins are at predicatable places: a grid of 24 +/- 48*n (x,z)
  • Or random world gen where the ores are less predicatble (the default).

The tradeoff for the random version is more resource intensive world gen.

Should look into having a bigger offset most likely.

I don't know what this means. Offset of what?

Minecraft is hardwired to perform most optimally if all worldgen confines itself to +/- 24 blocks of that grid I mentioned above.

In later versions of Minecraft it has an abstraction called a ConfiguredFeature that will ignore you if you try to generate more than 1 chunk away from the chunk where you are told to generate. Although this constraint can be easily bypassed if you really want to. :-)

A real fix to reduce resource usage for the random worldgen would be write some data in the save directory so it remembers when it needs to continue ore veins into a neighbouring chunk that is not yet loaded - instead of doing it immediately and forcing cascading chunk loading.
This is kind of what minecraft does for things like mineshafts, strongholds, nether fortresses, etc.
In the grand scheme of things, this actually uses more resources in total. But the usage is split up into more "bite size" chunks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: unverified type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants