[0.16.51] Construction Robots stop working in various areas

Things that has been reported already before.
Post Reply
LucidMoses
Inserter
Inserter
Posts: 33
Joined: Fri Dec 04, 2015 11:08 pm
Contact:

[0.16.51] Construction Robots stop working in various areas

Post by LucidMoses »

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
Example are showing construction not happening.
Example are showing construction not happening.
FactorioConstructionFailure.png (4.69 MiB) Viewed 4286 times
011th-Try13.zip
Example save with player at location that is not being completed.
(118.46 MiB) Downloaded 98 times


Zavian
Smart Inserter
Smart Inserter
Posts: 1641
Joined: Thu Mar 02, 2017 2:57 am
Contact:

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

Post by Zavian »

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.

LucidMoses
Inserter
Inserter
Posts: 33
Joined: Fri Dec 04, 2015 11:08 pm
Contact:

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

Post by LucidMoses »

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.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13171
Joined: Wed Jun 11, 2014 5:23 am
Contact:

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

Post by Rseding91 »

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 Discord.

LucidMoses
Inserter
Inserter
Posts: 33
Joined: Fri Dec 04, 2015 11:08 pm
Contact:

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

Post by LucidMoses »

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.

Zavian
Smart Inserter
Smart Inserter
Posts: 1641
Joined: Thu Mar 02, 2017 2:57 am
Contact:

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

Post by Zavian »

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).

LucidMoses
Inserter
Inserter
Posts: 33
Joined: Fri Dec 04, 2015 11:08 pm
Contact:

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

Post by LucidMoses »

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.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13171
Joined: Wed Jun 11, 2014 5:23 am
Contact:

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

Post by Rseding91 »

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 Discord.

LucidMoses
Inserter
Inserter
Posts: 33
Joined: Fri Dec 04, 2015 11:08 pm
Contact:

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

Post by LucidMoses »

Ok, but One network can still cover many chunks and presumably a logistics chest can be attached to zero networks.

maccs
Burner Inserter
Burner Inserter
Posts: 8
Joined: Sun Jan 29, 2017 11:40 am
Contact:

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

Post by maccs »

Could it be possible to connect the overlapping networks on placement of a new roboport? In the example of 35 ports, wouldn't that then be only 4500*1 checks, or instead of maximum 35 checks like now, it would have to only check once? Roboports are rarely moved, so wouldn't that optimize a lot?

(not sure if I understand enough of data structures to give real input, be gentle :D )

Post Reply

Return to “Duplicates”