Hi.
I’m having a bit of trouble utilizing a cached Recast Graph in my scene.
The scene is quite a large city with numerous active agents walking around in the area.
I’ve made a Recast Graph and when setting it to Scan on Awake all agents act normal and have (seemingly) no errors in their pathing.
However, when caching the graph (exact same graph) to be able to make the loading time of the scene faster, agents start acting oddly at certain positions in the graph.
Some might be following their designated path and then suddenly start making what seems to be corrections to their path, walking slightly to a side, for instance, before returning to their original path.
Also when walking around a fence they seem to be having problems following their designated path. On the edge of a fence (which they should have just been able to walk around) they will start walking back and forth within an area of maybe 3-4 tiles.
All of the above described hickups do not appear at all when not using the cached graph, and instead scanning on awake. Which I find weird, because it’s the exact same graph.
Also, when using a NavMeshCut-object somewhere in the scene, the graph will update correctly when I move the Cut-object, but only if the graph has not been cached on startup.
Do you have any idea of what may cause the issues with the agents and their paths?
Also, is it so that a NavMeshCut will not update the recast graph if the graph is cached?
Thanks!
One more thing:
When caching the graph, some agents also starts walking through certain walls and not following their calculated path at all.
Still, when scanning on awake rather than using cache startup they will behave perfectly.
Using the cache just seems to create a lot of incorrect behavior in terms of agents and their pathing.
Thanks again.
No known fixes for issues with paths being different when using cached startup?
When I started using the A* PF Project cache startup worked just fine. Still using the same version…
For reference, I made a testscene with a RecastGraph on a plane, and a Capsule AI agent. The agent starts in the bottom corner, and has its target object set to the top corner (see images).
Below are images from tests with Scan on Awake enabled, and Cached Startup enabled:
Normal (Scan on Awake):
Here you can see the path is correct, and the AI is moving/pathing correctly from the bottom corner to the top corner.
Cached Startup enabled:
Here, however, you see the AI is moving from the bottom corner, but thinking the target is in the RIGHT corner.
Also, the pathing lines/gizmos are not drawn correctly. All you can see of the pathing-gizmo is a tiny green line in the right corner of the plane.
Also, I’ve double checked that the actual target-object is still placed at the same position; in the TOP corner of the plane.
However, it seems that the Cache Startup has messed up bigtime, which leads to errors such as this.
Anything to add? Any ideas to what may be happening would be very much appreciated.
EDIT: I’m sorry, but the forum doesn’t seem to like the images I’ve added in. If you want to see them, copy the URL and open it in another tab/window.