---
name: ezyplatform-vibe-game
description: Build any game (2D or 3D, single player or online multiplayer) for a non-technical "vibe coder", end to end, on EzyPlatform (server) and the Vibe Game C++/SDL3 engine (client) - checks that EzyPlatform is installed (installs it with the ezyplatform-install skill if not), creates the server project with the ezyplatform-develop skill (theme, web plugin, admin plugin, socket plugin, socket app), installs the game plugins (ezylogin, ezygame, game-master-server) and learns their APIs by decompiling their jars, asks the user for the game description, gameplay and assets (generates the assets when there are none), clones vibe-game as the client library in its own folder, writes the client by its docs, asks which platforms to build (browser, macOS, iOS, Android, Windows, Linux), then wires everything together, starts every server, builds and runs the client and tests it until the user can actually play. Use when the user asks to make / build / code / làm / tạo / lập trình a game, trò chơi, game online, game nhiều người chơi, or wants to turn a game idea into something playable with EzyPlatform or vibe-game.
---
# Build a game for a vibe coder (EzyPlatform + Vibe Game)
The user describes a game in plain words; you do every technical step, ask only about the game and confirmations, and talk in the user's language, briefly. Done means the user is playing it on the platform they chose, not that it compiles.
`<skill>` is the folder of this file. Tools:
| Tool | What |
|---|---|
| `python3 <skill>/scripts/vgame.py <command>` | The repetitive steps, each printing a few `RESULT_*` lines, `NEED <code>: <fix>` (exit 3) or `ERROR` (exit 1). Commands below. `--home <EZYPLATFORM_HOME>` goes before the command when the home is not found. |
| `python3 <skill>/scripts/gen_assets.py --out <client>/assets` | Pillow template that draws sprites, background, tiles, buttons, panels with outlines and shadows; copy it to `<client>/tools/` and edit the palette and shapes |
| `references/server.md` | Read before writing server code |
| `references/client.md` | Read before writing client code |
| `references/lessons.md` | Read when a step of the chain fails |
`vgame.py` commands: `fetch-skills`, `socket start|stop|restart|status`, `logs socket|admin|web`, `prepare`, `chain`, `client-init`, `emsdk`, `build <preset>`, `run <preset>`, `app-log <preset>`. Commands that start Java (`socket`) run through `ezydev run` so JDK 8 and `EZYPLATFORM_HOME` are set: `ezydev run python3 <skill>/scripts/vgame.py socket start` (Windows: `ezydev run "python <skill>\scripts\vgame.py socket start"`).
When the user already has an `EZYPLATFORM_HOME` in their shell for another EzyPlatform, it wins over `--dir` in `ezydev`. For an install made by ezyplatform-install in another folder, run every `ezydev` command with `EZY_DIR=<install dir>` and `EZYPLATFORM_HOME` unset (`env -u EZYPLATFORM_HOME EZY_DIR=<dir> bash <develop>/scripts/ezydev.sh ...`); `--dir` cannot be used with `ezydev run` (it is passed to the command).
## Save tokens
- Use the script outputs; do not `cat` whole logs or build outputs. `vgame.py logs <server>` gives the distinct error lines, `vgame.py build` prints only compiler errors, `vgame.py app-log <preset> --grep <regex>` filters the client log.
- Read a reference file only at the step that needs it, once. Read the vibe-game `README.md` fully, but `docs/project-structure.md` only for the section you need (layout, per-platform build, web rules).
- Decompile only the classes you need and write what you learn to `<project>/docs/server-notes.md`; next time read that file instead of decompiling again.
- Ask the user once per topic (game, platforms), with defaults they can accept with "ok".
## Rules
- Ask only about the game and about choices with a cost (paid plugin, large toolchains like Xcode or the Android SDK, replacing the active theme, deleting data). Never ask the user to edit files, run commands or read errors.
- Never print secrets (`setup.properties`, `encryption-keys.txt`, `.ezy/*`, tokens, passwords) and never log tokens in game code. The admin password goes only into the environment variable `EZY_ADMIN_PASSWORD` of one command.
- Never edit installed plugins, the platform, or the vibe-game engine (`<vibe-game>/lib/`) for one game.
- Do not guess plugin APIs: install the plugin and decompile its jars (`ezydev find-class`, `ezydev decompile`).
- The server decides everything that matters in multiplayer (hits, damage, score, rewards); the client predicts and draws.
- Long steps run with a long timeout; tell the user what is happening and about how long.
## Steps
### 1. Get the EzyPlatform skills and EzyPlatform
1. If the skills `ezyplatform-install` and `ezyplatform-develop` are available to you, use them. Otherwise `python3 <skill>/scripts/vgame.py fetch-skills` downloads them (`RESULT_EZYPLATFORM_INSTALL`, `RESULT_EZYPLATFORM_DEVELOP` are their folders); read each `SKILL.md` when you reach its step. `ezydev` below is the script of ezyplatform-develop.
2. `ezydev check`. Not installed: install with ezyplatform-install in **native** mode. Docker-only: install a native one next to it. Stopped: `ezydev restart`. Missing dev tools: `ezydev setup`.
### 2. Ask about the game (one message)
Name and one-line pitch; gameplay (what the player does, controls, how a round starts/ends, win/lose, score); players (solo, or online: how many per room, friends or anyone, bots when alone); look (2D/3D, view, style, colors, mood, sound); assets they already have and where; extras (levels, shop, leaderboard, chat). Offer to decide anything they skip.
Write `<client>/docs/game-design.md` later in step 5 (core loop, controls per platform, rules and numbers, screens, server vs client duties, asset list, a "later" list). Summarize it in a few lines and get an OK. The first version is small: one mode, one level, the core loop, a result screen.
### 3. Ask which platforms
Recommend the browser first (easiest to share). Options: browser, macOS, iOS Simulator, Android phone (USB), Windows, Linux. Mention what each installs (`references/client.md` table). Get one platform fully playable before the next.
### 4. Server project
1. `ezydev create <name> --group <com.company> --modules theme,web-plugin,admin-plugin,socket-plugin,socket-app --out <workspace>` (offline game: drop the socket modules). Read the generated `AGENTS.md` and `SKILL.md`.
The SDK puts the socket app and plugin in their own zone (`zone.name` in `<name>-socket-app/module.properties`, settings in `<name>-socket-plugin/<name>-zone-settings.xml`): keep it, and widen `user-name-pattern` to `{3,64}` there (guest usernames are 41 characters).
2. `ezydev link ezylogin ezygame game-master-server`, then `ezydev install-plugin data-backup logs-monitor --no-restart` (the generated poms need both) and `ezydev sync-versions`, from the project root. Add `ezyaccount`, `ezychat`, `ecommerce` only when the design needs them; tell the user what and why.
3. Add `com.tvd12:ezyfox-server-java-client:1.3.2` to `<name>-socket-app/pom.xml` dependencies (the ezygame socket plugin needs it for the game master broker), then `ezydev export`, then `ezydev run python3 <skill>/scripts/vgame.py socket start` (it also enables the socket target, disabled on a fresh install).
4. `EZY_ADMIN_PASSWORD='<admin password>' python3 <skill>/scripts/vgame.py prepare`: allows guest login and socket tokens in ezylogin and creates the `LOBBY` instance. Then `vgame.py socket restart` and `vgame.py chain` until `RESULT_CHAIN=ok`.
5. Read `references/server.md`, decompile what it lists, write `docs/server-notes.md`.
6. Write the server (socket plugin login, socket app game, web/admin APIs) and `docs/protocol.md`. After each change: `ezydev export`, `vgame.py socket restart` (through `ezydev run`), `vgame.py logs socket`.
### 5. Client project
1. `python3 <skill>/scripts/vgame.py client-init --project <project folder> --name "<Game Name>" --app <socket app name> --org <company> --http <web url>`: clones vibe-game next to the project if missing and creates `<project>/<project>-client` (CMake files, presets, `configs.json`, sample `src/`); the zone comes from the socket app's `module.properties`.
2. Read `<vibe-game>/README.md`, then `references/client.md`.
3. Assets: copy the user's files into `assets/` (PNG, OGG, TTF), or copy `gen_assets.py` into `tools/`, edit it to the design, run it, show the user the PNGs.
4. Write the game from `docs/game-design.md` and `docs/protocol.md`.
### 6. Wire, run and test until playable
Fix the first failing step before going on (`references/lessons.md` when stuck):
1. `vgame.py socket status` (through `ezydev run`): TCP and WebSocket ports open.
2. `vgame.py chain`: guest register, login, game server list, `LOBBY` instance. `NEED register` or `NEED no_lobby_instance` → `EZY_ADMIN_PASSWORD='<admin password>' vgame.py prepare`, then `vgame.py socket restart`, then `chain` again.
3. Toolchain: browser `vgame.py emsdk`; other platforms see `references/client.md`.
4. `vgame.py build <preset> --client <client>` (first time: several minutes), then `vgame.py run <preset> --client <client>` (prints `RESULT_URL` for the browser, or the first app log lines).
5. `vgame.py app-log <preset> --client <client> --grep "session|error|fail"`: register, login, game servers, connected, ready, then your first command. `vgame.py logs socket` for server errors.
6. Play the core loop yourself: give the game `--autoplay` / `--bot` dev flags (`references/client.md`), run one or two copies (`vgame.py run <preset> --args=--bot --log-name bot1`), check the milestone log lines and a screenshot of the game window only. Fix, rebuild, repeat.
7. Hand over: open the game for the user, tell the controls, ask them to play a round and say what feels wrong. Iterate.
### 7. Report
Briefly, in their language: what works, what is on the "later" list, how to open the game on each platform, the admin address, the project, client and vibe-game folders, and that they can ask for the next feature. No logs, no passwords.
## Later requests
| User says | Do |
|---|---|
| change gameplay / add a feature | update the design and protocol docs, server, client, then step 6 |
| new art or sounds | replace files in `assets/` or rerun `tools/gen_assets.py`; web: `vgame.py build <preset> --clean` |
| another platform | step 3, then `references/client.md` |
| put the browser game on the website | build `web-release`, copy `build/web-release/` into `<project>-theme/src/main/resources/static/play/`, `ezydev export` |
| play with friends over the internet | public host with a domain and TLS, `configs.json` `http` to it, release builds (they refuse `http://`/`ws://`) |
| start again after a reboot | `ezydev restart`, `vgame.py socket start`, `vgame.py chain` |