Flaw in Robot Traveling Logic

Things that has been reported already before.
Post Reply
Elias_
Manual Inserter
Manual Inserter
Posts: 2
Joined: Fri Sep 14, 2018 10:14 am
Contact:

Flaw in Robot Traveling Logic

Post by Elias_ »

Dear Factorio Development Team,

Before I start to explain what I have experienced I want to make clear that what I'm talking about is technically not a bug.
Nonetheless it is in my opinion unwanted behaviour in the game that can cause players (including myself) to have a bad experience.
I still find that 'Bug Reports' is the best place to share this in.


I have experienced a flaw in the robot traveling logic that is produced as follows:
- Build a horseshoe-shaped robotic network where both ends have a distance of at least more than two 'charged robot fligth distances' (the distance a robot can fly before it is discharged)
- Place the Player at one end of the horseshoe and let him logistic-request an item (say A)
- have item A in a chest at the other end of the horseshoe (and at no other location in the robotic network)

With this setup the robot(s) delivering the item will try to fly from one end of the horseshoe directly to the other.
When it is out of energy it will turn back to the roboport it started at.
This results in the robot(s) moving infinitely as the player stays in this position.


Here are some pictures of the situation:
Factorio_Robot_Issue.png
Factorio_Robot_Issue.png (476.97 KiB) Viewed 859 times
Factorio_Robot_Issue_2.png
Factorio_Robot_Issue_2.png (4.26 MiB) Viewed 859 times
The log and savefile are also attached.

Ideas for a solution:
From what i understand from my observations is that the robot traveling logic is as follows:
1> try to fly the direct way to the destination
2> if discharged {
3> fly to the nearest roboport
4> charge
5> goto step 1 }
6> finished

How this could be resolved:
Method 1:
1> try to fly the direct way to the destination
2> if discharged {
3> r = nearest roboport
4> if r was last roboport charged at {
5> continue flying the direct way until you find that the nearest roboport is not r anymore
6> charge at the new found nearest roboport
7> goto step 1 }
8> else {
9> fly to the nearest roboport
a> charge
b> goto step 1 }
c> }
d> finished

Method 2:
Build a weighted graph of all the roboports in a robotic network. (weight is the distance)
Find the shortest path from target to destination and let the robot fly along it.

These methods may be infeasible from a perspective of computationally complexity but maybe you can come up with something more clever.
I just wanted to share my thoughts on this.

I hope this is a problem to you as well and the answer is not just 'Well just connect the ends of the horseshoe'.

Greetings,
Elias_
Attachments
OtherWorld.zip
(20.91 MiB) Downloaded 47 times
factorio-current.log
(5.19 KiB) Downloaded 42 times
Factorio_Robot_Issue_2.png
Factorio_Robot_Issue_2.png (4.26 MiB) Viewed 862 times
factorio-current.log
(5.19 KiB) Downloaded 48 times
OtherWorld.zip
(20.91 MiB) Downloaded 48 times


Elias_
Manual Inserter
Manual Inserter
Posts: 2
Joined: Fri Sep 14, 2018 10:14 am
Contact:

Re: Flaw in Robot Traveling Logic

Post by Elias_ »

I didn't find it, when i was searching for this problem.
Sorry for that.
And :( that it is a design decision.

User avatar
5thHorseman
Smart Inserter
Smart Inserter
Posts: 1193
Joined: Fri Jun 10, 2016 11:21 pm
Contact:

Re: Flaw in Robot Traveling Logic

Post by 5thHorseman »

I support a warning when a bot has to return to the same roboport to recharge without having done anything (except flying) between recharges.

I do not support reworking bot logic to make up for poorly designed networks.

Post Reply

Return to “Duplicates”