Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Question is navmesh pathing using all cores?

Discussion in 'Navigation' started by laurentlavigne, Jan 8, 2021.

  1. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    5,415
    i was wondering, before i jump into optimization, what's the performance profile of navmesh nowadays?
    back in the prehistoric days of 3.x it was single threaded and fast but not that fast.
     
  2. adriant

    adriant

    Unity Technologies

    Joined:
    Nov 1, 2016
    Posts:
    52
    The pathfinding operations of all agents are executed single-threaded and they are thus able to stay under the limit set with
    NavMesh.pathfindingIterationsPerFrame
    .

    The simulation of the NavMeshAgent crowd movement is multi-threaded and, if necessary, it will use as many worker threads as there are available. One thread will execute the simulation of a group of agents that are nearby each other.
     
  3. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    5,415
    Single thread ... not on the main thread I hope, main thread cycles are too precious to waste on non synchronous processes.
     
  4. adriant

    adriant

    Unity Technologies

    Joined:
    Nov 1, 2016
    Posts:
    52
    The pathfinding code runs on the main thread.
     
  5. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    5,415
    When is it being moved to jobs? There is no reason to hog the main thread with an async operations.
     
    radiantboy and Peter77 like this.
  6. adriant

    adriant

    Unity Technologies

    Joined:
    Nov 1, 2016
    Posts:
    52
    It makes sense to try and move it to a worker thread. I've added it to our backlog and we'll need to find a place for it in our plans. When we'll have news I'll share them here.
     
    laurentlavigne likes this.
  7. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    5,415
    Thanks, we on Switch appreciate.
     
  8. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,485
    Looking forward to this!
     
unityunity