← All Projects
CocSim — Clash of Clans RL Simulation
Python simulation of Clash of Clans game mechanics with separate RL agents for building placement and troop deployment, trained to optimise base/attack strategies.
PythonPyTorch / RL training loop (`train.py`)Custom environment (`cocsim_env.py`)Separate building and troop agentsJSON-based game state (`buildings.json`, `troops.json`)
⚡ Restricting agents to respect game-rule constraints (troop/b…⚡ Defining a reward signal rich enough to encourage strategic …
Portfolio Highlights
- →Built a multi-agent RL simulation of Clash of Clans game mechanics in Python, with separate policy networks for building placement and troop deployment trained under game-rule constraints.
Snapshot
- Period: April 2025
- Source: `github.com/josegibson/cocsim` (private)
- Domain: Reinforcement learning, game simulation, multi-agent systems
- Status: Research experiment
Stack
- Python
- PyTorch / RL training loop (`train.py`)
- Custom environment (`cocsim_env.py`)
- Separate building and troop agents
- JSON-based game state (`buildings.json`, `troops.json`)
- Simulator visualizer
What I Built
- Game environment simulating CoC mechanics: building placement, troop spawning, combat resolution.
- `BuildingAgent` and `TroopAgent` as separate policy networks with constrained action spaces (allotted counts enforced by design).
- Training pipeline with environment resets, reward shaping, and logging.
- Visualizer for stepping through simulation state.
- Hurdle log documenting design decisions around action-space constraints.