Page 1 of 1
Construction bots lagging
Posted: Sun Jan 03, 2021 9:33 am
by jape3
With the latest game we've run into a problem with construction bots. The big map is basically covered with roboport grid and is a single robot network. About 30k idle construction bots at this time.
Last time playing I placed a few dozen solar panel / accumulator grid blueprints, inside the existing roboport grid. I had power poles and substations in buffer chests near the build area, and bots started to place those in quick succession. But the solar panels for some reason took a very long time to get started - basically it was something like 1-2 minutes before anything happened, but once it started there was a huge rush of bots into the provider chests to install the 2.4k solar panels currently available in storages.
So I'm wondering if the bot scheduler is limited to run only a certain number of tests per tick, and if that is the cause of the long delay before starting the project .. And how to migitate this problem in a future game?
Re: Construction bots lagging
Posted: Sun Jan 03, 2021 10:43 am
by Zavian
jape3 wrote: ↑Sun Jan 03, 2021 9:33 am
So I'm wondering if the bot scheduler is limited to run only a certain number of tests per tick, and if that is the cause of the long delay before starting the project .. And how to migitate this problem in a future game?
It is limited to only attempt to dispatch a few bots per tick. (I think it is one deconstruction order, one item construction and one tile/landfill). It is considered a performance optimisation, since there a people who place large blueprint and endup with 10000 ghosts without having the items available in stock. Checking 10000+ ghosts every tick would slow the game to a crawl. Even then the dispatcher seems to just allocate the first available robot, and doesn't seem to care about how far away it is, so if you have a large logistic network, then they might come from half way across the map.
Personal roboports have special code to search for nearby ghosts, so if you are building out of your inventory, then the delay is typically less than 1 second.
The normal mitigation is to not have one large logistic network.
Re: Construction bots lagging
Posted: Sun Jan 03, 2021 1:04 pm
by jape3
Zavian wrote: ↑Sun Jan 03, 2021 10:43 am
The normal mitigation is to not have one large logistic network.
Thanks for the input. What you write makes sense, since often times after placing a big build order and you walk over there after a bit the personal bots will still rush to place stuff.
Do you know if the task scheduler is ran once for each network, in which case having a separate network for the main base would indeed help and have the big expansion projects in a separate network for example?
Re: Construction bots lagging
Posted: Sun Jan 03, 2021 1:11 pm
by jodokus31
One time I had a huge lag. It was because of too much ghosts in a not roboport covered area.
Re: Construction bots lagging
Posted: Sun Jan 03, 2021 2:09 pm
by Zavian
jape3 wrote: ↑Sun Jan 03, 2021 1:04 pm
Do you know if the task scheduler is ran once for each network, in which case having a separate network for the main base would indeed help and have the big expansion projects in a separate network for example?
As far as I am aware, it is run once per tick.
In my opinion there are two advantages of separate networks. One is that travel distance, and hence bot travel time, is kept relatively short. That mean that when the dispatcher does allocate a job to a bot, the bot gets there in a few seconds rather than potential taking minutes to travers the map. Ghosts which don't have a bot assigned can be built by you personal bots.
Secondly if there are no construction bots in the local network, then your personal bots can build everything, which is often faster than waiting for the dispatcher to cycle through a large queue of ghosts. That also avoids the wait for a distant bot to travel halfway across the map to build something near you.
Personally most of my construction is done by my personal bots. Most games even my home base has no construction bots, just logistics bots to keep me supplied. My solar field will get construction bots and a resupply train. (Occasionally it is close enough that I can just connect it by roboport). Everything else will get built out of my inventory. (If I'm using mods, then I will typically add either construction drones or one of the mods that adds personal roboport to the player at the start of the game. So I often have construction bots even from the start of the game).
Re: Construction bots lagging
Posted: Mon Jan 18, 2021 5:34 pm
by jape3
As a closure to this, the problem indeed was the bot scheduler.. I had a few thousands of ghost blueprints due to lacking accumulators and that ground the scheduler to a halt. Bots are back to working snappy after fixing the supply issue.
On a related note, it would be helpful if the alarm message did show the true amount of missing components - not a value capped at 600.
Re: Construction bots lagging
Posted: Tue Jan 19, 2021 12:38 am
by Silari
jape3 wrote: ↑Mon Jan 18, 2021 5:34 pm
On a related note, it would be helpful if the alarm message did show the true amount of missing components - not a value capped at 600.
I don't think the game tracks those numbers at all - it'd take more time and memory. The only reason you get the 600 alerts is because that's handled by the alert system. Each failure adds an alert, 1 failure per tick, 60 ticks per second, each lasts for 10 seconds. That means it naturally gets to 600 before the oldest drops off and gets replaced.