This document is about: QUANTUM 2
SWITCH TO

Rotation

Overview

AIRotation is a component used to simulate complex looking behavior for FPS games. The underlying goal is to emulate real look behavior so players do not immediately recognize an AI agent based on its look behavior - even when seeing its playstyle from a first person view (e.g. kill camera or replay).

The physics spring model is used to drive the rotation and create human-like behavior. The AIRotation update is called from within the animation states. The spring model is performance efficient; thanks to the fixed delta time in Quantum, the spring parameters only being calculated once at the start of the simulation and the rotation update is only made of a few multiplications. Adjusting spring setup will result in different look behavior; from relaxed mobile-like rotation to firm hardcore rotation of PC players. AIRotation-related settings can be tweaked in the AIConfig.

Execution Flow

The execution flow for AIRotation behaviors is as follows:

  1. Target rotation is selected based on the current rotation type
  2. The target rotation is randomized within the limits of the dispersion parameters and search behavior
  3. The target rotation is fed to spring model every tick which then returns the actual rotation to be performed for that tick
  4. The target rotation is recalculated periodically so even when looking at the same static target for an extended period of time the look is never completely steady

Types

Several rotation types are supported:

  • Target: Look at the object set as Target in the blackboard. It is possible to enable a velocity prediction so bots are aiming ahead of target based on the target's velocity.
  • Forward: Look in the direction of the movement velocity. If the bot is following a path and PredictForwardLook is enabled, the Bot is able to look ahead before turning around the corner.
  • Search: Same as Forward but the agent is looking left and right based on a specified search angle.
  • Point: Look at the point set as FocusPoint in the blackboard.
  • Direction: Look in the direction set as FocusDirection in the blackboard.
  • Destination: Look at point set as Destination in the blackboard.
  • SearchDiretion: Same as Direction but with a search behavior.
Back to top