AgentIntent

@three-blocks/proAIIntentMovementCombat
new AgentIntent()

AgentIntent - Output envelope for AI decision-making

Contains move, aim, and fire instructions that the AgentController consumes to drive agent behavior. Intents produce AgentIntent objects each frame to communicate their desired actions.

Usage

Example
// In an Intent's update() method:
update(body, state, memory, delta) {
  const intent = new AgentIntent();

  // Set movement
  intent.move.destination = targetPosition;
  intent.move.speed = 'run';

  // Set aiming
  intent.aim.target = enemyPosition;
  intent.aim.smoothing = 0.2;

  // Set firing
  intent.fire.trigger = true;
  intent.fire.mode = 'single';

  return intent;
}

Properties

.move : MoveIntent

Movement instructions.

.aim : AimIntent

Aiming instructions.

.fire : FireIntent

Firing instructions.

Methods

reset#

reset() : AgentIntent

Reset all intents to default values.

Returns
AgentIntent — This instance for chaining.

copy#

copy(other : AgentIntent) : AgentIntent

Copy values from another AgentIntent.

Parameters
The intent to copy from.
Returns
AgentIntent — This instance for chaining.