Non-standard Gravity


I’m currently working on a game that takes place in space, and thus, it also features non-standard gravity. In addition to that, the environments (ship interiors) are large and spaced out. Initially, I purchased the pro version to make use of Recast, but this was ineffective. I ran into some problems with walking on anything other than the floor, and the point graph was even worse.

The solution that I settled on was to sew hand-made navmeshes together to create the final mesh. At run-time, the meshes are placed appropriately in the world and then passed into the graph, and the actual pathfinding elements work wonderfully in the environment. I did have to write my own agent however, taking the gravity direction of the game into consideration when choosing the pathfinding source.

Nav Mesh Picture

Unfortunately I had a small oversight, in that dynamic objects aren’t supported with the standard nav mesh. I’ve found some stuff about the tile helper and using Recast with the navmesh, but it’s not really all that well documented, and I had issues with Recast before due to the non-standard gravity. Is there a way to do what I’m trying to do without writing my own dynamic object avoidance system?

Was really hoping somebody would be able to help :frowning:


I’m sorry to say that the recast graph will not work. The navmesh graph will work if you make custom navmeshes, but it will be hard to move on it since the funnel algorithm (which is basically required for nice movement on navmeshes) operates in XZ space (there are ways to solve that, but it’s far from trivial and requires changing the funnel algorithm a bit). Though you do say that you have your agents working, so if that works for you that’s ok I guess.

The navmesh cutting will never work on anything else than a 2.5D environment since it is based on boolean operations on polygons which are inherently 2D.

If your gravity is always along one of the world axes (so they always walk along for example the +X wall or along the +Z wall) then you could use multiple graphs which are rotated to get the right effect. Preferably grid graphs.