Meet the Characters:
Agryos includes three unique enemies: the Imp, the Gryphon, and the Kaiju. All AI share a behavior tree and parent class; behavior variations were achieved through overriding functions, adding enemy-specific components, and tuning variables.
- The Imp: A small, squishy quadruped that tries to stay an “ideal” distance from the player. They are strength-in-numbers fighters equipped with simple turrets.
- The Gryphon: A medium sized flying enemy equipped with flesh-melting laser beams. They always face the player while zipping swiftly through the air, attempting to stay nearby without getting too close or sitting still.
- The Kaiju: A large, wheeled tank that turns slowly towards the player and drives towards them, firing missile barrages every few seconds.
Most Interesting AI Questions Solved:
Choosing the "Best" Position
- An EQS query returning a singular “best" position may cause multiple AI to desire essentially the same spot. This issue is especially relevant in tight areas, like our first arena’s corridors and staircases. I handled this by using the AI’s positions as custom query contexts so claimed areas scored lower, plus a failsafe system of “if I overlap with an ally, we each step away from the impact point”.
Implementing 3D Navigation
- The Gryphon has to avoid obstacles, the floor, and ceiling while flying, but they should also zip around sporadically and stay distant from the player. I used raycasts to detect solids and ensure that the Gryphon canceled velocity in the direction of the obstacle (while still allowing movement to continue in other directions).
- Our level designers needed a tool to implement arena combat. The Arena Manager allows designers to change doors and lights upon entering/ending combat, create a list of enemies to be defeated before triggering the next wave, and allow waves to trigger multiple spawners. This system helped simplify AI testing and combat balancing!
- The boss was determined to be too unique to use the same systems as other enemy AI. The boss has two unique phases: one for close quarters combat and one for a more open area. During both phases, the boss shoots bullets at you and spawns AI to replace ones the player kills.
- Phase 1: The shell closes around the boss's core to force the player into close combat. The boss fires a flesh melting laser beam every few seconds.
- Phase 2: The shell re-opens. The boss’s remaining health is divided into four even ‘chunks’ of health; when a chunk of health is depleted, the boss shields itself, and power cores rise from the ground. Destroying a power core drops the boss’s shield, leaving it vulnerable to attack again.
Cut AI Systems
- Patrolling/Searching: Before we pivoted to arena-based combat, we considered supporting stealth playthroughs. At this point, the AI followed patrol routes; upon losing sight of a player, AI would search in the player’s most recently seen area before returning to their patrols. After switching to arenas in which killing all AI was mandatory for progression, AI had no perception; they simply pursued the player at all times.
- Cover System: For a while, severely damaged AI would hide behind a solid object to avoid combat. The AI used raycasts to seek the nearest solid object that they could hide behind and ensure that the player wasn’t blocking the path. However, balancing this system was a huge task: the player was always moving around to avoid bullets, and we were unsure when exactly the AI should hide (When they were low health? But enemies don’t heal over time, so would they hide forever? Does it matter if the player just follows them? Is it frustrating that the player now has to chase the AI?). We had too many unanswered questions for how to polish and convey the system.