Sudden problem appearing with walls - seekers no longer care that they're disallowed?

So I hit into an odd issue today. I have a random map generation script running, which generates maps with more obstacles/enemy spawners etc as the player progresses. However, it seems that the seekers suddenly stop caring about walls, or areas marked as out of bounds on the navmesh during gameplay.

Example here: https://www.youtube.com/watch?v=CQUT-IupgSI&feature=youtu.be

As you can see, the seekers exit a building, then start clinging to the wall - with a straight line being drawn from their pathfinding script, indicating that they’re not recognising the building at all. Following this then, they eventually get completely stuck within a no-bounds zone.

Any advice on how this could be solved? Seems to be appearing since I tried to run with ASTAR_FAST_NO_EXCEPTIONS - but even after disabling it and recompiling the scripts, it looks like it’s still happening.

The following error is also now being output whenever I hit Stop on the Unity editor:

NullReferenceException: Object reference not set to an instance of an object
    Pathfinding.AstarPathEditor.SerializeGraphs (Pathfinding.Serialization.SerializeSettings settings, System.UInt32& checksum) (at Assets/AstarPathfindingProject/Editor/AstarPathEditor.cs:1401)
    Pathfinding.AstarPathEditor.SerializeGraphs (System.UInt32& checksum) (at Assets/AstarPathfindingProject/Editor/AstarPathEditor.cs:1391)
    Pathfinding.AstarPathEditor.SerializeIfDataChanged () (at Assets/AstarPathfindingProject/Editor/AstarPathEditor.cs:1320)
    Pathfinding.AstarPathEditor.SaveGraphsAndUndo (EventType et, System.String eventCommand) (at Assets/AstarPathfindingProject/Editor/AstarPathEditor.cs:1371)
    Pathfinding.AstarPathEditor.OnDisable () (at Assets/AstarPathfindingProject/Editor/AstarPathEditor.cs:136)

Bump, anyone have any ideas on this?

It’s pretty much put development to a standstill… pathfinders who can’t recognise walls :frowning:

Hi

Have you been moving those agents around, perhaps using some pooling system or something like that?
What movement script are you using on those agents?

Just the very standard in-built scripts. Seeker, and AI Path. You can see in the video above that the path the seeker objects are drawing via gizmo are direct lines to their targets - it’s as though they’re not recognising the obstacles at all.

The only other script on it is a “Soldier” script, which receives target transforms, and sends them to AI Path. The SimpleSmoothModifier script is also attached (attempted to run with/without this enabled).

Inspector details attached;

Hm… I’m not sure why this is happening then… I haven’t seen something like that happen before.
It seems to happen immediately after you have created one of the blue agents. How are you creating those?

They’re being spawned in via prefab - exact same as the red agents, which are working as expected. They were working perfectly before I ticked the ASTAR_FAST_NO_EXCEPTIONS optimisation checkbox… but even after unticking it and allowing for a recompile, it’s still occurring.

I’ve done a complete delete/reimport of the A* assets… and it’s still completely broken.

It’s as if the agents just completely ignore all boundaries/obstacles in place, and head in a straight line for every target they’re given.

The only constant I’m seeing is the following error always being displayed after I click “stop” on the editor when it’s playing:

NullReferenceException: Object reference not set to an instance of an object
Pathfinding.AstarPathEditor.SerializeGraphs (Pathfinding.Serialization.SerializeSettings settings, System.UInt32& checksum) (at Assets/AstarPathfindingProject/Editor/AstarPathEditor.cs:1401)
Pathfinding.AstarPathEditor.SerializeGraphs (System.UInt32& checksum) (at Assets/AstarPathfindingProject/Editor/AstarPathEditor.cs:1391)
Pathfinding.AstarPathEditor.SerializeIfDataChanged () (at Assets/AstarPathfindingProject/Editor/AstarPathEditor.cs:1320)
Pathfinding.AstarPathEditor.SaveGraphsAndUndo (EventType et, System.String eventCommand) (at Assets/AstarPathfindingProject/Editor/AstarPathEditor.cs:1371)
Pathfinding.AstarPathEditor.OnDisable () (at Assets/AstarPathfindingProject/Editor/AstarPathEditor.cs:136)

Do you think it would be possible for you to share your project with me? It would help a great deal in debugging this.

Very sorry for the late reply to this - unfortunately my HDD gave a swansong over the weekend I posted this, and I’m only fully back up and running today.

So I did get this resolved - leaving this here incase anyone else has the same problem.

Firstly, I did a full delete/re-download/re-import of the asset, to ensure that all settings went back to their defaults. Following this then, I created a new navmesh instance in place of my old one - again, just to ensure the default settings were being used. Finally, I removed all non-essential scripts for pathfinding, including all smoothing components.

This resolved the issue - but as you can see from the above, I followed several steps that may not even have any relation to the fix. I hit them all at once.

If I run into this issue again at any point, I’ll run through the above in a step-by-step fashion, and try to pinpoint exactly what repaired it.

1 Like