Search Unity

Question is navmesh pathing using all cores?

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

  1. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,364
    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:
    69
    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:
    6,364
    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:
    69
    The pathfinding code runs on the main thread.
     
  5. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,364
    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:
    69
    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:
    6,364
    Thanks, we on Switch appreciate.
     
  8. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    Looking forward to this!
     
  9. ParhamXTT

    ParhamXTT

    Joined:
    May 24, 2020
    Posts:
    28
    Hello. anything changed in 2023.1 alpha 11 about multithreaded navmesh and pathfinding?
     
    Claytonious likes this.
  10. jjplay175

    jjplay175

    Joined:
    Apr 24, 2014
    Posts:
    3
    Over a year has passed and still no news on fixing Navmesh needlessly being on the main thread? Has it been moved or is it time for us to learn dots 1.0 to do it ourselves?
     
  11. DwinTeimlon

    DwinTeimlon

    Joined:
    Feb 25, 2016
    Posts:
    300
  12. Nikolat93

    Nikolat93

    Joined:
    Sep 5, 2016
    Posts:
    36
    Is it possible to force the crowd movement to be single threaded? I'm getting various freezes related to crowd manager multithreaded code.
     

    Attached Files: