Volumetric graph & custom heuristic function for traversal

Hello!

I made volumetric graph:

Pictures:

And I need your help guys!

I want to use this A* project well for A* algorithm. (I have pro version)

I want to have ground units (sheeps), ground&wall&ceiling units (spiders) and air units (planes), and I need different heuristic functions for path finding.

I can make graph and connect graph and also make “GetNearest” function, but I don’t know where to start… What type of graph should I use? Point graph? Navmesh graph?

Also, I am sure I need to extend graph class… I need additional properties like type: air/solid and slope (ground/wall/ceiling). Is it possible to use extended graph class in heuristic search?

This is it…thanks!

Hi

Volumetric graphs are usually very slow to search because of the huge number of nodes, just so you know.
What do you mean by different heuristic functions?

Hello aron! Thanks for reply!

I do realize it can be slow, I hope I didn’t made a mistake. I got a bit horrified when I saw function “FloodFill”. I sincerely hope it’s not a game killer. But this is octree structure, so it’s detailed only on meshes, on air it’s quite sparse.

By different/custom heuristic function I meant anonymous function, which can be passed into path processor. Later I realized I actually meant custom NNConstraint, so I can choose where path is searched - ground, air, wall etc. I solved this with tags so this problem is solved.

Anyway, I did a bit of progress, I am reading documentation for three days already. I will extend NavGraph.

P.S: Raycasting whole volume takes 200ms currently, other unoptimized things (air flood, wall construction etc take around 5 seconds)

Hello Aron, there I posted progress about this, it’s almost working! (it’s slow though, 25-100ms to compute). I think I will need to split this combined graph to air and ground/wall only.

https://facepunch.com/showthread.php?t=1521880&p=50538960&viewfull=1#post50538960

I just have one problem: Path searching is not always optimal. At posted link, there are two pictures with two idential A/B points, just reversed search. How can I fix this?

Aaron, it’s ok, I fixed it. I didn’t knew I needed to calculate costs and also I needed to set Heuristic multiplier/scale to 0.01. It scans a lot of area - it’s slower, but it’s optimal. We have multiple CPU cores on PC so who cares :).