Somniphobia

Our game AI was made to emulate a classic Resident Evil™ Zombie. It's slow, unintelligent, but aggressive and sometimes unpredictable. Because of how simple the behavior was set to be, a Finite State Machine suited the problem. Plus, we would have finer control over its more unpredictable aspects.

enemy editor

General layout of the enemy blueprint.

The Finite State Machine Overview

Each state is transitioned to based on different boolean values. Custom-made animations were created to play when entering these states as well.

  • Idle - the enemy is visibly standing still. Could be pursuing the player.
  • Attack - the enemy is swinging at the player because it's close enough to them.
  • Hit - the enemy was shot or hit by the player's pipe.
  • LungeAttack - the enemy lunges at the player based on probabilistic factors.
  • LockOnPlayer - if the enemy has a successful lunge, it will grab onto the player.
  • death - the enemy's HP is at zero. Enemy ragdolls and interrupts all other states.

A benefit of designing things this way was the innate modularity. If a designer wanted a behavior done, there was a clear translation to implementation.


Randomness

One of the ways we wanted to make players feel uneasy was through randomizing attributes so they couldn't get a clear read on enemy intent.

Lunging

Playtests revealed frustration with the lunge-locking, so this behavior was made probabilistic based on the player's equipped item:

  • Holding nothing - 10% chance to lunge
  • Melee weapon (pipe) - 20% chance to lunge
  • Ranged weapon (nail gun) - 80% chance to lunge

This gave players a fair chance to always evade enemies, without making them entirely invulnerable.

Health

Health is randomly selected between 10-50 HP upon spawning. This forces players to adapt ammo conservation strategies when encountering a "tougher" variant.

health logic

Staggering The Enemy

The player always has a 50% chance of staggering the enemy when landing a successful hit, providing a visible reaction to damage.


Animations and Collision

I used notifications through the animation system to set state values, offering near frame-perfect collision queries and finer-grain control compared to simple delays activated based on the animation's start and duration.

Animation made in Blender - baby's first!
Credits:
Team: Ad Space Reserved | Fall 2023 - Spring 2024 (Junior Year)
  • * Jordan Fowler - Level Designer
  • * Aaron Hansen - Programmer, AI, Randomization
  • * Michael Haynes - Producer, Programmer
  • * Gabe Hoefler - Narrative Director
  • * Caleb Kissinger - Programmer, AI, Animation Lead, Shaders/Materials
  • * Dong Ta - Audio Lead
  • * Haoran Wang - Tech Lead
  • * Nathan Fallon - UI/UX Programmer
  • * Liam Binford - Programmer