Search Unity

pathfindingIterationsPerFrame for bigger games should be per agent

Discussion in 'Navigation' started by mischa2k, Jul 11, 2017.

  1. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Hello everyone,
    I developed uMMORPG and uMOBA. Having pathfindingIterationsPerFrame is very useful to keep Unity from freezing up when too many players or monsters navigate around!

    My question is, why not change it to pathfindingIterationsPerAgent? It seems to be smarter in every way.

    Consider an MMORPG scenario where there are anything between 10 and 1000 players. There's just no way to set a good pathfindingIterationsPerFrame amount to make sure that path calculation is always 'reasonably fast' but doesn't take down the server.

    The only solution right now is to constantly set: pathfindingIterationsPerFrame to EntityAmount * 100 or similar. This works in theory, but in practice no agent should be able to slow down other agents. If we have a huge game world where a player clicks to the end of the world, it would slow down path finding calculations for everyone else immediately.

    If there was a pathfindingIterationsPerAgent setting then no agent would slow down any other agent. If a player clicks far away it takes slightly longer for that player only. Doesn't that make more sense?

    On a side note, are there any plans in regards to concurrency? Multithreaded pathfinding would provide gigantic benefits to all kinds of (online) games, especially MMORPGs. Right now, all of the user scripts run in one thread, which has a whole lot of simplicity benefits. UNET's new Network Transport Layer recently introduced multithreading, which is really awesome because we can use one thread for all user scripts + N threads for networking. If Navigation would be concurrent, then that would greatly increase the possible amount of players per server.
     
  2. Jakob_Unity

    Jakob_Unity

    Joined:
    Dec 25, 2011
    Posts:
    269
    Yes it makes sense. We're currently working on a low-level api for pathfinding queries, which aims to support what you suggest - ie. balancing pathfinding resources, concurrency, networked game.
     
  3. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Awesome. Can't wait to try it, thanks a lot!
     
  4. Darkestkiller3

    Darkestkiller3

    Joined:
    Dec 24, 2016
    Posts:
    1
    What version of unity do you expect this to be released on?
     
  5. drmccollum

    drmccollum

    Joined:
    Mar 19, 2016
    Posts:
    10
    When can we expect the new API?
     
  6. DwinTeimlon

    DwinTeimlon

    Joined:
    Feb 25, 2016
    Posts:
    300
    Any news?
     
  7. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Old thread, but did anything happen in this direction? This would still be incredibly useful :)
     
  8. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Any news yet? :)
     
    radiantboy and shamsfk like this.