Hi, everybody.
I’m quite new with unity. I’m using navmesh for a game that i making with a team. My teammates didn’t like the idea of use a nevmesh agent for our game. I didn’t understand their justifications, so i’m asking here. When should or shloudn’t i choose nevmesh agents for pathfinding AI? Which are the other option( i know A*)? Navmesh has a bad performace? Can you recommend some source of knowledge about this (i already read the unity documentation and watch their tutorials)? Thanks for the help!
This is the worst answer, but it depends. We have a game with up to 16 highly dynamic moving agents pathfinding to each other, and don’t have any issues. If you have more agents, but they are more static you can reduce the calls that cause a recomputing of the path so as to reduce the CPU cost, but so so much of that is dependant on your game. I’m happy with the Unity NavMesh, and like it way better then some of the other A* options available. Everything has tradeoffs - NavMeshAgent is very very biased on being attached to a thing that move like a person. Our game is a car-combat one, so i can’t use a lot of the built-in NavMeshAgent stuff. Also if you have any kind of dynamic level generation going on, you might have to pick a different solution, as the NavMesh is baked at compile/edit time, not run time.