FPS loss with planted seeds
Silvrus opened this issue ยท 38 comments
Agricraft 2.0.0-0.5.0-a6
Bred seeds to 10/10/10, then planted a 9x9 field and FPS tanked from 120 to ~30, with regular drops to 0-5 during visual growth ticks. Removing crops returned FPS to normal 120. No CTD.
Thanks @TehNut.
@InfinityRaider This seems more up your alley...
Can confirm, I've got massive fps loss with any 10/10/10 crops. Triple checked that it is indeed Agricraft crops causing issue. Thanks for the continued updates guys :)
Sorry, didn't see the notifications. I noticed some FPS hits while breeding, but it wasn't until I planted a field of 10/10/10 that it became unplayable. I first disabled the sprinkler thinking it was the particles, but it didn't help. When I broke that field the FPS went back to normal. I'm assuming it's something to do with the growth ticks, maybe that redraw thing I've heard about? There were a couple of other farms that weren't Agricraft, all within chunk boundaries with no machines or tanks, etc.
Thanks for looking into this! Agricraft is easily my favorite plant mod, I love the idea behind it and it's "cheaty" resource crops are very well balanced.
Huh... Perhaps at 10/10/10 the growth ticks get applied too frequently? Does the fps still go down if all the plants are fully grown?
Well the normal tps is 3 so, that's reasonable to lag a bit there... The fact that only the maxed plants cause the lag with normal tps is the interesting result here.
Could it be the lower tier plants have lower growth rate so not as many, (what is it, blockstate changes?) happening at the same time? Higher tier plants grow faster so more updates, exacerbated by anything speeding up crop growth?
Confirmed. New world, used the irrigated greenhouse farm (which didn't spawn any crops for some reason) and planted 2 5x5 fields of 10/10/10. During growth cycle game was highly lagged, once the crops were all grown the FPS returned to normal. Ran a profile while crops were growing, http://pastebin.com/NMVTXDce.
Just curious, I'd you use 1/1/1 crops and use the gamerule command to speed up the tick cycle, do you notice it as well?
Is that /gamerule randomTickSpeed ? What should I set it to?
Edit: A little research, set the /gamerule randomTickSpeed to 120. During 1/1/1 growth cycle game lagged, when mature game returned to normal. New profile: http://pastebin.com/RpFWjgk2
Low tiers with Actually Additions worms also cause this. Haven't tested with higher tiers but I imagine it would be worse.
EDIT: Rebooting the server appears to fix it somewhat. Again, no testing for high-tiers yet.
EDIT 2: Nevermind, had changed my tickrate. Anything greater than 0 makes the game unplayable. This is still with 1/1/1 crops.
I'm seeing very noticeable FPS issues with a 9x9 field of 1/1/1 plants. I'm not sure 10/10/10 is the only issue.
Confirmed that the FPS issues disappear when the Agricraft crops are gone. Either the sticks or the plant ticks are causing the issues.
Here is a video showing the issue. http://streamable.com/jv89m
That is a 9x9 field of default (1/1/1) seeds.
Oops... wrong button.
(I guess it is just a subconscious fear of the rendering code...)
(Why do we have to have rendering code?)
I also have the same issue. There's is a slight frame freeze when I place/break blocks in a chunk with agricraft crops.
Not really related but it seems memory keep increasing and ultimately cap when I play with agricraft crops nearby (need more testing thought).
Can someone try with smooth lighting disabled.
I do think that this will be the cause, because this has to be false (https://github.com/InfinityRaider/AgriCraft/blob/master/src/main/java/com/infinityraider/agricraft/renderers/blocks/RenderCrop.java#L113)
I have the same problem then Waisse (a10 Agricraft version) when using agricraft on a server. Block updates in a chunk with agricraft crops have a delay and client memory keeps increasing until it hits the cap (which only takes like 2minutes), only 1/1/1 wheat seeds planted.
I think the earlier mentioned FPS drops are just related to that memory leak, as soon as it hits the cap the FPS decrease a lot because the game can't keep up.
Interestingely it's only affecting the client memory. Server memory is still at normal usage.
I concur with Thyriel as I also have an issue with memory. It caps after a few minutes in game, causing game to lock, but only in a world with agricraft crops planted. And it is no longer an issue in a world when I remove them.
Any idea / ETA on a fix for this ? I'd really love to integrate agricraft into my modpack, but this bug makes it totally unuseable
This is a tricky one... I'd have to dive into @InfinityRaider's InfinityLib...
While it's no universal fix, the framerate issues disappear on my system when I set B:alwaysSetupTerrainOffThread=true in the forge config file. Just adding that in case it assists in narrowing down the source of the issue
I am experiencing this issue as well. I kind of freeze up every 5 or so seconds when crop sticks are in the area. It also freezes each time a block is broken. When crop sticks are pulled up, the freezes ceases to exist. Turning smooth lighting off has no effect on this issue.
I think that it is a memory churn issue. We implemented our own tessellation matrix and didn't use an object pool in the background, to the point that hundreds of double arrays are created and released every few seconds.
I don't know how to fix this... I would need the help of someone good at working with the MineCraft rendering system. Overcoming the memory churn is just too far beyond me...