A* Pathfinding Project

[SOLVED] Path Failed: Computation Time 0,00 ms Searched nodes 0


#1

Having some weird issue with pathing,

Setup:
Terrain, A* game object, Behaviour Designer with movement + A* addition

“Mob” -> Capsule with simple behavior to see an object, and seek it when found

Detailed error:

Path Failed : Computation Time 0,00 ms Searched Nodes 0
Error: Couldn't find a node close to the end point
Path Number 8761 (unique id)
UnityEngine.Debug:LogWarning(Object)
AstarPath:LogPathResults(Path) (at Assets/AstarPathfindingProject/Core/AstarPath.cs:835)
AstarPath:<InitializePathProcessor>b__122_1(Path) (at Assets/AstarPathfindingProject/Core/AstarPath.cs:1297)
Pathfinding.PathProcessor:CalculatePathsThreaded(PathHandler) (at Assets/AstarPathfindingProject/Core/Misc/PathProcessor.cs:389)
Pathfinding.<>c__DisplayClass24_0:<.ctor>b__0() (at Assets/AstarPathfindingProject/Core/Misc/PathProcessor.cs:110)
System.Threading.ThreadHelper:ThreadStart()

What is the root of this i wonder?


#2

Hi

This page will be able to help you I think: https://arongranberg.com/astar/docs/errormessages.html


#3

Thanks for the link, however that does not seem to apply in my case (as far as my limited knowledge can attest),

The scenario is that the capsule (mob) is standing on top of a tiny little slope, and i have my character below the mob (down the slope, as it were), but no matter where i stand the capsule spams the same error message, it’s standing on the blue stuff (the generated navmesh?) and i’m also standing on it with the player. neither of us are particularily far from the blue stuff as our feet (or bottom of cylinder) are touching it.

Please advise?


#4

Another note, sometimes, if i move the capsule and then disable and re-enable it, it will spin an arbitrary ammount of times (within the triangle it stands in) trying to get to “me”, sometimes it just gives up and stops, sometimes it spins like a fidgetspinner forever. And now a third option appeared, if i try to move the capsule (mob) back a bit in the editor (still playing btw) then it will walk back to the place more or less where he got stuck the last time, persistant to stay there i can bob him back and he walks forward, like a persistant little mouse


#5

Could you share a picture of your graph, and agent settings?


#6

Sure, here we go:


#7



#8

And your graph in the scene view? In particular around the area where the agents are.


#9

Here they are, i would have sent one where the capsule is “looking” at the player but the moment it sees it right now, it runs a circle inside that triangle it stands in, then gets stuck where it is now, spamming the aforementioned error.

Screenshot_1


#10

Hi

Could you try removing Behaviour Designer for a moment and just attaching the AIDestinationSetter component to the same GameObject as the AIPath script.

Also. The “Height” field on the agent is very tiny. This doesn’t have any affect on pathfinding, but the Behaviour Designer might use it indirectly. It is best if it is set to a reasonable value.

For navmesh graph movement I also recommend that you attach the FunnelModifier script to the agents (see https://arongranberg.com/astar/docs/modifiers.php). Also I think you have set Seeker -> Start End Modifier -> Add Points to true. That is not useful for your use case so I would recommend turning it off to revert it to the default value.

Also. Make sure that the recast graph’s layer mask does not include the layer that the agents are in (seems to be the Default layer in this case).


#11

That was a tall order, will take a while to confirm/do all of this :slight_smile: Back in a bit!


#12

Allright, moved the capsule + player to different layers that are not in the layer mask inclusions, check
Unchecked the addpoints thing, check.
Changed the height of the mob to match aproximate height of capsule, check.

Still spams the same error,

Going to try with an AIDestinationSetter now.


#13

Disabled the Behavior Tree (Script), and added an AI Destination Setter (Script), added the player as the destination, and i get a green line to the player and this spams in the logs:

Path Completed : Computation Time 0,00 ms Searched Nodes 5 Path Length 4
Path Number 750 (unique id)
UnityEngine.Debug:Log(Object)
AstarPath:LogPathResults(Path) (at Assets/AstarPathfindingProject/Core/AstarPath.cs:837)
AstarPath:<InitializePathProcessor>b__122_1(Path) (at Assets/AstarPathfindingProject/Core/AstarPath.cs:1297)
Pathfinding.PathProcessor:CalculatePathsThreaded(PathHandler) (at Assets/AstarPathfindingProject/Core/Misc/PathProcessor.cs:389)
Pathfinding.<>c__DisplayClass24_0:<.ctor>b__0() (at Assets/AstarPathfindingProject/Core/Misc/PathProcessor.cs:110)
System.Threading.ThreadHelper:ThreadStart()

Also noteworthy, when i disabled the behavior tree it changed the spam from the OP lines to something that said there were nodes,

Also noteworthy, when i re-enabled the behavior tree, still having the AI Destination Setter on, then it actually walks to the player

I’m even more confused now than i was before

Without the AI Destination Setter it wont leave the “current triangle”, with it it will run after me untill ends meet.


#14

So in that case it seems that your behaviour tree is setting the destination of the agent so some weird position that it cannot reach. Try to figure out what it is doing.

The AIDestinationSetter will most likely override the destination that the behaviour tree sets. So you should remove it if you want to use the behaviour tree to set the destination.


#15

Thanks a bunch for all the help, the narrowing down really helped!

The solution was that even with the simplest behavior tree which was like so:

Screenshot_2

There was still stuff that wasn’t clear, such as the need to actually BIND the “Can See Object”'s “Returned Object” variable to a variable you’ve created of type gameobject in the Variables tab, and then use that variable (in this case, i named it Target), inside the “Seek” task and bind it to the internal “Target” variable, a bit messy and confusing for a beginner, but once that’s set then all works :slight_smile:

Thanks again for the help aron! probably would have been stuck for several days more on this if it wasn’t for your kind assistance in the problemsolving department!