AgriCraft

AgriCraft

30M Downloads

Performance issue with smooth lighting.

Loine opened this issue ยท 18 comments

commented

Hello,
I've been playing the new FTB Infinity Evolved wich uses Agricraft, really love it btw.
Now I've got some problems with performance while using this mod and the smooth lighting setting in Minecraft.
Here's an example: http://imgur.com/a/oR5OL
(I have 4 farms at 15x15 underground there, these should not cause lag because I've seen people make bigger ones with less lag)
The top screenshot is with smooth lighting off, the bottom one has it on maximum.
At the bottom of the screen you can see the frame time graph shows alot of spikes in the last screenshot.
This causes alot of choppy gameplay.
You can see i'm using Optifine but even without it, it's still causing alot of problems.

I've tried to update the Agricraft to the latest version but it just doesn't want to work.
If you need more information or testing please let me know.

Cheers.

commented

Thanks for reporting, I will have to look into what Smooth Lighting does because I have no idea what it is really.

Sidenote, the spikes in the graph, do they denote a peak of high fps or of low?

commented

The higher the spike is, the longer the game "freezes" for a short period of time to make it look like it's choppy.
So basically it shows how smooth the game runs, the lower the better.

commented

I see a lot of other machinery in those screenshots, and just to be sure its agricraft, can you fire up a text world and only build some farms to see what the impact is?
Also, this is only with crops right? Not involving tanks or seed storages or other custom wood blocks?

commented

I'll just leave the following link to my Reddit post here:
https://www.reddit.com/r/feedthebeast/comments/3w7ysh/ftb_infinity_evolved_gameplay_feels_super_choppy/

I hope this helps because everything I tested is in there and I'm 100% sure it's AgriCraft.
I even removed the crops from my world and suddenly it started working fine, planted the crops again and the choppiness was back.

commented

I went trough the crop Block and TileEntity classes and cleaned up some rogue markForUpdate() calls, this should cut back on lighting calculations, however a lot of those where outside the ticking flow. It'll have an improvement, but I don't think it will have solved the issue completely, I'm further looking into Vanilla code atm.

commented

Awesome, hope it helps.
If there's anything I can test to help with please let me know.

commented

I could compile a build, but it'll probably have some bugs

commented

Uploaded a beta build on CurseForge, can you check what it does performance wise?

commented

Thanks for the fast support.
I've tried it but it sadly didn't give me any improvements.
http://imgur.com/L0W6saZ (note: this is while standing still)
You can see the spikes are still there, half way I disabled the smooth lighting.
The super large spike is a 0.5sec freeze alot of people seem to have in the pack, not sure what is causing that.

commented

I did some more cleanup, but I have honestly no idea what is causing this. I thought it was maybe the way I do my TE syncing, but it's comparable/identical to what some other mods do.

commented

Can confirm smooth lighting destroys fps with agricraft crops. http://puu.sh/lRPoT/9f51f89b1c.jpg
100 fps with smooth lighting off, 6 fps with it on. Screenshot taken on ftb infinity evolved version 2.2.2 in a void world with a lot of agricraft crops, 2 mfr harvesters, a few fluxducts/enderchests/world anchor, not too many other things. fps consistently drops the more crops I add (with smooth lighting on)

commented

Okay, and out of curiosity, how does that do without smooth lighting?

commented

It's definitely improved now (like 80% less choppiness), but mostly only with the crops being mature.
While they are growing I feel like there's a 25% improvement on what it was before.

Here's a screenshot with the crops fully grown: http://imgur.com/SBJGkcw
This is while they're growing: http://imgur.com/OHaoyHg

commented

graph is indeed better, however overall FPS seems lower? And its normal that when they are growing that fps will be worse, everytime a plant grows the chunk's vertices are reloaed

commented

Just a bit, it's mostly between 45-90 FPs now.

commented

Okay, I figured out that Smooth lighting actually is ambient occlusion. Before I was using MC's code to render crop sticks, which takes AO into account. I've replaced it with my own now, I'll compile a build for you to test and see how this performs.

Downloadable once it is approved: http://minecraft.curseforge.com/projects/agricraft/files/2270525

commented

If that doesn't fix it, then all I can think of that causes it is the excessive amount of light calculations due to chunk updates when crops grow.

Either way, I'm going to keep it like this (if it fixes the performance issue or not), using MC's AO for crop sticks is just silly.

commented

Since the changes I did improved it a little bit and I am rounding up 1.7 I'm going to close this. In 1.8 rendering is multithreaded, so we'll see how it goes there. If it is really unbearable all I can say is disable smooth lighting, my apologies.