Forum rules - please read before posting.

NavMesh Optimization?

edited April 2014 in Technical Q&A
Hi Chris (or anyone!)
I'm using a NavMesh for the pathfinding, and it works poor performance-wise.
If the path is very straight forward it's ok. But if the player has to go around an object, it takes a little while.
It's ok for a desktop computer but on the iPad it takes longer an it's not really good.

What would be the issue in the NavMesh that makes the pathfinder takes longer?
- Is the size of the mesh?
- Are the tris amount? (does Unity optimize that by default?)
- what would be?

This is a video on desktop of how it behaves. Is not so bad, but on iPad it is bad.
(can't embed the video)


Comments

  • I can't help you with your navmesh issues but I'm just dropping by to say that is a damn cool-looking game! Gorgeous art, very interested to play it someday.
  • At what point does it take a while?  Before the player even moves?

    The NavMesh pathfinding is based on my own algorithm.  It's the vertices, rather than the tris, that makes the difference.  You may want to consider using Unity Navigation instead for your scenes, which would surely be better optimised for mobile devices (they're smarter than me).
  • Thanks Hedgefield!

    @Chris: yes, before the player moves, looking for the best path I guess.
    The only problem with UnityNavigation is that I'm using a terrain, so is very difficult to use that approach.
    It should have to do with the amount of something... I'll try to optimize the mesh in different ways to see what happen. Thanks Chris!
  • I'm using UnityNavigation on a terrain scene, and I think I figured out the best way to do it-

    You lay down your navmesh segments where you want them to be, and make sure that they are above the terrain as much as you can. Little hills where it goes under the terrain at small points shouldn't be a huge issue.

    Then once all of the segments are placed, you open the Navigation window. In the navigation window, select your terrain, and deselect the "Navigation Static" box. If you check this box, upon baking, all of the terrain would be turned into your navmesh, which I assume you want to avoid.

    After deselecting that, you can determine bake settings in the bake tab of the navigation window, and once you are satisfied, click the bake button at the bottom of the window. This should combine those navmesh segments into a much more workable navmesh with good pathfinding. 

    If the navmesh doesn't generate correctly, i.e. if there are gaps between two segments, all you need to do is fix the segments and rebake. Another thing you can do is tweak the bake options so that things like high steps in navmesh segments still get turned into a navmesh.

    Hope this helps!
  • Thanks a lot @skitt2501 !! I'm going to try that and see what happen.
  • No problem, good luck! Your game looks great by the way!
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.