Galacticraft: 1.7.10 Rocket Chunk Preloader causing Singleplayer to be impossible to be used due to huge Lag

Created on 18 Sep 2017  路  4Comments  路  Source: micdoodle8/Galacticraft

Minecraft version: 1.7.10
Galacticraft version: 502
Forge version: 1614

SinglePlayer (internal Server Side), No Addons, unless Galacticraft Planets counts.

So, I wanted to go to Space to test things, while working on Compatibility, but somehow it is not possible, because the Pregenerator ends up loading insane amounts of Chunks over time. I could understand if it loads maybe a 3x3 of chunks around the possible landing sites, but according to the Comments in the Code it's 1250 Chunks PER PLANET that is reachable.

The resulting Lag is gigantic to say the least, I need to wait 15 minutes to get my Rocket Launched (what is supposed to take 20 seconds), and I have a decent computer that never made any serious problems with any Minecraft Mods.

Another thing is even after 20 TPS have been re-established, I cannot shut down my Client because the internal Server doesn't want to shut down, or takes ages to do so (I was still waiting for it as I wrote this, but then I watched a video and afterwards it finally got me back to the main menu).

This kind of Lag is unacceptible and leads to World Corruption Issues, due to the World not being able to save properly whenever you get stuck in a Rocket (what happens with a 100% probability to me) and need to kill Minecraft using the Task Manager, since I don't want to wait an IRL Hour for Minecraft to finally be in a state where I can shut it down properly.

The only way I found out that something was randomly loading huge amounts of Chunks was when I used jvisualvm to look at what the cause of this deadly lag was, and saw the Function for loading chunks being called enough to make up 60% of the CPU load.

Seeing how it happens when I launch a Rocket, I looked into the Rocket Code and saw a Chunk Pregenerator that cannot be turned off via Config in it, which loads all the possible destinations, resulting in potentially huge amounts of Worlds being pregenerated at once, ofcourse I dont have any Planets apart from Moon, Mars and Asteroids but oh wait it probably also pregenerates the Overworld too, since it is a possible destination aswell, and preloading that World is probably not a good idea in Singleplayer, considering that Worldgen can be quite laggy down there.

You guys really need a better Solution for Loading Chunks, I even think just not preloading them at all is a better Solution than the current System, as seriously loading all possible destinations is way more laggy than just teleporting a Player into another Dimension, like the Nether Portals do.

The Preloading System is very likely also the reason people have to constantly relog on Servers whenever they are in a Rocket, because of the huge Lag while starting the Rocket and flying to Space.

A possible Solution would be having the Players decide where they wanna go BEFORE they launch the Rocket, that way they dont have to relog or restart their Client because of the Destination Menu not showing up at all.

This is a very huge Issue that should not be left ignored, and might even persisted in later Versions of Galacticraft.

not a Galacticraft issue

Most helpful comment

Okay I found the Issue and now I feel really stupid, could anyone close this Issue?

Reason being I did an optimization to a utility function that I used in my worldgen (along many other things), and I did not see anything when logging my worldgen itself as there was always a 1 tick delay between the loop causing function and the actual worldgen, and I did not notice that loop.

So every tick I generated more chunks than the tick before that tick, resulting in the whole thing slowing down gradually during the Rocket Launching sequence, as it triggered Overworld Generation code. And a whole bunch of coincedences did not cause my teleportation test to cause Overworld Worldgen...

Sorry for the false report. ^^"

All 4 comments

I just noticed that "every possible destination" also means "the place where you launch the Rocket from", meaning if you Launch from the Overworld, you will generate and load Overworld Chunks.

But not only that, even if you break the Rocket, it will not stop loading random Chunks for some reason, despite the pregenerator being inside the onUpdate method.

It is not possible to blame any Worldgen Mod on that, because I can teleport around generating new Chunks without any Lag Issues. Yet when I launch a Rocket this happens shortly after.

There really is serious Issues in your Pregen Code that need to be addressed, and honestly, you dont have to pregen anything and things would be fine.

Okay I found the Issue and now I feel really stupid, could anyone close this Issue?

Reason being I did an optimization to a utility function that I used in my worldgen (along many other things), and I did not see anything when logging my worldgen itself as there was always a 1 tick delay between the loop causing function and the actual worldgen, and I did not notice that loop.

So every tick I generated more chunks than the tick before that tick, resulting in the whole thing slowing down gradually during the Rocket Launching sequence, as it triggered Overworld Generation code. And a whole bunch of coincedences did not cause my teleportation test to cause Overworld Worldgen...

Sorry for the false report. ^^"

Galacticraft ... boldly testing mods where no other mod has tested them before :)

hahahahaha good one ;D

Was this page helpful?
0 / 5 - 0 ratings

Related issues

benten2000 picture benten2000  路  3Comments

SteveKunG picture SteveKunG  路  4Comments

Yeetimus picture Yeetimus  路  6Comments

lllMohandarlll picture lllMohandarlll  路  6Comments

Slasherss1 picture Slasherss1  路  4Comments