AgentAvoidancePriority - jimdroberts/FishMMO GitHub Wiki
Defines avoidance priority levels for AI agents. Higher values cause agents to avoid others more aggressively. Used to control how strongly an agent tries to avoid collisions with other agents in the navigation system.
-
None = 0
Lowest priority. Agent avoids others the least and is most likely to yield.
-
Low = 25
Low avoidance priority. Agent yields to higher priority agents.
-
Medium = 50
Medium avoidance priority. Default value for most agents.
-
High = 75
High avoidance priority. Agent actively avoids others and is less likely to yield.
-
Critical = 100
Critical avoidance priority. Agent avoids others at all costs and rarely yields.
- Assign an
AgentAvoidancePriority
value to an AI agent's avoidance priority setting in the navigation or AI system. - Use the enum to standardize avoidance behavior across different agent types.
// Example 1: Setting an agent's avoidance priority
// Assume 'agent' is a reference to a NavMeshAgent or similar AI agent component.
agent.avoidancePriority = (int)AgentAvoidancePriority.High;
- Use
Medium
as the default for most agents unless specific behavior is required. - Assign
High
orCritical
to important NPCs or bosses to ensure they are not blocked by others. - Use
Low
orNone
for less important or passive agents to allow them to yield more easily. - Keep enum values consistent with the navigation system's expected priority range.