octarine-noise / BetterFoliage

Minecraft mod that alters the appearance of leaves & grass
MIT License
98 stars 42 forks source link

Frame time spikes and micro stuttering when placing or breaking blocks #240

Open Dimentive opened 5 years ago

Dimentive commented 5 years ago

Every time I place or break any block with Better Foliage installed, I experience large frame time spikes. My frame rate is fine, but my frame times are not. It appears as though the game freezes for a split second every time I place or break a block (micro stuttering), which is very noticeable and distracting.

Placing blocks in one chunk

Fresh install – placing blocks

I’ve tested this in the modpacks Enigmatica 2 and Enigmatica 2: Expert, with Better Foliage added (since neither pack has the mod).

This also happens in a completely new world. Disabling Better Foliage fixes this problem, so it’s clear that it’s caused by Better Foliage. The spikes still occur when the extra leaves, falling leaves, and more grass options are disabled. Maybe it’s because of the round logs? Or maybe it’s something technical that the mod does and not related to a specific visual feature of the mod. I’m not sure.

I’ve also tested this both with and without OptiFine installed. Same problem either way. I’ve tried fiddling with every graphics and performance setting in both vanilla Minecraft and in OptiFine but to no avail. I’ve also tried a bunch of performance-enhancing mods, but nothing has been able to remedy this problem aside from disabling Better Foliage itself.

The frame time spikes aren’t as bad if vanilla Minecraft’s smooth lighting is disabled, but they’re still there, and I can’t have smooth lighting disabled as it looks horrible. The spikes still happen with smooth lighting set to “Minimum” (I always use minimum smooth lighting anyway). The spikes are especially bad in areas with a lot of trees.

Versions

ShadowOfNights commented 5 years ago

I have the exact same problem. Its so annoying... Sry but I dont have any solution so far. Do you know any alternatives to the mod?

Dimentive commented 5 years ago

Sadly, there aren’t many mods like Better Foliage. Your best bet is either living with the micro-stuttering or simply not using Better Foliage at all. Since it’s purely a client-side mod that doesn’t interfere with gameplay, you can disable it in any modpack, even when playing multiplayer.

I do hope that this problem is addressed in a future update to the mod, though, as it’s difficult to live without a mod that makes the game look and feel so much better.

Dimentive commented 4 years ago

Will this be fixed?

octarine-noise commented 4 years ago

I kind of hope it already is, I just forgot to update this issue. I implemented some optimizations in BF 2.3.0 specifically for Round Logs, which I think are the culprit. Please test and see if things are better now.

If you are using Optifine F4 or newer, try BF 2.3.1

Dimentive commented 4 years ago

@octarine-noise I don’t use OptiFine anymore, but I’ll test 2.3.0 out. Is 2.3.1 specifically for OptiFine users?

octarine-noise commented 4 years ago

Not specifically, just an issue of version support. BF 2.3.1 is for Optifine F4 or newer, 2.3.0 is for older.

Dimentive commented 4 years ago

I’m still experiencing the same issues on version 2.3.0, sadly.

With Better Foliage enabled:

With Better Foliage

With Better Foliage disabled:

Without Better Foliage

What you’re seeing is the result of me continually placing and breaking the same block in the same place. I was in my main world but teleported to a random place, so I was in a completely empty are aside from randomly generated structures, and I had not chunk-loaded anything complicated.

OptiFine was not installed. When Better Foliage was enabled, all of its features were enabled, aside from falling leaves, which were disabled due to performance concerns.

With Better Foliage disabled, I still have frame spikes, which is normal in modded (and even in vanilla) Minecraft, but they are unnoticable, as indicated by the orange, as opposed to red, lines.

Whether or not Better Foliage is enabled, my frame rate is largely the same, give or take a few frames per second. Standing in the same area, without moving (still in the same area as when I did the tests above), my frame rate is 100–103 frames per second with Better Foliage enabled. If I disable Better Foliage, my frame rate becomes 102–109 fps, so not a big difference there. However, the real problem is these frame time spikes that I’ve showed you.

These frame time spikes cause micro-stuttering when placing or breaking blocks. They are slightly noticeable when in the wilderness and much more noticeable when at a base.

Mod list. While I do have a lot of mods installed, this does also happen in an unmodified instance of Enigmatica 2 or Enigmatica 2: Expert, as mentioned in the original issue.

Versions

PC specs

Dimentive commented 4 years ago

If I leave Better Foliage enabled but disable round logs specifically, it seems like it’s much better. I haven’t done any testing with it, but the round logs feature is almost certainly the cause of these issues, like you said. The performance optimizations didn’t seem to work, though—at least not for me.