# OpenGame
**Repository Path**: xuegoo_admin/OpenGame
## Basic Information
- **Project Name**: OpenGame
- **Description**: No description available
- **Primary Language**: Unknown
- **License**: Apache-2.0
- **Default Branch**: main
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2026-04-26
- **Last Updated**: 2026-04-26
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# OpenGame: Open Agentic Coding for Games
Yilei Jiang, Jinyuan Hu, Qianyin Xiao, Yaozhi Zheng, Ruize Ma, Kaituo Feng,
Jiaming Han, Tianshuo Peng, Kaixuan Fan, Manyuan Zhang, Xiangyu Yue*
*CUHK MMLab*
`yljiang@link.cuhk.edu.hk`, `xyyue@ie.cuhk.edu.hk`
*\*Corresponding author*
[](https://www.opengame-project-page.com/)
[](https://arxiv.org/abs/2604.18394)
[](https://huggingface.co/papers/2604.18394)
[](https://nodejs.org/)
**An open-source agentic framework for end-to-end web game creation from a prompt.**
|
Marvel Avengers: Infinity Strike
Prompt: "Build an epic side-scrolling action platformer starring the Avengers. I want to select between Iron Man (lasers & flight), Thor (hammer melee & lightning), or Hulk (smash attacks) to fight through 3 distinct levels: a ruined City, a SHIELD Helicarrier, and finally Titan. Each hero needs a basic attack, a special skill, and a screen-clearing Ultimate move. The final boss must be Thanos using Infinity Stone powers. The art style should be hardcore 90s Capcom arcade pixel art, not cute/chibi."
Intro: Choose your superhero. Clear stages with epic beatdowns and crush the mastermind. 选择你的超级英雄,清除关卡并击败Boss。
▶ Live Demo
·
↓ Source
|
Harry Potter: Arithmancy Academy
Prompt: "Create a turn-based card battle game set in a pixel art Hogwarts. I want to play as a wizard student dueling a rival in the Dueling Club. The twist is that magic requires knowledge: to cast spell cards like 'Expelliarmus' or 'Stupefy', I must answer trivia questions (Math/Science) correctly. Include a 'Magic Resonance' combo system where getting consecutive right answers boosts my spell damage. The style should be atmospheric Gothic fantasy pixel art with parchment-style UI and magical particle effects."
Intro: Cast spell cards by answering trivia correctly. Chain combos for bonus damage. 正确答题释放魔法卡牌,连续答对触发魔力共振连击。
▶ Live Demo
·
↓ Source
|
|
K.O.F: Celestial Showdown
Prompt: "Make a local 2-player quiz fighting game that looks and feels like a classic 90s SNK retro arcade fighter (like The King of Fighters). Instead of punching, players fight by racing to hit a 'Buzzer Key' to answer physics questions. If you answer fast and correctly, you deal damage; if you're wrong, you take self-damage. The setting is a grand fighting tournament stage located in a majestic 'Heavenly Court' (Chinese celestial realm), complete with ancient jade gates, floating auspicious clouds, and golden traditional motifs. Include dramatic health bars, screen shake on hits, and a 'K.O.' sequence. Visuals should be highly detailed 16-bit pixel art, typical of 90s arcade cabinets."
Intro: Two players race to buzz in and answer physics questions. Right answers deal damage; wrong answers backfire. 双人抢答物理题,答对造成伤害,答错反噬自身。
▶ Live Demo
·
↓ Source
|
Hajimi Defense: The Tuna Crisis
Prompt: "Make a hilarious tower defense game called 'Hajimi Defense' where cute cats defend a 'Golden Tuna Can' from an invasion of household pests (Cucumbers and Vacuums). The towers should be funny cat memes: a spitting Tabby, a sniper Siamese, and a fat orange cat that throws buns for AOE damage. Include a mechanic where players can click to break obstacles (like boxes) to free up building space. The art style should be hand-drawn, pastel, and super cute (Kawaii)."
Intro: Deploy cat towers to defend the Golden Tuna Can from waves of household invaders. 部署猫猫炮塔,保卫金枪鱼罐头抵御入侵者。
▶ Live Demo
·
↓ Source
|
|
StarWars: Mandalorian Protocol
Prompt: "Create a high-intensity top-down action RPG shooter set in the Star Wars universe. Play as The Mandalorian fighting through an Imperial Base to rescue Grogu. The gameplay should be a Twin-Stick Shooter style where I can use a Blaster (ranged), a Beskar Spear (melee), and a Jetpack Dash to dodge. Include Stormtrooper enemies and a tactical depth system where characters can walk behind crates and walls. The visuals should be metallic sci-fi pixel art."
Intro: Fight through the Imperial Base as the Mandalorian. Shoot, slash, and dash to rescue Grogu. 扮演曼达洛人突入帝国基地,射击、喷射闪避,营救古古。
▶ Live Demo
·
↓ Source
|
Squid Game: Red Light, Green Light
Prompt: "Recreate the intense 'Red Light, Green Light' scene from Squid Game as a survival reflex game. The player controls a character in a green tracksuit running across a sandy field towards a finish line. There is a Giant Robot Doll on the right; when she sings, we run; when she turns her head, we must stop instantly or get shot. Crucial visual detail: Dead bodies and blood pools should NOT disappear, they must pile up on the field to create a chaotic atmosphere. Use a gritty, realistic 16-bit pixel art style."
Intro: Run when she sings, freeze when she turns. One wrong move and you're eliminated. 她唱歌时跑,她转头时定住。一步走错,当场淘汰。
▶ Live Demo
·
↓ Source
|
**To run a demo locally:**
```bash
unzip demo_*.zip && cd demo_*
npm install
npm run dev # opens at http://localhost:5173
```
## Installation
#### Prerequisites
```bash
# Node.js 20+
curl -qL https://www.npmjs.com/install.sh | sh
```
#### From source (recommended while we prepare the npm release)
```bash
git clone https://github.com/leigest519/OpenGame.git
cd OpenGame
npm install
npm run build
npm link
```
This exposes the `opengame` command on your `PATH`.
## Quick Start
OpenGame is currently driven from the command line in **headless mode** —
you give it a one-shot prompt and it builds the game end-to-end.
```bash
# Create an empty folder for your new game
cd agent-test
mkdir -p games/my-game && cd games/my-game
# Generate the game from a single prompt
opengame -p "Build a Snake clone with WASD controls and a dark theme." --yolo
```
When the agent finishes, open the generated `index.html` (or run the printed
dev-server command) in your browser to play your game.
> If you prefer to create games anywhere on disk, set absolute paths instead:
>
> ```bash
> export GAME_TEMPLATES_DIR="/absolute/path/to/OpenGame/agent-test/templates"
> export GAME_DOCS_DIR="/absolute/path/to/OpenGame/agent-test/docs"
> ```
>
> Headless runs auto-elevate the approval mode to `auto-edit` so the agent
> can write/edit files. Shell commands stay disabled by default — pass
> `--yolo` (or `--approval-mode yolo`) if you want the agent to also run
> shell commands. See
> [`docs/users/features/headless.md`](docs/users/features/headless.md) for
> the full headless reference.
#### Authentication
OpenGame's agent runtime supports an OpenAI-compatible API. Set the following environment variables:
```bash
export OPENAI_API_KEY="your-api-key-here"
export OPENAI_BASE_URL="https://api.openai.com/v1" # optional
export OPENAI_MODEL="gpt-4o" # optional, swap in GameCoder-27B when running it locally
```
#### Asset / GDD provider keys (image, video, audio, reasoning)
Beyond the main agent LLM, OpenGame's asset-generation tools talk to image,
video, and audio providers. You bring your own keys for each — OpenGame ships
with no defaults. Each modality is configured **independently**, so you can
mix providers (e.g. DashScope for image, Doubao for video, OpenAI for
reasoning):
```bash
export OPENGAME_IMAGE_PROVIDER=tongyi # tongyi | doubao | openai-compat
export OPENGAME_IMAGE_API_KEY=sk-...
# ...and similarly for OPENGAME_REASONING_*, OPENGAME_VIDEO_*, OPENGAME_AUDIO_*
```
A complete env-var reference, settings.json schema, and examples for OpenAI /
fal.ai / OpenRouter / DashScope / Doubao live in
[`docs/users/configuration/api-keys.md`](docs/users/configuration/api-keys.md).
A copy-paste template is at [`.env.example`](.env.example).
OpenGame prints a one-line provider-status banner at startup so you can
confirm which modalities are wired up before the run begins.
## Game Skill
OpenGame's agent is bootstrapped with **Game Skill**, a reusable capability split into two parts:
- **Template Skill** — picks an appropriate engine/template (canvas, Phaser, three.js, etc.) and scaffolds a stable, conventional project structure so later edits stay coherent.
- **Debug Skill** — runs the game in a sandbox, catches integration errors, console errors, and broken interactions, and systematically resolves them until the game is playable end-to-end.
Together they let the agent move from "writes plausible code" to "ships a working game."
## Configuration
OpenGame can be configured via `settings.json`, environment variables, and CLI flags.
- **User settings**: `~/.qwen/settings.json`
- **Project settings**: `.qwen/settings.json`
> The on-disk settings directory is currently still named `.qwen` for backward compatibility with the upstream agent runtime. We plan to migrate this to `.opengame` in a future release.
## GameCoder-27B
`GameCoder-27B` is a Code LLM purpose-built for OpenGame. It is trained with:
1. **Supervised Fine-Tuning (SFT)** on curated game-development trajectories covering engine APIs, project scaffolding, and bug-fix workflows.
2. **Reinforcement Learning** with reward signals derived from real game playability (using OpenGame-Bench-style verifiers).
## OpenGame-Bench
`OpenGame-Bench` is a benchmark for evaluating agents that build interactive web games. Unlike static code-evaluation benchmarks, it dynamically launches generated games, drives them with scripted interactions, and verifies playability criteria (rendering, controls, game-loop progression, win/loss states, etc.).
The evaluation pipeline will be released soon.
## Acknowledgments
OpenGame builds on the excellent open-source work of:
- **[qwen-code](https://github.com/QwenLM/qwen-code)** — the agent runtime and CLI scaffolding that OpenGame extends with Game Skill, GameCoder-27B integration, and OpenGame-Bench tooling.
- **[Google Gemini CLI](https://github.com/google-gemini/gemini-cli)** — the original CLI architecture that qwen-code is itself based on.
- **[Phaser](https://github.com/phaserjs/phaser)** — the fast, free, and open-source HTML5 game framework used for game rendering and mechanics.
We thank these teams and communities for making their work openly available.