Project FCOM
An X-COM inspired strategy game made in Unity.
Overview
In Spring of 2023 I was part of a team of four that created a turn based strategy game inspired by games like X-COM and Fire Emblem. It was made in one semester as part of the AI for game programming course at UCF (CAP 4053). Our game won the award for most polished in the class.
Some things I’d like to highlight my responsibility for include:
- The save system.
- Performance optimizations.
- Certain actions and units.
A recording of a livestream our professor made of our game is shown below.
Save/Load
The save system was the most challenging component of the project for me. This was mostly because the framework used for the game was not built around the idea of a save state. My goal was to modify this framework to allow for game saving. As the project grew, more and more things needed to be saved, including:
- Turn order.
- Enemy and player unit state. (transforms, stats, active effects/elements, etc.)
- Enemy wave state.
- Scripted sequence state.
- Level hazards and destructibles.
The save system took a ton of effort to implement and maintain, but it was extremely useful not only for players, but also for development. It allowed us to implement level transitions seamlessly by creating hard coded saves for the beginning of levels. Additionally, it made finding and reproducing bugs easy as we could share save files to demonstrate issues.
Performance Optimizations
The game had performance issues very early on in development that needed to be addressed quickly. I took the initiative on our team to track down these problems and resolve them. Some issues were solved easily by using occlusion culling and baked lighting, but other problems were more difficult to track down.
One particularly stubborn issue took the form of stuttering every time any unit would move. Unity’s built in debugging utilities allowed me to track down the bug to an inefficient pathfinding implementation which I resolved with a combination of optimizations to the algorithm and caching pathfinding results.
Units and Actions
I was responsible for implementing a majority of the actions used by enemy units, and a handful of the actions used by player units. My team and I were able to modularize the different types of actions which allowed for code reuse for similar actions.
One action type I was very proud of was the charge action used by the bug enemies. When thinking about what sort of algorithm I could use to have a unit charge in a straight line, but on a grid, I drew on my experience with graphics programming. I identified that charging was essentially the same as rasterizing a line on a uniform grid and was able to use a pre existing algorithm to have the bugs charge properly.
Room For Improvement
In a brief retrospective with the team after the class concluded, I identified some areas that could use improvement:
- The save system works, but is very complex and could be redesigned to be simpler.
- Bugs: there are a few things that aren’t saved that should be.