Document GameDojo release and usage
Browse files
README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
---
|
| 2 |
-
pretty_name: GameDojo
|
| 3 |
tags:
|
| 4 |
- gamedojo
|
| 5 |
- game-agent
|
|
@@ -38,6 +38,61 @@ tags:
|
|
| 38 |
|
| 39 |
GameDojo-Data is a 600-hour corpus of gameplay trajectories from GameDojo. It covers 120 boss encounters across 20 game environments, with 60 encounters each in 2D and 3D. Each encounter is recorded at Easy, Medium, and Hard difficulty. The trajectories support imitation learning from visual observations and keyboard and mouse actions across different game mechanics.
|
| 40 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
## Collection
|
| 42 |
|
| 43 |
We use coding agents to write encounter-specific behavior-tree controllers from environment source code, internal state information, and task instructions. These controllers play the encounters in parallel across simulator instances. We verify episode outcomes using the environment state.
|
|
|
|
| 1 |
---
|
| 2 |
+
pretty_name: GameDojo
|
| 3 |
tags:
|
| 4 |
- gamedojo
|
| 5 |
- game-agent
|
|
|
|
| 38 |
|
| 39 |
GameDojo-Data is a 600-hour corpus of gameplay trajectories from GameDojo. It covers 120 boss encounters across 20 game environments, with 60 encounters each in 2D and 3D. Each encounter is recorded at Easy, Medium, and Hard difficulty. The trajectories support imitation learning from visual observations and keyboard and mouse actions across different game mechanics.
|
| 40 |
|
| 41 |
+
## To-do
|
| 42 |
+
|
| 43 |
+
- [x] Release the benchmark environments, training interfaces and PPO example, and evaluation harness.
|
| 44 |
+
- [ ] Release the 600-hour GameDojo-Data trajectory dataset.
|
| 45 |
+
|
| 46 |
+
## Download and launch
|
| 47 |
+
|
| 48 |
+
Clone the complete environment bundle with Git. Use Python 3.12 and install Node.js if you need symbolic observations in shared web games. Minecraft RGB rendering needs an OpenGL context.
|
| 49 |
+
|
| 50 |
+
```sh
|
| 51 |
+
git clone https://huggingface.co/datasets/THUSI-Lab/GameDojo GameDojo
|
| 52 |
+
cd GameDojo
|
| 53 |
+
python3.12 -m venv .venv
|
| 54 |
+
source .venv/bin/activate
|
| 55 |
+
python -m pip install -r environments/requirements-games.txt
|
| 56 |
+
python -m playwright install chromium
|
| 57 |
+
```
|
| 58 |
+
|
| 59 |
+
To play in your browser, start the launcher.
|
| 60 |
+
|
| 61 |
+
```sh
|
| 62 |
+
python -m http.server 8766 --bind 127.0.0.1 --directory environments/games/web
|
| 63 |
+
```
|
| 64 |
+
|
| 65 |
+
Open [the local launcher](http://127.0.0.1:8766/). For Minecraft, run `python environments/games/prototype/bossbench/play_server.py` in a second terminal with the virtual environment active and open [the Minecraft page](http://127.0.0.1:8765/). See the [environment setup guide](environments/README.md) for more options.
|
| 66 |
+
|
| 67 |
+
## Train a visual policy
|
| 68 |
+
|
| 69 |
+
Run the included single-encounter PPO example from this checkout with the virtual environment active. The example trains with the game clock paused.
|
| 70 |
+
|
| 71 |
+
```sh
|
| 72 |
+
python -m pip install 'stable-baselines3==2.9.2'
|
| 73 |
+
python examples/ppo.py --case doom/cyberdemon --tier easy train --steps 10000 --output runs/doom-ppo.zip
|
| 74 |
+
python examples/ppo.py --case doom/cyberdemon --tier easy eval --checkpoint runs/doom-ppo.zip --episodes 5
|
| 75 |
+
```
|
| 76 |
+
|
| 77 |
+
The example uses RGB observations, compact actions, and progress rewards. It reports win rate and mean progress on separate evaluation seeds. Custom trainers can use `bossbench.make_training_env` with `PYTHONPATH=environments/games/prototype`.
|
| 78 |
+
|
| 79 |
+
## Evaluate agents
|
| 80 |
+
|
| 81 |
+
From the environment checkout, run a no-op smoke check or point the harness at an OpenAI-compatible vision-language model endpoint.
|
| 82 |
+
|
| 83 |
+
```sh
|
| 84 |
+
python environments/run_model.py --case doom/cyberdemon --tier normal --policy noop --max-steps 1
|
| 85 |
+
python environments/run_model.py --case doom/cyberdemon --tier normal \
|
| 86 |
+
--policy chat --base-url http://127.0.0.1:8000/v1 --model gamedojo-4b \
|
| 87 |
+
--format lumine --time paused --seeds 1-3 --out runs/eval
|
| 88 |
+
```
|
| 89 |
+
|
| 90 |
+
Set `OPENAI_API_KEY` if your endpoint requires authentication. Select `--format semantic` for semantic actions and `--time realtime` for inference-latency-aware interaction. Runs save per-episode outcomes, progress, and JSON and CSV summaries. Run `python environments/run_model.py --help` for the available settings.
|
| 91 |
+
|
| 92 |
+
## Code license
|
| 93 |
+
|
| 94 |
+
Original GameDojo environment, training, and evaluation code is available for non-commercial scientific research under the [GameDojo Non-Commercial Research License](environments/LICENSE). The original games and their intellectual property belong to the respective original game companies and rights holders. See the [third-party notices](environments/THIRD_PARTY_NOTICES.md).
|
| 95 |
+
|
| 96 |
## Collection
|
| 97 |
|
| 98 |
We use coding agents to write encounter-specific behavior-tree controllers from environment source code, internal state information, and task instructions. These controllers play the encounters in parallel across simulator instances. We verify episode outcomes using the environment state.
|