Idea for crop growth rendering
Robijnvogel opened this issue · 1 comments
About this config option:
rendering {
# When rendering crops, the default (false) is that the plants will only be re-rendered whenever the chunk updates, this basically means that whenever a crop grows it causes the chunk containing the plant to re-rendered.
# For small farms this is the suggested approach, however for large farms, it is possible that a crop grows almost every tick, resulting in re-rendering the chunk every tick, possibly causing huge FPS drops.
# When setting this to true, there will no longer be chunk updates when a crop grows, but the rendering will be different: The plant will be rendered every tick (the sticks itself will still be rendered the default way), for small farms this is a bad approach,for large farms as well, but it might result in better FPS compared to the default.
# I recommend leaving this on false, if you have FPS problems, set this to true and see for yourself if it is an improvement or not.
# This config setting must match on server and client, the server should know if it should cause block updates and the client has to know how to render the crops [default: false]
B:"Crop rendering setting"=false
}
Would it be possible to let the server detect on its own, whether plants in the rendering range of a player are growing more than once per tick on average?
I'd say this could be tracked by a Map with some unique player ID as Key and a List of Pairs of block coördinates and an integer depicting how many ticks ago the block on said coordinates was updated, as Value.
To track 30 ticks:
If a plant grows, it registers its coordinates to the list with the integer having 30 as initial value. If the coordinates are already in the list, it resets the integer to 30.
Every tick:
-the integer values decrease by one.
-if the integer gets lower than 1, the entry gets removed from the list.
-if the List gets longer than 30 entries, this switches the mode to "plant-render mode"
-if the List gets shorter than 31 entries, this switches the mode to "chunk-update mode"
(Per player, keep a List of coördinates of plants that have updated in the last 30 ticks and switch modes (inform the client renderer as well) if the list gets longer than 30 entries or gets shorter than 30 entries)
Possibly based on chunkloading ticket, so two players' clients that are connected to the same server are not necessarily forced to the same rendering mode.
If two Players' rendering areas are overlapping, they should be forced in the same rendering mode though.
If you can't or won't implement this, then could I know why?