Openapoc: Vehicle pathfinding returns wrong path, causes stuck vehicle

Created on 27 Apr 2019  路  1Comment  路  Source: OpenApoc/OpenApoc

I found this stuck vehicle while debugging https://github.com/OpenApoc/OpenApoc/issues/395 , so this may be related to destroyed tiles.

Savegame: The same one from https://github.com/OpenApoc/OpenApoc/issues/395#issuecomment-428932936
Also attached here: save_SuperHuman.1.zip

At the top left corner of the city, there's a Transtellar Spacelines spaceport. There's a construction vehicle stuck above it, oscillating between two tiles.

It's at (29,105,2) or (29,105,3) and is trying to go to (29,69,2):

W 116304142941 bool OpenApoc::CityView::handleMouseDown(OpenApoc::Event *): CLICKED VEHICLE Construction Vehicle 23 at {29.5,105.5,3.20833}
W 116304237372 bool OpenApoc::CityView::handleMouseDown(OpenApoc::Event *): Mission GotoLocation (rra:0) {29,69,2}
W 116304350828 bool OpenApoc::CityView::handleMouseDown(OpenApoc::Event *): Mission GotoBuilding (rra:0) BUILDING_WAREHOUSE_TWO

findShortestPath is being called with the correct parameters, but it's returning a path to (29,105,2) or (29,105,3), whichever was not the starting position.

I 301092281835 std::list<Vec3<int> > OpenApoc::TileMap::findShortestPath(Vec3<int>, Vec3<int>, Vec3<int>, int, const OpenApoc::CanEnterTileHelper &, bool, bool, bool, bool, float *, float): Trying to route from {29,105,2} to {29,69,2}
I 301093188364 std::list<Vec3<int> > OpenApoc::TileMap::findShortestPath(Vec3<int>, Vec3<int>, Vec3<int>, int, const OpenApoc::CanEnterTileHelper &, bool, bool, bool, bool, float *, float): No route from {29,105,2} to {29,69,2}-{30,70,3} found after 51 iterations, returning closest path {29,105,3}

At game time 10:31:13, it magically recovers:

I 1198330487133 std::list<Vec3<int> > OpenApoc::TileMap::findShortestPath(Vec3<int>, Vec3<int>, Vec3<int>, int, const OpenApoc::CanEnterTileHelper &, bool, bool, bool, bool, float *, float): Trying to route from {29,105,3} to {29,69,2}
I 1198331343798 std::list<Vec3<int> > OpenApoc::TileMap::findShortestPath(Vec3<int>, Vec3<int>, Vec3<int>, int, const OpenApoc::CanEnterTileHelper &, bool, bool, bool, bool, float *, float): No route from {29,105,3} to {29,69,2}-{30,70,3} found after 51 iterations, returning closest path {32,99,6}

There are no visible changes to the path in between. Some tiles at unrelated locations on the map are destroyed just before pathfinding recovers.

!BUG! HIGH PRIORITY Help Wanted MacOs Pathfinding UnitAI / Behaviour

Most helpful comment

Possibly also related to issues #484 #364 #339

Ethan has found another example of this bug, again with a construction vehicle but this time trying to use an occupied landing pad

Save is here
https://cdn.discordapp.com/attachments/376028757183561728/612037753013665806/save_Bug_Save.save

>All comments

Possibly also related to issues #484 #364 #339

Ethan has found another example of this bug, again with a construction vehicle but this time trying to use an occupied landing pad

Save is here
https://cdn.discordapp.com/attachments/376028757183561728/612037753013665806/save_Bug_Save.save

Was this page helpful?
0 / 5 - 0 ratings