Way to see what's slowing the game down exactly?

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Post Reply
NeiroAtopelCC
Burner Inserter
Burner Inserter
Posts: 9
Joined: Mon Sep 28, 2020 9:22 am
Contact:

Way to see what's slowing the game down exactly?

Post by NeiroAtopelCC »

Hi. I've got a game going that's been slowing down for a while - but after the last artillery upgrade it's almost stopped completely. The timing updates tell me that it's spending sometimes over 300.000 on path finder (means less than 1 fps) and around 90-110.000 on entity updates. But I can't see what is causing it. I checked a roboport, and I only had about 400 logistics bots and 800 construction bots doing work (out of half a mill of each). Logistics mostly move used uranium fuel and construction bots almost exclusively replace mines. Currently the path finder numbers are lower but I'm still sitting at 7-8fps.

I've attached my save (mega) and a screenshot (here) with numbers in case anyone can tell me what's my limitation.
The game never uses more than half my cpu or gpu resources according to task manager and hasn't risen above 8GB memory usage.

Specs:
Win 10 x64
i5-6600K at stock speed
16GB RAM
Geforce 1080
Running on nvme

https://mega.nz/file/Akh1TQoT#LQMyaeB-j ... 6rJNTKz_YU
numbers.png
numbers.png (817.16 KiB) Viewed 5495 times

Koub
Global Moderator
Global Moderator
Posts: 7199
Joined: Fri May 30, 2014 8:54 am
Contact:

Re: Way to see what's slowing the game down exactly?

Post by Koub »

The entity update is basically any device that does stuff. Inserters inserting, assembling machines assembling, chem plant ... chemplanting, ...
Your CPU will always seem to be "not doing much", because all CPUs are multicore today, and FActorio is mostly single threaded (there are some aspects that are multithreaded, but the main update loop is single threaded). And the limiting factor is usually more on the memory latency and bandwidth than anything else.

So you need : as fast a CPU as possible (in single threaded, with turbo), as fast as memory as possible (DDR4 3200 better than DDR4 2400 for example), and CPU cache is probably also a factor (the more cache the better).

And at some point, you'll still arrive at a point where you have built too much, and you'd need a supeercomputer to compute your update in less than 16ms.
Koub - Please consider English is not my native language.

NeiroAtopelCC
Burner Inserter
Burner Inserter
Posts: 9
Joined: Mon Sep 28, 2020 9:22 am
Contact:

Re: Way to see what's slowing the game down exactly?

Post by NeiroAtopelCC »

So basically you're saying cpu or ram just isn't fast enough?
There's nothing in game I can change to fix it?

ps. a supercomputer wouldn't fix it. 1) that wouldn't run windows and 2) a super compuer is basically a cluster of smaller systems - which means even more cpu cores at slower speeds.

As for single threaded - I've set task manager to show individual cores, and they're all equally balanced at about 45-55% utilization.

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5150
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: Way to see what's slowing the game down exactly?

Post by Klonan »

#1 Lots of biters

#2 Lots of everything else, belts, pipes, inserters, lots

Serenity
Smart Inserter
Smart Inserter
Posts: 1000
Joined: Fri Apr 15, 2016 6:16 am
Contact:

Re: Way to see what's slowing the game down exactly?

Post by Serenity »

NeiroAtopelCC wrote:
Mon Sep 28, 2020 11:47 am
There's nothing in game I can change to fix it?
It depends on how you build your base. There are certain things you can avoid doing at that scale. For example so many bots will of course slow things down. Especially when they are all in one network

NeiroAtopelCC
Burner Inserter
Burner Inserter
Posts: 9
Joined: Mon Sep 28, 2020 9:22 am
Contact:

Re: Way to see what's slowing the game down exactly?

Post by NeiroAtopelCC »

Serenity wrote:
Mon Sep 28, 2020 12:23 pm
NeiroAtopelCC wrote:
Mon Sep 28, 2020 11:47 am
There's nothing in game I can change to fix it?
It depends on how you build your base. There are certain things you can avoid doing at that scale. For example so many bots will of course slow things down. Especially when they are all in one network
I've spent a 2 hour teams call picking up about 100K drones - this has doubled my fps to 15-16. I find it odd that dormant unused drones take up CPU, but maybe they do ; or maybe something else happened in the game I haven't noticed.

SoShootMe
Filter Inserter
Filter Inserter
Posts: 476
Joined: Mon Aug 03, 2020 4:16 pm
Contact:

Re: Way to see what's slowing the game down exactly?

Post by SoShootMe »

NeiroAtopelCC wrote:
Mon Sep 28, 2020 11:47 am
As for single threaded - I've set task manager to show individual cores, and they're all equally balanced at about 45-55% utilization.
Individual cores view is usually pretty meaningless, apart from showing the number of cores. Each thread will typically be scheduled on different cores effectively at random, many times per second, meaning all cores show almost the same utilisation. This is true even for a thread that can (nearly) always run, like Factorio main update thread in your case.

NeiroAtopelCC
Burner Inserter
Burner Inserter
Posts: 9
Joined: Mon Sep 28, 2020 9:22 am
Contact:

Re: Way to see what's slowing the game down exactly?

Post by NeiroAtopelCC »

I've now reduced the number of robots to about 200k total. Will try to get it below 50k over time.
I've also removed the solar farms now I was at it. They weren't effective anymore anyway. I'm down to 4 seconds per ingame second - from 22 seconds per ingame second.

Edit: I've also disabled most of my buffers.

Serenity
Smart Inserter
Smart Inserter
Posts: 1000
Joined: Fri Apr 15, 2016 6:16 am
Contact:

Re: Way to see what's slowing the game down exactly?

Post by Serenity »

Solar is the best power generation you can have. It's just number of solar panels * power per panel.

Yoyobuae
Filter Inserter
Filter Inserter
Posts: 499
Joined: Fri Nov 04, 2016 11:04 pm
Contact:

Re: Way to see what's slowing the game down exactly?

Post by Yoyobuae »

NeiroAtopelCC wrote:
Mon Sep 28, 2020 3:36 pm
I've spent a 2 hour teams call picking up about 100K drones - this has doubled my fps to 15-16. I find it odd that dormant unused drones take up CPU, but maybe they do ; or maybe something else happened in the game I haven't noticed.
Unused bots don't do anything that takes up CPU. But when assigning new tasks to bots the game needs to figure out which bot is the best suited. The larger the amount of bots the more CPU is used up trying to pick a bot for each task.

The optimal case is when there are no unused bots ever. The game will then always pick a bot that's already in the air to do new tasks, which is much cheaper CPU-wise than choosing a bot which is inside a roboport.

NeiroAtopelCC
Burner Inserter
Burner Inserter
Posts: 9
Joined: Mon Sep 28, 2020 9:22 am
Contact:

Re: Way to see what's slowing the game down exactly?

Post by NeiroAtopelCC »

Yoyobuae wrote:
Tue Sep 29, 2020 5:45 pm
Unused bots don't do anything that takes up CPU. But when assigning new tasks to bots the game needs to figure out which bot is the best suited. The larger the amount of bots the more CPU is used up trying to pick a bot for each task.

The optimal case is when there are no unused bots ever. The game will then always pick a bot that's already in the air to do new tasks, which is much cheaper CPU-wise than choosing a bot which is inside a roboport.
That makes sense. I'm down to 11k construction bots (all busy with pavement at the moment) and about 130k logistics bots. It takes longer to remove those.
I'm currently removing 12k every time I pay attention to the game by having them move some items around and being janked out of the roboports when they've done so.

orzelek
Smart Inserter
Smart Inserter
Posts: 3911
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: Way to see what's slowing the game down exactly?

Post by orzelek »

NeiroAtopelCC wrote:
Tue Sep 29, 2020 6:41 pm
Yoyobuae wrote:
Tue Sep 29, 2020 5:45 pm
Unused bots don't do anything that takes up CPU. But when assigning new tasks to bots the game needs to figure out which bot is the best suited. The larger the amount of bots the more CPU is used up trying to pick a bot for each task.

The optimal case is when there are no unused bots ever. The game will then always pick a bot that's already in the air to do new tasks, which is much cheaper CPU-wise than choosing a bot which is inside a roboport.
That makes sense. I'm down to 11k construction bots (all busy with pavement at the moment) and about 130k logistics bots. It takes longer to remove those.
I'm currently removing 12k every time I pay attention to the game by having them move some items around and being janked out of the roboports when they've done so.
Simple recommendation for the future:
You can connect roboport to circuit network and read current amount of free bots. Based on that you can only add more bots to roboports when they run out.

You could try automatic removal of them in similar way - put a chest with inserted with wire from roboport near some heavily used location. When bots do their task they will land there and be removed to the chest. Limit it so that it leaves some free bots and stop removing then.

NeiroAtopelCC
Burner Inserter
Burner Inserter
Posts: 9
Joined: Mon Sep 28, 2020 9:22 am
Contact:

Re: Way to see what's slowing the game down exactly?

Post by NeiroAtopelCC »

Just a quick update. The super slowdowns happen when the arti range is upgraded. I'm at over 650K path finding numbers at the moment and the movement animation for the spidertron takes just under a second per frame. Not sure if the arti aiming or the creep reacting is the issue, but I suspect it'll take some hours before it's all caught up.

astroshak
Filter Inserter
Filter Inserter
Posts: 597
Joined: Thu May 10, 2018 9:59 am
Contact:

Re: Way to see what's slowing the game down exactly?

Post by astroshak »

Artillery Range increase can indeed lead to a lot of slowdown. Its not due to the artillery itself, but due to it shooting at (and angering) hordes of biters that want to have a frank discussion about your wonton destruction of their homes.

IMO its one tech that should not be unlimited, but instead have a limit on how far you can extend it. That, or have biters far enough away wonder “where’d that come from?” And not come a-calling.

NeiroAtopelCC
Burner Inserter
Burner Inserter
Posts: 9
Joined: Mon Sep 28, 2020 9:22 am
Contact:

Re: Way to see what's slowing the game down exactly?

Post by NeiroAtopelCC »

astroshak wrote:
Fri Oct 02, 2020 8:45 pm
Artillery Range increase can indeed lead to a lot of slowdown. Its not due to the artillery itself, but due to it shooting at (and angering) hordes of biters that want to have a frank discussion about your wonton destruction of their homes.

IMO its one tech that should not be unlimited, but instead have a limit on how far you can extend it. That, or have biters far enough away wonder “where’d that come from?” And not come a-calling.
Well it's not actually unlimited. It doubles in cost each time. The price is insane quite quickly.

User avatar
Khagan
Fast Inserter
Fast Inserter
Posts: 233
Joined: Mon Mar 25, 2019 9:40 pm
Contact:

Re: Way to see what's slowing the game down exactly?

Post by Khagan »

astroshak wrote:
Fri Oct 02, 2020 8:45 pm
your wonton destruction of their homes
A food fight to the death? :D ("The shrimp and egg wasn't very effective; load all barrels with pork and cabbage.")

NeiroAtopelCC
Burner Inserter
Burner Inserter
Posts: 9
Joined: Mon Sep 28, 2020 9:22 am
Contact:

Re: Way to see what's slowing the game down exactly?

Post by NeiroAtopelCC »

It's still going slow. In the last 11½ hours the ingame time has progressed slightly less than 10 minutes. It's a new record for me. It takes about 70 seconds per ingame second now. And this is after I've removed most of my buffers and reduced the number of bots to 900 logi and 8000 construction.

Qon
Smart Inserter
Smart Inserter
Posts: 2118
Joined: Thu Mar 17, 2016 6:27 am
Contact:

Re: Way to see what's slowing the game down exactly?

Post by Qon »

What's your ups if you use a command or mod to remove (not kill) all enemies? You don't have to save after running the commands if you care about not using console, just check how it affects your ups.

Have you considered not upgrading artillery range? Maybe you have enough already? Artillery is already good enough without upgrades if you use it them on your perimeter instead of 1 in the center ot your base...

NeiroAtopelCC
Burner Inserter
Burner Inserter
Posts: 9
Joined: Mon Sep 28, 2020 9:22 am
Contact:

Re: Way to see what's slowing the game down exactly?

Post by NeiroAtopelCC »

ups with natives : 1.1
ups without natives: 23.6
Couldn't find a way to remove biters without killing them, so used the command from the wiki.

As for arti - for me the whole point of playing past the first rocket is to get arti range up. The next step is 1G though, which will take forever.

User avatar
ickputzdirwech
Filter Inserter
Filter Inserter
Posts: 768
Joined: Sun May 07, 2017 10:16 am
Contact:

Re: Way to see what's slowing the game down exactly?

Post by ickputzdirwech »

How about less artillery turrets then? Since they have an insane range you will still reach everywhere eventually, but you will anger fewer biters at a time. This will spread out the lag.
Mods: Shortcuts for 1.1, ick's Sea Block, ick's vanilla tweaks
Tools: Atom language pack
Text quickly seems cold and unfriendly. Be careful how you write and interpret what others have written.
- A reminder for me and all who read what I write

Post Reply

Return to “Gameplay Help”