[1.1.100] Path finding find suboptimal path and entities don't follow their path

Post your bugs and problems so we can fix them.
Post Reply
mrvn
Smart Inserter
Smart Inserter
Posts: 5710
Joined: Mon Sep 05, 2016 9:10 am
Contact:

[1.1.100] Path finding find suboptimal path and entities don't follow their path

Post by mrvn »

I'm playing a big game with Space Exploration and Transport Drone mods. The transport drones use the biter AI to find paths along roards and to go to location. In some layouts of the road the tranport drones get stuck trying to drive off the road or turn around in a circle for no reason. So I looked at what the game plans for the drones to do and what they actually do by enabling "Show Paths" for "player":
bath-path.png
bath-path.png (2.14 MiB) Viewed 134 times
Here you can see two issues:

1) The blue path the game found is not the shortest path. It includes a not just pointless but actually harmful detour. This would indicate there is a bug in the A* implementation used for path finding. The path should follow the purple shortcut.

2) The drones don't actually follow the path the game found for them. While initially on the path they overshoot corners, turning too late and then they just drive parallel to the path. First they shouldn't overshoot but that might be a bad attempt at making the movement more fluid. Secondly they should steer back towards the path.

When following a path it looks bad if the entity always drives towards the next closest point in the path. This leads to always driving in 45° steps and make corners look unnatural. But driving towards the point 2 or 3 tiles ahead will smooth this out without letting the entity get too far off the path and without overshooting corners (it cuts corners a bit instead).


What you can't see is that a some points in the path the drones stop, drive in a tiny circle and then continue. Like they overshot a waypoint by a bit and need to return to it before they can go on.

Post Reply

Return to “Bug Reports”