Search Unity

Tilesize and query performance for agents

Discussion in 'Navigation' started by snacktime, Oct 10, 2018.

  1. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    Something is wrong with agent pathfinding performance. I guess it could be some odd setting I'm missing but seems kind of doubtful. Agent queries are impacted by tilesize much more then manual queries, by an amount that just seems wrong. Going from the default 256 to 64, I start to see agents stuck in pathpending consistently for 3-4 seconds.

    To test I used my manual query code which does a SampleLocation at both start/end then CalculatePath, and those work as I would expect. The majority sub ms with a few at 3ms - 4ms on the high end. With the tile size not having a huge impact.

    The navmesh bounds is 2500 all dimensions. Tilesize is the only build setting that was customized. There were only two build sources, a terrain and water plane. Unity 2018.2.
     
  2. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    So it appears to be somewhat geometry related. Pathing near the terrain edge where the unwalkable water plane is definitely triggers more time stuck in pathpending. Manual queries are not effected.

    I can only assume the agents are actually doing something other then calculating paths during this time that's causing this, recast is simply not this slow even in a worst case setup.