This was the first project written in our custom engine which was a fun and interesting challenge since we had to create every single thing from scratch as we built up the engine alongside the game.
Early on I decided that I wanted to focus on working on the Enemies in this game since I did that in the previous project as well and really enjoyed it. I also ended up being responsible for the final boss of the game.
All the enemies as well as some other things in the game have their movements powered entirely by steering behaviors which I created a large and versatile system for.
The system uses a combination of weighted blending between behaviors as well as a form of priority-based arbitration system where if a high-priority behavior returns a really high force the less important behaviors would not run. The system also allowed for easy toggling of different behaviors.
Following the player is a magic lantern that uses a combination of Wander, Seek towards the player, Seperation from the player(with shorter range) and Wall Avoid behaviours
Groups of rat in the game uses the classic combination of Seperation, Cohesion and Alignment to create a boid behavoiur
The enemies, as well as the boss, uses a state machine for their decision making. I spent a lot of time with the enemies to make them interact fluidly with the players movements. One large thing to help that was that I made it so the enemies all have a prefered range that they want to stay at when they are waiting to attack, they stop at this range when approaching the player and move away when the player gets too close. I also added a failsafe so that they don't do this if they are backed up against a wall. It is most visible with the ranged enemies and I think it added a lot to make the enemies seem smarter than they really are.
Showcase of general enemy behaviour
Final boss fight
The final boss of the game also uses the same state machine system as the regular enemies where each of the three stages are seperate states that give commands to a central BossController class to perform certain attacks and animations.
Phase 1, consists of a group of standard enemies
Navmesh & Pathfinding
I was also responsible for constructing the navmeshes that we exported from Unity as well as doing the pathfinding on it.
The pathfinding itself is done through the A* algorithm and to make the final path smoother (since the path tends to get very zig-zagy on a navmesh) I used the "simple stupid funnel algorithm" which looks at the edges of the triangles used in the path and finds the shortest possible path through the corners.
I built a cutscene system that we used around the final boss fight.
The cutscenes consists of a bunch of really small segments that are easy to chain together to create the desired result. Some of the segments I made are: camera movements, playing animations, playing sounds, taking/giving control of the player, moving the player, etc.
Distance fog + Tool
I created a distance fog fullscreen shader by sampling from the depth texture and applying a percentage of a specified color on each pixel depending on the given depth and some variables for min- and max-distance and density.
I then also created a simple tool to tweak these values which allowed for very quick iteration to really enhance the atmosphere of the levels.