RAM Jam - 2018
Unreal Engine 4, First Person Shooter
Role: Programmer & Organizer
- Enemy AI Behavior
- AI Spawner Tool for Designers
- HUD Implementation
- Source Control System
Before this project, I hadn't done much gameplay programming in Unreal because there had always been another programmer dedicated to gameplay while I was assigned to work on other behind-the-scenes systems. I still didn't work on the main player character for this project, but I got the chance to work on AI which is always a fascinating task for me.
For my birthday this year, instead of going out, I invited a group of former classmates over for a game jam! There was seven of us in total: two programmers, 2 artists, and 3 designers. We had a lot of fun and were surprised with our result, which we ranked as our best game jam project yet.
The initial idea was a more serious science fantasy character had teleported into the treasure room of a dungeon and now needed to fight their way out with the loot. This eventually devolved into a much more silly dungeon shooter with a DOOM soundtrack and the main character being voiced by Dwight from The Office.
Despite the tomfoolery, I made a cool system for the designers to spawn AI. The design was based around the assumption of specific encounter areas, which worked well in a dungeon crawler. It consisted of blueprinted Spawner and Trigger objects that could be placed in the world.
The workflow was that once the encounter area
was white-boxed, designers placed spawners
inside the area, and a trigger at the entrance and exit to the area. Each spawner had properties to determine how many enemies would be spawned before the player entered, how many- if any- waves of enemies would spawn, how many enemies per wave and how long the delay was between waves. The trigger would have an encounter index, which was shared by the associated spawners, and a tickbox for if it was the encounter's starting or ending trigger.
When the player hits the starting trigger, all spawners with the same encounter index would start churning out waves of enemies until the ending trigger was hit. Additionally, each spawner kept track of its spawns and when a trigger 3 encounters beyond the spawner was hit, the spawner would destroy all of its spawns.
This system allowed the designers to easily and quickly change how the AI for any particular encounter behaved, and could swiftly be setup on new encounter areas once they were finished. A important function of this system was also to ensure we could have as man AI as we wanted, without worrying about performance. Since the AI were spawned with a just-in-time system, and then destroyed automatically after the player progressed past a certain point, the total active AI count was kept low.