AgriCraft

AgriCraft

30M Downloads

Irrigation System cause lag.

marcin212 opened this issue ยท 4 comments

commented

Irrigation System cause lag because on each tick they cause a re-render of the whole chunk because of changes in the buffer. Rendering of tanks and channels should be split into two renderers. The wooden frames should be rendered as ISBRH and water as TESR.

commented

Can you clarify how big the lag gets by providing some numbers? Like, if I place X amounts of channels / valves / tanks my frame rate drops from Y to Z. Without numbers or a general idea of the impact its hard for me to classify the problem. Is it gamebreaking and needs urgent fixing asap? or is it playable for smaller systems and gets really worse for middle tier systems so we should fix it in the next 2 weeks? Or is the impact rather small and the fix more for good practice?

commented

As I play with @marcin212, greatest problem is when you create loop out of channels. It causes chunk update every tick causing more than noticeable shuttering, FPS count falls by +-80%. Multiple sprinklers, as they drain and update a bit rarer, cause lower performance decrease but on lower end machine it is hardly playable.

One possible solution would be to make water level rendering in channels and tanks discreet, 8 or 16 levels would be more than enough, and update chunk only when water level changes to different range.

commented

I will split it in a TESR and ISBRH, as well as create discrete levels. I have a very busy week ahead, so it'll probably be a while until I can do this.

commented