Pathfinding is finding a path from somewhere to a destination.
Somewhere: where the robot sees “oh, my fuel is going below 20%”. Destination: the roboport, where the robot can recharge. That’s pathfinding, because it is an optimization algorithm.
Is there any solid reasoning behind why the robots aren't going for those charging stations.
Well, this made me thinking. I’ve made me the work to look a bit deeper into this subject, because I was a bit unsure, if all I already said was correct.
- robot pathfinder searches for a roboport, where distance multiplied by waiting queue is minimal.
I’ve looked into the wiki:
https://wiki.factorio.com/Logistic_network
Generally, a roboport can charge between 50 and 70 bots per min, 4 at a time, but are not very efficient at charging large queues of bots and can quickly become overworked.
When the charging-queue for the bots gets too long, the bots (and their loads) will slow down. Normally a robot flies to the nearest roboport to recharge. If the queue on that roboport is too long, they eventually choose another port. This is specified by the ratio of <distance to different roboport in tiles> / <queue size of robots waiting>.
So I was wrong. I thought it is a linear distribution (distance
minus waiting queue), but this non-linearity of 1/n is what you see: a roboport with distance of 100 and one robot waiting has the same weight as a roboport with distance 50 and two waiting or one in 25 tiles and 4 and so on, until 30 waiting robots, in distance of four. This is what you see: the robots tend to keep as near as possible to their current position.
- this explains why not all of your tight standing roboports (distance 4) are occupied but all of my wide standing roboports are used for charging (distance 50-200).
If the answer is to limit the throughput of robots, then I suggest doing it through gameplay means
Meanwhile I think this is a complex balanced mixture between minimal CPU-usage, a clever mechanism to let robots charge at other roboports, while avoiding long detours and the already mentioned bots vs. belts discussion. Koub has made a nice overview about That discussion:
viewtopic.php?p=513823#p513823
I’m not going to repeat that discussion here.
Some personal thoughts about this:
- from my experience I can say, that logistic robots are not good in handling a steady stream of many items reliably, because of charging. Items that where earlier ordered arrive later. This leads to “gaps” when you want to achieve a steady item-stream.
- all that can be done is: increase buffer-size and use multiple ways to transport items,
- which is for example, that you can add belts as a second transport, which reduces the loads for the robots, which are then able to handle sudden demands more rapidly. Or reduce the distance. Many possible solutions.
Robots are perfect to handle sudden requests with extremely (!) high throughput with a distance up to 100 tiles, but then they need time to recharge and rest in the roboports. I remember I’ve had no problems to load/unload a train station with a throughput of 40000-80000 items per minute. Trains come in, inserters unload wagons, robots bring it to requester/storage chests, robots recharge and go to sleep, 10 seconds are enough, until next train comes.
This works so much better, because a roboport has a limited capacity of parked robots: when there is nothing to do, the robots go into the roboports, but when the next roboport is full, the robot has no other choice than to go to another, eventually much more distant roboport and recharge there. In that case it’s a linear distribution.