Hello,
If I have seekers ranging from a radius of 1, to a radius of 5, do I have to create a separate layered grid graph for each unique size? I am noticing that my vehicle seekers are slightly overlapping tagged areas that should not be traversable for them, whilst the center of the vehicle is correctly moving along a traversable area.
How do I get the entire seeker, no matter how large, to stay in the traversable area? I did see some previous posts on this topic, but they are mostly 3+ years old. Was wondering if a new approach is now possible.
Hi
Take a look at this tutorial: https://arongranberg.com/astar/docs/multipleagenttypes.html
The easiest way is to create multiple graphs. For grid graphs there is also an option that allows you to use different tags for different agents (also mentioned on the page above). Using tags is less flexible, but it uses a lot less memory.
Note that all graphs in this package follow the principle that the traversable regions of the graph are where the center of the agent should be able to stand. So some other parts of the agent may be in regions that are not traversable, but since the graph has been generated to take that into account, they shouldnât clip obstacles or anything like that.
1 Like
Thank you for the response and link!
My only concern with this approach is that the tagged nodes from one graph might overlap tagged nodes from another. I did see in the example that the tile sizes haveât been changed from one graph to another though, so fingers crossed that this wonât be the case.
Couple questions about implementation:
-
Can I still update all graphs by saying: AstarPath.active.UpdateGraphs(guo)
, or do I need to call each graph separately?
-
How will adding another graph affect calls that donât mention which graph to query, such as: AstarPath.active.GetNearest(position, NNConstraint.None)
? Does it query all graphs and/or say which graph the node in the response is from?
-
Is there a way to duplicate a graph rather than adding a new one and copying all the settings over?
-
Since there is no character radius setting for layered grid graphs, like there is for raycast graphs in the example, I should be setting the Diameter in Collision testing instead, right?
-
Letâs say I have a vehicle seeker that has a width of 3, length of 11, and height of 4. What settings would you use for a rectangular shape like that?
-
Does the seeker have to have a Character Controller, or a box collider enough?
-
âSo some other parts of the agent may be in regions that are not traversableâ - I have already implemented a test round of adding a second graph, and the seeker still seems to be doing the same thing. Do I need to add colliders to both sides of the traversable path, in order to âpushâ the seeker completely inside the traversable area?
Wow, thank you for the detailed response! This really helps eliminate a lot of variables (and assumptions I had) in terms of debugging. Setting up a sample scene right now to help demonstrate the issue I am having, trying to get it to work.
Regarding #7, I wanted to clarify a bit more. I quoted the wrong part of the paragraph above. I should have quoted: âSo some other parts of the agent may be in regions that are not traversable, but since the graph has been generated to take that into account, they shouldnât clip obstacles or anything like that.â
Essentially, I think my part of my seeker might be outside the area tagged as traversable for them, because there are no obstacles on the sides of the traversable area, only tagged nodes that shouldnât be traversable for the seeker. Hence I am guessing that itâs not passing some collider test that would make it stay completely within the traversable area. Example scene should clarify everything shortly