Introduction:
For the first week of the Games and AI module at Coventry University, my task involved to choose a game and analyze the AI techniques implemented in it. I chose Doom (2016) because of its player-focused engaging action-oriented gameplay loop, defined as “Push Forward Combat” by the developers. This type of combat is designed with an emphasis on encouraging the player to actively seek out and pursue enemies until an area is cleared out which in turn provokes different type of AI behavior in the enemies who posses unique individual traits that they rely on to plan and execute their strategies in an effort of holding their ground, ensuring their survival and defeating the player.
Doom 2016:
The 2016 release of Doom is a resurgence of one of the most important classical franchises in gaming history. The original Doom, created in 1993, was considered a game design marvel for its time which has influenced and shaped the FPS game genre from its infant state to where we find it today. Doom (2016) is a modern adaptation of the original game formula, focused primarily on delivering an engaging fast-paced action-oriented gameplay experience by guiding the player through multiple types of battle arenas where crowds of different types of enemies are designed to spawn and present unique challenges as monster count is a pillar of the franchise.
AI Design:
AI Archetypes: The game features 16 distinct AI archetypes designed around the characteristics of each demon which the player engages in combat. Each archetype is outfitted to carry out a specific role efficiently in a fighting scenario rather than attempt to do many different things at the same time which reinforces the AI consistently predictable while allowing the player to instinctively plan the order of enemy engagement in combat. This method of design complements dynamic crowd AI behavior and is referred to by the developers at id Software as “AI Chess” (The “Swiss Army Knives vs Chess Pieces” ideology). While the original inception of AI design in the 2016 version provided a more complex solution to individual enemy behavior, during playtesting results showed that a large degree of that complexity was lost due to the pace of combat in the game so the resources related to it were moved to other systems.
AI Encounters: Combat encounters are designed to complement crowd AI behavior and can be separated into two distinct types based on the pacing options which they introduce: Wave fights and Arena fights. Wave fights consist of incidental combat encounters where crowds of enemies would engage the player in transitional spaces and would serve as pace breakers. Arena fights are the backbone of the game and feature a steady stream of AI reinforcements that engage the player in a “lockdown” style arena environment. The stream of spawning AI reinforcements is tied directly to the health of the last “heavy” minion which must be eliminated to lift the “lockdown” state and prevent other minions from spawning to assist it.
Hierarchical Finite State Machines:
Doom (2016) uses a Hierarchical Finite State Machine model for its AI behavior. The concept of HFSM can be described by a programmable hierarchy representing behavior inheritance between multiple individual Finite State Machines which are grouped together into clusters based on their classifications. As class inheritances allow subclasses to adapt to new environments, behavioral inheritance allows substates to mutate by adding a new behavior or by overriding existing behavior. HSFM is not prevalent in modern shooters due to being more mentally straining to develop for many different contexts and involve a tedious process of manually editing state transitions during iteration, whereas Behavior Trees and Hierarchical Task Network planning are more popular.
Crowd Combat System: Enemy AI attacks require a token to execute. If an enemy wants to execute an attack they must first request a token from a token pool. If a token is not available they must do something else and if it is then they acquire it. Enemy AI can hold onto the token or use it for the duration of the attack. When used, that token is on cooldown and can’t be reacquired by any enemy AI. Token pool count is regulated by game difficulty. Tokens can be stolen by select enemies based on their proximity and visibility to the player.
Faction System: Enemy infighting is core to demon characterization. AI archetypes represent factions that can accidentally or intentionally cause damage to other factions in combat which in turn leads to infighting. Infighting is managed by the number of colliding attacks in a fixed amount of time. Factions are defined as diverging groups of enemy archetypes and based on their inherent connection to each faction invoke different responses from attacks caused by AI behavior observed from other factions.
Doom (2016) uses two additional systems with HFSM to seamlessly manage AI behavior in different scenarios: Animweb Animation System and an expanded RAGE Cover System.
Animweb Animation System:
AI in Doom (2016) has direct control over their character animations and as such rely on a full-body animation system. This type of system minimizes limitations to the animation workflow as pose matching, breaking up or shortening animations and animation layer restrictions are no longer relevant issues. The AI can improve the utility of full-body animations by dynamically modifying origin translations and rotations, animation pose, playback rate, and position and blend weights. The result is AI behavior which feels more alive and engaging, facilitating sophistication and responsiveness to its surrounding environment.
AI Damage Response (Hit Reactions):
- Twitch (Light/Heavy) – react, but don’t stop current animation
- Falter – stop current animation, but continue fighting
- Pushback/Knockdown – stop current animation, temporarily immobilized, can’t be glory killed
- Stagger – stop current animation, temporarily immobilized, can be glory killed
RAGE Cover System:
Doom (2016)’s engine, idTech 6, is built on the advancements implemented in RAGE, another FPS developed by id Software, contains an AI cover system which suggests where enemies can take cover from the player. Due to the inherent design of the combat pace in Doom, the developers use reverse values to suggest firing position for ranged units which remain at a distance but are exposed to the player’s visibility (this system is referred to as “Exposed Cover” by the developers). Exposed cover positions are used by the developers as tether points and while tethered the enemy AI is free to make local direction and positional changes as they see fit. AI behavior in Doom (2016) evaluates the effectiveness of tether points using a runtime algorithm (“Bunch O’ Traces”) which generates a grid of sample points within each tether area and then traces the visibility of each sample point to the target to determine an average of which sample points can see the player converted into approximate percentage value.
Conclusion:
The AI in Doom (2016) is designed to showcase how dominating the player’s actions are. It is not designed to do whatever it can to kill the player but used to deliver a great player experience through its added value to the underlying gameplay loop which is the ultimate goal of the AI developer in a game development studio.
Credits:
- Featured Image: https://www.itl.cat/wallview/JiJmRJ_updated-for-4k-doom-slayer/
References:
- Cyber Demons | The AI of Doom (2016): https://www.gamasutra.com/blogs/TommyThompson/20180806/323715/Cyber_Demons__The_AI_of_DOOM_2016.php
- Bringing Hell to Life: AI and Full Body Animation in DOOM: https://www.youtube.com/watch?v=3lO1q8mQrrg
- Embracing Push Forward Combat in DOOM: https://www.youtube.com/watch?v=2KQNpQD8Ayo
- DOOM Documentary: Part 1 – To Hell & Back: https://www.youtube.com/watch?v=PS6SBnccxMA
- DOOM Documentary: Part 2 – Designing a First Impression: https://www.youtube.com/watch?v=vsoVQWnSOfM
- DOOM Documentary: Part 3 – Guns, Guitars & Chess on Mars: https://www.youtube.com/watch?v=r0nOsuaPDeg
- Resurrection & Reverence: The Return of DOOM | Design Dive: https://www.youtube.com/watch?v=fn3BPUA6vEE
- What We Can Learn From DOOM | Game Maker’s Toolkit: https://www.youtube.com/watch?v=yuOObGjCA7Q
- Introduction to Hierarchical Finite State Machines: https://barrgroup.com/embedded-systems/how-to/introduction-hierarchical-state-machines
- Hierarchical Finite State Machine & Behavior Tree: https://web.stanford.edu/class/cs123/lectures/CS123_lec08_HFSM_BT.pdf