Search Unity

Good solution for jumping with runtime baked navmesh?

Discussion in 'Navigation' started by UnkelRambo, Sep 7, 2022.

  1. UnkelRambo

    UnkelRambo

    Joined:
    Oct 26, 2012
    Posts:
    80
    Hi!

    I'm looking for a good solution to runtime generated navmesh data that can provide navlinks used for jumping vertically for ~1000 agents. The vanilla navlinks that get baked are useful for falling or jumping horizontally, but I need information and pathing that considers jumping vertically. I thought maybe I could make the navlinks bidirectional but 10 minutes of trying yielded nothing :D

    I ended up buying the A* Pathfinder Project Pro in the asset store (https://assetstore.unity.com/packages/tools/ai/a-pathfinding-project-pro-87744) and through some hackery of a 3rd party script I got runtime bidirectional navlinks working. Mostly. I think I can modify this package at some point to consider navlink height for what's "jumpable", even with different jump heights for different characters (something I'd love to support, but a minimum jump height will do just fine.)

    The issue I'm running into is that performance is quite poor in that package as finding paths seems to call gc.alloc() several times, no bueno for ~1000 agents (my target.)

    My google-fu is coming up pretty empty here, so any suggestions would be appreciated.

    Thanks!
     
  2. superdupergc

    superdupergc

    Joined:
    Jun 21, 2013
    Posts:
    28
    You could run a post-process on your runtime navmesh that generates navmeshlinks for climbing. I don't do it at runtime, but I've got a script that raycasts around looking for walls to climb and generates navmesh links.
     
    UnkelRambo likes this.
  3. UnkelRambo

    UnkelRambo

    Joined:
    Oct 26, 2012
    Posts:
    80
    I think this is the most likely scenario. It will be made much simpler if I add a grid-aligned constraint to my building system, something I've been considering but haven't actually done yet. This might be a good enough excuse to pull the trigger :D
     
  4. superdupergc

    superdupergc

    Joined:
    Jun 21, 2013
    Posts:
    28
    Any excuse to simplify your design is worth considering, if you asked me!