RecastUnity is designed to take the headache out of working with NavMeshes. Easily used in Unity3D Basic, RecastUnity brings the power of Navigation Meshes to all users but does so in a way that also allows Unity3D to be used like a utility in addition to a game engine. With the built in Export features, RecastUnity takes the navigation data and stores it in an xml, json, or bson structure.
The complete source code for the Recast library is included. With it you can build a server with Photon, import your exported navigation data and have a working pathfinding system on your authoritative server. This also means if you use another engine for your game, the pathfinding code isn’t limited to just Unity.
Version 1.0.8 has been pushed for review.
Changes Include:
Initial Tile support added.
Fixed an issue when rebuilding that cause the Mesh to no longer be toggled on/off
Initial creation of NavMesh adds the vertexMat material
Fixed the Editor window crashing when selecting a tag with no geometry data
Added a progress bar for tile generation for visual feedback when building a mesh
NavMesh exports all tiles.
Key Features
Editors to quickly build navigation meshes.
Quickly modify height, size, and slope angles.
Debugging utilities within Unity3d.
Import and Export XML, JSon and BSon.
Source code for Recast, Detour and Crowd included.
Tile support added to make smaller Nav Meshes
Off-Mesh connections added to allow jumping.
Terrain support.
MultiThreaded support
Updates
1.0.8 - Terrain support and Multi-threaded NavMesh generation
Update 1.0.4 has been released on the Asset Store!
This update includes fixes for working with the Web Player and has been tested with Android. It also includes a few speed optimizations roughly cutting the NavMesh generation time in half.
Planned for 1.0.5 and beyond:
Tiled code
More gizmo controls
I’m working to see if I can speed up generation to be faster, but it will involve moving the data classes to structs and handling them appropriately.
I wanted to give a small update, I’m neck deep in the tile code and working to get tiling up and running so it can be used in my MMO tutorials. Below is a screen shot of one of the tiles. I have it building the contours correctly, but when it builds the detail poly mesh, verts are going missing. I hope to correct this issue soon and get this new version pushed up to the store. I have also corrected a couple small bugs, such as the editor window crashing when a tag has no geometry.
Pushed up 1.0.6 to be reviewed on the Asset Store.
Changes include:
1.0.6 - Updated Recast Source Package
1.0.5 - Tile Support
Initial Tile support added.
Fixed an issue when rebuilding that cause the Mesh to no longer be toggled on/off
Initial creation of NavMesh adds the vertexMat material
Fixed the Editor window crashing when selecting a tag with no geometry data
Added a progress bar for tile generation for visual feedback when building a mesh
NavMesh exports all tiles.
It is possible to generate it in game, but without knowing how big the scene is or what kind of settings you’d need, I couldn’t tell you how optimal it might be. The example level that Recast uses took 2-3 seconds because this is a C# conversion and isn’t as optimized as, say, his C++ code which can do pointer arithmetic. If you could pm some examples so I could get a feel for the scale, I could answer this better.
I don’t use multi-threading at this time, that could speed it up considering I do have tile support in the game and each tile generates independent of the others due to how the algorithm works. I haven’t heard of loom multi-threading. I’d have to take a look at it to see how easily it could integrate with the tile generation code.
Spent the day working on some new features for this plugin. Just submitted it to Unity for an update.
1.0.8 - Terrain support and Multi-threaded
Terrains are now supported. They are large and take time to export.
Added threading so building NavMeshes will take less time.
Dropped back to Unity 3.5 for older builds.
I just stumbled upon this product. The terrain support in the latest version looks especially awesome! I had a few questions:
Is there a size limit (technical or practical) for exporting terrain heightmaps?
Is it possible to somehow merge terrain and meshes into a final navigation mesh from Unity? Or would they need to be exported separately and combined after the fact?
Is there any support for modifying a navigation mesh at runtime? I’m interested in an online world scenario where I may instantiate a mesh collider for a building at runtime. I’m not sure if it’s possible to somehow only export what’s changed, since in that situation, the majority of the navmesh is the same as before.
Apologies if any of my questions have already been answered previously.
There are a couple of limits at the moment. if your navmesh ends up with more than 65535 verts, unity has a fit. there is a fix for it that I’m working on to make it create multiple meshes. otherwise its really a time limit with how long you want to wait.
If you mark each terrain with the same tag, they will all be used to try and generate a navmesh. I am using the tiled data, which recast tries to join up each tile so you can cross each of them. this is supposed to allow you to build multiple nav mesh sets and by adding them to the query and they will work together. This isn’t something that I have tested, but others on mikko’s forum have asked about it and mikko says it works.
As it is right now, you would determine which tiles the building covers and could do a rebuild of each tile, but figuring out which tiles to rebuild is a manual process at this time. Depending on the complexity of the building and the already existing data it will take some time to calculate, but if you build it in the background and replace it as soon as its ready, it should work. Just don’t remove the tile, then build the data, then plug the tile in, because anything on that tile will be stuck there until the new tile is ready and if something happens while building the tile, the units on that tile will be stuck.
Can I use Recast unity and c++ Recast & Detour with my server? Any modification recast source code?
Not use Photon.
Just Export Recast in unity → Import on my c++ server