Hasty Briefsbeta

Bilingual

The Low-Tech AI of Elden Ring

8 hours ago
  • #Elden Ring
  • #Game Development
  • #AI Programming
  • FROMSOFT's AI system in Elden Ring uses a low-tech but effective approach based on Havok Script (Lua).
  • AI decision-making is organized around 'Goals', which are states that can be stacked, turning the system into a Pushdown Automaton (PDA).
  • Goals are updated each frame and can push sub-goals onto the stack, with outcomes like Continue, Success, or Failure determining stack changes.
  • The 'activate' callback in Goals handles AI logic, often using weighted random selection to choose actions based on context and randomness.
  • Interrupts allow Goals to respond immediately to external events, such as damage or special effects, by modifying the goal stack.
  • Goals have timeouts to prevent stuck states and access actor data via an array of floats, avoiding complex systems like blackboards.
  • Actions are animation-driven, with animations carrying hitbox info, effects, and combo features, leveraging Havok middleware.
  • The system separates 'logic' and 'battle' scripts, allowing for reusable logic and bespoke battle behaviors.
  • Compared to Behavior Trees or planners, the pushdown automaton is faster and more flexible, avoiding state explosion.
  • The approach prioritizes designer and animator control, making it legible and effective for Soulsborne NPC and boss encounters.