Class AgentTuning
- Namespace
- GrindFest
- Assembly
- GrindFest.dll
Gives every character's NavMeshAgent the avoidance settings the game actually relies on.
public static class AgentTuning
- Inheritance
-
objectAgentTuning
Remarks
Nothing set these before 2026-09-22, so every agent ran on Unity's defaults: avoidancePriority 50 for
all of them, obstacleAvoidanceType HighQualityObstacleAvoidance. Equal priorities are the case local
avoidance handles worst - two agents that both want the same square metre have no rule that says who yields,
so they push through each other - and a hero walking into a group of monsters is exactly that situation. The
hero is also the one character in the scene that must not be shunted around, and priority is how that is
expressed: lower wins.
The quality level is a cost decision. HighQualityObstacleAvoidance runs the most expensive avoidance simulation per agent, and this game puts many agents into one fight, in a browser. GoodQuality is the level Unity's own guidance reaches for as the agent count grows. This is the one part of the change that is not measured - a WebGL page has no profiler to attach and FrameProbe reports FMOD, not avoidance - so it is a reasoned choice rather than a number, and the lever is one enum if it turns out to matter.
Deliberately NOT set: radius, height, speed, acceleration,
stoppingDistance and autoBraking. Movement here is driven by root motion with
Agent.updatePosition = false, so the agent is a path service rather than the mover, and
stoppingDistance is read by MovementState and Skill to decide when a character has arrived - changing
it changes gameplay. Radius was measured 2026-09-22 instead of assumed: the same 48 sampled targets at three
radii (0.1, the CharacterController's own 0.1, and 0.5) gave an identical 42/48 complete paths and an
identical 11.18 m average path length, so on an already-baked mesh the agent radius is not the lever for path
clearance and leaving it as authored costs nothing.
Fields
- HeroPriority
Priority for the character the camera is on - lower wins.
- MonsterPriority
Priority for everything else, above the hero's, so monsters yield to it.
- MonsterSpread
How far apart two monsters of the same priority may be spread, in priority units.