[0.16.51] Construction Robots stop working in various areas

Things that has been reported already before.

[0.16.51] Construction Robots stop working in various areas

Postby LucidMoses » Mon Jul 02, 2018 9:18 pm

What did you do? - I stamp blueprints setup robotports, drop off some constructions robots and required materials then walk off.
What happened? - The construction robots fly to the roboports and just stay there.
What did you expect to happen instead? It might be obvious to you, but do it anyway! I would expect the construction robots to finish doing the construction of the blue print plan. There should at least be some motion to start within a few minutes.
Attachments
FactorioConstructionFailure.png
Example are showing construction not happening.
FactorioConstructionFailure.png (4.69 MiB) Viewed 256 times
011th-Try13.zip
Example save with player at location that is not being completed.
(118.46 MiB) Downloaded 3 times
LucidMoses
Inserter
Inserter
 
Posts: 21
Joined: Fri Dec 04, 2015 11:08 pm

Re: [0.16.51] Construction Robots stop working in various areas

Postby Loewchen » Mon Jul 02, 2018 9:38 pm

Loewchen
Global Moderator
Global Moderator
 
Posts: 4445
Joined: Wed Jan 07, 2015 5:53 pm

Re: [0.16.51] Construction Robots stop working in various areas

Postby Zavian » Mon Jul 02, 2018 10:01 pm

The game only attempts to construct one ghost tile per tick. This is a performance optimisation to prevent the ups dropping when players place 1000s of ghosts at once. The problem is you have placed 100,000s of tiles worth of concrete or brick ghosts, some in areas with no roboport coverage. It will take the game many minutes to work through the queue of ghosts and get around to dispatching the robots to finish that solar array.
Zavian
Filter Inserter
Filter Inserter
 
Posts: 931
Joined: Thu Mar 02, 2017 2:57 am

Re: [0.16.51] Construction Robots stop working in various areas

Postby LucidMoses » Tue Jul 03, 2018 6:45 am

Zavian wrote:It will take the game many minutes to work through the queue of ghosts

Or many hours in this case. But two thoughts on this.
1) Is it necessary to even look at the ghosts that are not in roboport range?
2) The example is of a small area with only two roboports. Even if you want to limit for performance reasons wouldn't one ghost per network per tick be a better option. If not, Can you round-robon the networks so some of the tasks could be completed, even if it's going to be slow. Hours is too slow.
LucidMoses
Inserter
Inserter
 
Posts: 21
Joined: Fri Dec 04, 2015 11:08 pm

Re: [0.16.51] Construction Robots stop working in various areas

Postby Rseding91 » Tue Jul 03, 2018 11:27 am

LucidMoses wrote:1) Is it necessary to even look at the ghosts that are not in roboport range?


The game still has to do O(N*M) checks to find which ghosts are in what network range where where N is the number of ghosts and M is the number of roboports on the same force on the same surface.

So say you have 35 roboports in your logistic network (quite a small number in most saves) and you place a blueprint with 4500 entities. If the game went over each of them right then to decide what's in-network and what's not that's 4500 * 35 checks or 157,500 checks assuming all of them aren't in the network area. The game would halt while that runs for quite some time.

Instead it does 4500 * 0 checks or 0 checks when they're built and each tick the game checks 1 ghost to see if it's in network: 1 * 35 or 35 checks maximum assuming it isn't in the network area.
If you want to get ahold of me I'm almost always on IRC and Discord.
Rseding91
Factorio Staff
Factorio Staff
 
Posts: 7621
Joined: Wed Jun 11, 2014 5:23 am

Re: [0.16.51] Construction Robots stop working in various areas

Postby LucidMoses » Thu Jul 05, 2018 3:22 am

that is of course assuming your using a flat data structure. Given you have an employee dedicated to optimisation I would not have guessed that. Maybe they are busy working on trains and pipes. Maybe when they get a sec you can separate ghost items into InRange and OutsideRange link lists divided by some chunk size and get the processing time way down. Heck you would only have to check the InRange and OutsideRange of a few chunks while people walk around with personal roboports. Again, should be a huge improvement.
LucidMoses
Inserter
Inserter
 
Posts: 21
Joined: Fri Dec 04, 2015 11:08 pm

Re: [0.16.51] Construction Robots stop working in various areas

Postby Zavian » Thu Jul 05, 2018 4:04 am

LucidMoses wrote: Maybe when they get a sec you can separate ghost items into InRange and OutsideRange link lists divided by some chunk size and get the processing time way down.


Then you would need to walk the entire out of range list every time someone placed a roboport that expanded coverage. (Yes you could optimise that by having separate in range and out of range list for every chunk, but that would make the memory footprint of a chunk larger. Since factorio tends to be memory bandwidth limited, that probably isn't desirable. Also Rseding does a lot of the optimisation work).

However the current code is simple and performant. It only causes problems when someone places 10,000+ ghosts, (At 60 ups the current system will dispatch 10800 construction bots every 3 minutes, if there are enough bots and materials, and everything is in range).
Zavian
Filter Inserter
Filter Inserter
 
Posts: 931
Joined: Thu Mar 02, 2017 2:57 am

Re: [0.16.51] Construction Robots stop working in various areas

Postby LucidMoses » Fri Jul 06, 2018 3:04 am

You may have misunderstood what I suggested. It's exactly the point of "divided by some chunk size" is to stop doing anything with OutsideRange ones. If you already have a "chunk" defined that's fine. I wasn't referring to that. However, if the dev team thinks so it could be attached to it that's fine too.

Keep in mind it's a good principle in optimisation to push things to infrequent tasks (like placing or lifting a roboport) to save time during hi frequency tasks (tick processing). And don't forget, it's not just he ghosts. Logistics robots could also benefit from completely ignoring chests that are not in roboport range. Also, the link list processing can be pushed into separate threads. As it doesn't matter that much if OutsideRange items get processed for an extra tic or two. Heck your pointlessly processing all of them every tick. It may also not matter across multi player connections depending on how your syncing is done.

I'm not saying do it. Your optimising people will have more info and do a better job then this simple system.
LucidMoses
Inserter
Inserter
 
Posts: 21
Joined: Fri Dec 04, 2015 11:08 pm

Re: [0.16.51] Construction Robots stop working in various areas

Postby Rseding91 » Fri Jul 06, 2018 1:08 pm

FYI: logistic chests can only be in one network at a time so they simply link themselves into the network on creation meaning robots don't have to check them to see anything - they just know by it being in network A it's in network A. Ghosts can be in multiple networks depending on how many different networks/players overlap the ghost. Additionally players can move around causing the network to be out of area one tick and in the next.
If you want to get ahold of me I'm almost always on IRC and Discord.
Rseding91
Factorio Staff
Factorio Staff
 
Posts: 7621
Joined: Wed Jun 11, 2014 5:23 am

Re: [0.16.51] Construction Robots stop working in various areas

Postby LucidMoses » Sun Jul 08, 2018 1:34 am

Ok, but One network can still cover many chunks and presumably a logistics chest can be attached to zero networks.
LucidMoses
Inserter
Inserter
 
Posts: 21
Joined: Fri Dec 04, 2015 11:08 pm


Return to Duplicates

Who is online

Users browsing this forum: No registered users and 0 guests