Layered Grid Graph - a Simple Tutorial Please

Hello -

Where can I go to see how to set up a layered grid map? There are several great tutorials on how to set up a single layered grid map, but I am having trouble finding anything that makes sense for a multi-layered grid map. I have been using the free version of A* for the last 3 weeks with much success, and have just recently purchased the pro version, mostly because the project I am doing needs the ability for AI capsules to travel to more than one level of an environment mostly created at runtime.

Hi

The layered grid graph is set up basically in the same way as a grid graph. Most options are the same. Could you elaborate on what problems you are running in to?

The game I am creating allows users to place down blocks to create buildings, and AI capsules can travel through them. I would like the ability to allow AI capsules to travel to higher levels above the ground level now. To do this, I have prefabbed some 45 degree blocks that users can instantiate which would act as stairs to get to higher levels. I know it’s possible to do something like this but haven’t really seen it in action yet… mostly just static pictures, so I didn’t know if there was a trick to setting this up.

I guess a few questions: what physics layer should the 45 degree “stair” blocks be placed in? Should higher level “floors” be placed in the “ground” physics layer? I realize trying to do this at run-time might be wishful thinking, A* has worked so well thus far and I would really like to start using more than the ground level. Thank you.

I should add that whenever I place the AI capsule target above the ground level, I get a Path Failed message… Error: Couldn’t find a close node to the end point.

Hi

If you are doing it during runtime you will need to recalculate the graph to make it take the new geometry into consideration. See http://arongranberg.com/astar/docs/graph-updates.php

Your stairs should be placed in the same layer as your ground.

If you get that error, try increasing the A* Inspector -> Settings -> Max Nearest Node Distance. If the closest node is too far away, it will not find a valid path.

PS: Sorry for the late answer, I have been away for a while and haven’t been able to answer many forum posts.