English | ็ฎไฝไธญๆ | ๆฅๆฌ่ช
Type one sentence. Get a playable game. Scan. Play.
Describe the game in your head โ AI plans it, writes the full code, builds it, fixes its own mistakes, and hands you a QR code. Your phone is the controller screen.
| Game Library (live preview + QR) | AI-generated game running on a phone |
|---|---|
![]() |
![]() |
The soccer game above was 100% AI-generated from the sentence "ไธ็ๆฏไปปๆ็ๅคงๅธ" โ code, visuals, sound effects, all of it.
LLMs can write code โ but going from "an idea" to "something you can actually play" is still a slog: scaffolding, dependencies, build errors, broken layouts on mobile, and the inevitable half-finished output.
Game Arena closes that loop end-to-end:
- It plans before it codes โ a multi-skill planning stage (interaction / gameplay / level / numerical design) produces a real design spec first
- It builds and repairs itself โ source validation +
vite build; on failure the LLM auto-fixes, and if that still fails, a stable fallback of the same game type is served. You always get something playable - Zero-click sharing โ every game gets a QR code; scan it on the same LAN and play on your phone instantly
- ๐ฃ๏ธ One-sentence generation โ natural language in, complete React + TypeScript game out (optional reference image for visual style)
- ๐ก Streaming progress โ SSE pushes every step live (planning โ codegen โ build โ preview), with cancellable generation
- ๐ง Self-repair & fallback โ build failure triggers an LLM fix round; ultimate failure swaps in a stable fallback version
- ๐น๏ธ Game library โ search, sort, live-preview, share via QR, delete; all generated games in one place
- ๐ฑ Scan-to-play โ automatic QR codes, phone-optimized 375px portrait gameplay with synthesized Web Audio sound
- ๐ i18n โ Chinese & English, auto-detected from your browser, one-click switch
- ๐จ Esports-grade UI โ neon arcade design with a HUD-style generation screen
# 1. Add your ARK API key to backend/.env
echo 'ARK_API_KEY=your_api_key_here' > backend/.env
# 2. Run everything
docker compose up --buildOpen http://localhost:8080 โ that's it.
Prerequisites: Node.js 20+ & pnpm ยท Python 3.10+ ยท a Volcengine ARK API key
# 1. Configure the backend
cat > backend/.env <<'EOF'
ARK_API_BASE=https://ark.cn-beijing.volces.com/api/coding/v3
ARK_API_KEY=your_api_key_here
ARK_MODEL=ark-code-latest
ARK_VISION_MODEL=kimi-k2.7-code
EOF
# 2. Backend (port 8002)
cd backend && pip install -r requirements-deploy.txt && python3 game_service.py
# 3. Frontend (port 3000, auto-proxies /api & /preview)
cd game-generator-ui && pnpm install && pnpm devOpen http://localhost:3000, type something like "ๅไธชๆๅฐ้ผ ๆธธๆ", and watch it come alive.
Your sentence โโโบ โ Planning โโโบ โก Code Generation โโโบ โข Validation
(optional (4 design skills: (App.tsx + index.css (dangerous API /
image style) interaction, with hard rules: incomplete code /
gameplay, level, mobile 375px, rAF interaction entry)
numerical) loop, Web Audio)
โ
โฅ Scan & Play โโโ โค Build โโโ โฃ Auto-Repair
(QR code, (vite build (LLM fixes
same LAN) + preview) failures, fallback
as safety net)
- Planning โ
game-planning/*/SKILL.mdfiles act as system prompts; the LLM produces a design spec across up to 4 dimensions - Code generation โ the LLM outputs
===GAME_META=== / ===APP_TSX=== / ===INDEX_CSS===sections under strict hard rules (no100vh, rAF game loop, synthesized audio, nolocalStorage/eval) - Validation & repair โ static checks + real
vite build; failures feed back to the LLM for one fix round - Guaranteed playable โ if repair still fails, a stable same-type fallback is deployed instead
- Instant sharing โ built games are served at
/preview/{id}/and rendered into a QR code
| Layer | Technology |
|---|---|
| Frontend | React 18 ยท TypeScript ยท Vite ยท Tailwind CSS ยท framer-motion ยท lucide-react |
| i18n | i18next ยท react-i18next |
| Backend | FastAPI ยท uvicorn ยท httpx ยท pydantic |
| LLM | Volcengine ARK (chat/completions, code + vision models) |
| Deployment | Docker ยท Node reverse proxy |
| Method | Path | Description |
|---|---|---|
POST |
/api/games/generate-llm-stream |
Stream-generate a game (SSE: step progress โ done/error) |
GET |
/api/games/list |
List built games |
GET |
/api/games/{game_id}/health |
Query build status |
DELETE |
/api/games/{game_id} |
Delete a game |
GET |
/api/games/types |
List supported game types & themes |
GET |
/preview/{game_id}/ |
Play the built game |
All via backend/.env:
| Variable | Default | Description |
|---|---|---|
ARK_API_KEY |
โ | Required. Volcengine ARK API key |
ARK_API_BASE |
https://ark.cn-beijing.volces.com/api/coding/v3 |
API endpoint |
ARK_MODEL |
ark-code-latest |
Model for planning / codegen / repair |
ARK_VISION_MODEL |
kimi-k2.7-code |
Vision model for reference-image style analysis |
GAME_PLANNER_MAX_TOKENS |
4096 |
Planning overview max tokens |
GAME_PLANNER_SUB_SKILL_MAX_TOKENS |
2048 |
Planning sub-skill doc max tokens |
GAME_PLANNER_TIMEOUT_SECONDS |
90 |
Planning LLM timeout |
GAME_PLANNER_TEMPERATURE |
0.5 |
Planning temperature |
GAME_GENERATOR_TIMEOUT_SECONDS |
240 |
Code generation timeout |
GAME_GENERATOR_MAX_KEPT_GAMES |
200 |
Max games kept (oldest auto-cleaned) |
โโโ backend/ # FastAPI service (port 8002): LLM calls, codegen, build, API
โโโ game-generator-ui/ # React frontend (port 3000)
โ โโโ src/
โ โโโ components/ # SideNav / ArenaScreen / ConsolePanel / LibraryPage / ...
โ โโโ hooks/ # useGameGeneration (SSE) / useGameList / useToast
โ โโโ i18n/ # zh & en locales
โโโ game-planning/ # Planning skills (system prompts for the planning stage)
โโโ skills/game-templates/ # Scaffold templates + runtime output dir for generated games
โโโ prebuilt-games/ # Prebuilt games shipped with the image
โโโ deploy/ # start.sh / proxy.js (container entry)
โโโ docker-compose.yml
โโโ Dockerfile
Chinese & English ship out of the box โ auto-detected from navigator.language, manually switchable, persisted to localStorage. To add a language: drop a new JSON into game-generator-ui/src/i18n/locales/ and register it in src/i18n/index.ts.
Questions, ideas, or just want to chat about AI-generated games? Scan to join โ ๅๆไบคๆต:
| QQ Group | |
|---|---|
![]() |
![]() |
If Game Arena sparks an idea for you, a star means a lot โ it helps more people discover the project. Issues and PRs are always welcome!




