Maybe this is obvious but I'm not seeing it... Why would an NPC measure distance in triangles instead of meters? Why is it trying to get 100 triangles away?
Maybe this is obvious but I'm not seeing it... Why would an NPC measure distance in triangles instead of meters? Why is it trying to get 100 triangles away?
So you give the NPC a speed, and it moves as far along the edges between vertexes in each time interval.
The navmesh also helps keep the AI traveling in places that have been marked as safe for travel, without collision or drops.
In the low-density mesh which the fox uses, there are more nodes around treasure, and because edges connect nodes, more of the edges in uninteresting space lead towards treasure. So just by picking random edges, or edges away from the player, you are likely to end up near treasure. It's a bit like the is fox moving through a non-Euclidean space which has more volume near treasure.
Because measuring distance by hops would be absolutely daft.
Bethesda has been building this specific type of game for decades so at this point things like npcs having complex patrols or other behavior is something they've figured out how to do well.
If you enter the camp and it gets high suddenly, nothing is changed, since as a player you know you are in a camp.
The fact the fox stays, chewing through triangles, rather than running though like it would if it was based on meters doesn't matter.
Although, since the fox stays in the camp, you would think it was telling you something, even though it was random chance.
This is exactly what I said (breadth-first). Breadth first find shortest distances to all nodes in the neighbourhood.
> "The Fox isn't trying to get 100 meters away - it's trying to get 100 triangles away."
Breadth-first search wouldn't be possible. If at each triangle the fox has ~2 options that's 2^100 to get to 100 triangles away
But if it did impossibly work out every journey, and then chose a random last node it would end up in camps more often.
Depth-first search shouldn't preference the camps, unless it gets dragged in from afar. But if it can only get dragged in really close to/in a camp, then it's about the same probability as the fox running past/through a camp anyway. And I would assume as a player you would see the fact it's pretty.
I don’t think you understand what Djikstra’s algorithm is. Breadth first doesn’t mean you have to always re-visit the same node more than once.