Jaasssoooonnnnn/FirstLight_CR
Offline Clash Royale AI research: native simulation, imitation learning, PPO, and interactive evaluation.
What it solves
Training game agents for Clash Royale normally requires a live game client and huge amounts of data. FirstLight CR removes those barriers by running the game engine offline, reconstructing real player replays, and using them to teach AI via imitation learning and reinforcement learning. It also provides a full local environment to evaluate and play against the trained agents, so you can experiment without needing an online connection or Supercell's servers.
How it works
The project starts with a dataset of 252,238 replays, downloaded from Hugging Face. These replays are reconstructed in a native battle environment that simulates the game exactly, producing observation and action sequences. Imitation learning is first applied to these sequences to get a recurrent policy. That policy is then improved with PPO self-play, where the agent trains against itself and a pool of opponents, using matchmaking and distributed collection. The training flow is: replay dataset → native reconstruction → observation/action sequences → imitation learning → recurrent policy → self-play + PPO → evaluation, play, or policy service. The engine is an offline APK built from the original game (user-provided), so everything runs locally.
Who it's for
This is for AI researchers, hobbyists, and developers interested in reinforcement learning, imitation learning, or game AI, especially those who want to train and test agents for Clash Royale in a controlled, offline environment. It's also useful for anyone who wants to watch AI battles or build custom training pipelines with a Python interface.
Highlights
- Native battle environment with headless and rendered execution, structured observations, and Python reset/step interfaces.
- Imitation learning from reconstructed replays (252,238 replays, 17,836,160 actions).
- Self-play reinforcement learning with PPO, matchmaking, opponent pools, and distributed collection.
- Includes 122 supported cards, 5 pre-trained checkpoints (including a strong general model and a Hog 2.6 specialist).
- Offline play and evaluation: run the interface, watch replays, control both sides, or compare checkpoints.
- Fully open source under Apache-2.0, with source code for the probe, APK build tools, and training code.
Related
- Project
- Project
- Project
- Project