C# Port of Recast/Detour Navigation Mesh

Filed Under (Uncategorized) by sickadmin on 21-12-2012

I’m releasing Sick Kreations C# port of ‘Recast/Detour by Mikko Mononen’ and hope it helps others solve complex AI path finding.
Recast/Detour tool with End of Days:Survivor level loaded and the navigation mesh generated

Here’s is a link to Recast and Detour 1.21 by Mikko Mononen on his ‘Digesting Duck’ blog, here.
Here’s is the modified project we use to export the navigation mesh in a format compatible with Xbox360 Big Endian, Download.
Here is the files  to add to your game for run time loading and getting routes, Download.

To compile the Recast/Detour navigation mesh generation tool:
I downloaded C++ 2010 Express to build the Recast/Detour project, you can get it free from Microsoft.
After unzipping ‘Recast Detour Project’ you should find the solution file at ’..RecastDemo\Build\VC9\Recast.sln’.
You’ll probably have to set the include, source and library paths for your build.

In addition to that you’ll have to set ‘Additional Library Directories’ in the C++ Express environment to point to were you downloaded and unzipped the Recast/Detour files from  Mikko Mononen’s blog.


To load a navigation mesh in game:
dtStatNavMesh NavigationMesh = new dtStatNavMesh();
NavigationMesh.LoadNavigationMesh( AssetDirectory + NavigationMeshName + ”NavMeshXbox360″);

To get a route in game:
int NavMeshStart = 0;
int NavMeshCount = NavigationMesh.GetPath(ref Vector3 Start, ref Vector3 End, ushort[] routePolys, Vector3[] NavMeshRoute, true);

To walk through the route:
while (NavMeshStart < NavMeshCount)
{ Vector3 RouteNode = NavMeshRoute[NavMeshStart++]; }

My implementation of Recast/Detour was quick and dirty and there is room to optimize the code, the first place to look for optimizing would be the file DetourNode.cs’.

If I left out any files from the End Game Engine that are referenced please leave a commit and I’ll get those included asap.
Mikko Mononen stuff works flawlessly for our engine and we are grateful to him for sharing his navigation mesh code. All the original code is by Mikko Mononen and I have clearly marked my changes, please do the same with the code when you get it.


4 comments on “C# Port of Recast/Detour Navigation Mesh

  1. Ice man on said:

    I like end of days survivor the map is like the nuketown of this game but I mean we want to play more maps like a mansion, factory or so on what I am saying is u guys need too update the game fast before someone else takes your place I know you you guys have the potential to do this

    Gamertag: DEZENUTZZ69

  2. Gamer on said:

    I too would like to see a new map and more precision weapons, such as snipers(bolt action etc.).

  3. Reuben on said:

    i know i might be replying a little to late but if i wanted to use this port of recast on an XNA game running on pc, would i have to make any other changes?

  4. Zodiac5517 on said:

    I think their should be more bug fixes as well as some new maps to expand the End of days mythos.

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>