Dynamic Trees

Dynamic Trees

25M Downloads

FPS drop in forest while moving

VonZeeple opened this issue ยท 8 comments

commented

In dense forests i experience some frame rate drop while moving/turning the camera. The average FPS stays correct with large drops at certain frames.

Dynamic trees is the only mod enabled
FPS while still:
dt_still
FPS while moving the camera:
dt_moving

FPS while moving the camera (vanilla):
vanilla_moving
FPS while still (vanilla):
vanilla_still

commented

EDIT: can't reproduce the bug after messing with configs (?), so to be closed I guess...

commented

What options did you change?

commented

I changed the growth rate to 0, but i can't reproduce the bug turning it back to 1. Same with a fresh install.

Edit: it was changing the wrong parameter during previous tests. The problem disappear when the growth rate is set to 0.

commented

This makes sense then. It's not a bug. Growth takes cpu time and may affect frame rate. The growthrate could be adjust to any value between 0 and 1 to balance performance with growth speed.

commented

But why does the fps drops only when i'm moving? Would it be possible to smooth the framerate by dividing calculations on several frames?

commented

If you are turning the camera then minecraft will render chunks that were not in the viewport. Minecraft tries to save time by not rendering chunks that are not being looked at on the client.

It could be that the off-screen chunk's cached rendering gets invalidated when a tree grows in them because the blocks in the chunk are now different. This is normal. But since that chunk is off-screen it doesn't try to recreate the chunks cached mesh until you look at it. The rendering caching of the chunks is supposed to be handled on different threads so ideally it shouldn't be a problem.

When you set the growthrate to 0 then the trees don't grow. So the chunks aren't modified and hence are never graphically invalidated. So the chunks off of the viewport will still be the same when looked at again.

It's hard for me to test since I don't experience a frame drop like this. I also don't attempt to run at 90fps. Many things could affect this. View distance for instance. If the view distance is set high then it increases the amount of work exponentially that the client has to perform to render chunks that were previously off screen just a moment ago before you simply turned the camera.

Another thing could be additional players or nearby chunk loaders that would be causing the chunks to be ticking. Ticking chunks will make trees grow. These chunks may be too far away to logically tick with just your presence alone but are still within your rendering distance.

I don't know everything there is to know about how all of this works. I'm always seeking improvements. If there's anyone who knows more about the subject than I do who might have a magic bullet to improve this problem then I'm all ears.

commented

Thanks for you comment. The view distance was set on 8. I seems to be an optimization problem from Minecraft itself, so I tried to use Optifine. The frame smoothing feature, seems to solve this issue.

commented

Some enhancements were added to improve client side chunk rendering.