
If this project helps you, feel free to buy me a coffee
๐ฑ Follow the developer on Bilibili: ่ฟ็ฑณไธ
Battle assistant for Roco Kingdom: World PVP โ turn-by-turn AI coach, damage reverse engineering, and a sandbox for what-if analysis.
็ฎไฝไธญๆ | English
A desktop companion that sits alongside your PVP match. While the in-game UI shows HP percentages and damage numbers, Roco Sandbox tells you what those numbers actually mean.
- ๐งฉ Predict opponent personality and talent stats
- ๐ Preview who wins the next few turns
- ๐ค Get AI coaching for every turn
- ๐ง Correct the simulation when it diverges from reality
All recommendations are grounded in PVP Introduction tactical principles โ analyzing Check/Counter relationships, redundancy tactics, and breakthrough tactics rather than raw damage comparison.
- ๐ง True conversation memory โ the AI remembers its advice from round 2 when reasoning about round 3
- โก Preloaded system prompt โ full team context injected once, then lightweight per-turn calls
- โฉ๏ธ Undo sync โ rolling back a turn also trims the AI chat history
- ๐พ Persistent sessions โ stored in localStorage, survives restarts
- ๐ฐ Low cost โ roughly 0.001 RMB per turn, about one cent for a 30-turn match
After every turn, a slim bar appears at the bottom with a 1.5-second progress bar.
- โ Normal turns auto-confirm โ zero friction
- ๐ด Key events (KO, evolution, mark layer change, freeze) force manual confirmation
- ๐ Press
Eto expand the correction panel โ adjust enemy HP%, your HP, observed damage, and energy - โณ The AI is delayed during the bar โ only fires after you've locked in the data
Tell it the actual damage dealt, and it reverse-solves the damage formula to narrow down the opponent's attack stat and personality.
Each observation shrinks the range. After 3โ5 corrections, the engine identifies the enemy's likely personality name and pins their attack stat to within ยฑ10. Future damage predictions use the inferred range instead of default popular builds.
The estimate appears as a purple badge on the enemy panel:
็ฉๆปโ195ยทๅๆง / ้ญๆปโ210ยทไธๆณจ (5 observations)
Every turn is recorded โ state before, state after, both players' actions โ and displayed as a horizontal timeline at the bottom.
- ๐ Click any past turn to open retrospective correction
- ๐ "Only this one" โ override that turn's display without affecting later turns
- ๐ "Replay to current" โ re-simulate all subsequent turns using the corrected state
- ๐ค The AI receives a correction notice so it knows the context shifted
Paste the official share format โ the kind of text players post on community platforms:
### Team Name
# ้ญๆณ๏ผ่ฟๅไนๅ
#
# Pokรฉmon A๏ผFire Bloodlineใ{Skill 1ใSkill 2ใSkill 3ใSkill 4}
# Pokรฉmon B๏ผDark Bloodlineใ{Skill 1ใSkill 2ใSkill 3ใSkill 4}
...
One click creates a team with all 6 Pokรฉmon, their bloodlines, skills, recommended personality and talent (auto-resolved through evolution chains and leader form lookups), plus the magic item.
โ ๏ธ Personality and talent values imported via the official formula use recommended builds. Adjust manually if they differ from your actual configuration.
Type the first letter(s) of each Chinese character's pinyin to filter results instantly.
tmatches skills where any character starts with ttqmatches skills with two characters starting with t + qdmmatches Pokรฉmon whose name starts with d + m
All 6 search boxes in the app support this feature.
Approximately 95% trait coverage across five handlers plus two supplemental systems.
- ๐ช Entry traits โ ~30 effects on switch-in
- ๐ถ Exit traits โ cleanup or transfer on switch-out
- ๐ End-of-turn traits โ periodic effects like dedication and auto-detach
- ๐ก๏ธ Counter traits โ triggered on successful counter
- โ๏ธ On-attack traits โ ~25 attack-time patterns
- ๐ Capture balls โ 14 variants with different stat modifiers
- ๐ธ Beast bloodlines โ 18 type-based effects
Only persistent fields survive switching; all others are cleared and recalculated on re-entry.
- โ๏ธ Battle โ live match flow with team panels, AI engine, and 3-column matchup analysis
โถ๏ธ Replay โ paste battle logs, view structured turns, AI replay analysis (up to 50 saved)- ๐ฅ Teams โ featured teams browser, formula import, template management
- ๐ Pokedex โ all 525 monsters by index number with recommended builds
- ๐ Tutorial โ reader-style with table of contents, textbook prose, and term tables
- โ Settings โ API key, suggestion mode, rank mode, theme, font size, data management
- ๐ฅ๏ธ Desktop shell โ Tauri 2 (Rust)
- โ๏ธ Frontend โ React 19 + TypeScript (strict mode)
- ๐จ Styling โ Tailwind CSS v4
- ๐ฆ Build โ Vite 7
- ๐ค AI โ DeepSeek (multi-turn chat completions)
- ๐ Data โ 525 monsters, 501 moves, 18 types
The Rust backend is intentionally pass-through โ all business logic lives in TypeScript for fast iteration.
๐ก If Windows shows "Windows protected your PC" or "Unknown publisher" after downloading the installer, click "More info" โ "Run anyway". This software is a safe open-source project; we simply don't have a paid code signing certificate.
- Node.js 18 or higher
- Rust (for building the desktop app)
- Windows 10 or 11 (macOS/Linux should work but untested)
git clone https://github.com/HZ-KMNO/roco-sandbox.git
cd roco-sandbox
npm install
npm run tauri dev # Full desktop app with hot reload
# or
npm run dev # Frontend only at http://localhost:1420npm run tauri build
# Output: %CARGO_TARGET_DIR%/roco-sandbox/release/bundle/The app works without AI โ a rule-based suggestion engine takes over. To enable AI:
- Get an API key from the DeepSeek Platform
- Open the app โ Settings โ paste the key
- Add the first enemy โ AI auto-preloads and starts suggesting after each turn
A comprehensive usage guide is available at docs/app-guide.md (in Chinese). It covers all tabs, advanced features, keyboard shortcuts, and FAQ. Also accessible in-app via the Tutorial tab (pinned at the top).
src/
โโโ App.tsx # Tab shell, settings, AI orchestration
โโโ components/
โ โโโ TeamPanel.tsx # Your team
โ โโโ EnemyPanel.tsx # Opponent team
โ โโโ MatchupAnalysis.tsx # 3-column battle UI
โ โโโ TurnCorrectionBar.tsx # 1.5s correction bar
โ โโโ TurnTimeline.tsx # Timeline & cascade replay
โ โโโ QuickImport.tsx # Formula import
โ โโโ MonsterCard.tsx # Monster detail card
โ โโโ FeaturedTeams.tsx # Teams tab
โ โโโ Pokedex.tsx # Pokedex tab
โ โโโ Tutorial.tsx # Tutorial reader
โ โโโ ReplayAnalysis.tsx # Replay tab
โโโ lib/
โโโ calculator.ts # Damage formula & stat calc
โโโ battle.ts # Matchup analysis
โโโ simulator.ts # Turn engine & trait handlers
โโโ aiAdvisor.ts # DeepSeek client (multi-turn)
โโโ aiSession.ts # Session persistence & truncation
โโโ observations.ts # Damage observation log
โโโ damageReverser.ts # Reverse engine
โโโ battleTimeline.ts # Turn records & cascade replay
โโโ officialFormatParser.ts # Share-format parser
โโโ popularStats.ts # Recommended config lookup
โโโ pinyinSearch.ts # Pinyin search
See CLAUDE.md for an architecture deep dive.
User selects skills โ Space (execute)
โ resolveTurn() โ new state
โ TurnRecord recorded
โ Correction bar appears (1.5s)
โโ Key event? โ red, must confirm
โโ Press E โ correction panel
โ โโ Apply โ BattleState updated + observation recorded
โโ Auto or manual confirm
โ getTurnAdvice() with multi-turn history
โ AI reply + localStorage persistence
Undo โ state rollback + AI history trim + notice banner
Retrospective fix โ Timeline โ this-only or cascade replay
This is a personal project, but pull requests are welcome:
- ๐ Bug fixes for trait edge cases
- ๐ New recommended build data
- ๐ Tutorial content updates
- ๐ Localization
This project is for educational and personal use only. Game data belongs to the original IP holder of Roco Kingdom: World.
โ ๏ธ No piracy. No commercial use. This is a free open-source project. If you paid for access, please report the seller and demand a refund.
- ๐ RK Team Builder โ team building reference
- ๐ LCX Wiki โ monster and move data source
- ๐ Roco PVP Assistant โ popular teams API
- ๐บ Zhuo Shuai โ recommended builds for all monsters
- ๐ค DeepSeek โ affordable multi-turn LLM API
- ๐ฅ Roco Kingdom: World community โ tactical theory contributors
- ๐ WwlWss โ tactical theory
โ๏ธ Have fun. The best players know when to stop trusting the simulator.
