- A* version: 5.3.1
- Unity version: 6000.0.32f1
So I’ve been using A* pathfinding for my team’s project for a short while now and I love it!
Well documented, easy to extend, easy to use. Except for one case.
We have pretty large scenes with many different types of small animals that use A* pathfinding for their movement. They are also quite spread out, so there are several graphs set up for all these animals. Now, I could do something like the procedural graph mover or have fewer, huge graphs that cover the bulk of the scene. The only problem with those solutions is that I also have several animals that crawl on walls so they can’t really reuse the same graphs as the land animals.
The animals on the walls are also spread out so we mostly have one animal per graph and since the editor is quite limited in what you can copy from existing graphs (I know about the duplication feature) it takes a bit of time with manually inputting the same values over and over.
Maybe there is a solution for this or we just have an obscure use case? Would love some thoughts on this!
Interesting use case! If animal’s sizes don’t play a major part in your project, maybe you could have a graph for “Floors” and a graph for “Walls” and have the agents that can traverse both have both enabled and only floors enabled for the non-wall crawling creatures? This would work well if they’re all about the same size or can usually all go through the same places. If there are different size classes, this could still work. At the very least that would cut down on using a graph per animal?
You may also want to look into setting up graphs at runtime- possibly this section about loading them from script? You could then keep graph information elsewhere in maybe a custom editor and then use this to create them when needed.
This could work if I my scenes were built from simpler geometry and I wanted larger coverage for the animals. The angles of the walls in one scene differ quite much and I still want to be able to constrain their movements quite heavily to certain areas.
I don’t really have a problem setting up all those small graphs correctly.
I guess my problem is more about the editor tools to create graphs that have consistent settings. If there existed some kind of template settings I could just drag into a new graph that would control all the values in ‘Input Filtering’ and ‘Rasterization’ I think my problem would be solved.
I would also recommend an editor script for this use case. It could, for example, loop through all graphs and set the same input filtering and rasterization options for all of them.
1 Like
Yeah, that was my idea if no one else had anything. Imma try to make an editor script
But speaking of making a solution like this, have you thought about implementing new functionality like this to the AStarPath inspector?
It would be really nice to be able to define presets like I mentioned above so I can easily redefine the settings a specific animal use later on. Because right now I would have to go into each scene, and edit each graph manually if I want to make modifications.
But maybe the demand for such features isn’t that big, and if so I understand completely
Hi
I don’t think there’s a lot of demand for this, I’m afraid. And it would be a lot of work to make a system flexible and intuitive enough to be widely useful.
That’s what I thought 
Then I better start looking into making some tools of my own.
Thanks for the answers!