Page 1 of 1

FPS dropping with time

Posted: Tue Aug 19, 2014 7:12 pm
by micomico
The FPS in my factorio save has dropped a lot since the start. Of course, my factory is bigger than it ever was, which can explain it. Still, I think something might not be quite right. Whether it's something wrong from my part or from the game, I don't know, but I'm inclined to think it's an operator error. Maybe I'm building something terribly wrong.

I have 550 logistics robots hanging around and about 1000 construction robots, but those are stopped unless I'm building stuff. There's also the 7 trains moving around. The factory is not too big, from what I've seen in the wild. You can see pretty pictures of it.

Here's a screenshot with the debug info on, showing the paltry 30 FPS I'm getting in my save:

Image

On a new game and also for quite a while in my save, the game runs fixed at 60 FPS. The FPS drops were noticeable, like "The game is running slower, what's up debug screen? Dang, it's only running at 50 FPS!". Repeated for 40 and now 30 FPS.

If someone could see if indeed I'm breaking the game, the game is broken or if I should throw my computer out the window, I would be so pleased.

More technical info below.

Screenshot of new game with debug info:

Image
Linux x64
Intel i5 650 3.2GHz
Nvidia GT 220 1GB
12 GB RAM

Re: FPS dropping with time

Posted: Wed Aug 20, 2014 3:48 pm
by Rseding91
It's all the transport belts you're using. I don't know the belts bugged out or if you just have too many of them but removing all of them instantly fixes the FPS.


You can test it yourself by running this command from the in-game console:

Code: Select all

for _,v in pairs(game.findentitiesfiltered({area = {{-5000, -5000}, {5000, 5000}}, type = "transport-belt"})) do v.destroy() end

I'd definitely put this in bug reports and mention the above. See if you've just gone beyond the limits of the game's engine or if there's something bugging out in your save.

Re: FPS dropping with time

Posted: Wed Aug 20, 2014 5:11 pm
by micomico
Rseding91 wrote:It's all the transport belts you're using. I don't know the belts bugged out of if you just have too many of them but removing all of them instantly fixes the FPS.

8<

I'd definitely put this in bug reports and mention the above. See if you've just gone beyond the limits of the game's engine or if there's something bugging out in your save.
Thanks for taking the time to look into it. I "knew" it had to be something I did. I really like using the belts though, opposed to using robots to move everything.

I'll post a bug report with this info later today. Maybe some attentive and caring moderator moves the whole thread for me, it would be really nice.

Re: FPS dropping with time

Posted: Wed Aug 20, 2014 5:33 pm
by ssilk
Moved from technical help due to user request

Re: FPS dropping with time

Posted: Wed Aug 20, 2014 8:03 pm
by micomico
Thanks for moving the post.

With Rseding91 info in hand I set to try removing different items from the game, other than the transport belts. After a lot of loading and reloading save games, the items that made some change in the FPS were the following: (the numbers are FPS immediately after the command and a few minutes later. The FPS when loading the save was 33.)
  • 'transport-belt': 44 / 44
  • 'item-entity': 50 / 33
  • 'transport-belt' and 'item-entity': 58 / 58
  • 'inserter': 43 / 58
  • 'electric-pole': 33 / 38
The power screen shows 2.2k fast, 650 smart, 610 normal and 140 long inserters in my factory.

After a little chat with Rseding91 on IRC, I learned that my save also reduces FPS on a higher-spec computer and that at least one person has about the same amount of inserters without problems.

In other similar test, the previous command to remove the inserters was changed to only deactivate them ("v.destroy" replaced by "v.active = false"). The FPS increased in the same way as if they were destroyed.


EDIT: Added the results for removing all electric poles. This stops all the factory and items on belts after a while, but doesn't increase FPS significantly.

Re: FPS dropping with time

Posted: Thu Aug 21, 2014 6:02 am
by Rseding91
I took another look at it and I believe I found the root issue: over half of your inserters aren't going inactive when there's no work to do.

In this screenshot you can see my main base and the red circle on inactive entities (inserters): http://i.imgur.com/Zvpcxzx.jpg

This is your base in 2 of the heavy areas: http://i.imgur.com/ICOx43d.jpg and http://i.imgur.com/JjVItAJ.jpg

Note how almost all of those inserters are showing active when they shouldn't be.

Re: FPS dropping with time

Posted: Fri Aug 22, 2014 5:23 pm
by Kithoras
Did someone notice the incredible large amount of entites? Maybe ...

Re: FPS dropping with time

Posted: Fri Aug 22, 2014 5:54 pm
by micomico
Kithoras wrote:Did someone notice the incredible large amount of entites? Maybe ...
I went and look at it since you mentioned it and it seemed like a big number. Then I looked at Rseding91's screen...

Re: FPS dropping with time

Posted: Mon Aug 25, 2014 4:36 pm
by kovarex
Well, this map is certainly a good testing material for optimisation in the future.

I did a quick profiling and most of the time is taken by the usual combo of transport belts and inserters, they are just a lot of them (4102 basic belts, 2839 express belts, etc.)
Today we had a plan about the update of the roadmap, and I believe I could squeeze two very important optimisations of these two, that should make them run MUCH faster, but it is planned for 0.11.

But, it is not really a bug, so I'm moving it to not a bug, but I stored the save for the optimisations, so I can compare the speedups later on :)

Re: FPS dropping with time

Posted: Mon Aug 25, 2014 5:04 pm
by micomico
Thanks for taking the time to look at it. I guess I'll be waiting for 0.11 with anxious anticipation.

If you ever need an updated save for the optimization, I've managed to reduce 5 FPS more in that save since then.