AgriCraft

AgriCraft

30M Downloads

FPS loss with planted seeds

Silvrus opened this issue ยท 38 comments

commented

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.

commented

What does CTD mean?

commented

Crash to Desktop

commented

Thanks @TehNut.

commented

@InfinityRaider This seems more up your alley...

commented

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 :)

commented

Is it just 10/10/10 crops?

commented

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.

commented

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?

commented

I'll test and let you know.

commented

I'll try to do some testing tonight or tomorrow and find out.

commented

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.

commented

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?

commented

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.

commented

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?

commented

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

commented

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.

commented

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.

commented

Here is a video showing the issue. http://streamable.com/jv89m

That is a 9x9 field of default (1/1/1) seeds.

commented

Wow that is quite major... It might take a fair bit of investigating...

commented

Oops... wrong button.

(I guess it is just a subconscious fear of the rendering code...)

(Why do we have to have rendering code?)

commented

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).

commented

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)

commented

With smooth lighting disabled, the issue still occurs as in the video.

commented

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.

commented

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.

commented

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

commented

This is a tricky one... I'd have to dive into @InfinityRaider's InfinityLib...

commented

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

commented

It might be in part due to memory churn from the TransformationMatrixes.

commented

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.

commented

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.

commented

So anything a regular guy like me can do to make it better?

commented

What version of forge are you on?

commented

Nothing better in the new a11 version. Still unplayable

commented

Forge 2239

commented

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...

commented

Fixed in 2.0.0a12. Was caused by faulty caching mechanism in InfinityLib.

commented

Any chance the fix could be implemented for 1.5.0? (it is the latest one that supports 1.7.10)