feat: Pokemon Battle World Agent + world manifest protocol#68
Open
Jing-yilin wants to merge 2 commits intomainfrom
Open
feat: Pokemon Battle World Agent + world manifest protocol#68Jing-yilin wants to merge 2 commits intomainfrom
Jing-yilin wants to merge 2 commits intomainfrom
Conversation
- Add manifest field to world.join response in server.mjs (rules, actions, state_fields) - Create pokemon.mjs: turn-based Pokemon battle world using @pkmn/sim - 1v1 battles with random Gen 1 teams (3 Pokemon each) - Agent vs built-in RandomAI - Actions: move (slot 1-4), switch (slot 1-6) - Returns structured battle state (active Pokemon, HP, moves, team, log) - Full manifest describing rules, actions, objectives on join - Add @pkmn/sim, @pkmn/randoms, @pkmn/data dependencies to world/package.json Closes #67
- Add web/pokemon.html, pokemon-client.js, pokemon-style.css - Uses @pkmn/img for official Pokemon Showdown Gen 1 sprites - Battle scene with front/back sprites, HP bars, move buttons - Switch UI when Pokemon faints, team panel with icons - Battle log with color-coded entries (damage, faint, critical) - Keyboard shortcuts (1-4 for moves) - Add /play/join, /play/action, /play/new REST endpoints to pokemon.mjs - Serve frontend at /pokemon on the world agent port
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements #67 — adds a world manifest protocol and the first game world: a Pokemon Battle Arena.
World Manifest Protocol
When an agent sends
world.join, the response now includes amanifestfield describing:This allows AI agents to understand how to play in any world without external docs.
Pokemon Battle World Agent (
world/pokemon.mjs)A standalone DAP World Agent running a turn-based Pokemon battle engine:
@pkmn/sim(MIT license) — same engine as Pokemon Showdownmove(slot 1-4) andswitch(slot 1-6)Testing
Verified locally: full battle from join → 15 turns → battle over with winner.
Closes #67