We want a very specific thing from A* and we ran into a lot of problems trying to achieve that. Because of the multi-level scenes with larger volumes we have to use the recast graph. What do we want – our enemies can crawl or walk (dismembered leg makes it a crawler) and we would like them to be able to squeeze in spaces walker cannot fit in. Walker could also decide that it would like to crawl through a lowered space rather than walk around. For that we need penalties and tags.
Right now we also have navmesh cuts for doors and other dynamic obstacles and that is where our problems begin. We know, that using navmesh cuts discards tag and penalty data we attributed to navmesh triangles during baking phase before the level kicks in.
Another problem is – even if we’ll manage to get through the issue with discarded triangle properties – that we have to get triangle generation under control to be able to use this approach. If we use some viable tile size, navmesh triangles are generated and marked with the crawler tag in a way that is not always very logical. Some of them run across perfectly walkable floors.
Semi-ideal solution would be having dual navmesh cuts run only during scan phase for us to be able to cut the navmesh in ways that are practical – that way we could use tags to manage if doors are open or closed. With dynamic obstacles, we could make some adjustments of the concept so we could live with the case where dynamic navmesh cuts are out of the question.
But I just provided you with the context, now let’s get to the actual question
Could you please help us with the fitting concept or approach to utilize Astar for this purpose?
And just to recapitulate:
- Generally, enemies need to be able to decide to go prone and crawl if the path through the lowered space is more viable to them.
- We need some way to pre-cut some places on navmesh to have triangles covering the areas precisely wehre we want them to, without losing the tag and/or penalty data. Performance of this taks is not a problem for us because all will be pre-baked.
- (Optional) We need navmesh under the dynamic obstacles like doors and oil barrels to be unwalkable.