Modifying recast for spherical surface

210 views
Skip to first unread message

Omega Skies

unread,
Sep 29, 2020, 12:34:01 AM9/29/20
to recastnavigation
I am looking to modify recast to work on my planets, and could use some help to be pointed in the right direction.

I am using ue4 source, modding in NavMesh, my planets aren't moving or rotating and always located at (0,0,0), I have already successfully modded character / pawn / movement classes / etc so those are of no concern here. Nav mesh doesn't need to cover an entire planet at once, nav will be dynamic and only needs to cover a very small area of a planet at one time.

Main problem: recast is Z- gravity only

I am trying to find all the info I can about recast to get a better understanding, from what I gather every component that has geo has an export geo function that basically passes the geo data to recast upon request, is this correct? Recast will then voxelize and filter the data, I assume this filter stage would be where to start modifying stuff? Or am I looking at all of this from the wrong direction? I NEED a spherical nav mesh solution and there doesn't seem to be anything out there!

Sergey Lapin

unread,
Sep 29, 2020, 1:43:45 AM9/29/20
to recastna...@googlegroups.com
I remember there was an idea in using projection of a set of 6 planes
into a sphere to use both voxels and navmesh for spherical case.
I think it was a GDC video about No Man's Sky but I could be wrong.
> --
>
> ---
> You received this message because you are subscribed to the Google Groups "recastnavigation" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to recastnavigati...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/recastnavigation/f77dda78-3c66-49dc-a032-ad72735f6895n%40googlegroups.com.

Mikko Mononen

unread,
Sep 29, 2020, 1:50:53 AM9/29/20
to recastna...@googlegroups.com
Building navmesh is one thing, but a spherical navmesh is 3D and many of the navmesh algorithms work essentially in 2D.

If you can live with having navmesh just around the player, and your planet is big enough that you can assume the area the navmesh covers to be "flat", then you can create local navmesh at important locations with specific transform, or rebuild it around the player they move. UE does not support transforming the navmesh, though.


--mikko

On Tue, Sep 29, 2020 at 7:34 AM Omega Skies <omegas...@gmail.com> wrote:
--

Omega Skies

unread,
Sep 29, 2020, 2:08:13 AM9/29/20
to recastnavigation
Yeah planets are decently large, and the max delta angle would probably be less than maybe 2% over the nav mesh at one time. That said if the AI runs far enough along a "straight" line they could potentially run around the entire planet... after several hours haha. Perhaps after the AI goes past a certain distance we clear all nav tiles and rebuild with a new up vector? Or would another other be to change the coordinate system to spherical or something else make more sense?

Mikko Mononen

unread,
Sep 29, 2020, 3:58:56 AM9/29/20
to recastna...@googlegroups.com
There's no simple way to get rid of the assumption that things are flat, and that there's only one up axis. Rebuilding with a new up axis is the most generic solution. If you have, say, towns or villages in your game, then you could have separate navmesh around each of those locations with specific up axis (assuming your characters don't wander too far from the location). This of course depends a lot on what type of AI you have. What type of AIs you're working on?


--mikko
 

Omega Skies

unread,
Sep 29, 2020, 4:47:31 PM9/29/20
to recastnavigation
Thank you so much for the help thus far, I can't express enough how much I appreciate it!


> What type of AIs you're working on?
Not sure what you mean by type here, but assume you mean ground or flying...? I have both but my only concern is for ground AI.

For changing the default up vector, do you have any idea which classes / functions I should look at? I tried rotating the input data into the export functions in RecastNavGenerator class and no luck. I still have a lot to learn about recast and nav gen in general though, still trying to get an understand how this stuff is working.

Mikko Mononen

unread,
Sep 30, 2020, 1:30:20 AM9/30/20
to recastna...@googlegroups.com
I was expecting ground AI, but I dont know what type of game you're working on and what type of things the AI needs to do.

You'll need to add transform for world to navmesh local as well as navmesh local to world. UE specific things are better handled via UDN.


--mikko


Reply all
Reply to author
Forward
0 new messages