In this project, I worked on several systems to support the gameplay and improve functionality. I implemented procedural animations for the robots, allowing them to adapt their walking motion based on the terrain. For the enemy AI, I used a finite state machine to manage basic behaviors like roaming and attacking, keeping the system simple yet flexible enough for potential expansion. I also developed a weapon system that made it easy to create and manage different weapon configurations while maintaining performance and reusability. These contributions helped ensure the core systems worked as intended for the project.
For this project I created a flexible gun system in Unity using Scriptable Objects to separate weapon data (like damage and fire rate) from the shooting mechanics. This design keeps the core system efficient and reusable, allowing new weapons to be added or updated easily without changing the underlying code.
The Gun Equiper, which handles equipping and managin active weapons.
The Gun Scriptable Object (GUNSO), which stores weapon data (together with config files) and implements an object pool for performance.
To enhance efficiency further, I included a trail pool to handle bullet trails. This reuses trail objects instead of constantly creating and destroying them, ensuring smoother performance during gameplay.
For this project, I created the walking animation for the robots. We wanted the robots to adapt their movement based on the terrain, which led us to implement procedural animation. This approach allowed the robots to dynamically adjust their steps, creating a more realistic and responsive behavior compared to pre-made animations. It also ensured the robots could handle varying environments seamlessly.
The walking system, implemented in this procedural animation code on GitHub, dynamically calculates leg movement based on the body’s position. It checks the distance between the body and the position where each leg is planted. When the distance exceeds a defined threshold, the leg predicts a future position aligned with the body’s movement direction. A ray-cast ensures the calculated position matches the ground height, and the leg moves toward it in a smooth arc.
To maintain stability, the system ensures that at least two legs remain grounded at all times. While the code is not fully modular, it is adaptable enough to handle characters with a fixed number of legs or similar movement needs. This approach focuses on simplicity and achieving natural, dynamic motion without relying on predefined animations.
This project uses a finite state machine to handle the AI logic for the robots. The implementation is based on an older version of the state machine I created, which you can explore in more detail on the Finite state machine page.
The code integrates a parent state machine class, which manages transitions, and a set of specific state classes for individual robot behaviors, such as Idle, Patrol, and Attacking. This modular approach allows the AI to dynamically switch between states depending on its inputs and environment.
By leveraging the finite state machine, this project demonstrates how reusable code can streamline AI logic across different projects.
This project taught me the importance of setting clear goals and staying focused as a team. We divided tasks, tackled challenges one at a time, and made sure each part of the project contributed to the final result. It showed me how important it is to keep things simple and practical while working towards shared objectives.