High Amounts of Chunk Updating Leading to Diminishing Framerate in a Modpack
TheTrainwreck2010 opened this issue ยท 14 comments
Excuse me for the title. It is definitely a mouth full. I was attempting to add Yung's Better Caves 1.12.2-1.6.0 to a private modpack that I am creating and there are seemingly some performance issues when it is added. One thing I check for with an update is a creative mode flyover on a new game and a new world to check Framerate and TPS. Without Better Caves, my framerate is about 120-140 FPS while it can drop down to about 60-75 FPS when doing a 360 rotation before shooting back up to the higher values. With Better Caves, the higher values are still the same but the low values drop to about 28-56 FPS. Furthermore, there seem to be FPS dead spots were looking in a general direction or being underground in certain spots puts the game constantly at 28-47 FPS. I've ruled out compatibility by removing mods both halves of the pack and playtesting.
Here is something that does remain constant during these low frame issues: chunk updating. In a normal flyover, even with all the wacky terrain changing mods I have, Minecraft will update between 0-84 chunks. This will sometimes spike to the 140-160s and very rarely into the 180s for a second or two. Typically, this value is 32-65. And being still for a moment will bring it at 0-16. However, there aren't any reductions in frames from these instances. With Better Caves, chunk updating is on average higher. Rarely is will be somewhere around 6-30 but it will be on average 86-140. Standing still also seems to only reduce chunk updating to about 30-47, even for long periods of time. This doesn't exactly matter though since there seems to be no noticeable reduction in framerate in these instances anyway.
Where the issues are noticeable is that in these frame drops or deads spots the chunk updating will sit at 184-280 and stay there. This is when the game will begin to run and stay running at that low 28-56 FPS mark (typically at 28 or 36). Looking away from that area helps but I can't understand why. Using LagGoggles, I would go to these areas and ping it, but nothing was out of the ordinary compared to other areas. Furthermore, removing some other changes that I made in the update such as Quark or downgrading Tinker's Compendium yielded weirder results. This caused the higher end of the chunk updates to increase to about 340 chunks updating.
Removing more mods only got odder. Removing mods, the higher end chunk updating amount could increase to as high as 436. 436 chunks updating is a large amount especially for a new world and none of my investigations can lead me to the cause or solution.
Attached to this issue report will be a file containing the modpack I am working with, logs (without debug as to not tank performance further though I can provide debug if needed), and screenshots that were also taken during my research. A few more additions to detail:
Minecraft was run on Twitch with no additional arguments
~10,600 MB is dedicated to client
Important Client settings are render distance: standard 8, Mipmap: 0, Particles: Decreased, Clouds Fancy
If you need anything more, I can be sure to provide it.
https://drive.google.com/open?id=1O4WXMcGUPCFoLkwe-I-Z_hGiNezvxEum
i second this, i was doing some testing, and really cranked up the moving around, and eventually got to 2 fps average with 30% CPU usage. Totally needs to be the highest priority to fix this. The game is literally unplayable when you are in a cave for more than 5 minutes. Totally unacceptable.
note that my TPS is actually fine (15-20) and at this point i wasn't even moving around, it just kept lagging, also the chunk updates didn't affect the lag at all imo
also 10 gb for minecraft on any modpack is beyond overkill. allocate at most 8 for large packs and 6 for medium
I haven't pinpointed any sources for sure, but the lag is possibly due at least in part to two factors: lots of blocks being replaced with air/water/lava (which is obviously unavoidable), and the water/lava blocks being set to their moving counterparts by default.
In addition, noise generation takes some time, but shouldn't be the source of this issue since these calculations are only performed once on chunk generation, and related optimizations are being made for the next 1.12 release anyway.
In the meantime @MasterBuilder747, if you don't mind, please try replacing the lava and water blocks in the Better Caves settings with their stationary counterparts(I believe it's just minecraft:lava and minecraft:water) and see if this improves performance at all for you.
Edit: for all those reading this now, you no longer need to do this. The liquids are set to their stationary counterparts by default now.
I'm not sure if it has to do with this mod, but I do notice that if I stare in certain directions then my framerate tends to drop to 30 fps (I usually have it at 60 fps)
Someone on Discord reported that this only happens in certain areas, when using shaders. Turning off shaders reportedly improves FPS instantly. Installing Phoshor also helped them. Perhaps this is caused by some buggy lighting updates due to the large openings from caves?
EDIT: Looking at @MasterBuilder747's image may support this theory. That performance pie is getting absolutely grand-slammed by rendering.
Another update from the Discord user who reported the stuff regarding shaders:
"I used pure PureBDCraft resource pack. I also have the "Better leaves" addon that makes tree leaves more natural and less blocky. Well, when using Biomes o Plenty, that addon lags some new trees introduced on BOP
i noticed when i pointed to certain tree leaves server tick would be super high. I pointed somewhere else and it would be normal. I disable that addon and boom, problem gone!"
So for this user, at least, the problem was unrelated to Better Caves. I suspect that will also be the case for most users using Better Caves v2.0+, as the excessive chunk updating due to moving liquids is no longer a problem.
For those experiencing issues when using only Better Caves and shaders, try disabling your shaders or installing Phosphor. If that fixes the lag, it's probably a problem with the lighting engine.
For those using only Better Caves and experiencing this lag, please let me know! I personally have not been able to recreate it.
I believe this was due to the liquid block being set to moving counterparts. I can't think of what else would be the problem, since the issue pertains to chunks that have already been generated.
As of 1.12.2-2.0, moving blocks are never used for liquid placement by default. 2.0 also features some additional performance improvements that may help.
I'll leave the issue open in case it persists.
@TheTrainwreck2010 have you experienced this issue with the newer versions?
Once again - any issues related to reduced performance when looking in a certain direciton will not be the fault of Better Caves, unless you're simply generating new chunks. BC is strictly world generation, and as such will only incur a performance cost when generating new chunks.
As for memory usage when flying around - both Fabric and Forge 1.16 now have optimizations fixing excessive garbage collection. 1.12 has not yet received this fix.
When i using better caves in my modpack, i have 10-20 fps on Y:48, 80-120 on Y:5 when i looking down and 80-120 on Y:80+ when i looking up. I dont use shaders, i using phosphor, placebo, optifine, foamfix.