AgentAvoidancePriority - jimdroberts/FishMMO GitHub Wiki

Description

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.


API Access

Enum Values

  • 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.


Basic Usage

Setup

  1. Assign an AgentAvoidancePriority value to an AI agent's avoidance priority setting in the navigation or AI system.
  2. Use the enum to standardize avoidance behavior across different agent types.

Example

// 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;

Best Practices

  • Use Medium as the default for most agents unless specific behavior is required.
  • Assign High or Critical to important NPCs or bosses to ensure they are not blocked by others.
  • Use Low or None 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.
⚠️ **GitHub.com Fallback** ⚠️