Jump to content

[SOLVED] Dynamic Pathfinding/NavMesh


photo

Recommended Posts

Hi all,

 

during my implementation of custom NPC's and navigating them arount the world I ran in some trouble with my game idea. For my RPG/RTS-game the player have the ability to build various buildings, like walkable walls and towers. The building implementation is successfully done, but I have a problem to get the pathfinding work.

 

As far as I red, the Navigation with NavSector will be straight through it, and doesn't use any surfaces in count, in fact if I want to use the Player-class. So, for a walkable tower with stairs i have to use a NavMesh. Problem: There aren't any support to navigate between two navmeshes, which isn't very useful for e.g. connecting walls.

 

So my question is: Are anybody here who have used a successful navigation area for a complex scene (terrain, buidlings, walkable floors?) and are ready to share the knowledge with me?

 

@Unigine:

 

Are their any plans to implement the modifying of navmeshs dynamically during runtime? I have an idea to implement that on my own (using ObjectMeshDynamic to change the navmesh and load that into the current NavMesh). It would be great if Unigine can support them, because no engine I have used in past (Unreal,CryEngine) have that feature. And in my opinion it would be a great advantage for an game engine to support that feature instead of using a middleware product.

Link to comment

Christian,

 

Yes, NavigationMesh works with one mesh. But there's no problem with regenerating NavigationMesh in real-time. Just as you described, you can modify geometry via ObjectMeshDynamic, regenerate NavMesh and have pathfinding work for new environment. That's the pipeline we could suggest for your use case.

Link to comment

Thanks manguste,

 

but are their any thoughts about implementing that as a core feature for the engine? As I wrote above, it would be a great benefit for Unigine to support dynamic navigation meshes. No current top game engine, like Unreal, CryEngine or Unity have that feature and it wouldn't be hard to implement that with ObjectMeshDynamic.

Link to comment

Cristianwolf,

 

Ok, I got you point that you what to have it done under the hood. Our developers will surely take that as a suggestion, but I'm afraid not in the near future. For now, please use this more low-level approach.

Link to comment
  • 4 months later...

NavigationMesh will have setMesh()/getMesh() methods. You will able to pass a dynamic ObjectMesh into setMesh() function to update navigation topology:

ObjectMesh mesh = new ObjectMesh(NULL,1);
// create mesh geometry
// mesh.addEmptySurface(...)
// mesh.setVertex(...)
// mesh.setIndex(...)
navigation.setMesh(mesh);
delete mesh;
Link to comment
  • 3 weeks later...

To incremental geometry addition you can use the following approach:

getMesh(), append geometry, setMesh().

 

The new evaluation kit should contain C++ API for plugins.

So you can create a Recast plugin without problem.

Link to comment
×
×
  • Create New...