This project is a technical prototype developed to demonstrate the implementation of scalable, memory-efficient software architectures within a real-time environment. Rather than focusing on visual assets, the project serves as a showcase for decoupled systems, event-driven logic, and optimized memory management.
Implemented a robust Command Pattern to handle player movement.
- Decoupling Action from Execution: Input triggers are encapsulated as command objects and passed to a
CommandInvoker. - Extensibility: This architecture allows for easy implementation of features like move-queuing (via
Queue<ICommand>) or undo/redo functionality, ensuring the player controller remains lightweight and modular.
To manage high-frequency object spawning without performance degradation, I developed a generic, reusable Object Pooling System.
- Memory Optimization: Utilizing
UnityEngine.Pool, the system recycles projectiles and enemies to maintain a near-zero allocation footprint during runtime, effectively eliminating Garbage Collection (GC) spikes. - Generic Abstraction: The
PoolBase<T>allows for rapid scaling—adding new pooled entities requires zero modification to the core pooling logic.
The "Rage Mode" weapon system is built using the Decorator Pattern, allowing for the dynamic extension of object behaviors at runtime.
- Composition over Inheritance: Instead of complex inheritance trees, weapon upgrades (like the
RageBullet) "wrap" theDefaultBulletto modify damage and fire rates on the fly. - Polymorphism: The
IBulletinterface ensures that theFire.cssystem can interact with any bullet type without knowing its specific implementation.
Player behavior is managed through a Finite State Machine (FSM).
- State Encapsulation: Discrete classes for
IdleState,MovingState, andFiringStatehandle their own logic and transitions. - Clean Control Flow: This removes large, complex
if-elseorswitchblocks from the mainUpdateloop, making the player controller highly maintainable and less prone to "state-leaking" bugs.
The project utilizes C# Actions and Delegates to manage cross-system communication.
- Observer Pattern: Systems like UI indicators and spawners react to events (e.g.,
OnExitRage) without direct dependencies, keeping the architecture loosely coupled.
- Language: C#
- Engine: Unity
- Key Patterns: Command, Decorator, Object Pooling (Generic), State (FSM), Observer.
- Principles: SOLID, DRY, Composition over Inheritance.