View Issue Details

IDProjectCategoryView StatusLast Update
0004059The Dark ModAIpublic11.02.2024 00:59
Reportergrayman Assigned To 
PrioritynormalSeveritynormalReproducibilitysometimes
Status newResolutionopen 
Product VersionTDM 2.03 
Summary0004059: Investigate idAASLocal::WalkPathToGoal()
DescriptionWhy does pathfinding say an AI can't use a certain path when it's obvious the path is good?
Additional InformationWhile working on the problem of the Mandrasola lady stopping near the initial gate (0004044), I learned a little more about pathfinding.

At first glance, it looks like idAASLocal::WalkPathToGoal() isn't returning a) the optimum path between two points and is b) giving false negatives.

With the lady standing one AAS area from the gate's AAS area, the first attempt to find a walking route (idAASLocal::RouteToGoalArea()) from the lady's AAS area to the next path_corner was successful. However, I assume there's a bit of optimization going on, and the loop being used is looking for the optimal path. On the next time through the loop, the route being tested starts at the gate's AAS area. By this time, because the gate is marked "ai_should_not_handle", that AAS area has been put on a list of forbidden areas (AI can't walk through these). So the attempt to find a route to the goal fails, and the loop is immediately exited.

So even though the first attempt to find a route was successful, the failed second attempt doomed the effort and the lady was told there was no route for her to take. Thus she stopped.

If this is a loop to find an optimal path, why does it fail on the first failure? Why not continue looking for alternate routes? Why didn't the first successful route get returned to the lady? Why didn't the route-checking simply skip over the cluster exit that was forbidden, and keep on trying other routes?

Also, idAASLocal::WalkPathValid() returns true if there's a straight line from start to goal, but the code calling it acts as if this is a failure. If there's a straight line, why not use it?

Pathfinding exhibits odd behavior now and then when an AI wanders away from the path you'd think it would take, or uses the wrong door to enter a room when there are multiple doors. Perhaps a study of the questions posed above would shed some light on this bad behavior.
Tagspathfinding

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
23.01.2015 19:13 grayman New Issue
23.01.2015 19:16 grayman Additional Information Updated
11.02.2024 00:59 Fiver Tag Attached: pathfinding