Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
tags:
|
| 4 |
+
- reinforcement-learning
|
| 5 |
+
- ppo
|
| 6 |
+
- openfront
|
| 7 |
+
- game-ai
|
| 8 |
+
---
|
| 9 |
+
|
| 10 |
+
# OpenFront RL Agent
|
| 11 |
+
|
| 12 |
+
PPO-trained agent for [OpenFront.io](https://openfront.io), a multiplayer territory control game.
|
| 13 |
+
|
| 14 |
+
## Training Details
|
| 15 |
+
|
| 16 |
+
- **Algorithm:** PPO (Proximal Policy Optimization)
|
| 17 |
+
- **Architecture:** Actor-Critic with shared backbone (512→512→256)
|
| 18 |
+
- **Observation dim:** 96
|
| 19 |
+
- **Max neighbors:** 16
|
| 20 |
+
- **Maps:** plains, big_plains, ocean_and_land, half_land_half_ocean (random per episode)
|
| 21 |
+
- **Opponents:** N/A Easy bots
|
| 22 |
+
- **Parallel envs:** 16
|
| 23 |
+
- **Learning rate:** 0.00034
|
| 24 |
+
- **Rollout steps:** 1024
|
| 25 |
+
- **Updates trained:** 660
|
| 26 |
+
- **Global steps:** 86507520
|
| 27 |
+
- **Best mean reward:** -0.06284408122301102
|
| 28 |
+
|
| 29 |
+
## Final Training Metrics
|
| 30 |
+
|
| 31 |
+
- **Mean reward:** -0.5554914677888155
|
| 32 |
+
- **Mean episode length:** 7626.04
|
| 33 |
+
- **Loss:** -0.16370002925395966
|
| 34 |
+
|
| 35 |
+
## Usage
|
| 36 |
+
|
| 37 |
+
```python
|
| 38 |
+
from train import ActorCritic
|
| 39 |
+
import torch
|
| 40 |
+
|
| 41 |
+
model = ActorCritic(obs_dim=96, max_neighbors=16, hidden_sizes=[512, 512, 256])
|
| 42 |
+
model.load_state_dict(torch.load("best_model.pt", weights_only=True))
|
| 43 |
+
model.eval()
|
| 44 |
+
```
|
| 45 |
+
|
| 46 |
+
## Repository
|
| 47 |
+
|
| 48 |
+
Trained from [josh-freeman/openfront-rl](https://github.com/josh-freeman/openfront-rl).
|