Saya is a custom Real-Time Strategy (RTS) engine designed to benchmark and visualize Reinforcement Learning (RL) algorithms specifically DQN and PPO in a dynamic multi-agent environment.
The project now utilizes SDL3 to visualize the agents decision-making in real-time. The goal is to train an agent capable of competing against human players using RL strategies.
The engine is functional with the following systems implemented:
- Core Tech Stack: Built with C++17, integrated with PyTorch (LibTorch) for inference/training.
- Visualization: Real-time rendering using SDL3.
- Algorithms: Both DQN (Deep Q-Network) and PPO (Proximal Policy Optimization) training loops are implemented.
- Replay System: Custom serialization supporting two formats:
- Binary (
.bay) for performance. - String/Text (
.say) for human readability. - Includes a GUI replay viewer to analyze agent movements.
- Binary (
- Testing: Fully integrated Catch2 unit testing framework.
Current priorities and areas needing improvement:
- Performance Optimization:
- Current Issue: Units currently manage their own cooldowns using multiple timers (approx. 3 per unit), creating overhead.
- Goal: Refactor the cooldown system to use a centralized time-step manager or more efficient data structure.
- Tensor Input Shaping: Refining how game state data is fed into the tensor model for better learning stability.
- Algorithm Tuning: The training loops for DQN and PPO are functional but require tuning to resolve minor stability issues.
- CMake
- SDL3
- Catch2
- FlameGraph
- Perf
- PyTorch
For the fastest setup, use the provided helper script. Ensure you generate the build files using the -G flag if doing this manually.
./compile.shRun the profiler script to get into optimizations
./profiler.shAn .svg will be generated in the main directory, and you can view it using any .svg viewer including chrome.
