Search Unity

[Released] RecastUnity: Recast for Unity in C#

Discussion in 'Assets and Asset Store' started by CJR-Gaming, May 30, 2013.

  1. CJR-Gaming

    CJR-Gaming

    Joined:
    Oct 12, 2012
    Posts:
    63


    Overview

    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
    • 1.0.7 - Off-Mesh Connections and Tile Fixes
    • 1.0.6 - Updated Recast Source Package
    • 1.0.5 - Tile Support
    • 1.0.4 - Speed optimizations and WebPlayer fixes
    • 1.0.3 - Initial Release
    Tutorials

    Written
    Video
    Video Tutorials are being prepared.​
     
    Last edited: Dec 22, 2013
  2. CJR-Gaming

    CJR-Gaming

    Joined:
    Oct 12, 2012
    Posts:
    63
    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.
     
  3. CJR-Gaming

    CJR-Gaming

    Joined:
    Oct 12, 2012
    Posts:
    63
    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.

     
  4. CJR-Gaming

    CJR-Gaming

    Joined:
    Oct 12, 2012
    Posts:
    63
    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.
     
  5. CJR-Gaming

    CJR-Gaming

    Joined:
    Oct 12, 2012
    Posts:
    63
    UnityRecast v 1.0.6 is now approved and available in the asset store.
     
  6. CJR-Gaming

    CJR-Gaming

    Joined:
    Oct 12, 2012
    Posts:
    63
    Pushed up 1.0.7 to be reviewed on the Asset Store.

    Changes include:
    • Off-Mesh Connections
    • NavMeshQuery fix when querying across tiles.

    Moving on to 1.0.8 we are looking at better support with the Unity conversion of Json.NET and temporary obstacle support.
     
  7. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    I don't know much about Recast until I saw your posting. I checked out a few links on Recast and it does look amazing.

    Question: Can the navigation mesh be generated in-game. My levels are all procedurally created.

    Cheers.
     
  8. CJR-Gaming

    CJR-Gaming

    Joined:
    Oct 12, 2012
    Posts:
    63
    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.
     
  9. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    The levels could get pretty big because it's the users who are generating in-game.

    Are you using multi-threading ? or could something like Loom multi-threading (on Asset store) be used ?
     
  10. CJR-Gaming

    CJR-Gaming

    Joined:
    Oct 12, 2012
    Posts:
    63
    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.
     
  11. CJR-Gaming

    CJR-Gaming

    Joined:
    Oct 12, 2012
    Posts:
    63
    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.
     
  12. CJR-Gaming

    CJR-Gaming

    Joined:
    Oct 12, 2012
    Posts:
    63
    RecastUnity v1.0.8 is officially on the asset store.
     
  13. chiapet1021

    chiapet1021

    Joined:
    Jun 5, 2013
    Posts:
    605
    Hey Christian,

    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.
     
  14. CJR-Gaming

    CJR-Gaming

    Joined:
    Oct 12, 2012
    Posts:
    63
    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.
     
  15. klaizard

    klaizard

    Joined:
    Jan 8, 2015
    Posts:
    2
    Hi, I have some question.

    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
     
  16. magiceye

    magiceye

    Joined:
    Oct 29, 2014
    Posts:
    9
    I think this is the true value of this tool.
     
  17. lopa421

    lopa421

    Joined:
    Mar 5, 2020
    Posts:
    8
    Hi do you have any tips on getting the Area tags and costs working (e.g. water, grass) with this tool?