Add GameDojo game environments

#2
by hanoiy - opened
This view is limited to 50 files because it contains too many changes. See the raw diff here.
Files changed (50) hide show
  1. environments/.gitignore +3 -0
  2. environments/LICENSE +30 -0
  3. environments/README.md +43 -0
  4. environments/THIRD_PARTY_NOTICES.md +8 -0
  5. environments/check_games.py +44 -0
  6. environments/games/prototype/bossbench/__init__.py +127 -0
  7. environments/games/prototype/bossbench/compact.py +315 -0
  8. environments/games/prototype/bossbench/core.py +252 -0
  9. environments/games/prototype/bossbench/engine_contract.py +130 -0
  10. environments/games/prototype/bossbench/engine_env.py +119 -0
  11. environments/games/prototype/bossbench/keymouse.py +211 -0
  12. environments/games/prototype/bossbench/mc4d.py +0 -0
  13. environments/games/prototype/bossbench/mc_scripted.py +1102 -0
  14. environments/games/prototype/bossbench/mcskin.py +0 -0
  15. environments/games/prototype/bossbench/native_games.py +249 -0
  16. environments/games/prototype/bossbench/play_server.py +404 -0
  17. environments/games/prototype/bossbench/policy_env.py +151 -0
  18. environments/games/prototype/bossbench/progress_reward.py +102 -0
  19. environments/games/prototype/bossbench/rig.py +235 -0
  20. environments/games/prototype/bossbench/scope.py +81 -0
  21. environments/games/prototype/bossbench/scripted.py +355 -0
  22. environments/games/prototype/bossbench/step_reward.py +105 -0
  23. environments/games/prototype/bossbench/tiers.py +97 -0
  24. environments/games/prototype/bossbench/unified.py +488 -0
  25. environments/games/prototype/bossbench/webenv.py +260 -0
  26. environments/games/prototype/bossbench_llm/__init__.py +6 -0
  27. environments/games/prototype/bossbench_llm/client.py +66 -0
  28. environments/games/prototype/bossbench_llm/envs.py +196 -0
  29. environments/games/prototype/bossbench_llm/frames.py +23 -0
  30. environments/games/prototype/bossbench_llm/lumine.py +194 -0
  31. environments/games/prototype/bossbench_llm/mock_server.py +89 -0
  32. environments/games/prototype/bossbench_llm/policies.py +111 -0
  33. environments/games/prototype/bossbench_llm/prompting.py +236 -0
  34. environments/games/prototype/bossbench_llm/prompts/games/battlecity_remake.json +423 -0
  35. environments/games/prototype/bossbench_llm/prompts/games/cuphead_remake.json +668 -0
  36. environments/games/prototype/bossbench_llm/prompts/games/doom_remake.json +429 -0
  37. environments/games/prototype/bossbench_llm/prompts/games/genshin_remake.json +1214 -0
  38. environments/games/prototype/bossbench_llm/prompts/games/hexen2_remake.json +611 -0
  39. environments/games/prototype/bossbench_llm/prompts/games/hollowknight_remake.json +993 -0
  40. environments/games/prototype/bossbench_llm/prompts/games/isaac_remake.json +534 -0
  41. environments/games/prototype/bossbench_llm/prompts/games/kirby_remake.json +508 -0
  42. environments/games/prototype/bossbench_llm/prompts/games/kof_remake.json +811 -0
  43. environments/games/prototype/bossbench_llm/prompts/games/mario64_remake.json +646 -0
  44. environments/games/prototype/bossbench_llm/prompts/games/megaman_remake.json +517 -0
  45. environments/games/prototype/bossbench_llm/prompts/games/minecraft.json +448 -0
  46. environments/games/prototype/bossbench_llm/prompts/games/nfsmw_remake.json +519 -0
  47. environments/games/prototype/bossbench_llm/prompts/games/quake2_remake.json +459 -0
  48. environments/games/prototype/bossbench_llm/prompts/games/sekiro_remake.json +1008 -0
  49. environments/games/prototype/bossbench_llm/prompts/games/soulknight_remake.json +652 -0
  50. environments/games/prototype/bossbench_llm/prompts/games/terraria_remake.json +462 -0
environments/.gitignore ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ __pycache__/
2
+ *.pyc
3
+ *.pyo
environments/LICENSE ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ GameDojo Non-Commercial Research License 1.0
2
+
3
+ Copyright (c) 2026 the GameDojo authors
4
+
5
+ The GameDojo authors grant permission to use, reproduce, modify, and share
6
+ original GameDojo environment code and the accompanying configuration,
7
+ documentation, and training and evaluation code in this directory solely for
8
+ non-commercial scientific research, including reproduction of research results.
9
+
10
+ Non-commercial scientific research is work whose primary purpose is scientific
11
+ inquiry and whose use of these materials is neither primarily directed toward
12
+ commercial advantage nor intended for monetary compensation. Commercial use
13
+ requires separate written permission from the applicable rights holders.
14
+
15
+ Copies and substantial portions of the covered materials, including modified
16
+ copies, must retain this copyright notice and license. Modified copies must
17
+ identify their changes and may be shared only under these terms.
18
+
19
+ All copyrights, trademarks, and other intellectual property rights in the
20
+ original games, including their titles, characters, artwork, and audio, remain
21
+ exclusively with their respective original game companies and rights holders.
22
+ GameDojo has no affiliation, endorsement, or sponsorship from those parties.
23
+ This license grants no rights in third-party material. Separately licensed
24
+ components remain subject to their own terms. See THIRD_PARTY_NOTICES.md.
25
+
26
+ THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
27
+ IMPLIED, INCLUDING WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
28
+ PURPOSE, AND NON-INFRINGEMENT. TO THE EXTENT PERMITTED BY LAW, THE AUTHORS ARE
29
+ NOT LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY ARISING FROM THE MATERIALS
30
+ OR THEIR USE.
environments/README.md ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # GameDojo environments
2
+
3
+ GameDojo contains 120 boss encounters across 20 games. The environment package provides browser play, Gymnasium interfaces, scripted reference controllers, and a model evaluation harness.
4
+
5
+ ## Setup
6
+
7
+ From this directory, install Python 3.12 dependencies and a Chromium browser for RGB observations. Install Node.js and put `node` on `PATH` to use the symbolic back end for the shared web games. Minecraft RGB observations require a working OpenGL context through ModernGL.
8
+
9
+ ```sh
10
+ python -m pip install -r requirements-games.txt
11
+ python -m playwright install chromium
12
+ ```
13
+
14
+ ## Play in a browser
15
+
16
+ Serve the game launcher at `http://127.0.0.1:8766/`.
17
+
18
+ ```sh
19
+ python -m http.server 8766 --bind 127.0.0.1 --directory games/web
20
+ ```
21
+
22
+ Start the Minecraft play server in another terminal. Its page is available directly at `http://127.0.0.1:8765/`.
23
+
24
+ ```sh
25
+ python games/prototype/bossbench/play_server.py
26
+ ```
27
+
28
+ ## Train and evaluate
29
+
30
+ Set `PYTHONPATH=games/prototype` when importing `bossbench`. The `BENCH_CASES` registry in `bossbench.scope` lists the official encounters. Use `bossbench.make_policy_env` for 200 ms keyboard and mouse actions, `bossbench.make_compact_env` for discrete semantic actions, and `bossbench.make_training_env` for the step-damage reward wrapper.
31
+
32
+ ```sh
33
+ python check_games.py --game terraria_remake --out terraria-check.json
34
+ python run_model.py --case doom/cyberdemon --tier normal --policy noop --max-steps 1
35
+ ```
36
+
37
+ `run_model.py` accepts `--format lumine` for CUA or `--format semantic` for semantic actions, and `--time paused` or `--time realtime`. For model evaluation, use `--policy chat` and set `--base-url` and `--model` to your OpenAI-compatible endpoint and model. Run `python run_model.py --help` for the available options.
38
+
39
+ ## Copyright and license
40
+
41
+ All copyrights, trademarks, and other intellectual property rights in the original games, including their titles, characters, artwork, and audio, remain exclusively with their respective original game companies and rights holders.
42
+
43
+ Original GameDojo materials in this directory are available for non-commercial scientific research under the [GameDojo Non-Commercial Research License](LICENSE). See the [third-party notices](THIRD_PARTY_NOTICES.md) and the [project copyright and use statement](https://gamedojo-benchmark.github.io/).
environments/THIRD_PARTY_NOTICES.md ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ # Third-party notices
2
+
3
+ - Three.js r160 is bundled as `games/web/games/_boss3d/vendor/three.min.js`. Copyright © 2010–2023 Three.js authors. The [MIT license](games/web/games/_boss3d/vendor/LICENSE) applies to that component.
4
+ - All copyrights, trademarks, and other intellectual property rights in the original games, including their titles, characters, artwork, and audio, remain exclusively with their respective original game companies and rights holders. The GameDojo license grants rights in original GameDojo material only.
5
+ - Quake II’s deterministic trigonometry in `q2core.js` adapts [fdlibm](https://www.netlib.org/fdlibm/). Copyright © 1993 Sun Microsystems, Inc. See the [fdlibm permission notice](games/web/games/quake2_remake/LICENSE.fdlibm).
6
+ - The Battle City environment includes stage layouts and spawn order transcribed from the reference game via an [annotated disassembly](https://github.com/cyneprepou4uk/NES-Games-Disassembly/blob/6c145873e0f344ac4f132f451ac2dc7ea95cea6b/Battle%20City/bank_FF.asm) and the [vgrichina/battlecity reference implementation](https://github.com/vgrichina/battlecity). The Mega Man environment includes weapon and boss tables transcribed via an [annotated disassembly](https://github.com/plasticsmoke/megaman1-disassembly-ca65/tree/2771fb3). The GameDojo license does not grant rights in the original games or their data.
7
+ - The Kirby encounters reference the [Kirby's Dream Land disassembly](https://github.com/ElectroDeoxys/kirbydreamland/tree/dba74416a66e4641204073276c0330f07b30cf12) and WiKirby. The source-game graphics and audio are excluded from the package.
8
+ - Upstream references for Need for Speed: Most Wanted, Hexen II, Quake II, and Tomb Raider are recorded in their game manifests.
environments/check_games.py ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Run from the delivered package in a clean Python environment. No model calls."""
2
+ import argparse, hashlib, json, os, sys, time, traceback
3
+ from pathlib import Path
4
+
5
+ parser = argparse.ArgumentParser()
6
+ parser.add_argument('--game', required=True)
7
+ parser.add_argument('--out', required=True)
8
+ args = parser.parse_args()
9
+ ROOT = Path(__file__).resolve().parent
10
+ sys.path.insert(0, str(ROOT / 'games/prototype'))
11
+ import bossbench
12
+ from bossbench.scope import BENCH_CASES
13
+ from bossbench_llm import lumine, prompting
14
+ cases = sorted(k for k,v in BENCH_CASES.items() if v['game']==args.game)
15
+ report = {'game':args.game,'python':sys.version,'checks':[], 'started':time.time(), 'test':'reset + RGB + one valid 200ms action; not a win/performance evaluation'}
16
+ for case in cases:
17
+ for tier in ('easy','normal','hard'):
18
+ env = None
19
+ start = time.time()
20
+ try:
21
+ env = bossbench.make_policy_env(case)
22
+ obs, info = env.reset(seed=1, options={'tier':tier})
23
+ assert obs.shape == (480,854,3), obs.shape
24
+ assert str(obs.dtype) == 'uint8', obs.dtype
25
+ kind = prompting.mouse_kind(args.game)
26
+ action = lumine.from_packet(bossbench.NOOP, mouse_kind=kind)
27
+ parsed = lumine.parse('<think>\n\n</think>\n\n'+action, mouse_kind=kind)
28
+ assert parsed.ok, parsed
29
+ nxt, reward, terminated, truncated, step_info = env.step(parsed.packet)
30
+ assert nxt.shape == (480,854,3)
31
+ assert prompting.system_prompt(args.game, case, 'lumine', 'en')
32
+ report['checks'].append({'case':case,'tier':tier,'passed':True,'rgb_sha256':hashlib.sha256(obs.tobytes()).hexdigest(),'reward':float(reward),'seconds':time.time()-start})
33
+ except Exception:
34
+ report['checks'].append({'case':case,'tier':tier,'passed':False,'error':traceback.format_exc(),'seconds':time.time()-start})
35
+ finally:
36
+ if env is not None:
37
+ try: env.close()
38
+ except Exception: pass
39
+ Path(args.out).write_text(json.dumps(report,indent=2),encoding='utf-8')
40
+ report['passed'] = len(report['checks']) == 18 and all(c['passed'] for c in report['checks'])
41
+ report['finished'] = time.time()
42
+ Path(args.out).write_text(json.dumps(report,indent=2),encoding='utf-8')
43
+ print(json.dumps({'game':args.game,'passed':report['passed'],'checks':len(report['checks'])}), flush=True)
44
+ sys.exit(0 if report['passed'] else 1)
environments/games/prototype/bossbench/__init__.py ADDED
@@ -0,0 +1,127 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """BossBench: every case behind one Gymnasium interface (unified.py), whatever engine runs it.
2
+
3
+ import bossbench
4
+ bossbench.ENVS # {"2d/needle_warden": "web", "3d/minecraft_wither": "py", ...}
5
+ env = bossbench.make("2d/needle_warden", obs_mode="symbolic", time_mode="virtual_rt", latency=0.3)
6
+ obs, info = env.reset(seed=0, options={"difficulty": 0.5})
7
+ obs, r, term, trunc, info = env.step("<|action_start|> 0 0 0 ; D ; D ; D,Space ; D ; J ; J <|action_end|>")
8
+ env.verifier() # {reward in [-1,1], win, outcome, boss_damage, ...}
9
+ gymnasium.make("BossBench/2d-needle_warden-v0") # same env through the gymnasium registry
10
+
11
+ Engines: "web" = web/engine + one folder per game under web/games/ (JavaScript, 60 Hz; HK-style 2D cases),
12
+ "py" = this package (Minecraft). WEB_GAME maps each web case id to its game folder.
13
+ Those engines run at 60 Hz. Independent backends declare their own native clocks.
14
+
15
+ The retired Python tank demo and its aliases are no longer registered.
16
+ """
17
+ import os
18
+ import re
19
+
20
+ from . import mc4d
21
+ from .core import FPS, RES, Arena, Body, Boss, BossBenchEnv, Case, Knobs
22
+ from .keymouse import NOOP, format_packet, parse_packet
23
+ from .unified import PyCaseEnv, UnifiedEnv
24
+
25
+ PY_CASES = {f"3d/minecraft_{m}": (mc4d.make, {"mob": m}) for m in mc4d.MOBS}
26
+
27
+
28
+ def _web_cases():
29
+ """{case id: game folder} for every BB.CASES['...'] = registration under web/games/<game>/, found without
30
+ starting Node. Folders starting with "_" (the template) or without an index.html, and tests/ shots/, are skipped."""
31
+ games = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))), "web", "games")
32
+ out = {}
33
+ for game in sorted(os.listdir(games)) if os.path.isdir(games) else []:
34
+ if game.startswith(("_", ".")) or not os.path.isfile(os.path.join(games, game, "index.html")):
35
+ continue
36
+ for d, sub, files in os.walk(os.path.join(games, game)):
37
+ sub[:] = [s for s in sub if s not in ("tests", "shots")]
38
+ for f in files:
39
+ if f.endswith(".js"):
40
+ src = open(os.path.join(d, f), encoding="utf-8").read()
41
+ for i in re.findall(r"BB\.CASES\['([^']+)'\]\s*=", src):
42
+ if out.setdefault(i, game) != game:
43
+ raise RuntimeError(f"web case {i!r} registered by two games: {out[i]}, {game}")
44
+ return out
45
+
46
+
47
+ WEB_GAME = _web_cases()
48
+ WEB_CASES = sorted(WEB_GAME)
49
+ ENVS = {**{i: "web" for i in WEB_CASES}, **{i: "py" for i in PY_CASES}}
50
+ ENGINE_BACKENDS = {}
51
+
52
+
53
+ def register_backend(case_id, factory):
54
+ """Explicitly register an independent GameBackend factory; this does not enroll it in training.
55
+
56
+ Call in the integration module on each process, including spawned workers.
57
+ Each factory call must create an independent backend and own its resources.
58
+ """
59
+ if not isinstance(case_id, str) or not re.fullmatch(r'[a-z0-9_]+/[a-z0-9_]+', case_id):
60
+ raise ValueError('case_id must be namespace/name using lowercase letters, digits or underscores')
61
+ if case_id in ENVS:
62
+ raise ValueError(f'case already registered: {case_id}')
63
+ if case_id in ('2d/tank_battle', 'tank_battle_1v1'):
64
+ raise ValueError('retired case cannot be registered again')
65
+ if not callable(factory):
66
+ raise TypeError('backend factory must be callable')
67
+ import gymnasium as gym
68
+ gym.register(gym_id(case_id), entry_point=make, kwargs={'name': case_id})
69
+ ENGINE_BACKENDS[case_id] = factory
70
+ ENVS[case_id] = 'native'
71
+
72
+
73
+ def make(name, **kw):
74
+ """Unified env for any id in ENVS; kw: obs_mode, time_mode, latency, difficulty, reward_mode, action_mode,
75
+ (web) transport, (py) case_kw for the case constructor (e.g. {"camera": "first"})."""
76
+ if name in ENGINE_BACKENDS:
77
+ from .engine_env import EngineEnv
78
+ backend_options = dict(kw.pop('backend_options', {}) or {})
79
+ backend = ENGINE_BACKENDS[name](**backend_options)
80
+ return EngineEnv(name, backend, **kw)
81
+ if name in PY_CASES:
82
+ factory, fixed = PY_CASES[name]
83
+ extra = dict(kw.pop("case_kw", {}) or {})
84
+ if any(key in extra and extra[key] != value for key, value in fixed.items()):
85
+ raise ValueError(f"case_kw cannot override the registered case identity: {fixed}")
86
+ case_kw = {**extra, **fixed}
87
+ return PyCaseEnv(name, lambda **k: factory(**case_kw, **k), **kw)
88
+ if name in WEB_CASES:
89
+ from .webenv import WebCaseEnv
90
+ return WebCaseEnv(name, **kw)
91
+ raise KeyError(f"unknown case {name!r}; known: {sorted(ENVS)}")
92
+
93
+
94
+ def gym_id(name):
95
+ return "BossBench/" + name.replace("/", "-") + "-v0"
96
+
97
+
98
+ from .policy_env import PolicyEnv, make_policy_env, policy_gym_id
99
+
100
+
101
+ try: # gymnasium.make("BossBench/2d-needle_warden-v0")
102
+ import gymnasium as gym
103
+ for _n in ENVS:
104
+ gym.register(gym_id(_n), entry_point=make, kwargs={"name": _n})
105
+ from .scope import FORMAL_CASES, PUBLIC_WEB_CASES
106
+ for _n in (*FORMAL_CASES, *PUBLIC_WEB_CASES):
107
+ gym.register(policy_gym_id(_n), entry_point=make_policy_env, kwargs={"case_id": _n})
108
+ except Exception:
109
+ pass
110
+
111
+ from .native_games import NATIVE_CASES, backend_factory
112
+ for _n in NATIVE_CASES:
113
+ register_backend(_n, backend_factory(_n))
114
+ gym.register(policy_gym_id(_n), entry_point=make_policy_env, kwargs={'case_id': _n})
115
+
116
+ # 2026-11-10: compact discrete action spaces (bossbench/compact-actions@1, compact.py). Registered for every public
117
+ # case whose game ships web/games/<game>/compact_actions.json; the raw key/mouse contract above is unchanged.
118
+ from . import compact
119
+ from .compact import make_compact_env, compact_gym_id
120
+ from .step_reward import StepDamageReward, make_training_env
121
+ try:
122
+ from .scope import POLICY_CASES as _PC
123
+ for _n, _v in _PC.items():
124
+ if compact.declaration_path(_v['game']).is_file():
125
+ gym.register(compact_gym_id(_n), entry_point=make_compact_env, kwargs={'case_id': _n})
126
+ except Exception:
127
+ pass
environments/games/prototype/bossbench/compact.py ADDED
@@ -0,0 +1,315 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Compact discrete action spaces for the public BossBench env: bossbench/compact-actions@1.
2
+
3
+ Most games use fewer than 1,000 action combinations. Terraria has a separate action space.
4
+ A game declares a few independent heads (move, turn, attack, ...), each a short list of options. One action
5
+ picks one option per head and is held for one 200 ms packet, which is the ViZDoom frame-skip analogue. The
6
+ action count is the product of the head sizes and must be below 1000.
7
+
8
+ Nothing underneath changes. An action is translated into an ordinary key/mouse packet before env.step, so the
9
+ simulation, the recordings, the verifier and the raw packet contract (bossbench/policy-gym@2) are all untouched.
10
+
11
+ Declaration: web/games/<folder>/compact_actions.json
12
+
13
+ {"schema": "bossbench/compact-actions@1", "game": "doom_remake", "version": "doom-compact@1",
14
+ "heads": [
15
+ {"name": "move", "zh": "movement", "options": [
16
+ {"label": "none"}, {"label": "forward", "zh": "forward", "keys": ["W", "Shift"]}, ...]},
17
+ {"name": "turn", "zh": "turn", "options": [
18
+ {"label": "none"}, {"label": "left_10", "zh": "turn left 10 degrees", "dx": -60}, ...]}]}
19
+
20
+ Option fields: label (required, [a-z0-9_]+, unique within its head); zh; note; and at most one of
21
+ keys: [...] held in all six sub-steps
22
+ tap: [...] held in the first sub-step only, so the key is pressed afresh every packet
23
+ subs: [[...] x 6] an explicit per-sub-step pattern (motion inputs, combos)
24
+ plus optional relative mouse counts dx, dy, dz for the packet.
25
+
26
+ Rules:
27
+ - Option 0 of every head is neutral (no keys, no mouse), so action [0, 0, ...] is the no-op packet.
28
+ - Heads never share a key or a mouse axis.
29
+ - Every combination must be a legal packet (at most 4 keys per sub-step).
30
+ """
31
+ from __future__ import annotations
32
+
33
+ from collections.abc import Mapping
34
+ import itertools
35
+ import json
36
+ import math
37
+ from pathlib import Path
38
+ import re
39
+
40
+ import gymnasium as gym
41
+ import numpy as np
42
+
43
+ from . import keymouse as km
44
+
45
+ SCHEMA = 'bossbench/compact-actions@1'
46
+ CONTRACT = 'bossbench/policy-compact@1'
47
+ MAX_ACTIONS = 1000
48
+ EXEMPT_GAMES = frozenset({'terraria_remake'})
49
+ ROOT = Path(__file__).resolve().parents[2]
50
+ _FOLDER = {'minecraft': 'minecraft_remake'}
51
+ _LABEL = re.compile(r'[a-z0-9_]+\Z')
52
+ _HEAD = re.compile(r'[a-z][a-z0-9_]*\Z')
53
+ _AXES = ('dx', 'dy', 'dz')
54
+ _LIMIT = (1000, 1000, 5)
55
+ _FIELDS = {'label', 'zh', 'note', 'keys', 'tap', 'subs', 'dx', 'dy', 'dz'}
56
+ INVALID = 'invalid compact action' # executed as a malformed packet: no-op, counted in format_errors
57
+
58
+
59
+ def declaration_path(game):
60
+ return ROOT / 'web' / 'games' / _FOLDER.get(game, game) / 'compact_actions.json'
61
+
62
+
63
+ def _keyset(value, where):
64
+ if not isinstance(value, list) or any(not isinstance(k, str) for k in value):
65
+ raise ValueError(f'{where}: keys must be a list of key names')
66
+ if len(set(value)) != len(value):
67
+ raise ValueError(f'{where}: duplicate key')
68
+ bad = [k for k in value if k not in km.KEYS]
69
+ if bad:
70
+ raise ValueError(f'{where}: unknown key(s) {bad}; allowed {list(km.KEYS)}')
71
+ if len(value) > km.MAX_KEYS:
72
+ raise ValueError(f'{where}: more than {km.MAX_KEYS} keys in one sub-step')
73
+ return frozenset(value)
74
+
75
+
76
+ class CompactSpec:
77
+ """A validated compact action declaration. Indices are per head; flat indices are mixed-radix, first head
78
+ most significant, so flat 0 is the no-op."""
79
+
80
+ def __init__(self, data, where='declaration'):
81
+ if not isinstance(data, dict) or data.get('schema') != SCHEMA:
82
+ raise ValueError(f'{where}: schema must be {SCHEMA!r}')
83
+ self.where, self.game, self.version = where, data.get('game'), data.get('version')
84
+ if not isinstance(self.game, str) or not isinstance(self.version, str) or not self.version:
85
+ raise ValueError(f'{where}: game and version must be non-empty strings')
86
+ heads = data.get('heads')
87
+ if not isinstance(heads, list) or not heads:
88
+ raise ValueError(f'{where}: heads must be a non-empty list')
89
+ self.raw, self.heads, keys_owner, axes_owner = data, [], {}, {}
90
+ for h in heads:
91
+ name = h.get('name') if isinstance(h, dict) else None
92
+ if not isinstance(name, str) or not _HEAD.match(name) or any(x['name'] == name for x in self.heads):
93
+ raise ValueError(f'{where}: head names must match [a-z][a-z0-9_]* and be unique: {name!r}')
94
+ opts = h.get('options')
95
+ if not isinstance(opts, list) or len(opts) < 2:
96
+ raise ValueError(f'{where}: head {name!r} needs at least two options')
97
+ parsed, labels = [], set()
98
+ for i, o in enumerate(opts):
99
+ at = f'{where}: {name}[{i}]'
100
+ if not isinstance(o, dict) or set(o) - _FIELDS:
101
+ raise ValueError(f'{at}: unknown fields {sorted(set(o) - _FIELDS) if isinstance(o, dict) else o}')
102
+ label = o.get('label')
103
+ if not isinstance(label, str) or not _LABEL.match(label) or label in labels:
104
+ raise ValueError(f'{at}: label must match [a-z0-9_]+ and be unique in the head: {label!r}')
105
+ labels.add(label)
106
+ kinds = [k for k in ('keys', 'tap', 'subs') if k in o]
107
+ if len(kinds) > 1:
108
+ raise ValueError(f'{at}: use only one of keys / tap / subs')
109
+ subs = [frozenset()] * km.SUBSTEPS
110
+ if 'keys' in o:
111
+ subs = [_keyset(o['keys'], at)] * km.SUBSTEPS
112
+ elif 'tap' in o:
113
+ subs = [_keyset(o['tap'], at)] + [frozenset()] * (km.SUBSTEPS - 1)
114
+ elif 'subs' in o:
115
+ if not isinstance(o['subs'], list) or len(o['subs']) != km.SUBSTEPS:
116
+ raise ValueError(f'{at}: subs must list {km.SUBSTEPS} sub-steps')
117
+ subs = [_keyset(s, f'{at} sub {j + 1}') for j, s in enumerate(o['subs'])]
118
+ mouse = []
119
+ for axis, limit in zip(_AXES, _LIMIT):
120
+ v = o.get(axis, 0)
121
+ if isinstance(v, bool) or not isinstance(v, int) or abs(v) > limit:
122
+ raise ValueError(f'{at}: {axis} must be an integer within +-{limit}')
123
+ mouse.append(v)
124
+ if i == 0 and (any(subs) or any(mouse)):
125
+ raise ValueError(f'{at}: option 0 must be neutral (no keys, no mouse)')
126
+ parsed.append({'label': label, 'zh': o.get('zh'), 'subs': tuple(subs), 'mouse': tuple(mouse)})
127
+ uni = frozenset().union(*(frozenset().union(*p['subs']) for p in parsed))
128
+ axes = frozenset(a for p in parsed for a, v in zip(range(3), p['mouse']) if v)
129
+ for k in uni:
130
+ if k in keys_owner:
131
+ raise ValueError(f'{where}: key {k} is used by heads {keys_owner[k]!r} and {name!r}')
132
+ keys_owner[k] = name
133
+ for a in axes:
134
+ if a in axes_owner:
135
+ raise ValueError(f'{where}: mouse {_AXES[a]} is used by heads {axes_owner[a]!r} and {name!r}')
136
+ axes_owner[a] = name
137
+ self.heads.append({'name': name, 'zh': h.get('zh'), 'options': parsed, 'keys': uni, 'axes': axes})
138
+ self.nvec = [len(h['options']) for h in self.heads]
139
+ self.size = math.prod(self.nvec)
140
+ if self.size >= MAX_ACTIONS and self.game not in EXEMPT_GAMES:
141
+ raise ValueError(f'{where}: {self.size} actions ({" x ".join(map(str, self.nvec))}), must be below {MAX_ACTIONS}')
142
+ bad = None
143
+ for idx in itertools.islice(itertools.product(*(range(n) for n in self.nvec)), 200000):
144
+ if km.parse_packet(self.compose(idx)) is None:
145
+ bad = idx
146
+ break
147
+ if bad is not None:
148
+ raise ValueError(f'{where}: action {self.named(bad)} is not a legal packet (more than 4 keys in a sub-step?)')
149
+
150
+ # ---- conversions
151
+ def compose(self, idx):
152
+ subs, mouse = [set() for _ in range(km.SUBSTEPS)], [0, 0, 0]
153
+ for head, i in zip(self.heads, idx):
154
+ option = head['options'][i]
155
+ for j in range(km.SUBSTEPS):
156
+ subs[j] |= option['subs'][j]
157
+ for a in range(3):
158
+ mouse[a] += option['mouse'][a]
159
+ return km.format_packet([sorted(s, key=km.KEYS.index) for s in subs], mouse)
160
+
161
+ def unflat(self, i):
162
+ if not 0 <= i < self.size:
163
+ raise ValueError(f'flat action {i} outside [0, {self.size})')
164
+ out = []
165
+ for n in reversed(self.nvec):
166
+ i, r = divmod(i, n)
167
+ out.append(r)
168
+ return tuple(reversed(out))
169
+
170
+ def flat(self, idx):
171
+ i = 0
172
+ for n, v in zip(self.nvec, idx):
173
+ i = i * n + v
174
+ return i
175
+
176
+ def named(self, idx):
177
+ return {h['name']: h['options'][i]['label'] for h, i in zip(self.heads, idx)}
178
+
179
+ def parse(self, action):
180
+ """Action -> per-head indices. Accepts None (no-op), a flat int, a sequence of per-head ints, a mapping
181
+ {head: label or index} (missing heads = option 0), or text "move=forward; turn=left_10" (same rule)."""
182
+ if action is None:
183
+ return (0,) * len(self.heads)
184
+ if isinstance(action, (bool, np.bool_)):
185
+ raise ValueError('a boolean is not an action')
186
+ if isinstance(action, (int, np.integer)):
187
+ return self.unflat(int(action))
188
+ if isinstance(action, str):
189
+ text = action.strip()
190
+ for mark in ('<|compact_start|>', '<|compact_end|>'):
191
+ text = text.replace(mark, '')
192
+ pairs = {}
193
+ for part in re.split(r'[;,\n]', text):
194
+ part = part.strip()
195
+ if not part:
196
+ continue
197
+ if '=' not in part and ':' not in part:
198
+ raise ValueError(f'expected head=label, got {part!r}')
199
+ head, _, label = part.replace(':', '=', 1).partition('=')
200
+ head, label = head.strip(), label.strip()
201
+ if head in pairs:
202
+ raise ValueError(f'head {head!r} given twice')
203
+ pairs[head] = label
204
+ return self.parse(pairs)
205
+ if isinstance(action, Mapping):
206
+ names = [h['name'] for h in self.heads]
207
+ unknown = set(action) - set(names)
208
+ if unknown:
209
+ raise ValueError(f'unknown head(s) {sorted(unknown)}; heads are {names}')
210
+ out = []
211
+ for h in self.heads:
212
+ v = action.get(h['name'], 0)
213
+ if isinstance(v, str):
214
+ labels = [o['label'] for o in h['options']]
215
+ if v not in labels:
216
+ raise ValueError(f'head {h["name"]!r} has no option {v!r}; options are {labels}')
217
+ out.append(labels.index(v))
218
+ elif isinstance(v, (int, np.integer)) and not isinstance(v, (bool, np.bool_)) and 0 <= v < len(h['options']):
219
+ out.append(int(v))
220
+ else:
221
+ raise ValueError(f'head {h["name"]!r}: bad value {v!r}')
222
+ return tuple(out)
223
+ arr = np.asarray(action)
224
+ if arr.ndim != 1 or arr.shape[0] != len(self.heads) or arr.dtype.kind not in 'iu':
225
+ raise ValueError(f'expected {len(self.heads)} integer head indices')
226
+ if any(not 0 <= int(v) < n for v, n in zip(arr, self.nvec)):
227
+ raise ValueError(f'head index out of range for {self.nvec}')
228
+ return tuple(int(v) for v in arr)
229
+
230
+ def project(self, packet):
231
+ """Nearest compact action to a packet (packet text or parse_packet() dict), head by head.
232
+
233
+ Key heads: Hamming distance over the 6 sub-steps x the head's own keys.
234
+ Mouse: |difference| / 100 per axis the head owns. Ties go to the lowest index, so neutral wins a tie and
235
+ option order matters: list the richer of two equally close options first (cuphead v3 lost jumps this way)."""
236
+ p = km.parse_packet(packet) if isinstance(packet, str) else packet
237
+ if p is None:
238
+ return (0,) * len(self.heads)
239
+ out = []
240
+ for h in self.heads:
241
+ best, best_d = 0, None
242
+ for i, o in enumerate(h['options']):
243
+ d = sum(len((p['subs'][j] & h['keys']) ^ o['subs'][j]) for j in range(km.SUBSTEPS))
244
+ d += sum(abs(p['mouse'][a] - o['mouse'][a]) / 100 for a in h['axes'])
245
+ if best_d is None or d < best_d - 1e-12:
246
+ best, best_d = i, d
247
+ out.append(best)
248
+ return tuple(out)
249
+
250
+ def table(self):
251
+ """What an agent's manual shows: every head and option with its meaning."""
252
+ heads = []
253
+ for h, raw in zip(self.heads, self.raw['heads']):
254
+ heads.append({'name': h['name'], 'zh': h['zh'], 'options': [
255
+ {'index': i, **{k: v for k, v in o.items() if k in ('label', 'zh', 'note', 'keys', 'tap', 'subs', 'dx', 'dy', 'dz')}}
256
+ for i, o in enumerate(raw['options'])]})
257
+ return {'schema': SCHEMA, 'contract': CONTRACT, 'game': self.game, 'version': self.version,
258
+ 'size': self.size, 'nvec': list(self.nvec), 'decision_seconds': km.PACKET_SECONDS,
259
+ 'text_form': 'head=label; head=label (missing heads = option 0)', 'heads': heads}
260
+
261
+
262
+ def load(game=None, path=None):
263
+ p = Path(path) if path else declaration_path(game)
264
+ if not p.is_file():
265
+ raise FileNotFoundError(f'no compact action declaration for {game!r}: {p}')
266
+ spec = CompactSpec(json.loads(p.read_text(encoding='utf-8')), where=str(p))
267
+ if game and spec.game != game:
268
+ raise ValueError(f'{p}: declares game {spec.game!r}, expected {game!r}')
269
+ return spec
270
+
271
+
272
+ class CompactActionEnv(gym.Wrapper):
273
+ """The public policy env with a small MultiDiscrete action space; each action becomes one ordinary packet."""
274
+
275
+ def __init__(self, env, spec):
276
+ super().__init__(env)
277
+ self.compact_spec = spec # not `spec`: gym.Wrapper.spec is the registry EnvSpec (read-only)
278
+ self.action_space = gym.spaces.MultiDiscrete(spec.nvec)
279
+ self.metadata = {**env.metadata, 'action_contract': CONTRACT, 'compact_version': spec.version,
280
+ 'compact_size': spec.size}
281
+
282
+ def manual(self):
283
+ manual = self.env.manual()
284
+ manual['compact_actions'] = self.compact_spec.table()
285
+ return manual
286
+
287
+ def reset(self, *, seed=None, options=None):
288
+ obs, info = self.env.reset(seed=seed, options=options)
289
+ if 'manual' in info:
290
+ info = {**info, 'manual': self.manual()}
291
+ return obs, info
292
+
293
+ def step(self, action, latency=None):
294
+ try:
295
+ idx = self.compact_spec.parse(action)
296
+ packet = self.compact_spec.compose(idx)
297
+ except (ValueError, TypeError, OverflowError):
298
+ idx, packet = None, INVALID
299
+ obs, reward, terminated, truncated, info = self.env.step(packet, latency=latency)
300
+ info = {**info, 'compact_action': None if idx is None else self.compact_spec.named(idx)}
301
+ return obs, reward, terminated, truncated, info
302
+
303
+
304
+ def make_compact_env(case_id, decl_path=None, **kwargs):
305
+ """make_policy_env(case_id) with the game's compact action space (MultiDiscrete, fewer than 1000 actions)."""
306
+ from .policy_env import make_policy_env
307
+ from .scope import POLICY_CASES
308
+ if case_id not in POLICY_CASES:
309
+ raise ValueError(f'case is not registered for the public policy interface: {case_id!r}')
310
+ spec = load(POLICY_CASES[case_id]['game'], decl_path)
311
+ return CompactActionEnv(make_policy_env(case_id, **kwargs), spec)
312
+
313
+
314
+ def compact_gym_id(case_id):
315
+ return 'BossBenchCompact/' + case_id.replace('/', '-') + '-v0'
environments/games/prototype/bossbench/core.py ADDED
@@ -0,0 +1,252 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """BossBench core.
2
+
3
+ A Case is the composition Arena (environment) + Body (embodiment) + Boss.
4
+ Every component declares a difficulty TABLE; one scalar d in [0, 1] sets all knobs.
5
+ BossBenchEnv wraps a Case as a Gymnasium env with three time modes.
6
+ """
7
+ from __future__ import annotations
8
+
9
+ import math
10
+ from collections.abc import Mapping
11
+ from numbers import Integral, Real
12
+ import os
13
+ import time
14
+
15
+ import gymnasium as gym
16
+ import numpy as np
17
+
18
+ # fixed simulation tick: 60 Hz = 2 ticks per 33 ms sub-step of the 200 ms packet, as the web engine
19
+ # (proposal 4.4). Rules are written per second (or per vanilla 20 Hz Minecraft tick, converted in mc4d), so the
20
+ # game plays the same at any rate >= 30; BOSSBENCH_FPS overrides it for equivalence checks only.
21
+ FPS = int(os.environ.get("BOSSBENCH_FPS", 60))
22
+ RES = (854, 480) # every case and every renderer outputs 480p, 16:9 (W, H)
23
+
24
+
25
+ class Knobs:
26
+ """d in [0,1] -> named parameters. A row is (easy, hard) or (easy, normal, hard)."""
27
+
28
+ def __init__(self, table: dict, d: float):
29
+ self._names = list(table)
30
+ d = float(np.clip(d, 0.0, 1.0))
31
+ for name, row in table.items():
32
+ setattr(self, name, float(np.interp(d, np.linspace(0, 1, len(row)), row)))
33
+
34
+ def as_dict(self) -> dict:
35
+ return {n: round(getattr(self, n), 4) for n in self._names}
36
+
37
+
38
+ class Component:
39
+ TABLE: dict = {}
40
+
41
+ def reset(self, case: "Case") -> None:
42
+ self.k = Knobs(self.TABLE, case.d)
43
+
44
+ def update(self, case: "Case") -> None:
45
+ pass
46
+
47
+
48
+ class Arena(Component):
49
+ """Static geometry + transient entities (projectiles, hazards)."""
50
+
51
+
52
+ class Body(Component):
53
+ """The agent's embodiment: action space, kinematics, health."""
54
+ action_space: gym.Space
55
+ max_hp = 1.0
56
+
57
+ def noop(self):
58
+ raise NotImplementedError
59
+
60
+ def parse(self, text: str):
61
+ """'up+fire' -> action; lets LLM agents act with words."""
62
+ raise NotImplementedError
63
+
64
+ def apply(self, case: "Case", action) -> None:
65
+ raise NotImplementedError
66
+
67
+ # key/mouse packets (keymouse.py): what each key means is up to the body (proposal 4.3)
68
+ manual: tuple = ()
69
+
70
+ def keys(self, case: "Case", held: frozenset, pressed: frozenset, mouse: tuple):
71
+ """Keys held this tick (+ those newly pressed, + this tick's share of the mouse motion) -> native action."""
72
+ raise NotImplementedError
73
+
74
+
75
+ class Boss(Component):
76
+ """Opponent: a state machine over MOVES (Boss-Spec DSL subset)."""
77
+ MOVES: dict = {}
78
+ SKILLS: tuple = ()
79
+ max_hp = 1.0
80
+
81
+
82
+ class Case:
83
+ """Arena + Body + Boss, stepped at FPS. Subclasses add observe/state/render."""
84
+ name = "case"
85
+ max_seconds = 120.0
86
+ obs_dim = 0
87
+
88
+ def __init__(self, arena: Arena, body: Body, boss: Boss):
89
+ self.arena, self.body, self.boss = arena, body, boss
90
+ self.observation_space = gym.spaces.Box(-np.inf, np.inf, (self.obs_dim,), np.float32)
91
+
92
+ def reset(self, seed: int, d: float) -> None:
93
+ self.rng = np.random.default_rng(seed)
94
+ self.d, self.t, self.events = float(d), 0, []
95
+ for c in (self.arena, self.body, self.boss):
96
+ c.reset(self)
97
+
98
+ def tick(self, action) -> None:
99
+ self.body.apply(self, action)
100
+ self.boss.update(self)
101
+ self.arena.update(self)
102
+ self.interact()
103
+ self.t += 1
104
+
105
+ def interact(self) -> None:
106
+ """Case-specific body/boss contact rules."""
107
+
108
+ def outcome(self):
109
+ if self.boss.hp <= 0:
110
+ return "win"
111
+ if self.body.hp <= 0:
112
+ return "loss"
113
+ return None
114
+
115
+ def describe(self) -> dict:
116
+ """Difficulty knobs + boss spec: what an LLM generator/verifier sees."""
117
+ return {"case": self.name, "d": self.d,
118
+ "knobs": {type(c).__name__: c.k.as_dict() for c in (self.arena, self.body, self.boss)},
119
+ "moves": self.boss.MOVES, "skills_tested": self.boss.SKILLS}
120
+
121
+ def observe(self) -> np.ndarray:
122
+ raise NotImplementedError
123
+
124
+ def state(self) -> dict:
125
+ raise NotImplementedError
126
+
127
+ def render(self) -> np.ndarray:
128
+ raise NotImplementedError
129
+
130
+
131
+ class BossBenchEnv(gym.Env):
132
+ """Gymnasium wrapper.
133
+
134
+ time_mode:
135
+ paused - the world waits for the agent (turn-based upper bound)
136
+ virtual - before each action the world runs ceil(latency*FPS) no-op ticks
137
+ (set env.latency per step to the agent's measured think time)
138
+ realtime - same, but the lag is measured on the wall clock between steps
139
+ reward: terminal win=+1, loss/timeout=-1+boss_damage_fraction (+ optional dense shaping)
140
+ """
141
+ metadata = {"render_modes": ["rgb_array"], "render_fps": FPS}
142
+
143
+ def __init__(self, case: Case, difficulty=0.5, time_mode="paused", latency=0.0,
144
+ frame_skip=1, reward_mode="sparse", render_mode=None, max_seconds=None):
145
+ assert time_mode in ("paused", "virtual", "realtime")
146
+ self.case, self.difficulty, self.time_mode, self.latency = case, difficulty, time_mode, latency
147
+ self.frame_skip, self.reward_mode, self.render_mode = frame_skip, reward_mode, render_mode
148
+ seconds = case.max_seconds if max_seconds is None else max_seconds
149
+ if (isinstance(seconds, (bool, np.bool_)) or not isinstance(seconds, Real) or
150
+ not math.isfinite(seconds) or not math.isfinite(seconds * FPS) or seconds < 1 / FPS):
151
+ raise ValueError("max_seconds must be finite and allow at least one simulation tick")
152
+ self.max_ticks = int(seconds * FPS)
153
+ self.action_space = case.body.action_space
154
+ self.observation_space = case.observation_space
155
+ self.renderer = None # None -> case.render(); or a callable(env) -> frame (e.g. skin.GodotRenderer)
156
+ self.episode = 0
157
+ self._closed = False
158
+ self._has_reset, self._done = False, True
159
+
160
+ # -- gym API ---------------------------------------------------------
161
+ def reset(self, *, seed=None, options=None):
162
+ self._ensure_open()
163
+ if options is not None and not isinstance(options, Mapping):
164
+ raise ValueError("reset options must be a mapping")
165
+ d = (options or {}).get("difficulty", self.difficulty)
166
+ if isinstance(d, (bool, np.bool_)) or not isinstance(d, Real) or not math.isfinite(d) or not 0 <= d <= 1:
167
+ raise ValueError("difficulty must be a finite number in [0, 1]")
168
+ if seed is not None:
169
+ if isinstance(seed, (bool, np.bool_)) or not isinstance(seed, Integral) or seed < 0:
170
+ raise ValueError("seed must be a nonnegative integer or None")
171
+ seed = int(seed)
172
+ super().reset(seed=seed)
173
+ self.case.reset(int(self.np_random.integers(2**31 - 1)), d)
174
+ self._has_reset, self._done = True, False
175
+ self.episode += 1
176
+ self._prev = self._progress()
177
+ self._lag_ticks = 0
178
+ self._t_return = time.perf_counter()
179
+ return self.case.observe(), self._info()
180
+
181
+ def step(self, action):
182
+ self._ensure_reset()
183
+ if self._done:
184
+ raise RuntimeError("episode is over; call reset()")
185
+ c = self.case
186
+ if isinstance(action, str):
187
+ action = c.body.parse(action)
188
+ c.events.clear()
189
+ self._lag_ticks = self._lag()
190
+ for a in [c.body.noop()] * self._lag_ticks + [action] * self.frame_skip:
191
+ c.tick(a)
192
+ if c.outcome() or c.t >= self.max_ticks:
193
+ break
194
+ terminated = c.outcome() is not None
195
+ truncated = not terminated and c.t >= self.max_ticks
196
+ prog, reward = self._progress(), 0.0
197
+ if self.reward_mode == "dense":
198
+ reward += (prog[0] - self._prev[0]) - (prog[1] - self._prev[1])
199
+ self._prev = prog
200
+ if terminated or truncated:
201
+ reward += self.verifier()["reward"]
202
+ self._done = True
203
+ obs, info = c.observe(), self._info()
204
+ self._t_return = time.perf_counter()
205
+ return obs, float(reward), terminated, truncated, info
206
+
207
+ def render(self):
208
+ self._ensure_reset()
209
+ img = self.renderer(self) if self.renderer else self.case.render()
210
+ assert img.shape == (RES[1], RES[0], 3), f"render must be 480p {RES}, got {img.shape}"
211
+ return img
212
+
213
+ def close(self):
214
+ if not self._closed:
215
+ try:
216
+ close = getattr(self.case, "close", None)
217
+ if close is not None:
218
+ close()
219
+ finally:
220
+ self._closed = True
221
+
222
+ def _ensure_open(self):
223
+ if self._closed:
224
+ raise RuntimeError("environment is closed; create a new environment")
225
+
226
+ def _ensure_reset(self):
227
+ self._ensure_open()
228
+ if not self._has_reset:
229
+ raise RuntimeError("environment has not been reset; call reset()")
230
+
231
+ # -- BossBench extras ----------------------------------------------------
232
+ def verifier(self) -> dict:
233
+ self._ensure_reset()
234
+ boss_frac, _ = self._progress()
235
+ win = self.case.outcome() == "win"
236
+ return {"reward": 1.0 if win else -1.0 + boss_frac, "win": win,
237
+ "boss_damage": round(boss_frac, 4), "seconds": self.case.t / FPS, "d": self.case.d}
238
+
239
+ def _progress(self):
240
+ b, p = self.case.boss, self.case.body
241
+ return (1 - max(b.hp, 0) / b.max_hp, 1 - max(p.hp, 0) / p.max_hp)
242
+
243
+ def _lag(self) -> int:
244
+ if self.time_mode == "virtual":
245
+ return math.ceil(self.latency * FPS - 1e-9)
246
+ if self.time_mode == "realtime":
247
+ return int((time.perf_counter() - self._t_return) * FPS)
248
+ return 0
249
+
250
+ def _info(self) -> dict:
251
+ return {"t": self.case.t / FPS, "state": self.case.state(), "events": list(self.case.events),
252
+ "lag_ticks": self._lag_ticks, "difficulty": self.case.d}
environments/games/prototype/bossbench/engine_contract.py ADDED
@@ -0,0 +1,130 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """External engine boundary. No Arena/Body/Boss/Case or renderer library required."""
2
+ from __future__ import annotations
3
+
4
+ from dataclasses import dataclass
5
+ import math
6
+ from typing import Protocol
7
+
8
+ import numpy as np
9
+
10
+ API_VERSION = 'bossbench/engine@1'
11
+
12
+
13
+ @dataclass(frozen=True)
14
+ class EngineSpec:
15
+ engine_id: str
16
+ dimension: str
17
+ native_hz: int
18
+ max_seconds: float
19
+ renderer: str
20
+ render_kind: str # raster | perspective
21
+ rule_version: str = '1'
22
+ resolution: tuple[int, int] = (854, 480)
23
+
24
+ def __post_init__(self):
25
+ if self.dimension not in ('2d', '3d') or self.render_kind not in ('raster', 'perspective'):
26
+ raise ValueError('invalid engine dimension or render_kind')
27
+ if isinstance(self.native_hz, bool) or not isinstance(self.native_hz, int) or not 5 <= self.native_hz <= 1000:
28
+ raise ValueError('native_hz must be an integer in [5, 1000]')
29
+ if not math.isfinite(self.max_seconds) or self.max_seconds <= 0:
30
+ raise ValueError('max_seconds must be positive and finite')
31
+ if not self.engine_id or not self.renderer or not self.rule_version:
32
+ raise ValueError('engine identity, renderer and rules must be declared')
33
+ if len(self.resolution) != 2 or any(type(v) is not int or v <= 0 for v in self.resolution):
34
+ raise ValueError('resolution must contain positive integer width/height')
35
+
36
+
37
+ @dataclass(frozen=True)
38
+ class RenderStatus:
39
+ renderer: str
40
+ kind: str
41
+ ready: bool
42
+ error: str | None = None
43
+
44
+
45
+ @dataclass(frozen=True)
46
+ class InputPacket:
47
+ """200ms of input; six equally spaced held-key samples and total relative mouse delta."""
48
+ mouse: tuple[float, float, float]
49
+ holds: tuple[frozenset[str], ...]
50
+
51
+ @classmethod
52
+ def noop(cls):
53
+ return cls((0, 0, 0), (frozenset(),) * 6)
54
+
55
+
56
+ @dataclass(frozen=True)
57
+ class TickInput:
58
+ held: frozenset[str]
59
+ pressed: frozenset[str]
60
+ mouse: tuple[float, float, float]
61
+
62
+
63
+ class NativeClock:
64
+ """Optional integer scheduler: sample holds at each native tick, without clock drift.
65
+
66
+ The right endpoint belongs to the preceding input interval. Thus 35Hz uses
67
+ 7 ticks per packet while 24Hz alternates 4/5, executing exactly 24 per second.
68
+ Engines with their own native input queue may implement this boundary themselves.
69
+ """
70
+ def __init__(self, hz):
71
+ self.hz = hz
72
+ self.reset()
73
+
74
+ def reset(self):
75
+ self.packets = 0
76
+ self.ticks = 0
77
+ self.held = frozenset()
78
+
79
+ def schedule(self, packet: InputPacket):
80
+ end = (self.packets + 1) * self.hz // 5
81
+ count = end - self.ticks
82
+ result = []
83
+ for tick in range(self.ticks + 1, end + 1):
84
+ sub = (tick * 30 + self.hz - 1) // self.hz - 1 - self.packets * 6
85
+ held = packet.holds[max(0, min(5, sub))]
86
+ pressed = held - self.held
87
+ mouse = tuple(v / count for v in packet.mouse)
88
+ result.append(TickInput(held, pressed, mouse))
89
+ self.held = held
90
+ self.packets += 1
91
+ self.ticks = end
92
+ return result
93
+
94
+
95
+ @dataclass
96
+ class EngineSnapshot:
97
+ """Normalized diagnostics, owned by the trusted adapter; never a model observation.
98
+
99
+ ticks is absolute native time, frames is the number executed by this call.
100
+ Multipart bosses report aggregate remaining progress as hp/max_hp here.
101
+ state must include all replay-relevant game state/RNG/input state.
102
+ """
103
+ ticks: int
104
+ frames: int
105
+ outcome: str | None
106
+ player_hp: float
107
+ player_max_hp: float
108
+ boss_hp: float
109
+ boss_max_hp: float
110
+ state: dict
111
+ events: tuple = ()
112
+
113
+
114
+ class GameBackend(Protocol):
115
+ """A game may be an in-process engine, subprocess, RPC client or browser client.
116
+
117
+ validate_options must be pure. reset must establish a fresh independent
118
+ episode. advance executes one packet and stops on the exact terminal tick.
119
+ render is read-only and returns a perspective RGB for a 3D game. close must
120
+ release resources and be idempotent. The adapter owns process isolation.
121
+ """
122
+ spec: EngineSpec
123
+
124
+ def validate_options(self, options: dict) -> None: ...
125
+ def reset(self, seed: int, difficulty: float, options: dict) -> EngineSnapshot: ...
126
+ def advance(self, packet: InputPacket) -> EngineSnapshot: ...
127
+ def render(self) -> np.ndarray: ...
128
+ def render_status(self) -> RenderStatus: ...
129
+ def manual(self) -> dict: ...
130
+ def close(self) -> None: ...
environments/games/prototype/bossbench/engine_env.py ADDED
@@ -0,0 +1,119 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Gym adapter for independent game backends (engine_contract.GameBackend)."""
2
+ from __future__ import annotations
3
+
4
+ from dataclasses import asdict
5
+ import copy
6
+ import json
7
+ import math
8
+
9
+ from . import keymouse as km
10
+ from .engine_contract import EngineSnapshot, InputPacket
11
+ from .unified import UnifiedEnv
12
+
13
+
14
+ class EngineEnv(UnifiedEnv):
15
+ """No access to a game world, Body, Boss or a specific rendering library."""
16
+ def __init__(self, case_id, backend, **kwargs):
17
+ self.backend = backend
18
+ try:
19
+ super().__init__(case_id, **kwargs)
20
+ if self.action_mode != 'keymouse':
21
+ raise ValueError('independent engine adapter accepts keymouse; native actions stay inside the backend')
22
+ self.fps = self.engine_spec.native_hz
23
+ self.max_seconds = self.engine_spec.max_seconds
24
+ self.max_ticks = math.ceil(self.max_seconds * self.fps)
25
+ self.observation_space = self._obs_space()
26
+ except BaseException:
27
+ backend.close()
28
+ raise
29
+
30
+ @property
31
+ def engine_spec(self):
32
+ return self.backend.spec
33
+
34
+ def render_status(self):
35
+ return self.backend.render_status()
36
+
37
+ def _declared_tiers(self):
38
+ declared = getattr(self.backend, 'declared_tiers', None)
39
+ return declared() if callable(declared) else None
40
+
41
+ def _difficulty_band(self, d):
42
+ band = getattr(self.backend, 'difficulty_band', None)
43
+ return band(d) if callable(band) else None
44
+
45
+ def _validate_options(self, options):
46
+ super()._validate_options(options)
47
+ self.backend.validate_options(copy.deepcopy(options))
48
+
49
+ def _snapshot(self, value, *, previous=None, reset=False):
50
+ if not isinstance(value, EngineSnapshot):
51
+ raise TypeError('backend must return EngineSnapshot')
52
+ if type(value.ticks) is not int or type(value.frames) is not int or min(value.ticks, value.frames) < 0:
53
+ raise ValueError('backend ticks/frames must be nonnegative integers')
54
+ if reset and (value.ticks != 0 or value.frames != 0 or value.outcome is not None):
55
+ raise ValueError('reset must return a fresh live episode at tick zero')
56
+ if previous is not None:
57
+ expected = round(previous['t'] * self.fps) + value.frames
58
+ if value.ticks != expected or value.frames > math.ceil(self.fps * km.PACKET_SECONDS):
59
+ raise ValueError('backend native time does not match the executed packet')
60
+ if not value.frames and value.outcome is None:
61
+ raise ValueError('live packet did not advance simulation')
62
+ if value.outcome not in (None, 'win', 'loss', 'timeout'):
63
+ raise ValueError('unknown backend outcome')
64
+ if value.ticks >= self.max_ticks and value.outcome is None:
65
+ raise ValueError('backend exceeded its declared episode deadline')
66
+ for hp, maximum in ((value.player_hp,value.player_max_hp),(value.boss_hp,value.boss_max_hp)):
67
+ if not math.isfinite(hp) or not math.isfinite(maximum) or maximum <= 0 or not 0 <= hp <= maximum:
68
+ raise ValueError('invalid normalized backend health/progress')
69
+ if not isinstance(value.state, dict):
70
+ raise ValueError('backend diagnostics state must be a JSON object')
71
+ result = asdict(value)
72
+ json.dumps(result, allow_nan=False)
73
+ result.pop('ticks')
74
+ result['t'] = value.ticks / self.fps
75
+ return copy.deepcopy(result)
76
+
77
+ def _engine_reset(self, seed, d, options=None):
78
+ return self._snapshot(self.backend.reset(seed, d, copy.deepcopy(options or {})), reset=True)
79
+
80
+ def _engine_packet(self, packet, lag, ok):
81
+ try:
82
+ return self._advance_packets(packet, lag, ok)
83
+ except BaseException:
84
+ # A failed backend may have advanced privately; never expose the stale snapshot as live.
85
+ self.snap, self.done = None, True
86
+ raise
87
+
88
+ def _advance_packets(self, packet, lag, ok):
89
+ parsed = km.parse_packet(packet) if ok else None
90
+ action = (InputPacket(tuple(parsed['mouse']),tuple(frozenset(h) for h in parsed['subs']))
91
+ if parsed is not None else InputPacket.noop())
92
+ snapshot = self.snap
93
+ frames = lag_frames = 0
94
+ events = []
95
+ for _ in range(lag):
96
+ if snapshot['outcome']:
97
+ break
98
+ snapshot = self._snapshot(self.backend.advance(InputPacket.noop()),previous=snapshot)
99
+ frames += snapshot['frames']
100
+ lag_frames += snapshot['frames']
101
+ events.extend(snapshot['events'])
102
+ if not snapshot['outcome']:
103
+ snapshot = self._snapshot(self.backend.advance(action),previous=snapshot)
104
+ frames += snapshot['frames']
105
+ events.extend(snapshot['events'])
106
+ return {**snapshot,'frames':frames,'events':events,'lag_frames':lag_frames}
107
+
108
+ def _manual(self):
109
+ return copy.deepcopy(self.backend.manual())
110
+
111
+ def _render(self):
112
+ return self.backend.render()
113
+
114
+ def close(self):
115
+ if not self._closed:
116
+ try:
117
+ self.backend.close()
118
+ finally:
119
+ super().close()
environments/games/prototype/bossbench/keymouse.py ADDED
@@ -0,0 +1,211 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """The key/mouse action packet shared by every BossBench case (proposal 4.4), Python side.
2
+
3
+ <|action_start|> dx dy dz ; K1 ; K2 ; K3 ; K4 ; K5 ; K6 <|action_end|>
4
+
5
+ One packet = 200 ms = 6 sub-steps of 33 ms; K_j = 0-4 keys held during sub-step j. The parser is a
6
+ line-for-line port of web/engine/case.js BB.parsePacket, so a
7
+ packet means the same thing whether the case runs in Python or in the browser engine.
8
+
9
+ Both engines tick at 60 Hz (2 ticks per sub-step); `schedule` spreads a packet over any number of
10
+ ticks per 200 ms all the same: a key counts as held in a tick if it is held during any
11
+ sub-step overlapping that tick, and a press (released -> held between sub-steps) lands in the tick
12
+ where that sub-step starts. At 60 Hz this is exactly the web engine's 2 ticks per sub-step.
13
+ """
14
+ from __future__ import annotations
15
+
16
+ from collections.abc import Mapping
17
+ import re
18
+
19
+ import gymnasium as gym
20
+ import numpy as np
21
+
22
+ KEYS = ("W", "A", "S", "D", "Space", "Shift", "J", "K", "L", "Q", "E", "R", "LMB", "RMB")
23
+ _UP = {k.upper(): k for k in KEYS}
24
+ SUBSTEPS = 6
25
+ PACKET_SECONDS = 0.2
26
+ MAX_KEYS = 4
27
+ _PACKET = re.compile(r"\s*<\|action_start\|>([\s\S]*)<\|action_end\|>\s*")
28
+ _INT = re.compile(r"-?[0-9]+")
29
+
30
+
31
+ def parse_packet(text):
32
+ """-> {"mouse": (dx, dy, dz), "subs": [frozenset(keys)] * 6}, or None if the packet is malformed."""
33
+ m = _PACKET.fullmatch("" if text is None else str(text))
34
+ if not m:
35
+ return None
36
+ parts = m.group(1).split(";")
37
+ if len(parts) != 1 + SUBSTEPS:
38
+ return None
39
+ mouse = parts[0].split()
40
+ if len(mouse) != 3 or not all(_INT.fullmatch(v) for v in mouse):
41
+ return None
42
+ # Canonicalize leading zeros before int(): Python limits decimal input size,
43
+ # whereas JS rejects enormous values as out of range. Neither may crash.
44
+ normalized = []
45
+ for value in mouse:
46
+ digits = value.lstrip("-").lstrip("0") or "0"
47
+ if len(digits) > 4:
48
+ return None
49
+ normalized.append(("-" if value.startswith("-") else "") + digits)
50
+ dx, dy, dz = (int(v) for v in normalized)
51
+ if abs(dx) > 1000 or abs(dy) > 1000 or abs(dz) > 5:
52
+ return None
53
+ subs = []
54
+ for s in parts[1:]:
55
+ s, held = s.strip(), set()
56
+ if s:
57
+ ks = s.split(",")
58
+ if len(ks) > MAX_KEYS:
59
+ return None
60
+ for k in ks:
61
+ k = _UP.get(k.strip().upper())
62
+ if k is None or k in held:
63
+ return None
64
+ held.add(k)
65
+ subs.append(frozenset(held))
66
+ return {"mouse": (dx, dy, dz), "subs": subs}
67
+
68
+
69
+ def format_packet(subs, mouse=(0, 0, 0)) -> str:
70
+ """subs: 6 iterables of key names. Does not validate: too many keys gives a packet the env rejects."""
71
+ return "<|action_start|> " + " ".join(str(int(v)) for v in mouse) + " ; " + \
72
+ " ; ".join(",".join(_UP.get(str(k).upper(), str(k)) for k in s) for s in subs) + " <|action_end|>"
73
+
74
+
75
+ NOOP = format_packet([()] * SUBSTEPS)
76
+
77
+
78
+ def to_packet(action) -> str:
79
+ """Anything an agent may hand to env.step -> packet text.
80
+
81
+ str the packet itself (LLM agents)
82
+ None NOOP
83
+ {"mouse": (dx,dy,dz), "keys": 6x14} KeyMouse space sample: 0/1 per sub-step and key, in KEYS order
84
+ {"mouse": ..., "keys": [["D"], ["D", "Space"], ...]} key names per sub-step
85
+ """
86
+ if action is None:
87
+ return NOOP
88
+ if isinstance(action, str):
89
+ return action
90
+ # Invalid structured output has the same semantics as invalid packet text:
91
+ # the env executes a no-op and counts it, without coercing fractions to ints.
92
+ if not isinstance(action, Mapping) or set(action) - {"mouse", "keys"}:
93
+ return "invalid structured action"
94
+ try:
95
+ mouse = np.asarray(action.get("mouse", (0, 0, 0)))
96
+ if (mouse.shape != (3,) or mouse.dtype.kind not in "iuf" or
97
+ not np.isfinite(mouse).all() or not (mouse == np.trunc(mouse)).all() or
98
+ not (np.abs(mouse) <= (1000, 1000, 5)).all()):
99
+ return "invalid structured action"
100
+ rows = action.get("keys", [()] * SUBSTEPS)
101
+ if isinstance(rows, (str, bytes)) or len(rows) != SUBSTEPS:
102
+ return "invalid structured action"
103
+ if any(isinstance(row, (str, bytes)) for row in rows):
104
+ return "invalid structured action"
105
+ try:
106
+ matrix = np.asarray(rows)
107
+ except ValueError: # ragged lists of key names
108
+ matrix = None
109
+ if matrix is not None and matrix.shape == (SUBSTEPS, len(KEYS)) and matrix.dtype.kind in "biuf":
110
+ if not ((matrix == 0) | (matrix == 1)).all():
111
+ return "invalid structured action"
112
+ rows = [[KEYS[i] for i in np.flatnonzero(row)] for row in matrix]
113
+ elif not all(all(isinstance(key, str) for key in row) for row in rows):
114
+ return "invalid structured action"
115
+ return format_packet(rows, mouse)
116
+ except (TypeError, ValueError, OverflowError):
117
+ return "invalid structured action"
118
+
119
+
120
+ def schedule(packet, n_ticks, prev=frozenset()):
121
+ """Spread a parsed packet (None = no-op) over n_ticks engine ticks.
122
+
123
+ -> ([(held, pressed, (dx, dy, dz)) per tick], held during the last sub-step)
124
+ `prev` is the last sub-step of the previous packet, so a key held across packets is not re-pressed.
125
+ """
126
+ subs = packet["subs"] if packet else [frozenset()] * SUBSTEPS
127
+ mouse = np.asarray(packet["mouse"] if packet else (0, 0, 0), float) / n_ticks
128
+ held = [set() for _ in range(n_ticks)]
129
+ pressed = [set() for _ in range(n_ticks)]
130
+ last = prev
131
+ for j, s in enumerate(subs):
132
+ for k in range(n_ticks): # sub-step [j/6, (j+1)/6) overlaps tick [k/n, (k+1)/n)
133
+ if j * n_ticks < SUBSTEPS * (k + 1) and k * SUBSTEPS < (j + 1) * n_ticks:
134
+ held[k] |= s
135
+ pressed[j * n_ticks // SUBSTEPS] |= s - last
136
+ last = s
137
+ return [(frozenset(h), frozenset(p), tuple(mouse)) for h, p in zip(held, pressed)], last
138
+
139
+
140
+ class KeyMouse(gym.spaces.Dict):
141
+ """Structured form of a packet for RL: mouse (dx, dy, dz) + a 6 x 14 hold matrix (sub-step x KEYS).
142
+
143
+ env.step also accepts the packet text directly. Samples respect the 0-4 keys per sub-step rule;
144
+ an action that breaks it is a malformed packet (executed as no-op, counted in format_errors)."""
145
+
146
+ def __init__(self, seed=None):
147
+ super().__init__({"mouse": gym.spaces.Box(np.array([-1000, -1000, -5]), np.array([1000, 1000, 5]),
148
+ dtype=np.int64),
149
+ "keys": gym.spaces.MultiBinary([SUBSTEPS, len(KEYS)])}, seed=seed)
150
+
151
+ def sample(self, mask=None, probability=None):
152
+ out = super().sample(mask, probability)
153
+ out["keys"] = _constrained_keys(out["keys"], self.np_random,
154
+ None if mask is None else mask["keys"],
155
+ None if probability is None else probability["keys"])
156
+ return out
157
+
158
+ def contains(self, x) -> bool:
159
+ return super().contains(x) and bool((np.asarray(x["keys"]).sum(1) <= MAX_KEYS).all())
160
+
161
+
162
+ def _constrained_keys(sample, rng, mask=None, probability=None):
163
+ keys = np.asarray(sample).copy()
164
+ rows = keys.reshape(-1, len(KEYS))
165
+ if mask is None and probability is None:
166
+ rows.fill(0)
167
+ for row in rows:
168
+ row[rng.choice(len(KEYS), rng.integers(0, MAX_KEYS + 1), replace=False)] = 1
169
+ else:
170
+ forced = (mask == 1) if mask is not None else (probability == 1)
171
+ for row, fixed in zip(rows, np.asarray(forced).reshape(-1, len(KEYS))):
172
+ if fixed.sum() > MAX_KEYS:
173
+ raise ValueError("key mask/probability forces more than four keys in a substep")
174
+ candidates = np.flatnonzero(row & ~fixed)
175
+ keep = MAX_KEYS - int(fixed.sum())
176
+ if len(candidates) > keep:
177
+ row[rng.choice(candidates, len(candidates) - keep, replace=False)] = 0
178
+ return keys
179
+
180
+
181
+ class BatchedKeyMouse(gym.spaces.Dict):
182
+ """Gym's vector action space preserving KeyMouse's per-substep constraint."""
183
+
184
+ def __init__(self, single, n):
185
+ from gymnasium.vector.utils import batch_space
186
+ base = batch_space(gym.spaces.Dict(dict(single.spaces)), n)
187
+ spaces = dict(base.spaces)
188
+ # Gym batches MultiBinary as Box, which loses mask/probability support.
189
+ # Keep binary semantics as well as the leading member dimension.
190
+ spaces["keys"] = gym.spaces.MultiBinary([n, SUBSTEPS, len(KEYS)])
191
+ super().__init__(spaces)
192
+
193
+ def sample(self, mask=None, probability=None):
194
+ out = super().sample(mask, probability)
195
+ out["keys"] = _constrained_keys(out["keys"], self.np_random,
196
+ None if mask is None else mask["keys"],
197
+ None if probability is None else probability["keys"])
198
+ return out
199
+
200
+ def contains(self, x):
201
+ return super().contains(x) and bool((np.asarray(x["keys"]).sum(-1) <= MAX_KEYS).all())
202
+
203
+
204
+ # Default Dict batching drops subclass invariants. Register the real batch
205
+ # space so SyncVectorEnv/AsyncVectorEnv samplers still emit legal actions.
206
+ from gymnasium.vector.utils import batch_space
207
+
208
+
209
+ @batch_space.register(KeyMouse)
210
+ def _batch_keymouse(space, n=1):
211
+ return BatchedKeyMouse(space, n)
environments/games/prototype/bossbench/mc4d.py ADDED
The diff for this file is too large to render. See raw diff
 
environments/games/prototype/bossbench/mc_scripted.py ADDED
@@ -0,0 +1,1102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Standard trusted scripted controller for the Minecraft remake (bossbench.mc4d), overnight PROTOCOL section 3.
2
+
3
+ from bossbench import mc_scripted
4
+ packet = mc_scripted.scripted(case) # case: the live mc4d.MobFight -> one legal 200 ms packet (text)
5
+
6
+ It reads privileged simulation state (it is a reference controller, never shown to a policy) and emits only legal
7
+ packets (<= 4 keys per hold set, |dx|,|dy| <= 1000, |dz| <= 5). It never mutates the live case: every lookahead
8
+ runs on a light clone (deep copy with its own RNG state and arena heights; renderer, rigs and particles are not
9
+ copied and posing is disabled), so it is deterministic for a given (case, seed, options, packet history). Memory
10
+ lives in a WeakKeyDictionary keyed by the case and is reset when the episode tick is 0.
11
+
12
+ Strategy per packet: decide the weapon (hotbar wheel), an aim point and a few candidate packets (movement x
13
+ attack timing x jump/draw/release), roll every candidate forward 2-4 packets on a clone (the later packets are a
14
+ greedy continuation), and keep the best score = 10 x boss damage - taken_w x player damage + shaping, with a small
15
+ bonus for progress made sooner (breaks the "release now" vs "release next packet" tie that held full bow draws).
16
+ minecraft-arena@4 (2026-11-02, three tiers): the iron golem gets its own planner (attack-box gap, room to back off,
17
+ 4-packet lookahead pricing a slam like the hit it is); the dragon aims only at crystals it can see, leaves their
18
+ blast radius, sidesteps a fireball line-up and walks into sword reach of a perched head; the wither looks 3 packets
19
+ ahead when a skull closes in at melee range.
20
+ """
21
+ from __future__ import annotations
22
+
23
+ import copy
24
+ import math
25
+ import types
26
+ import weakref
27
+
28
+ import numpy as np
29
+
30
+ from . import keymouse as km
31
+ from . import mc4d
32
+
33
+ TICKS = 12 # 60 Hz simulation ticks per 200 ms packet
34
+ DEG = mc4d.Steve.MOUSE_DEG
35
+ _MEM: "weakref.WeakKeyDictionary" = weakref.WeakKeyDictionary()
36
+ MOVES = ("", "W", "S", "A", "D")
37
+ # minecraft-arena@7 removed natural regeneration: a hit taken at 10 s still counts at 170 s. Price player damage at
38
+ # least at this fraction of the rate the fight affords (boss health left per player health left); short fights
39
+ # keep their own taken_w, long hard fights get more careful as health runs down. Measured on seeds 1-32 (hard wins,
40
+ # floor off -> on): dragon 28 -> 31, golem 13 -> 14, skeleton 0 -> 8, zombie leader 20 -> 32, warden 30 -> 30, but
41
+ # wither 25 -> 20 (careful play stretched its fights until the skulls wore the player down), so the wither keeps 0.
42
+ HP_BUDGET = 0.05
43
+ HP_BUDGET_BY_BOSS = {"wither": 0.0}
44
+
45
+
46
+ # ------------------------------------------------------------------------------------------- simulation helpers
47
+ def clone(case):
48
+ """Gameplay-only deep copy. Shares the read-only difficulty knobs, drops renderer/rigs/particles."""
49
+ memo = {id(case.fx): []}
50
+ minions = list(getattr(case.boss, "minions", ())) # zombie reinforcements (minecraft-arena@5)
51
+ for obj in (getattr(case, "_gl", None), case.body.rig, case.boss.rig, getattr(case, "fxrng", None),
52
+ *(z.rig for z in minions)):
53
+ if obj is not None:
54
+ memo[id(obj)] = None
55
+ for comp in (case.arena, case.body, case.boss):
56
+ memo[id(comp.k)] = comp.k
57
+ arena = copy.copy(case.arena)
58
+ arena.H = case.arena.H.copy()
59
+ memo[id(case.arena)] = arena
60
+ sim = copy.deepcopy(case, memo)
61
+ # Harness wrappers (e.g. bossbench.scripted.FrameCapture) patch bound methods onto the live instance; deepcopy
62
+ # keeps function objects as-is, so a copied wrapper would still drive the LIVE case. Restore class methods.
63
+ for obj in (sim, sim.body, sim.boss, sim.arena, *getattr(sim.boss, "minions", ())):
64
+ for key in [k for k, v in vars(obj).items() if isinstance(v, (types.FunctionType, types.MethodType))]:
65
+ del vars(obj)[key]
66
+ sim.track = lambda: None
67
+ sim.body.pose = lambda c: None
68
+ sim.boss.pose = lambda c: None
69
+ sim.boss.pose_child = lambda c, z: None
70
+ return sim
71
+
72
+
73
+ def run_packet(sim, packet, last):
74
+ """Execute one parsed packet exactly as PyCaseEnv does (keymouse.schedule over 12 ticks)."""
75
+ sched, last = km.schedule(packet, TICKS, last)
76
+ for held, pressed, mouse in sched:
77
+ if sim.outcome():
78
+ break
79
+ sim.tick(sim.body.keys(sim, held, pressed, mouse))
80
+ return last
81
+
82
+
83
+ def packet(subs, mouse=(0, 0, 0)):
84
+ subs = [frozenset(s) for s in subs]
85
+ assert len(subs) == 6 and all(len(s) <= km.MAX_KEYS for s in subs)
86
+ mouse = (int(np.clip(mouse[0], -1000, 1000)), int(np.clip(mouse[1], -1000, 1000)), int(np.clip(mouse[2], -5, 5)))
87
+ return {"mouse": mouse, "subs": subs}
88
+
89
+
90
+ def text(p):
91
+ order = {k: i for i, k in enumerate(km.KEYS)}
92
+ return km.format_packet([sorted(s, key=order.get) for s in p["subs"]], p["mouse"])
93
+
94
+
95
+ def wrap(a):
96
+ return (a + math.pi) % (2 * math.pi) - math.pi
97
+
98
+
99
+ def aim_to(body, point, frac=1.0):
100
+ """Mouse (dx, dy) that turns the view onto point by the end of the packet (frac < 1: by that fraction)."""
101
+ e = body.e
102
+ d = np.asarray(point, float) - (e.pos + [0, mc4d.EYE, 0])
103
+ yaw = math.atan2(d[2], d[0])
104
+ pitch = math.atan2(d[1], math.hypot(d[0], d[2]))
105
+ dyaw, dpitch = wrap(yaw - e.yaw), pitch - e.pitch
106
+ return math.degrees(dyaw) / DEG / frac, -math.degrees(dpitch) / DEG / frac
107
+
108
+
109
+ def view_error(body, point):
110
+ dx, dy = aim_to(body, point)
111
+ return math.hypot(dx, dy) * DEG # degrees
112
+
113
+
114
+ def flat(v):
115
+ return np.array([v[0], 0.0, v[2]])
116
+
117
+
118
+ def hdist(a, b):
119
+ return float(math.hypot(a[0] - b[0], a[2] - b[2]))
120
+
121
+
122
+ # ------------------------------------------------------------------------------------------- memory
123
+ def memory(case):
124
+ m = _MEM.get(case)
125
+ if m is None or (case.t == 0 and m.get("t", -1) != 0) or case.t < m.get("t", -1):
126
+ m = {"last": frozenset(), "t": case.t, "crit_wait": 0}
127
+ _MEM[case] = m
128
+ m["t"] = case.t
129
+ return m
130
+
131
+
132
+ def scripted(case):
133
+ """One legal packet (text) for the live MobFight; deterministic, read-only."""
134
+ m = memory(case)
135
+ planner = PLANNERS[case.boss.name]
136
+ p = planner(case, m)
137
+ m["last"] = frozenset(p["subs"][-1])
138
+ return text(p)
139
+
140
+
141
+ # ------------------------------------------------------------------------------------------- packet building
142
+ def build(move="", jump=(), swing=None, rmb=None, sprint=False, mouse=(0, 0, 0), wheel=0, last=frozenset()):
143
+ """Six hold sets. move: '' or one of W/S/A/D (held all packet); jump: substeps holding Space;
144
+ swing: substep index of one LMB/J press (the key not held in the previous substep);
145
+ rmb: None (released), 'hold' (held all packet) or an int j (held for substeps < j, released from j)."""
146
+ subs = []
147
+ prev = set(last)
148
+ for j in range(6):
149
+ s = set()
150
+ if move:
151
+ s.add(move)
152
+ if j in jump:
153
+ s.add("Space")
154
+ if sprint and move == "W":
155
+ s.add("Shift")
156
+ if rmb == "hold" or (isinstance(rmb, int) and not isinstance(rmb, bool) and j < rmb):
157
+ s.add("RMB")
158
+ if swing is not None and j == swing:
159
+ s.add("J" if "LMB" in prev else "LMB")
160
+ subs.append(s)
161
+ prev = s
162
+ return packet(subs, (mouse[0], mouse[1], wheel))
163
+
164
+
165
+ def weapon_wheel(case, want):
166
+ return 0 if case.body.weapon == want else 1
167
+
168
+
169
+ def swing_slots(body):
170
+ """Sub-steps worth trying a full-charge swing at: the first charged one and every other one after it (the
171
+ in-between timings rarely differ; pruning them keeps the lookahead fast enough for the live demo)."""
172
+ ready = [j for j in range(6) if charge_at(body, 2 * j) > 0.9]
173
+ return ready[::2]
174
+
175
+
176
+ def charge_at(body, ticks_ahead, weapon=None):
177
+ weapon = weapon or body.weapon
178
+ T = body.T_ATTACK if weapon == "sword" else body.T_FIST
179
+ return min(1.0, (body.since_swing + ticks_ahead + 0.5) / T)
180
+
181
+
182
+ # ------------------------------------------------------------------------------------------- evaluation
183
+ def evaluate(case, m, cand, cont, shape, horizon=2, taken_w=8.0):
184
+ """Roll cand then (horizon - 1) greedy continuation packets on a clone; return (score, sim).
185
+ taken_w prices player damage against boss damage (x10): long fights must not trade hits. Since minecraft-arena@7
186
+ (no natural regeneration) health is a budget for the whole fight, so the price never drops below HP_BUDGET of
187
+ the exchange rate the fight affords: 10 x boss health left / player health left (see HP_BUDGET)."""
188
+ b = case.body
189
+ budget = HP_BUDGET_BY_BOSS.get(case.boss.name, HP_BUDGET)
190
+ taken_w = max(taken_w, budget * 10.0 * max(float(case.boss.hp), 0.0) / max(float(b.hp), 1.0))
191
+ sim = clone(case)
192
+ boss0, hp0 = float(sim.boss.hp), float(sim.body.hp)
193
+ wither0 = sim.body.wither_t
194
+
195
+ def alive():
196
+ return sum(c["alive"] for c in getattr(sim.boss, "crystals", ()))
197
+ alive0 = alive()
198
+ last = run_packet(sim, cand, m["last"])
199
+ first = (float(sim.boss.hp), float(sim.body.hp))
200
+ # Progress made sooner is worth a little more. Without it a full bow draw held "for later" ties with a release
201
+ # now (the continuation releases anyway), the tie goes to holding, and the next packet repeats it: found
202
+ # 2026-11-02, an easy dragon with a crystal in plain sight and the bow held at full draw for 15 s.
203
+ sooner, hp_prev, alive_prev = 0.0, boss0, alive0
204
+ for k in range(horizon):
205
+ if k:
206
+ if sim.outcome():
207
+ break
208
+ last = run_packet(sim, cont(sim, last), last)
209
+ hp_now, alive_now = float(sim.boss.hp), alive()
210
+ sooner += (1 - k / horizon) * (1.0 * (hp_prev - hp_now) + 3.0 * (alive_prev - alive_now))
211
+ hp_prev, alive_prev = hp_now, alive_now
212
+ dealt = boss0 - float(sim.boss.hp)
213
+ taken = hp0 - float(sim.body.hp) + max(0, sim.body.wither_t - wither0) / mc4d.FPS * 0.7
214
+ crystals = alive0 - alive()
215
+ score = 10 * dealt - taken_w * taken + 25 * crystals + 4 * (boss0 - first[0]) - 4 * (hp0 - first[1]) + sooner
216
+ if sim.outcome() == "win":
217
+ score += 1000
218
+ elif sim.outcome() == "loss":
219
+ score -= 1000
220
+ return score + shape(sim), sim
221
+
222
+
223
+ def best_of(case, m, cands, cont, shape, horizon=2, taken_w=8.0):
224
+ """cands: packets, or (packet, own continuation) pairs; the best first packet wins."""
225
+ best, best_score = None, -math.inf
226
+ for cand in cands:
227
+ own = cont
228
+ if isinstance(cand, tuple):
229
+ cand, own = cand
230
+ s, _ = evaluate(case, m, cand, own, shape, horizon, taken_w)
231
+ if s > best_score + 1e-9:
232
+ best, best_score = cand, s
233
+ return best
234
+
235
+
236
+ def greedy_melee(target_fn, band=(2.4, 3.2)):
237
+ """Continuation: keep aiming, keep the distance band, swing when charged and on target."""
238
+ def cont(sim, last):
239
+ b = sim.body
240
+ point = target_fn(sim)
241
+ dx, dy = aim_to(b, point)
242
+ dist = hdist(b.e.pos, point)
243
+ move = "S" if dist < band[0] else ("W" if dist > band[1] else "")
244
+ swing = None
245
+ if b.weapon == "sword" and charge_at(b, 0) > 0.9 and b.ray_hit(sim) is not None:
246
+ swing = 0
247
+ return build(move, swing=swing, mouse=(dx, dy), last=last)
248
+ return cont
249
+
250
+
251
+ # ------------------------------------------------------------------------------------------- terrain helpers
252
+ def open_space(case, pos):
253
+ """Distance to the arena wall and number of tall columns nearby (a crude 'room to retreat' measure)."""
254
+ H = case.arena.H
255
+ x, z = pos[0], pos[2]
256
+ wall = min(x - 1, z - 1, mc4d.S - 1 - x, mc4d.S - 1 - z)
257
+ ix, iz = int(x), int(z)
258
+ near = H[max(ix - 1, 0):ix + 2, max(iz - 1, 0):iz + 2]
259
+ return wall, int((near > pos[1] + 1).sum())
260
+
261
+
262
+ def safe_shape(case_sim, centre_weight=0.15):
263
+ wall, tall = open_space(case_sim, case_sim.body.e.pos)
264
+ return -centre_weight * max(0.0, 4.0 - wall) ** 2 - 0.4 * tall
265
+
266
+
267
+ # ------------------------------------------------------------------------------------------- melee (golem, zombie)
268
+ def mob_centre(sim):
269
+ g = sim.boss
270
+ return (g.hit_lo() + g.hit_hi()) / 2
271
+
272
+
273
+ def plan_melee(case, m, band, threat_reach, threat=None, taken_w=8.0, horizon=2):
274
+ b, g = case.body, case.boss
275
+ wheel = weapon_wheel(case, "sword")
276
+ lead = g.e.pos + g.e.vel * TICKS * 0.5
277
+ point = (g.hit_lo() + g.hit_hi()) / 2 + (lead - g.e.pos)
278
+ dx, dy = aim_to(b, point)
279
+ dist = hdist(b.e.pos, g.e.pos)
280
+
281
+ def shape(sim):
282
+ d = hdist(sim.body.e.pos, sim.boss.e.pos)
283
+ s = -1.2 * abs(d - (band[0] + band[1]) / 2) + safe_shape(sim)
284
+ if sim.boss.state in ("windup", "swing") and d < threat_reach:
285
+ s -= 6.0
286
+ if threat is not None:
287
+ s += threat(sim)
288
+ s -= 0.02 * view_error(sim.body, mob_centre(sim))
289
+ return s
290
+
291
+ cont = greedy_melee(mob_centre, band)
292
+ cands = []
293
+ swings = [None]
294
+ if wheel == 0 and dist < 5.5:
295
+ swings += swing_slots(b)
296
+ for move in MOVES:
297
+ for jump in ((), (0, 1, 2)):
298
+ if jump and move not in ("", "W", "S"):
299
+ continue
300
+ for sw in swings:
301
+ if jump and sw is not None and not (not b.e.on_ground and b.e.vel[1] < 0):
302
+ continue
303
+ cands.append(build(move, jump=jump, swing=sw, mouse=(dx, dy), wheel=wheel, last=m["last"]))
304
+ # turn and sprint away (sprint 0.281 b/t outruns a mob that is faster than walking backwards)
305
+ away = math.atan2(b.e.pos[2] - g.e.pos[2], b.e.pos[0] - g.e.pos[0])
306
+ for off in (-0.6, 0.0, 0.6):
307
+ turn = math.degrees(wrap(away + off - b.e.yaw)) / DEG
308
+ cands.append(build("W", sprint=True, mouse=(turn, 0), wheel=wheel, last=m["last"]))
309
+ return best_of(case, m, cands, cont, shape, horizon=horizon, taken_w=taken_w)
310
+
311
+
312
+ def golem_gap(sim):
313
+ """Blocks between the player's box and the golem's attack box (Chebyshev; negative = inside). The 1.20.2 attack
314
+ box is the collision box grown 0.828 horizontally, axis-aligned, so on a diagonal it reaches 2.6 blocks."""
315
+ g, p = sim.boss, sim.body.e
316
+ r = g.half[0] + g.ATTACK_INFLATE + mc4d.PLAYER_W / 2
317
+ return max(abs(p.pos[0] - g.e.pos[0]), abs(p.pos[2] - g.e.pos[2])) - r
318
+
319
+
320
+ def box_reach(sim):
321
+ """Distance from the player's eye to the golem's hitbox; the sword ray reaches 3."""
322
+ g, b = sim.boss, sim.body
323
+ eye = b.e.pos + [0, mc4d.EYE, 0]
324
+ return float(np.linalg.norm(eye - np.clip(eye, g.hit_lo(), g.hit_hi())))
325
+
326
+
327
+ def golem_danger(sim, soon=10):
328
+ g = sim.boss
329
+ return g.state == "windup" or (g.state in ("chase", "recover") and g.cd <= mc4d.ticks(soon))
330
+
331
+
332
+ def golem_threat(sim):
333
+ """Slams beyond the rollout horizon: the golem winds up the moment the player is inside its attack box with the
334
+ cooldown done. Keep a margin while it can swing and never be airborne next to it then (no air control).
335
+ Priced near the cost of eating a slam (taken_w x a mid-range hit): a crit is never worth one."""
336
+ g, b = sim.boss, sim.body
337
+ gap = golem_gap(sim)
338
+ s = 0.0
339
+ if g.state == "windup":
340
+ s -= 70.0 * max(0.0, 0.45 - gap)
341
+ elif golem_danger(sim, 8):
342
+ s -= 35.0 * max(0.0, 0.55 - gap)
343
+ if not b.e.on_ground:
344
+ s -= 15.0 * max(0.0, 1.2 - gap)
345
+ return s
346
+
347
+
348
+ def retreat_room(sim, direction=None, limit=8.0):
349
+ """Free floor (blocks) behind the player when backing straight away from the boss (or along direction):
350
+ the arena wall and any column the player would have to jump end it. Backing into a corner is how a
351
+ near-walking-speed golem pins a player."""
352
+ p = sim.body.e.pos
353
+ if direction is None:
354
+ direction = flat(p - sim.boss.e.pos)
355
+ n = float(np.linalg.norm(direction))
356
+ if n < 1e-6:
357
+ return limit
358
+ u, H = direction / n, sim.arena.H
359
+ step = 0.0
360
+ while step < limit:
361
+ q = p + u * (step + 0.5)
362
+ if not (1.3 <= q[0] <= mc4d.S - 1.3 and 1.3 <= q[2] <= mc4d.S - 1.3) or H[int(q[0]), int(q[2])] > p[1] + 0.5:
363
+ break
364
+ step += 0.5
365
+ return step
366
+
367
+
368
+ def golem_cont(sim, last):
369
+ """Continuation that fights like a careful player: face the golem, step back out of its box while it can
370
+ swing (sideways when the wall is behind), close in when out of sword reach, swing on a full charge."""
371
+ b = sim.body
372
+ dx, dy = aim_to(b, mob_centre(sim))
373
+ gap, reach = golem_gap(sim), box_reach(sim)
374
+ back = "S"
375
+ if retreat_room(sim) < 1.5:
376
+ left, right = -b.e.right, b.e.right
377
+ back = "A" if retreat_room(sim, left) >= retreat_room(sim, right) else "D"
378
+ if golem_danger(sim) and gap < 0.7:
379
+ move = back
380
+ elif reach > 2.8:
381
+ move = "W"
382
+ elif gap < 0.35:
383
+ move = back
384
+ else:
385
+ move = ""
386
+ swing = 0 if b.weapon == "sword" and charge_at(b, 0) > 0.9 and b.ray_hit(sim) is not None else None
387
+ return build(move, swing=swing, mouse=(dx, dy), last=last)
388
+
389
+
390
+ def plan_golem(case, m):
391
+ b, g = case.body, case.boss
392
+ wheel = weapon_wheel(case, "sword")
393
+ lead = g.e.pos + g.e.vel * TICKS * 0.5
394
+ dx, dy = aim_to(b, mob_centre(case) + (lead - g.e.pos))
395
+
396
+ def shape(sim):
397
+ gap, reach = golem_gap(sim), box_reach(sim)
398
+ s = -1.2 * max(0.0, reach - 2.7) - 1.2 * max(0.0, 0.6 - gap) + safe_shape(sim) + golem_threat(sim)
399
+ if gap < 2.0: # keep open floor behind: circle away from walls and corners
400
+ s += 1.5 * min(retreat_room(sim), 6.0)
401
+ return s - 0.02 * view_error(sim.body, mob_centre(sim))
402
+
403
+ swings = [None]
404
+ if wheel == 0 and box_reach(case) < 4.0:
405
+ swings += swing_slots(b)
406
+ cands = []
407
+ for move in MOVES:
408
+ for jump in ((), (0, 1, 2)):
409
+ if jump and move not in ("", "W", "S"):
410
+ continue
411
+ for sw in swings:
412
+ if jump and sw is not None and not (not b.e.on_ground and b.e.vel[1] < 0):
413
+ continue
414
+ cands.append(build(move, jump=jump, swing=sw, mouse=(dx, dy), wheel=wheel, last=m["last"]))
415
+ # turn and sprint away (0.281 b/t sprint vs the golem's 0.11-0.15 b/t chase); the continuation keeps running
416
+ # so the rollout prices the escape, not a turn back into the slam
417
+ away = math.atan2(b.e.pos[2] - g.e.pos[2], b.e.pos[0] - g.e.pos[0])
418
+ for off in (-0.6, 0.0, 0.6):
419
+ turn = math.degrees(wrap(away + off - b.e.yaw)) / DEG
420
+ run = lambda sim, last: build("W", sprint=True, last=last)
421
+ cands.append((build("W", sprint=True, mouse=(turn, 0), wheel=wheel, last=m["last"]), run))
422
+ return best_of(case, m, cands, golem_cont, shape, horizon=4, taken_w=24.0)
423
+
424
+
425
+ def plan_zombie(case, m):
426
+ return plan_melee(case, m, band=(2.5, 3.1), threat_reach=2.5)
427
+
428
+
429
+ def plan_zombie_leader(case, m):
430
+ """Leader zombie with reinforcements (minecraft-arena@5; its own case since @6): fight at the edge of the horde, hit the leader on full
431
+ charges and cut down a reinforcement that comes into the sword's reach first (an add swipes as hard as the leader
432
+ but dies in two crits; the leader's hits on the player are what lose the fight). Priced like the golem, per zombie."""
433
+ b, g = case.body, case.boss
434
+ wheel = weapon_wheel(case, "sword")
435
+ target = horde_target(case)
436
+ lead = target.e.pos + target.e.vel * TICKS * 0.5
437
+ dx, dy = aim_to(b, mob_centre_of(target) + (lead - target.e.pos))
438
+ adds0 = {z.n: max(z.hp, 0.0) for z in g.minions if z.hp > 0}
439
+
440
+ def shape(sim):
441
+ gap, reach = mob_gap(sim, sim.boss), mob_reach(sim, sim.boss)
442
+ s = -0.8 * max(0.0, reach - 2.7) - 1.0 * max(0.0, 0.5 - gap) + safe_shape(sim) + horde_threat(sim)
443
+ alive = {z.n: max(z.hp, 0.0) for z in sim.boss.minions if z.hp > 0}
444
+ s += 6.0 * sum(hp - alive.get(n, 0.0) for n, hp in adds0.items()) # thinning the horde
445
+ s += 40.0 * sum(1 for n in adds0 if n not in alive) # a dead add stops swinging for good
446
+ s += 1.0 * min(retreat_room(sim), 6.0) * min(horde_near(sim), 3) # keep open floor behind when crowded
447
+ t = horde_target(sim)
448
+ return s - 0.02 * view_error(sim.body, mob_centre_of(t))
449
+
450
+ swings = [None]
451
+ if wheel == 0 and any(mob_reach(case, z) < 3.6 for z in horde(case)):
452
+ swings += swing_slots(b)
453
+ cands = []
454
+ for move in MOVES:
455
+ for jump in ((), (0, 1, 2)):
456
+ if jump and move not in ("", "W", "S"):
457
+ continue
458
+ for sw in swings:
459
+ if jump and sw is not None and not (not b.e.on_ground and b.e.vel[1] < 0):
460
+ continue
461
+ cands.append(build(move, jump=jump, swing=sw, mouse=(dx, dy), wheel=wheel, last=m["last"]))
462
+ centre = np.mean([z.e.pos for z in horde(case)], axis=0)
463
+ away = math.atan2(b.e.pos[2] - centre[2], b.e.pos[0] - centre[0])
464
+ for off in (-0.9, 0.0, 0.9):
465
+ turn = math.degrees(wrap(away + off - b.e.yaw)) / DEG
466
+ run = lambda sim, last: build("W", sprint=True, last=last)
467
+ cands.append((build("W", sprint=True, mouse=(turn, 0), wheel=wheel, last=m["last"]), run))
468
+ return best_of(case, m, cands, horde_cont, shape, horizon=3, taken_w=14.0)
469
+
470
+
471
+ def mob_centre_of(mob):
472
+ return (mob.hit_lo() + mob.hit_hi()) / 2
473
+
474
+
475
+ def horde_target(sim):
476
+ """Whom to aim at: a reinforcement in sword reach that one full-charge hit kills (it would otherwise keep swinging
477
+ for 2.5-4.5 a time), else a reinforcement clearly closer than the leader, else the leader."""
478
+ g = sim.boss
479
+ one_hit = mc4d.armor_reduce(sim.body.k.sword_dmg * 1.5, g.armor, 0.0)
480
+ best, best_key = g, (2, mob_reach(sim, g))
481
+ for z in g.minions:
482
+ if z.hp <= 0:
483
+ continue
484
+ r = mob_reach(sim, z)
485
+ if r < 2.9 and z.hp <= one_hit:
486
+ key = (0, r)
487
+ elif r < 2.9 and r < mob_reach(sim, g) - 0.3:
488
+ key = (1, r)
489
+ else:
490
+ continue
491
+ if key < best_key:
492
+ best, best_key = z, key
493
+ return best
494
+
495
+
496
+ # ------------------------------------------------------------------------------------------- shared melee helpers (@5)
497
+ def mob_gap(sim, mob):
498
+ """Blocks between the player's box and this mob's 1.20.2 attack box (Chebyshev; negative = inside)."""
499
+ p = sim.body.e
500
+ r = mob.half[0] + mob.ATTACK_INFLATE + mc4d.PLAYER_W / 2
501
+ return max(abs(p.pos[0] - mob.e.pos[0]), abs(p.pos[2] - mob.e.pos[2])) - r
502
+
503
+
504
+ def mob_reach(sim, mob):
505
+ """Distance from the player's eye to this mob's hitbox (the sword ray reaches 3)."""
506
+ eye = sim.body.e.pos + [0, mc4d.EYE, 0]
507
+ return float(np.linalg.norm(eye - np.clip(eye, mob.hit_lo(), mob.hit_hi())))
508
+
509
+
510
+ def horde(sim):
511
+ return [sim.boss] + [z for z in getattr(sim.boss, "minions", ()) if z.hp > 0]
512
+
513
+
514
+ def horde_near(sim, within=3.0):
515
+ return sum(mob_gap(sim, z) < within for z in horde(sim))
516
+
517
+
518
+ def horde_threat(sim):
519
+ """Swings beyond the rollout horizon, for every zombie: inside an attack box while its cooldown runs out."""
520
+ s = 0.0
521
+ for z in horde(sim):
522
+ gap = mob_gap(sim, z)
523
+ if z.state == "windup":
524
+ s -= 16.0 * max(0.0, 0.45 - gap)
525
+ elif z.state in ("chase", "recover") and z.cd <= mc4d.ticks(6):
526
+ s -= 6.0 * max(0.0, 0.5 - gap)
527
+ return s
528
+
529
+
530
+ def horde_cont(sim, last):
531
+ """Continuation: face the current target (an add in reach, else the leader), back away from whichever zombie is
532
+ about to swing, close in when the leader is out of sword reach, swing on a full charge."""
533
+ b, g = sim.body, sim.boss
534
+ target = horde_target(sim)
535
+ dx, dy = aim_to(b, mob_centre_of(target))
536
+ threat = min(horde(sim), key=lambda z: mob_gap(sim, z))
537
+ tgap = mob_gap(sim, threat)
538
+ back = "S"
539
+ if retreat_room(sim, flat(b.e.pos - threat.e.pos)) < 1.5:
540
+ back = "A" if retreat_room(sim, -b.e.right) >= retreat_room(sim, b.e.right) else "D"
541
+ hot = threat.state == "windup" or (threat.state in ("chase", "recover") and threat.cd <= mc4d.ticks(8))
542
+ if hot and tgap < 0.6:
543
+ move = back
544
+ elif mob_reach(sim, g) > 2.8:
545
+ move = "W"
546
+ else:
547
+ move = ""
548
+ swing = 0 if b.weapon == "sword" and charge_at(b, 0) > 0.9 and b.ray_hit(sim) is not None else None
549
+ return build(move, swing=swing, mouse=(dx, dy), last=last)
550
+
551
+
552
+ # ------------------------------------------------------------------------------------------- warden (@5)
553
+ def warden_threat(sim):
554
+ """The warden's smash lands on anything in its attack box when the windup ends; it out-walks a backpedalling
555
+ player, so the only escape is backing out *during* the windup, from the edge of its box. One smash costs 8-15 HP.
556
+ Price being deep inside the box while its cooldown runs out (no escape from there) and being airborne then."""
557
+ g, b = sim.boss, sim.body
558
+ gap = mob_gap(sim, g)
559
+ s = 0.0
560
+ if g.phase == "windup":
561
+ s -= 90.0 * max(0.0, 0.5 - gap)
562
+ elif g.phase in ("chase", "recover"):
563
+ soon = max(0.0, 1.0 - g.cd / mc4d.ticks(24)) # 0 with 24+ vanilla ticks of cooldown left, 1 at 0
564
+ s -= 60.0 * soon * max(0.0, 0.45 - gap - 0.55 * (1.0 - soon))
565
+ if not b.e.on_ground and soon > 0.5:
566
+ s -= 20.0 * max(0.0, 1.3 - gap)
567
+ return s
568
+
569
+
570
+ def warden_cont(sim, last):
571
+ """Continuation: face the warden; while it winds up, backpedal (sideways at a wall); in its recovery and early
572
+ cooldown stay in sword reach; as the cooldown runs out, drift to the edge of its attack box; swing on full charge."""
573
+ b, g = sim.body, sim.boss
574
+ dx, dy = aim_to(b, mob_centre(sim))
575
+ gap, reach = mob_gap(sim, g), mob_reach(sim, g)
576
+ back = "S"
577
+ if retreat_room(sim) < 1.5:
578
+ back = "A" if retreat_room(sim, -b.e.right) >= retreat_room(sim, b.e.right) else "D"
579
+ if g.phase == "windup" and gap < 0.6:
580
+ move = back
581
+ elif g.phase in ("chase", "recover") and g.cd <= mc4d.ticks(12) and gap < 0.1:
582
+ move = back
583
+ elif reach > 2.8:
584
+ move = "W"
585
+ else:
586
+ move = ""
587
+ swing = 0 if b.weapon == "sword" and charge_at(b, 0) > 0.9 and b.ray_hit(sim) is not None else None
588
+ return build(move, swing=swing, mouse=(dx, dy), last=last)
589
+
590
+
591
+ def plan_warden(case, m):
592
+ b, g = case.body, case.boss
593
+ wheel = weapon_wheel(case, "sword")
594
+ dx, dy = aim_to(b, mob_centre(case))
595
+
596
+ def shape(sim):
597
+ w = sim.boss
598
+ gap, reach = mob_gap(sim, w), mob_reach(sim, w)
599
+ s = -1.0 * max(0.0, reach - 2.7) + safe_shape(sim) + warden_threat(sim)
600
+ if gap < 2.0:
601
+ s += 1.5 * min(retreat_room(sim), 6.0)
602
+ s -= 0.3 * max(0.0, w.out_of_reach / mc4d.FPS - 2.0) # staying out of reach invites a sonic boom
603
+ return s - 0.02 * view_error(sim.body, mob_centre(sim))
604
+
605
+ swings = [None]
606
+ if wheel == 0 and mob_reach(case, g) < 4.0:
607
+ swings += swing_slots(b)
608
+ # No crit jumps once its cooldown is nearly over: a player in the air when the smash winds up cannot back out of
609
+ # the attack box (no air control), and the smash lands after the rollout horizon (found 2026-11-03, hard seed 2).
610
+ jump_ok = g.phase in ("recover", "boom_recover") or (g.phase == "chase" and g.cd > mc4d.ticks(24))
611
+ cands = []
612
+ for move in MOVES:
613
+ for jump in ((), (0, 1, 2)):
614
+ if jump and (move not in ("", "W", "S") or not jump_ok):
615
+ continue
616
+ for sw in swings:
617
+ if jump and sw is not None and not (not b.e.on_ground and b.e.vel[1] < 0):
618
+ continue
619
+ cands.append(build(move, jump=jump, swing=sw, mouse=(dx, dy), wheel=wheel, last=m["last"]))
620
+ away = math.atan2(b.e.pos[2] - g.e.pos[2], b.e.pos[0] - g.e.pos[0])
621
+ for off in (-0.6, 0.0, 0.6):
622
+ turn = math.degrees(wrap(away + off - b.e.yaw)) / DEG
623
+ run = lambda sim, last: build("W", sprint=True, last=last)
624
+ cands.append((build("W", sprint=True, mouse=(turn, 0), wheel=wheel, last=m["last"]), run))
625
+ return best_of(case, m, cands, warden_cont, shape, horizon=4, taken_w=24.0)
626
+
627
+
628
+ # ------------------------------------------------------------------------------------------- skeleton (@5)
629
+ def arrow_threat(sim):
630
+ """Boss arrows closing on the player beyond the rollout horizon."""
631
+ p = sim.body.e.pos + [0, 0.9, 0]
632
+ pen = 0.0
633
+ for a in getattr(sim.boss, "arrows", ()):
634
+ rel = p - a["pos"]
635
+ dist = float(np.linalg.norm(rel))
636
+ v = a["vel"]
637
+ speed = float(np.linalg.norm(v)) + 1e-9
638
+ if dist < 12 and float(rel @ v) / (dist * speed + 1e-9) > 0.6:
639
+ pen += max(0.0, 1.0 - float(np.linalg.norm(np.cross(rel, v / speed)))) * 2.0
640
+ return pen
641
+
642
+
643
+ def skeleton_cont(sim, last):
644
+ """Continuation: when the draw is about to release, strafe across the line of fire (a Java skeleton does not lead
645
+ its target, so a side-step beats the arrow beyond ~2.5 blocks); otherwise close in (sprinting when far) and
646
+ swing on a full charge."""
647
+ b, g = sim.body, sim.boss
648
+ dx, dy = aim_to(b, mob_centre(sim))
649
+ if g.state == "windup" and g.timer < 0.45:
650
+ side = "A" if retreat_room(sim, -b.e.right) >= retreat_room(sim, b.e.right) else "D"
651
+ return build(side, mouse=(dx, dy), last=last)
652
+ reach = mob_reach(sim, g)
653
+ if reach > 6.0:
654
+ return build("W", sprint=True, mouse=(dx, dy), last=last)
655
+ move = "W" if reach > 2.6 else ""
656
+ swing = 0 if b.weapon == "sword" and charge_at(b, 0) > 0.9 and b.ray_hit(sim) is not None else None
657
+ return build(move, swing=swing, mouse=(dx, dy), last=last)
658
+
659
+
660
+ def plan_skeleton(case, m):
661
+ b, g = case.body, case.boss
662
+ wheel = weapon_wheel(case, "sword")
663
+ lead = g.e.pos + g.e.vel * TICKS * 0.5
664
+ dx, dy = aim_to(b, mob_centre(case) + (lead - g.e.pos))
665
+
666
+ def shape(sim):
667
+ s_ = sim.boss
668
+ drawing = s_.state == "windup"
669
+ s = -(0.25 if drawing else 0.8) * max(0.0, mob_reach(sim, s_) - 2.6) - arrow_threat(sim) + safe_shape(sim)
670
+ return s - 0.02 * view_error(sim.body, mob_centre(sim))
671
+
672
+ swings = [None]
673
+ if wheel == 0 and mob_reach(case, g) < 4.0:
674
+ swings += swing_slots(b)
675
+ cands = []
676
+ for move in MOVES:
677
+ for jump in ((), (0, 1, 2)):
678
+ if jump and move not in ("", "W"):
679
+ continue
680
+ for sw in swings:
681
+ if jump and sw is not None and not (not b.e.on_ground and b.e.vel[1] < 0):
682
+ continue
683
+ cands.append(build(move, jump=jump, swing=sw, mouse=(dx, dy), wheel=wheel, last=m["last"]))
684
+ for jump in ((), (0, 1)): # sprint (and sprint-jump) straight at it
685
+ cands.append(build("W", jump=jump, sprint=True, mouse=(dx, dy), wheel=wheel, last=m["last"]))
686
+ if g.state == "windup": # sprint across the line of fire (5.6 b/s vs walking 4.3)
687
+ to = math.atan2(g.e.pos[2] - b.e.pos[2], g.e.pos[0] - b.e.pos[0])
688
+ for off in (-math.pi / 2, math.pi / 2):
689
+ turn = math.degrees(wrap(to + off - b.e.yaw)) / DEG
690
+ run = lambda sim, last: build("W", sprint=True, last=last)
691
+ cands.append((build("W", sprint=True, mouse=(turn, 0), wheel=wheel, last=m["last"]), run))
692
+ # An arrow costs more than a crit gains: Java Hard arrows (every 2 s, 4-8) out-damage natural regeneration ten to
693
+ # one, so trading hits loses any fight longer than a minute (found 2026-11-03: hard 1/3 at a weight of 10).
694
+ return best_of(case, m, cands, skeleton_cont, shape, horizon=3, taken_w=20.0)
695
+
696
+
697
+ # ------------------------------------------------------------------------------------------- bow helpers
698
+ def ballistic_pitch(dx_h, dy, power=1.0):
699
+ """Pitch (rad) that makes a bow arrow of this power pass (dx_h, dy) relative to the eye (vanilla physics)."""
700
+ speed = mc4d.BOW_RULES['maximum_speed_blocks_per_vanilla_tick'] * power
701
+ g, drag = mc4d.BOW_RULES['gravity_blocks_per_vanilla_tick_squared'], mc4d.BOW_RULES['drag_per_vanilla_tick']
702
+
703
+ def height_at(pitch):
704
+ vx, vy, x, y = speed * math.cos(pitch), speed * math.sin(pitch), 0.0, 0.0
705
+ for n in range(200):
706
+ if x + vx >= dx_h:
707
+ u = (dx_h - x) / max(vx, 1e-9)
708
+ return y + vy * u, n + u
709
+ x, y = x + vx, y + vy
710
+ vx, vy = vx * drag, vy * drag - g
711
+ return -1e9, 200
712
+
713
+ lo, hi = -1.45, 1.45
714
+ pitch = math.atan2(dy, max(dx_h, 1e-6))
715
+ for _ in range(18):
716
+ h, _ = height_at(pitch)
717
+ if h < dy:
718
+ lo = pitch
719
+ else:
720
+ hi = pitch
721
+ pitch = (lo + hi) / 2
722
+ return pitch, height_at(pitch)[1]
723
+
724
+
725
+ def bow_aim(case, point_fn, sim_future=None):
726
+ """Mouse to aim a full-power arrow at a moving point. point_fn(sim) gives the aim point in a state;
727
+ sim_future: list of (tick offset, point) predictions used for the lead."""
728
+ b = case.body
729
+ eye = b.e.pos + [0, mc4d.EYE, 0]
730
+ point = point_fn(case)
731
+ flight = 0.0
732
+ for _ in range(3):
733
+ target = point
734
+ if sim_future:
735
+ k = min(len(sim_future) - 1, int(round(flight / mc4d.VT)) + TICKS)
736
+ target = sim_future[k]
737
+ d = target - eye
738
+ pitch, flight = ballistic_pitch(math.hypot(d[0], d[2]), d[1])
739
+ yaw = math.atan2(d[2], d[0])
740
+ return math.degrees(wrap(yaw - b.e.yaw)) / DEG, -math.degrees(pitch - b.e.pitch) / DEG, target
741
+
742
+
743
+ def predict(case, m, point_fn, n_packets=3, move=""):
744
+ """Future aim points (per tick) if the player stands (or keeps `move`), from a clone rollout."""
745
+ sim = clone(case)
746
+ out = [point_fn(sim)]
747
+ last = m["last"]
748
+ for _ in range(n_packets):
749
+ held = build(move, rmb="hold" if sim.body.bow_drawing else None, last=last)
750
+ sched, last = km.schedule(held, TICKS, last)
751
+ for h, p, mo in sched:
752
+ if sim.outcome():
753
+ break
754
+ sim.tick(sim.body.keys(sim, h, p, mo))
755
+ out.append(point_fn(sim))
756
+ return out
757
+
758
+
759
+ def bow_cands(case, m, point_fn, moves=MOVES, wheel=0, extra_shape=None, allow_release=True):
760
+ """Candidates while using the bow: keep drawing (with each movement) or release at substep j."""
761
+ b = case.body
762
+ future = predict(case, m, point_fn)
763
+ dx, dy, _ = bow_aim(case, point_fn, future)
764
+ cands = []
765
+ full_in = max(0, int(mc4d.FPS * mc4d.BOW_RULES['draw_seconds']) - b.bow_draw_ticks)
766
+ for move in moves:
767
+ cands.append(build(move, rmb="hold", mouse=(dx, dy), wheel=wheel, last=m["last"]))
768
+ if b.bow_drawing and allow_release:
769
+ for j in range(6):
770
+ if 2 * j >= full_in:
771
+ cands.append(build(move, rmb=j, mouse=(dx, dy), wheel=wheel, last=m["last"]))
772
+ return cands, (dx, dy)
773
+
774
+
775
+ def bow_cont(point_fn):
776
+ def cont(sim, last):
777
+ b = sim.body
778
+ point = point_fn(sim)
779
+ eye = b.e.pos + [0, mc4d.EYE, 0]
780
+ d = point - eye
781
+ pitch, _ = ballistic_pitch(math.hypot(d[0], d[2]), d[1])
782
+ yaw = math.atan2(d[2], d[0])
783
+ dx, dy = math.degrees(wrap(yaw - b.e.yaw)) / DEG, -math.degrees(pitch - b.e.pitch) / DEG
784
+ full = b.bow_draw_ticks >= mc4d.FPS * mc4d.BOW_RULES['draw_seconds']
785
+ return build("", rmb=0 if full else "hold", mouse=(dx, dy), last=last)
786
+ return cont
787
+
788
+
789
+ def arrow_score_horizon(case):
790
+ return 3 # arrows need ~1-3 packets to land
791
+
792
+
793
+ # ------------------------------------------------------------------------------------------- wither
794
+ def wither_body(sim):
795
+ g = sim.boss
796
+ return (g.hit_lo() + g.hit_hi()) / 2 + [0, 0.3, 0]
797
+
798
+
799
+ def skull_threat(sim):
800
+ """Penalty for skulls closing on the player (predicts hits beyond the rollout horizon)."""
801
+ p = sim.body.e.pos + [0, 0.9, 0]
802
+ pen = 0.0
803
+ for s in sim.boss.skulls:
804
+ rel = p - s["pos"]
805
+ dist = float(np.linalg.norm(rel))
806
+ v = s["vel"]
807
+ speed = float(np.linalg.norm(v)) + 1e-9
808
+ closing = float(rel @ v) / (dist * speed + 1e-9)
809
+ if closing > 0.6 and dist < 8:
810
+ miss = float(np.linalg.norm(np.cross(rel, v / speed)))
811
+ pen += max(0.0, 1.2 - miss) * 3.0
812
+ return pen
813
+
814
+
815
+ def plan_wither(case, m):
816
+ b, g = case.body, case.boss
817
+ if g.state == "spawn":
818
+ # run to the far side and face the wither; the power-7 blast reaches 14 blocks
819
+ wheel = weapon_wheel(case, "bow")
820
+ away = flat(b.e.pos - g.e.pos)
821
+ away /= np.linalg.norm(away) + 1e-9
822
+ goal = np.clip(g.e.pos + away * 20.0, 2.5, mc4d.S - 2.5)
823
+ dist_goal = hdist(b.e.pos, goal)
824
+ face = goal if dist_goal > 1.5 else g.e.pos + [0, 1.0, 0]
825
+ dx, dy = aim_to(b, face + [0, mc4d.EYE if dist_goal > 1.5 else 0, 0])
826
+ mv = "W" if dist_goal > 1.0 else ""
827
+
828
+ def shape(sim):
829
+ return -1.5 * max(0.0, 15.5 - hdist(sim.body.e.pos, sim.boss.e.pos)) + safe_shape(sim, 0.05)
830
+ cands = [build(mv, jump=j, sprint=True, mouse=(dx, dy), wheel=wheel, last=m["last"]) for j in ((), (0, 1))]
831
+ cands += [build(k, mouse=(dx, dy), wheel=wheel, last=m["last"]) for k in ("A", "D")]
832
+ return best_of(case, m, cands, lambda sim, last: build(mv, sprint=True, mouse=(0, 0), last=last), shape)
833
+
834
+ if g.armored:
835
+ # phase 2: sword on the ground, keep 2.2-2.8 blocks, dodge skulls
836
+ wheel = weapon_wheel(case, "sword")
837
+ point = wither_body(case) - [0, 0.6, 0]
838
+ dx, dy = aim_to(b, point)
839
+ dist = hdist(b.e.pos, g.e.pos)
840
+
841
+ def shape(sim):
842
+ d = hdist(sim.body.e.pos, sim.boss.e.pos)
843
+ return -1.0 * abs(d - 2.5) - skull_threat(sim) + safe_shape(sim) - 0.02 * view_error(sim.body, wither_body(sim))
844
+ swings = [None]
845
+ if wheel == 0 and dist < 4.5:
846
+ swings += swing_slots(b)
847
+ cands = []
848
+ for move in MOVES:
849
+ for jump in ((), (0, 1, 2)):
850
+ if jump and move not in ("", "W"):
851
+ continue
852
+ for sw in swings:
853
+ cands.append(build(move, jump=jump, swing=sw, mouse=(dx, dy), wheel=wheel, last=m["last"]))
854
+ # A skull fired from 2-3 blocks lands within a packet, before the 2-packet rollout can price a dodge, and on
855
+ # Java Hard each one carries 40 s of Wither II. When one is closing in, look 3 packets ahead and value
856
+ # health like the long fight it is (found 2026-11-02: hard-tier losses were all to skulls at melee range).
857
+ incoming = skull_threat(case) > 0.0
858
+ return best_of(case, m, cands, greedy_melee(lambda s: wither_body(s) - [0, 0.6, 0], (2.2, 2.8)), shape,
859
+ horizon=3 if incoming else 2, taken_w=16.0 if incoming else 8.0)
860
+
861
+ # phase 1: bow, keep 4-9 blocks horizontally, dodge skulls between draws
862
+ wheel = weapon_wheel(case, "bow")
863
+ if wheel:
864
+ dx, dy = aim_to(b, wither_body(case))
865
+ return build("S", mouse=(dx, dy), wheel=wheel, last=m["last"])
866
+
867
+ def shape(sim):
868
+ d = hdist(sim.body.e.pos, sim.boss.e.pos)
869
+ eye = sim.body.e.pos + [0, mc4d.EYE, 0]
870
+ sight = 0.0 if sim.arena.los(eye, wither_body(sim), eye_h=0.0) else -2.5
871
+ # a wither directly overhead fires straight down: keep 5-9 blocks of horizontal distance
872
+ return (-0.2 * max(0.0, d - 10) - 0.8 * max(0.0, 5.0 - d) - 0.25 * skull_threat(sim) + safe_shape(sim) + sight
873
+ + 0.05 * min(sim.body.bow_draw_ticks, 60))
874
+ cands, _ = bow_cands(case, m, wither_body, moves=("", "A", "D", "S", "W"))
875
+ look = aim_to(b, wither_body(case))
876
+ if not b.bow_drawing or b.bow_draw_ticks <= 15: # releasing a longer draw would waste it on a weak arrow
877
+ cands += [build(mv, mouse=look, last=m["last"]) for mv in ("A", "D", "S", "W")]
878
+ elif g.skulls: # a skull is coming: release now and sidestep at full speed
879
+ for mv in ("A", "D"):
880
+ keep = lambda sim, last, mv=mv: build(mv, mouse=aim_to(sim.body, wither_body(sim)), last=last)
881
+ cands.append((build(mv, mouse=look, last=m["last"]), keep))
882
+ return best_of(case, m, cands, bow_cont(wither_body), shape, horizon=3)
883
+
884
+
885
+ # ------------------------------------------------------------------------------------------- ender dragon
886
+ def dragon_head(sim):
887
+ return sim.boss.head_center()
888
+
889
+
890
+ def head_reach(sim):
891
+ """Distance from the player's eye to the dragon's head box; the sword ray reaches 3."""
892
+ h = sim.boss.head_center()
893
+ eye = sim.body.e.pos + [0, mc4d.EYE, 0]
894
+ return float(np.linalg.norm(eye - np.clip(eye, h - [0.55, 0.45, 0.55], h + [0.55, 0.45, 0.55])))
895
+
896
+
897
+ def perch_cont(sim, last):
898
+ """Continuation at a perched dragon: walk into sword reach of the head (never into its contact box), step out
899
+ of a breath cloud sideways, swing on a full charge."""
900
+ b, g = sim.body, sim.boss
901
+ h = g.head_center()
902
+ dx, dy = aim_to(b, h)
903
+ gap = max(abs(b.e.pos[0] - h[0]), abs(b.e.pos[2] - h[2])) - 1.85
904
+ inside = [c for c in g.clouds if hdist(b.e.pos, c["pos"]) < c["r"] + 0.3]
905
+ if inside:
906
+ c = inside[0]
907
+ side = float(np.dot(flat(b.e.pos - c["pos"]), b.e.right))
908
+ move = "D" if side >= 0 else "A"
909
+ elif gap < 0.3:
910
+ move = "S"
911
+ elif head_reach(sim) > 2.7:
912
+ move = "W"
913
+ else:
914
+ move = ""
915
+ swing = 0 if b.weapon == "sword" and charge_at(b, 0) > 0.9 and b.ray_hit(sim) is not None else None
916
+ return build(move, swing=swing, mouse=(dx, dy), last=last)
917
+
918
+
919
+ def dragon_body(sim):
920
+ return sim.boss.e.pos.copy()
921
+
922
+
923
+ def clear_shot(sim, point):
924
+ """True when the straight line from the player's eye to point crosses no terrain (a cheap proxy for the
925
+ ballistic arc, which only rises above it)."""
926
+ eye = sim.body.e.pos + [0, mc4d.EYE, 0]
927
+ wall, _ = sim._arrow_world_hit(eye, np.asarray(point, float))
928
+ return wall is None or wall >= 0.999
929
+
930
+
931
+ BLAST_SAFE = 12.5 # power-6 crystal blast reaches 12 blocks (mc4d.crystal_destroyed)
932
+
933
+
934
+ def crystal_dist(sim, c):
935
+ return float(np.linalg.norm(sim.body.e.pos + [0, 0.9, 0] - c["pos"]))
936
+
937
+
938
+ def crystal_target(case):
939
+ """Only the crystal that is shot explodes. Prefer one in the clear and already outside its blast: the healing
940
+ crystal first (breaking it also hurts the dragon), then the one nearest 13 blocks away."""
941
+ g = case.boss
942
+ alive = [c for c in g.crystals if c["alive"]]
943
+ if not alive:
944
+ return None
945
+ p = case.body.e.pos
946
+
947
+ def key(c):
948
+ clear = clear_shot(case, c["pos"] + [0, 0.8, 0])
949
+ return (not clear, crystal_dist(case, c) < BLAST_SAFE, c is not g.heal_from, abs(hdist(p, c["pos"]) - 13.0),
950
+ c["id"])
951
+ return min(alive, key=key)
952
+
953
+
954
+ def plan_dragon(case, m):
955
+ b, g = case.body, case.boss
956
+ sitting = g.phase in g.SITTING
957
+ clouds = g.clouds
958
+
959
+ def cloud_pen(sim):
960
+ p = sim.body.e.pos
961
+ pen = 0.0
962
+ for c in sim.boss.clouds:
963
+ d = hdist(p, c["pos"])
964
+ pen += max(0.0, c["r"] + 1.0 - d) * 2.0
965
+ for f in sim.boss.fireballs:
966
+ rel = p + [0, 0.9, 0] - f["pos"]
967
+ dist = float(np.linalg.norm(rel))
968
+ if dist < 12:
969
+ miss = float(np.linalg.norm(np.cross(rel, f["dir"])))
970
+ pen += max(0.0, 3.5 - miss) * 0.8
971
+ return pen
972
+
973
+ if sitting and g.phase != "landing":
974
+ # perched: sword on the head (full damage). The perched dragon keeps turning to face the player, so the
975
+ # head is always attacked from the front: inside sword reach, outside the head's contact box, and out of the
976
+ # breath cloud it drops in front of its head (the cloud stays where it fell; a sidestep leaves it).
977
+ wheel = weapon_wheel(case, "sword")
978
+ head = g.head_center()
979
+ dx, dy = aim_to(b, head)
980
+
981
+ def shape(sim):
982
+ h = sim.boss.head_center()
983
+ p = sim.body.e.pos
984
+ gap = max(abs(p[0] - h[0]), abs(p[2] - h[2])) - 1.85 # > 0: outside the contact box
985
+ return (-1.5 * max(0.0, head_reach(sim) - 2.6) - cloud_pen(sim) - 0.03 * view_error(sim.body, h)
986
+ - 12.0 * max(0.0, 0.25 - gap))
987
+ swings = [None]
988
+ if wheel == 0 and head_reach(case) < 3.6:
989
+ swings += swing_slots(b)
990
+ cands = []
991
+ for move in MOVES:
992
+ for jump in ((), (0, 1, 2)):
993
+ if jump and move not in ("", "W"):
994
+ continue
995
+ for sw in swings:
996
+ cands.append(build(move, jump=jump, swing=sw, mouse=(dx, dy), wheel=wheel, last=m["last"]))
997
+ return best_of(case, m, cands, perch_cont, shape, horizon=3)
998
+
999
+ danger = any(hdist(b.e.pos, c["pos"]) < c["r"] + 0.6 for c in clouds) or any(
1000
+ _fireball_lands_near(case, f) for f in g.fireballs)
1001
+ if danger:
1002
+ return flee(case, m, cloud_pen)
1003
+ if g.phase == "strafe" and g.goal is not None:
1004
+ return lineup_dodge(case, m, cloud_pen)
1005
+ wheel = weapon_wheel(case, "bow")
1006
+ crystal = crystal_target(case)
1007
+ if crystal is not None:
1008
+ point_fn = lambda sim, cid=crystal["id"]: sim.boss.crystals[cid]["pos"] + [0, 0.8, 0]
1009
+ want = 13.0
1010
+ else:
1011
+ point_fn = dragon_head
1012
+ want = 9.0
1013
+ if wheel:
1014
+ dx, dy = aim_to(b, point_fn(case))
1015
+ return build("", mouse=(dx, dy), wheel=wheel, last=m["last"])
1016
+
1017
+ def shape(sim):
1018
+ s = -cloud_pen(sim) + safe_shape(sim)
1019
+ if crystal is not None:
1020
+ c = sim.boss.crystals[crystal["id"]]
1021
+ s -= 0.3 * abs(hdist(sim.body.e.pos, c["pos"]) - want)
1022
+ s -= 3.0 * max(0.0, BLAST_SAFE - crystal_dist(sim, c))
1023
+ if not clear_shot(sim, point_fn(sim)): # a draw held at a hidden crystal is wasted time
1024
+ s -= 3.0
1025
+ else:
1026
+ s -= 0.1 * abs(hdist(sim.body.e.pos, [mc4d.MID, 0, mc4d.MID]) - 6.0)
1027
+ return s
1028
+ too_close = crystal is not None and crystal_dist(case, crystal) < BLAST_SAFE
1029
+ cands, _ = bow_cands(case, m, point_fn, allow_release=not too_close)
1030
+ if too_close: # run out of the power-6 blast before shooting: 8 headings
1031
+ cands = []
1032
+ for k in range(8):
1033
+ turn = math.degrees(wrap(2 * math.pi * k / 8 - b.e.yaw)) / DEG
1034
+ run = lambda sim, last: build("W", sprint=True, last=last)
1035
+ cands.append((build("W", sprint=True, mouse=(turn, 0), last=m["last"]), run))
1036
+ return best_of(case, m, cands, None, shape, horizon=2)
1037
+ return best_of(case, m, cands, bow_cont(point_fn), shape, horizon=3)
1038
+
1039
+
1040
+ def _fireball_lands_near(case, f, radius=3.6):
1041
+ p = case.body.e.pos
1042
+ rel = p + [0, 0.9, 0] - f["pos"]
1043
+ along = float(rel @ f["dir"])
1044
+ if along < 0 or along > 14:
1045
+ return False
1046
+ return float(np.linalg.norm(rel - f["dir"] * along)) < radius
1047
+
1048
+
1049
+ def flee(case, m, penalty):
1050
+ """Sprint out of a hazard: 8 headings, continuation keeps running; bow draw is dropped."""
1051
+ b = case.body
1052
+ cands = []
1053
+ for k in range(8):
1054
+ yaw = 2 * math.pi * k / 8
1055
+ dx = math.degrees(wrap(yaw - b.e.yaw)) / DEG
1056
+ cands.append(build("W", jump=(0, 1) if k % 2 else (), sprint=True, mouse=(dx, 0), last=m["last"]))
1057
+ return best_of(case, m, cands, lambda sim, last: build("W", sprint=True, last=last),
1058
+ lambda sim: -2.0 * penalty(sim) + safe_shape(sim), horizon=3)
1059
+
1060
+
1061
+ def lineup_dodge(case, m, penalty):
1062
+ """The dragon is lining up a fireball (mouth glow, HUD flash): the shot goes where the player stands when it
1063
+ fires and its cloud is 3 blocks wide, so drop the draw and sprint across the dragon's line of approach."""
1064
+ b, g = case.body, case.boss
1065
+ p0 = b.e.pos.copy()
1066
+ line = flat(p0 - g.e.pos)
1067
+ line /= float(np.linalg.norm(line)) + 1e-9
1068
+
1069
+ def shape(sim):
1070
+ moved = flat(sim.body.e.pos - p0)
1071
+ across = abs(moved[0] * line[2] - moved[2] * line[0])
1072
+ return 2.0 * min(across, 4.0) - 2.0 * penalty(sim) + safe_shape(sim)
1073
+ cands = []
1074
+ for k in range(8):
1075
+ dx = math.degrees(wrap(2 * math.pi * k / 8 - b.e.yaw)) / DEG
1076
+ cands.append(build("W", jump=(0, 1) if k % 2 else (), sprint=True, mouse=(dx, 0), last=m["last"]))
1077
+ return best_of(case, m, cands, lambda sim, last: build("W", sprint=True, last=last), shape, horizon=3)
1078
+
1079
+
1080
+ PLANNERS = {"iron_golem": plan_golem, "zombie": plan_zombie, "ender_dragon": plan_dragon, "wither": plan_wither,
1081
+ "warden": plan_warden, "skeleton": plan_skeleton, "zombie_leader": plan_zombie_leader}
1082
+
1083
+
1084
+ # ------------------------------------------------------------------------------------------- self-check
1085
+ def play(mob, seed=1, d=0.5, weapon="sword", max_packets=None, verbose=False):
1086
+ """Run the controller on a bare MobFight (no renderer) to the terminal outcome; for quick tuning."""
1087
+ case = mc4d.MobFight(mob, style=mc4d.STYLES[mob], weapon=weapon, max_seconds=mc4d.SECONDS[mob])
1088
+ case.reset(seed, d)
1089
+ last = frozenset()
1090
+ limit = max_packets or int(mc4d.SECONDS[mob] * 5)
1091
+ for i in range(limit):
1092
+ p = km.parse_packet(scripted(case))
1093
+ assert p is not None
1094
+ case.events.clear()
1095
+ last = run_packet(case, p, last)
1096
+ if verbose and i % 25 == 0:
1097
+ print(i, case.boss.state, round(case.boss.hp, 1), round(case.body.hp, 1), case.body.weapon)
1098
+ if case.outcome():
1099
+ break
1100
+ return {"mob": mob, "seed": seed, "d": d, "weapon": weapon, "outcome": case.outcome() or "timeout",
1101
+ "seconds": round(case.t / mc4d.FPS, 2), "boss_hp": round(float(case.boss.hp), 1),
1102
+ "player_hp": round(float(case.body.hp), 1)}
environments/games/prototype/bossbench/mcskin.py ADDED
The diff for this file is too large to render. See raw diff
 
environments/games/prototype/bossbench/native_games.py ADDED
@@ -0,0 +1,249 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Optional browser-backed integrations; no dependency on a game's internal world classes.
2
+
3
+ The protocol also permits other implementations (native executable, RPC, Python).
4
+ Only this integration knows JavaScript and Canvas. All instances have isolated pages.
5
+ """
6
+ from __future__ import annotations
7
+
8
+ import base64
9
+ import io
10
+ import json
11
+ import os
12
+ from pathlib import Path
13
+
14
+ import numpy as np
15
+ from PIL import Image
16
+
17
+ from .engine_contract import EngineSpec, EngineSnapshot, RenderStatus
18
+
19
+ WEB = Path(__file__).resolve().parents[2] / 'web'
20
+
21
+
22
+ def _discover_native_games():
23
+ """Every web/games/<game>/manifest.json with engine "independent" is a native game.
24
+
25
+ New games register themselves by adding their own manifest; no shared file has to change.
26
+ """
27
+ games = []
28
+ for manifest in sorted((WEB / 'games').glob('*/manifest.json')):
29
+ if manifest.parent.name.startswith(('_', '.')):
30
+ continue
31
+ try:
32
+ data = json.loads(manifest.read_text(encoding='utf8'))
33
+ except (OSError, ValueError):
34
+ continue
35
+ if data.get('engine') == 'independent':
36
+ games.append(manifest.parent.name)
37
+ return tuple(games)
38
+
39
+
40
+ NATIVE_GAMES = _discover_native_games()
41
+
42
+
43
+ def _load_manifests():
44
+ """Each independent game declares itself in web/games/<game>/manifest.json (bossbench/game-manifest@1).
45
+
46
+ The JS module's own declaration (hz, version, renderer) is checked against it when a backend starts,
47
+ so a game folder can bump its rule version or add script files without editing this module.
48
+ """
49
+ cases = {}
50
+ for game in NATIVE_GAMES:
51
+ manifest = json.loads((WEB / 'games' / game / 'manifest.json').read_text(encoding='utf8'))
52
+ if manifest.get('schema') != 'bossbench/game-manifest@1' or manifest.get('game') != game:
53
+ raise RuntimeError(f'{game}: invalid manifest.json')
54
+ for case_id in manifest['cases']:
55
+ if case_id in cases:
56
+ raise RuntimeError(f'native case declared twice: {case_id}')
57
+ cases[case_id] = {'game': game, 'dimension': manifest['dimension'], 'hz': manifest['native_hz'],
58
+ 'module': manifest['module'], 'renderer': manifest['renderer'],
59
+ 'seconds': manifest['max_seconds'], 'version': manifest['rules'],
60
+ 'scripts': tuple(manifest['scripts'])}
61
+ return cases
62
+
63
+
64
+ NATIVE_CASES = _load_manifests()
65
+
66
+
67
+ def source_paths(case_id):
68
+ spec = NATIVE_CASES[case_id]
69
+ return [Path(__file__), *(WEB / 'games' / path for path in spec['scripts'])]
70
+
71
+
72
+ class JavaScriptBackend:
73
+ def __init__(self, case_id):
74
+ from .webenv import BrowserTransport
75
+ self.case_id = case_id
76
+ entry = NATIVE_CASES[case_id]
77
+ self.spec = EngineSpec(entry['game'], entry['dimension'], entry['hz'], entry['seconds'],
78
+ entry['renderer'], 'perspective' if entry['dimension'] == '3d' else 'raster',
79
+ rule_version=entry['version'])
80
+ self.page = None
81
+ self._pid = os.getpid()
82
+ self._ready = False
83
+ self._error = None
84
+ self._reset = False
85
+ try:
86
+ self.page = BrowserTransport._launch().new_page(viewport={'width': 854, 'height': 480})
87
+ self.page.set_content('<canvas id="view" width="854" height="480"></canvas>')
88
+ for script in source_paths(case_id)[1:]:
89
+ self.page.add_script_tag(path=str(script))
90
+ self.page.evaluate('name => { window.backendModule=window[name]; window.backendCanvas=document.querySelector("canvas"); }', entry['module'])
91
+ declaration = self.page.evaluate('() => [backendModule.hz,backendModule.version,backendModule.renderer]')
92
+ if declaration != [self.spec.native_hz, self.spec.rule_version, self.spec.renderer]:
93
+ raise RuntimeError('Python/JavaScript engine declaration mismatch')
94
+ from .tiers import validate_declared
95
+ self._tiers = validate_declared(self.page.evaluate('() => backendModule.tiers || null'),
96
+ where=f'{entry["module"]}.tiers')
97
+ # A game that declares validateOptions opts in to game-specific reset options (loadouts etc.);
98
+ # one that does not keeps refusing anything beyond the harness's own keys.
99
+ self._accepts_options = bool(self.page.evaluate(
100
+ '() => typeof backendModule.validateOptions === "function"'))
101
+ self._has_band = bool(self.page.evaluate(
102
+ '() => typeof backendModule.difficultyBand === "function"'))
103
+ except BaseException:
104
+ self.close()
105
+ raise
106
+
107
+ def _open(self):
108
+ if self.page is None:
109
+ raise RuntimeError('backend is closed')
110
+ if self._pid != os.getpid():
111
+ raise RuntimeError('backend belongs to another process; use spawned workers')
112
+
113
+ # Reset options the shared harness itself understands. Anything else is a *game* option: it is forwarded
114
+ # only when the game declares a validator (Module.validateOptions) and is rejected by that validator's own
115
+ # rules, so a typo still fails loudly instead of being silently ignored. 2026-11-03, requested by
116
+ # isaac_remake (item loadouts); games without a validator keep the old behaviour of refusing extras.
117
+ HARNESS_OPTIONS = frozenset({'difficulty', 'latency', 'engine_seed', 'resolved_from_tier'})
118
+
119
+ def game_options(self, options):
120
+ """Split reset options into the harness's own and the game's, validating the latter in the game."""
121
+ extra = {k: v for k, v in (options or {}).items() if k not in self.HARNESS_OPTIONS}
122
+ if not extra:
123
+ return None
124
+ if not self._accepts_options:
125
+ raise ValueError(f'unsupported {self.spec.engine_id} reset options: {sorted(extra)}')
126
+ try:
127
+ self.page.evaluate('a => backendModule.validateOptions(a)', extra)
128
+ except Exception as error: # the game's own message is the useful one
129
+ raise ValueError(f'{self.spec.engine_id} rejected reset options {sorted(extra)}: '
130
+ f'{str(error).splitlines()[0][:160]}') from None
131
+ return extra
132
+
133
+ def validate_options(self, options):
134
+ self.game_options(options)
135
+
136
+ def _snapshot(self, expression, argument=None):
137
+ # JSON canonicalization matches the Node validation path, including -0.
138
+ result = json.loads(self.page.evaluate(f'a => JSON.stringify({expression})', argument))
139
+ result['events'] = tuple(result['events'])
140
+ return EngineSnapshot(**result)
141
+
142
+ def reset(self, seed, difficulty, options):
143
+ self._open()
144
+ extra = self.game_options(options)
145
+ self.page.evaluate('a => { window.backendSession=new NativeBench.Session(backendModule,a.id,a.seed,a.d,a.options);'
146
+ ' backendSession.recording=false; }',
147
+ {'id': self.case_id, 'seed': seed, 'd': difficulty, 'options': extra})
148
+ self._reset = True
149
+ self._ready, self._error = False, None
150
+ return self._snapshot('backendSession.snapshot()')
151
+
152
+ def advance(self, packet):
153
+ self._open()
154
+ if not self._reset:
155
+ raise RuntimeError('reset before advancing')
156
+ return self._snapshot('backendSession.packet(a)',
157
+ {'holds': [sorted(h) for h in packet.holds], 'mouse': list(packet.mouse)})
158
+
159
+ def render(self):
160
+ self._open()
161
+ if not self._reset:
162
+ raise RuntimeError('reset before rendering')
163
+ try:
164
+ result = self.page.evaluate('''() => {
165
+ const context=backendCanvas.getContext("2d");
166
+ backendModule.draw(backendSession.game,context);
167
+ return {png:backendCanvas.toDataURL("image/png").split(",")[1],
168
+ status:backendModule.renderStatus ? backendModule.renderStatus(context) : null};
169
+ }''')
170
+ status = result['status']
171
+ if status is not None and (not status.get('ready') or status.get('error')
172
+ or status.get('kind') != self.spec.render_kind
173
+ or status.get('renderer') != self.spec.renderer):
174
+ raise RuntimeError(f"game renderer not ready: {status}")
175
+ png = result['png']
176
+ with Image.open(io.BytesIO(base64.b64decode(png))) as image:
177
+ rgb = np.asarray(image.convert('RGB'), dtype=np.uint8).copy()
178
+ if rgb.shape != (480, 854, 3):
179
+ raise RuntimeError('renderer returned an incorrect resolution')
180
+ self._ready, self._error = True, None
181
+ return rgb
182
+ except Exception as error:
183
+ self._ready, self._error = False, str(error)
184
+ raise
185
+
186
+ def render_status(self):
187
+ return RenderStatus(self.spec.renderer, self.spec.render_kind, self._ready, self._error)
188
+
189
+ def declared_tiers(self):
190
+ """The module's own Module.tiers = {easy, normal, hard} -> difficulty, validated at startup."""
191
+ return getattr(self, '_tiers', None)
192
+
193
+ def difficulty_band(self, d):
194
+ """Module.difficultyBand(d) -> the game's own name for the segment d falls in, or None.
195
+
196
+ Optional. Pure function of d, so it exposes nothing the public info does not already carry, and so
197
+ it is cached per difficulty — _info() runs every step, and querying the page each time wasted a
198
+ measurable share of a step (measured by the Cuphead session on the web route, 2026-11-03).
199
+ """
200
+ if not getattr(self, '_has_band', False):
201
+ return None
202
+ key = float(d)
203
+ cache = getattr(self, '_band_cache', None)
204
+ if cache is None:
205
+ cache = self._band_cache = {}
206
+ if key not in cache:
207
+ from .unified import _clean_band
208
+ cache[key] = _clean_band(
209
+ self.page.evaluate('d => backendModule.difficultyBand(d) ?? null', key),
210
+ f'{self.case_id}.difficultyBand')
211
+ return cache[key]
212
+
213
+ def scripted(self):
214
+ """Trusted reference controller (Module.scripted, else Module.oracle) for the current state.
215
+
216
+ Returns {holds: 6 key arrays, mouse: [dx, dy, dz]}; it must not change the simulation.
217
+ """
218
+ self._open()
219
+ if not self._reset:
220
+ raise RuntimeError('reset before asking the scripted controller')
221
+ return self.page.evaluate('''() => {
222
+ const M=backendModule, f=M.scripted||M.oracle;
223
+ if(typeof f!=='function') throw Error(M.id+': no scripted controller (Module.scripted)');
224
+ const before=NativeBench.hash(backendSession.state());
225
+ const out=f.call(M, backendSession.game);
226
+ if(NativeBench.hash(backendSession.state())!==before) throw Error('scripted controller changed the simulation');
227
+ return {holds:out.holds.map(h=>[...h]), mouse:[...(out.mouse||[0,0,0])]};
228
+ }''')
229
+
230
+ def manual(self):
231
+ self._open()
232
+ return self.page.evaluate('''() => ({controls:Array.isArray(backendModule.controls)
233
+ ? backendModule.controls : Object.entries(backendModule.controls).map(([key,value])=>key+": "+value)})''')
234
+
235
+ def close(self):
236
+ page, self.page = self.page, None
237
+ self._ready = False
238
+ if page is not None and self._pid == os.getpid() and not page.is_closed():
239
+ try:
240
+ page.evaluate('''() => {
241
+ if(window.backendModule && backendModule.closeRenderer && window.backendCanvas)
242
+ backendModule.closeRenderer(backendCanvas.getContext("2d"));
243
+ }''')
244
+ finally:
245
+ page.close()
246
+
247
+
248
+ def backend_factory(case_id):
249
+ return lambda: JavaScriptBackend(case_id)
environments/games/prototype/bossbench/play_server.py ADDED
@@ -0,0 +1,404 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Human play server for the Minecraft remake: the real mc4d simulation + ModernGL renderer behind a browser page.
2
+
3
+ python games/prototype/bossbench/play_server.py # http://127.0.0.1:8765/
4
+ python games/prototype/bossbench/play_server.py --port 8770 --open
5
+
6
+ Standard library only (http.server on 127.0.0.1). Each browser tab owns one session = one public-interface style
7
+ environment (bossbench.make(case, obs_mode="symbolic") -> PyCaseEnv -> mc4d.MobFight), so a human packet is decoded
8
+ by exactly the same keymouse.schedule + Steve.keys path as bossbench.make_policy_env. The page streams its own input
9
+ as legal `bossbench/policy-replay@1` packets: one packet = 200 ms = 6 hold sets of <= 4 keys + mouse dx dy dz.
10
+
11
+ GET / -> web/games/minecraft_remake/index.html (and its static files)
12
+ GET /api/meta -> rules, tiers, cases, options, controls, protocol
13
+ POST /api/new {case, seed, tier | difficulty, weapon, camera} -> {sid, state}
14
+ POST /api/step {sid, packets:[text,...]} -> {state, outcome, ...} (<= 5 packets)
15
+ POST /api/scripted {sid, n} -> runs the standard scripted controller n packets
16
+ GET /api/frame?sid=..&t=.. -> image/jpeg of the current state from the real renderer (+HUD)
17
+ GET /api/replay?sid=.. -> the session's packets as bossbench/policy-replay@1
18
+ POST /api/import {replay} -> new session, re-simulated packet by packet, checked against rules/outcome/hash
19
+
20
+ The world never advances on its own: the browser sends a packet every 200 ms (pause = stop sending), so the
21
+ simulation stays a pure function of (case, seed, options, packets) and every play can be exported and re-verified.
22
+ """
23
+ from __future__ import annotations
24
+
25
+ import argparse
26
+ import io
27
+ import json
28
+ import os
29
+ import pathlib
30
+ import secrets
31
+ import sys
32
+ import threading
33
+ import time
34
+ import traceback
35
+ from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
36
+ from urllib.parse import parse_qs, urlparse
37
+
38
+ ROOT = pathlib.Path(__file__).resolve().parents[2]
39
+ if str(ROOT / "prototype") not in sys.path:
40
+ sys.path.insert(0, str(ROOT / "prototype"))
41
+
42
+ import numpy as np # noqa: E402
43
+
44
+ import bossbench # noqa: E402
45
+ from bossbench import keymouse as km, mc4d, mc_scripted, tiers # noqa: E402
46
+
47
+ PAGE = ROOT / "web" / "games" / "minecraft_remake"
48
+ CASES = tuple(f"3d/minecraft_{m}" for m in mc4d.MOBS)
49
+ # 2026-11-10 (user: "remove the Green Brawler"): the scene list the page offers is the benchmark's six. The retired green zombie
50
+ # stays playable by id (old replays, the frozen formal case); it is just not offered in the dropdown.
51
+ from bossbench.scope import BENCH_RETIRED # noqa: E402
52
+ LISTED = tuple(c for c in CASES if c not in BENCH_RETIRED)
53
+ NAMES = {"3d/minecraft_iron_golem": "Hurling Brute", "3d/minecraft_zombie": "Green Brawler",
54
+ "3d/minecraft_ender_dragon": "Violet Breath Flyer", "3d/minecraft_wither": "Three-Headed Hover Gun",
55
+ "3d/minecraft_warden": "Blind Shockwave Beast", "3d/minecraft_skeleton": "Strafing Bowman",
56
+ "3d/minecraft_zombie_leader": "Horde Caller"}
57
+ TIER_LABELS = {"easy": "Easy", "normal": "Normal", "hard": "Hard"} # as the shared page shells
58
+ REPLAY_FORMAT = "bossbench/policy-replay@1"
59
+ MAX_SESSIONS = 6
60
+ TYPES = {".html": "text/html; charset=utf-8", ".js": "text/javascript; charset=utf-8", ".css": "text/css; charset=utf-8",
61
+ ".json": "application/json; charset=utf-8", ".png": "image/png", ".jpg": "image/jpeg", ".svg": "image/svg+xml",
62
+ ".md": "text/plain; charset=utf-8", ".mp4": "video/mp4"}
63
+
64
+
65
+ class Session:
66
+ """One live episode. All access is serialized by the session lock (GL contexts are not thread-safe)."""
67
+
68
+ def __init__(self, case_id, seed, difficulty, options, tier=None):
69
+ self.lock = threading.RLock()
70
+ self.case_id = case_id
71
+ self.env = bossbench.make(case_id, obs_mode="symbolic")
72
+ self.used = time.time()
73
+ self.reset(seed, difficulty, options, tier)
74
+
75
+ def reset(self, seed, difficulty, options, tier=None):
76
+ # A public tier is resolved by the env from mc4d.TIERS (bossbench.tiers), exactly as make_policy_env does;
77
+ # the session then pins the concrete difficulty plus resolved_from_tier, like a harness replay.
78
+ opts = {"tier": tier} if tier is not None else {"difficulty": float(difficulty)}
79
+ opts["engine_seed"] = int(seed)
80
+ opts.update({k: v for k, v in options.items() if k in ("weapon", "camera")})
81
+ self.seed = int(seed)
82
+ _, info = self.env.reset(seed=int(seed), options=dict(opts))
83
+ if tier is not None:
84
+ opts.pop("tier")
85
+ opts["difficulty"], opts["resolved_from_tier"] = float(info["difficulty"]), tier
86
+ self.options = opts
87
+ self.packets, self.outcome, self.scripted_packets = [], None, 0
88
+
89
+ @property
90
+ def case(self):
91
+ return self.env.unwrapped.case
92
+
93
+ def step(self, packet, shots=None, every=2):
94
+ """Run one packet; with shots=[] also render a frame every `every` ticks (30 fps at 60 Hz) into it.
95
+ Rendering only reads the state (renderer contract), so frames never change the simulation."""
96
+ if self.outcome is not None:
97
+ return False
98
+ if km.parse_packet(packet) is None:
99
+ raise ValueError("illegal packet: " + repr(packet)[:200])
100
+ case = self.case
101
+ if shots is not None:
102
+ tick, inner = type(case).tick, self.env.unwrapped.inner
103
+
104
+ def wrapped(action, _case=case):
105
+ tick(_case, action)
106
+ if _case.t % every == 0 or _case.outcome():
107
+ shots.append(self.jpeg(inner.render()))
108
+ case.tick = wrapped
109
+ try:
110
+ _, _, terminated, truncated, info = self.env.step(packet)
111
+ finally:
112
+ case.__dict__.pop("tick", None)
113
+ self.packets.append(packet)
114
+ if terminated or truncated:
115
+ self.outcome = info["outcome"]
116
+ return True
117
+
118
+ @staticmethod
119
+ def jpeg(image, quality=74, data_url=True):
120
+ from PIL import Image
121
+ import base64
122
+ buffer = io.BytesIO()
123
+ Image.fromarray(image).save(buffer, "JPEG", quality=quality)
124
+ raw = buffer.getvalue()
125
+ return "data:image/jpeg;base64," + base64.b64encode(raw).decode("ascii") if data_url else raw
126
+
127
+ def frame(self, quality=78):
128
+ return self.jpeg(self.env.unwrapped.inner.render(), quality, data_url=False)
129
+
130
+ def summary(self):
131
+ c, raw = self.case, self.env.unwrapped
132
+ b, g = c.body, c.boss
133
+ boss = {"name": NAMES.get(self.case_id, g.name), "kind": g.name, "hp": round(max(float(g.hp), 0.0), 2),
134
+ "max_hp": float(g.max_hp), "state": g.state, "phase": getattr(g, "phase", g.state),
135
+ "armored": bool(getattr(g, "armored", False)),
136
+ "crystals": sum(x["alive"] for x in getattr(g, "crystals", ())) if hasattr(g, "crystals") else None,
137
+ "minions": sum(z.hp > 0 for z in getattr(g, "minions", ())) if hasattr(g, "minions") else None,
138
+ "darkness_s": round(getattr(g, "dark_t", 0) / mc4d.FPS, 1) if hasattr(g, "dark_t") else None}
139
+ player = {"hp": round(max(float(b.hp), 0.0), 2), "max_hp": float(b.max_hp), "weapon": b.weapon,
140
+ "kit": getattr(b, "kit", "diamond"),
141
+ "attack_charge": round(float(b.attack_charge), 3), "bow_charge": round(float(b.bow_charge), 3),
142
+ "bow_drawing": bool(b.bow_drawing), "arrows_fired": b.arrows_fired, "arrows_hit": b.arrows_hit,
143
+ "wither_effect_s": round(b.wither_t / mc4d.FPS, 2), "yaw_deg": round(float(np.degrees(b.e.yaw)), 1),
144
+ "pitch_deg": round(float(np.degrees(b.e.pitch)), 1)}
145
+ return {"case": self.case_id, "seed": self.seed, "options": self.options, "rules": mc4d.RULES,
146
+ "t": round(c.t / mc4d.FPS, 3), "ticks": int(c.t), "packets": len(self.packets),
147
+ "max_seconds": raw.max_seconds, "outcome": self.outcome, "player": player, "boss": boss,
148
+ "last_swing_t": round(b.swing_t / mc4d.FPS, 3),
149
+ "scripted_packets": self.scripted_packets, "camera": c.camera}
150
+
151
+ def replay(self):
152
+ raw = self.env.unwrapped
153
+ ver = raw.verifier()
154
+ return {"format": REPLAY_FORMAT, "case_id": self.case_id, "game": "minecraft", "contract": "bossbench/policy-gym@2",
155
+ "rules": mc4d.RULES, "native_hz": raw.fps, "gym_seed": self.seed, "engine_seed": int(raw.engine_seed),
156
+ "options": self.options,
157
+ "controller": "human (play page)" if self.scripted_packets == 0 else
158
+ f"mixed: {self.scripted_packets} of {len(self.packets)} packets from the scripted controller",
159
+ "packets": list(self.packets), "steps": len(self.packets), "ticks": int(self.case.t),
160
+ "seconds": round(self.case.t / raw.fps, 4), "outcome": ver["outcome"],
161
+ "terminated": ver["outcome"] in ("win", "loss"), "truncated": ver["outcome"] == "timeout",
162
+ "verifier": ver, "final_hash": raw.state_hash()}
163
+
164
+ def close(self):
165
+ try:
166
+ self.env.close()
167
+ except Exception:
168
+ pass
169
+
170
+
171
+ SESSIONS: dict = {}
172
+ SLOCK = threading.Lock()
173
+ # WGL/GLX contexts are bound to the thread that made them current; http.server answers every request on a new
174
+ # thread. All simulation + rendering therefore runs on this one worker thread (requests are serialized).
175
+ from concurrent.futures import ThreadPoolExecutor # noqa: E402
176
+ GL = ThreadPoolExecutor(max_workers=1, thread_name_prefix="bossbench-gl")
177
+
178
+
179
+ def _session(sid):
180
+ with SLOCK:
181
+ s = SESSIONS.get(sid)
182
+ if s is None:
183
+ raise KeyError("unknown or expired session; press Start again")
184
+ s.used = time.time()
185
+ return s
186
+
187
+
188
+ def _new_session(body):
189
+ case_id = body.get("case", LISTED[0])
190
+ if case_id not in CASES:
191
+ raise ValueError(f"unknown case {case_id!r}")
192
+ seed = int(body.get("seed", 1))
193
+ if not 0 <= seed < 2 ** 32:
194
+ raise ValueError("seed must be in [0, 2**32)")
195
+ tier = body.get("tier")
196
+ if tier is not None and "difficulty" in body:
197
+ raise ValueError("pass either tier or difficulty, not both")
198
+ if tier is not None and tier not in tiers.TIER_NAMES:
199
+ raise ValueError(f"tier must be one of {tiers.TIER_NAMES}")
200
+ difficulty = float(body.get("difficulty", 0.5))
201
+ if not 0.0 <= difficulty <= 1.0:
202
+ raise ValueError("difficulty must be in [0, 1]")
203
+ options = {k: body[k] for k in ("weapon", "camera") if k in body}
204
+ sid = secrets.token_hex(8)
205
+ s = Session(case_id, seed, difficulty, options, tier=tier)
206
+ if tier is None and body.get("resolved_from_tier") in tiers.TIER_NAMES: # an imported tier recording
207
+ s.options["resolved_from_tier"] = body["resolved_from_tier"]
208
+ with SLOCK:
209
+ SESSIONS[sid] = s
210
+ while len(SESSIONS) > MAX_SESSIONS: # drop the least recently used session
211
+ old = min(SESSIONS, key=lambda k: SESSIONS[k].used)
212
+ SESSIONS.pop(old).close()
213
+ return sid, s
214
+
215
+
216
+ def meta():
217
+ body = mc4d.Steve()
218
+ declared = tiers.validate_declared(getattr(mc4d, "TIERS", None), "mc4d") or dict(tiers.DEFAULT_TIERS)
219
+ return {"rules": mc4d.RULES, "native_hz": mc4d.FPS, "packet_seconds": km.PACKET_SECONDS, "substeps": km.SUBSTEPS,
220
+ "keys": list(km.KEYS), "max_keys": km.MAX_KEYS, "protocol": bossbench.unified.PROTOCOL,
221
+ "cases": [{"id": c, "name": NAMES[c], "max_seconds": mc4d.SECONDS[c.split("_", 1)[1]]} for c in LISTED],
222
+ "tiers": [{"name": t, "label": TIER_LABELS[t], "difficulty": declared[t],
223
+ "target_seconds": list(tiers.TARGET_SECONDS[t])} for t in tiers.TIER_NAMES],
224
+ "default_tier": "normal",
225
+ "weapons": list(mc4d.WEAPONS), "cameras": ["first", "third"], "controls": list(body.MANUAL),
226
+ "replay_format": REPLAY_FORMAT}
227
+
228
+
229
+ class Handler(BaseHTTPRequestHandler):
230
+ server_version = "BossBenchMinecraft/1"
231
+
232
+ def log_message(self, fmt, *args): # quiet: one line per error only
233
+ if args and str(args[1]).startswith(("4", "5")):
234
+ sys.stderr.write("%s %s\n" % (self.address_string(), fmt % args))
235
+
236
+ def _send(self, code, payload, ctype="application/json; charset=utf-8", extra=None):
237
+ data = payload if isinstance(payload, bytes) else json.dumps(payload, ensure_ascii=False).encode("utf-8")
238
+ self.send_response(code)
239
+ self.send_header("Content-Type", ctype)
240
+ self.send_header("Content-Length", str(len(data)))
241
+ self.send_header("Cache-Control", "no-store")
242
+ self.send_header("Access-Control-Allow-Origin", "*") # the lobby / file:// page talks to 127.0.0.1
243
+ for k, v in (extra or {}).items():
244
+ self.send_header(k, v)
245
+ self.end_headers()
246
+ self.wfile.write(data)
247
+
248
+ def _json(self):
249
+ n = int(self.headers.get("Content-Length") or 0)
250
+ if n > 16_000_000:
251
+ raise ValueError("request too large")
252
+ return json.loads(self.rfile.read(n) or b"{}")
253
+
254
+ def do_OPTIONS(self):
255
+ self.send_response(204)
256
+ self.send_header("Access-Control-Allow-Origin", "*")
257
+ self.send_header("Access-Control-Allow-Methods", "GET, POST, OPTIONS")
258
+ self.send_header("Access-Control-Allow-Headers", "Content-Type")
259
+ self.end_headers()
260
+
261
+ def do_GET(self):
262
+ return GL.submit(self._get).result()
263
+
264
+ def do_POST(self):
265
+ return GL.submit(self._post).result()
266
+
267
+ def _get(self):
268
+ url = urlparse(self.path)
269
+ q = parse_qs(url.query)
270
+ try:
271
+ if url.path == "/api/meta":
272
+ return self._send(200, meta())
273
+ if url.path == "/api/frame":
274
+ s = _session(q.get("sid", [""])[0])
275
+ with s.lock:
276
+ data = s.frame(int(q.get("q", ["78"])[0]))
277
+ return self._send(200, data, "image/jpeg")
278
+ if url.path == "/api/state":
279
+ s = _session(q.get("sid", [""])[0])
280
+ with s.lock:
281
+ return self._send(200, s.summary())
282
+ if url.path == "/api/replay":
283
+ s = _session(q.get("sid", [""])[0])
284
+ with s.lock:
285
+ return self._send(200, s.replay())
286
+ return self._static(url.path)
287
+ except KeyError as ex:
288
+ return self._send(404, {"error": str(ex).strip("'")})
289
+ except Exception as ex:
290
+ traceback.print_exc()
291
+ return self._send(500, {"error": repr(ex)})
292
+
293
+ def _static(self, path):
294
+ rel = path.lstrip("/") or "index.html"
295
+ if rel.endswith("/"):
296
+ rel += "index.html"
297
+ target = (PAGE / rel).resolve()
298
+ if not str(target).startswith(str(PAGE.resolve())) or not target.is_file():
299
+ return self._send(404, {"error": "not found: " + path})
300
+ return self._send(200, target.read_bytes(), TYPES.get(target.suffix.lower(), "application/octet-stream"))
301
+
302
+ def _post(self):
303
+ url = urlparse(self.path)
304
+ try:
305
+ body = self._json()
306
+ if url.path == "/api/new":
307
+ sid, s = _new_session(body)
308
+ with s.lock:
309
+ return self._send(200, {"sid": sid, "state": s.summary()})
310
+ if url.path == "/api/step":
311
+ s = _session(body.get("sid", ""))
312
+ packets = body.get("packets") or []
313
+ if len(packets) > 5:
314
+ raise ValueError("at most 5 packets per request (1 s of play)")
315
+ with s.lock:
316
+ shots = [] if body.get("frames") else None
317
+ for p in packets:
318
+ s.step(p, shots)
319
+ return self._send(200, {"state": s.summary(), "frames": shots or []})
320
+ if url.path == "/api/scripted":
321
+ s = _session(body.get("sid", ""))
322
+ n = max(1, min(int(body.get("n", 1)), 5))
323
+ with s.lock:
324
+ shots = [] if body.get("frames") else None
325
+ for _ in range(n):
326
+ if s.outcome is not None:
327
+ break
328
+ s.step(mc_scripted.scripted(s.case), shots)
329
+ s.scripted_packets += 1
330
+ return self._send(200, {"state": s.summary(), "frames": shots or []})
331
+ if url.path == "/api/import":
332
+ data = body.get("replay") or {}
333
+ problems = []
334
+ if data.get("format") != REPLAY_FORMAT:
335
+ problems.append("not a bossbench/policy-replay@1 file")
336
+ if data.get("rules") != mc4d.RULES:
337
+ problems.append(f"rules mismatch: recording {data.get('rules')!r}, engine {mc4d.RULES!r}")
338
+ if data.get("case_id") not in CASES:
339
+ problems.append(f"unknown case {data.get('case_id')!r}")
340
+ if problems:
341
+ return self._send(400, {"error": "; ".join(problems)})
342
+ opts = dict(data.get("options") or {})
343
+ sid, s = _new_session({"case": data["case_id"], "seed": opts.get("engine_seed", data.get("engine_seed", 1)),
344
+ "difficulty": opts.get("difficulty", 0.5),
345
+ **{k: opts[k] for k in ("weapon", "camera", "resolved_from_tier") if k in opts}})
346
+ return self._send(200, {"sid": sid, "packets": len(data.get("packets") or []),
347
+ "expect": {"outcome": data.get("outcome"), "final_hash": data.get("final_hash"),
348
+ "ticks": data.get("ticks")}, "state": s.summary()})
349
+ if url.path == "/api/still":
350
+ s = _session(body.get("sid", ""))
351
+ with s.lock:
352
+ return self._send(200, {"state": s.summary(), "frame": s.jpeg(s.env.unwrapped.inner.render())})
353
+ if url.path == "/api/verify":
354
+ s = _session(body.get("sid", ""))
355
+ with s.lock:
356
+ raw = s.env.unwrapped
357
+ return self._send(200, {"final_hash": raw.state_hash(), "ticks": int(s.case.t),
358
+ "outcome": raw.verifier()["outcome"]})
359
+ if url.path == "/api/close":
360
+ with SLOCK:
361
+ s = SESSIONS.pop(body.get("sid", ""), None)
362
+ if s is not None:
363
+ with s.lock:
364
+ s.close()
365
+ return self._send(200, {"closed": s is not None})
366
+ return self._send(404, {"error": "unknown endpoint"})
367
+ except KeyError as ex:
368
+ return self._send(404, {"error": str(ex).strip("'")})
369
+ except ValueError as ex:
370
+ return self._send(400, {"error": str(ex)})
371
+ except Exception as ex:
372
+ traceback.print_exc()
373
+ return self._send(500, {"error": repr(ex)})
374
+
375
+
376
+ def main(argv=None):
377
+ parser = argparse.ArgumentParser(description="BossBench Minecraft human play server (127.0.0.1 only)")
378
+ parser.add_argument("--port", type=int, default=int(os.environ.get("BOSSBENCH_MC_PORT", 8765)))
379
+ parser.add_argument("--open", action="store_true", help="open the page in the default browser")
380
+ args = parser.parse_args(argv)
381
+ server = ThreadingHTTPServer(("127.0.0.1", args.port), Handler)
382
+ server.daemon_threads = True
383
+ url = f"http://127.0.0.1:{args.port}/"
384
+ print(f"Minecraft remake ({mc4d.RULES}) play server: {url}", flush=True)
385
+ if args.open:
386
+ import webbrowser
387
+ webbrowser.open(url)
388
+ try:
389
+ server.serve_forever()
390
+ except KeyboardInterrupt:
391
+ pass
392
+ finally:
393
+ server.server_close()
394
+ def shutdown():
395
+ with SLOCK:
396
+ for s in SESSIONS.values():
397
+ s.close()
398
+ SESSIONS.clear()
399
+ GL.submit(shutdown).result()
400
+ GL.shutdown()
401
+
402
+
403
+ if __name__ == "__main__":
404
+ main()
environments/games/prototype/bossbench/policy_env.py ADDED
@@ -0,0 +1,151 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Public Gymnasium contract shared by visual models and RL, for 2D and 3D.
2
+
3
+ The underlying simulations and privileged diagnostics remain accessible through
4
+ ``unwrapped`` for trusted collectors. This wrapper is an input boundary, not a
5
+ security sandbox; policies receive ``rl.rollout.Context``, never the env object.
6
+ """
7
+ from __future__ import annotations
8
+
9
+ import copy
10
+
11
+ import gymnasium as gym
12
+ import numpy as np
13
+
14
+ from . import keymouse as km
15
+ from .core import RES
16
+ from .scope import POLICY_CASES
17
+
18
+ CONTRACT_VERSION = "bossbench/policy-gym@2"
19
+ PUBLIC_INFO_KEYS = frozenset({
20
+ "case_id", "contract", "t", "steps", "frames", "lag_packets", "format_ok",
21
+ "format_errors", "difficulty", "engine_seed", "outcome", "terminated",
22
+ "truncated", "timing", "renderer",
23
+ # 2026-11-03: the game's own name for the segment `difficulty` falls in, when it declares one.
24
+ # Present only for such games, and safe to expose because it is a pure function of `difficulty`,
25
+ # which this info already carries — a label on a number the policy can already see, not live state.
26
+ # It exists so a d* sweep can explain the steps it measures at mode boundaries instead of
27
+ # re-deriving them from each game's source.
28
+ "difficulty_band",
29
+ })
30
+ _RAW_PUBLIC_KEYS = ("t", "steps", "frames", "lag_packets", "format_ok", "format_errors",
31
+ "difficulty", "engine_seed", "outcome")
32
+ _RAW_OPTIONAL_KEYS = ("difficulty_band",)
33
+
34
+
35
+ class PolicyEnv(gym.Wrapper):
36
+ """RGB + legal key/mouse packets + sparse reward + public-only info.
37
+
38
+ One step holds six key sets over 200 ms, using the declared native engine clock.
39
+ Text and structured actions share the same parser and rejection semantics.
40
+ Actual perspective 3D is mandatory: a fallback image raises an error.
41
+ """
42
+
43
+ def __init__(self, env):
44
+ raw = env.unwrapped
45
+ if raw.case_id not in POLICY_CASES:
46
+ raise ValueError(f"case is not registered for the public policy interface: {raw.case_id!r}")
47
+ if (raw.obs_mode, raw.action_mode, raw.reward_mode) != ("rgb", "keymouse", "sparse"):
48
+ raise ValueError("public policy env requires rgb/keymouse/sparse")
49
+ spec = raw.engine_spec
50
+ if raw.fps != spec.native_hz:
51
+ raise ValueError(f"engine clock must match declared {spec.native_hz} Hz; remove runtime FPS overrides")
52
+ if spec.dimension != POLICY_CASES[raw.case_id]['dimension']:
53
+ raise ValueError('engine dimension differs from the registered case')
54
+ if tuple(spec.resolution) != RES:
55
+ raise ValueError("public policy contract requires a renderer size of 854 x 480")
56
+ if spec.dimension == '3d' and spec.render_kind != 'perspective':
57
+ raise ValueError('3D policy observations require perspective rendering')
58
+ super().__init__(env)
59
+ self.metadata = {**env.metadata, "contract": CONTRACT_VERSION, "simulation_fps": raw.fps}
60
+ self._closed = False
61
+ self._elapsed_frames = 0
62
+
63
+ def _open(self):
64
+ if self._closed:
65
+ raise RuntimeError("environment is closed; create a new environment")
66
+
67
+ def _frame(self, image):
68
+ if not isinstance(image, np.ndarray) or image.shape != (RES[1], RES[0], 3) or image.dtype != np.uint8:
69
+ raise RuntimeError("policy observation must be RGB uint8 (480, 854, 3)")
70
+ if POLICY_CASES[self.unwrapped.case_id]["dimension"] == "3d":
71
+ status = self.unwrapped.render_status()
72
+ if (not status.ready or status.kind != 'perspective' or status.error is not None
73
+ or status.renderer != self.unwrapped.engine_spec.renderer):
74
+ raise RuntimeError(f"{self.unwrapped.case_id}: real 3D renderer unavailable: {status.error or 'no perspective renderer'}")
75
+ # Neither reused engine buffers nor policy mutation may change history.
76
+ return image.copy()
77
+
78
+ def _info(self, info, terminated=False, truncated=False):
79
+ raw = self.unwrapped
80
+ frames, lag = int(info["frames"]), int(info["lag_packets"])
81
+ lag_frames = int(raw.snap.get('lag_frames', min(frames, lag * round(raw.fps * km.PACKET_SECONDS))))
82
+ out = {k: copy.deepcopy(info[k]) for k in _RAW_PUBLIC_KEYS}
83
+ out.update({k: copy.deepcopy(info[k]) for k in _RAW_OPTIONAL_KEYS if k in info})
84
+ out.update(case_id=raw.case_id, contract=CONTRACT_VERSION,
85
+ terminated=bool(terminated), truncated=bool(truncated),
86
+ renderer=raw.engine_spec.renderer,
87
+ timing={"fps": raw.fps, "tick_seconds": 1 / raw.fps,
88
+ "packet_seconds": km.PACKET_SECONDS, "substeps": km.SUBSTEPS,
89
+ "ticks_per_substep": raw.fps * km.PACKET_SECONDS / km.SUBSTEPS,
90
+ "simulation_seconds": frames / raw.fps,
91
+ "elapsed_seconds": self._elapsed_frames / raw.fps,
92
+ "lag_frames": lag_frames, "action_frames": frames - lag_frames})
93
+ if "manual" in info:
94
+ out["manual"] = self.manual()
95
+ return out
96
+
97
+ def manual(self):
98
+ self._open()
99
+ manual = self.unwrapped.manual()
100
+ return {"protocol": str(manual["protocol"]), "controls": copy.deepcopy(manual["controls"])}
101
+
102
+ def reset(self, *, seed=None, options=None):
103
+ self._open()
104
+ obs, info = self.env.reset(seed=seed, options=options)
105
+ self._elapsed_frames = 0
106
+ return self._frame(obs), self._info(info)
107
+
108
+ def step(self, action, latency=None):
109
+ self._open()
110
+ obs, reward, terminated, truncated, info = self.env.step(action, latency=latency)
111
+ self._elapsed_frames += int(info["frames"])
112
+ return self._frame(obs), reward, terminated, truncated, self._info(info, terminated, truncated)
113
+
114
+ def render(self):
115
+ self._open()
116
+ return self._frame(self.env.render())
117
+
118
+ def close(self):
119
+ if not self._closed:
120
+ try:
121
+ self.env.close()
122
+ finally:
123
+ self._closed = True
124
+
125
+
126
+ def make_policy_env(case_id, **kwargs):
127
+ """Create the same public Gym env for model evaluation and RL collection.
128
+
129
+ Pass engine-specific experiment conditions in reset(options=...), e.g.
130
+ Minecraft weapon/camera or Terraria dawn_in_seconds; engine_seed imports a
131
+ recording seed exactly. Raw symbolic/native/dense ablations use make().
132
+ """
133
+ if case_id not in POLICY_CASES:
134
+ raise ValueError(f"case is not registered for the public policy interface: {case_id!r}; known: {sorted(POLICY_CASES)}")
135
+ for key, value in (("obs_mode", "rgb"), ("action_mode", "keymouse"), ("reward_mode", "sparse")):
136
+ if key in kwargs and kwargs[key] != value:
137
+ raise ValueError(f"public policy contract requires {key}={value!r}")
138
+ kwargs[key] = value
139
+ kwargs.setdefault("time_mode", "paused")
140
+ kwargs.setdefault("render_mode", "rgb_array")
141
+ from . import make
142
+ env = make(case_id, **kwargs)
143
+ try:
144
+ return PolicyEnv(env)
145
+ except Exception:
146
+ env.close()
147
+ raise
148
+
149
+
150
+ def policy_gym_id(case_id):
151
+ return "BossBenchPolicy/" + case_id.replace("/", "-") + "-v0"
environments/games/prototype/bossbench/progress_reward.py ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Versioned high-water progress reward; trusted scoring only, never policy input."""
2
+ from __future__ import annotations
3
+
4
+ import math
5
+ import gymnasium as gym
6
+
7
+ REWARD_CONTRACT = 'bossbench/step-progress-highwater@1'
8
+
9
+
10
+ def unit(value):
11
+ if isinstance(value, bool) or not isinstance(value, (int, float)):
12
+ raise RuntimeError('progress must be numeric')
13
+ value = float(value)
14
+ if not math.isfinite(value) or not 0 <= value <= 1:
15
+ raise RuntimeError('progress must be finite and in [0,1]')
16
+ return value
17
+
18
+
19
+ class HighWaterProgress:
20
+ def __init__(self, initial):
21
+ self.initial = self.peak = self.final = unit(initial)
22
+ self.steps = 0
23
+
24
+ def step(self, current):
25
+ current = unit(current)
26
+ peak = max(self.peak, current)
27
+ reward = peak - self.peak
28
+ self.peak, self.final = peak, current
29
+ self.steps += 1
30
+ return reward
31
+
32
+ def diagnostics(self):
33
+ return dict(contract=REWARD_CONTRACT, initial_progress=self.initial,
34
+ peak_progress=self.peak, final_progress=self.final,
35
+ episode_return=self.peak - self.initial, steps=self.steps)
36
+
37
+
38
+ def objective_progress(snapshot, case_id):
39
+ """Read scoring fields while preserving the original game's HP and outcome."""
40
+ from .step_reward import objective_progress as hp_progress
41
+ if case_id == 'cuphead/root_pack':
42
+ boss = snapshot['state']['boss']
43
+ score = boss['reward_objective']
44
+ if score['version'] != 'root-pack-fixed-phase@1':
45
+ raise RuntimeError('Root Pack fixed phase scoring unavailable')
46
+ return unit(score['progress'])
47
+ if case_id == 'nfsmw/speedtrap':
48
+ game = snapshot['state']['game']
49
+ score, target = game['you'], game['reward_target_score']
50
+ if game['reward_target_version'] != 'speedtrap-reachable-profile@1':
51
+ raise RuntimeError('Speedtrap calibration unavailable')
52
+ if not math.isfinite(score) or score < 0 or not math.isfinite(target) or target <= 0:
53
+ raise RuntimeError('Invalid speedtrap score/target')
54
+ return unit(min(1.0, score / target))
55
+ return unit(hp_progress(snapshot))
56
+
57
+
58
+ class StepProgressReward(gym.Wrapper):
59
+ """Reward new peaks at env.step boundaries, including each step's lag window.
60
+
61
+ No reward rescaling by batch, terminal bonus, time/death/format penalty, or
62
+ repeated credit after healing. Imported initial progress is not rewarded.
63
+ """
64
+ def __init__(self, env, case_id):
65
+ super().__init__(env)
66
+ self.case_id = case_id
67
+ self.metadata = dict(env.metadata, reward_contract=REWARD_CONTRACT)
68
+ self.scorer = None
69
+ self._closed, self._done = False, True
70
+
71
+ def reset(self, *, seed=None, options=None):
72
+ if self._closed:
73
+ raise RuntimeError('environment is closed')
74
+ obs, info = self.env.reset(seed=seed, options=options)
75
+ self._done = True
76
+ self.scorer = HighWaterProgress(objective_progress(self.unwrapped.snap, self.case_id))
77
+ self._done = False
78
+ return obs, dict(info, reward_contract=REWARD_CONTRACT)
79
+
80
+ def step(self, action, latency=None):
81
+ if self._closed or self._done or self.scorer is None:
82
+ raise RuntimeError('reset required before step')
83
+ try:
84
+ obs, _, terminated, truncated, info = self.env.step(action, latency=latency)
85
+ reward = self.scorer.step(objective_progress(self.unwrapped.snap, self.case_id))
86
+ except BaseException:
87
+ self._done = True
88
+ raise
89
+ self._done = bool(terminated or truncated)
90
+ return obs, reward, terminated, truncated, dict(info, reward_contract=REWARD_CONTRACT)
91
+
92
+ def reward_diagnostics(self):
93
+ if self.scorer is None:
94
+ raise RuntimeError('reset required')
95
+ return dict(self.scorer.diagnostics(), done=self._done)
96
+
97
+ def close(self):
98
+ if not self._closed:
99
+ try:
100
+ self.env.close()
101
+ finally:
102
+ self._closed = self._done = True
environments/games/prototype/bossbench/rig.py ADDED
@@ -0,0 +1,235 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Rig: the single animation channel that every renderer reads.
2
+
3
+ A rig is a set of named boxes ("parts") attached to an entity's report frame. Once per tick the
4
+ simulation poses it: each part gets a world origin and a rotation, built from a local offset in
5
+ the entity's own frame (x = forward, y = up, z = right) plus three angles in degrees
6
+ (yaw about up, pitch about right = limb raise, roll about forward = wing flap).
7
+
8
+ rig.pose(case.t, {"arm_l": (0, 2.05, -0.95, 0, 166), ...}, e.pos, e.yaw)
9
+
10
+ Renderers interpolate between ticks instead of animating on their own clock::
11
+
12
+ origin(t) = origin[k] + (origin[k+1] - origin[k]) * u u = (t - tick_k) / (tick_k1 - tick_k)
13
+
14
+ so a pose is an exact function of the simulation tick, not of the renderer's frame timer, and
15
+ drawing two ticks or twenty between two keyframes gives the same picture at the same fractional
16
+ time. Rotations travel as quaternions, which removes every Euler-order ambiguity between three.js,
17
+ Godot and the numpy box renderer.
18
+
19
+ Nothing here feeds back into the rules: a rig only ever describes what the simulation already did
20
+ (architecture rule 1).
21
+ """
22
+ from __future__ import annotations
23
+
24
+ import math
25
+
26
+ import numpy as np
27
+
28
+ _PI = np.pi
29
+
30
+
31
+ def q_y(deg: float) -> np.ndarray:
32
+ a = np.radians(deg) * 0.5
33
+ return np.array([0.0, np.sin(a), 0.0, np.cos(a)])
34
+
35
+
36
+ def q_z(deg: float) -> np.ndarray:
37
+ a = np.radians(deg) * 0.5
38
+ return np.array([0.0, 0.0, np.sin(a), np.cos(a)])
39
+
40
+
41
+ def q_x(deg: float) -> np.ndarray:
42
+ a = np.radians(deg) * 0.5
43
+ return np.array([np.sin(a), 0.0, 0.0, np.cos(a)])
44
+
45
+
46
+ def q_mul(a: np.ndarray, b: np.ndarray) -> np.ndarray:
47
+ x1, y1, z1, w1 = a
48
+ x2, y2, z2, w2 = b
49
+ return np.array([w1 * x2 + x1 * w2 + y1 * z2 - z1 * y2,
50
+ w1 * y2 - x1 * z2 + y1 * w2 + z1 * x2,
51
+ w1 * z2 + x1 * y2 - y1 * x2 + z1 * w2,
52
+ w1 * w2 - x1 * x2 - y1 * y2 - z1 * z2])
53
+
54
+
55
+ def q_norm(q: np.ndarray) -> np.ndarray:
56
+ n = np.linalg.norm(q)
57
+ return q / n if n > 1e-12 else np.array([0.0, 0.0, 0.0, 1.0])
58
+
59
+
60
+ def q_slerp(a: np.ndarray, b: np.ndarray, u: float) -> np.ndarray:
61
+ """Shortest-arc slerp; u is clamped by the caller."""
62
+ d = float(np.dot(a, b))
63
+ if d < 0.0:
64
+ b, d = -b, -d
65
+ if d > 0.9995:
66
+ return q_norm(a + (b - a) * u)
67
+ th = np.arccos(np.clip(d, -1.0, 1.0))
68
+ s = np.sin(th)
69
+ return q_norm(np.sin((1 - u) * th) / s * a + np.sin(u * th) / s * b)
70
+
71
+
72
+ def q_to_mat(q: np.ndarray) -> np.ndarray:
73
+ x, y, z, w = q
74
+ return np.array([[1 - 2 * (y * y + z * z), 2 * (x * y - z * w), 2 * (x * z + y * w)],
75
+ [2 * (x * y + z * w), 1 - 2 * (x * x + z * z), 2 * (y * z - x * w)],
76
+ [2 * (x * z - y * w), 2 * (y * z + x * w), 1 - 2 * (x * x + y * y)]])
77
+
78
+
79
+ # -- tuple quaternions: Bones runs every tick inside the simulation step, so it stays off numpy --
80
+ def _qm(a, b):
81
+ x1, y1, z1, w1 = a
82
+ x2, y2, z2, w2 = b
83
+ return (w1 * x2 + x1 * w2 + y1 * z2 - z1 * y2, w1 * y2 - x1 * z2 + y1 * w2 + z1 * x2,
84
+ w1 * z2 + x1 * y2 - y1 * x2 + z1 * w2, w1 * w2 - x1 * x2 - y1 * y2 - z1 * z2)
85
+
86
+
87
+ def _qe(yaw, pitch, roll):
88
+ """q_y(-yaw) * q_z(pitch) * q_x(roll): yaw turns +x toward +z (right), pitch raises +x, roll
89
+ lowers +z. Same order the entity frame uses, so a chain of these composes like a skeleton."""
90
+ a, b, c = math.radians(-yaw) * 0.5, math.radians(pitch) * 0.5, math.radians(roll) * 0.5
91
+ q = (0.0, math.sin(a), 0.0, math.cos(a))
92
+ if b:
93
+ q = _qm(q, (0.0, 0.0, math.sin(b), math.cos(b)))
94
+ if c:
95
+ q = _qm(q, (math.sin(c), 0.0, 0.0, math.cos(c)))
96
+ return q
97
+
98
+
99
+ def _qv(q, v):
100
+ x, y, z, w = q
101
+ tx, ty, tz = 2 * (y * v[2] - z * v[1]), 2 * (z * v[0] - x * v[2]), 2 * (x * v[1] - y * v[0])
102
+ return (v[0] + w * tx + y * tz - z * ty, v[1] + w * ty + z * tx - x * tz, v[2] + w * tz + x * ty - y * tx)
103
+
104
+
105
+ class Bones:
106
+ """Forward kinematics in the entity frame, feeding Rig.pose.
107
+
108
+ b = Bones()
109
+ b.bone("body", None, (0, 1.0, 0), pitch=lean)
110
+ b.bone("arm_r", "body", (0, 0.62, 0.69), pitch=raise_, boxes=("arm_r", "vine_r"))
111
+ rig.pose(t, b.spans, e.pos, e.yaw)
112
+
113
+ A bone's offset and angles are relative to its parent; every box listed in `boxes` takes the
114
+ bone's frame (the box's own "pivot" then places it inside that frame).
115
+ """
116
+
117
+ def __init__(self):
118
+ self.f, self.spans = {}, {}
119
+
120
+ def bone(self, name, parent=None, at=(0.0, 0.0, 0.0), yaw=0.0, pitch=0.0, roll=0.0, boxes=None):
121
+ p, q = self.f[parent] if parent else ((0.0, 0.0, 0.0), (0.0, 0.0, 0.0, 1.0))
122
+ o = _qv(q, at)
123
+ pos = (p[0] + o[0], p[1] + o[1], p[2] + o[2])
124
+ ql = _qm(q, _qe(yaw, pitch, roll))
125
+ self.f[name] = (pos, ql)
126
+ for b in (boxes if boxes is not None else (name,)):
127
+ self.spans[b] = (pos[0], pos[1], pos[2], ql)
128
+ return pos
129
+
130
+ def point(self, name, v):
131
+ """A point given in bone `name`'s frame, in the entity frame."""
132
+ p, q = self.f[name]
133
+ o = _qv(q, v)
134
+ return (p[0] + o[0], p[1] + o[1], p[2] + o[2])
135
+
136
+
137
+ class Rig:
138
+ """Boxes for one entity. Parts are declared once; only their pose changes per tick.
139
+
140
+ parts: name -> {"size": (sx, sy, sz), "color": (r, g, b), "pivot": (px, py, pz) or None,
141
+ "fwd": bool} pivot is the box centre inside the part frame (default the
142
+ origin); fwd=False means the box keeps world-aligned axes and only follows the
143
+ entity's position (legs of a diagonally-standing golem, for instance).
144
+ """
145
+
146
+ def __init__(self, parts: dict, tint=(1.0, 1.0, 1.0)):
147
+ self.parts = parts
148
+ self.tint = tuple(float(c) for c in tint)
149
+ self.kf: dict[str, list] = {}
150
+ self.hide: set = set() # parts not drawn this tick (e.g. wither armour above half hp)
151
+ self.variant = "" # texture variant suffix (golem cracks, wither eye glow)
152
+ self.overlay = (0.0, 0.0, 0.0, 0.0) # rgb + amount mixed over the lit colour (hurt red)
153
+ self.glow = 0.0 # boost for emissive texels (eyes flaring on a telegraph)
154
+ self.shell = 0.0 # alpha of a translucent shell around every part (wither guard)
155
+ self.shell_color = (0.55, 0.7, 1.0)
156
+ self.mem: dict = {} # pose-only memory (smoothed angles, state entry ticks)
157
+
158
+ # -- posing ----------------------------------------------------------
159
+ def reset(self) -> None:
160
+ self.kf = {n: [] for n in self.parts}
161
+
162
+ def pose(self, tick: int, spans: dict, root, yaw: float, base=(0.0, 0.0), h_floor: float = 0.0,
163
+ trim: int = 64) -> None:
164
+ """spans: name -> (lx, ly, lz[, yaw_deg, pitch_deg, roll_deg]) in the entity frame, or
165
+ (lx, ly, lz, q) with q a local quaternion (what Bones produces).
166
+
167
+ base = (pitch_deg, roll_deg) tilts the whole rig about the entity's right/forward axes,
168
+ which is how the dragon banks into a turn or the wither leans into a strafe.
169
+ """
170
+ Ry = q_y(-np.degrees(yaw))
171
+ QB = q_mul(Ry, q_mul(q_z(base[0]), q_x(base[1])))
172
+ M = q_to_mat(QB)
173
+ qb = tuple(QB)
174
+ root = np.asarray(root, float) + np.array([0.0, h_floor, 0.0])
175
+ for name, span in spans.items():
176
+ p = self.parts[name]
177
+ if len(span) == 4 and isinstance(span[3], tuple): # (lx, ly, lz, local quaternion)
178
+ lx, ly, lz, ql = span
179
+ origin = root + M @ np.array([lx, ly, lz])
180
+ q = np.array(_qm(qb, ql))
181
+ else:
182
+ lx, ly, lz, lyaw, pitch, roll = (tuple(span) + (0.0, 0.0, 0.0))[:6]
183
+ origin = root + M @ np.array([lx, ly, lz])
184
+ if p.get("fwd", True): # part frame follows the entity's facing
185
+ q = np.array(_qm(qb, _qe(lyaw, pitch, roll)))
186
+ else: # box keeps world axes, only its origin moves
187
+ q = np.array(_qe(lyaw, pitch, roll))
188
+ kf = self.kf.setdefault(name, [])
189
+ kf.append((int(tick), origin, q))
190
+ if len(kf) > trim:
191
+ del kf[:len(kf) - trim]
192
+
193
+ # -- reading ---------------------------------------------------------
194
+ def sample(self, t: float) -> dict:
195
+ """Pose at fractional tick t, interpolated between the two surrounding keyframes."""
196
+ out = {}
197
+ for name, kfs in self.kf.items():
198
+ if not kfs:
199
+ continue
200
+ if t <= kfs[0][0]:
201
+ _, o, q = kfs[0]
202
+ out[name] = (o, q)
203
+ continue
204
+ if t >= kfs[-1][0]:
205
+ _, o, q = kfs[-1]
206
+ out[name] = (o, q)
207
+ continue
208
+ i = 1
209
+ while i < len(kfs) and kfs[i][0] <= t:
210
+ i += 1
211
+ t0, o0, q0 = kfs[i - 1]
212
+ t1, o1, q1 = kfs[i]
213
+ u = 0.0 if t1 == t0 else (t - t0) / (t1 - t0)
214
+ out[name] = (o0 + (o1 - o0) * u, q_slerp(q0, q1, u))
215
+ return out
216
+
217
+
218
+ class Rigged:
219
+ """Mixin: an entity that owns one or more rigs and reports their current state."""
220
+
221
+ def rigs(self) -> list:
222
+ return []
223
+
224
+ def rig_state(self, t) -> list:
225
+ out = []
226
+ for r in self.rigs():
227
+ out.append({"parts": r.parts, "pose": {n: [list(o), list(q)] for n, (o, q) in r.sample(t).items()},
228
+ "tint": list(getattr(r, "tint", (1.0, 1.0, 1.0)))})
229
+ return out
230
+
231
+
232
+ def walk_cycle(phase: float, amp: float = 26.0, roll: float = 0.0) -> tuple:
233
+ """Two-leg walk: returns (left_pitch, right_pitch) in degrees for a phase in [0, 1)."""
234
+ a = 2 * _PI * phase
235
+ return (float(np.sin(a) * amp), float(np.sin(a + _PI) * amp))
environments/games/prototype/bossbench/scope.py ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Formal BossBench scope, separate from the backwards-compatible registry.
2
+
3
+ Never discover training/evaluation scope by blindly iterating bossbench.ENVS. This manifest is
4
+ explicit so a newly added game cannot silently enter an existing experiment.
5
+ """
6
+ from __future__ import annotations
7
+
8
+ from types import MappingProxyType
9
+
10
+
11
+ FORMAL_GAMES = MappingProxyType({
12
+ "hollowknight_remake": "2d",
13
+ "kirby_remake": "2d",
14
+ "terraria_remake": "2d",
15
+ "minecraft": "3d",
16
+ })
17
+
18
+ FORMAL_CASES = MappingProxyType({
19
+ **{f"2d/{boss}": {"game": "hollowknight_remake", "dimension": "2d", "engine": "web"} for boss in (
20
+ "needle_warden", "iron_bulwark", "hollow_vessel", "sickle_sisters", "pale_vessel")},
21
+ **{f"kirby/{boss}": {"game": "kirby_remake", "dimension": "2d", "engine": "web"} for boss in (
22
+ "whispy_woods", "kracko", "king_dedede")},
23
+ **{f"terraria/{boss}": {"game": "terraria_remake", "dimension": "2d", "engine": "web"} for boss in (
24
+ "king_slime", "eye_of_cthulhu", "skeletron", "eater_of_worlds")},
25
+ **{f"3d/minecraft_{boss}": {"game": "minecraft", "dimension": "3d", "engine": "py"} for boss in (
26
+ "iron_golem", "zombie", "ender_dragon", "wither")},
27
+ })
28
+
29
+ RETIRED_CASES = ("2d/tank_battle", "tank_battle_1v1")
30
+ # Public cases are discovered from registrations. Frozen evaluation cases are listed above.
31
+ from . import WEB_GAME
32
+ PUBLIC_WEB_CASES = MappingProxyType({
33
+ case_id: {"game": game, "dimension": "2d", "engine": "web"}
34
+ for case_id, game in WEB_GAME.items() if case_id not in FORMAL_CASES
35
+ })
36
+ # Python-route scenes (mc4d.MOBS) are discovered the same way, so Minecraft can add bosses without editing
37
+ # this file. Their ids are "3d/<game>_<boss>"; the game name is read from the id rather than assumed, so a
38
+ # second Python game would be routed correctly instead of silently labelled Minecraft.
39
+ from . import PY_CASES
40
+ PUBLIC_PY_CASES = MappingProxyType({
41
+ case_id: {"game": case_id.split("/", 1)[1].split("_", 1)[0], "dimension": "3d", "engine": "py"}
42
+ for case_id in PY_CASES if case_id not in FORMAL_CASES
43
+ })
44
+ from .native_games import NATIVE_CASES
45
+ POLICY_CASES = MappingProxyType({**FORMAL_CASES, **PUBLIC_WEB_CASES, **PUBLIC_PY_CASES, **{
46
+ key: {'game': value['game'], 'dimension': value['dimension'], 'engine': 'native'}
47
+ for key, value in NATIVE_CASES.items()
48
+ }})
49
+ # Retired cases retain their IDs for replay compatibility and are omitted from the benchmark registry.
50
+ BENCH_RETIRED = frozenset({
51
+ "3d/minecraft_zombie", # Minecraft had 7; its tier calibration is the separate 3d/minecraft_zombie_leader
52
+ })
53
+ BENCH_SCENES_PER_GAME = 6
54
+ BENCH_CASES = MappingProxyType({k: v for k, v in POLICY_CASES.items() if k not in BENCH_RETIRED})
55
+ # Every game, including Minecraft (Python), with its dimension; used by the media/scripted harness.
56
+ GAMES = MappingProxyType({spec["game"]: spec["dimension"] for spec in POLICY_CASES.values()})
57
+ FIRST_CASE = "kirby/whispy_woods"
58
+ COLD_START_CASE = "2d/needle_warden"
59
+ SCOPE_VERSION = "bossbench/formal-scope@1"
60
+
61
+
62
+ def case_ids(*, dimension: str | None = None, game: str | None = None) -> tuple[str, ...]:
63
+ """Return stable, sorted formal IDs, optionally restricted by game or dimension."""
64
+ if dimension is not None and dimension not in ("2d", "3d"):
65
+ raise ValueError("dimension must be '2d' or '3d'")
66
+ if game is not None and game not in FORMAL_GAMES:
67
+ raise ValueError(f"unknown formal game: {game!r}")
68
+ return tuple(sorted(i for i, spec in FORMAL_CASES.items()
69
+ if (dimension is None or spec["dimension"] == dimension)
70
+ and (game is None or spec["game"] == game)))
71
+
72
+
73
+ def validate_registry() -> None:
74
+ """Reject missing/misrouted formal cases without changing the legacy registry."""
75
+ from . import ENVS, WEB_GAME
76
+
77
+ for case_id, spec in {**FORMAL_CASES, **PUBLIC_WEB_CASES, **PUBLIC_PY_CASES}.items():
78
+ if ENVS.get(case_id) != spec["engine"]:
79
+ raise RuntimeError(f"formal case {case_id!r} has missing or incorrect engine registration")
80
+ if spec["engine"] == "web" and WEB_GAME.get(case_id) != spec["game"]:
81
+ raise RuntimeError(f"formal case {case_id!r} has incorrect game registration")
environments/games/prototype/bossbench/scripted.py ADDED
@@ -0,0 +1,355 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Standard trusted scripted controller + frame capture for every BossBench case (all 12 games).
2
+
3
+ One API over the three engine routes, used by web/tools/bench_media.py and any trusted collector:
4
+
5
+ env = bossbench.make_policy_env(case_id) # public RGB interface (or bossbench.make(...) symbolic)
6
+ ctrl = scripted.controller(env) # reads env.unwrapped; never handed to a policy
7
+ obs, info = env.reset(seed=1, options={"difficulty": 0.5, "engine_seed": 1})
8
+ cap = scripted.FrameCapture(env) # optional: frames of this same run at native-tick cadence
9
+ while True:
10
+ obs, reward, terminated, truncated, info = env.step(ctrl())
11
+ frames = cap.drain() # [(tick, jpeg bytes), ...] produced during that step
12
+ if terminated or truncated: break
13
+
14
+ Game hooks (one per engine route):
15
+ * BB.Case web games BB.GAME.scripted(case) -> packet (bridge cmd "scripted", web/engine/case.js scriptedPacket)
16
+ * independent JS Module.scripted(game) -> {holds, mouse} (fallback Module.oracle)
17
+ * Minecraft (Python) bossbench.mc_scripted.scripted(case) -> packet text
18
+ Every controller must be deterministic and must not change the simulation; both are checked here or in JS.
19
+
20
+ HAZARD for any Python-route controller that plans on a deep copy of the live case (found 2026-11-01 in
21
+ mc_scripted): FrameCapture below installs an *instance-level* `case.tick` wrapper, and `copy.deepcopy` copies
22
+ instance attributes — so a naive clone carries that wrapper with it and the controller's lookahead then drives
23
+ the real episode while still reporting a legal packet. Strip bound functions from the clone's own __dict__
24
+ before simulating it, e.g.
25
+
26
+ clone = copy.deepcopy(case)
27
+ for name, value in list(vars(clone).items()):
28
+ if callable(value) and not isinstance(value, type):
29
+ del vars(clone)[name] # drop instance-level patches; class methods are unaffected
30
+
31
+ The state-hash check around each controller call catches this only if the lookahead happens to change the
32
+ hash before the call returns, so do not rely on it as the guard.
33
+ """
34
+ from __future__ import annotations
35
+
36
+ import base64
37
+ import hashlib
38
+ import io
39
+ import json
40
+ from pathlib import Path
41
+
42
+ import numpy as np
43
+
44
+ from . import keymouse as km
45
+
46
+ ROOT = Path(__file__).resolve().parents[2]
47
+ WEB = ROOT / 'web'
48
+ REPLAY_FORMAT = 'bossbench/policy-replay@1'
49
+
50
+
51
+ def route(env):
52
+ """'web' (BB.Case), 'native' (independent JS backend) or 'py' (Minecraft) for a make()/make_policy_env() env."""
53
+ raw = env.unwrapped
54
+ from .webenv import WebCaseEnv
55
+ from .engine_env import EngineEnv
56
+ from .unified import PyCaseEnv
57
+ if isinstance(raw, WebCaseEnv):
58
+ return 'web'
59
+ if isinstance(raw, EngineEnv):
60
+ if not hasattr(raw.backend, 'page'):
61
+ raise TypeError(f'{raw.case_id}: backend has no scripted controller hook')
62
+ return 'native'
63
+ if isinstance(raw, PyCaseEnv):
64
+ return 'py'
65
+ raise TypeError(f'unsupported env type {type(raw).__name__}')
66
+
67
+
68
+ def _page(env):
69
+ raw = env.unwrapped
70
+ kind = route(env)
71
+ if kind == 'web':
72
+ if raw.transport != 'browser':
73
+ return None
74
+ return raw.t.page
75
+ if kind == 'native':
76
+ return raw.backend.page
77
+ return None
78
+
79
+
80
+ def controller(env):
81
+ """Callable returning the next legal packet text for the env's current (live) state."""
82
+ raw = env.unwrapped
83
+ kind = route(env)
84
+ if kind == 'web':
85
+ def ask():
86
+ return raw._call({'cmd': 'scripted'})['packet']
87
+ elif kind == 'native':
88
+ def ask():
89
+ out = raw.backend.scripted()
90
+ return km.format_packet([tuple(h) for h in out['holds']], tuple(int(round(v)) for v in out['mouse']))
91
+ else:
92
+ from . import mc_scripted
93
+
94
+ def ask():
95
+ before = raw.state_hash() if raw.snap is not None else None
96
+ packet = mc_scripted.scripted(raw.case)
97
+ if before is not None and raw.state_hash() != before:
98
+ raise RuntimeError('scripted controller changed the simulation')
99
+ return packet if isinstance(packet, str) else km.to_packet(packet)
100
+
101
+ def next_packet():
102
+ packet = ask()
103
+ if km.parse_packet(packet) is None:
104
+ raise RuntimeError(f'{raw.case_id}: scripted controller returned an illegal packet: {packet!r}')
105
+ return packet
106
+ return next_packet
107
+
108
+
109
+ def rules(env):
110
+ """Rule/version string the engine declares for this case (None if the game has none)."""
111
+ raw = env.unwrapped
112
+ kind = route(env)
113
+ if kind == 'web':
114
+ return raw._call({'cmd': 'meta'}).get('rules')
115
+ if kind == 'native':
116
+ return raw.engine_spec.rule_version
117
+ from . import mc4d
118
+ return getattr(mc4d, 'RULES', None)
119
+
120
+
121
+ def state_hash(env):
122
+ """Engine-native final-state hash (BB.hashState / NativeBench.hash / sha1 of the Python state)."""
123
+ raw = env.unwrapped
124
+ kind = route(env)
125
+ if kind == 'web':
126
+ return raw._call({'cmd': 'hash'})['hash']
127
+ if kind == 'native':
128
+ return raw.backend.page.evaluate('() => NativeBench.hash(backendSession.state())')
129
+ return raw.state_hash()
130
+
131
+
132
+ def game_of(env):
133
+ raw = env.unwrapped
134
+ from .scope import POLICY_CASES
135
+ return POLICY_CASES[raw.case_id]['game']
136
+
137
+
138
+ def source_files(env):
139
+ """Files that define this case's rules and pictures (fingerprinted in media provenance)."""
140
+ raw = env.unwrapped
141
+ kind = route(env)
142
+ if kind == 'web':
143
+ from .webenv import game_scripts
144
+ files = [Path(p) for p in game_scripts(raw.game)]
145
+ files += [WEB / 'games' / raw.game / 'index.html', WEB / 'engine' / 'bridge.js']
146
+ elif kind == 'native':
147
+ from .native_games import source_paths
148
+ files = source_paths(raw.case_id)
149
+ else:
150
+ pkg = Path(__file__).resolve().parent
151
+ files = [pkg / name for name in ('mc4d.py', 'mcskin.py', 'rig.py', 'core.py', 'unified.py', 'mc_scripted.py')]
152
+ out = {}
153
+ for path in files:
154
+ if path.is_file():
155
+ out[path.resolve().relative_to(ROOT).as_posix()] = hashlib.sha256(path.read_bytes()).hexdigest()
156
+ return out
157
+
158
+
159
+ _WEB_CAPTURE = r'''a => {
160
+ const env = BB.bridgeEnv(), c = env.case;
161
+ if (!BB.Renderer) throw Error('capture needs the browser renderer');
162
+ const canvas = document.createElement('canvas');
163
+ const cap = window.__bbCapture = {R: new BB.Renderer(canvas), every: a.every, quality: a.quality, frames: [], ticks: [], case: c};
164
+ cap.grab = () => {
165
+ const before = BB.hashState(c);
166
+ cap.R.draw(c, c.t / BB.FPS, '');
167
+ if (BB.hashState(c) !== before) throw Error('renderer changed the simulation');
168
+ cap.frames.push(cap.R.canvas.toDataURL('image/jpeg', cap.quality).split(',')[1]); cap.ticks.push(c.t);
169
+ };
170
+ if (!c.__bbCaptureWrapped) {
171
+ const tick = c.tick;
172
+ c.tick = function (keys, mouse) {
173
+ const t0 = this.t; tick.call(this, keys, mouse);
174
+ const k = window.__bbCapture;
175
+ if (k && k.case === this && this.t !== t0 && (this.t % k.every === 0 || this.result)) k.grab();
176
+ };
177
+ c.__bbCaptureWrapped = true;
178
+ }
179
+ cap.grab();
180
+ return {w: cap.R.canvas.width, h: cap.R.canvas.height, hz: BB.FPS};
181
+ }'''
182
+
183
+ _NATIVE_CAPTURE = r'''a => {
184
+ const s = backendSession, M = backendModule;
185
+ const canvas = document.createElement('canvas'); canvas.width = 854; canvas.height = 480;
186
+ const ctx = canvas.getContext('2d');
187
+ const cap = window.__bbCapture = {every: a.every, quality: a.quality, frames: [], ticks: [], session: s, ctx, canvas};
188
+ cap.grab = () => {
189
+ const before = NativeBench.hash(s.state());
190
+ M.draw(s.game, ctx);
191
+ if (NativeBench.hash(s.state()) !== before) throw Error('renderer changed the simulation');
192
+ cap.frames.push(canvas.toDataURL('image/jpeg', cap.quality).split(',')[1]); cap.ticks.push(s.game.t);
193
+ };
194
+ const tick = s.tick.bind(s);
195
+ s.tick = function (keys, mouse) {
196
+ const ok = tick(keys, mouse), k = window.__bbCapture;
197
+ if (ok && k && k.session === s && (s.game.t % k.every === 0 || s.game.outcome)) k.grab();
198
+ return ok;
199
+ };
200
+ cap.grab();
201
+ return {w: 854, h: 480, hz: M.hz};
202
+ }'''
203
+
204
+ _DRAIN = '''() => { const k = window.__bbCapture; if (!k) return {frames: [], ticks: []};
205
+ const out = {frames: k.frames, ticks: k.ticks}; k.frames = []; k.ticks = []; return out; }'''
206
+
207
+ _CLOSE_NATIVE = '''() => { const k = window.__bbCapture; if (k && k.ctx && backendModule.closeRenderer) backendModule.closeRenderer(k.ctx);
208
+ window.__bbCapture = null; }'''
209
+
210
+
211
+ class FrameCapture:
212
+ """Frames of the live episode every `every` native ticks (default: 30 fps at 60 Hz, every tick below 40 Hz).
213
+
214
+ Install right after reset; frames come from a private renderer/canvas reading the same simulation, so the
215
+ policy observation, gameplay RNG and physics are untouched. The terminal tick is always captured.
216
+ """
217
+
218
+ def __init__(self, env, every=None, quality=0.92):
219
+ self.env, self.kind, self.raw = env, route(env), env.unwrapped
220
+ fps = int(self.raw.fps)
221
+ self.every = int(every or (2 if fps >= 40 else 1))
222
+ self.fps = fps / self.every
223
+ self.quality = float(quality)
224
+ self._py_frames = []
225
+ if self.kind in ('web', 'native'):
226
+ page = _page(env)
227
+ if page is None:
228
+ raise RuntimeError('frame capture needs the browser transport (obs_mode="rgb")')
229
+ self.page = page
230
+ script = _WEB_CAPTURE if self.kind == 'web' else _NATIVE_CAPTURE
231
+ self.size = page.evaluate(script, {'every': self.every, 'quality': self.quality})
232
+ else:
233
+ case, inner, frames, every = self.raw.case, self.raw.inner, self._py_frames, self.every
234
+ tick = type(case).tick
235
+
236
+ def wrapped(action, _case=case):
237
+ t0 = _case.t
238
+ tick(_case, action)
239
+ if _case.t != t0 and (_case.t % every == 0 or _case.outcome()):
240
+ frames.append((_case.t, inner.render()))
241
+ case.tick = wrapped
242
+ self._unwrap = lambda: case.__dict__.pop('tick', None)
243
+ frames.append((case.t, inner.render()))
244
+ self.size = {'w': case.size[0], 'h': case.size[1], 'hz': fps}
245
+
246
+ def drain(self):
247
+ """-> [(tick, jpeg bytes)] captured since the last drain."""
248
+ if self.kind in ('web', 'native'):
249
+ got = self.page.evaluate(_DRAIN)
250
+ return [(t, base64.b64decode(f)) for t, f in zip(got['ticks'], got['frames'])]
251
+ from PIL import Image
252
+ out = []
253
+ for t, rgb in self._py_frames:
254
+ buffer = io.BytesIO()
255
+ Image.fromarray(np.ascontiguousarray(rgb)).save(buffer, 'JPEG', quality=int(self.quality * 100))
256
+ out.append((t, buffer.getvalue()))
257
+ self._py_frames.clear()
258
+ return out
259
+
260
+ def close(self):
261
+ try:
262
+ if self.kind == 'native':
263
+ self.page.evaluate(_CLOSE_NATIVE)
264
+ elif self.kind == 'web':
265
+ self.page.evaluate('() => { window.__bbCapture = null; }')
266
+ else:
267
+ self._unwrap()
268
+ except Exception:
269
+ pass
270
+
271
+
272
+ def play(env, *, seed=1, options=None, max_steps=None, on_step=None, capture=None):
273
+ """Run the scripted controller to the terminal outcome on an existing env; returns a policy-replay dict.
274
+
275
+ options are forwarded to reset (difficulty, engine-specific keys); engine_seed defaults to seed so the replay
276
+ and the human play page share the same world. on_step(index, packet, info, frames) is called after each step.
277
+ """
278
+ options = dict(options or {})
279
+ if 'tier' not in options:
280
+ options.setdefault('difficulty', 0.5)
281
+ options.setdefault('engine_seed', int(seed))
282
+ obs, info = env.reset(seed=int(seed), options=options)
283
+ # A replay must pin what was actually played. A `tier` is resolved by the game's declaration at reset
284
+ # time; store the concrete difficulty it produced (plus the tier name as provenance), so the recording
285
+ # still reproduces exactly if that game later recalibrates its tiers.
286
+ if 'tier' in options:
287
+ tier = options.pop('tier')
288
+ options['difficulty'] = float(info['difficulty'])
289
+ options['resolved_from_tier'] = tier
290
+ cap = FrameCapture(env, **capture) if capture is not None else None
291
+ if cap is not None and on_step is not None:
292
+ on_step(-1, None, info, cap.drain())
293
+ ctrl = controller(env)
294
+ raw = env.unwrapped
295
+ packets, terminated, truncated = [], False, False
296
+ limit = max_steps or int(raw.max_seconds / km.PACKET_SECONDS) + 2
297
+ try:
298
+ for index in range(limit):
299
+ packet = ctrl()
300
+ obs, reward, terminated, truncated, info = env.step(packet)
301
+ packets.append(packet)
302
+ if on_step is not None:
303
+ on_step(index, packet, info, cap.drain() if cap is not None else [])
304
+ if terminated or truncated:
305
+ break
306
+ finally:
307
+ if cap is not None:
308
+ cap.close()
309
+ verifier = raw.verifier()
310
+ ticks = int(round(raw.snap['t'] * raw.fps))
311
+ return {
312
+ 'format': REPLAY_FORMAT, 'case_id': raw.case_id, 'game': game_of(env), 'contract': 'bossbench/policy-gym@2',
313
+ 'rules': rules(env), 'native_hz': raw.fps, 'gym_seed': int(seed), 'engine_seed': int(raw.engine_seed),
314
+ 'options': options, 'controller': 'scripted (standard trusted reference controller; privileged state; not a model)',
315
+ 'packets': packets, 'steps': len(packets), 'ticks': ticks, 'seconds': round(ticks / raw.fps, 4),
316
+ 'outcome': verifier['outcome'], 'terminated': bool(terminated), 'truncated': bool(truncated),
317
+ 'verifier': verifier, 'final_hash': state_hash(env), 'source_sha256': source_files(env),
318
+ }
319
+
320
+
321
+ def replay(env, data):
322
+ """Re-run a policy-replay through env; returns (outcome, final_hash, ticks, problems)."""
323
+ problems = []
324
+ raw = env.unwrapped
325
+ if data.get('format') != REPLAY_FORMAT:
326
+ problems.append('not a bossbench/policy-replay@1 file')
327
+ if data.get('case_id') != raw.case_id:
328
+ problems.append(f"case mismatch: {data.get('case_id')} vs {raw.case_id}")
329
+ current = rules(env)
330
+ if data.get('rules') != current:
331
+ problems.append(f"rules mismatch: recording {data.get('rules')!r}, engine {current!r}")
332
+ env.reset(seed=int(data['gym_seed']), options=dict(data['options']))
333
+ done = False
334
+ for index, packet in enumerate(data['packets']):
335
+ if done:
336
+ problems.append(f'packet {index} after terminal outcome')
337
+ break
338
+ _, _, terminated, truncated, _ = env.step(packet)
339
+ done = terminated or truncated
340
+ if not done:
341
+ problems.append('recording ended before a terminal outcome')
342
+ outcome = raw.verifier()['outcome']
343
+ final = state_hash(env)
344
+ ticks = int(round(raw.snap['t'] * raw.fps))
345
+ if outcome != data.get('outcome'):
346
+ problems.append(f"outcome mismatch: {outcome} vs {data.get('outcome')}")
347
+ if final != data.get('final_hash'):
348
+ problems.append(f"final hash mismatch: {final} vs {data.get('final_hash')}")
349
+ if ticks != data.get('ticks'):
350
+ problems.append(f"tick mismatch: {ticks} vs {data.get('ticks')}")
351
+ return outcome, final, ticks, problems
352
+
353
+
354
+ def dumps(data):
355
+ return json.dumps(data, ensure_ascii=False, indent=1) + '\n'
environments/games/prototype/bossbench/step_reward.py ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Damage/progress-only rewards per Gym step, shared by every registered game.
2
+
3
+ The engine's aggregate objective HP/progress is trusted scoring data. It is never
4
+ added to the image observation or the model prompt.
5
+ """
6
+ from __future__ import annotations
7
+
8
+ import math
9
+ import gymnasium as gym
10
+
11
+ REWARD_CONTRACT = 'bossbench/step-damage@1'
12
+
13
+
14
+ def objective_progress(snapshot):
15
+ """Use the existing aggregate objective, including all phases/required parts."""
16
+ if not isinstance(snapshot, dict):
17
+ raise RuntimeError('reward requires a valid current engine snapshot')
18
+ hp, maximum = float(snapshot['boss_hp']), float(snapshot['boss_max_hp'])
19
+ if not math.isfinite(hp) or not math.isfinite(maximum) or maximum <= 0 or not 0 <= hp <= maximum:
20
+ raise RuntimeError('invalid aggregate objective HP/progress')
21
+ return 1.0 - hp / maximum
22
+
23
+
24
+ class StepDamageReward(gym.Wrapper):
25
+ """Replace sparse/dense return with the signed increment of objective progress.
26
+
27
+ A hit gives positive reward; a heal or objective regression gives negative
28
+ reward. No clipping, player-health penalty, step cost or terminal bonus is
29
+ added. Delay windows belong to the same step. Across a complete episode,
30
+ sum(reward) = final progress - reset progress.
31
+ """
32
+ def __init__(self, env):
33
+ super().__init__(env)
34
+ self.metadata = dict(env.metadata, reward_contract=REWARD_CONTRACT)
35
+ self._reward_previous = None
36
+ self._reward_total = 0.0
37
+ self._reward_steps = 0
38
+ self._reward_closed = False
39
+ self._reward_done = True
40
+
41
+ def reset(self, *, seed=None, options=None):
42
+ if self._reward_closed:
43
+ raise RuntimeError('environment is closed')
44
+ obs, info = self.env.reset(seed=seed, options=options)
45
+ self._reward_previous = objective_progress(self.unwrapped.snap)
46
+ self._reward_total = 0.0
47
+ self._reward_steps = 0
48
+ self._reward_done = False
49
+ return obs, dict(info, reward_contract=REWARD_CONTRACT)
50
+
51
+ def step(self, action, latency=None):
52
+ if self._reward_closed or self._reward_done or self._reward_previous is None:
53
+ raise RuntimeError('reset required before step')
54
+ try:
55
+ obs, _, terminated, truncated, info = self.env.step(action, latency=latency)
56
+ current = objective_progress(self.unwrapped.snap)
57
+ except BaseException:
58
+ self._reward_done = True
59
+ raise
60
+ reward = current - self._reward_previous
61
+ self._reward_previous = current
62
+ self._reward_total += reward
63
+ self._reward_steps += 1
64
+ self._reward_done = bool(terminated or truncated)
65
+ return obs, float(reward), terminated, truncated, dict(info, reward_contract=REWARD_CONTRACT)
66
+
67
+ def reward_diagnostics(self):
68
+ """Collector-only summary, not part of the visual observation."""
69
+ return dict(contract=REWARD_CONTRACT, episode_return=self._reward_total,
70
+ steps=self._reward_steps, done=self._reward_done)
71
+
72
+ def close(self):
73
+ if not self._reward_closed:
74
+ try:
75
+ self.env.close()
76
+ finally:
77
+ self._reward_closed = self._reward_done = True
78
+
79
+
80
+ def make_training_env(case_id, *, action_format='keymouse', **kwargs):
81
+ """Public RGB environment; new calls default to versioned high-water progress.
82
+
83
+ action_format='compact' selects the game's declared MultiDiscrete interface.
84
+ All reset options, engine clocks, terminal flags and replay rules are kept.
85
+ The raw engine remains sparse internally; this wrapper replaces that scalar.
86
+ Explicit 'boss_damage' or 'bossbench/step-damage@1' retains legacy signed
87
+ delta behavior. New releases use 'bossbench/step-progress-highwater@1'.
88
+ """
89
+ from .progress_reward import StepProgressReward, REWARD_CONTRACT as HIGHWATER
90
+ mode = kwargs.pop('reward_mode', HIGHWATER)
91
+ if mode not in ('boss_damage', REWARD_CONTRACT, HIGHWATER):
92
+ raise ValueError('unknown versioned training reward')
93
+ if action_format == 'keymouse':
94
+ from .policy_env import make_policy_env
95
+ env = make_policy_env(case_id, **kwargs)
96
+ elif action_format == 'compact':
97
+ from .compact import make_compact_env
98
+ env = make_compact_env(case_id, **kwargs)
99
+ else:
100
+ raise ValueError('action_format must be keymouse or compact')
101
+ try:
102
+ return StepDamageReward(env) if mode in ('boss_damage', REWARD_CONTRACT) else StepProgressReward(env, case_id)
103
+ except BaseException:
104
+ env.close()
105
+ raise
environments/games/prototype/bossbench/tiers.py ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Three public difficulty tiers shared by every BossBench game.
2
+
3
+ The standard interface takes one of three named tiers. Use continuous difficulty for finer control.
4
+
5
+ env.reset(seed=1, options={"tier": "easy"}) # public: one of three tiers
6
+ env.reset(seed=1, options={"difficulty": 0.37}) # still allowed: direct continuous control
7
+
8
+ Each game declares its own tier -> difficulty mapping next to its rule version, so the simulation, the play
9
+ page and this public interface all read one source of truth:
10
+
11
+ BB.Case games BB.GAME.tiers = {easy: 0.15, normal: 0.5, hard: 0.85} (game.js)
12
+ native JS games Module.tiers = {easy: ..., normal: ..., hard: ...} (game.js)
13
+ Minecraft mc4d.TIERS = {"easy": ..., "normal": ..., "hard": ...}
14
+
15
+ A game that declares nothing uses DEFAULT_TIERS. Passing both `tier` and `difficulty` is rejected, so a
16
+ recording can never be ambiguous about which one produced it.
17
+
18
+ """
19
+ from __future__ import annotations
20
+
21
+ import math
22
+ from numbers import Real
23
+ from types import MappingProxyType
24
+
25
+ TIER_NAMES = ("easy", "normal", "hard")
26
+
27
+ DEFAULT_TIERS = MappingProxyType({"easy": 0.2, "normal": 0.5, "hard": 0.8})
28
+ TIERS = DEFAULT_TIERS # backwards-compatible name
29
+
30
+ # Reference-controller completion windows in seconds.
31
+ TARGET_SECONDS = MappingProxyType({
32
+ "easy": (20.0, 30.0),
33
+ "normal": (45.0, 90.0),
34
+ "hard": (150.0, 240.0),
35
+ })
36
+
37
+
38
+ def validate_declared(declared, where="game"):
39
+ """Return a clean {tier: difficulty} from a game's declaration, or raise with a precise reason.
40
+
41
+ A declaration must name exactly easy/normal/hard, each a finite number in [0, 1], strictly increasing
42
+ from easy to hard. A broken declaration fails when the env is created, inside the game that wrote it.
43
+ """
44
+ if declared is None:
45
+ return None
46
+ if not isinstance(declared, dict):
47
+ raise ValueError(f"{where}: tiers must be an object with keys {TIER_NAMES}")
48
+ if set(declared) != set(TIER_NAMES):
49
+ raise ValueError(f"{where}: tiers must declare exactly {TIER_NAMES}, got {sorted(declared)}")
50
+ clean = {}
51
+ for name in TIER_NAMES:
52
+ value = declared[name]
53
+ if isinstance(value, bool) or not isinstance(value, Real) or not math.isfinite(value) or not 0 <= value <= 1:
54
+ raise ValueError(f"{where}: tier {name!r} must be a finite number in [0, 1], got {value!r}")
55
+ clean[name] = float(value)
56
+ if not clean["easy"] < clean["normal"] < clean["hard"]:
57
+ raise ValueError(f"{where}: tiers must increase strictly easy < normal < hard, got {clean}")
58
+ return clean
59
+
60
+
61
+ def difficulty_for(tier, declared=None):
62
+ """Continuous difficulty for a public tier, using the game's own declaration when it has one."""
63
+ if tier not in TIER_NAMES:
64
+ raise ValueError(f"tier must be one of {TIER_NAMES}, got {tier!r}")
65
+ table = declared if declared else DEFAULT_TIERS
66
+ return float(table[tier])
67
+
68
+
69
+ def resolve_options(options, declared=None):
70
+ """Replace a public `tier` with the concrete `difficulty` the engines already understand.
71
+
72
+ Returns a new dict; the original is not modified. `tier` and `difficulty` are mutually exclusive so a
73
+ replay's options always say exactly one thing about how hard the fight was.
74
+ """
75
+ if not options or "tier" not in options:
76
+ return dict(options or {})
77
+ resolved = dict(options)
78
+ tier = resolved.pop("tier")
79
+ if "difficulty" in resolved:
80
+ raise ValueError("pass either tier or difficulty, not both: a recording must be unambiguous")
81
+ resolved["difficulty"] = difficulty_for(tier, declared)
82
+ resolved["resolved_from_tier"] = tier # provenance: which tier the caller asked for
83
+ return resolved
84
+
85
+
86
+ def tier_of(difficulty, declared=None, tolerance=1e-9):
87
+ """The tier that maps to this difficulty, or None when it is a custom continuous value."""
88
+ for tier in TIER_NAMES:
89
+ if abs(difficulty_for(tier, declared) - float(difficulty)) <= tolerance:
90
+ return tier
91
+ return None
92
+
93
+
94
+ def within_target(tier, seconds):
95
+ """True when a scripted run's duration falls inside the reference-controller window for that tier."""
96
+ low, high = TARGET_SECONDS[tier]
97
+ return low <= float(seconds) <= high
environments/games/prototype/bossbench/unified.py ADDED
@@ -0,0 +1,488 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """One Gymnasium interface for every BossBench case, whatever engine runs it (proposal 4.4).
2
+
3
+ import bossbench
4
+ env = bossbench.make("2d/needle_warden", # web engine (JS, 60 Hz)
5
+ obs_mode="symbolic", # "rgb" | "symbolic" | "vector"
6
+ time_mode="virtual_rt", # "paused" | "virtual_rt" | "wallclock_rt"
7
+ latency=0.3)
8
+ env = bossbench.make("3d/minecraft_wither") # Python engine (60 Hz) - same API
9
+ obs, info = env.reset(seed=0, options={"difficulty": 0.5})
10
+ obs, reward, terminated, truncated, info = env.step(
11
+ "<|action_start|> 120 0 0 ; W ; W ; W,Space ; W ; LMB ; LMB <|action_end|>")
12
+
13
+ What is identical across cases (and is all an agent or trainer needs to know):
14
+ step one 200 ms key/mouse packet (keymouse.py): str, or a dict from env.action_space
15
+ action_space keymouse.KeyMouse() (mouse dx dy dz + 6 x 14 hold matrix); the key *meaning* is per
16
+ body and is spelled out in info["manual"]["controls"]
17
+ obs rgb: 480 x 854 x 3 uint8 | symbolic: the case's state dict | vector: float32 Box
18
+ time paused: the world waits; virtual_rt: ceil(latency / 0.2) no-op packets run first;
19
+ wallclock_rt: floor(wall time since the last return / 0.2) no-op packets run first
20
+ reward sparse: verifier reward at the end only; dense: + d(boss damage) - d(player damage)
21
+ info t, state, events, outcome, player_hp, player_max_hp, boss_hp, boss_max_hp, format_ok,
22
+ format_errors, steps, frames, lag_packets, difficulty, engine_seed
23
+ (+ manual at reset, verifier on the last step)
24
+ verifier() {reward in [-1, 1], win, outcome, boss_damage, seconds, d, player_hp}
25
+ end win / loss -> terminated; time cap -> truncated; stepping a finished episode raises
26
+
27
+ info["state"] is always filled so oracles and loggers can read it; an rgb-only agent harness must not
28
+ pass it to the agent (that is the perception-gap ablation's job, not the env's).
29
+
30
+ action_mode="native" (Python engine only) keeps the body's own action space (e.g. MultiDiscrete for
31
+ Steve) for RL ablations; one step is still one 200 ms packet with that action held throughout.
32
+ """
33
+ from __future__ import annotations
34
+
35
+ import hashlib
36
+ import copy
37
+ from collections.abc import Mapping
38
+ import json
39
+ import math
40
+ from numbers import Integral, Real
41
+ import time
42
+
43
+ import gymnasium as gym
44
+ import numpy as np
45
+
46
+ from . import keymouse as km
47
+ from .core import RES
48
+ from .engine_contract import EngineSpec, RenderStatus
49
+
50
+ OBS_MODES = ("rgb", "symbolic", "vector")
51
+ TIME_MODES = ("paused", "virtual_rt", "wallclock_rt")
52
+ PROTOCOL = ("one step = one 200 ms packet: <|action_start|> dx dy dz ; K1 ; K2 ; K3 ; K4 ; K5 ; K6 <|action_end|>; "
53
+ "K_j = 0-4 keys from W A S D Space Shift J K L Q E R LMB RMB held during the j-th 33 1/3 ms sub-step (2 ticks at 60 Hz), "
54
+ "comma separated; dx dy in [-1000, 1000] mouse motion, dz in [-5, 5] wheel; "
55
+ "a malformed packet runs as no-op and counts as a format error")
56
+
57
+
58
+ class Json(gym.Space):
59
+ """Observation space of obs_mode='symbolic': a JSON-serialisable dict (the case's state())."""
60
+
61
+ def __init__(self, seed=None):
62
+ super().__init__(None, None, seed)
63
+
64
+ def contains(self, x) -> bool:
65
+ return isinstance(x, dict)
66
+
67
+ def sample(self, mask=None, probability=None):
68
+ return {}
69
+
70
+ def __repr__(self):
71
+ return "Json()"
72
+
73
+ def __eq__(self, other):
74
+ return isinstance(other, Json)
75
+
76
+
77
+ def event_names(events):
78
+ return [e[0] if isinstance(e, (tuple, list)) else e for e in events]
79
+
80
+
81
+ def _plain(o):
82
+ if isinstance(o, np.generic):
83
+ return o.item()
84
+ if isinstance(o, np.ndarray):
85
+ return o.tolist()
86
+ raise TypeError(type(o))
87
+
88
+
89
+ def _finite_number(value, name, *, upper=None):
90
+ if isinstance(value, (bool, np.bool_)) or not isinstance(value, Real):
91
+ raise ValueError(f"{name} must be a finite number >= 0" + (f" and <= {upper}" if upper is not None else ""))
92
+ value = float(value)
93
+ if not math.isfinite(value) or value < 0 or (upper is not None and value > upper):
94
+ raise ValueError(f"{name} must be a finite number >= 0" + (f" and <= {upper}" if upper is not None else ""))
95
+ return value
96
+
97
+
98
+ def _clean_band(value, where):
99
+ """Validate a game's difficulty_band declaration: a short plain name, or None for 'no segmentation'."""
100
+ if value is None:
101
+ return None
102
+ if not isinstance(value, str) or not value.strip() or len(value) > 40 or '\n' in value:
103
+ raise ValueError(f"{where}: difficulty_band must return a short non-empty string or None, "
104
+ f"got {value!r}")
105
+ return value.strip()
106
+
107
+
108
+ def _reset_options(options):
109
+ if options is not None and not isinstance(options, Mapping):
110
+ raise ValueError("reset options must be a mapping")
111
+ return copy.deepcopy(dict(options or {}))
112
+
113
+
114
+ class UnifiedEnv(gym.Env):
115
+ """Engine-independent half: action decoding, time modes, reward, info/verifier schema.
116
+
117
+ An engine adapter implements _engine_reset(seed, d, options) and _engine_packet(packet, lag, ok), both returning a
118
+ snapshot dict {state, events, outcome (None | win | loss | timeout), t, frames, player_hp, player_max_hp,
119
+ boss_hp, boss_max_hp}, plus _render / _vector / _manual, and sets fps and max_seconds.
120
+ """
121
+ metadata = {"render_modes": ["rgb_array"], "render_fps": round(1 / km.PACKET_SECONDS)}
122
+
123
+ def __init__(self, case_id, obs_mode="symbolic", action_mode="keymouse", time_mode="paused", latency=0.0,
124
+ difficulty=0.5, reward_mode="sparse", render_mode=None):
125
+ for name, value, choices in (("obs_mode", obs_mode, OBS_MODES), ("time_mode", time_mode, TIME_MODES),
126
+ ("action_mode", action_mode, ("keymouse", "native")),
127
+ ("reward_mode", reward_mode, ("sparse", "dense")),
128
+ ("render_mode", render_mode, (None, "rgb_array"))):
129
+ if value not in choices:
130
+ raise ValueError(f"{name} must be one of {choices}")
131
+ self.case_id, self.obs_mode, self.action_mode, self.time_mode = case_id, obs_mode, action_mode, time_mode
132
+ self.latency = self._default_latency = _finite_number(latency, "latency")
133
+ self.difficulty = _finite_number(difficulty, "difficulty", upper=1)
134
+ self.reward_mode = reward_mode
135
+ self.render_mode = render_mode
136
+ self.action_space = km.KeyMouse()
137
+ self.snap, self.done, self.d, self.engine_seed = None, True, self.difficulty, None
138
+ self._closed = False
139
+
140
+ def _obs_space(self, vector_space=None):
141
+ if self.obs_mode == "rgb":
142
+ return gym.spaces.Box(0, 255, (RES[1], RES[0], 3), np.uint8)
143
+ if self.obs_mode == "vector":
144
+ if vector_space is None:
145
+ raise ValueError(f"{self.case_id}: obs_mode='vector' is not available for this engine")
146
+ return vector_space
147
+ return Json()
148
+
149
+ @property
150
+ def engine_spec(self):
151
+ """Default for the existing web engine; independent backends override it."""
152
+ return EngineSpec('web-canvas', '2d', 60, self.max_seconds, 'canvas', 'raster')
153
+
154
+ def render_status(self):
155
+ return RenderStatus(self.engine_spec.renderer, self.engine_spec.render_kind, True)
156
+
157
+ # -- gym API -------------------------------------------------------------
158
+ def reset(self, *, seed=None, options=None):
159
+ """Reset using Gym's seed, or an explicit uint32 engine_seed for imported replays.
160
+
161
+ Ordinary seed handling is unchanged. options are forwarded to the web
162
+ game so its initial world settings match browser play.
163
+ """
164
+ self._ensure_open()
165
+ options = _reset_options(options)
166
+ # A public `tier` (easy/normal/hard) resolves to the continuous difficulty the engines understand,
167
+ # using the game's own declared mapping (see tiers.py), so the play page and this interface agree.
168
+ from .tiers import resolve_options
169
+ options = resolve_options(options, self._declared_tiers())
170
+ d = _finite_number(options.get("difficulty", self.difficulty), "difficulty", upper=1)
171
+ latency = _finite_number(options.get("latency", self._default_latency), "latency")
172
+ options["difficulty"] = d
173
+ if "latency" in options:
174
+ options["latency"] = latency
175
+ if seed is not None:
176
+ if isinstance(seed, (bool, np.bool_)) or not isinstance(seed, Integral) or seed < 0:
177
+ raise ValueError("seed must be a nonnegative integer or None")
178
+ seed = int(seed)
179
+ if "engine_seed" in options:
180
+ explicit_seed = options["engine_seed"]
181
+ if isinstance(explicit_seed, (bool, np.bool_)) or not isinstance(explicit_seed, Integral) or not 0 <= explicit_seed < 2 ** 32:
182
+ raise ValueError("engine_seed must be an integer in [0, 2**32)")
183
+ options["engine_seed"] = int(explicit_seed)
184
+ self._validate_options(options)
185
+ # Invalid reset conditions must not consume RNG or alter a live episode.
186
+ super().reset(seed=seed)
187
+ self.engine_seed = options.get("engine_seed", None)
188
+ if self.engine_seed is None:
189
+ self.engine_seed = int(self.np_random.integers(2 ** 31 - 1))
190
+ self.latency = latency
191
+ self.d, self.steps, self.format_errors, self.done = d, 0, 0, False
192
+ try:
193
+ self.snap = self._engine_reset(self.engine_seed, d, options)
194
+ except Exception:
195
+ self.snap, self.done = None, True
196
+ raise
197
+ self._prev = self._progress(self.snap)
198
+ info = self._info(True, 0)
199
+ info["manual"] = self.manual()
200
+ obs = self._observe()
201
+ self._t_return = time.perf_counter()
202
+ return obs, info
203
+
204
+ def step(self, action, latency=None):
205
+ """latency (s, virtual_rt only) overrides env.latency for this step: the agent's measured think time."""
206
+ self._ensure_reset()
207
+ if self.done:
208
+ raise RuntimeError("episode is over; call reset()")
209
+ latency = self.latency if latency is None else _finite_number(latency, "latency")
210
+ if self.time_mode == "virtual_rt":
211
+ # Bound work at the episode deadline, including huge but finite latency.
212
+ remaining = max(0, math.ceil(self.max_seconds / km.PACKET_SECONDS))
213
+ lag = remaining if latency >= self.max_seconds else math.ceil(latency / km.PACKET_SECONDS - 1e-9)
214
+ elif self.time_mode == "wallclock_rt":
215
+ lag = max(0, int((time.perf_counter() - self._t_return) / km.PACKET_SECONDS))
216
+ else:
217
+ lag = 0
218
+ if self.action_mode == "native":
219
+ packet, ok = action, True
220
+ else:
221
+ packet = km.to_packet(action)
222
+ ok = km.parse_packet(packet) is not None
223
+ if not ok:
224
+ self.format_errors += 1
225
+ self.snap = self._engine_packet(packet, lag, ok)
226
+ self.steps += 1
227
+ out = self.snap["outcome"]
228
+ terminated, truncated = out in ("win", "loss"), out == "timeout"
229
+ prog, reward = self._progress(self.snap), 0.0
230
+ if self.reward_mode == "dense":
231
+ reward += (prog[0] - self._prev[0]) - (prog[1] - self._prev[1])
232
+ self._prev = prog
233
+ info = self._info(ok, lag)
234
+ if terminated or truncated:
235
+ self.done = True
236
+ info["verifier"] = self.verifier()
237
+ reward += info["verifier"]["reward"]
238
+ obs = self._observe()
239
+ self._t_return = time.perf_counter()
240
+ return obs, float(reward), terminated, truncated, info
241
+
242
+ def render(self):
243
+ self._ensure_reset()
244
+ img = self._render()
245
+ if not isinstance(img, np.ndarray) or img.shape != (RES[1], RES[0], 3) or img.dtype != np.uint8:
246
+ raise RuntimeError(f"render must be RGB uint8 with shape {(RES[1], RES[0], 3)}")
247
+ return img
248
+
249
+ def verifier(self) -> dict:
250
+ self._ensure_reset()
251
+ s = self.snap
252
+ frac = 1 - max(s["boss_hp"], 0) / s["boss_max_hp"]
253
+ win = s["outcome"] == "win"
254
+ return {"reward": 1.0 if win else round(-1.0 + frac, 4), "win": win, "outcome": s["outcome"],
255
+ "boss_damage": round(frac, 4), "seconds": round(s["t"], 4), "d": self.d,
256
+ "player_hp": s["player_hp"]}
257
+
258
+ def manual(self) -> dict:
259
+ """Prompt context (proposal 4.4): packet protocol, this body's key meanings, this boss's skill table."""
260
+ self._ensure_open()
261
+ m = self._manual()
262
+ protocol = PROTOCOL
263
+ if getattr(self, 'fps', 60) != 60:
264
+ protocol = PROTOCOL.replace('(2 ticks at 60 Hz)',
265
+ f'(input sampled on native {self.fps} Hz ticks; actual executed time is reported)')
266
+ return {"protocol": protocol, "controls": list(m["controls"]), "skills": list(m.get("skills", []))}
267
+
268
+ def state_hash(self) -> str:
269
+ """sha1 of the symbolic state, for determinism checks across runs and transports."""
270
+ self._ensure_reset()
271
+ return hashlib.sha1(json.dumps(self.snap["state"], sort_keys=True, default=_plain).encode()).hexdigest()
272
+
273
+ def _ensure_open(self):
274
+ if self._closed:
275
+ raise RuntimeError("environment is closed; create a new environment")
276
+
277
+ def _ensure_reset(self):
278
+ self._ensure_open()
279
+ if self.snap is None:
280
+ raise RuntimeError("environment has not been reset; call reset()")
281
+
282
+ def _validate_options(self, options):
283
+ try:
284
+ json.dumps(options, allow_nan=False, default=_plain)
285
+ except (TypeError, ValueError) as ex:
286
+ raise ValueError("reset options must be finite JSON data") from ex
287
+
288
+ def close(self):
289
+ self._closed, self.done = True, True
290
+
291
+ # -- shared helpers ----------------------------------------------------------
292
+ def _progress(self, s):
293
+ return (1 - max(s["boss_hp"], 0) / s["boss_max_hp"], 1 - max(s["player_hp"], 0) / s["player_max_hp"])
294
+
295
+ def _info(self, ok, lag):
296
+ s = self.snap
297
+ info = {"t": round(s["t"], 4), "state": s["state"], "events": event_names(s["events"]),
298
+ "outcome": s["outcome"], "player_hp": s["player_hp"], "player_max_hp": s["player_max_hp"],
299
+ "boss_hp": s["boss_hp"], "boss_max_hp": s["boss_max_hp"], "format_ok": ok,
300
+ "format_errors": self.format_errors, "steps": self.steps, "frames": s["frames"],
301
+ "lag_packets": lag, "difficulty": self.d, "engine_seed": self.engine_seed}
302
+ band = self._difficulty_band(self.d)
303
+ if band is not None:
304
+ info["difficulty_band"] = band
305
+ return info
306
+
307
+ def _observe(self):
308
+ if self.obs_mode == "rgb":
309
+ return self.render()
310
+ if self.obs_mode == "vector":
311
+ return self._vector()
312
+ return self.snap["state"]
313
+
314
+ # -- engine adapter --------------------------------------------------------
315
+ def _declared_tiers(self):
316
+ """The game's own {easy, normal, hard} -> difficulty mapping, or None to use tiers.DEFAULT_TIERS."""
317
+ return None
318
+
319
+ def _difficulty_band(self, d):
320
+ """The game's own name for the segment `d` falls in, or None if it declares no segmentation.
321
+
322
+ 2026-11-03, requested by the Cuphead session. Several games map the continuous difficulty onto the
323
+ original's own modes (Cuphead Simple/Regular/Expert at 0.25 and 0.75, DOOM's skill levels, Terraria's
324
+ Classic/Expert gate at 0.75). Behaviour therefore steps at those boundaries: Cuphead measured the
325
+ scripted controller's median duration jumping +8%..+24% across d=0.25, and hits taken rising (Cagney
326
+ 0.13 -> 1.13) across d=0.75. Anyone sweeping d to find d* sees a discontinuous curve, and until now
327
+ had to re-derive the boundaries from the game's own source to know why.
328
+
329
+ This leaks nothing: the band is a pure function of `difficulty`, which the public info already
330
+ carries. It is a label on a number the policy can already see — not live state.
331
+ """
332
+ return None
333
+
334
+ def _engine_reset(self, seed, d, options=None):
335
+ raise NotImplementedError
336
+
337
+ def _engine_packet(self, packet, lag, ok):
338
+ raise NotImplementedError
339
+
340
+ def _render(self):
341
+ raise NotImplementedError
342
+
343
+ def _vector(self):
344
+ raise NotImplementedError
345
+
346
+ def _manual(self):
347
+ raise NotImplementedError
348
+
349
+
350
+ class PyCaseEnv(UnifiedEnv):
351
+ """Adapter for the existing Python Case engine: the Case ticks at its own FPS (60 Hz -> 12 ticks per
352
+ packet, 2 per sub-step) and the body's keys() maps each tick's held keys onto its native action."""
353
+
354
+ def __init__(self, case_id, factory, case_kw=None, **kw):
355
+ super().__init__(case_id, **kw)
356
+ self.inner = factory(difficulty=self.difficulty, **(case_kw or {})) # BossBenchEnv: owns case + renderer
357
+ self.case = self.inner.case
358
+ self.fps = self.inner.metadata["render_fps"]
359
+ self.ticks = round(self.fps * km.PACKET_SECONDS)
360
+ self.max_ticks = self.inner.max_ticks
361
+ self.max_seconds = self.max_ticks / self.fps
362
+ if self.action_mode == "native":
363
+ self.action_space = self.case.body.action_space
364
+ self.observation_space = self._obs_space(self.case.observation_space)
365
+
366
+ @property
367
+ def engine_spec(self):
368
+ return EngineSpec('minecraft-python', '3d', 60, self.max_seconds, 'moderngl', 'perspective',
369
+ resolution=tuple(self.case.size))
370
+
371
+ def render_status(self):
372
+ error = getattr(self.case, 'render_error', None)
373
+ ready = getattr(self.case, '_gl', None) is not None and error is None
374
+ return RenderStatus('moderngl', 'perspective' if ready else 'raster', ready, error)
375
+
376
+ def _validate_options(self, options):
377
+ super()._validate_options(options)
378
+ # Minecraft loadout/camera are public experiment conditions, passed
379
+ # through the same Gym reset contract as the web games' options.
380
+ # Validate before UnifiedEnv changes the live episode or RNG state.
381
+ if self.case_id.startswith("3d/minecraft_"):
382
+ for key, choices in (("weapon", ("sword", "bow")),
383
+ ("camera", ("first", "third"))):
384
+ if key in options and options[key] not in choices:
385
+ raise ValueError(f"Minecraft {key} must be one of {choices}")
386
+
387
+ def reset(self, *, seed=None, options=None):
388
+ obs, info = super().reset(seed=seed, options=options)
389
+ return obs, self._visual_info(info)
390
+
391
+ def step(self, action, latency=None):
392
+ obs, reward, terminated, truncated, info = super().step(action, latency)
393
+ return obs, reward, terminated, truncated, self._visual_info(info)
394
+
395
+ def _visual_info(self, info):
396
+ # UnifiedEnv builds info before rendering. Inspect the renderer only
397
+ # after _observe returned so a fallback cannot masquerade as 3D RGB.
398
+ if self.case_id.startswith("3d/minecraft_"):
399
+ info = dict(info)
400
+ info.update(camera=self.case.camera,
401
+ weapon=getattr(self.case.body, "weapon", "sword"))
402
+ if self.obs_mode == "rgb":
403
+ error = getattr(self.case, "render_error", None)
404
+ renderer = getattr(self.case, "_gl", None)
405
+ info["render_error"] = error
406
+ info["renderer"] = "moderngl" if renderer is not None and error is None else "topdown"
407
+ if info["renderer"] == "moderngl":
408
+ info["render_backend"] = renderer.ctx.info.get("GL_RENDERER")
409
+ return info
410
+
411
+ def _snapshot(self, frames):
412
+ c = self.case
413
+ out = c.outcome() or ("timeout" if c.t >= self.max_ticks else None)
414
+ return {"state": c.state(), "events": list(c.events), "outcome": out, "t": c.t / self.fps,
415
+ "player_hp": round(max(float(c.body.hp), 0.0), 4), "player_max_hp": float(c.body.max_hp),
416
+ "boss_hp": round(max(float(c.boss.hp), 0.0), 4), "boss_max_hp": float(c.boss.max_hp), "frames": frames}
417
+
418
+ def _engine_reset(self, seed, d, options=None):
419
+ if self.case_id.startswith("3d/minecraft_"):
420
+ self.case.reset(seed, d, options=dict(options or {}))
421
+ else:
422
+ self.case.reset(seed, d)
423
+ self.inner._has_reset, self.inner._done = True, False
424
+ self._held = frozenset()
425
+ return self._snapshot(0)
426
+
427
+ def _tick_all(self, actions):
428
+ c, n = self.case, 0
429
+ for a in actions:
430
+ if c.outcome() or c.t >= self.max_ticks:
431
+ break
432
+ c.tick(a() if callable(a) else a) # keys() runs at tick time: it may read the current state
433
+ n += 1
434
+ return n
435
+
436
+ def _key_ticks(self, packet):
437
+ sched, self._held = km.schedule(packet, self.ticks, self._held)
438
+ body, c = self.case.body, self.case
439
+ return [lambda h=h, p=p, m=m: body.keys(c, h, p, m) for h, p, m in sched]
440
+
441
+ def _engine_packet(self, packet, lag, ok):
442
+ c, frames = self.case, 0
443
+ c.events.clear()
444
+ native = self.action_mode == "native"
445
+ for _ in range(lag): # the world did not wait
446
+ if c.outcome() or c.t >= self.max_ticks:
447
+ break
448
+ frames += self._tick_all([c.body.noop()] * self.ticks if native else self._key_ticks(None))
449
+ if c.outcome() or c.t >= self.max_ticks:
450
+ return self._snapshot(frames)
451
+ if native:
452
+ a = c.body.parse(packet) if isinstance(packet, str) else packet
453
+ frames += self._tick_all([a] * self.ticks)
454
+ else:
455
+ frames += self._tick_all(self._key_ticks(km.parse_packet(packet) if ok else None))
456
+ return self._snapshot(frames)
457
+
458
+ def _render(self):
459
+ return self.inner.render()
460
+
461
+ def _vector(self):
462
+ return self.case.observe()
463
+
464
+ def _manual(self):
465
+ skills = [{"move": n, "cue": m.get("cue") or m.get("telegraph"), "punish": m.get("punish"),
466
+ "damage": m.get("damage")} for n, m in self.case.boss.MOVES.items()]
467
+ return {"controls": self.case.body.manual, "skills": skills}
468
+
469
+ def _declared_tiers(self):
470
+ # The case's own module declares TIERS (e.g. mc4d.TIERS) next to its RULES constant.
471
+ import sys
472
+ from .tiers import validate_declared
473
+ module = sys.modules.get(type(self.case).__module__)
474
+ return validate_declared(getattr(module, "TIERS", None), where=self.case_id)
475
+
476
+ def _difficulty_band(self, d):
477
+ # Optional, same pattern as TIERS: the case's module may declare difficulty_band(d) -> str.
478
+ import sys
479
+ module = sys.modules.get(type(self.case).__module__)
480
+ fn = getattr(module, "difficulty_band", None)
481
+ return _clean_band(fn(d), self.case_id) if callable(fn) else None
482
+
483
+ def close(self):
484
+ if not self._closed:
485
+ try:
486
+ self.inner.close()
487
+ finally:
488
+ super().close()
environments/games/prototype/bossbench/webenv.py ADDED
@@ -0,0 +1,260 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Gymnasium binding for the web engine (web/engine + web/games/<game>/, 60 Hz): the Hollow-Knight-style 2D cases.
2
+
3
+ The simulation stays in JavaScript (one source of truth for the browser game, the Node tests and
4
+ training). Each case belongs to one game folder (bossbench.WEB_GAME), whose index.html fixes the script order.
5
+ This module drives it through web/engine/bridge.js over one of two transports:
6
+
7
+ node `node web/tools/gym_server.js <game>`, JSON lines on stdin/stdout. symbolic only, fast, no browser.
8
+ browser a headless Chromium page (Playwright) with the game's scripts + renderer loaded; needed for obs_mode="rgb".
9
+ BB_CHANNEL=msedge|chrome picks an installed browser instead of Playwright's own build.
10
+
11
+ transport="auto" picks browser for rgb and node otherwise. Both transports load the same game rules.
12
+ """
13
+ from __future__ import annotations
14
+
15
+ import atexit
16
+ import base64
17
+ import json
18
+ import os
19
+ import re
20
+ import shutil
21
+ import subprocess
22
+
23
+ import numpy as np
24
+
25
+ from .unified import UnifiedEnv, _finite_number, _plain
26
+
27
+ WEB = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))), "web")
28
+ NO_PAGE = ("engine/input.js", "engine/app.js") # browser-app UI: needs the game's DOM, not part of the env
29
+
30
+ DEFAULT_GAME = "hollowknight_remake"
31
+
32
+
33
+ def game_of(case_id):
34
+ from . import WEB_GAME
35
+ if case_id not in WEB_GAME:
36
+ raise KeyError(f"no web game registers {case_id!r}; known: {sorted(WEB_GAME)}")
37
+ return WEB_GAME[case_id]
38
+
39
+
40
+ def game_scripts(game):
41
+ """Absolute paths of web/games/<game>/index.html's scripts in page order, minus the browser-app layer."""
42
+ gdir = os.path.join(WEB, "games", game)
43
+ with open(os.path.join(gdir, "index.html"), encoding="utf-8") as source:
44
+ html = source.read()
45
+ out = [os.path.normpath(os.path.join(gdir, s)) for s in re.findall(r'<script\s+src="([^"]+)"', html)]
46
+ return [p for p in out if os.path.relpath(p, WEB).replace(os.sep, "/") not in NO_PAGE]
47
+
48
+
49
+ class NodeTransport:
50
+ def __init__(self, game=DEFAULT_GAME):
51
+ node = shutil.which("node")
52
+ if node is None:
53
+ raise RuntimeError("web cases need Node.js on PATH (node web/tools/gym_server.js <game>)")
54
+ self.p = subprocess.Popen([node, os.path.join(WEB, "tools", "gym_server.js"), game], stdin=subprocess.PIPE,
55
+ stdout=subprocess.PIPE, text=True, encoding="utf-8", bufsize=1)
56
+
57
+ def __call__(self, msg):
58
+ self.p.stdin.write(json.dumps(msg, allow_nan=False, default=_plain) + "\n")
59
+ line = self.p.stdout.readline()
60
+ if not line:
61
+ raise RuntimeError(f"web gym server exited (code {self.p.poll()})")
62
+ return json.loads(line)
63
+
64
+ def close(self):
65
+ if self.p.poll() is None:
66
+ self.p.stdin.close()
67
+ try:
68
+ self.p.wait(timeout=5)
69
+ except subprocess.TimeoutExpired:
70
+ self.p.terminate()
71
+ try:
72
+ self.p.wait(timeout=5)
73
+ except subprocess.TimeoutExpired:
74
+ self.p.kill()
75
+ self.p.wait(timeout=5)
76
+ elif not self.p.stdin.closed:
77
+ self.p.stdin.close()
78
+ if not self.p.stdout.closed:
79
+ self.p.stdout.close()
80
+
81
+
82
+ class BrowserTransport:
83
+ """One shared headless browser per process, one page per env."""
84
+ _pw = _browser = None
85
+ _owner_pid = None
86
+
87
+ @classmethod
88
+ def _launch(cls):
89
+ if cls._browser is not None and cls._owner_pid != os.getpid():
90
+ raise RuntimeError("browser runtime belongs to another process; use AsyncVectorEnv(context='spawn')")
91
+ if cls._browser is None:
92
+ from playwright.sync_api import sync_playwright
93
+ cls._pw = sync_playwright().start()
94
+ cls._owner_pid = os.getpid()
95
+ want = os.environ.get("BB_CHANNEL")
96
+ errors = []
97
+ for ch in ([want] if want else [None, "chrome", "msedge"]):
98
+ try:
99
+ cls._browser = cls._pw.chromium.launch(channel=ch, args=["--no-sandbox"])
100
+ break
101
+ except Exception as ex: # this channel is not installed; try the next one
102
+ errors.append(f"{ch or 'playwright chromium'}: {str(ex).splitlines()[0]}")
103
+ if cls._browser is None:
104
+ cls._pw.stop()
105
+ cls._pw = None
106
+ raise RuntimeError("no headless browser for rgb web cases (run `playwright install chromium` "
107
+ "or set BB_CHANNEL):\n " + "\n ".join(errors))
108
+ atexit.register(cls._shutdown)
109
+ return cls._browser
110
+
111
+ @classmethod
112
+ def _shutdown(cls):
113
+ if cls._owner_pid is not None and cls._owner_pid != os.getpid():
114
+ # A forked child's atexit must not close the parent's browser/pipes.
115
+ cls._browser = cls._pw = cls._owner_pid = None
116
+ return
117
+ try:
118
+ if cls._browser is not None:
119
+ cls._browser.close()
120
+ except Exception:
121
+ pass
122
+ try:
123
+ if cls._pw is not None:
124
+ cls._pw.stop()
125
+ except Exception:
126
+ pass
127
+ cls._browser = cls._pw = cls._owner_pid = None
128
+
129
+ def __init__(self, game=DEFAULT_GAME):
130
+ self.page = self._launch().new_page()
131
+ self._pid = os.getpid()
132
+ try:
133
+ for path in game_scripts(game):
134
+ self.page.add_script_tag(path=path)
135
+ self.page.add_script_tag(path=os.path.join(WEB, "engine", "bridge.js"))
136
+ except Exception:
137
+ self.close()
138
+ raise
139
+
140
+ def __call__(self, msg):
141
+ if self._pid != os.getpid():
142
+ raise RuntimeError("browser page belongs to another process; create env in a spawn worker")
143
+ # JSON.stringify on the page, as the Node transport does (Playwright's own serializer keeps -0 apart from 0)
144
+ return json.loads(self.page.evaluate(
145
+ "m => { try { return JSON.stringify(BB.bridge(m)); } catch (e) { return JSON.stringify({ error: String(e.stack || e) }); } }",
146
+ msg))
147
+
148
+ def close(self):
149
+ if self._pid != os.getpid():
150
+ return
151
+ try:
152
+ self.page.close()
153
+ except Exception:
154
+ pass
155
+
156
+
157
+ def list_cases(game=DEFAULT_GAME):
158
+ t = NodeTransport(game)
159
+ try:
160
+ return t({"cmd": "cases"})["cases"]
161
+ finally:
162
+ t.close()
163
+
164
+
165
+ class WebCaseEnv(UnifiedEnv):
166
+ fps = 60
167
+
168
+ def __init__(self, case_id, transport="auto", game=None, **kw):
169
+ super().__init__(case_id, **kw)
170
+ if self.action_mode != "keymouse":
171
+ raise ValueError("web cases only take key/mouse packets (action_mode='keymouse')")
172
+ self.observation_space = self._obs_space(None)
173
+ if transport not in ("auto", "browser", "node"):
174
+ raise ValueError("transport must be 'auto', 'browser' or 'node'")
175
+ if transport == "auto":
176
+ transport = "browser" if self.obs_mode == "rgb" else "node"
177
+ if self.obs_mode == "rgb" and transport != "browser":
178
+ raise ValueError("RGB observations require browser transport")
179
+ self.transport, self.game = transport, game or game_of(case_id)
180
+ self.t = BrowserTransport(self.game) if transport == "browser" else NodeTransport(self.game)
181
+ try:
182
+ meta = self._call({"cmd": "make", "id": case_id, "rgb": transport == "browser"})
183
+ from .tiers import validate_declared
184
+ self._tiers = validate_declared(self._call({"cmd": "meta"}).get("tiers"),
185
+ where=f"{self.game} BB.GAME.tiers")
186
+ except Exception:
187
+ self.close()
188
+ raise
189
+ self.fps, self.max_seconds, self._man = meta["fps"], meta["max_seconds"], meta["manual"]
190
+ self._frame = None
191
+
192
+ def _declared_tiers(self):
193
+ return self._tiers
194
+
195
+ def _difficulty_band(self, d):
196
+ """The game's own BB.GAME.difficultyBand(d), read through the bridge like `tiers`.
197
+
198
+ Cached per difficulty: the band is a pure function of d, but _info() runs on every step, so querying
199
+ the page each time cost ~25% of a symbolic step (0.095 ms of 0.39 ms) and 2.3% of an RGB step. Found
200
+ and measured by the Cuphead session, 2026-11-03. A dict keyed by d keeps `reset(difficulty=...)`
201
+ correct across difficulties within one episode-sequence without re-querying.
202
+ """
203
+ key = float(d)
204
+ cache = getattr(self, '_band_cache', None)
205
+ if cache is None:
206
+ cache = self._band_cache = {}
207
+ if key not in cache:
208
+ from .unified import _clean_band
209
+ try:
210
+ value = self._call({'cmd': 'band', 'd': key}).get('band')
211
+ except Exception:
212
+ value = None
213
+ cache[key] = _clean_band(value, f'{self.case_id}.difficultyBand')
214
+ return cache[key]
215
+
216
+ def _validate_options(self, options):
217
+ super()._validate_options(options)
218
+ if self.case_id.startswith("terraria/") and "dawn_in_seconds" in options:
219
+ options["dawn_in_seconds"] = _finite_number(options["dawn_in_seconds"], "dawn_in_seconds", upper=540)
220
+
221
+ def _call(self, msg):
222
+ res = self.t(msg)
223
+ if "error" in res:
224
+ raise RuntimeError(f"{self.case_id}: {res['error']}")
225
+ return res
226
+
227
+ def _snapshot(self, res):
228
+ if "frame" in res:
229
+ f = res["frame"]
230
+ self._frame = np.frombuffer(base64.b64decode(f["b64"]), np.uint8).reshape(f["shape"])
231
+ i = res["info"]
232
+ return {"state": res["state"], "events": i["events"], "outcome": i["outcome"], "t": i["t"],
233
+ "frames": i["frames"], "player_hp": i["player_hp"], "player_max_hp": i["player_max_hp"],
234
+ "boss_hp": i["boss_hp"], "boss_max_hp": i["boss_max_hp"]}
235
+
236
+ def _engine_reset(self, seed, d, options=None):
237
+ # Game options (e.g. Terraria's dawn_in_seconds) must reach the same reset
238
+ # as human play. Keep the top-level difficulty for older bridge clients.
239
+ return self._snapshot(self._call({"cmd": "reset", "seed": seed, "difficulty": d,
240
+ "options": dict(options or {})}))
241
+
242
+ def _engine_packet(self, packet, lag, ok):
243
+ return self._snapshot(self._call({"cmd": "step", "packet": packet, "lag": lag}))
244
+
245
+ def _render(self):
246
+ if self.transport != "browser":
247
+ raise RuntimeError(f"{self.case_id}: rgb frames need transport='browser' (obs_mode='rgb' picks it)")
248
+ return self._frame
249
+
250
+ def _manual(self):
251
+ return self._man
252
+
253
+ def close(self):
254
+ if not self._closed:
255
+ try:
256
+ if getattr(self, "t", None) is not None:
257
+ self.t.close()
258
+ finally:
259
+ self.t = None
260
+ super().close()
environments/games/prototype/bossbench_llm/__init__.py ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ """LLM harness for BossBench: Lumine-format and semantic-format agents on the BossBench games.
2
+
3
+ Modules: lumine (action text <-> packets), semantic (named actions), prompting (system prompts, zh/en),
4
+ session (Lumine sliding-window chat), frames (JPEG), client (OpenAI-compatible), policies, envs, run, verify.
5
+ """
6
+ __version__ = "bossbench-llm@1"
environments/games/prototype/bossbench_llm/client.py ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Minimal OpenAI-compatible chat client (standard library only): vLLM, SGLang, OpenAI, any /v1/chat/completions.
2
+
3
+ Notes for Lumine-style models served by vLLM: <|action_start|> / <|action_end|> are special tokens and vLLM drops
4
+ special tokens from the returned text by default. Pass --extra-body '{"skip_special_tokens": false}' (the harness
5
+ also accepts an action body without markers and counts it as `bare`).
6
+ """
7
+ from __future__ import annotations
8
+
9
+ import json
10
+ import os
11
+ import time
12
+ import urllib.error
13
+ import urllib.request
14
+
15
+
16
+ class ChatError(RuntimeError):
17
+ """The endpoint could not produce a reply (network / HTTP / malformed response): an infrastructure failure,
18
+ never scored as a model action."""
19
+
20
+
21
+ class ChatClient:
22
+ def __init__(self, base_url, model, *, api_key=None, api_key_env="OPENAI_API_KEY", temperature=1.0, top_p=1.0,
23
+ max_tokens=128, timeout=120.0, retries=3, extra_body=None, headers=None):
24
+ self.url = base_url.rstrip("/") + "/chat/completions"
25
+ self.model = model
26
+ self.api_key = api_key if api_key is not None else os.environ.get(api_key_env or "", "")
27
+ self.params = {"temperature": temperature, "top_p": top_p, "max_tokens": max_tokens}
28
+ self.extra_body = dict(extra_body or {})
29
+ self.timeout, self.retries = float(timeout), int(retries)
30
+ self.headers = {"Content-Type": "application/json", **(headers or {})}
31
+ if self.api_key:
32
+ self.headers["Authorization"] = "Bearer " + self.api_key
33
+
34
+ def describe(self):
35
+ """Public settings for the run log (never the key)."""
36
+ return {"endpoint": self.url, "model": self.model, **self.params, "extra_body": self.extra_body}
37
+
38
+ def complete(self, messages):
39
+ """-> (reply text, metadata). Raises ChatError after `retries` failed attempts."""
40
+ body = json.dumps({"model": self.model, "messages": messages, "stream": False, **self.params,
41
+ **self.extra_body}).encode("utf-8")
42
+ last = None
43
+ for attempt in range(self.retries + 1):
44
+ start = time.perf_counter()
45
+ try:
46
+ request = urllib.request.Request(self.url, data=body, headers=self.headers, method="POST")
47
+ with urllib.request.urlopen(request, timeout=self.timeout) as response:
48
+ payload = json.loads(response.read().decode("utf-8"))
49
+ choice = payload["choices"][0]
50
+ content = choice["message"].get("content")
51
+ if isinstance(content, list): # some servers return content parts
52
+ content = "".join(p.get("text", "") for p in content if isinstance(p, dict))
53
+ reasoning = choice["message"].get("reasoning_content")
54
+ return (content or ""), {"seconds": time.perf_counter() - start, "attempts": attempt + 1,
55
+ "finish_reason": choice.get("finish_reason"), "usage": payload.get("usage"),
56
+ "reasoning_content": reasoning}
57
+ except urllib.error.HTTPError as e:
58
+ detail = e.read().decode("utf-8", "replace")[:500]
59
+ last = f"HTTP {e.code}: {detail}"
60
+ if 400 <= e.code < 500 and e.code not in (408, 409, 429):
61
+ break # a request error will not fix itself
62
+ except (urllib.error.URLError, TimeoutError, OSError, KeyError, IndexError, ValueError) as e:
63
+ last = f"{type(e).__name__}: {e}"
64
+ if attempt < self.retries:
65
+ time.sleep(min(30.0, 2.0 ** attempt))
66
+ raise ChatError(last or "unknown error")
environments/games/prototype/bossbench_llm/envs.py ADDED
@@ -0,0 +1,196 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """One game episode behind the LLM harness: reset, execute a parsed model action, trusted result, replay record.
2
+
3
+ Three routes, all on the project's public interfaces (nothing here edits or monkey-patches game code):
4
+ * LumineGame Lumine text -> BossBench packet -> bossbench.make_policy_env (every registered case).
5
+ * CompactGame semantic JSON -> compact action -> bossbench.make_compact_env (18 games).
6
+ * TerrariaSemantic semantic JSON -> terraria-semantic@1 (web/games/terraria_remake/semantic_ppo_v1), 2 x 100 ms.
7
+
8
+ Only the public RGB frame goes to the model. Results (verifier, final hash) are read on the trusted side for the
9
+ log and are never put into the model's context.
10
+ """
11
+ from __future__ import annotations
12
+
13
+ from pathlib import Path
14
+ import sys
15
+
16
+ import bossbench
17
+ from bossbench import keymouse as km, scripted
18
+ from bossbench.scope import POLICY_CASES
19
+
20
+ from . import lumine
21
+ from .semantic import TERRARIA, Vocabulary
22
+
23
+ ROOT = Path(bossbench.__file__).resolve().parents[2]
24
+ INVALID = "invalid model action" # any non-packet text: the env runs a no-op and counts a format error
25
+
26
+
27
+ def game_of(case_id):
28
+ if case_id not in POLICY_CASES:
29
+ raise KeyError(f"unknown case {case_id!r}; known: {sorted(POLICY_CASES)}")
30
+ return POLICY_CASES[case_id]["game"]
31
+
32
+
33
+ def _resolve_options(options, info):
34
+ """Pin a tier to the concrete difficulty it produced, as bossbench.scripted.play does."""
35
+ options = dict(options)
36
+ if "tier" in options:
37
+ options["resolved_from_tier"] = options.pop("tier")
38
+ options["difficulty"] = float(info["difficulty"])
39
+ return options
40
+
41
+
42
+ class _PacketGame:
43
+ """Shared by the two routes that end in ordinary 200 ms BossBench packets (replayable by make_policy_env)."""
44
+ fmt = None
45
+
46
+ def __init__(self, case_id):
47
+ self.case_id, self.game = case_id, game_of(case_id)
48
+ self.env = None
49
+ self.packets, self.terminated, self.truncated = [], False, False
50
+
51
+ def reset(self, seed, options):
52
+ options = dict(options or {})
53
+ options.setdefault("engine_seed", int(seed)) # same world as the play page / scripted replays
54
+ obs, info = self.env.reset(seed=int(seed), options=options)
55
+ self.gym_seed, self.options = int(seed), _resolve_options(options, info)
56
+ self.packets, self.terminated, self.truncated = [], False, False
57
+ return obs, info
58
+
59
+ def _run(self, action, packet):
60
+ obs, _, terminated, truncated, info = self.env.step(action)
61
+ self.packets.append(packet)
62
+ self.terminated, self.truncated = bool(terminated), bool(truncated)
63
+ return obs, terminated or truncated, info
64
+
65
+ def noop(self):
66
+ return self._step_packet(km.NOOP)
67
+
68
+ def result(self):
69
+ raw = self.env.unwrapped
70
+ v = raw.verifier()
71
+ return {"outcome": v["outcome"], "win": bool(v["win"]), "boss_damage": v["boss_damage"],
72
+ "seconds": v["seconds"], "difficulty": v.get("d"), "player_hp": v.get("player_hp"),
73
+ "format_errors": int(getattr(raw, "format_errors", 0))}
74
+
75
+ def replay(self):
76
+ raw = self.env.unwrapped
77
+ v = raw.verifier()
78
+ ticks = int(round(raw.snap["t"] * raw.fps))
79
+ return {"format": scripted.REPLAY_FORMAT, "case_id": self.case_id, "game": self.game,
80
+ "contract": "bossbench/policy-gym@2", "rules": scripted.rules(self.env), "native_hz": raw.fps,
81
+ "gym_seed": self.gym_seed, "engine_seed": int(raw.engine_seed), "options": self.options,
82
+ "controller": f"bossbench_llm ({self.fmt} actions, see episode.json)",
83
+ "packets": list(self.packets), "steps": len(self.packets), "ticks": ticks,
84
+ "seconds": round(ticks / raw.fps, 4), "outcome": v["outcome"], "terminated": self.terminated,
85
+ "truncated": self.truncated, "verifier": v, "final_hash": scripted.state_hash(self.env),
86
+ "source_sha256": scripted.source_files(self.env)}
87
+
88
+ def provenance(self):
89
+ return {"rules": scripted.rules(self.env), "route": scripted.route(self.env),
90
+ "native_hz": self.env.unwrapped.fps, "max_seconds": getattr(self.env.unwrapped, "max_seconds", None)}
91
+
92
+ def close(self):
93
+ if self.env is not None:
94
+ self.env.close()
95
+ self.env = None
96
+
97
+
98
+ class LumineGame(_PacketGame):
99
+ fmt = "lumine"
100
+
101
+ def __init__(self, case_id, mouse_kind):
102
+ super().__init__(case_id)
103
+ self.mouse_kind = mouse_kind
104
+ self.env = bossbench.make_policy_env(case_id)
105
+
106
+ def _step_packet(self, packet):
107
+ return self._run(packet, packet)
108
+
109
+ def step(self, parsed):
110
+ """parsed: lumine.Parsed. Format errors run a no-op that the env counts as a format error."""
111
+ return self._step_packet(parsed.packet if parsed.ok else INVALID)
112
+
113
+
114
+ class CompactGame(_PacketGame):
115
+ fmt = "semantic"
116
+
117
+ def __init__(self, case_id):
118
+ super().__init__(case_id)
119
+ self.vocab = Vocabulary.for_game(self.game)
120
+ self.env = bossbench.make_compact_env(case_id)
121
+ self.spec = self.env.compact_spec
122
+
123
+ def _step_packet(self, packet):
124
+ # A packet given to the compact wrapper is not a compact action; run it on the inner policy env.
125
+ obs, _, terminated, truncated, info = self.env.env.step(packet)
126
+ self.packets.append(packet)
127
+ self.terminated, self.truncated = bool(terminated), bool(truncated)
128
+ return obs, terminated or truncated, info
129
+
130
+ def step(self, parsed):
131
+ if not parsed.ok:
132
+ return self._run(INVALID, INVALID)
133
+ packet = self.spec.compose(self.spec.parse(parsed.action))
134
+ return self._run(dict(parsed.action), packet)
135
+
136
+
137
+ class TerrariaSemantic:
138
+ fmt = "semantic"
139
+
140
+ def __init__(self, case_id):
141
+ if str(ROOT) not in sys.path:
142
+ sys.path.insert(0, str(ROOT))
143
+ from web.games.terraria_remake.semantic_ppo_v1 import make_semantic_env
144
+ self.case_id, self.game = case_id, TERRARIA
145
+ self.vocab = Vocabulary.for_game(TERRARIA)
146
+ self.env = make_semantic_env(case_id)
147
+ self.windows = round(0.2 / self.vocab.window_seconds)
148
+
149
+ def reset(self, seed, options):
150
+ options = dict(options or {})
151
+ options.setdefault("engine_seed", int(seed))
152
+ obs, info = self.env.reset(seed=int(seed), options=options)
153
+ self.gym_seed, self.options = int(seed), dict(options)
154
+ return obs, info
155
+
156
+ def _windows(self, action):
157
+ done, obs, info = False, None, None
158
+ for _ in range(self.windows):
159
+ obs, _, terminated, truncated, info = self.env.step(action)
160
+ done = terminated or truncated
161
+ if done:
162
+ break
163
+ return obs, done, info
164
+
165
+ def noop(self):
166
+ return self._windows(None)
167
+
168
+ def step(self, parsed):
169
+ return self._windows(dict(parsed.action) if parsed.ok else "INVALID")
170
+
171
+ def result(self):
172
+ d = self.env.diagnostic()
173
+ v = d.get("verifier", {})
174
+ return {"outcome": v.get("outcome"), "win": bool(v.get("win")), "boss_damage": v.get("boss_damage"),
175
+ "seconds": v.get("seconds"), "difficulty": v.get("d"), "player_hp": v.get("player_hp"),
176
+ "format_errors": None}
177
+
178
+ def replay(self, path):
179
+ return self.env.save_replay(path)
180
+
181
+ def provenance(self):
182
+ return {"rules": self.env.meta.get("rules"), "route": "terraria-semantic@1",
183
+ "native_hz": 60, "max_seconds": self.env.meta.get("max_seconds")}
184
+
185
+ def close(self):
186
+ if self.env is not None:
187
+ self.env.close()
188
+ self.env = None
189
+
190
+
191
+ def open_game(case_id, fmt, mouse_kind="none"):
192
+ if fmt == "lumine":
193
+ return LumineGame(case_id, mouse_kind)
194
+ if fmt == "semantic":
195
+ return TerrariaSemantic(case_id) if game_of(case_id) == TERRARIA else CompactGame(case_id)
196
+ raise ValueError("format must be 'lumine' or 'semantic'")
environments/games/prototype/bossbench_llm/frames.py ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Frame encoding for the model (Lumine: one 1280x720 JPEG per 200 ms, sent as base64)."""
2
+ from __future__ import annotations
3
+
4
+ import base64
5
+ import io
6
+
7
+ import numpy as np
8
+ from PIL import Image
9
+
10
+ DEFAULT_SIZE = (1280, 720)
11
+
12
+
13
+ def encode(frame, size=DEFAULT_SIZE, quality=90):
14
+ """RGB uint8 (H, W, 3) -> (jpeg bytes, data URL). size=None keeps the native 854x480."""
15
+ if not isinstance(frame, np.ndarray) or frame.ndim != 3 or frame.shape[2] != 3 or frame.dtype != np.uint8:
16
+ raise ValueError("expected an RGB uint8 frame")
17
+ image = Image.fromarray(frame, "RGB")
18
+ if size is not None and image.size != tuple(size):
19
+ image = image.resize(tuple(size), Image.BICUBIC)
20
+ buf = io.BytesIO()
21
+ image.save(buf, format="JPEG", quality=int(quality), optimize=False)
22
+ data = buf.getvalue()
23
+ return data, "data:image/jpeg;base64," + base64.b64encode(data).decode("ascii")
environments/games/prototype/bossbench_llm/lumine.py ADDED
@@ -0,0 +1,194 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Lumine-format action text <-> BossBench key/mouse packets.
2
+
3
+ Lumine (arXiv 2511.08892; internal CPT preprocessing `get_lumine_token`) emits one action per 200 ms:
4
+
5
+ <|action_start|>X Y Z ; K1 ; K2 ; K3 ; K4 ; K5 ; K6<|action_end|>
6
+
7
+ * X, Y: relative mouse displacement, integers in [-1000, 1000] (X > 0 right, Y > 0 down), in units of 1/1000 of
8
+ the screen width / height. Z: scroll steps in [-5, 5] (Z > 0 up).
9
+ * K1..K6: six 33 ms chunks; each holds 0-4 key names separated by spaces. A key listed in consecutive chunks
10
+ stays held (not pressed again); an unlisted key is released.
11
+ * Key names: capital letters A-Z; Space Shift Ctrl Alt Tab Esc Caps; number keys as words zero..nine;
12
+ F1-F12 as One..Twelve; mouse buttons LB RB MB.
13
+ * Optional reasoning before the action: <|thought_start|> ... <|thought_end|>.
14
+
15
+ BossBench executes "<|action_start|> dx dy dz ; K1 ; ... ; K6 <|action_end|>" with comma-separated keys from
16
+ W A S D Space Shift J K L Q E R LMB RMB (prototype/bossbench/keymouse.py). This module is the only translation
17
+ between the two; it never changes timing (both are 6 x 33 ms per 200 ms) and never reads game state.
18
+
19
+ Mouse units: on "pointer" games (an on-screen crosshair follows the mouse) X/Y are screen-normalised exactly as in
20
+ Lumine, so X = 1000 moves the crosshair one full screen width (854 game pixels). On "camera" and "none" games X/Y
21
+ are passed through unchanged (1 unit = 1 game mouse count), which keeps every turn rate the game allows reachable.
22
+ """
23
+ from __future__ import annotations
24
+
25
+ from dataclasses import dataclass, field
26
+ from fractions import Fraction
27
+ import re
28
+
29
+ from bossbench import keymouse as km
30
+
31
+ FORMAT = "lumine-action@1"
32
+ SCREEN = (854, 480) # Game coordinate size; model image preprocessing is configured separately.
33
+
34
+ LETTERS = tuple(chr(c) for c in range(ord("A"), ord("Z") + 1))
35
+ NUMBER_WORDS = ("zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine")
36
+ FKEY_WORDS = ("One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Eleven", "Twelve")
37
+ SPECIAL = ("Space", "Shift", "Ctrl", "Alt", "Tab", "Esc", "Caps")
38
+ MOUSE_BUTTONS = ("LB", "RB", "MB")
39
+ LUMINE_KEYS = frozenset(LETTERS + NUMBER_WORDS + FKEY_WORDS + SPECIAL + MOUSE_BUTTONS)
40
+
41
+ # Lumine key name -> BossBench key name. Valid Lumine keys missing here have no binding in any BossBench game.
42
+ TO_BOSSBENCH = {k: k for k in ("W", "A", "S", "D", "J", "K", "L", "Q", "E", "R", "Space", "Shift")}
43
+ TO_BOSSBENCH.update({"LB": "LMB", "RB": "RMB"})
44
+ FROM_BOSSBENCH = {v: k for k, v in TO_BOSSBENCH.items()}
45
+
46
+ # Lenient mode only: unambiguous case variants and the BossBench spellings of the mouse buttons.
47
+ _LENIENT = {k.upper(): k for k in LETTERS + SPECIAL + MOUSE_BUTTONS}
48
+ _LENIENT.update({"LMB": "LB", "RMB": "RB", "MMB": "MB", "SPACEBAR": "Space", "CONTROL": "Ctrl", "ESCAPE": "Esc"})
49
+
50
+ _THOUGHT = re.compile(r"<\|thought_start\|>([\s\S]*?)<\|thought_end\|>")
51
+ _THINK = re.compile(r"<think>([\s\S]*?)</think>")
52
+ _ACTION = re.compile(r"<\|action_start\|>([\s\S]*?)<\|action_end\|>")
53
+ _INT = re.compile(r"[+-]?[0-9]{1,6}")
54
+ _TRAILERS = ("<|im_end|>", "<|endoftext|>", "</s>", "<|eot_id|>")
55
+
56
+
57
+ def mouse_scale(kind):
58
+ """(sx, sy): game mouse counts per Lumine unit for this game's mouse kind."""
59
+ if kind == "pointer":
60
+ return Fraction(SCREEN[0], 1000), Fraction(SCREEN[1], 1000)
61
+ return Fraction(1), Fraction(1)
62
+
63
+
64
+ def _round_scaled(value, scale):
65
+ """round(value * scale), halves away from zero, in exact integer arithmetic."""
66
+ scale = Fraction(scale)
67
+ num, den = scale.numerator, scale.denominator
68
+ q = (2 * abs(value) * num + den) // (2 * den)
69
+ return -q if value < 0 else q
70
+
71
+
72
+ @dataclass
73
+ class Parsed:
74
+ ok: bool # a format-valid Lumine action was found
75
+ packet: str | None = None # BossBench packet to execute; None -> run a no-op (format error)
76
+ mouse: tuple = (0, 0, 0) # Lumine X Y Z as written
77
+ groups: list = field(default_factory=list) # Lumine key tokens per chunk (canonical names)
78
+ thought: str | None = None
79
+ unbound: list = field(default_factory=list) # valid Lumine keys with no BossBench binding (dropped)
80
+ bare: bool = False # the <|action_*|> markers were missing (e.g. stripped by the server)
81
+ lenient_fixes: int = 0 # tokens accepted only by lenient normalisation
82
+ error: str | None = None
83
+
84
+ @property
85
+ def text(self):
86
+ """Canonical Lumine text of what was parsed (None when not ok)."""
87
+ return format_action(self.mouse, self.groups) if self.ok else None
88
+
89
+
90
+ def format_action(mouse, groups):
91
+ """Canonical Lumine text: 'X Y Z ; g1 ; ... ; g6' wrapped in the action markers."""
92
+ x, y, z = (int(v) for v in mouse)
93
+ if len(groups) != km.SUBSTEPS:
94
+ raise ValueError("Lumine actions have exactly 6 chunks")
95
+ return "<|action_start|>%d %d %d ; " % (x, y, z) + " ; ".join(" ".join(g) for g in groups) + "<|action_end|>"
96
+
97
+
98
+ def strip_thoughts(text):
99
+ """-> (text without reasoning blocks, last reasoning text or None). Accepts Lumine and <think> blocks."""
100
+ thought = None
101
+ for pattern in (_THOUGHT, _THINK):
102
+ found = pattern.findall(text)
103
+ if found:
104
+ thought = found[-1].strip() or thought
105
+ text = pattern.sub(" ", text)
106
+ return text, thought
107
+
108
+
109
+ def _canonical_token(token, lenient):
110
+ if token in LUMINE_KEYS:
111
+ return token, False
112
+ if lenient:
113
+ fixed = _LENIENT.get(token.upper())
114
+ if fixed is not None:
115
+ return fixed, True
116
+ return None, False
117
+
118
+
119
+ def parse(reply, *, mouse_kind="none", lenient=False, accept_bare=True):
120
+ """Model reply text -> Parsed (with the BossBench packet to run). Never raises on model output."""
121
+ text = "" if reply is None else str(reply)
122
+ text, thought = strip_thoughts(text)
123
+ found = _ACTION.findall(text)
124
+ bare = False
125
+ if len(found) > 1:
126
+ return Parsed(False, thought=thought, error=f"{len(found)} action blocks in one reply")
127
+ if found:
128
+ body = found[0]
129
+ else:
130
+ if "<|action_start|>" in text:
131
+ return Parsed(False, thought=thought, error="unterminated action (no <|action_end|>)")
132
+ body = text.strip()
133
+ for trailer in _TRAILERS:
134
+ body = body.replace(trailer, "")
135
+ body = body.strip()
136
+ if not accept_bare or not body:
137
+ return Parsed(False, thought=thought, error="no <|action_start|>...<|action_end|> block")
138
+ bare = True
139
+ parts = body.split(";")
140
+ if len(parts) != 1 + km.SUBSTEPS:
141
+ return Parsed(False, thought=thought, bare=bare,
142
+ error=f"expected mouse + 6 chunks separated by ';', got {len(parts)} fields")
143
+ mouse_tokens = parts[0].split()
144
+ if len(mouse_tokens) != 3 or not all(_INT.fullmatch(v) for v in mouse_tokens):
145
+ return Parsed(False, thought=thought, bare=bare, error=f"mouse field must be 3 integers, got {parts[0].strip()!r}")
146
+ x, y, z = (int(v) for v in mouse_tokens)
147
+ if abs(x) > 1000 or abs(y) > 1000 or abs(z) > 5:
148
+ return Parsed(False, thought=thought, bare=bare, error=f"mouse out of range: {x} {y} {z}")
149
+ groups, unbound, fixes = [], [], 0
150
+ for index, part in enumerate(parts[1:], 1):
151
+ raw = part.replace(",", " ").split() if lenient else part.split()
152
+ if len(raw) > km.MAX_KEYS:
153
+ return Parsed(False, thought=thought, bare=bare, error=f"chunk {index} has {len(raw)} keys (max 4)")
154
+ group = []
155
+ for token in raw:
156
+ name, fixed = _canonical_token(token, lenient)
157
+ if name is None:
158
+ return Parsed(False, thought=thought, bare=bare, error=f"chunk {index}: unknown key name {token!r}")
159
+ if name in group:
160
+ return Parsed(False, thought=thought, bare=bare, error=f"chunk {index}: key {name} repeated")
161
+ fixes += fixed
162
+ group.append(name)
163
+ if name not in TO_BOSSBENCH:
164
+ unbound.append(name)
165
+ groups.append(group)
166
+ sx, sy = mouse_scale(mouse_kind)
167
+ subs = [[TO_BOSSBENCH[k] for k in g if k in TO_BOSSBENCH] for g in groups]
168
+ packet = km.format_packet(subs, (_round_scaled(x, sx), _round_scaled(y, sy), z))
169
+ if km.parse_packet(packet) is None: # cannot happen for valid input; keep the contract explicit
170
+ return Parsed(False, thought=thought, bare=bare, error="internal: converted packet rejected")
171
+ return Parsed(True, packet=packet, mouse=(x, y, z), groups=groups, thought=thought, unbound=unbound,
172
+ bare=bare, lenient_fixes=fixes)
173
+
174
+
175
+ def from_packet(packet, *, mouse_kind="none"):
176
+ """BossBench packet text -> canonical Lumine text that converts back to exactly the same packet.
177
+
178
+ Raises ValueError if the packet is invalid or its mouse cannot be expressed in Lumine units for this game."""
179
+ p = km.parse_packet(packet if packet is not None else km.NOOP)
180
+ if p is None:
181
+ raise ValueError(f"not a valid BossBench packet: {packet!r}")
182
+ sx, sy = mouse_scale(mouse_kind)
183
+ dx, dy, dz = p["mouse"]
184
+ x, y = _round_scaled(dx, 1 / sx), _round_scaled(dy, 1 / sy)
185
+ if abs(x) > 1000 or abs(y) > 1000 or _round_scaled(x, sx) != dx or _round_scaled(y, sy) != dy:
186
+ raise ValueError(f"mouse {dx} {dy} is not expressible in Lumine units for a {mouse_kind!r} game")
187
+ groups = [sorted(FROM_BOSSBENCH[k] for k in sub) for sub in p["subs"]]
188
+ return format_action((x, y, dz), groups)
189
+
190
+
191
+ def same_packet(a, b):
192
+ """True when two BossBench packet texts parse to the same action."""
193
+ pa, pb = km.parse_packet(a), km.parse_packet(b)
194
+ return pa is not None and pb is not None and pa["mouse"] == pb["mouse"] and pa["subs"] == pb["subs"]
environments/games/prototype/bossbench_llm/mock_server.py ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """A stand-in OpenAI-compatible endpoint for checking the harness without a model.
2
+
3
+ python -m bossbench_llm.mock_server --port 8009
4
+ python -m bossbench_llm.run --case terraria/king_slime --tier easy --policy chat \
5
+ --base-url http://127.0.0.1:8009/v1 --model mock --max-steps 20
6
+
7
+ It checks each request the way a real server would see it (system prompt first, one image per user turn,
8
+ alternating turns) and answers with a fixed-pattern action in the format the system prompt asks for. It is not a
9
+ policy: it does not look at the image.
10
+ """
11
+ from __future__ import annotations
12
+
13
+ import argparse
14
+ from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
15
+ import json
16
+ import sys
17
+
18
+ LUMINE = ["<|action_start|>0 0 0 ; D ; D ; D ; D ; D ; D<|action_end|>",
19
+ "<|action_start|>40 0 0 ; A Space ; A Space ; A ; A ; LB ; LB<|action_end|>",
20
+ "<|action_start|>-40 0 0 ; J ; J ; ; ; Space ; Space<|action_end|>"]
21
+
22
+
23
+ def check(messages):
24
+ if not messages or messages[0].get("role") != "system":
25
+ return "first message must be the system prompt"
26
+ roles = [m.get("role") for m in messages[1:]]
27
+ if not roles or roles[-1] != "user":
28
+ return "last message must be a user turn"
29
+ for a, b in zip(roles, roles[1:]):
30
+ if a == b:
31
+ return "user/assistant turns must alternate"
32
+ for m in messages[1:]:
33
+ if m["role"] == "user":
34
+ images = [p for p in m.get("content", []) if isinstance(p, dict) and p.get("type") == "image_url"]
35
+ if len(images) != 1 or not images[0]["image_url"]["url"].startswith("data:image/jpeg;base64,"):
36
+ return "each user turn must carry exactly one JPEG data URL"
37
+ return None
38
+
39
+
40
+ class Handler(BaseHTTPRequestHandler):
41
+ counter = 0
42
+
43
+ def log_message(self, *args):
44
+ pass
45
+
46
+ def do_POST(self):
47
+ if not self.path.endswith("/chat/completions"):
48
+ self.send_error(404)
49
+ return
50
+ body = json.loads(self.rfile.read(int(self.headers.get("Content-Length", 0))))
51
+ problem = check(body.get("messages", []))
52
+ if problem:
53
+ out = json.dumps({"error": {"message": problem}}).encode()
54
+ self.send_response(400)
55
+ else:
56
+ Handler.counter += 1
57
+ system = body["messages"][0]["content"]
58
+ if "<|action_start|>" in system:
59
+ text = LUMINE[Handler.counter % len(LUMINE)]
60
+ else:
61
+ text = "{}"
62
+ out = json.dumps({"id": f"mock-{Handler.counter}", "object": "chat.completion", "model": body.get("model"),
63
+ "choices": [{"index": 0, "finish_reason": "stop",
64
+ "message": {"role": "assistant", "content": text}}],
65
+ "usage": {"prompt_tokens": 0, "completion_tokens": 0,
66
+ "images": sum(1 for m in body["messages"] if m["role"] == "user")}}).encode()
67
+ self.send_response(200)
68
+ self.send_header("Content-Type", "application/json")
69
+ self.send_header("Content-Length", str(len(out)))
70
+ self.end_headers()
71
+ self.wfile.write(out)
72
+
73
+
74
+ def main(argv=None):
75
+ p = argparse.ArgumentParser(prog="python -m bossbench_llm.mock_server")
76
+ p.add_argument("--host", default="127.0.0.1")
77
+ p.add_argument("--port", type=int, default=8009)
78
+ args = p.parse_args(argv)
79
+ server = ThreadingHTTPServer((args.host, args.port), Handler)
80
+ print(f"mock endpoint on http://{args.host}:{args.port}/v1", flush=True)
81
+ try:
82
+ server.serve_forever()
83
+ except KeyboardInterrupt:
84
+ pass
85
+ return 0
86
+
87
+
88
+ if __name__ == "__main__":
89
+ sys.exit(main())
environments/games/prototype/bossbench_llm/policies.py ADDED
@@ -0,0 +1,111 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Policies the harness can drive. Every policy sees only the chat messages (system prompt, frames, its own
2
+ replies) plus a small public `turn` record (index, case, format, the game's key names / action vocabulary).
3
+
4
+ * chat an OpenAI-compatible endpoint (the real thing)
5
+ * python your own code: --policy python --policy-factory my_module:make -> object with act(messages, turn)
6
+ * replay a recorded scripted win, converted to the chosen format (pipeline self-test; lumine is lossless)
7
+ * noop / random baselines and smoke tests
8
+ """
9
+ from __future__ import annotations
10
+
11
+ import importlib
12
+ import json
13
+ import random
14
+
15
+ from bossbench import keymouse as km
16
+
17
+ from . import lumine
18
+
19
+
20
+ class Turn(dict):
21
+ """Public per-turn context: index, case_id, game, format, lumine_keys, vocab (semantic only)."""
22
+ __getattr__ = dict.get
23
+
24
+
25
+ class ChatPolicy:
26
+ name = "chat"
27
+
28
+ def __init__(self, client):
29
+ self.client = client
30
+
31
+ def act(self, messages, turn):
32
+ return self.client.complete(messages)
33
+
34
+ def describe(self):
35
+ return {"policy": self.name, **self.client.describe()}
36
+
37
+
38
+ class PythonPolicy:
39
+ name = "python"
40
+
41
+ def __init__(self, factory, config=None):
42
+ module, _, attr = factory.partition(":")
43
+ self.factory = factory
44
+ self.impl = getattr(importlib.import_module(module), attr or "make")(dict(config or {}))
45
+
46
+ def act(self, messages, turn):
47
+ out = self.impl.act(messages, turn)
48
+ return out if isinstance(out, tuple) else (out, {})
49
+
50
+ def describe(self):
51
+ info = getattr(self.impl, "describe", None)
52
+ return {"policy": self.name, "factory": self.factory, **(info() if callable(info) else {})}
53
+
54
+
55
+ class ReplayPolicy:
56
+ """Replays a bossbench/policy-replay@1 recording. Lumine text converts back to exactly the recorded packets, so
57
+ a lumine replay must reproduce the recording's final hash; semantic replays use the nearest compact action
58
+ (compact.CompactSpec.project) and are a smoke test only."""
59
+ name = "replay"
60
+
61
+ def __init__(self, path, fmt, mouse_kind="none", spec=None):
62
+ with open(path, encoding="utf-8") as f:
63
+ self.data = json.load(f)
64
+ self.path, self.fmt, self.mouse_kind, self.spec = str(path), fmt, mouse_kind, spec
65
+ self.index = 0
66
+
67
+ def act(self, messages, turn):
68
+ packets = self.data["packets"]
69
+ packet = packets[self.index] if self.index < len(packets) else km.NOOP
70
+ self.index += 1
71
+ if self.fmt == "lumine":
72
+ return lumine.from_packet(packet, mouse_kind=self.mouse_kind), {"seconds": 0.0}
73
+ idx = self.spec.project(packet)
74
+ return json.dumps(self.spec.named(idx)), {"seconds": 0.0}
75
+
76
+ def describe(self):
77
+ return {"policy": self.name, "replay": self.path, "case_id": self.data.get("case_id"),
78
+ "rules": self.data.get("rules"), "outcome": self.data.get("outcome")}
79
+
80
+
81
+ class NoopPolicy:
82
+ name = "noop"
83
+
84
+ def __init__(self, fmt):
85
+ self.fmt = fmt
86
+
87
+ def act(self, messages, turn):
88
+ return (lumine.format_action((0, 0, 0), [[]] * km.SUBSTEPS) if self.fmt == "lumine" else "{}"), {"seconds": 0.0}
89
+
90
+ def describe(self):
91
+ return {"policy": self.name}
92
+
93
+
94
+ class RandomPolicy:
95
+ """Uniform over this game's own keys (lumine: each chunk 0-2 keys, mouse +-100) or over its action options."""
96
+ name = "random"
97
+
98
+ def __init__(self, fmt, seed=0):
99
+ self.fmt, self.rng, self.seed = fmt, random.Random(seed), seed
100
+
101
+ def act(self, messages, turn):
102
+ if self.fmt == "lumine":
103
+ keys = list(turn.lumine_keys or [])
104
+ groups = [sorted(self.rng.sample(keys, min(len(keys), self.rng.randint(0, 2)))) for _ in range(km.SUBSTEPS)]
105
+ mouse = (self.rng.randint(-100, 100), self.rng.randint(-100, 100), 0) if turn.mouse_kind != "none" else (0, 0, 0)
106
+ return lumine.format_action(mouse, groups), {"seconds": 0.0}
107
+ vocab = turn.vocab
108
+ return json.dumps({h["name"]: self.rng.choice(h["options"])["label"] for h in vocab.heads}), {"seconds": 0.0}
109
+
110
+ def describe(self):
111
+ return {"policy": self.name, "seed": self.seed}
environments/games/prototype/bossbench_llm/prompting.py ADDED
@@ -0,0 +1,236 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """System prompts for the LLM harness: Lumine format and semantic format, English only.
2
+
3
+ The Lumine-format prompt copies the Lumine / CPT system prompt (6 x 33 ms chunks, space-separated key names,
4
+ LB/RB mouse buttons) and appends what this game needs: the keys that do something here, what the mouse does, and
5
+ the boss's moves. Health bars and other status are not described: the model reads them from the screen.
6
+
7
+ Per-game text lives in prompts/games/<game>.json (schema bossbench-llm/game-prompt@1); the semantic action groups
8
+ are read live from the game's own declaration (semantic.Vocabulary). A prompt is a fixed concatenation of parts
9
+ (intro, format, game, boss, footer); the HTML page joins the same parts with the same separator.
10
+ """
11
+ from __future__ import annotations
12
+ import json
13
+ import os
14
+ import re
15
+ from functools import lru_cache
16
+ from pathlib import Path
17
+ from . import lumine
18
+ from .semantic import TERRARIA, Vocabulary
19
+ DATA = Path(os.environ.get('BOSSBENCH_LLM_PROMPTS') or Path(__file__).resolve().parent / 'prompts' / 'games')
20
+ SCHEMA = 'bossbench-llm/game-prompt@1'
21
+ SEP = '\n\n'
22
+ LANGS = ('en',)
23
+ FORMATS = ('lumine', 'semantic')
24
+
25
+ @lru_cache(maxsize=None)
26
+ def load_game(game):
27
+ path = DATA / f'{game}.json'
28
+ data = json.loads(path.read_text(encoding='utf-8'))
29
+ if data.get('schema') != SCHEMA or data.get('game') != game:
30
+ raise ValueError(f'{path}: not a {SCHEMA} file for {game}')
31
+ return data
32
+
33
+ def available_games():
34
+ return sorted((p.stem for p in DATA.glob('*.json')))
35
+
36
+ def scene(game_data, case_id):
37
+ for s in game_data['scenes']:
38
+ if s['case_id'] == case_id:
39
+ return s
40
+ raise KeyError(f"{case_id} not in {game_data['game']} prompt data")
41
+
42
+ def mouse_kind(game):
43
+ return load_game(game).get('mouse', {}).get('kind', 'none')
44
+
45
+ def _t(pair, lang):
46
+ if pair is None:
47
+ return ''
48
+ if isinstance(pair, str):
49
+ return pair
50
+ return (pair.get(lang) or pair.get('en') or pair.get('zh') or '').strip()
51
+
52
+ def _sentence(text, lang):
53
+ # Prompts are English only; lang is kept so existing callers do not change.
54
+ text = text.strip()
55
+ if text and text[-1] == ')' and text[-2:-1] not in '.!?':
56
+ text += '.'
57
+ elif text and text[-1] not in '.!?;:)"':
58
+ text += '.'
59
+ return text
60
+ _INTRO = {('lumine', 'zh'): 'You are an experienced PC game player, proficient in keyboard and mouse operations. You are playing "{title}". Based on the current game screen and the corresponding historical trajectory, plan the next 200ms of actions, consisting of 6 steps. Each step is spaced 33ms apart. Every step lasts 33ms from its start time until the next step begins.', ('lumine', 'en'): 'You are an experienced PC game player, proficient in keyboard and mouse operations. You are playing "{title}". Based on the current game screen and the corresponding historical trajectory, plan the next 200ms of actions, consisting of 6 steps. Each step is spaced 33ms apart. Every step lasts 33ms from its start time until the next step begins.', ('semantic', 'zh'): 'You are an experienced PC game player. You are playing "{title}". Based on the current game screen and the corresponding historical trajectory, choose the action for the next 200ms.', ('semantic', 'en'): 'You are an experienced PC game player. You are playing "{title}". Based on the current game screen and the corresponding historical trajectory, choose the action for the next 200ms.'}
61
+ _LUMINE_FORMAT = {'zh': '**Output Format**\n<|action_start|>X Y Z ; k1 k2 k3 ; k4 k5 ; k6 ; k7 ; k8 ; k9 k10<|action_end|>\n**Explanation**\n1. **Mouse Movement**: First, specify the relative displacement X, Y (X>0 means move right, Y>0 means move down) and scroll amount Z (Z>0 means scroll up). X and Y are integers in [-1000, 1000]; Z is an integer in [-5, 5].\n2. **Key Sequence**: Then list 6 groups of keys; within each group, keys are separated by spaces, and groups are separated by semicolons.\n- Each group can contain up to 4 keys.\n- If a group has no keys, leave it empty but keep the `;`.\n- A key listed in consecutive groups stays held down and is not pressed again; a key that is not listed is released.\n3. Only output a plain string that conforms to the above format — no line breaks and no quotation marks.\n**Key Naming Rules**\n- Letter keys: the capital letter, e.g., `W`, `A`.\n- Other keys (Space, Shift, etc.): the real key name with an initial capital letter, e.g., `Space`, `Shift`.\n- Mouse buttons: `LB` (left button), `RB` (right button).', 'en': '**Output Format**\n<|action_start|>X Y Z ; k1 k2 k3 ; k4 k5 ; k6 ; k7 ; k8 ; k9 k10<|action_end|>\n**Explanation**\n1. **Mouse Movement**: First, specify the relative displacement X, Y (X>0 means move right, Y>0 means move down) and scroll amount Z (Z>0 means scroll up). X and Y are integers in [-1000, 1000]; Z is an integer in [-5, 5].\n2. **Key Sequence**: Then list 6 groups of keys; within each group, keys are separated by spaces, and groups are separated by semicolons.\n- Each group can contain up to 4 keys.\n- If a group has no keys, leave it empty but keep the `;`.\n- A key listed in consecutive groups stays held down and is not pressed again; a key that is not listed is released.\n3. Only output a plain string that conforms to the above format — no line breaks and no quotation marks.\n**Key Naming Rules**\n- Letter keys: the capital letter, e.g., `W`, `A`.\n- Other keys (Space, Shift, etc.): the real key name with an initial capital letter, e.g., `Space`, `Shift`.\n- Mouse buttons: `LB` (left button), `RB` (right button).'}
62
+ _THINKING = {('lumine', 'zh'): '**Reasoning (optional)**: when the situation changes (a new attack starts, your plan fails), you may first write a short thought as <|thought_start|>your reasoning<|thought_end|> and then the action; otherwise output only the action.', ('lumine', 'en'): '**Reasoning (optional)**: when the situation changes (a new attack starts, your plan fails), you may first write a short thought as <|thought_start|>your reasoning<|thought_end|> and then the action; otherwise output only the action.', ('semantic', 'zh'): '**Reasoning (optional)**: when the situation changes, you may write a short thought as <|thought_start|>your reasoning<|thought_end|> before the JSON; otherwise output only the JSON.', ('semantic', 'en'): '**Reasoning (optional)**: when the situation changes, you may write a short thought as <|thought_start|>your reasoning<|thought_end|> before the JSON; otherwise output only the JSON.'}
63
+
64
+ def _semantic_example(vocab):
65
+ if vocab.game == TERRARIA:
66
+ return '{"move": "left", "vert": "jump", "attack": "shoot 135"}'
67
+ pick = {}
68
+ for h in vocab.heads[:2]:
69
+ pick[h['name']] = h['options'][min(1, len(h['options']) - 1)]['label']
70
+ return json.dumps(pick, ensure_ascii=False)
71
+
72
+ def _option_text(game_data, vocab, head, option, lang):
73
+ if lang == 'zh':
74
+ return option.get('zh') or option['label']
75
+ glossary = game_data.get('compact_glossary', {}).get(head['name'], {}).get('options', {})
76
+ return glossary.get(option['label']) or option.get('en') or option['label'].replace('_', ' ')
77
+
78
+ def _head_text(game_data, head, lang):
79
+ if lang == 'zh':
80
+ return head.get('zh') or head['name']
81
+ return game_data.get('compact_glossary', {}).get(head['name'], {}).get('en') or head.get('en') or head['name']
82
+
83
+ def _semantic_format(game_data, vocab, lang):
84
+ zh = lang == 'zh'
85
+ lines = ['**Output Format**', 'Output one JSON object on a single line that picks one option for each action group, for example:', _semantic_example(vocab)]
86
+ lines += ['- All groups act at the same time, for the next 200ms.', '- A group you leave out takes its first option (none = do nothing).', '- Use the option names exactly as listed; do not output option indices or any other text.']
87
+ lines.append('**Action groups**')
88
+ for head in vocab.heads:
89
+ if vocab.game == TERRARIA and head['name'] == 'attack':
90
+ opts = [o for o in head['options'] if not o['label'].startswith('shoot ')]
91
+ shoot = '`shoot <angle>` (shoot an arrow toward that angle; integer degrees 0-359, 0° = right, 90° = up, rounded to multiples of 22.5°)'
92
+ items = [f"`{o['label']}` ({_option_text(game_data, vocab, head, o, lang)})" for o in opts[:1]]
93
+ items.append(shoot)
94
+ items += [f"`{o['label']}` ({_option_text(game_data, vocab, head, o, lang)})" for o in opts[1:]]
95
+ else:
96
+ items = [f"`{o['label']}` ({_option_text(game_data, vocab, head, o, lang)})" for o in head['options']]
97
+ sep = '; '
98
+ lines.append(f"- `{head['name']}` ({_head_text(game_data, head, lang)}): " + sep.join(items))
99
+ return '\n'.join(lines)
100
+ _DEG = re.compile('(\\d+(?:\\.\\d+)?)\\s*°')
101
+
102
+ def _camera_sign(vocab):
103
+ """+1 when X > 0 turns the view right (normal), -1 when this game turns it left; None if unknown."""
104
+ if vocab is None:
105
+ return None
106
+ for h in vocab.heads:
107
+ for o in h['options']:
108
+ dx = o.get('dx', 0)
109
+ if dx:
110
+ label = (o['label'] + ' ' + (o.get('zh') or '')).lower()
111
+ left = 'left' in label or 'left' in label
112
+ right = 'right' in label or 'right' in label
113
+ if left != right:
114
+ return 1 if (dx < 0) == left else -1
115
+ return None
116
+
117
+ def _deg_per_count(vocab):
118
+ """Degrees per mouse count from the game's own semantic options ("turn left 10 degrees" with dx -152), or None."""
119
+ if vocab is None:
120
+ return None
121
+ best = None
122
+ for h in vocab.heads:
123
+ for o in h['options']:
124
+ dx, text = (o.get('dx', 0), o.get('zh') or '')
125
+ m = _DEG.search(text)
126
+ if dx and m and ('lock' not in text) and ('look down' not in text) and ('look up' not in text):
127
+ rate = float(m.group(1)) / abs(dx)
128
+ if best is None or abs(dx) > best[0]:
129
+ best = (abs(dx), rate)
130
+ return best[1] if best else None
131
+
132
+ def _mouse_line(game_data, vocab, lang):
133
+ m = game_data.get('mouse', {})
134
+ kind, zh = (m.get('kind', 'none'), lang == 'zh')
135
+ extra = _t(m, lang)
136
+ if kind == 'none':
137
+ return '- Mouse: not used in this game; write X Y Z as 0 0 0.'
138
+ if kind == 'pointer':
139
+ base = '- Mouse: X/Y move the crosshair; X = 1000 moves it one full screen width to the right, Y = 1000 one full screen height down.'
140
+ return base + (' ' + _sentence(extra, lang) if extra else '')
141
+ deg = _deg_per_count(vocab) or m.get('deg_per_count_x')
142
+ sign = _camera_sign(vocab)
143
+ if deg:
144
+ x = round(10 / float(deg))
145
+ right = (sign or 1) > 0
146
+ base = f"- Mouse: X/Y turn the view; X = {x} turns about 10° to the {('right' if right else 'left')}" + (' (note: in this game X > 0 turns LEFT)' if not right else '') + '.'
147
+ else:
148
+ base = '- Mouse: X/Y turn the view.'
149
+ return base + (' ' + _sentence(extra, lang) if extra else '')
150
+
151
+ def game_block(game, fmt, lang):
152
+ data, zh = (load_game(game), lang == 'zh')
153
+ vocab = None
154
+ if fmt == 'semantic' or data.get('mouse', {}).get('kind') == 'camera':
155
+ try:
156
+ vocab = Vocabulary.for_game(game)
157
+ except (FileNotFoundError, ValueError):
158
+ if fmt == 'semantic':
159
+ raise
160
+ lines = ['**Game**']
161
+ for key in ('view', 'goal'):
162
+ if data.get(key):
163
+ lines.append(_sentence(_t(data[key], lang), lang))
164
+ if fmt == 'lumine':
165
+ lines.append('**Controls** (only these keys do anything in this game)')
166
+ for k in data['keys']:
167
+ name = lumine.FROM_BOSSBENCH.get(k['key'], k['key'])
168
+ lines.append(f'- `{name}`: {_t(k, lang)}')
169
+ lines.append(_mouse_line(data, vocab, lang))
170
+ notes = [n for n in data.get('notes', []) if _t(n, lang)]
171
+ if notes:
172
+ lines.append('**Mechanics**')
173
+ lines += [f'- {_sentence(_t(n, lang), lang)}' for n in notes]
174
+ return '\n'.join(lines)
175
+
176
+ def boss_block(game, case_id, lang, counters=False):
177
+ s, zh = (scene(load_game(game), case_id), lang == 'zh')
178
+ lines = [f"**Boss: {_t(s['boss'], lang)}**"]
179
+ if s.get('summary'):
180
+ lines.append(_sentence(_t(s['summary'], lang), lang))
181
+ lines.append('Moves:')
182
+ for i, mv in enumerate(s['moves'], 1):
183
+ body = ' '.join((x for x in (_sentence(_t(mv.get('tell'), lang), lang), _sentence(_t(mv.get('effect'), lang), lang)) if x))
184
+ tag = _t(mv.get('only'), lang)
185
+ name = f"{_t(mv['name'], lang)} [{tag}]" if tag else _t(mv['name'], lang)
186
+ line = f'{i}. {name}: {body}'
187
+ if counters and _t(mv.get('counter'), lang):
188
+ line += f" How to deal with it: {_sentence(_t(mv['counter'], lang), lang)}"
189
+ lines.append(line)
190
+ phases = [p for p in s.get('phases', []) if _t(p, lang)]
191
+ if phases:
192
+ lines.append('Phases:')
193
+ lines += [f'- {_sentence(_t(p, lang), lang)}' for p in phases]
194
+ return '\n'.join(lines)
195
+ FOOTER = {'zh': 'Health bars and other status are shown on the screen; read them yourself.', 'en': 'Health bars and other status are shown on the screen; read them yourself.'}
196
+
197
+ def parts(game, case_id, fmt='lumine', lang='en', *, thinking=False, counters=False):
198
+ """The prompt as ordered parts; system_prompt() joins them with SEP. The HTML page uses the same parts."""
199
+ if fmt not in FORMATS or lang not in LANGS:
200
+ raise ValueError(f'fmt must be one of {FORMATS}, lang one of {LANGS}')
201
+ data = load_game(game)
202
+ intro = _INTRO[fmt, lang].format(title=_t(data['title'], lang))
203
+ if fmt == 'lumine':
204
+ fmt_text = _LUMINE_FORMAT[lang]
205
+ else:
206
+ fmt_text = _semantic_format(data, Vocabulary.for_game(game), lang)
207
+ if thinking:
208
+ fmt_text += '\n' + _THINKING[fmt, lang]
209
+ return [intro + '\n' + fmt_text, game_block(game, fmt, lang), boss_block(game, case_id, lang, counters), FOOTER[lang]]
210
+
211
+ def system_prompt(game, case_id, fmt='lumine', lang='en', *, thinking=False, counters=False):
212
+ return SEP.join(parts(game, case_id, fmt, lang, thinking=thinking, counters=counters))
213
+
214
+ def lumine_keys(game):
215
+ """Lumine key names this game binds (for the random baseline and the docs)."""
216
+ return [lumine.FROM_BOSSBENCH[k['key']] for k in load_game(game)['keys'] if k['key'] in lumine.FROM_BOSSBENCH]
217
+
218
+ def main(argv=None):
219
+ """python -m bossbench_llm.prompting --case terraria/king_slime --format lumine --lang zh [--thinking] [--counters]"""
220
+ import argparse
221
+ import sys
222
+ from bossbench.scope import POLICY_CASES
223
+ p = argparse.ArgumentParser(prog='python -m bossbench_llm.prompting', description='print a system prompt')
224
+ p.add_argument('--case', required=True)
225
+ p.add_argument('--format', choices=FORMATS, default='lumine')
226
+ p.add_argument('--lang', choices=LANGS, default='en')
227
+ p.add_argument('--thinking', action='store_true')
228
+ p.add_argument('--counters', action='store_true')
229
+ args = p.parse_args(argv)
230
+ if hasattr(sys.stdout, 'reconfigure'):
231
+ sys.stdout.reconfigure(encoding='utf-8')
232
+ game = POLICY_CASES[args.case]['game']
233
+ print(system_prompt(game, args.case, args.format, args.lang, thinking=args.thinking, counters=args.counters))
234
+ return 0
235
+ if __name__ == '__main__':
236
+ raise SystemExit(main())
environments/games/prototype/bossbench_llm/prompts/games/battlecity_remake.json ADDED
@@ -0,0 +1,423 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "schema": "bossbench-llm/game-prompt@1",
3
+ "game": "battlecity_remake",
4
+ "rules": "battlecity-nes-rom-20261102-r6",
5
+ "title": {
6
+ "en": "Top-Down Tank Battle: Defend the Eagle Base"
7
+ },
8
+ "dimension": "2d",
9
+ "view": {
10
+ "en": "Top-down 2D grid battlefield with brick, steel, water, ice and forest terrain. You drive a player tank, and the eagle base at the bottom must be protected; the side panel shows remaining enemy tanks and your lives"
11
+ },
12
+ "goal": {
13
+ "en": "Destroy every enemy tank to clear the stage (10 on easy, 20 on medium, 60 on hard). Protect the eagle base at the bottom: any shell, including your own, that hits it is an instant loss; losing all lives also loses (4 on easy, 3 on medium, 2 on hard). Lives do not regenerate except via the extra-life pickup"
14
+ },
15
+ "mouse": {
16
+ "kind": "none",
17
+ "en": ""
18
+ },
19
+ "keys": [
20
+ {
21
+ "key": "W",
22
+ "en": "Drive up"
23
+ },
24
+ {
25
+ "key": "A",
26
+ "en": "Drive left"
27
+ },
28
+ {
29
+ "key": "S",
30
+ "en": "Drive down"
31
+ },
32
+ {
33
+ "key": "D",
34
+ "en": "Drive right"
35
+ },
36
+ {
37
+ "key": "J",
38
+ "en": "Fire"
39
+ },
40
+ {
41
+ "key": "K",
42
+ "en": "Fire (same as J)"
43
+ },
44
+ {
45
+ "key": "Space",
46
+ "en": "Fire (same as J)"
47
+ },
48
+ {
49
+ "key": "LMB",
50
+ "en": "Fire (same as J)"
51
+ }
52
+ ],
53
+ "notes": [
54
+ {
55
+ "en": "The tank moves in four directions only; with several direction keys held, only one is used (right > left > down > up); perpendicular turns snap to the 8px grid."
56
+ },
57
+ {
58
+ "en": "Each shot needs a fresh key press; holding does not auto-fire. Only one of your shells can be on the field at first, two from two stars."
59
+ },
60
+ {
61
+ "en": "Brick, steel, water, the base and other tanks block movement; water blocks tanks but not shells; forest hides tanks but not shells; on ice you slide in a locked direction after starting."
62
+ },
63
+ {
64
+ "en": "Each shot removes one layer of brick; only three-star shells break steel; never fire toward your own base."
65
+ },
66
+ {
67
+ "en": "Flashing red tanks drop pickups when hit: star (upgrade), shield (invulnerable about 10.7 s), fortify (base wall becomes steel), freeze (enemies halt), blast (destroys all enemies on screen), extra life."
68
+ },
69
+ {
70
+ "en": "Four enemy types: light, swift (fast), long-gun (strong shells) and heavy (four hits, colour changes with armour)."
71
+ }
72
+ ],
73
+ "compact_glossary": {
74
+ "move": {
75
+ "en": "Tank driving, one 200 ms packet (12 frames) per action",
76
+ "options": {
77
+ "none": "stand still",
78
+ "up": "drive up all 12 frames",
79
+ "down": "drive down all 12 frames",
80
+ "left": "drive left all 12 frames",
81
+ "right": "drive right all 12 frames",
82
+ "face_up": "turn to face up only (first sub-step, no travel)",
83
+ "up_early": "drive up for sub-steps 1-3 then stop",
84
+ "up_late": "drive up for sub-steps 4-6 only",
85
+ "face_down": "turn to face down only (first sub-step, no travel)",
86
+ "down_early": "drive down for sub-steps 1-3 then stop",
87
+ "down_late": "drive down for sub-steps 4-6 only",
88
+ "face_left": "turn to face left only (first sub-step, no travel)",
89
+ "left_early": "drive left for sub-steps 1-3 then stop",
90
+ "left_late": "drive left for sub-steps 4-6 only",
91
+ "face_right": "turn to face right only (first sub-step, no travel)",
92
+ "right_early": "drive right for sub-steps 1-3 then stop",
93
+ "right_late": "drive right for sub-steps 4-6 only",
94
+ "up_then_left_1": "drive up for 1 sub-steps, then turn and drive left",
95
+ "up_then_left_2": "drive up for 2 sub-steps, then turn and drive left",
96
+ "up_then_left_3": "drive up for 3 sub-steps, then turn and drive left",
97
+ "up_then_left_4": "drive up for 4 sub-steps, then turn and drive left",
98
+ "up_then_left_5": "drive up for 5 sub-steps, then turn and drive left",
99
+ "up_then_right_1": "drive up for 1 sub-steps, then turn and drive right",
100
+ "up_then_right_2": "drive up for 2 sub-steps, then turn and drive right",
101
+ "up_then_right_3": "drive up for 3 sub-steps, then turn and drive right",
102
+ "up_then_right_4": "drive up for 4 sub-steps, then turn and drive right",
103
+ "up_then_right_5": "drive up for 5 sub-steps, then turn and drive right",
104
+ "down_then_left_1": "drive down for 1 sub-steps, then turn and drive left",
105
+ "down_then_left_2": "drive down for 2 sub-steps, then turn and drive left",
106
+ "down_then_left_3": "drive down for 3 sub-steps, then turn and drive left",
107
+ "down_then_left_4": "drive down for 4 sub-steps, then turn and drive left",
108
+ "down_then_left_5": "drive down for 5 sub-steps, then turn and drive left",
109
+ "down_then_right_1": "drive down for 1 sub-steps, then turn and drive right",
110
+ "down_then_right_2": "drive down for 2 sub-steps, then turn and drive right",
111
+ "down_then_right_3": "drive down for 3 sub-steps, then turn and drive right",
112
+ "down_then_right_4": "drive down for 4 sub-steps, then turn and drive right",
113
+ "down_then_right_5": "drive down for 5 sub-steps, then turn and drive right",
114
+ "left_then_up_1": "drive left for 1 sub-steps, then turn and drive up",
115
+ "left_then_up_2": "drive left for 2 sub-steps, then turn and drive up",
116
+ "left_then_up_3": "drive left for 3 sub-steps, then turn and drive up",
117
+ "left_then_up_4": "drive left for 4 sub-steps, then turn and drive up",
118
+ "left_then_up_5": "drive left for 5 sub-steps, then turn and drive up",
119
+ "left_then_down_1": "drive left for 1 sub-steps, then turn and drive down",
120
+ "left_then_down_2": "drive left for 2 sub-steps, then turn and drive down",
121
+ "left_then_down_3": "drive left for 3 sub-steps, then turn and drive down",
122
+ "left_then_down_4": "drive left for 4 sub-steps, then turn and drive down",
123
+ "left_then_down_5": "drive left for 5 sub-steps, then turn and drive down",
124
+ "right_then_up_1": "drive right for 1 sub-steps, then turn and drive up",
125
+ "right_then_up_2": "drive right for 2 sub-steps, then turn and drive up",
126
+ "right_then_up_3": "drive right for 3 sub-steps, then turn and drive up",
127
+ "right_then_up_4": "drive right for 4 sub-steps, then turn and drive up",
128
+ "right_then_up_5": "drive right for 5 sub-steps, then turn and drive up",
129
+ "right_then_down_1": "drive right for 1 sub-steps, then turn and drive down",
130
+ "right_then_down_2": "drive right for 2 sub-steps, then turn and drive down",
131
+ "right_then_down_3": "drive right for 3 sub-steps, then turn and drive down",
132
+ "right_then_down_4": "drive right for 4 sub-steps, then turn and drive down",
133
+ "right_then_down_5": "drive right for 5 sub-steps, then turn and drive down"
134
+ }
135
+ },
136
+ "fire": {
137
+ "en": "Fire button taps within the packet",
138
+ "options": {
139
+ "none": "no firing",
140
+ "fire": "press fire on sub-steps 1/3/5",
141
+ "fire_odd": "press fire on sub-steps 2/4/6 (pairs with turning)"
142
+ }
143
+ }
144
+ },
145
+ "scenes": [
146
+ {
147
+ "case_id": "battlecity/brick_front",
148
+ "boss": {
149
+ "en": "Brick Lane Front"
150
+ },
151
+ "summary": {
152
+ "en": "A brick-heavy open field with the base at the bottom; enemy tanks spawn from three points along the top."
153
+ },
154
+ "moves": [
155
+ {
156
+ "id": "wave",
157
+ "name": {
158
+ "en": "Enemy tank waves"
159
+ },
160
+ "tell": {
161
+ "en": "The left, middle and right spawn points at the top flash in turn; up to four tanks are on the field."
162
+ },
163
+ "effect": {
164
+ "en": "Enemy tanks shoot at you or the eagle base; a hit on your tank costs a life and a hit on the base is an instant loss."
165
+ },
166
+ "counter": {
167
+ "en": "Each shot chips only one layer of brick; line up on the spawn points at the lane mouths in advance, and never fire toward the base."
168
+ }
169
+ },
170
+ {
171
+ "id": "powerup",
172
+ "name": {
173
+ "en": "Flashing carrier and pickups"
174
+ },
175
+ "tell": {
176
+ "en": "The 4th, 11th and 18th tanks flash red."
177
+ },
178
+ "effect": {
179
+ "en": "Does no damage; shooting a flashing tank drops a pickup that you collect by driving onto it."
180
+ },
181
+ "counter": {
182
+ "en": "Fortify turns the base brick wall to steel for about 21 seconds; stars give speed, twin shots, then steel-breaking."
183
+ }
184
+ }
185
+ ],
186
+ "phases": [
187
+ {
188
+ "en": "Tanks get more aggressive over time: on medium they hunt you after about 26 s and rush the base after about 50 s; on hard after about 7 s and 14 s."
189
+ }
190
+ ]
191
+ },
192
+ {
193
+ "case_id": "battlecity/jungle_ambush",
194
+ "boss": {
195
+ "en": "Jungle Ambush"
196
+ },
197
+ "summary": {
198
+ "en": "Dense forest hides tanks and shells; swift tanks make up over half the wave; a steel block above the base stops shells."
199
+ },
200
+ "moves": [
201
+ {
202
+ "id": "wave",
203
+ "name": {
204
+ "en": "Enemy tank waves"
205
+ },
206
+ "tell": {
207
+ "en": "Tanks are hidden in the forest; swift tanks move fast and dash out of the trees."
208
+ },
209
+ "effect": {
210
+ "en": "Enemy tanks shoot at you or the eagle base; a hit on your tank costs a life and a hit on the base is an instant loss."
211
+ },
212
+ "counter": {
213
+ "en": "Hold the clearing exits and shoot swift tanks as they leave the trees; enemies mostly circle down the side forests."
214
+ }
215
+ },
216
+ {
217
+ "id": "powerup",
218
+ "name": {
219
+ "en": "Flashing carrier and pickups"
220
+ },
221
+ "tell": {
222
+ "en": "The 4th, 11th and 18th tanks flash red (swift, light, swift)."
223
+ },
224
+ "effect": {
225
+ "en": "Does no damage; shooting a flashing tank drops a pickup that you collect by driving onto it."
226
+ },
227
+ "counter": {
228
+ "en": "Freeze lasts about 10.7 seconds; use it to clear tanks hiding in the forest."
229
+ }
230
+ }
231
+ ],
232
+ "phases": [
233
+ {
234
+ "en": "On easy and medium enemies hunt you after about 13 s and rush the base after about 26 s; on hard after about 7 s and 14 s."
235
+ }
236
+ ]
237
+ },
238
+ {
239
+ "case_id": "battlecity/river_delta",
240
+ "boss": {
241
+ "en": "River Delta"
242
+ },
243
+ "summary": {
244
+ "en": "Two north-south rivers split the field into three lanes, crossable only at three fords; shells fly over water."
245
+ },
246
+ "moves": [
247
+ {
248
+ "id": "wave",
249
+ "name": {
250
+ "en": "Enemy tank waves"
251
+ },
252
+ "tell": {
253
+ "en": "Long-gun tanks fire across the rivers from the side lanes; enemies cross at the fords."
254
+ },
255
+ "effect": {
256
+ "en": "Enemy tanks shoot at you or the eagle base; a hit on your tank costs a life and a hit on the base is an instant loss."
257
+ },
258
+ "counter": {
259
+ "en": "Hold the middle brick island and shoot across the water; the fords are chokepoints."
260
+ }
261
+ },
262
+ {
263
+ "id": "powerup",
264
+ "name": {
265
+ "en": "Flashing carrier and pickups"
266
+ },
267
+ "tell": {
268
+ "en": "The 4th, 11th and 18th tanks flash red (light, long-gun, swift)."
269
+ },
270
+ "effect": {
271
+ "en": "Does no damage; shooting a flashing tank drops a pickup that you collect by driving onto it."
272
+ },
273
+ "counter": {
274
+ "en": "Fortify turns the base wall to steel for about 21 seconds; stars give speed, twin shots, then steel-breaking."
275
+ }
276
+ }
277
+ ],
278
+ "phases": [
279
+ {
280
+ "en": "On easy and medium enemies hunt you after about 17 s and rush the base after about 34 s; on hard after about 7 s and 14 s."
281
+ }
282
+ ]
283
+ },
284
+ {
285
+ "case_id": "battlecity/river_ice",
286
+ "boss": {
287
+ "en": "Ice River Woods"
288
+ },
289
+ "summary": {
290
+ "en": "Ice, water and forest mixed; forest hides tanks but shells still fly."
291
+ },
292
+ "moves": [
293
+ {
294
+ "id": "wave",
295
+ "name": {
296
+ "en": "Enemy tank waves"
297
+ },
298
+ "tell": {
299
+ "en": "On ice a tank locks its direction and slides after starting; tanks in woods are hidden."
300
+ },
301
+ "effect": {
302
+ "en": "Enemy tanks shoot at you or the eagle base; a hit on your tank costs a life and a hit on the base is an instant loss."
303
+ },
304
+ "counter": {
305
+ "en": "Release keys early to avoid sliding too far; guard the ice lane above the base."
306
+ }
307
+ },
308
+ {
309
+ "id": "powerup",
310
+ "name": {
311
+ "en": "Flashing carrier and pickups"
312
+ },
313
+ "tell": {
314
+ "en": "A flashing carrier drops a pickup at one of 16 fixed points when hit."
315
+ },
316
+ "effect": {
317
+ "en": "Does no damage; shooting a flashing tank drops a pickup that you collect by driving onto it."
318
+ },
319
+ "counter": {
320
+ "en": "Freeze and shield each last about 10.7 seconds and help you push through the woods."
321
+ }
322
+ }
323
+ ],
324
+ "phases": [
325
+ {
326
+ "en": "On easy and medium enemies hunt you after about 11 s and rush the base after about 21 s; on hard after about 7 s and 14 s."
327
+ }
328
+ ]
329
+ },
330
+ {
331
+ "case_id": "battlecity/steel_fort",
332
+ "boss": {
333
+ "en": "Steel Fortress"
334
+ },
335
+ "summary": {
336
+ "en": "A fortress of steel walls and water; swift tanks open, followed by heavy tanks."
337
+ },
338
+ "moves": [
339
+ {
340
+ "id": "wave",
341
+ "name": {
342
+ "en": "Enemy tank waves"
343
+ },
344
+ "tell": {
345
+ "en": "Swift tanks open, then heavy tanks that take four hits and change colour as armour drops."
346
+ },
347
+ "effect": {
348
+ "en": "Enemy tanks shoot at you or the eagle base; a hit on your tank costs a life and a hit on the base is an instant loss."
349
+ },
350
+ "counter": {
351
+ "en": "Water blocks tanks but not shells, so shoot across it; only three-star shells break steel."
352
+ }
353
+ },
354
+ {
355
+ "id": "powerup",
356
+ "name": {
357
+ "en": "Flashing carrier and pickups"
358
+ },
359
+ "tell": {
360
+ "en": "A flashing carrier drops a pickup when hit; a red heavy tank drops only on its first hit."
361
+ },
362
+ "effect": {
363
+ "en": "Does no damage; shooting a flashing tank drops a pickup that you collect by driving onto it."
364
+ },
365
+ "counter": {
366
+ "en": "At three stars you can shoot through steel to open shortcuts."
367
+ }
368
+ }
369
+ ],
370
+ "phases": [
371
+ {
372
+ "en": "On easy and medium enemies hunt you after about 12 s and rush the base after about 23 s; on hard after about 7 s and 14 s."
373
+ }
374
+ ]
375
+ },
376
+ {
377
+ "case_id": "battlecity/steel_maze",
378
+ "boss": {
379
+ "en": "Steel Maze"
380
+ },
381
+ "summary": {
382
+ "en": "A steel maze with only a few brick seams; the base has a steel roof, so enemies must reach the bottom two rows and hit the brick wall from the sides."
383
+ },
384
+ "moves": [
385
+ {
386
+ "id": "wave",
387
+ "name": {
388
+ "en": "Enemy tank waves"
389
+ },
390
+ "tell": {
391
+ "en": "Enemies circle to the bottom two rows and hit the base brick wall from left and right."
392
+ },
393
+ "effect": {
394
+ "en": "Enemy tanks shoot at you or the eagle base; a hit on your tank costs a life and a hit on the base is an instant loss."
395
+ },
396
+ "counter": {
397
+ "en": "Guard the two bottom-row corridors beside the base; three-star shells break steel for shortcuts."
398
+ }
399
+ },
400
+ {
401
+ "id": "powerup",
402
+ "name": {
403
+ "en": "Flashing carrier and pickups"
404
+ },
405
+ "tell": {
406
+ "en": "The 4th, 11th and 18th tanks flash red (long-gun, heavy, light); a red heavy tank drops only on its first hit."
407
+ },
408
+ "effect": {
409
+ "en": "Does no damage; shooting a flashing tank drops a pickup that you collect by driving onto it."
410
+ },
411
+ "counter": {
412
+ "en": "Shoot red tanks first for stars; at three stars the maze becomes straight roads."
413
+ }
414
+ }
415
+ ],
416
+ "phases": [
417
+ {
418
+ "en": "On easy and medium enemies hunt you after about 10 s and rush the base after about 19 s; on hard after about 7 s and 14 s."
419
+ }
420
+ ]
421
+ }
422
+ ]
423
+ }
environments/games/prototype/bossbench_llm/prompts/games/cuphead_remake.json ADDED
@@ -0,0 +1,668 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "schema": "bossbench-llm/game-prompt@1",
3
+ "game": "cuphead_remake",
4
+ "rules": "cuphead-tiers-v5",
5
+ "title": {
6
+ "en": "Side-scrolling shooter: boss fights (on foot and by plane)"
7
+ },
8
+ "dimension": "2d",
9
+ "view": {
10
+ "en": "Side-view 2D. You control a reel gunner, on foot or in a small plane for the flying scenes; your health and cards are shown at the bottom of the screen, and the boss's state is shown on screen; read the health bar yourself."
11
+ },
12
+ "goal": {
13
+ "en": "Empty the boss's health bar in its last phase to win (the screen shows 'A KNOCKOUT!'). You have 3 health points and lose when they run out; a timeout is not a win. Health does not regenerate."
14
+ },
15
+ "mouse": {
16
+ "kind": "none",
17
+ "en": "The mouse does not aim in this game; left and right click only duplicate fire and EX."
18
+ },
19
+ "keys": [
20
+ {
21
+ "key": "W",
22
+ "en": "ground: aim up; plane: fly up"
23
+ },
24
+ {
25
+ "key": "A",
26
+ "en": "left (run or fly)"
27
+ },
28
+ {
29
+ "key": "S",
30
+ "en": "ground: crouch / aim down (crouched shots go straight ahead); plane: fly down"
31
+ },
32
+ {
33
+ "key": "D",
34
+ "en": "right (run or fly)"
35
+ },
36
+ {
37
+ "key": "Space",
38
+ "en": "ground: jump, press again in the air to parry pink objects (bounce and gain 1 card); plane: parry pink objects any time"
39
+ },
40
+ {
41
+ "key": "Shift",
42
+ "en": "ground: dash (no invulnerability); plane: hold to shrink, smaller and faster but only short weak shots, no EX or super"
43
+ },
44
+ {
45
+ "key": "J",
46
+ "en": "hold to fire rapidly (plane default: auto gun)"
47
+ },
48
+ {
49
+ "key": "K",
50
+ "en": "EX move for 1 card; with 5 cards the super: a sweep ray on the ground, blast form in the plane"
51
+ },
52
+ {
53
+ "key": "L",
54
+ "en": "ground: hold to stand still and aim in 8 directions (cannot run)"
55
+ },
56
+ {
57
+ "key": "Q",
58
+ "en": "plane: swap auto gun and drop bombs (higher damage, slower, arcing fall)"
59
+ },
60
+ {
61
+ "key": "E",
62
+ "en": "release the super at 5 cards (same as K)"
63
+ },
64
+ {
65
+ "key": "LMB",
66
+ "en": "fire (same as J)"
67
+ },
68
+ {
69
+ "key": "RMB",
70
+ "en": "EX (same as K)"
71
+ }
72
+ ],
73
+ "notes": [
74
+ {
75
+ "en": "Four scenes are ground fights (seed bloom, bouncing blob, boxing frogs, garden trio) and two are plane fights (zodiac shifter, chick). Key meanings differ by scene; you play the reel gunner, on foot or in a plane."
76
+ },
77
+ {
78
+ "en": "Ground: W/S combined with A/D aims in 8 directions; crouching with S shoots straight ahead; holding L locks you in place, standing, unable to run."
79
+ },
80
+ {
81
+ "en": "Plane: W/A/S/D fly in 8 directions and L does nothing; Q swaps auto gun and drop bombs; holding Shift shrinks you, with no EX or super."
82
+ },
83
+ {
84
+ "en": "Pink objects can be parried: on the ground press jump (Space) again in the air, in the plane press Space any time; each parry gives 1 card, each card powers one EX, and 5 cards give the super."
85
+ },
86
+ {
87
+ "en": "Super: on the ground a horizontal sweep ray; in the plane a blast form that explodes on contact or timeout, followed by about 3 seconds of invulnerability."
88
+ },
89
+ {
90
+ "en": "Dash gives no invulnerability, so do not dash through attacks. You are briefly invulnerable after being hit."
91
+ },
92
+ {
93
+ "en": "In the action options, a sub-step is one of six slices of a 200 ms packet; jump, parry and dash only count on a new press, which is why options differ in press timing."
94
+ }
95
+ ],
96
+ "compact_glossary": {
97
+ "move": {
98
+ "en": "Movement and aiming; every option except none also holds shoot. On the ground W/S aim up/down and S crouches; in the plane W/S fly.",
99
+ "options": {
100
+ "none": "no movement, no shooting",
101
+ "fire": "stand and shoot",
102
+ "right": "move/aim right while shooting",
103
+ "right_short": "move/aim right for the first 2 sub-steps only, shooting",
104
+ "up_right": "move/aim up-right while shooting",
105
+ "up_right_short": "move/aim up-right for the first 2 sub-steps only, shooting",
106
+ "up": "move/aim up while shooting",
107
+ "up_short": "move/aim up for the first 2 sub-steps only, shooting",
108
+ "up_left": "move/aim up-left while shooting",
109
+ "up_left_short": "move/aim up-left for the first 2 sub-steps only, shooting",
110
+ "left": "move/aim left while shooting",
111
+ "left_short": "move/aim left for the first 2 sub-steps only, shooting",
112
+ "down_left": "move/aim down-left while shooting",
113
+ "down_left_short": "move/aim down-left for the first 2 sub-steps only, shooting",
114
+ "down": "move/aim down while shooting",
115
+ "down_short": "move/aim down for the first 2 sub-steps only, shooting",
116
+ "down_right": "move/aim down-right while shooting",
117
+ "down_right_short": "move/aim down-right for the first 2 sub-steps only, shooting",
118
+ "left_turn_1": "run left 1 sub-step(s) then turn to face right, shooting",
119
+ "right_turn_1": "run right 1 sub-step(s) then turn to face left, shooting",
120
+ "left_turn_2": "run left 2 sub-step(s) then turn to face right, shooting",
121
+ "right_turn_2": "run right 2 sub-step(s) then turn to face left, shooting",
122
+ "left_turn_3": "run left 3 sub-step(s) then turn to face right, shooting",
123
+ "right_turn_3": "run right 3 sub-step(s) then turn to face left, shooting",
124
+ "left_turn_4": "run left 4 sub-step(s) then turn to face right, shooting",
125
+ "right_turn_4": "run right 4 sub-step(s) then turn to face left, shooting",
126
+ "left_turn_5": "run left 5 sub-step(s) then turn to face right, shooting",
127
+ "right_turn_5": "run right 5 sub-step(s) then turn to face left, shooting"
128
+ }
129
+ },
130
+ "act": {
131
+ "en": "Jump / parry / EX / dash / aim-lock / weapon swap, one key action per sub-step.",
132
+ "options": {
133
+ "none": "nothing",
134
+ "jump_tap": "jump (plane: parry), press in sub-step 1 only",
135
+ "jump": "jump (plane: parry), held 4 sub-steps",
136
+ "jump_hold_parry": "jump held 2 sub-steps, then hold for an air parry from sub-step 4",
137
+ "jump_parry": "jump, then air parry at sub-step 4",
138
+ "press_2": "press jump at sub-step 2",
139
+ "press_3": "press jump at sub-step 3 (air parry timing)",
140
+ "press_4": "press jump at sub-step 4 (air parry timing)",
141
+ "press_5": "press jump at sub-step 5 (air parry timing)",
142
+ "lock_jump_parry": "hold aim-lock, jump, parry at sub-step 4",
143
+ "lock_jump": "hold aim-lock and jump",
144
+ "lock_press_4": "aim-lock, press jump at sub-step 4",
145
+ "lock_press_5": "aim-lock, press jump at sub-step 5",
146
+ "lock": "hold aim-lock (stand still, 8-way aim)",
147
+ "lock_from_2": "aim-lock from sub-step 2",
148
+ "lock_half": "aim-lock for the second half",
149
+ "lock_late": "aim-lock for the last two sub-steps",
150
+ "lock_end": "aim-lock at the last sub-step",
151
+ "ex": "EX shot (1 card; super at 5 cards)",
152
+ "dash": "dash (plane: hold to shrink)",
153
+ "dash_tap": "dash at sub-step 1",
154
+ "dash_2": "dash at sub-step 2",
155
+ "dash_3": "dash at sub-step 3",
156
+ "dash_mid": "dash at sub-step 4",
157
+ "dash_5": "dash at sub-step 5",
158
+ "dash_6": "dash at sub-step 6",
159
+ "jump_dash": "jump, then air dash at sub-step 4",
160
+ "jump3_dash6": "jump at sub-step 3, air dash at sub-step 6",
161
+ "swap": "plane: swap machine gun / drop bombs"
162
+ }
163
+ }
164
+ },
165
+ "scenes": [
166
+ {
167
+ "case_id": "cuphead/goopy",
168
+ "boss": {
169
+ "en": "Bouncing Blob"
170
+ },
171
+ "summary": {
172
+ "en": "Ground fight in a forest clearing: a blue blob bounces around, grows to throw punches, and finally drops tombstones."
173
+ },
174
+ "moves": [
175
+ {
176
+ "id": "bounce",
177
+ "name": {
178
+ "en": "Bounce"
179
+ },
180
+ "tell": {
181
+ "en": "It squashes down before each leap; small and big forms jump to different heights."
182
+ },
183
+ "effect": {
184
+ "en": "Landing on you deals 1 damage."
185
+ },
186
+ "counter": {
187
+ "en": "Track the landing spot and shoot it in the air; it rebounds off side walls."
188
+ }
189
+ },
190
+ {
191
+ "id": "punch",
192
+ "name": {
193
+ "en": "Punch"
194
+ },
195
+ "tell": {
196
+ "en": "It faces you and winds up; the giant form blinks before its first punch."
197
+ },
198
+ "effect": {
199
+ "en": "The fist deals 1 damage on hit."
200
+ },
201
+ "counter": {
202
+ "en": "Crouch under the punch; dash has no invulnerability."
203
+ }
204
+ },
205
+ {
206
+ "id": "transform",
207
+ "name": {
208
+ "en": "Transform"
209
+ },
210
+ "tell": {
211
+ "en": "It swallows a candy and three pink question marks appear."
212
+ },
213
+ "effect": {
214
+ "en": "Contact deals 1 damage."
215
+ },
216
+ "counter": {
217
+ "en": "Press jump again in the air to parry the pink marks; this is the only parry in this fight."
218
+ }
219
+ },
220
+ {
221
+ "id": "tombstone",
222
+ "name": {
223
+ "en": "Tombstone"
224
+ },
225
+ "tell": {
226
+ "en": "A tombstone slides back and forth in the background, then pauses."
227
+ },
228
+ "effect": {
229
+ "en": "Its slam deals 1 damage; the slide itself is harmless."
230
+ },
231
+ "counter": {
232
+ "en": "Leave the spot it has locked on to."
233
+ }
234
+ }
235
+ ],
236
+ "phases": [
237
+ {
238
+ "en": "Small form first, then big form, and tombstones join in the last phase."
239
+ }
240
+ ]
241
+ },
242
+ {
243
+ "case_id": "cuphead/root_pack",
244
+ "boss": {
245
+ "en": "Garden Trio"
246
+ },
247
+ "summary": {
248
+ "en": "Ground fight against three vegetables in turn: potato, onion, carrot; not attacking the onion for about six seconds leads to the hidden-radish branch."
249
+ },
250
+ "moves": [
251
+ {
252
+ "id": "dirt_worm",
253
+ "name": {
254
+ "en": "Dirt Worm"
255
+ },
256
+ "tell": {
257
+ "en": "The potato spits several dirt balls, the last one a pink worm."
258
+ },
259
+ "effect": {
260
+ "en": "Dirt balls deal 1 damage."
261
+ },
262
+ "counter": {
263
+ "en": "Jump over the balls; parry the pink worm in mid-air."
264
+ }
265
+ },
266
+ {
267
+ "id": "tears",
268
+ "name": {
269
+ "en": "Tears"
270
+ },
271
+ "tell": {
272
+ "en": "The onion cries once hit; pink tears are mixed into the rain."
273
+ },
274
+ "effect": {
275
+ "en": "Tears deal 1 damage."
276
+ },
277
+ "counter": {
278
+ "en": "Watch the drop points above; about six seconds without attacking enters the hidden-radish branch."
279
+ }
280
+ },
281
+ {
282
+ "id": "homing_carrots",
283
+ "name": {
284
+ "en": "Homing Carrots"
285
+ },
286
+ "tell": {
287
+ "en": "The big carrot in the background summons homing mini carrots."
288
+ },
289
+ "effect": {
290
+ "en": "Mini carrots deal 1 damage on contact; the big background body is harmless."
291
+ },
292
+ "counter": {
293
+ "en": "Shoot the mini carrots down; they take only a few hits."
294
+ }
295
+ },
296
+ {
297
+ "id": "eye_laser",
298
+ "name": {
299
+ "en": "Eye Rings"
300
+ },
301
+ "tell": {
302
+ "en": "The third eye charges up, then fires rings aimed at you."
303
+ },
304
+ "effect": {
305
+ "en": "Rings deal 1 damage."
306
+ },
307
+ "counter": {
308
+ "en": "Keep repositioning; three shots in regular mode, two in simple and expert."
309
+ }
310
+ }
311
+ ],
312
+ "phases": [
313
+ {
314
+ "en": "Potato, onion and carrot appear in order; a hidden-radish branch may follow."
315
+ }
316
+ ]
317
+ },
318
+ {
319
+ "case_id": "cuphead/hilda",
320
+ "boss": {
321
+ "en": "Zodiac Shifter"
322
+ },
323
+ "summary": {
324
+ "en": "Plane fight in the sky: the boss turns into a bull, twins and an archer in turn, ending with a moon phase."
325
+ },
326
+ "moves": [
327
+ {
328
+ "id": "laughter",
329
+ "name": {
330
+ "en": "Laughter"
331
+ },
332
+ "tell": {
333
+ "en": "In normal form it laughs and fires HA letters, then small planes enter."
334
+ },
335
+ "effect": {
336
+ "en": "The shots deal 1 damage."
337
+ },
338
+ "counter": {
339
+ "en": "Parry every fourth pink shot from purple planes; green fans cannot be parried."
340
+ }
341
+ },
342
+ {
343
+ "id": "horn_jab",
344
+ "name": {
345
+ "en": "Horn Jab"
346
+ },
347
+ "tell": {
348
+ "en": "The bull lines up with your height, pauses, then thrusts its horns."
349
+ },
350
+ "effect": {
351
+ "en": "The thrust deals 1 damage."
352
+ },
353
+ "counter": {
354
+ "en": "Dodge up or down once its height locks."
355
+ }
356
+ },
357
+ {
358
+ "id": "rotating_vortex",
359
+ "name": {
360
+ "en": "Rotating Vortex"
361
+ },
362
+ "tell": {
363
+ "en": "The twins summon rotating lines of bullets on your side."
364
+ },
365
+ "effect": {
366
+ "en": "Touching the lines deals 1 damage."
367
+ },
368
+ "counter": {
369
+ "en": "Stay clear of the lines and never cross the centre."
370
+ }
371
+ },
372
+ {
373
+ "id": "arrow_stars",
374
+ "name": {
375
+ "en": "Arrow and Stars"
376
+ },
377
+ "tell": {
378
+ "en": "The archer charges an arrow, then three blue stars follow."
379
+ },
380
+ "effect": {
381
+ "en": "The arrow or stars deal 1 damage."
382
+ },
383
+ "counter": {
384
+ "en": "The arrow keeps a fixed direction, so leave early; the blue stars can be shot down."
385
+ }
386
+ },
387
+ {
388
+ "id": "ufo_laser",
389
+ "name": {
390
+ "en": "UFO Laser"
391
+ },
392
+ "tell": {
393
+ "en": "In the moon phase a UFO slides sideways, changes colour, charges, then fires."
394
+ },
395
+ "effect": {
396
+ "en": "The laser deals 1 damage."
397
+ },
398
+ "counter": {
399
+ "en": "Red fires straight below you, gold fires ahead; shrink to slip through gaps."
400
+ }
401
+ }
402
+ ],
403
+ "phases": [
404
+ {
405
+ "en": "Normal form, bull, twins, archer, and finally the moon with the UFO."
406
+ }
407
+ ]
408
+ },
409
+ {
410
+ "case_id": "cuphead/cagney",
411
+ "boss": {
412
+ "en": "Seed Bloom"
413
+ },
414
+ "summary": {
415
+ "en": "Ground fight in a garden with an upper and lower platform layer; in phase two the floor grows thorns and vines block paths."
416
+ },
417
+ "moves": [
418
+ {
419
+ "id": "lunge",
420
+ "name": {
421
+ "en": "Lunge"
422
+ },
423
+ "tell": {
424
+ "en": "Its face and arms sweep along the upper platform or the lower floor."
425
+ },
426
+ "effect": {
427
+ "en": "Being swept deals 1 damage."
428
+ },
429
+ "counter": {
430
+ "en": "Jump up or leave the platform to switch layers."
431
+ }
432
+ },
433
+ {
434
+ "id": "hands",
435
+ "name": {
436
+ "en": "Magic Hands"
437
+ },
438
+ "tell": {
439
+ "en": "Magic hands launch boomerang sycamore seeds, or 3-4 acorns aimed at you."
440
+ },
441
+ "effect": {
442
+ "en": "Seeds or acorns deal 1 damage."
443
+ },
444
+ "counter": {
445
+ "en": "Switch layers against seeds; move before the acorns are thrown."
446
+ }
447
+ },
448
+ {
449
+ "id": "gatling",
450
+ "name": {
451
+ "en": "Seed Gatling"
452
+ },
453
+ "tell": {
454
+ "en": "The head becomes a gun spitting seeds: blue homes in, purple becomes a small plant on the floor, pink can be parried."
455
+ },
456
+ "effect": {
457
+ "en": "Seeds and plants deal 1 damage."
458
+ },
459
+ "counter": {
460
+ "en": "Shoot homing seeds; parry pink seeds and pink shots from floating flowers."
461
+ }
462
+ },
463
+ {
464
+ "id": "pollen",
465
+ "name": {
466
+ "en": "Pollen"
467
+ },
468
+ "tell": {
469
+ "en": "In phase two the floor grows thorns, dandelions drift by and vines intermittently block platforms."
470
+ },
471
+ "effect": {
472
+ "en": "Thorns, dandelions and vines deal 1 damage."
473
+ },
474
+ "counter": {
475
+ "en": "Stay on platforms; switch when a vine shows its growth warning."
476
+ }
477
+ }
478
+ ],
479
+ "phases": [
480
+ {
481
+ "en": "Phase two adds thorns, dandelions and vines."
482
+ }
483
+ ]
484
+ },
485
+ {
486
+ "case_id": "cuphead/ribby_croaks",
487
+ "boss": {
488
+ "en": "Boxing Frogs"
489
+ },
490
+ "summary": {
491
+ "en": "Ground fight: the left frog punches, the right frog spits fireflies, over three phases ending with a slot machine."
492
+ },
493
+ "moves": [
494
+ {
495
+ "id": "fists",
496
+ "name": {
497
+ "en": "Fists"
498
+ },
499
+ "tell": {
500
+ "en": "The left frog throws low, mid and high punch waves, some pink, going back and forth in phase one."
501
+ },
502
+ "effect": {
503
+ "en": "Punch waves deal 1 damage."
504
+ },
505
+ "counter": {
506
+ "en": "Jump or crouch under; pink punches can be parried."
507
+ }
508
+ },
509
+ {
510
+ "id": "firefly",
511
+ "name": {
512
+ "en": "Firefly"
513
+ },
514
+ "tell": {
515
+ "en": "The right frog spits fireflies that slowly close in."
516
+ },
517
+ "effect": {
518
+ "en": "Contact deals 1 damage."
519
+ },
520
+ "counter": {
521
+ "en": "One shot kills one."
522
+ }
523
+ },
524
+ {
525
+ "id": "roll",
526
+ "name": {
527
+ "en": "Roll"
528
+ },
529
+ "tell": {
530
+ "en": "At the end of a phase the left frog rolls along the floor across the arena."
531
+ },
532
+ "effect": {
533
+ "en": "Contact deals 1 damage."
534
+ },
535
+ "counter": {
536
+ "en": "Jump over it."
537
+ }
538
+ },
539
+ {
540
+ "id": "balls",
541
+ "name": {
542
+ "en": "Bouncing Balls"
543
+ },
544
+ "tell": {
545
+ "en": "In phase two the left frog slaps out three bouncing balls while the right frog turns and blows you toward it."
546
+ },
547
+ "effect": {
548
+ "en": "Balls deal 1 damage."
549
+ },
550
+ "counter": {
551
+ "en": "Run or dash against the wind and pass through gaps between balls."
552
+ }
553
+ },
554
+ {
555
+ "id": "slot",
556
+ "name": {
557
+ "en": "Slot Machine"
558
+ },
559
+ "tell": {
560
+ "en": "In phase three it spits coins first; the lever turns pink before it can be hurt; tiger, snake and bull spiked chip platforms."
561
+ },
562
+ "effect": {
563
+ "en": "Coins, spikes and fire deal 1 damage."
564
+ },
565
+ "counter": {
566
+ "en": "Parry the lever; jump over, stand on or dodge fire depending on the chip."
567
+ }
568
+ }
569
+ ],
570
+ "phases": [
571
+ {
572
+ "en": "Three phases: fists and fireflies, wind and balls, slot machine."
573
+ }
574
+ ]
575
+ },
576
+ {
577
+ "case_id": "cuphead/wally",
578
+ "boss": {
579
+ "en": "Chick"
580
+ },
581
+ "summary": {
582
+ "en": "Plane fight against a birdhouse; phase two is the chick's egg shield and phase three is a stretcher."
583
+ },
584
+ "moves": [
585
+ {
586
+ "id": "eggs",
587
+ "name": {
588
+ "en": "Eggs"
589
+ },
590
+ "tell": {
591
+ "en": "The birdhouse spits eggs that burst into fragments at the screen edge."
592
+ },
593
+ "effect": {
594
+ "en": "Fragments deal 1 damage."
595
+ },
596
+ "counter": {
597
+ "en": "Predict the fragment directions."
598
+ }
599
+ },
600
+ {
601
+ "id": "finger",
602
+ "name": {
603
+ "en": "Finger"
604
+ },
605
+ "tell": {
606
+ "en": "The head becomes a three-fingered hand and, after a delay, fires three big shots in a fan."
607
+ },
608
+ "effect": {
609
+ "en": "The shots deal 1 damage."
610
+ },
611
+ "counter": {
612
+ "en": "Move out of the fan centre during the wind-up."
613
+ }
614
+ },
615
+ {
616
+ "id": "whistle",
617
+ "name": {
618
+ "en": "Whistle"
619
+ },
620
+ "tell": {
621
+ "en": "A whistle scream, then flapping that fires feathers in eight directions; it rests when tired."
622
+ },
623
+ "effect": {
624
+ "en": "Feathers deal 1 damage."
625
+ },
626
+ "counter": {
627
+ "en": "Slip through feather gaps; focus fire while it rests."
628
+ }
629
+ },
630
+ {
631
+ "id": "chick_shield",
632
+ "name": {
633
+ "en": "Egg Shield"
634
+ },
635
+ "tell": {
636
+ "en": "In phase two spiked eggs orbit the chick, extend and retract and block bullets; electric shots are always pink."
637
+ },
638
+ "effect": {
639
+ "en": "Spiked eggs and electric shots deal 1 damage."
640
+ },
641
+ "counter": {
642
+ "en": "Shoot through gaps when eggs retract; parry the electric shots."
643
+ }
644
+ },
645
+ {
646
+ "id": "stretcher",
647
+ "name": {
648
+ "en": "Stretcher"
649
+ },
650
+ "tell": {
651
+ "en": "In phase three the stretcher spits junk (pink boots can be parried), a heart rises, and the nurse bird's pills split and home in."
652
+ },
653
+ "effect": {
654
+ "en": "Junk and pills deal 1 damage; only the heart can be hurt once it appears."
655
+ },
656
+ "counter": {
657
+ "en": "Use bombs from above or up close; shoot the heart when it appears."
658
+ }
659
+ }
660
+ ],
661
+ "phases": [
662
+ {
663
+ "en": "Three phases: birdhouse, chick egg shield, stretcher."
664
+ }
665
+ ]
666
+ }
667
+ ]
668
+ }
environments/games/prototype/bossbench_llm/prompts/games/doom_remake.json ADDED
@@ -0,0 +1,429 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "schema": "bossbench-llm/game-prompt@1",
3
+ "game": "doom_remake",
4
+ "rules": "doom-arena@11",
5
+ "title": {
6
+ "en": "First-Person Shooter: Hall Boss Fights"
7
+ },
8
+ "dimension": "3d",
9
+ "view": {
10
+ "en": "First-person 3D shooter: the crosshair is at the centre, your weapon is at the bottom, and the status bar shows ammo, health, armour and the current weapon. The arena is a hall with pillars and low walls, with medical, armour and ammo pickups on the floor. Your gunner can only turn left and right: no looking up or down, no jumping"
11
+ },
12
+ "goal": {
13
+ "en": "Defeat every boss in the arena to win; you lose if your health reaches zero; each fight lasts at most 300 seconds and a timeout is not a win. Health does not regenerate; only pickups restore it"
14
+ },
15
+ "mouse": {
16
+ "kind": "camera",
17
+ "en": "The mouse only turns the view left and right (X>0 turns right); there is no pitch"
18
+ },
19
+ "keys": [
20
+ {
21
+ "key": "W",
22
+ "en": "move forward"
23
+ },
24
+ {
25
+ "key": "S",
26
+ "en": "move backward"
27
+ },
28
+ {
29
+ "key": "A",
30
+ "en": "strafe left"
31
+ },
32
+ {
33
+ "key": "D",
34
+ "en": "strafe right"
35
+ },
36
+ {
37
+ "key": "Shift",
38
+ "en": "hold to run (about twice as fast)"
39
+ },
40
+ {
41
+ "key": "Q",
42
+ "en": "turn left"
43
+ },
44
+ {
45
+ "key": "E",
46
+ "en": "turn right"
47
+ },
48
+ {
49
+ "key": "J",
50
+ "en": "fire, hold for continuous fire"
51
+ },
52
+ {
53
+ "key": "LMB",
54
+ "en": "fire (same as J)"
55
+ },
56
+ {
57
+ "key": "K",
58
+ "en": "switch to the next weapon"
59
+ },
60
+ {
61
+ "key": "RMB",
62
+ "en": "switch to the next weapon (same as K)"
63
+ },
64
+ {
65
+ "key": "L",
66
+ "en": "switch to the previous weapon"
67
+ }
68
+ ],
69
+ "notes": [
70
+ {
71
+ "en": "Weapon order: shotgun, chaingun, plus a rocket launcher in scenes that have one. Switching lowers then raises the weapon, taking about a second during which you cannot fire"
72
+ },
73
+ {
74
+ "en": "Shots go along the line through the crosshair, so turn to face the enemy first. The shotgun hits hard but fires slowly, the chaingun fires fast, and the rocket launcher does heavy damage with a blast radius, so avoid firing it point-blank"
75
+ },
76
+ {
77
+ "en": "Fireballs and rockets are visible projectiles that you can dodge by strafing sideways; pillars and low walls block them and break line of sight"
78
+ },
79
+ {
80
+ "en": "You can fire and turn while running. Enemies on the field may hurt each other, and each pickup can be taken only once"
81
+ }
82
+ ],
83
+ "compact_glossary": {
84
+ "move": {
85
+ "en": "movement (run is always held)",
86
+ "options": {
87
+ "none": "stand still",
88
+ "forward": "run forward",
89
+ "back": "run backward",
90
+ "left": "strafe left",
91
+ "right": "strafe right",
92
+ "forward_left": "run forward-left",
93
+ "forward_right": "run forward-right",
94
+ "back_left": "run backward-left",
95
+ "back_right": "run backward-right"
96
+ }
97
+ },
98
+ "turn": {
99
+ "en": "horizontal turn by a fixed angle (no pitch)",
100
+ "options": {
101
+ "none": "do not turn",
102
+ "left_3": "turn left 3 degrees",
103
+ "right_3": "turn right 3 degrees",
104
+ "left_10": "turn left 10 degrees",
105
+ "right_10": "turn right 10 degrees",
106
+ "left_30": "turn left 30 degrees",
107
+ "right_30": "turn right 30 degrees",
108
+ "left_60": "turn left 60 degrees",
109
+ "right_60": "turn right 60 degrees"
110
+ }
111
+ },
112
+ "attack": {
113
+ "en": "fire or change weapon",
114
+ "options": {
115
+ "none": "do not fire",
116
+ "fire": "hold fire",
117
+ "fire_fresh": "release then press fire (a fresh trigger pull)",
118
+ "next_weapon": "switch to the next weapon",
119
+ "prev_weapon": "switch to the previous weapon"
120
+ }
121
+ }
122
+ },
123
+ "scenes": [
124
+ {
125
+ "case_id": "doom/cyberdemon",
126
+ "boss": {
127
+ "en": "Rocket Colossus"
128
+ },
129
+ "summary": {
130
+ "en": "A huge hooved rocket gunner alone at the far end of a pillared hall, attacking only at range. You have a shotgun, chaingun and rocket launcher"
131
+ },
132
+ "moves": [
133
+ {
134
+ "id": "rocket_volley",
135
+ "name": {
136
+ "en": "Triple rocket volley"
137
+ },
138
+ "tell": {
139
+ "en": "It aims an arm at you, then fires a rocket about every third of a second, three in total"
140
+ },
141
+ "effect": {
142
+ "en": "Rockets fly straight and explode on hitting you or a wall, hurting everything in the blast; the damage is high"
143
+ },
144
+ "counter": {
145
+ "en": "Strafe sideways or duck behind a pillar when you see the arm rise; rockets take time to arrive, so a step or two sideways misses"
146
+ }
147
+ },
148
+ {
149
+ "id": "pain_stagger",
150
+ "name": {
151
+ "en": "Hit stagger"
152
+ },
153
+ "tell": {
154
+ "en": "When hit it sometimes stops and flinches briefly"
155
+ },
156
+ "effect": {
157
+ "en": "It does not attack during the stagger, which interrupts what it was doing"
158
+ },
159
+ "counter": {
160
+ "en": "Keep firing during the stagger; heavy weapons trigger it more often"
161
+ }
162
+ }
163
+ ],
164
+ "phases": []
165
+ },
166
+ {
167
+ "case_id": "doom/barons",
168
+ "boss": {
169
+ "en": "Green-Flame Horned Fiends"
170
+ },
171
+ "summary": {
172
+ "en": "Two horned fiends with green flame appear together; they spit fireballs at range and claw up close. The hall is fairly open with a few pieces of cover"
173
+ },
174
+ "moves": [
175
+ {
176
+ "id": "fireball",
177
+ "name": {
178
+ "en": "Green fireball"
179
+ },
180
+ "tell": {
181
+ "en": "It stops facing you for about half a second, then throws a green fireball"
182
+ },
183
+ "effect": {
184
+ "en": "The fireball flies straight and does moderate damage on hit; both may fire at once"
185
+ },
186
+ "counter": {
187
+ "en": "Strafe sideways or hide behind a pillar; fireballs do not home"
188
+ }
189
+ },
190
+ {
191
+ "id": "claw",
192
+ "name": {
193
+ "en": "Claw swipe"
194
+ },
195
+ "tell": {
196
+ "en": "When you are right in front of it, it swipes instead of throwing a fireball"
197
+ },
198
+ "effect": {
199
+ "en": "Melee damage is very high and can take a large chunk of health in one hit"
200
+ },
201
+ "counter": {
202
+ "en": "Do not stand next to it; keep your distance and shoot while backing off"
203
+ }
204
+ },
205
+ {
206
+ "id": "fast_fireball",
207
+ "name": {
208
+ "en": "Fast fireball"
209
+ },
210
+ "tell": {
211
+ "en": "Looks like the normal fireball but flies noticeably faster"
212
+ },
213
+ "effect": {
214
+ "en": "Same damage, but you have less time to react"
215
+ },
216
+ "counter": {
217
+ "en": "Strafe earlier or take cover in advance"
218
+ },
219
+ "only": {
220
+ "en": "highest difficulty only"
221
+ }
222
+ }
223
+ ],
224
+ "phases": [
225
+ {
226
+ "en": "After one falls the other keeps attacking; both must be defeated to win"
227
+ }
228
+ ]
229
+ },
230
+ {
231
+ "case_id": "doom/spider_mastermind",
232
+ "boss": {
233
+ "en": "Four-Legged Gun Platform"
234
+ },
235
+ "summary": {
236
+ "en": "A very large four-legged machine with a rapid-fire gun that walks slowly through a pillar-ringed arena. Its wide body is easy to hit"
237
+ },
238
+ "moves": [
239
+ {
240
+ "id": "burst_fire",
241
+ "name": {
242
+ "en": "Three-pellet burst"
243
+ },
244
+ "tell": {
245
+ "en": "It stops and aims at you for about a third of a second, then the muzzle flashes and it fires a stream, three pellets each time"
246
+ },
247
+ "effect": {
248
+ "en": "Hits instantly with no flight time; each pellet is weak but hits add up fast"
249
+ },
250
+ "counter": {
251
+ "en": "Strafing does not help; break line of sight behind a pillar, and it stops firing and walks after you"
252
+ }
253
+ },
254
+ {
255
+ "id": "sustained_fire",
256
+ "name": {
257
+ "en": "Sustained suppression"
258
+ },
259
+ "tell": {
260
+ "en": "As long as it can see you it keeps firing with almost no pause"
261
+ },
262
+ "effect": {
263
+ "en": "Standing in the open for long keeps draining your health"
264
+ },
265
+ "counter": {
266
+ "en": "Fight around the pillars: step out, fire a few shots, step back behind cover"
267
+ }
268
+ }
269
+ ],
270
+ "phases": []
271
+ },
272
+ {
273
+ "case_id": "doom/archvile",
274
+ "boss": {
275
+ "en": "Flame-Caller Sorcerer"
276
+ },
277
+ "summary": {
278
+ "en": "A fast flame-casting sorcerer accompanied by a few fire-throwing minions. The courtyard is full of pillars and low walls, which are the key to avoiding its flame"
279
+ },
280
+ "moves": [
281
+ {
282
+ "id": "flame_strike",
283
+ "name": {
284
+ "en": "Flame strike"
285
+ },
286
+ "tell": {
287
+ "en": "It raises its hands and a column of flame appears next to you and follows you; about a second and a half later it bursts"
288
+ },
289
+ "effect": {
290
+ "en": "If it can still see you at the moment of the burst you take damage and are thrown up, with area damage around the flame"
291
+ },
292
+ "counter": {
293
+ "en": "Get behind a pillar or wall before the burst so it cannot see you; running in the open does not help"
294
+ }
295
+ },
296
+ {
297
+ "id": "raise_minion",
298
+ "name": {
299
+ "en": "Raise minion"
300
+ },
301
+ "tell": {
302
+ "en": "It walks to a fallen fire-throwing minion, waves a hand, and the body rises again"
303
+ },
304
+ "effect": {
305
+ "en": "The revived minion returns at full health and keeps attacking"
306
+ },
307
+ "counter": {
308
+ "en": "Prioritise the sorcerer itself, and keep it away from bodies"
309
+ }
310
+ },
311
+ {
312
+ "id": "minion_fireball",
313
+ "name": {
314
+ "en": "Minion fireball"
315
+ },
316
+ "tell": {
317
+ "en": "A fire-throwing minion stops and throws a fireball; up close it claws instead"
318
+ },
319
+ "effect": {
320
+ "en": "Fireballs and claws do low damage"
321
+ },
322
+ "counter": {
323
+ "en": "Strafe past fireballs; minions have little health and drop to one or two shotgun blasts"
324
+ }
325
+ }
326
+ ],
327
+ "phases": []
328
+ },
329
+ {
330
+ "case_id": "doom/mancubus",
331
+ "boss": {
332
+ "en": "Twin-Cannon Brute"
333
+ },
334
+ "summary": {
335
+ "en": "A slow, huge-bellied brute with a cannon on each arm, alone in an open hall with pillars at the corners. You only have a shotgun and a chaingun"
336
+ },
337
+ "moves": [
338
+ {
339
+ "id": "fan_volley",
340
+ "name": {
341
+ "en": "Three-round fan volley"
342
+ },
343
+ "tell": {
344
+ "en": "It raises both cannons and pauses about half a second, then fires three rounds of two fireballs each, about a third of a second apart"
345
+ },
346
+ "effect": {
347
+ "en": "Fireballs fan out: one round leans left, one leans right, one brackets your position; each hit does moderate damage"
348
+ },
349
+ "counter": {
350
+ "en": "Strafe widely as it raises the cannons to slip through the gaps, or hide behind a pillar"
351
+ }
352
+ },
353
+ {
354
+ "id": "slow_advance",
355
+ "name": {
356
+ "en": "Slow advance"
357
+ },
358
+ "tell": {
359
+ "en": "Between volleys it walks slowly toward you"
360
+ },
361
+ "effect": {
362
+ "en": "Its only attack is the volley; it has no melee"
363
+ },
364
+ "counter": {
365
+ "en": "Shoot while backing up, then strafe when it raises its cannons"
366
+ }
367
+ }
368
+ ],
369
+ "phases": []
370
+ },
371
+ {
372
+ "case_id": "doom/revenant",
373
+ "boss": {
374
+ "en": "Shoulder-Cannon Skeleton"
375
+ },
376
+ "summary": {
377
+ "en": "A skeleton with shoulder-mounted rocket launchers: little health but quick. The arena is a cloister of pillar rows, with several fire-throwing minions around. You only have a shotgun and a chaingun"
378
+ },
379
+ "moves": [
380
+ {
381
+ "id": "homing_missile",
382
+ "name": {
383
+ "en": "Homing missile"
384
+ },
385
+ "tell": {
386
+ "en": "It raises the shoulder launcher, pauses about a third of a second, then releases a smoking missile that flies slowly"
387
+ },
388
+ "effect": {
389
+ "en": "The missile slowly turns to chase you and does moderate damage on hit"
390
+ },
391
+ "counter": {
392
+ "en": "Put a pillar between you and the missile so it hits the pillar; you can also shoot it down"
393
+ }
394
+ },
395
+ {
396
+ "id": "fist",
397
+ "name": {
398
+ "en": "Fist punch"
399
+ },
400
+ "tell": {
401
+ "en": "When you are very close it winds up an arm and swings about half a second later"
402
+ },
403
+ "effect": {
404
+ "en": "Moderate melee damage"
405
+ },
406
+ "counter": {
407
+ "en": "Do not stay in melee range; back away"
408
+ }
409
+ },
410
+ {
411
+ "id": "minion_fireball",
412
+ "name": {
413
+ "en": "Minion fireball"
414
+ },
415
+ "tell": {
416
+ "en": "The surrounding fire-throwing minions stop and throw fireballs"
417
+ },
418
+ "effect": {
419
+ "en": "Fireballs do low damage; minions and the skeleton may hurt each other by accident"
420
+ },
421
+ "counter": {
422
+ "en": "Strafe aside, and clear nearby minions first if needed"
423
+ }
424
+ }
425
+ ],
426
+ "phases": []
427
+ }
428
+ ]
429
+ }
environments/games/prototype/bossbench_llm/prompts/games/genshin_remake.json ADDED
@@ -0,0 +1,1214 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "schema": "bossbench-llm/game-prompt@1",
3
+ "game": "genshin_remake",
4
+ "rules": "genshin-bosses@8",
5
+ "title": {
6
+ "en": "Third-Person 3D: Four-Character Party Boss Fights"
7
+ },
8
+ "dimension": "3d",
9
+ "view": {
10
+ "en": "Third-person 3D: the camera follows behind the active character. The boss name, status line and health bar are at the top; a side panel shows the four party members (health, energy ring, skill cooldown); the active character's health and stamina are below, with skill and burst rings, the timer and the lock-on state."
11
+ },
12
+ "goal": {
13
+ "en": "Empty the boss's health bar to win; you lose when the whole party is down; each fight lasts at most 300 seconds and a timeout is not a win. Health does not regenerate by itself; only the healer's abilities or healing effects restore it."
14
+ },
15
+ "mouse": {
16
+ "kind": "camera",
17
+ "en": "The mouse turns the camera, but only while lock-on is off. The fight opens with the camera unlocked (free camera); press R to lock onto the target. In this game dx > 0 turns the view RIGHT and dx < 0 turns it left; dy > 0 lowers the aim pitch, which only affects unlocked bow aiming."
18
+ },
19
+ "keys": [
20
+ {
21
+ "key": "W",
22
+ "en": "move forward relative to the camera"
23
+ },
24
+ {
25
+ "key": "A",
26
+ "en": "move left relative to the camera"
27
+ },
28
+ {
29
+ "key": "S",
30
+ "en": "move backward relative to the camera"
31
+ },
32
+ {
33
+ "key": "D",
34
+ "en": "move right relative to the camera"
35
+ },
36
+ {
37
+ "key": "Space",
38
+ "en": "jump; clears ground rings"
39
+ },
40
+ {
41
+ "key": "Shift",
42
+ "en": "dash: brief invulnerability on press; holding runs and drains stamina"
43
+ },
44
+ {
45
+ "key": "J",
46
+ "en": "normal attack, hold to chain; pressed in the air it is a plunge attack"
47
+ },
48
+ {
49
+ "key": "LMB",
50
+ "en": "hold to charge a heavy attack; the archer taps for one arrow and fully charges for a fire arrow"
51
+ },
52
+ {
53
+ "key": "K",
54
+ "en": "elemental skill; the archer can hold it to set the decoy throw distance"
55
+ },
56
+ {
57
+ "key": "RMB",
58
+ "en": "elemental skill (same as K)"
59
+ },
60
+ {
61
+ "key": "L",
62
+ "en": "elemental burst; needs full energy and no cooldown"
63
+ },
64
+ {
65
+ "key": "Q",
66
+ "en": "swap to the previous living character"
67
+ },
68
+ {
69
+ "key": "E",
70
+ "en": "swap to the next living character"
71
+ },
72
+ {
73
+ "key": "R",
74
+ "en": "toggle target lock-on; off at the start"
75
+ }
76
+ ],
77
+ "notes": [
78
+ {
79
+ "en": "You control a party of four, one active at a time: swordsman (sword, ice), archer (bow, fire), spearman (polearm, fire) and healer (catalyst, water). Q / E swap, with a shared cooldown of about 1 s; fallen characters are skipped."
80
+ },
81
+ {
82
+ "en": "Each character has their own skill (K) and burst (L) with separate cooldowns and energy; energy builds from normal attacks and skills. Skill names are not shown; read the cooldown and energy rings."
83
+ },
84
+ {
85
+ "en": "Ice is useless against the wolf and some elements do nothing to the cube, so swap by scene: bosses and water creatures have different weak elements."
86
+ },
87
+ {
88
+ "en": "Elemental reactions: hitting a target with different elements in turn triggers reactions (overload, superconduct, vaporize, melt, freeze and so on) for bonus damage or effects."
89
+ },
90
+ {
91
+ "en": "Stamina is shared by the whole party; dashing, sprinting and swimming drain it, and without stamina you cannot dash."
92
+ },
93
+ {
94
+ "en": "J, LMB and the archer's K work while held; E, Q, R, L, Shift, Space and the other characters' K take effect on a press."
95
+ },
96
+ {
97
+ "en": "Archer: unlocked, holding LMB gives an over-the-shoulder aim and arrows follow the crosshair, able to hit the colossus's eye and back weak points. Locked, arrows aim at the target automatically."
98
+ },
99
+ {
100
+ "en": "When locked the camera and facing follow the target and strafing does not turn the camera; when unlocked you steer the camera with the mouse."
101
+ }
102
+ ],
103
+ "compact_glossary": {
104
+ "move": {
105
+ "en": "Movement relative to the camera (WASD)",
106
+ "options": {
107
+ "none": "stand still",
108
+ "forward": "W",
109
+ "back": "S",
110
+ "left": "A",
111
+ "right": "D",
112
+ "forward_left": "W+A",
113
+ "forward_right": "W+D",
114
+ "back_left": "S+A",
115
+ "back_right": "S+D"
116
+ }
117
+ },
118
+ "action": {
119
+ "en": "Attack, skill and dodge for the active character",
120
+ "options": {
121
+ "none": "no action",
122
+ "attack": "hold J for normal attack chain",
123
+ "charge": "hold LMB to charge a heavy attack",
124
+ "charge_release": "hold LMB for 3 sub-steps then release",
125
+ "shot": "tap LMB: one arrow, or a normal attack",
126
+ "shot_up": "tap LMB and raise aim ~5 degrees",
127
+ "shot_down": "tap LMB and lower aim ~5 degrees",
128
+ "skill": "tap skill key K",
129
+ "skill_hold": "hold skill key K",
130
+ "burst": "tap ultimate L",
131
+ "dash": "tap Shift to dash",
132
+ "jump": "tap Space to jump"
133
+ }
134
+ },
135
+ "view": {
136
+ "en": "Camera, lock-on and character swap",
137
+ "options": {
138
+ "none": "no change",
139
+ "next": "swap to next character (E)",
140
+ "prev": "swap to previous character (Q)",
141
+ "lock": "toggle lock-on (R)",
142
+ "lock_left_18": "toggle lock and turn left 18 degrees",
143
+ "left_5": "turn view left 5 degrees",
144
+ "right_5": "turn view right 5 degrees",
145
+ "left_45": "turn view left 45 degrees",
146
+ "right_45": "turn view right 45 degrees"
147
+ }
148
+ }
149
+ },
150
+ "scenes": [
151
+ {
152
+ "case_id": "genshin/electro_hypostasis",
153
+ "boss": {
154
+ "en": "Floating Square Array"
155
+ },
156
+ "summary": {
157
+ "en": "A floating cube boss that alternates between a closed shell and an exposed core, in a flat arena."
158
+ },
159
+ "moves": [
160
+ {
161
+ "id": "fist",
162
+ "name": {
163
+ "en": "Block Punch"
164
+ },
165
+ "tell": {
166
+ "en": "The cube raises a block fist and winds up for about 0.7 s"
167
+ },
168
+ "effect": {
169
+ "en": "Lunges forward with a punch that damages on hit"
170
+ },
171
+ "counter": {
172
+ "en": "Sidestep or dash through"
173
+ }
174
+ },
175
+ {
176
+ "id": "clap",
177
+ "name": {
178
+ "en": "Twin-Plate Clap"
179
+ },
180
+ "tell": {
181
+ "en": "Two plates swing open, then snap shut after about 0.9 s"
182
+ },
183
+ "effect": {
184
+ "en": "Frontal fan-shaped clamp"
185
+ },
186
+ "counter": {
187
+ "en": "Back out of the fan or circle behind"
188
+ }
189
+ },
190
+ {
191
+ "id": "rps",
192
+ "name": {
193
+ "en": "Three-Shape Combo"
194
+ },
195
+ "tell": {
196
+ "en": "The body morphs in turn into scissors, fist and palm shapes"
197
+ },
198
+ "effect": {
199
+ "en": "Each shape has a different reach, hit in a row"
200
+ },
201
+ "counter": {
202
+ "en": "Read the current shape: scissors are narrow and long, palm is widest; keep moving"
203
+ }
204
+ },
205
+ {
206
+ "id": "drill",
207
+ "name": {
208
+ "en": "Spiral Dash"
209
+ },
210
+ "tell": {
211
+ "en": "Spins into a spiral and charges up for about 0.8 s"
212
+ },
213
+ "effect": {
214
+ "en": "Charges at speed in a straight line"
215
+ },
216
+ "counter": {
217
+ "en": "Dodge perpendicular to the line"
218
+ }
219
+ },
220
+ {
221
+ "id": "lasers",
222
+ "name": {
223
+ "en": "Rotating Beams"
224
+ },
225
+ "tell": {
226
+ "en": "Four beam ports light up, then rotate for several seconds after about 1 s"
227
+ },
228
+ "effect": {
229
+ "en": "Rotating beams sweep the floor and hurt on contact"
230
+ },
231
+ "counter": {
232
+ "en": "Jump or dash through the gaps between beams"
233
+ }
234
+ },
235
+ {
236
+ "id": "missiles",
237
+ "name": {
238
+ "en": "Diamond Barrage"
239
+ },
240
+ "tell": {
241
+ "en": "A ring of diamond crystals floats up, then fires after about 1 s"
242
+ },
243
+ "effect": {
244
+ "en": "Projectiles fly at your position and explode"
245
+ },
246
+ "counter": {
247
+ "en": "Keep strafing and leave your spot before the blasts"
248
+ }
249
+ },
250
+ {
251
+ "id": "cage",
252
+ "name": {
253
+ "en": "Eight-Pillar Cage"
254
+ },
255
+ "tell": {
256
+ "en": "Eight light pillars rise around the edge, warning for about 1.6 s"
257
+ },
258
+ "effect": {
259
+ "en": "Pillars link into a lasting energy net that traps you"
260
+ },
261
+ "counter": {
262
+ "en": "Stay in the safe zone inside; do not touch the pillars"
263
+ }
264
+ },
265
+ {
266
+ "id": "waves",
267
+ "name": {
268
+ "en": "Ground Rings"
269
+ },
270
+ "tell": {
271
+ "en": "The boss drops down and rings start to spread on the ground"
272
+ },
273
+ "effect": {
274
+ "en": "Spreading rings that hurt along the ground"
275
+ },
276
+ "counter": {
277
+ "en": "Jump with Space as a ring reaches you"
278
+ }
279
+ },
280
+ {
281
+ "id": "prism",
282
+ "name": {
283
+ "en": "Crystal Blocks"
284
+ },
285
+ "tell": {
286
+ "en": "Three crystal blocks are left after the shell closes"
287
+ },
288
+ "effect": {
289
+ "en": "The blocks carry shields and keep the boss protected until broken"
290
+ },
291
+ "counter": {
292
+ "en": "Use a character or element that counters them; break the blocks, then hit the exposed core"
293
+ }
294
+ }
295
+ ],
296
+ "phases": [
297
+ {
298
+ "en": "The boss is mostly closed and cannot be damaged; the core is exposed only after certain moves. Burst it then."
299
+ },
300
+ {
301
+ "en": "One kind of element does nothing to this boss, so swap characters."
302
+ }
303
+ ]
304
+ },
305
+ {
306
+ "case_id": "genshin/ruin_guard",
307
+ "boss": {
308
+ "en": "Back-Cannon Colossus"
309
+ },
310
+ "summary": {
311
+ "en": "A large mechanical colossus with weak points on the eye and back; its body is tough."
312
+ },
313
+ "moves": [
314
+ {
315
+ "id": "stomp",
316
+ "name": {
317
+ "en": "Stomp Quake"
318
+ },
319
+ "tell": {
320
+ "en": "Lifts one foot, then stomps after about 0.6 s"
321
+ },
322
+ "effect": {
323
+ "en": "Small circular quake around the foot"
324
+ },
325
+ "counter": {
326
+ "en": "Move away from the foot or dash out"
327
+ }
328
+ },
329
+ {
330
+ "id": "clap",
331
+ "name": {
332
+ "en": "Arm Slam"
333
+ },
334
+ "tell": {
335
+ "en": "Raises an arm, then slams forward after about 0.5 s"
336
+ },
337
+ "effect": {
338
+ "en": "Narrow frontal heavy hit"
339
+ },
340
+ "counter": {
341
+ "en": "Sidestep"
342
+ }
343
+ },
344
+ {
345
+ "id": "combo",
346
+ "name": {
347
+ "en": "Punch and Leap-Slam"
348
+ },
349
+ "tell": {
350
+ "en": "Two punches, then a leap and landing"
351
+ },
352
+ "effect": {
353
+ "en": "Two punches followed by a wide landing slam"
354
+ },
355
+ "counter": {
356
+ "en": "Back away or dash and avoid the landing point"
357
+ }
358
+ },
359
+ {
360
+ "id": "spin",
361
+ "name": {
362
+ "en": "Spin Crush"
363
+ },
364
+ "tell": {
365
+ "en": "Crouches and spins, then marches while spinning after about 0.7 s"
366
+ },
367
+ "effect": {
368
+ "en": "Repeatedly hits nearby targets while spinning"
369
+ },
370
+ "counter": {
371
+ "en": "Keep a good distance"
372
+ }
373
+ },
374
+ {
375
+ "id": "volley",
376
+ "name": {
377
+ "en": "Back-Cannon Volley"
378
+ },
379
+ "tell": {
380
+ "en": "Back cannons swivel and open; six missiles in about 2 s"
381
+ },
382
+ "effect": {
383
+ "en": "Homing missiles that curve"
384
+ },
385
+ "counter": {
386
+ "en": "Run in circles so they miss; hit the back weak point to interrupt"
387
+ }
388
+ }
389
+ ],
390
+ "phases": [
391
+ {
392
+ "en": "Two quick aimed hits on the eye or back weak point paralyse it; burst then."
393
+ },
394
+ {
395
+ "en": "Its body strongly resists physical damage; use elemental damage."
396
+ }
397
+ ]
398
+ },
399
+ {
400
+ "case_id": "genshin/oceanid",
401
+ "boss": {
402
+ "en": "Tidepool Summoner"
403
+ },
404
+ "summary": {
405
+ "en": "A 3x3 platform in a pond. The boss itself cannot be hit; defeat the water creatures it summons."
406
+ },
407
+ "moves": [
408
+ {
409
+ "id": "summon",
410
+ "name": {
411
+ "en": "Summon Water Creatures"
412
+ },
413
+ "tell": {
414
+ "en": "Water swells and forms animal shapes in about 1 s"
415
+ },
416
+ "effect": {
417
+ "en": "Five waves; each kind has a different weak element and some heal, explode or fly"
418
+ },
419
+ "counter": {
420
+ "en": "Swap to the character that counters the element; kill healers first"
421
+ }
422
+ },
423
+ {
424
+ "id": "sink",
425
+ "name": {
426
+ "en": "Platform Sinks"
427
+ },
428
+ "tell": {
429
+ "en": "Some platforms bubble and begin sinking, warning for about 1.7 s"
430
+ },
431
+ "effect": {
432
+ "en": "Sunken tiles become deep water; swimming drains stamina"
433
+ },
434
+ "counter": {
435
+ "en": "Jump to a tile that is still above water"
436
+ }
437
+ },
438
+ {
439
+ "id": "torrent",
440
+ "name": {
441
+ "en": "Chasing Whirlpool"
442
+ },
443
+ "tell": {
444
+ "en": "If the fight drags on, a whirlpool forms on the water"
445
+ },
446
+ "effect": {
447
+ "en": "The whirlpool follows you and hurts on contact"
448
+ },
449
+ "counter": {
450
+ "en": "Keep moving and clear the wave fast"
451
+ }
452
+ }
453
+ ],
454
+ "phases": [
455
+ {
456
+ "en": "There are five waves; platforms sink after waves 2 and 4 are cleared."
457
+ },
458
+ {
459
+ "en": "Use the archer's arrows against flying or in-water targets."
460
+ }
461
+ ]
462
+ },
463
+ {
464
+ "case_id": "genshin/maguu_kenki",
465
+ "boss": {
466
+ "en": "Masked Dual-Blade"
467
+ },
468
+ "summary": {
469
+ "en": "A fast melee boss. Attacks from far away are deflected by the mask, so you must close in."
470
+ },
471
+ "moves": [
472
+ {
473
+ "id": "ichimonji",
474
+ "name": {
475
+ "en": "Triple Slash"
476
+ },
477
+ "tell": {
478
+ "en": "Raises a blade, then slashes three times after about 0.4 s"
479
+ },
480
+ "effect": {
481
+ "en": "Each slash lunges a little, frontal fan"
482
+ },
483
+ "counter": {
484
+ "en": "Back off or sidestep; close in during the gaps"
485
+ }
486
+ },
487
+ {
488
+ "id": "rush",
489
+ "name": {
490
+ "en": "Straight Dash-Slash"
491
+ },
492
+ "tell": {
493
+ "en": "Crouches, then dashes in a line after about 0.6 s"
494
+ },
495
+ "effect": {
496
+ "en": "Line damage with another blade strike at the end"
497
+ },
498
+ "counter": {
499
+ "en": "Dodge perpendicular to the line"
500
+ }
501
+ },
502
+ {
503
+ "id": "sweeper",
504
+ "name": {
505
+ "en": "Pulling Sweep"
506
+ },
507
+ "tell": {
508
+ "en": "Raises the blade for about 1 s while air pulls inward"
509
+ },
510
+ "effect": {
511
+ "en": "Pulls you in, then sweeps in a circle"
512
+ },
513
+ "counter": {
514
+ "en": "Dash through, or keep distance during the wind-up"
515
+ }
516
+ },
517
+ {
518
+ "id": "pushMask",
519
+ "name": {
520
+ "en": "Thrown Mask"
521
+ },
522
+ "tell": {
523
+ "en": "Throws a mask forward after about 0.5 s"
524
+ },
525
+ "effect": {
526
+ "en": "Mask flies in a straight line and hurts"
527
+ },
528
+ "counter": {
529
+ "en": "Move sideways"
530
+ }
531
+ },
532
+ {
533
+ "id": "explodeMask",
534
+ "name": {
535
+ "en": "Mask Blast"
536
+ },
537
+ "tell": {
538
+ "en": "A mask lands and detonates after about 1.4 s"
539
+ },
540
+ "effect": {
541
+ "en": "Explosion around the landing point"
542
+ },
543
+ "counter": {
544
+ "en": "Leave the mask area before it explodes"
545
+ }
546
+ },
547
+ {
548
+ "id": "taunt",
549
+ "name": {
550
+ "en": "Standing Challenge"
551
+ },
552
+ "tell": {
553
+ "en": "The boss stands still for about 2 s"
554
+ },
555
+ "effect": {
556
+ "en": "No attack; a damage window"
557
+ },
558
+ "counter": {
559
+ "en": "Close in and attack"
560
+ }
561
+ },
562
+ {
563
+ "id": "dash",
564
+ "name": {
565
+ "en": "Hop Dash"
566
+ },
567
+ "tell": {
568
+ "en": "Five short hops in a row"
569
+ },
570
+ "effect": {
571
+ "en": "Its position keeps changing"
572
+ },
573
+ "counter": {
574
+ "en": "Keep chasing it"
575
+ }
576
+ },
577
+ {
578
+ "id": "transition",
579
+ "name": {
580
+ "en": "Ground-Pound Ice Ring"
581
+ },
582
+ "tell": {
583
+ "en": "Slams the ground after about 1.2 s; invulnerable then"
584
+ },
585
+ "effect": {
586
+ "en": "Large ice ring"
587
+ },
588
+ "counter": {
589
+ "en": "Get away or prepare to jump before it lands"
590
+ }
591
+ },
592
+ {
593
+ "id": "dualBurst",
594
+ "name": {
595
+ "en": "Dual-Blade Ice Ring"
596
+ },
597
+ "tell": {
598
+ "en": "Plants both blades in the ground after about 1 s"
599
+ },
600
+ "effect": {
601
+ "en": "Large ice ring"
602
+ },
603
+ "counter": {
604
+ "en": "Keep distance"
605
+ },
606
+ "only": {
607
+ "en": "later phase only"
608
+ }
609
+ },
610
+ {
611
+ "id": "shadowIchimonji",
612
+ "name": {
613
+ "en": "Clone Triple Slash"
614
+ },
615
+ "tell": {
616
+ "en": "Clone adds a delayed slash after the main body's"
617
+ },
618
+ "effect": {
619
+ "en": "Two waves of attacks offset in time"
620
+ },
621
+ "counter": {
622
+ "en": "The second wave arrives slightly later; dodge again"
623
+ },
624
+ "only": {
625
+ "en": "later phase only"
626
+ }
627
+ },
628
+ {
629
+ "id": "shadowSweeper",
630
+ "name": {
631
+ "en": "Clone Pulling Sweep"
632
+ },
633
+ "tell": {
634
+ "en": "Main body winds up while a clone adds an outer sweep"
635
+ },
636
+ "effect": {
637
+ "en": "Inner and outer hits"
638
+ },
639
+ "counter": {
640
+ "en": "Evade the inner ring, then the outer"
641
+ },
642
+ "only": {
643
+ "en": "later phase only"
644
+ }
645
+ },
646
+ {
647
+ "id": "shadowBlade",
648
+ "name": {
649
+ "en": "Clone Blade Throw"
650
+ },
651
+ "tell": {
652
+ "en": "Clones fire three blades one after another"
653
+ },
654
+ "effect": {
655
+ "en": "Straight blades"
656
+ },
657
+ "counter": {
658
+ "en": "Strafe"
659
+ },
660
+ "only": {
661
+ "en": "later phase only"
662
+ }
663
+ }
664
+ ],
665
+ "phases": [
666
+ {
667
+ "en": "At around 70% health the boss turns invulnerable and changes phase; clone and dual-blade moves appear."
668
+ },
669
+ {
670
+ "en": "From a distance, all your attacks are deflected by the mask."
671
+ }
672
+ ]
673
+ },
674
+ {
675
+ "case_id": "genshin/andrius",
676
+ "boss": {
677
+ "en": "Tundra Wolf"
678
+ },
679
+ "summary": {
680
+ "en": "A huge tundra wolf in a round arena, immune to ice and wind; phase 2 starts around half health."
681
+ },
682
+ "moves": [
683
+ {
684
+ "id": "slash",
685
+ "name": {
686
+ "en": "Claw Slash"
687
+ },
688
+ "tell": {
689
+ "en": "Lifts a paw, swipes forward after about 0.4 s"
690
+ },
691
+ "effect": {
692
+ "en": "Frontal melee fan"
693
+ },
694
+ "counter": {
695
+ "en": "Sidestep"
696
+ }
697
+ },
698
+ {
699
+ "id": "leap",
700
+ "name": {
701
+ "en": "Leaping Pounce"
702
+ },
703
+ "tell": {
704
+ "en": "Crouches, then leaps onto your position after about 0.7 s"
705
+ },
706
+ "effect": {
707
+ "en": "Circular damage at the landing point"
708
+ },
709
+ "counter": {
710
+ "en": "Leave the landing spot while it is airborne"
711
+ }
712
+ },
713
+ {
714
+ "id": "charge",
715
+ "name": {
716
+ "en": "Straight Charge"
717
+ },
718
+ "tell": {
719
+ "en": "Backs up and winds up for about 0.9 s"
720
+ },
721
+ "effect": {
722
+ "en": "Charges in a line leaving a trail"
723
+ },
724
+ "counter": {
725
+ "en": "Run perpendicular"
726
+ }
727
+ },
728
+ {
729
+ "id": "tail",
730
+ "name": {
731
+ "en": "Tail Ice Spikes"
732
+ },
733
+ "tell": {
734
+ "en": "Turns and flicks 5 ice spikes that explode a few seconds later"
735
+ },
736
+ "effect": {
737
+ "en": "Spikes land and then explode"
738
+ },
739
+ "counter": {
740
+ "en": "Leave the spikes before they pop"
741
+ }
742
+ },
743
+ {
744
+ "id": "tailMelee",
745
+ "name": {
746
+ "en": "Close Tail Swing"
747
+ },
748
+ "tell": {
749
+ "en": "Swings its tail when you are close"
750
+ },
751
+ "effect": {
752
+ "en": "Wide close-range fan"
753
+ },
754
+ "counter": {
755
+ "en": "Back off or dash through"
756
+ },
757
+ "only": {
758
+ "en": "later phase only"
759
+ }
760
+ },
761
+ {
762
+ "id": "spin",
763
+ "name": {
764
+ "en": "Spinning Ice Ring"
765
+ },
766
+ "tell": {
767
+ "en": "Spins, then releases an ice ring after about 0.9 s"
768
+ },
769
+ "effect": {
770
+ "en": "Large circle around its body"
771
+ },
772
+ "counter": {
773
+ "en": "Get outside the circle or dash"
774
+ }
775
+ },
776
+ {
777
+ "id": "interlude",
778
+ "name": {
779
+ "en": "Arena Run"
780
+ },
781
+ "tell": {
782
+ "en": "At about half health it leaves and runs around the arena"
783
+ },
784
+ "effect": {
785
+ "en": "Cannot be targeted; leads to phase 2"
786
+ },
787
+ "counter": {
788
+ "en": "Keep distance and wait"
789
+ }
790
+ },
791
+ {
792
+ "id": "storm",
793
+ "name": {
794
+ "en": "Falling Ice"
795
+ },
796
+ "tell": {
797
+ "en": "Howls up; ice falls in 3 waves after about 1.1 s"
798
+ },
799
+ "effect": {
800
+ "en": "Several drop circles per wave"
801
+ },
802
+ "counter": {
803
+ "en": "Leave each circle as it appears"
804
+ },
805
+ "only": {
806
+ "en": "later phase only"
807
+ }
808
+ },
809
+ {
810
+ "id": "roar",
811
+ "name": {
812
+ "en": "Arena Roar"
813
+ },
814
+ "tell": {
815
+ "en": "Roars, then the whole arena hurts for a while after about 1 s"
816
+ },
817
+ "effect": {
818
+ "en": "Continuous damage across the arena and detonates ice pillars"
819
+ },
820
+ "counter": {
821
+ "en": "Hide behind an ice pillar or dash"
822
+ },
823
+ "only": {
824
+ "en": "later phase only"
825
+ }
826
+ },
827
+ {
828
+ "id": "blades",
829
+ "name": {
830
+ "en": "Fan Air Slashes"
831
+ },
832
+ "tell": {
833
+ "en": "Raises a paw, then fires 3 fan air slashes after about 0.6 s"
834
+ },
835
+ "effect": {
836
+ "en": "Three blades travelling far"
837
+ },
838
+ "counter": {
839
+ "en": "Step into the gaps or move to the side"
840
+ },
841
+ "only": {
842
+ "en": "later phase only"
843
+ }
844
+ },
845
+ {
846
+ "id": "iceWave",
847
+ "name": {
848
+ "en": "Straight Ice Wave"
849
+ },
850
+ "tell": {
851
+ "en": "Ice lines appear on the ground, a wave moves along them after about 0.8 s"
852
+ },
853
+ "effect": {
854
+ "en": "A long wave that slows"
855
+ },
856
+ "counter": {
857
+ "en": "Leave the line"
858
+ },
859
+ "only": {
860
+ "en": "later phase only"
861
+ }
862
+ },
863
+ {
864
+ "id": "wolves",
865
+ "name": {
866
+ "en": "Summon Wolves"
867
+ },
868
+ "tell": {
869
+ "en": "At low health it howls and calls small wolves"
870
+ },
871
+ "effect": {
872
+ "en": "Small wolves chase and bite"
873
+ },
874
+ "counter": {
875
+ "en": "Clear the wolves first or keep dodging while hitting the boss"
876
+ },
877
+ "only": {
878
+ "en": "later phase only"
879
+ }
880
+ }
881
+ ],
882
+ "phases": [
883
+ {
884
+ "en": "Immune to ice and wind, so the swordsman is nearly useless; use fire and other elements."
885
+ },
886
+ {
887
+ "en": "Around half health there is an arena-run interlude, then phase 2 adds ice pillars and more moves."
888
+ },
889
+ {
890
+ "en": "Fire melts ice pillars; roars or air slashes detonate them."
891
+ }
892
+ ]
893
+ },
894
+ {
895
+ "case_id": "genshin/signora",
896
+ "boss": {
897
+ "en": "Frost-Flame Caster"
898
+ },
899
+ "summary": {
900
+ "en": "A two-phase caster that fights with ice first, then fire. There are beacons at the four corners and a temperature gauge on screen."
901
+ },
902
+ "moves": [
903
+ {
904
+ "id": "wheel",
905
+ "name": {
906
+ "en": "Ice Shard Fan"
907
+ },
908
+ "tell": {
909
+ "en": "Raises a hand, fires a spread of ice shards after about 0.5 s"
910
+ },
911
+ "effect": {
912
+ "en": "Shards flying in a fan"
913
+ },
914
+ "counter": {
915
+ "en": "Dodge to the side"
916
+ }
917
+ },
918
+ {
919
+ "id": "hail",
920
+ "name": {
921
+ "en": "Targeted Ice Fall"
922
+ },
923
+ "tell": {
924
+ "en": "A circle shows on the ground; ice falls after about 0.7 s"
925
+ },
926
+ "effect": {
927
+ "en": "Damage in the circle"
928
+ },
929
+ "counter": {
930
+ "en": "Step out of the circle"
931
+ }
932
+ },
933
+ {
934
+ "id": "flower",
935
+ "name": {
936
+ "en": "Triple Ice Burst"
937
+ },
938
+ "tell": {
939
+ "en": "Three frost blooms appear and explode after about 1.5 s"
940
+ },
941
+ "effect": {
942
+ "en": "Three area explosions"
943
+ },
944
+ "counter": {
945
+ "en": "Stay away from all three"
946
+ }
947
+ },
948
+ {
949
+ "id": "biting",
950
+ "name": {
951
+ "en": "Homing Ice Spears"
952
+ },
953
+ "tell": {
954
+ "en": "Fires 5 homing ice spears in sequence"
955
+ },
956
+ "effect": {
957
+ "en": "They track but turn slowly"
958
+ },
959
+ "counter": {
960
+ "en": "Run in circles so they cannot turn"
961
+ }
962
+ },
963
+ {
964
+ "id": "snowfall",
965
+ "name": {
966
+ "en": "Close Ice Burst"
967
+ },
968
+ "tell": {
969
+ "en": "At close range she gathers ice and bursts after about 0.7 s"
970
+ },
971
+ "effect": {
972
+ "en": "Medium area around her"
973
+ },
974
+ "counter": {
975
+ "en": "Back off"
976
+ }
977
+ },
978
+ {
979
+ "id": "benevolence",
980
+ "name": {
981
+ "en": "Underfoot Ice Array"
982
+ },
983
+ "tell": {
984
+ "en": "An ice array forms under you, warning for about 1.3 s"
985
+ },
986
+ "effect": {
987
+ "en": "Damage after the array finishes"
988
+ },
989
+ "counter": {
990
+ "en": "Leave during the warning"
991
+ }
992
+ },
993
+ {
994
+ "id": "frozenVoid",
995
+ "name": {
996
+ "en": "Delayed Giant Spear"
997
+ },
998
+ "tell": {
999
+ "en": "Hurls a giant spear that stays in the ground and explodes after about 4 s"
1000
+ },
1001
+ "effect": {
1002
+ "en": "Delayed explosion"
1003
+ },
1004
+ "counter": {
1005
+ "en": "Get away before it blows"
1006
+ }
1007
+ },
1008
+ {
1009
+ "id": "cocoon",
1010
+ "name": {
1011
+ "en": "Ice Shell Charge"
1012
+ },
1013
+ "tell": {
1014
+ "en": "At low health she is encased in an ice shell while flames float around"
1015
+ },
1016
+ "effect": {
1017
+ "en": "The shell has a large shield and normal damage fails"
1018
+ },
1019
+ "counter": {
1020
+ "en": "Pick up a floating flame and hit the shell with it"
1021
+ }
1022
+ },
1023
+ {
1024
+ "id": "lash",
1025
+ "name": {
1026
+ "en": "Fire Whip Slash"
1027
+ },
1028
+ "tell": {
1029
+ "en": "A fire whip appears, swings after about 0.4 s"
1030
+ },
1031
+ "effect": {
1032
+ "en": "Frontal fire fan"
1033
+ },
1034
+ "counter": {
1035
+ "en": "Back off or sidestep"
1036
+ },
1037
+ "only": {
1038
+ "en": "later phase only"
1039
+ }
1040
+ },
1041
+ {
1042
+ "id": "lashLong",
1043
+ "name": {
1044
+ "en": "Fire Whip Thrust"
1045
+ },
1046
+ "tell": {
1047
+ "en": "The whip straightens and thrusts after about 0.5 s"
1048
+ },
1049
+ "effect": {
1050
+ "en": "Long narrow line"
1051
+ },
1052
+ "counter": {
1053
+ "en": "Dodge sideways"
1054
+ },
1055
+ "only": {
1056
+ "en": "later phase only"
1057
+ }
1058
+ },
1059
+ {
1060
+ "id": "lashTriple",
1061
+ "name": {
1062
+ "en": "Triple Fire Whip"
1063
+ },
1064
+ "tell": {
1065
+ "en": "Three fire whips lash out in different directions and then pop"
1066
+ },
1067
+ "effect": {
1068
+ "en": "Three arcs plus a blast"
1069
+ },
1070
+ "counter": {
1071
+ "en": "Stand in the gap between whips"
1072
+ },
1073
+ "only": {
1074
+ "en": "later phase only"
1075
+ }
1076
+ },
1077
+ {
1078
+ "id": "warp",
1079
+ "name": {
1080
+ "en": "Close-Range Dash"
1081
+ },
1082
+ "tell": {
1083
+ "en": "Her form turns to fire and rushes at you"
1084
+ },
1085
+ "effect": {
1086
+ "en": "Collides with you"
1087
+ },
1088
+ "counter": {
1089
+ "en": "Dash away"
1090
+ },
1091
+ "only": {
1092
+ "en": "later phase only"
1093
+ }
1094
+ },
1095
+ {
1096
+ "id": "fireball",
1097
+ "name": {
1098
+ "en": "Slow Fireball"
1099
+ },
1100
+ "tell": {
1101
+ "en": "A fireball forms and launches after about 0.5 s"
1102
+ },
1103
+ "effect": {
1104
+ "en": "A slow fireball that keeps going"
1105
+ },
1106
+ "counter": {
1107
+ "en": "Walk or jump away"
1108
+ },
1109
+ "only": {
1110
+ "en": "later phase only"
1111
+ }
1112
+ },
1113
+ {
1114
+ "id": "wrath",
1115
+ "name": {
1116
+ "en": "Falling Fire Pillars"
1117
+ },
1118
+ "tell": {
1119
+ "en": "Markers appear in the sky; fire pillars fall in 3 waves after about 0.8 s"
1120
+ },
1121
+ "effect": {
1122
+ "en": "Five circles per wave"
1123
+ },
1124
+ "counter": {
1125
+ "en": "Leave each wave's circles at once"
1126
+ },
1127
+ "only": {
1128
+ "en": "later phase only"
1129
+ }
1130
+ },
1131
+ {
1132
+ "id": "onslaught",
1133
+ "name": {
1134
+ "en": "Floating Flame Volley"
1135
+ },
1136
+ "tell": {
1137
+ "en": "Releases 6 floating flames at once"
1138
+ },
1139
+ "effect": {
1140
+ "en": "The flames fly toward you"
1141
+ },
1142
+ "counter": {
1143
+ "en": "Strafe so they miss"
1144
+ },
1145
+ "only": {
1146
+ "en": "later phase only"
1147
+ }
1148
+ },
1149
+ {
1150
+ "id": "moth",
1151
+ "name": {
1152
+ "en": "Homing Flame"
1153
+ },
1154
+ "tell": {
1155
+ "en": "A slow homing flame"
1156
+ },
1157
+ "effect": {
1158
+ "en": "Follows you for a long time"
1159
+ },
1160
+ "counter": {
1161
+ "en": "Walk around it"
1162
+ },
1163
+ "only": {
1164
+ "en": "later phase only"
1165
+ }
1166
+ },
1167
+ {
1168
+ "id": "blaze",
1169
+ "name": {
1170
+ "en": "Patrol Fire Whirl"
1171
+ },
1172
+ "tell": {
1173
+ "en": "A fire whirl patrols the arena and sheds small flames"
1174
+ },
1175
+ "effect": {
1176
+ "en": "Large whirl and small flames"
1177
+ },
1178
+ "counter": {
1179
+ "en": "Keep moving and avoid its path"
1180
+ },
1181
+ "only": {
1182
+ "en": "later phase only"
1183
+ }
1184
+ },
1185
+ {
1186
+ "id": "counter",
1187
+ "name": {
1188
+ "en": "Retaliation"
1189
+ },
1190
+ "tell": {
1191
+ "en": "When she is hit hard in some states she retaliates"
1192
+ },
1193
+ "effect": {
1194
+ "en": "Area damage around her; painful"
1195
+ },
1196
+ "counter": {
1197
+ "en": "Do not burst her down all at once; shoot from outside its range"
1198
+ }
1199
+ }
1200
+ ],
1201
+ "phases": [
1202
+ {
1203
+ "en": "The temperature gauge is the arena clock: you bleed when it is full; use the beacons (ice lamps and fire braziers) to adjust it."
1204
+ },
1205
+ {
1206
+ "en": "At about 20% health she is covered in an ice shell; you need to pick up a floating flame to break it."
1207
+ },
1208
+ {
1209
+ "en": "Phase 2 uses fire moves and resists fire strongly."
1210
+ }
1211
+ ]
1212
+ }
1213
+ ]
1214
+ }
environments/games/prototype/bossbench_llm/prompts/games/hexen2_remake.json ADDED
@@ -0,0 +1,611 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "schema": "bossbench-llm/game-prompt@1",
3
+ "game": "hexen2_remake",
4
+ "rules": "hexen2-arena@4",
5
+ "title": {
6
+ "en": "First-Person Fantasy Arena: Riders and Serpent"
7
+ },
8
+ "dimension": "3d",
9
+ "view": {
10
+ "en": "First-person 3D: you are a heavily armoured swordsman with a crosshair at the centre and your weapon below. The HUD shows the boss name and health bar and your health, mana, armour and current weapon. The arena is round with pillars and cover, and mana and life crystals lie on the floor"
11
+ },
12
+ "goal": {
13
+ "en": "Empty the boss health bar to win; you lose when your health reaches zero; each fight lasts at most 300 seconds and a timeout is not a win. Health does not regenerate and each life crystal can be taken once; mana crystals respawn over time"
14
+ },
15
+ "mouse": {
16
+ "kind": "camera",
17
+ "en": "X>0 turns right, Y>0 looks down; look up for flying or very large bosses"
18
+ },
19
+ "keys": [
20
+ {
21
+ "key": "W",
22
+ "en": "move ahead"
23
+ },
24
+ {
25
+ "key": "S",
26
+ "en": "move back"
27
+ },
28
+ {
29
+ "key": "A",
30
+ "en": "strafe left"
31
+ },
32
+ {
33
+ "key": "D",
34
+ "en": "strafe right"
35
+ },
36
+ {
37
+ "key": "Shift",
38
+ "en": "hold to run (double speed)"
39
+ },
40
+ {
41
+ "key": "Space",
42
+ "en": "jump"
43
+ },
44
+ {
45
+ "key": "L",
46
+ "en": "crouch"
47
+ },
48
+ {
49
+ "key": "Q",
50
+ "en": "turn left (keyboard turn, slow)"
51
+ },
52
+ {
53
+ "key": "E",
54
+ "en": "turn right (keyboard turn, slow)"
55
+ },
56
+ {
57
+ "key": "J",
58
+ "en": "attack, hold to repeat"
59
+ },
60
+ {
61
+ "key": "LMB",
62
+ "en": "attack (same as J)"
63
+ },
64
+ {
65
+ "key": "K",
66
+ "en": "next weapon (about 0.3 s select delay, no firing)"
67
+ },
68
+ {
69
+ "key": "RMB",
70
+ "en": "next weapon (same as K)"
71
+ },
72
+ {
73
+ "key": "R",
74
+ "en": "previous weapon"
75
+ }
76
+ ],
77
+ "notes": [
78
+ {
79
+ "en": "Four weapons: gauntlet (melee), long sword (melee, uses mana), throwing axe (bounces back) and fire-orb wand (ranged rapid fire, uses mana). Pick up mana crystals when you run dry."
80
+ },
81
+ {
82
+ "en": "Hold attack to repeat; switching weapons blocks firing for about 0.3 s, so do not switch in danger."
83
+ },
84
+ {
85
+ "en": "Aim ranged weapons before firing; boss homing shots turn slowly, so sidestepping behind cover works best."
86
+ },
87
+ {
88
+ "en": "Boss attacks have visible wind-ups: a glow at the release point, a shrinking ring and an on-screen banner. Dodge when you see them."
89
+ },
90
+ {
91
+ "en": "Your projectiles are sky blue and boss projectiles never are; bosses have an outline glow found nowhere else in the arena."
92
+ },
93
+ {
94
+ "en": "Each rider follows a fixed route; pillars on it can block shots."
95
+ }
96
+ ],
97
+ "compact_glossary": {
98
+ "move": {
99
+ "en": "Movement, 8 directions; every non-idle option also holds Shift (run)",
100
+ "options": {
101
+ "none": "stand still",
102
+ "forward": "run ahead",
103
+ "back": "run back",
104
+ "left": "strafe left",
105
+ "right": "strafe right",
106
+ "forward_left": "run ahead-left",
107
+ "forward_right": "run ahead-right",
108
+ "back_left": "run back-left",
109
+ "back_right": "run back-right"
110
+ }
111
+ },
112
+ "turn": {
113
+ "en": "Horizontal view turn by a fixed angle (mouse X), negative is left",
114
+ "options": {
115
+ "none": "no turn",
116
+ "left_3": "turn left 3 deg",
117
+ "right_3": "turn right 3 deg",
118
+ "left_10": "turn left 10 deg",
119
+ "right_10": "turn right 10 deg",
120
+ "left_30": "turn left 30 deg",
121
+ "right_30": "turn right 30 deg",
122
+ "left_60": "turn left 60 deg",
123
+ "right_60": "turn right 60 deg"
124
+ }
125
+ },
126
+ "pitch": {
127
+ "en": "Vertical view tilt (mouse Y), for flying or tall enemies",
128
+ "options": {
129
+ "none": "no tilt",
130
+ "up_3": "look up 3 deg",
131
+ "down_3": "look down 3 deg"
132
+ }
133
+ },
134
+ "attack": {
135
+ "en": "Attack or weapon switch; never combined in one packet",
136
+ "options": {
137
+ "none": "no attack",
138
+ "fire": "hold the attack button",
139
+ "next_weapon": "switch to next weapon",
140
+ "prev_weapon": "switch to previous weapon"
141
+ }
142
+ }
143
+ },
144
+ "scenes": [
145
+ {
146
+ "case_id": "hexen2/airborne_bone_rider",
147
+ "boss": {
148
+ "en": "Airborne Bone-Rain Rider"
149
+ },
150
+ "summary": {
151
+ "en": "A rider on a flying mount circles above the arena along a fixed route and chains three ranged attacks. You often need to look up to aim."
152
+ },
153
+ "moves": [
154
+ {
155
+ "id": "death_bones",
156
+ "name": {
157
+ "en": "Bone-Rain Missile"
158
+ },
159
+ "tell": {
160
+ "en": "The rider launches a slow homing missile that can be shot down."
161
+ },
162
+ "effect": {
163
+ "en": "If it hits you, bones rain on you from above for about 4 to 6 seconds; each does little damage but there are many."
164
+ },
165
+ "counter": {
166
+ "en": "Shoot the missile before it lands, or keep strafing so the bones miss."
167
+ }
168
+ },
169
+ {
170
+ "id": "death_fire_circle",
171
+ "name": {
172
+ "en": "Fire Ring"
173
+ },
174
+ "tell": {
175
+ "en": "A missile flies at you and bursts into flames where it lands."
176
+ },
177
+ "effect": {
178
+ "en": "The flames spin and widen for about 1.2 seconds, burning anyone inside, harder over time."
179
+ },
180
+ "counter": {
181
+ "en": "Run out of the ring as soon as the missile lands; do not stay near the impact point."
182
+ }
183
+ },
184
+ {
185
+ "id": "death_missiles",
186
+ "name": {
187
+ "en": "Triple Missile Volley"
188
+ },
189
+ "tell": {
190
+ "en": "The rider fires left, centre and right homing missiles at once."
191
+ },
192
+ "effect": {
193
+ "en": "Each hit deals moderate damage and the missiles steer at you for about 3 seconds."
194
+ },
195
+ "counter": {
196
+ "en": "Run sideways and get behind cover so the missiles hit the wall."
197
+ }
198
+ }
199
+ ],
200
+ "phases": [
201
+ {
202
+ "en": "After each attack there is a few seconds of cooldown and only one attack is active at a time."
203
+ }
204
+ ]
205
+ },
206
+ {
207
+ "case_id": "hexen2/axe_hurling_rider",
208
+ "boss": {
209
+ "en": "Axe-Hurling Armoured Rider"
210
+ },
211
+ "summary": {
212
+ "en": "A heavily armoured rider gallops along a route and hurls a batch of axes after every lap. It is big and tramples."
213
+ },
214
+ "moves": [
215
+ {
216
+ "id": "war_axe",
217
+ "name": {
218
+ "en": "Side Axes"
219
+ },
220
+ "tell": {
221
+ "en": "After each lap the rider throws two to four axes that fly out sideways, then curve at you."
222
+ },
223
+ "effect": {
224
+ "en": "Each axe deals moderate damage; the slower the rider gallops, the more axes per throw."
225
+ },
226
+ "counter": {
227
+ "en": "The axes turn slowly; strafe or hide behind a pillar, then attack in the gap."
228
+ }
229
+ },
230
+ {
231
+ "id": "war_big_axe",
232
+ "name": {
233
+ "en": "Rearing Heavy Axe"
234
+ },
235
+ "tell": {
236
+ "en": "The mount rears up, then the rider throws one larger axe."
237
+ },
238
+ "effect": {
239
+ "en": "This axe tracks more tightly and hits very hard, and explodes on walls."
240
+ },
241
+ "counter": {
242
+ "en": "Start strafing as soon as it rears and lead the axe into cover."
243
+ }
244
+ },
245
+ {
246
+ "id": "war_trample",
247
+ "name": {
248
+ "en": "Trample"
249
+ },
250
+ "tell": {
251
+ "en": "The rider gallops straight at you."
252
+ },
253
+ "effect": {
254
+ "en": "Contact deals moderate damage and knocks you far back, worse from the front."
255
+ },
256
+ "counter": {
257
+ "en": "Step aside early and do not stand in its path."
258
+ }
259
+ }
260
+ ],
261
+ "phases": [
262
+ {
263
+ "en": "A sharp turn makes the next lap faster; gentle turns slow it and it throws more axes."
264
+ }
265
+ ]
266
+ },
267
+ {
268
+ "case_id": "hexen2/blinking_tether_rider",
269
+ "boss": {
270
+ "en": "Blinking Tether Rider"
271
+ },
272
+ "summary": {
273
+ "en": "A rider gallops on a route. It does not trample, but pulls you in, fires homing missiles, and blinks next to you after rearing."
274
+ },
275
+ "moves": [
276
+ {
277
+ "id": "famine_pull",
278
+ "name": {
279
+ "en": "Tether Pull"
280
+ },
281
+ "tell": {
282
+ "en": "The rider stops and a string of glowing orbs links at you."
283
+ },
284
+ "effect": {
285
+ "en": "The beam lasts several seconds, drags you steadily at the rider and deals small damage each second."
286
+ },
287
+ "counter": {
288
+ "en": "Cover that blocks the beam cancels the pull; get behind a pillar."
289
+ }
290
+ },
291
+ {
292
+ "id": "famine_missiles",
293
+ "name": {
294
+ "en": "Triple Missile Volley"
295
+ },
296
+ "tell": {
297
+ "en": "The rider raises an arm and fires left, centre and right missiles."
298
+ },
299
+ "effect": {
300
+ "en": "The missiles home for about 2 seconds, each hit moderate."
301
+ },
302
+ "counter": {
303
+ "en": "Run sideways and use cover so the missiles cannot turn in time."
304
+ }
305
+ },
306
+ {
307
+ "id": "famine_blink",
308
+ "name": {
309
+ "en": "Rear and Blink"
310
+ },
311
+ "tell": {
312
+ "en": "The mount rears and its body fades out."
313
+ },
314
+ "effect": {
315
+ "en": "While gone it cannot be hit; after about 0.5 to 3 seconds it reappears at the route point nearest you and may fire another volley."
316
+ },
317
+ "counter": {
318
+ "en": "Do not waste shots while it is gone; guess where it will reappear and aim there."
319
+ }
320
+ }
321
+ ],
322
+ "phases": [
323
+ {
324
+ "en": "The more hurt it is, the more it rears and blinks."
325
+ }
326
+ ]
327
+ },
328
+ {
329
+ "case_id": "hexen2/boar_archer_rider",
330
+ "boss": {
331
+ "en": "Boar-Riding Poison Archer"
332
+ },
333
+ "summary": {
334
+ "en": "An archer on a huge boar. It starts awake, chases you on sight, tramples up close and shoots poison arrows and throws hives from range."
335
+ },
336
+ "moves": [
337
+ {
338
+ "id": "pest_arrow",
339
+ "name": {
340
+ "en": "Poison Arrow"
341
+ },
342
+ "tell": {
343
+ "en": "The archer turns at you and draws the bow."
344
+ },
345
+ "effect": {
346
+ "en": "The homing arrow flies for about 2 seconds, hits for moderate damage and poisons you, dealing damage each second; stacks."
347
+ },
348
+ "counter": {
349
+ "en": "Strafe away; poison lasts 5 to 10 seconds, so avoid getting hit."
350
+ }
351
+ },
352
+ {
353
+ "id": "pest_hive",
354
+ "name": {
355
+ "en": "Hive Throw"
356
+ },
357
+ "tell": {
358
+ "en": "The archer lobs a hive that bounces along the ground."
359
+ },
360
+ "effect": {
361
+ "en": "When it lands or is shot, it releases three insect clouds that drift after you for about 20 seconds, chipping small damage on contact."
362
+ },
363
+ "counter": {
364
+ "en": "Shoot the hive in the air; the clouds are slow, so keep moving."
365
+ }
366
+ },
367
+ {
368
+ "id": "pest_charge",
369
+ "name": {
370
+ "en": "Charge"
371
+ },
372
+ "tell": {
373
+ "en": "The boar lowers its head, speeds up sharply and runs straight at you."
374
+ },
375
+ "effect": {
376
+ "en": "Contact deals moderate damage and heavy knockback; it may also shoot or throw during the charge."
377
+ },
378
+ "counter": {
379
+ "en": "Dodge sideways early; do not run straight back."
380
+ }
381
+ },
382
+ {
383
+ "id": "pest_trample",
384
+ "name": {
385
+ "en": "Body Slam"
386
+ },
387
+ "tell": {
388
+ "en": "The boar closes in and rams you."
389
+ },
390
+ "effect": {
391
+ "en": "Moderate damage with knockback, at most once every half second."
392
+ },
393
+ "counter": {
394
+ "en": "Keep distance and shoot while backing away."
395
+ }
396
+ }
397
+ ],
398
+ "phases": [
399
+ {
400
+ "en": "It attacks more eagerly after being hurt; if stuck on a wall it backs up for a few seconds."
401
+ }
402
+ ]
403
+ },
404
+ {
405
+ "case_id": "hexen2/orb_warded_serpent",
406
+ "boss": {
407
+ "en": "Orb-Shielded Serpent"
408
+ },
409
+ "summary": {
410
+ "en": "A destructible orb in the arena shields the serpent. You must break the orb first, then defeat the serpent itself, over several phases."
411
+ },
412
+ "moves": [
413
+ {
414
+ "id": "eidolon_magic",
415
+ "name": {
416
+ "en": "Small-Form Bolts"
417
+ },
418
+ "tell": {
419
+ "en": "In its small form the serpent raises a hand and fires one or more fast bolts."
420
+ },
421
+ "effect": {
422
+ "en": "The bolts are fast and moderately damaging."
423
+ },
424
+ "counter": {
425
+ "en": "Keep moving around pillars instead of backing straight away."
426
+ }
427
+ },
428
+ {
429
+ "id": "eidolon_fireball",
430
+ "name": {
431
+ "en": "Fireball"
432
+ },
433
+ "tell": {
434
+ "en": "In its large form it opens its mouth and fires fireballs in pairs."
435
+ },
436
+ "effect": {
437
+ "en": "A direct hit is extremely damaging, one can cripple you, and the blast splashes."
438
+ },
439
+ "counter": {
440
+ "en": "Dodge sideways the moment it opens its mouth and get behind cover."
441
+ }
442
+ },
443
+ {
444
+ "id": "eidolon_flames",
445
+ "name": {
446
+ "en": "Flame Breath"
447
+ },
448
+ "tell": {
449
+ "en": "At mid range it lowers its head and breathes a stream of flames."
450
+ },
451
+ "effect": {
452
+ "en": "The flames are slower and hurt noticeably, and push you away when close."
453
+ },
454
+ "counter": {
455
+ "en": "Strafe aside, or move closer or farther than its breath range."
456
+ }
457
+ },
458
+ {
459
+ "id": "eidolon_lightning",
460
+ "name": {
461
+ "en": "Roar Lightning"
462
+ },
463
+ "tell": {
464
+ "en": "The serpent throws back its head and roars, the sky darkens, and lightning strikes random spots."
465
+ },
466
+ "effect": {
467
+ "en": "A direct strike is nearly fatal; positions are random."
468
+ },
469
+ "counter": {
470
+ "en": "During the roar head to a corner away from the centre and do not stand still."
471
+ }
472
+ },
473
+ {
474
+ "id": "eidolon_grow",
475
+ "name": {
476
+ "en": "Growth"
477
+ },
478
+ "tell": {
479
+ "en": "After the small form is beaten the sky darkens, the ground shakes and the serpent swells."
480
+ },
481
+ "effect": {
482
+ "en": "Standing close during growth pushes you away and hurts you steadily."
483
+ },
484
+ "counter": {
485
+ "en": "Back off during growth and attack after the roar."
486
+ }
487
+ }
488
+ ],
489
+ "phases": [
490
+ {
491
+ "en": "Small form: unkillable; enough damage makes it fake a collapse."
492
+ },
493
+ {
494
+ "en": "Large form with the orb intact: the serpent cannot die; breaking the orb is the only way ahead."
495
+ },
496
+ {
497
+ "en": "After the orb breaks, the real fight begins and it can be killed."
498
+ }
499
+ ]
500
+ },
501
+ {
502
+ "case_id": "hexen2/star_volley_sorcerer",
503
+ "boss": {
504
+ "en": "Star Volley Sorcerer"
505
+ },
506
+ "summary": {
507
+ "en": "A tall sorcerer casting in an open hall: star bolts at range, fire pillars under your feet, fire walls and an arena-wide storm; he also teleports and blocks shots with a shield. Each time his health drops another step he becomes briefly invulnerable and recharges."
508
+ },
509
+ "moves": [
510
+ {
511
+ "id": "praevus_star",
512
+ "name": {
513
+ "en": "Triple Star Bolt"
514
+ },
515
+ "tell": {
516
+ "en": "He points at you and a 'triple star bolt' cue appears on screen, firing almost immediately"
517
+ },
518
+ "effect": {
519
+ "en": "Three star bolts fly at you in a narrow fan and hurt on hit; they only spark against walls"
520
+ },
521
+ "counter": {
522
+ "en": "Strafe through a gap in the fan or duck behind a pillar"
523
+ }
524
+ },
525
+ {
526
+ "id": "praevus_pillar",
527
+ "name": {
528
+ "en": "Fire Pillar"
529
+ },
530
+ "tell": {
531
+ "en": "A 'fire pillar' marker appears under your feet and the pillar rises about 0.2 s later"
532
+ },
533
+ "effect": {
534
+ "en": "A pillar of fire erupts where you stand and hurts while you are inside it"
535
+ },
536
+ "counter": {
537
+ "en": "Move away the moment the marker appears under you"
538
+ }
539
+ },
540
+ {
541
+ "id": "praevus_firewall",
542
+ "name": {
543
+ "en": "Fire Wall"
544
+ },
545
+ "tell": {
546
+ "en": "He charges for about 1.6 s with a 'fire wall' cue on screen"
547
+ },
548
+ "effect": {
549
+ "en": "He releases a wall of fire that sweeps across the arena at you and hurts on contact"
550
+ },
551
+ "counter": {
552
+ "en": "Get sideways out of its path while he is still charging"
553
+ }
554
+ },
555
+ {
556
+ "id": "praevus_conjure",
557
+ "name": {
558
+ "en": "Summon Storm"
559
+ },
560
+ "tell": {
561
+ "en": "He raises his hands with a 'summon storm' cue and a storm forms over the middle of the arena"
562
+ },
563
+ "effect": {
564
+ "en": "The storm covers a large area and keeps striking anyone inside it, each bolt hurting a lot"
565
+ },
566
+ "counter": {
567
+ "en": "Run to the edge of the storm or into a corner quickly"
568
+ }
569
+ },
570
+ {
571
+ "id": "praevus_teleport",
572
+ "name": {
573
+ "en": "Teleport"
574
+ },
575
+ "tell": {
576
+ "en": "He spins faster and shrinks with a 'teleport' cue, then vanishes"
577
+ },
578
+ "effect": {
579
+ "en": "He reappears a few seconds later at another teleport point in the arena"
580
+ },
581
+ "counter": {
582
+ "en": "Use the gap to pick up supplies and reposition, then turn to find where he reappears"
583
+ }
584
+ },
585
+ {
586
+ "id": "praevus_shield",
587
+ "name": {
588
+ "en": "Shield"
589
+ },
590
+ "tell": {
591
+ "en": "Six shield plates circle around him"
592
+ },
593
+ "effect": {
594
+ "en": "The plates block your shots; each can be shattered and does not regrow"
595
+ },
596
+ "counter": {
597
+ "en": "Break the plates between you and him first"
598
+ }
599
+ }
600
+ ],
601
+ "phases": [
602
+ {
603
+ "en": "At the start he spins and slows down; he can only be hurt once he has turned to face you"
604
+ },
605
+ {
606
+ "en": "Each time he loses another fifth of his health he goes invulnerable for about 6 s to recharge (no healing), then follows with a fire wall"
607
+ }
608
+ ]
609
+ }
610
+ ]
611
+ }
environments/games/prototype/bossbench_llm/prompts/games/hollowknight_remake.json ADDED
@@ -0,0 +1,993 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "schema": "bossbench-llm/game-prompt@1",
3
+ "game": "hollowknight_remake",
4
+ "rules": "hk-arena-20261103-r5",
5
+ "title": {
6
+ "en": "Side-View Blade Boss Fights"
7
+ },
8
+ "dimension": "2d",
9
+ "view": {
10
+ "en": "Side-view 2D: a cloaked swordsman stands in a closed room facing a boss. Your health points and energy are shown at the top or corner of the screen, and the boss's health bar at the top"
11
+ },
12
+ "goal": {
13
+ "en": "Empty the boss's health bar to win; you lose when your health points reach zero; each fight has a time limit and a timeout is not a win. Health does not regenerate by itself; you must build energy by hitting the boss and then channel healing"
14
+ },
15
+ "mouse": {
16
+ "kind": "none",
17
+ "en": ""
18
+ },
19
+ "keys": [
20
+ {
21
+ "key": "W",
22
+ "en": "hold to slash upward; used with the slash button"
23
+ },
24
+ {
25
+ "key": "A",
26
+ "en": "move left"
27
+ },
28
+ {
29
+ "key": "S",
30
+ "en": "hold in the air and slash to strike downward; hitting the boss or a bounceable attack bounces you up (pogo)"
31
+ },
32
+ {
33
+ "key": "D",
34
+ "en": "move right"
35
+ },
36
+ {
37
+ "key": "Space",
38
+ "en": "jump: hold for height, release to cut it short"
39
+ },
40
+ {
41
+ "key": "Shift",
42
+ "en": "dash: once per air time, about 0.6 s cooldown"
43
+ },
44
+ {
45
+ "key": "J",
46
+ "en": "slash"
47
+ },
48
+ {
49
+ "key": "LMB",
50
+ "en": "slash (same as J)"
51
+ },
52
+ {
53
+ "key": "K",
54
+ "en": "hold on the ground to heal: standing still for about 1.1 s spends 33 energy for 1 health"
55
+ }
56
+ ],
57
+ "notes": [
58
+ {
59
+ "en": "Each hit on the boss stores 11 energy; healing needs 33 and takes about 1.1 s holding K on the ground; moving, leaving the ground or being hit cancels it"
60
+ },
61
+ {
62
+ "en": "Side slashes alternate between two swings, resetting after 0.5 s; slashes have about a 0.41 s cooldown"
63
+ },
64
+ {
65
+ "en": "Early presses are buffered: jump about 0.04 s, slash about 0.1 s, dash about 0.2 s"
66
+ },
67
+ {
68
+ "en": "A downward hit on the boss or a bounceable attack bounces you up and refreshes the air dash (not the dash cooldown), so you can chain pogos"
69
+ },
70
+ {
71
+ "en": "You cannot dash during the first 0.1 s of a slash"
72
+ },
73
+ {
74
+ "en": "Each boss's stagger (collapsing when pressured) is the time to deal concentrated damage"
75
+ }
76
+ ],
77
+ "compact_glossary": {
78
+ "move": {
79
+ "en": "left/right movement",
80
+ "options": {
81
+ "none": "stand still",
82
+ "left": "walk left, whole packet",
83
+ "right": "walk right, whole packet",
84
+ "left_tap": "tap left once at sub-step 1 (to turn around)",
85
+ "right_tap": "tap right once at sub-step 1 (to turn around)"
86
+ }
87
+ },
88
+ "jump": {
89
+ "en": "jumping",
90
+ "options": {
91
+ "none": "do not jump",
92
+ "hold": "hold jump for the whole packet (high jump; only starts if jump was not held at the end of the previous packet)",
93
+ "press2_hold": "press jump at sub-step 2 and hold (use after holding jump in the previous packet)",
94
+ "tap1": "short hop, tap at sub-step 1",
95
+ "tap2": "short hop, tap at sub-step 2",
96
+ "tap3": "short hop, tap at sub-step 3",
97
+ "tap4": "short hop, tap at sub-step 4",
98
+ "tap5": "short hop, tap at sub-step 5",
99
+ "tap6": "short hop, tap at sub-step 6"
100
+ }
101
+ },
102
+ "action": {
103
+ "en": "slash / dash / heal",
104
+ "options": {
105
+ "none": "do not attack",
106
+ "down_1": "downward slash, repeated presses from sub-step 1 (air only)",
107
+ "down_2": "downward slash, repeated presses from sub-step 2 (air only)",
108
+ "down_3": "downward slash, repeated presses from sub-step 3 (air only)",
109
+ "down_4": "downward slash, repeated presses from sub-step 4 (air only)",
110
+ "down_5": "downward slash, repeated presses from sub-step 5 (air only)",
111
+ "down_6": "downward slash, repeated presses from sub-step 6 (air only)",
112
+ "slash_101010": "side slash, press timing 101010",
113
+ "slash_010101": "side slash, press timing 010101",
114
+ "slash_100000": "side slash, press timing 100000",
115
+ "slash_010000": "side slash, press timing 010000",
116
+ "slash_001010": "side slash, press timing 001010",
117
+ "slash_000101": "side slash, press timing 000101",
118
+ "slash_000010": "side slash, press timing 000010",
119
+ "slash_000001": "side slash, press timing 000001",
120
+ "up_1": "upward slash, press timing 101010",
121
+ "up_2": "upward slash, press timing 010101",
122
+ "up_3": "upward slash, press timing 100000",
123
+ "up_5": "upward slash, press timing 000010",
124
+ "dash": "dash at sub-steps 1-2",
125
+ "dash_mid": "dash at sub-step 4 (pair with a jump for an air dash)",
126
+ "heal": "channel healing, held the whole packet (stand still on the ground)"
127
+ }
128
+ }
129
+ },
130
+ "scenes": [
131
+ {
132
+ "case_id": "2d/hollow_vessel",
133
+ "boss": {
134
+ "en": "Orange-Ooze Berserker"
135
+ },
136
+ "summary": {
137
+ "en": "A closed room duel against a blade-wielding berserker who dashes, leaps, and pours orange ooze from the walls and roof."
138
+ },
139
+ "moves": [
140
+ {
141
+ "id": "dash",
142
+ "name": {
143
+ "en": "Dash"
144
+ },
145
+ "tell": {
146
+ "en": "Steps back and crouches with the blade drawn back, then crosses most of the room in one dash"
147
+ },
148
+ "effect": {
149
+ "en": "Contact damage along the ground"
150
+ },
151
+ "counter": {
152
+ "en": "Jump over it or stay clear; the 0.25 s recovery after the dash is your opening"
153
+ }
154
+ },
155
+ {
156
+ "id": "air_dash",
157
+ "name": {
158
+ "en": "Air dash"
159
+ },
160
+ "tell": {
161
+ "en": "Jumps and hangs in the air with the blade drawn, then dashes at head height"
162
+ },
163
+ "effect": {
164
+ "en": "Dashes sideways at head height; contact hurts"
165
+ },
166
+ "counter": {
167
+ "en": "Stay low, out of its height line; it falls after the dash with about 0.25 s of recovery to punish"
168
+ }
169
+ },
170
+ {
171
+ "id": "jump",
172
+ "name": {
173
+ "en": "Leap"
174
+ },
175
+ "tell": {
176
+ "en": "Crouches, then jumps to a random point in the room"
177
+ },
178
+ "effect": {
179
+ "en": "Landing on you hurts"
180
+ },
181
+ "counter": {
182
+ "en": "Move off the landing point; it has about 0.17 s of landing recovery"
183
+ }
184
+ },
185
+ {
186
+ "id": "downstab",
187
+ "name": {
188
+ "en": "Plunge stab"
189
+ },
190
+ "tell": {
191
+ "en": "Jumps over you, hangs with the blade pointing down, then plunges and splashes four blobs along the floor"
192
+ },
193
+ "effect": {
194
+ "en": "The plunge and the blobs both hurt"
195
+ },
196
+ "counter": {
197
+ "en": "Leave the landing spot and jump the blobs; the roughly 0.9 s of recovery after landing is your opening"
198
+ }
199
+ },
200
+ {
201
+ "id": "overhead",
202
+ "name": {
203
+ "en": "Overhead flail"
204
+ },
205
+ "tell": {
206
+ "en": "Raises the blade and flails it over its head while you are above it"
207
+ },
208
+ "effect": {
209
+ "en": "Hits you when you are above it"
210
+ },
211
+ "counter": {
212
+ "en": "Do not hover above it; about 0.17 s of recovery afterwards"
213
+ }
214
+ },
215
+ {
216
+ "id": "evade",
217
+ "name": {
218
+ "en": "Hop back"
219
+ },
220
+ "tell": {
221
+ "en": "Hops backwards away from a close player"
222
+ },
223
+ "effect": {
224
+ "en": "Not an attack, but often leads into one"
225
+ },
226
+ "counter": {
227
+ "en": "Do not chase; anticipate the follow-up"
228
+ }
229
+ },
230
+ {
231
+ "id": "cascade",
232
+ "name": {
233
+ "en": "Ooze cascade"
234
+ },
235
+ "tell": {
236
+ "en": "Jumps to the middle and shakes; orange blobs pour from both walls and the roof for about four seconds"
237
+ },
238
+ "effect": {
239
+ "en": "Falling blobs hurt on contact"
240
+ },
241
+ "counter": {
242
+ "en": "Weave through gaps between blobs; do not stand under falling ones"
243
+ }
244
+ },
245
+ {
246
+ "id": "balloon",
247
+ "name": {
248
+ "en": "Balloons"
249
+ },
250
+ "tell": {
251
+ "en": "Once its health bar is below about four fifths, balloons drift in every 4-5 seconds and chase you"
252
+ },
253
+ "effect": {
254
+ "en": "Balloons that reach you hurt"
255
+ },
256
+ "counter": {
257
+ "en": "One strike pops them; do not let them pile up"
258
+ }
259
+ }
260
+ ],
261
+ "phases": [
262
+ {
263
+ "en": "Below about four fifths health, chasing balloons are added."
264
+ }
265
+ ]
266
+ },
267
+ {
268
+ "case_id": "2d/iron_bulwark",
269
+ "boss": {
270
+ "en": "Iron-Bell Mace Soldier"
271
+ },
272
+ "summary": {
273
+ "en": "A heavily armoured mace soldier hunts you on flat ground while barrels drop from the roof."
274
+ },
275
+ "moves": [
276
+ {
277
+ "id": "leap",
278
+ "name": {
279
+ "en": "Leap"
280
+ },
281
+ "tell": {
282
+ "en": "Crouches with the mace on its shoulder, then leaps toward you (half of the leaps go to a random spot)"
283
+ },
284
+ "effect": {
285
+ "en": "Landing on you hurts"
286
+ },
287
+ "counter": {
288
+ "en": "Step away from the landing; about 0.5 s of landing recovery is your opening"
289
+ }
290
+ },
291
+ {
292
+ "id": "bludgeon",
293
+ "name": {
294
+ "en": "Bludgeon"
295
+ },
296
+ "tell": {
297
+ "en": "Leaps with the mace raised and brings it down in front of it on landing"
298
+ },
299
+ "effect": {
300
+ "en": "Slams in front of it; the area hurts"
301
+ },
302
+ "counter": {
303
+ "en": "Stay out of the front of its landing; about 0.25 s of recoil after the slam"
304
+ }
305
+ },
306
+ {
307
+ "id": "smash",
308
+ "name": {
309
+ "en": "Wind-up smash"
310
+ },
311
+ "tell": {
312
+ "en": "Jumps back, then winds the mace far behind its head for over a second"
313
+ },
314
+ "effect": {
315
+ "en": "The smash sends a shockwave along the floor"
316
+ },
317
+ "counter": {
318
+ "en": "Jump the shockwave; about 0.42 s of recovery after the smash"
319
+ }
320
+ },
321
+ {
322
+ "id": "charge",
323
+ "name": {
324
+ "en": "Charge"
325
+ },
326
+ "tell": {
327
+ "en": "When you are far away it runs at you and follows up with the leaping slam"
328
+ },
329
+ "effect": {
330
+ "en": "Both the run and the slam hurt"
331
+ },
332
+ "counter": {
333
+ "en": "Do not stay far away; jump the run, then dodge the slam"
334
+ }
335
+ },
336
+ {
337
+ "id": "rage",
338
+ "name": {
339
+ "en": "Rage slams"
340
+ },
341
+ "tell": {
342
+ "en": "After the exposed rider is beaten back into the armour, it jumps to the middle and slams left and right"
343
+ },
344
+ "effect": {
345
+ "en": "Slams the floor on both sides in succession"
346
+ },
347
+ "counter": {
348
+ "en": "Move and jump in the gaps between slams"
349
+ }
350
+ },
351
+ {
352
+ "id": "barrel",
353
+ "name": {
354
+ "en": "Falling barrel"
355
+ },
356
+ "tell": {
357
+ "en": "Dust trickles from the roof where a barrel is about to drop"
358
+ },
359
+ "effect": {
360
+ "en": "The barrel hurts if it lands on you"
361
+ },
362
+ "counter": {
363
+ "en": "Leave the spot as soon as dust appears"
364
+ }
365
+ }
366
+ ],
367
+ "phases": [
368
+ {
369
+ "en": "When the armour breaks an exposed rider appears; beating it back into the armour triggers the rage slams."
370
+ }
371
+ ]
372
+ },
373
+ {
374
+ "case_id": "2d/lumen_moth",
375
+ "boss": {
376
+ "en": "Four-Winged Sword Wielder"
377
+ },
378
+ "summary": {
379
+ "en": "A glowing four-winged boss fills the arena with light orbs, sword patterns and beams; later the floor turns into an abyss."
380
+ },
381
+ "moves": [
382
+ {
383
+ "id": "orbs",
384
+ "name": {
385
+ "en": "Light orbs"
386
+ },
387
+ "tell": {
388
+ "en": "Her core flares and up to three orbs of light peel away from her, then home in"
389
+ },
390
+ "effect": {
391
+ "en": "Orbs deal 2 damage on contact"
392
+ },
393
+ "counter": {
394
+ "en": "Lead them into the floor or a wall so they burst"
395
+ }
396
+ },
397
+ {
398
+ "id": "sword_burst",
399
+ "name": {
400
+ "en": "Sword ring"
401
+ },
402
+ "tell": {
403
+ "en": "Twelve swords stand in a ring around her, points outward"
404
+ },
405
+ "effect": {
406
+ "en": "Swords shoot outward and deal 2 damage"
407
+ },
408
+ "counter": {
409
+ "en": "Stand between two swords' lines; farther away is safer"
410
+ }
411
+ },
412
+ {
413
+ "id": "sword_rain",
414
+ "name": {
415
+ "en": "Sword rain"
416
+ },
417
+ "tell": {
418
+ "en": "Rows of swords hang along the ceiling, points down, with two wide gaps"
419
+ },
420
+ "effect": {
421
+ "en": "Swords fall and deal 2 damage"
422
+ },
423
+ "counter": {
424
+ "en": "Stand under a gap; she teleports half-way through"
425
+ }
426
+ },
427
+ {
428
+ "id": "sword_wall",
429
+ "name": {
430
+ "en": "Sword wall"
431
+ },
432
+ "tell": {
433
+ "en": "A column of swords forms along one side wall, with one gap open at the floor or at full-jump height"
434
+ },
435
+ "effect": {
436
+ "en": "The wall sweeps across, dealing 2 damage"
437
+ },
438
+ "counter": {
439
+ "en": "Stand in a floor gap; for a high gap, jump as it arrives"
440
+ }
441
+ },
442
+ {
443
+ "id": "beam_burst",
444
+ "name": {
445
+ "en": "Beam burst"
446
+ },
447
+ "tell": {
448
+ "en": "Thin lines of light spread from her in eight directions"
449
+ },
450
+ "effect": {
451
+ "en": "Beams deal 2 damage"
452
+ },
453
+ "counter": {
454
+ "en": "Stand between two lines; the next burst turns half a step"
455
+ }
456
+ },
457
+ {
458
+ "id": "beam_sweep",
459
+ "name": {
460
+ "en": "Beam sweep"
461
+ },
462
+ "tell": {
463
+ "en": "Light gathers along one side wall"
464
+ },
465
+ "effect": {
466
+ "en": "A wall of light sweeps the arena for 2 damage"
467
+ },
468
+ "counter": {
469
+ "en": "Run to the far end; it fades just short of the far wall"
470
+ }
471
+ },
472
+ {
473
+ "id": "spikes",
474
+ "name": {
475
+ "en": "Floor spikes"
476
+ },
477
+ "tell": {
478
+ "en": "One half of the floor glows, then spikes rise there"
479
+ },
480
+ "effect": {
481
+ "en": "Spikes deal 1 damage"
482
+ },
483
+ "counter": {
484
+ "en": "Stand on the other half"
485
+ }
486
+ },
487
+ {
488
+ "id": "abyss",
489
+ "name": {
490
+ "en": "Abyss"
491
+ },
492
+ "tell": {
493
+ "en": "After the stagger the floor darkens into an abyss between four pale footholds"
494
+ },
495
+ "effect": {
496
+ "en": "Falling into the abyss deals 1 damage"
497
+ },
498
+ "counter": {
499
+ "en": "Stay on the footholds and jump the gaps"
500
+ }
501
+ },
502
+ {
503
+ "id": "big_beam",
504
+ "name": {
505
+ "en": "Big beam"
506
+ },
507
+ "tell": {
508
+ "en": "A thin line of light drops where you stand"
509
+ },
510
+ "effect": {
511
+ "en": "The light pillar deals 2 damage"
512
+ },
513
+ "counter": {
514
+ "en": "Step aside; after the third beam she sinks within reach and one strike ends her"
515
+ }
516
+ },
517
+ {
518
+ "id": "teleport",
519
+ "name": {
520
+ "en": "Teleport"
521
+ },
522
+ "tell": {
523
+ "en": "She dissolves into light and re-forms elsewhere"
524
+ },
525
+ "effect": {
526
+ "en": "No direct damage"
527
+ },
528
+ "counter": {
529
+ "en": "Re-locate her; do not chase blindly"
530
+ }
531
+ },
532
+ {
533
+ "id": "scream",
534
+ "name": {
535
+ "en": "Scream"
536
+ },
537
+ "tell": {
538
+ "en": "She screams and the arena changes"
539
+ },
540
+ "effect": {
541
+ "en": "No direct damage, but marks a phase change"
542
+ },
543
+ "counter": {
544
+ "en": "Use the moment to reposition for the new arena"
545
+ }
546
+ }
547
+ ],
548
+ "phases": [
549
+ {
550
+ "en": "After a stagger the arena becomes an abyss with footholds; after the last big beams she sinks low and can be finished with one strike."
551
+ }
552
+ ]
553
+ },
554
+ {
555
+ "case_id": "2d/needle_warden",
556
+ "boss": {
557
+ "en": "Green-Robed Lancer"
558
+ },
559
+ "summary": {
560
+ "en": "An agile green-robed fighter attacks with a spear, dashes and whirlwinds; her pause after throwing gives you an opening."
561
+ },
562
+ "moves": [
563
+ {
564
+ "id": "g_dash",
565
+ "name": {
566
+ "en": "Ground dash"
567
+ },
568
+ "tell": {
569
+ "en": "Crouches low facing you with the spear drawn back"
570
+ },
571
+ "effect": {
572
+ "en": "Contact damage during the dash"
573
+ },
574
+ "counter": {
575
+ "en": "Jump over her and pogo; she slides to a stop for about 0.33 s"
576
+ }
577
+ },
578
+ {
579
+ "id": "a_dash",
580
+ "name": {
581
+ "en": "Aerial dash"
582
+ },
583
+ "tell": {
584
+ "en": "Jumps, then freezes mid-air and aims at your feet; the aim is locked when the freeze starts"
585
+ },
586
+ "effect": {
587
+ "en": "Dives along the locked line"
588
+ },
589
+ "counter": {
590
+ "en": "Move once she freezes; the 0.5 s hard landing is your opening"
591
+ }
592
+ },
593
+ {
594
+ "id": "throw",
595
+ "name": {
596
+ "en": "Spear throw"
597
+ },
598
+ "tell": {
599
+ "en": "Rears back with the spear; always thrown horizontally"
600
+ },
601
+ "effect": {
602
+ "en": "The spear flies horizontally and hurts on its way out and back"
603
+ },
604
+ "counter": {
605
+ "en": "Jump it; she stands still until the spear returns (about 1 s), so attack her then"
606
+ }
607
+ },
608
+ {
609
+ "id": "g_sphere",
610
+ "name": {
611
+ "en": "Ground whirlwind"
612
+ },
613
+ "tell": {
614
+ "en": "Plants her feet while a whirlwind gathers around her"
615
+ },
616
+ "effect": {
617
+ "en": "The whirlwind hurts when it bursts"
618
+ },
619
+ "counter": {
620
+ "en": "Keep away from her; about 0.17 s of recovery after the burst"
621
+ }
622
+ },
623
+ {
624
+ "id": "a_sphere",
625
+ "name": {
626
+ "en": "Aerial whirlwind"
627
+ },
628
+ "tell": {
629
+ "en": "Stalls on the way down while a whirlwind gathers"
630
+ },
631
+ "effect": {
632
+ "en": "The whirlwind hurts when it bursts"
633
+ },
634
+ "counter": {
635
+ "en": "Go around; do not stand right below her"
636
+ }
637
+ },
638
+ {
639
+ "id": "evade",
640
+ "name": {
641
+ "en": "Back-step"
642
+ },
643
+ "tell": {
644
+ "en": "Short crouch, then a fast back-step when you are close"
645
+ },
646
+ "effect": {
647
+ "en": "Not an attack"
648
+ },
649
+ "counter": {
650
+ "en": "Do not chase; wait for her next move"
651
+ }
652
+ }
653
+ ],
654
+ "phases": [
655
+ {
656
+ "en": "While she throws she stands still, and stagger does not accumulate during that time."
657
+ }
658
+ ]
659
+ },
660
+ {
661
+ "case_id": "2d/pale_vessel",
662
+ "boss": {
663
+ "en": "Split-Chest Swordsman"
664
+ },
665
+ "summary": {
666
+ "en": "A pale swordsman with a split chest and a huge move set: it teleports, counters and sprays orange blobs, and changes forms as its health drops."
667
+ },
668
+ "moves": [
669
+ {
670
+ "id": "slash",
671
+ "name": {
672
+ "en": "Triple slash"
673
+ },
674
+ "tell": {
675
+ "en": "Plants the blade behind its shoulder, then three wide swings stepping forward; the 2nd and 3rd also reach behind it"
676
+ },
677
+ "effect": {
678
+ "en": "All three swings have a wide reach"
679
+ },
680
+ "counter": {
681
+ "en": "Back off or jump; about 0.33 s of recovery after the third swing"
682
+ }
683
+ },
684
+ {
685
+ "id": "dash",
686
+ "name": {
687
+ "en": "Lunge dash"
688
+ },
689
+ "tell": {
690
+ "en": "Crouches with the blade pointed forward, then lunges along the ground"
691
+ },
692
+ "effect": {
693
+ "en": "Contact damage along the ground"
694
+ },
695
+ "counter": {
696
+ "en": "Jump it; it slides to a stop for about 0.45 s, your opening"
697
+ }
698
+ },
699
+ {
700
+ "id": "counter",
701
+ "name": {
702
+ "en": "Counter stance"
703
+ },
704
+ "tell": {
705
+ "en": "Raises the blade; when it shines, a frontal hit is blocked and answered by a fast sliding riposte"
706
+ },
707
+ "effect": {
708
+ "en": "Hitting the front gets you riposted"
709
+ },
710
+ "counter": {
711
+ "en": "Do not hit the front while the blade shines; it lowers the guard after about 0.75 s"
712
+ }
713
+ },
714
+ {
715
+ "id": "evade",
716
+ "name": {
717
+ "en": "Hop back"
718
+ },
719
+ "tell": {
720
+ "en": "Hops backwards away from a close player, often straight into another attack"
721
+ },
722
+ "effect": {
723
+ "en": "Not an attack itself"
724
+ },
725
+ "counter": {
726
+ "en": "Anticipate the follow-up on landing"
727
+ }
728
+ },
729
+ {
730
+ "id": "jump",
731
+ "name": {
732
+ "en": "Leap"
733
+ },
734
+ "tell": {
735
+ "en": "Crouches and leaps across the room"
736
+ },
737
+ "effect": {
738
+ "en": "Landing on you hurts"
739
+ },
740
+ "counter": {
741
+ "en": "Dodge the landing; about 0.33 s of landing recovery"
742
+ }
743
+ },
744
+ {
745
+ "id": "tele",
746
+ "name": {
747
+ "en": "Teleport"
748
+ },
749
+ "tell": {
750
+ "en": "Fades out and reappears at a distance (or high above you) ready to attack"
751
+ },
752
+ "effect": {
753
+ "en": "Attacks right after reappearing"
754
+ },
755
+ "counter": {
756
+ "en": "Watch where it appears and prepare to dodge"
757
+ }
758
+ },
759
+ {
760
+ "id": "dstab",
761
+ "name": {
762
+ "en": "Plunge stab"
763
+ },
764
+ "tell": {
765
+ "en": "Leaps (or teleports) above you, hangs with the blade pointing down, then slams into the floor"
766
+ },
767
+ "effect": {
768
+ "en": "The slam hurts and the pillars burst"
769
+ },
770
+ "counter": {
771
+ "en": "Leave the spot; it stands for about 1.1 s after landing while the pillars burst"
772
+ }
773
+ },
774
+ {
775
+ "id": "plume",
776
+ "name": {
777
+ "en": "Fire columns"
778
+ },
779
+ "tell": {
780
+ "en": "Orange glows spread across the floor from where it landed; columns of fire shoot up from every glow at once"
781
+ },
782
+ "effect": {
783
+ "en": "Fire columns deal 2 damage"
784
+ },
785
+ "counter": {
786
+ "en": "Stand in the gaps between glows, or jump"
787
+ }
788
+ },
789
+ {
790
+ "id": "barrage",
791
+ "name": {
792
+ "en": "Blob barrage"
793
+ },
794
+ "tell": {
795
+ "en": "Opens its cloak and sprays 9-10 blobs in a sweeping arc over about three quarters of the room"
796
+ },
797
+ "effect": {
798
+ "en": "Blobs hurt on contact"
799
+ },
800
+ "counter": {
801
+ "en": "Find gaps or the uncovered side; about 0.36 s of recovery"
802
+ }
803
+ },
804
+ {
805
+ "id": "outbreak",
806
+ "name": {
807
+ "en": "Chest outbreak"
808
+ },
809
+ "tell": {
810
+ "en": "Rises to the middle of the room and blobs burst out of its chest in arcs to both sides and downward"
811
+ },
812
+ "effect": {
813
+ "en": "Blobs hurt on contact"
814
+ },
815
+ "counter": {
816
+ "en": "Slip between the arcs; it can be hit from below the whole time, including its fall"
817
+ }
818
+ },
819
+ {
820
+ "id": "puppet",
821
+ "name": {
822
+ "en": "Puppet slams"
823
+ },
824
+ "tell": {
825
+ "en": "Jerked up like a puppet, it floats after you and slams down 2-5 times"
826
+ },
827
+ "effect": {
828
+ "en": "Each slam hurts"
829
+ },
830
+ "counter": {
831
+ "en": "Sidestep each slam; after the last it collapses for about 1.6 s"
832
+ }
833
+ },
834
+ {
835
+ "id": "self_stab",
836
+ "name": {
837
+ "en": "Self stab"
838
+ },
839
+ "tell": {
840
+ "en": "Turns the blade on itself and stabs its own chest; hits only deal 1 meanwhile, then it collapses"
841
+ },
842
+ "effect": {
843
+ "en": "No direct attack on you"
844
+ },
845
+ "counter": {
846
+ "en": "Save your damage for the full stagger after the collapse (about 2.25 s)"
847
+ }
848
+ },
849
+ {
850
+ "id": "weak_slash",
851
+ "name": {
852
+ "en": "Weak slash"
853
+ },
854
+ "tell": {
855
+ "en": "Staggers toward you, raises the blade for one swing and falls to its knees"
856
+ },
857
+ "effect": {
858
+ "en": "One swing"
859
+ },
860
+ "counter": {
861
+ "en": "Dodge the swing; it kneels for a full stagger of about 2.25 s"
862
+ }
863
+ },
864
+ {
865
+ "id": "roar",
866
+ "name": {
867
+ "en": "Roar"
868
+ },
869
+ "tell": {
870
+ "en": "Screams at each phase change"
871
+ },
872
+ "effect": {
873
+ "en": "No direct damage; marks a phase change"
874
+ },
875
+ "counter": {
876
+ "en": "Use it to reposition"
877
+ }
878
+ }
879
+ ],
880
+ "phases": [
881
+ {
882
+ "en": "As health drops it changes form and uses moves such as self stab and weak slash, each phase change marked by a roar."
883
+ }
884
+ ]
885
+ },
886
+ {
887
+ "case_id": "2d/sickle_sisters",
888
+ "boss": {
889
+ "en": "Triple Lancers"
890
+ },
891
+ "summary": {
892
+ "en": "Three lance fighters take turns attacking with dashes, plunges, boomerang blades and two-person combos."
893
+ },
894
+ "moves": [
895
+ {
896
+ "id": "dash",
897
+ "name": {
898
+ "en": "Floor-crossing dash"
899
+ },
900
+ "tell": {
901
+ "en": "Appears crouched at one end of the floor with the lance drawn back, then crosses the whole floor"
902
+ },
903
+ "effect": {
904
+ "en": "The whole floor is the damage path"
905
+ },
906
+ "counter": {
907
+ "en": "Jump it; it stands at the far end for about 0.63 s, your opening"
908
+ }
909
+ },
910
+ {
911
+ "id": "dstab",
912
+ "name": {
913
+ "en": "Plunge stab"
914
+ },
915
+ "tell": {
916
+ "en": "Appears high above you pointing the lance down, then drops straight onto the floor"
917
+ },
918
+ "effect": {
919
+ "en": "Drops straight on you"
920
+ },
921
+ "counter": {
922
+ "en": "Move sideways when it appears; about 0.67 s of landing pose"
923
+ }
924
+ },
925
+ {
926
+ "id": "throw",
927
+ "name": {
928
+ "en": "Blade throw"
929
+ },
930
+ "tell": {
931
+ "en": "Clings to a side wall high (blade will sink) or low (blade will rise) and winds up a throw"
932
+ },
933
+ "effect": {
934
+ "en": "Throws a boomerang blade"
935
+ },
936
+ "counter": {
937
+ "en": "Anticipate the rise or sink; she hangs on the wall about 1.2 s after the throw, so strike then"
938
+ }
939
+ },
940
+ {
941
+ "id": "blade",
942
+ "name": {
943
+ "en": "Spinning blade"
944
+ },
945
+ "tell": {
946
+ "en": "A spinning blade crosses the room, slows, and flies back to the thrower"
947
+ },
948
+ "effect": {
949
+ "en": "Hurts both going and returning"
950
+ },
951
+ "counter": {
952
+ "en": "Jump it and watch for the return"
953
+ }
954
+ },
955
+ {
956
+ "id": "high_throw",
957
+ "name": {
958
+ "en": "High throw"
959
+ },
960
+ "tell": {
961
+ "en": "When you hug a wall, a fighter appears on the far wall at your height and throws"
962
+ },
963
+ "effect": {
964
+ "en": "Throws a blade at your height"
965
+ },
966
+ "counter": {
967
+ "en": "Do not hug the wall; move up or down off the line"
968
+ }
969
+ },
970
+ {
971
+ "id": "duo",
972
+ "name": {
973
+ "en": "Duo combo"
974
+ },
975
+ "tell": {
976
+ "en": "Two fighters at once: dash + plunge combos, a pincer dash from both ends, or blades from both walls"
977
+ },
978
+ "effect": {
979
+ "en": "Attacks from two directions at once"
980
+ },
981
+ "counter": {
982
+ "en": "Read both positions first; jump in the gap between the two attacks"
983
+ }
984
+ }
985
+ ],
986
+ "phases": [
987
+ {
988
+ "en": "As health drops, the fight goes from one fighter at a time to two at once, and finally only one remains."
989
+ }
990
+ ]
991
+ }
992
+ ]
993
+ }
environments/games/prototype/bossbench_llm/prompts/games/isaac_remake.json ADDED
@@ -0,0 +1,534 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "schema": "bossbench-llm/game-prompt@1",
3
+ "game": "isaac_remake",
4
+ "rules": "isaac-basement@3",
5
+ "title": {
6
+ "en": "Tear Kid: Basement Boss Rooms"
7
+ },
8
+ "dimension": "2d",
9
+ "view": {
10
+ "en": "Top-down 2D sealed boss room shown on one screen, possibly with rocks inside. You control a bald child, the Tear Kid, with twin-stick controls: one set of keys moves, another set shoots tears in four directions. Your hearts (half-heart steps) are at the top left and the boss's health bar is at the top"
11
+ },
12
+ "goal": {
13
+ "en": "Empty the boss's health bar to win; you lose when all your hearts are gone; each fight lasts at most 300 seconds and a timeout is not a win. Health does not regenerate. A versus banner shows at the start and the boss only starts acting after about 1.3 seconds"
14
+ },
15
+ "mouse": {
16
+ "kind": "none",
17
+ "en": "The mouse is not used"
18
+ },
19
+ "keys": [
20
+ {
21
+ "key": "W",
22
+ "en": "move up (eight directions, with inertia)"
23
+ },
24
+ {
25
+ "key": "A",
26
+ "en": "move left"
27
+ },
28
+ {
29
+ "key": "S",
30
+ "en": "move down"
31
+ },
32
+ {
33
+ "key": "D",
34
+ "en": "move right"
35
+ },
36
+ {
37
+ "key": "J",
38
+ "en": "hold to shoot tears left"
39
+ },
40
+ {
41
+ "key": "K",
42
+ "en": "hold to shoot tears down"
43
+ },
44
+ {
45
+ "key": "L",
46
+ "en": "hold to shoot tears right"
47
+ },
48
+ {
49
+ "key": "Shift",
50
+ "en": "hold to shoot tears up"
51
+ },
52
+ {
53
+ "key": "E",
54
+ "en": "place a bomb: you start with only 1; it deals big damage but costs you a whole heart if it hits you"
55
+ }
56
+ ],
57
+ "notes": [
58
+ {
59
+ "en": "Moving and shooting are independent: you can retreat left while shooting right. When several shoot keys are held only the most recent direction counts, so hold one at a time"
60
+ },
61
+ {
62
+ "en": "Tears only go in four directions with no aiming; to hit the boss, line yourself up with its row or column, and tears have limited range"
63
+ },
64
+ {
65
+ "en": "After a hit you are invulnerable for a while (about 1 second for half a heart, about 2 seconds for a full heart) and are pushed away; you cannot be hurt during it"
66
+ },
67
+ {
68
+ "en": "Most contact and small shots cost half a heart; large tears and your own bomb cost a full heart; at high difficulty half-heart hits also become full hearts. At zero health you fall and lose after about a second"
69
+ },
70
+ {
71
+ "en": "You carry a fixed set of passive upgrades (fire rate, damage, range, special tears such as multi-shot, piercing, homing, bouncing) that apply automatically; there is no active item to use"
72
+ },
73
+ {
74
+ "en": "The bomb is a one-off burst of heavy damage; save it for when the boss is close, and step away yourself"
75
+ }
76
+ ],
77
+ "compact_glossary": {
78
+ "move": {
79
+ "en": "eight-direction movement with WASD held for the whole 200 ms",
80
+ "options": {
81
+ "none": "stand still",
82
+ "up": "walk up",
83
+ "up_right": "walk up-right",
84
+ "right": "walk right",
85
+ "down_right": "walk down-right",
86
+ "down": "walk down",
87
+ "down_left": "walk down-left",
88
+ "left": "walk left",
89
+ "up_left": "walk up-left"
90
+ }
91
+ },
92
+ "fire": {
93
+ "en": "shoot tears in one of four directions, held for the whole 200 ms",
94
+ "options": {
95
+ "none": "do not shoot",
96
+ "up": "shoot up",
97
+ "down": "shoot down",
98
+ "left": "shoot left",
99
+ "right": "shoot right"
100
+ }
101
+ },
102
+ "bomb": {
103
+ "en": "place the single starting bomb",
104
+ "options": {
105
+ "none": "no bomb",
106
+ "place": "place a bomb under you"
107
+ }
108
+ }
109
+ },
110
+ "scenes": [
111
+ {
112
+ "case_id": "isaac/monstro",
113
+ "boss": {
114
+ "en": "Hopping Blob"
115
+ },
116
+ "summary": {
117
+ "en": "A huge blob in an open room that hops at you, spits shot spreads and leaps to crash down on you. It is dangerous up close, so keep your distance and circle while shooting"
118
+ },
119
+ "moves": [
120
+ {
121
+ "id": "hop",
122
+ "name": {
123
+ "en": "Small hops"
124
+ },
125
+ "tell": {
126
+ "en": "It crouches briefly, then hops, 1 to 3 times in a row"
127
+ },
128
+ "effect": {
129
+ "en": "It lands toward where you were at takeoff; it is harmless in the air, and its body costs half a heart on contact after landing"
130
+ },
131
+ "counter": {
132
+ "en": "Sidestep the landing spot and shoot it during its short pause after landing"
133
+ }
134
+ },
135
+ {
136
+ "id": "spit",
137
+ "name": {
138
+ "en": "Spit spread"
139
+ },
140
+ "tell": {
141
+ "en": "Its cheeks puff up, then about half a second later it fires a fan of shots at once"
142
+ },
143
+ "effect": {
144
+ "en": "A scattered fan aimed toward you with varied speeds and ranges; most are small shots costing half a heart, a few are big tears costing a full heart"
145
+ },
146
+ "counter": {
147
+ "en": "While it puffs, move sideways into a gap of the fan, or back off so the shots spread out"
148
+ }
149
+ },
150
+ {
151
+ "id": "slam",
152
+ "name": {
153
+ "en": "Leap slam"
154
+ },
155
+ "tell": {
156
+ "en": "It crouches deep and leaps up off the screen; a shadow follows you on the ground, then locks as a red dashed circle"
157
+ },
158
+ "effect": {
159
+ "en": "Anything inside the circle is hurt when it lands, then it sprays a ring of shots outward"
160
+ },
161
+ "counter": {
162
+ "en": "Run out of the circle once it locks, then dodge the ring and shoot after landing"
163
+ }
164
+ }
165
+ ],
166
+ "phases": []
167
+ },
168
+ {
169
+ "case_id": "isaac/larry_jr",
170
+ "boss": {
171
+ "en": "Segment Worm"
172
+ },
173
+ "summary": {
174
+ "en": "A long worm made of many segments that crawls along the grid in right-angle turns, leaving dung piles behind. Every segment can be shot, and cutting it splits it in two"
175
+ },
176
+ "moves": [
177
+ {
178
+ "id": "crawl",
179
+ "name": {
180
+ "en": "Grid crawl"
181
+ },
182
+ "tell": {
183
+ "en": "The head advances along the grid centre lines and the body segments follow its path"
184
+ },
185
+ "effect": {
186
+ "en": "Any segment touching you costs half a heart; it has no ranged attack"
187
+ },
188
+ "counter": {
189
+ "en": "Stand in a row or column it will not turn into, and shoot approaching segments from the side"
190
+ }
191
+ },
192
+ {
193
+ "id": "chase_turn",
194
+ "name": {
195
+ "en": "Turning toward you"
196
+ },
197
+ "tell": {
198
+ "en": "At a grid centre the head may suddenly turn toward your row or column"
199
+ },
200
+ "effect": {
201
+ "en": "Changes its route and heads straight at you"
202
+ },
203
+ "counter": {
204
+ "en": "Do not stay on one row or column for long; keep moving and leave an escape route"
205
+ }
206
+ },
207
+ {
208
+ "id": "dung",
209
+ "name": {
210
+ "en": "Dung piles"
211
+ },
212
+ "tell": {
213
+ "en": "A dung pile appears on the cell behind its tail"
214
+ },
215
+ "effect": {
216
+ "en": "Piles block the way; the worm smashes one and turns when it hits it, and piles also block your movement and tears"
217
+ },
218
+ "counter": {
219
+ "en": "Use piles to force turns, and do not trap yourself between a pile and a wall"
220
+ }
221
+ },
222
+ {
223
+ "id": "split",
224
+ "name": {
225
+ "en": "Cut and split"
226
+ },
227
+ "tell": {
228
+ "en": "After you kill a middle segment, the worm breaks into two that crawl on separately"
229
+ },
230
+ "effect": {
231
+ "en": "If both parts are long enough they become two separate worms; if the head dies the next segment becomes the new head"
232
+ },
233
+ "counter": {
234
+ "en": "Shoot the nearest segments first and watch for two heads chasing you at once"
235
+ }
236
+ }
237
+ ],
238
+ "phases": [
239
+ {
240
+ "en": "At higher difficulty the worm is longer, faster and turns toward you more often"
241
+ }
242
+ ]
243
+ },
244
+ {
245
+ "case_id": "isaac/duke_of_flies",
246
+ "boss": {
247
+ "en": "Swarm Host"
248
+ },
249
+ "summary": {
250
+ "en": "A big bug body drifting diagonally and bouncing off walls, constantly releasing flies. Flies orbit it to block shots or chase you; you must clear all flies and the body"
251
+ },
252
+ "moves": [
253
+ {
254
+ "id": "drift",
255
+ "name": {
256
+ "en": "Diagonal drift"
257
+ },
258
+ "tell": {
259
+ "en": "The body moves slowly on a diagonal and bounces off walls; tears nudge it along their direction"
260
+ },
261
+ "effect": {
262
+ "en": "Body contact costs half a heart"
263
+ },
264
+ "counter": {
265
+ "en": "Read its diagonal and shoot from a line not covered by flies"
266
+ }
267
+ },
268
+ {
269
+ "id": "summon_orbit",
270
+ "name": {
271
+ "en": "Summon orbiting flies"
272
+ },
273
+ "tell": {
274
+ "en": "Its body swells for about 0.4 seconds, then three flies appear circling it"
275
+ },
276
+ "effect": {
277
+ "en": "Orbiting flies block tears aimed at the body; they are sturdy, and a fly costs half a heart on touching you and then dies"
278
+ },
279
+ "counter": {
280
+ "en": "Shoot down some orbiters before the body, and do not let them pile up to four or five"
281
+ }
282
+ },
283
+ {
284
+ "id": "big_fly",
285
+ "name": {
286
+ "en": "Big fly"
287
+ },
288
+ "tell": {
289
+ "en": "The same swelling tell, then a larger fly appears and chases you"
290
+ },
291
+ "effect": {
292
+ "en": "The big fly chases you and costs half a heart on contact"
293
+ },
294
+ "counter": {
295
+ "en": "Retreat while shooting it down"
296
+ }
297
+ },
298
+ {
299
+ "id": "release",
300
+ "name": {
301
+ "en": "Swarm release"
302
+ },
303
+ "tell": {
304
+ "en": "When five or six orbit it, it swells and they all break away at once"
305
+ },
306
+ "effect": {
307
+ "en": "All orbiting flies turn into chasers at the same time"
308
+ },
309
+ "counter": {
310
+ "en": "Break up the orbiters beforehand, or keep distance and shoot them down piece by piece"
311
+ }
312
+ }
313
+ ],
314
+ "phases": [
315
+ {
316
+ "en": "When the body dies, remaining orbiters turn into chasers; you only win after every fly is dead"
317
+ }
318
+ ]
319
+ },
320
+ {
321
+ "case_id": "isaac/gemini",
322
+ "boss": {
323
+ "en": "Tethered Pair"
324
+ },
325
+ "summary": {
326
+ "en": "A large and a small body joined by a cord: the big one chases and charges, the small one trails behind and shoots at you. Four symmetric rocks serve as cover"
327
+ },
328
+ "moves": [
329
+ {
330
+ "id": "big_chase",
331
+ "name": {
332
+ "en": "Big one chases"
333
+ },
334
+ "tell": {
335
+ "en": "The big one walks slowly toward you"
336
+ },
337
+ "effect": {
338
+ "en": "Touching its body at the feet costs half a heart"
339
+ },
340
+ "counter": {
341
+ "en": "Circle around the rocks and shoot from a distance"
342
+ }
343
+ },
344
+ {
345
+ "id": "big_charge",
346
+ "name": {
347
+ "en": "Big one charge"
348
+ },
349
+ "tell": {
350
+ "en": "After chasing for a while it suddenly speeds up and rushes at you, turning only slowly"
351
+ },
352
+ "effect": {
353
+ "en": "A high-speed hit costs half a heart; after hitting a rock or finishing it stops to pant for a moment"
354
+ },
355
+ "counter": {
356
+ "en": "Sidestep or hide behind a rock when the charge starts, and pour damage in while it pants"
357
+ }
358
+ },
359
+ {
360
+ "id": "small_shot",
361
+ "name": {
362
+ "en": "Small one's shot"
363
+ },
364
+ "tell": {
365
+ "en": "The small one pauses to charge for about 0.3 seconds; it does not shoot when a rock blocks the line"
366
+ },
367
+ "effect": {
368
+ "en": "Fires one shot at you, costing half a heart"
369
+ },
370
+ "counter": {
371
+ "en": "Move during the charge and use rocks for cover"
372
+ }
373
+ },
374
+ {
375
+ "id": "small_rush",
376
+ "name": {
377
+ "en": "Freed small one rush"
378
+ },
379
+ "tell": {
380
+ "en": "After the big one dies, the small one breaks free and accelerates at you with heavy inertia, overshooting"
381
+ },
382
+ "effect": {
383
+ "en": "Contact costs half a heart; being hit by tears actually speeds it up"
384
+ },
385
+ "counter": {
386
+ "en": "Circle it, and shoot from the side or behind after it overshoots"
387
+ }
388
+ }
389
+ ],
390
+ "phases": [
391
+ {
392
+ "en": "Killing the big one first frees the small one to rush; killing the small one first leaves the big one unchanged"
393
+ }
394
+ ]
395
+ },
396
+ {
397
+ "case_id": "isaac/famine",
398
+ "boss": {
399
+ "en": "Charging Rider"
400
+ },
401
+ "summary": {
402
+ "en": "A horse and rider that charge along horizontal lanes and summon shot-spitting flies. At low health only a head remains and creeps toward you. Contact costs a full heart in both phases"
403
+ },
404
+ "moves": [
405
+ {
406
+ "id": "charge",
407
+ "name": {
408
+ "en": "Lane charge"
409
+ },
410
+ "tell": {
411
+ "en": "When you stand in the red horizontal lane at its level it rears for about half a second, then dashes across the screen and returns from the other side"
412
+ },
413
+ "effect": {
414
+ "en": "Hitting you costs a full heart, and it also crushes the flies"
415
+ },
416
+ "counter": {
417
+ "en": "Avoid staying in its lane; move up or down out of the red lane when it rears"
418
+ }
419
+ },
420
+ {
421
+ "id": "summon_fly",
422
+ "name": {
423
+ "en": "Summon spitting flies"
424
+ },
425
+ "tell": {
426
+ "en": "It stops for a summoning pose of about half a second and a fly appears beside it"
427
+ },
428
+ "effect": {
429
+ "en": "The fly drifts slowly toward you and, at close range, charges and spits one shot costing half a heart; it does no contact damage and at most 2 exist"
430
+ },
431
+ "counter": {
432
+ "en": "Shoot the flies first, or lure the rider into charging through them"
433
+ }
434
+ },
435
+ {
436
+ "id": "align",
437
+ "name": {
438
+ "en": "Line up and retreat"
439
+ },
440
+ "tell": {
441
+ "en": "When the flies are at the limit it moves to your row and backs to the far end"
442
+ },
443
+ "effect": {
444
+ "en": "Sets up the next lane charge"
445
+ },
446
+ "counter": {
447
+ "en": "Change rows as soon as you see it line up"
448
+ }
449
+ },
450
+ {
451
+ "id": "head_fan",
452
+ "name": {
453
+ "en": "Head triple shot"
454
+ },
455
+ "tell": {
456
+ "en": "In the second phase only the head creeps closer, stops for about 0.4 seconds, then fires"
457
+ },
458
+ "effect": {
459
+ "en": "Fires a three-shot fan toward you"
460
+ },
461
+ "counter": {
462
+ "en": "Step sideways when it stops, and shoot it between volleys"
463
+ }
464
+ }
465
+ ],
466
+ "phases": [
467
+ {
468
+ "en": "At low health the horse and body burst apart, leaving only a head that approaches and fires triple shots; no more lane charges"
469
+ }
470
+ ]
471
+ },
472
+ {
473
+ "case_id": "isaac/envy",
474
+ "boss": {
475
+ "en": "Splitting Head"
476
+ },
477
+ "summary": {
478
+ "en": "A big head always flies on 45-degree diagonals and bounces off walls. Each time it dies it splits into two smaller, faster heads, for three generations, so more and more heads fill the room"
479
+ },
480
+ "moves": [
481
+ {
482
+ "id": "bounce",
483
+ "name": {
484
+ "en": "Diagonal bounce"
485
+ },
486
+ "tell": {
487
+ "en": "The head flies diagonally and bounces off walls, sometimes bouncing toward you"
488
+ },
489
+ "effect": {
490
+ "en": "Contact costs half a heart; no ranged attack"
491
+ },
492
+ "counter": {
493
+ "en": "Predict the diagonal path and shoot from outside it"
494
+ }
495
+ },
496
+ {
497
+ "id": "home_in",
498
+ "name": {
499
+ "en": "Steering toward you"
500
+ },
501
+ "tell": {
502
+ "en": "Every second or two its diagonal suddenly turns toward you at the same speed"
503
+ },
504
+ "effect": {
505
+ "en": "A player standing still is easily hit"
506
+ },
507
+ "counter": {
508
+ "en": "Do not stand in doorways or corners; keep moving and keep space around you"
509
+ }
510
+ },
511
+ {
512
+ "id": "split",
513
+ "name": {
514
+ "en": "Split on death"
515
+ },
516
+ "tell": {
517
+ "en": "When a head dies it becomes two smaller heads that fly apart"
518
+ },
519
+ "effect": {
520
+ "en": "The smaller they are, the faster and harder to hit"
521
+ },
522
+ "counter": {
523
+ "en": "Break the big head from far away so you have time to react to the small ones"
524
+ }
525
+ }
526
+ ],
527
+ "phases": [
528
+ {
529
+ "en": "Three splits in total: big head into two medium, each into two small, each into two tiny ones; you win only when all are gone"
530
+ }
531
+ ]
532
+ }
533
+ ]
534
+ }
environments/games/prototype/bossbench_llm/prompts/games/kirby_remake.json ADDED
@@ -0,0 +1,508 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "schema": "bossbench-llm/game-prompt@1",
3
+ "game": "kirby_remake",
4
+ "rules": "kdl-bosses-2026-11-05-r8",
5
+ "title": {
6
+ "en": "Round Hero: Inhale-and-Spit Boss Fights"
7
+ },
8
+ "dimension": "2d",
9
+ "view": {
10
+ "en": "Side-view 2D single-screen arena. You control a small round pink creature that walks, jumps, puffs up to float, inhales and spits stars; your health bars and the boss's name and health bar are shown at the top of the screen"
11
+ },
12
+ "goal": {
13
+ "en": "Empty the boss's health bar to win; you lose when your health bars run out; each fight has a time limit and a timeout is not a win. Health does not regenerate. After a hit you blink and are invulnerable for about 1.5 seconds"
14
+ },
15
+ "mouse": {
16
+ "kind": "none",
17
+ "en": "The mouse is not used; LMB does the same as J"
18
+ },
19
+ "keys": [
20
+ {
21
+ "key": "A",
22
+ "en": "walk left (fly left in the airship fight)"
23
+ },
24
+ {
25
+ "key": "D",
26
+ "en": "walk right (fly right in the airship fight)"
27
+ },
28
+ {
29
+ "key": "W",
30
+ "en": "puff up and float and rise in the air; stops an inhale that pulls nothing; rises in the airship fight"
31
+ },
32
+ {
33
+ "key": "S",
34
+ "en": "duck on the ground with an empty mouth; swallows a full mouthful; sinks in the airship fight"
35
+ },
36
+ {
37
+ "key": "Space",
38
+ "en": "jump, higher the longer you hold; press again in the air to puff and float"
39
+ },
40
+ {
41
+ "key": "J",
42
+ "en": "hold to inhale what is in front; with a full mouth press to spit a star; while floating press to blow a puff (harmless to bosses); in the airship fight press to blow an air bullet to the right"
43
+ },
44
+ {
45
+ "key": "LMB",
46
+ "en": "same as J"
47
+ }
48
+ ],
49
+ "notes": [
50
+ {
51
+ "en": "In the ground scenes only a spat star hurts the boss: first inhale something the boss throws (an apple, a walker, a bomb, a box), then spit it back at the boss. You cannot walk while inhaling; reach is about 5 units, about 2.5 units of vertical tolerance"
52
+ },
53
+ {
54
+ "en": "The airship fight controls differ: you fly the whole fight, with no jumping or inhaling. A/D move horizontally and stop at once, W rises fast, S sinks slower, and with neither you hang in the air; you always face right, and each J/LMB press blows one air bullet to the right (about one every 0.25 s, at most two in the air). Stay on the left of the airship to hit it"
55
+ },
56
+ {
57
+ "en": "J and jump trigger on the press: inhale, spit, jump and puff all start the moment the key goes down; holding J keeps inhaling and holding Space makes the jump higher"
58
+ },
59
+ {
60
+ "en": "Pressing J while floating blows a puff and ends the float; holding W keeps flapping upward. A hit knocks you sideways but keeps your mouthful and your float"
61
+ },
62
+ {
63
+ "en": "Some things cannot be inhaled (spiky balls, air puffs) and still hurt you; dodge them. Most hits cost 1 health bar, spiky balls cost 3. Some moves appear only in the extended mode and are tagged expert mode only"
64
+ }
65
+ ],
66
+ "compact_glossary": {
67
+ "mouth": {
68
+ "en": "mouth action (J): inhale, spit, swallow timing",
69
+ "options": {
70
+ "none": "no J",
71
+ "hold": "hold J for the whole packet (inhale, or spit when full)",
72
+ "press_1": "tap J in sub-step 1",
73
+ "press_2": "tap J in sub-step 2",
74
+ "press_3": "tap J in sub-step 3",
75
+ "press_4": "tap J in sub-step 4",
76
+ "press_5": "tap J in sub-step 5",
77
+ "press_6": "tap J in sub-step 6",
78
+ "triple_odd": "tap J in sub-steps 1, 3 and 5",
79
+ "hold_from_2": "hold J from sub-step 2 on"
80
+ }
81
+ },
82
+ "walk": {
83
+ "en": "horizontal movement (A/D)",
84
+ "options": {
85
+ "none": "stand still",
86
+ "left": "hold A the whole packet",
87
+ "right": "hold D the whole packet",
88
+ "left_tap": "tap A in sub-step 1",
89
+ "right_tap": "tap D in sub-step 1",
90
+ "left_half": "hold A for sub-steps 1-3",
91
+ "right_half": "hold D for sub-steps 1-3",
92
+ "left_2": "hold A for sub-steps 1-2",
93
+ "right_2": "hold D for sub-steps 1-2"
94
+ }
95
+ },
96
+ "vertical": {
97
+ "en": "jump / float / duck (Space, W, S)",
98
+ "options": {
99
+ "none": "no vertical key",
100
+ "jump": "hold Space (high jump; rises when puffing in the air)",
101
+ "jump_tap": "tap Space in sub-step 1",
102
+ "jump_late": "press and hold Space from sub-step 2",
103
+ "float": "hold W (puff and rise; rise while flying)",
104
+ "float_tap": "tap W in sub-step 1",
105
+ "float_flap": "tap W in sub-steps 2 and 5",
106
+ "down": "hold S (duck; sink while flying)",
107
+ "down_tap": "tap S (swallow / drop through a thin platform)",
108
+ "down_alt": "tap S in sub-steps 1, 3 and 5",
109
+ "jump_half": "hold Space for the first half (medium jump)"
110
+ }
111
+ }
112
+ },
113
+ "scenes": [
114
+ {
115
+ "case_id": "kirby/kaboola",
116
+ "boss": {
117
+ "en": "Armed Airship"
118
+ },
119
+ "summary": {
120
+ "en": "A shooter-style fight high in the sky: you fly throughout and can only blow air bullets to the right, so stay on the airship's left. A hit gives about 1.5 seconds of blinking with no knockback"
121
+ },
122
+ "moves": [
123
+ {
124
+ "id": "shoot",
125
+ "name": {
126
+ "en": "Cannon Fire"
127
+ },
128
+ "tell": {
129
+ "en": "The cannon opens under the hull (or over it after the blimp rolls over), then fires one bullet, three in a row, or a fan of three"
130
+ },
131
+ "effect": {
132
+ "en": "A bullet hit costs 1 health bar; the straight shots fly about 16 px above or below its centre"
133
+ },
134
+ "counter": {
135
+ "en": "Level with its middle, only the fan's slanted bullets come at you; your air bullets pass through its bullets, so keep firing while dodging"
136
+ }
137
+ },
138
+ {
139
+ "id": "ram",
140
+ "name": {
141
+ "en": "Ram Dash"
142
+ },
143
+ "tell": {
144
+ "en": "The blimp backs away and tips toward your side (up, level or down), then dashes across the screen and floats back"
145
+ },
146
+ "effect": {
147
+ "en": "Contact costs 1 health bar, and you cannot outrun it sideways"
148
+ },
149
+ "counter": {
150
+ "en": "Move out of its line up or down (rising is twice as fast as sinking) and keep firing as it floats back"
151
+ }
152
+ }
153
+ ]
154
+ },
155
+ {
156
+ "case_id": "kirby/king_dedede",
157
+ "boss": {
158
+ "en": "Arena Hammer Brute"
159
+ },
160
+ "summary": {
161
+ "en": "A close-quarters fight on a ring stage: he has four moves, each aimed at where you were. You must inhale things he throws or drops and spit them back"
162
+ },
163
+ "moves": [
164
+ {
165
+ "id": "walk",
166
+ "name": {
167
+ "en": "Waddle and Belly Slide"
168
+ },
169
+ "tell": {
170
+ "en": "Steps back a little, waddles toward you, and within about 3 units throws himself into a belly slide"
171
+ },
172
+ "effect": {
173
+ "en": "The slide costs 1 health bar on contact; he has super armour during the slide and while lying there"
174
+ },
175
+ "counter": {
176
+ "en": "Jump or float over him as the slide starts; a star still hurts him while he lies there"
177
+ }
178
+ },
179
+ {
180
+ "id": "jump",
181
+ "name": {
182
+ "en": "High Leap Slam"
183
+ },
184
+ "tell": {
185
+ "en": "Crouches, then leaps high toward you (straight up if you are overhead) and crashes down"
186
+ },
187
+ "effect": {
188
+ "en": "The landing costs 1 health bar, and two stars pop out beside him, lasting only about 0.6 seconds"
189
+ },
190
+ "counter": {
191
+ "en": "Be inhaling next to the landing spot, then inhale a star and spit it back"
192
+ }
193
+ },
194
+ {
195
+ "id": "inhale",
196
+ "name": {
197
+ "en": "Suction"
198
+ },
199
+ "tell": {
200
+ "en": "Backs off, walks to where you were, opens his mouth and sucks for up to about 1.7 seconds"
201
+ },
202
+ "effect": {
203
+ "en": "If caught you are spat into the ropes for 1 health bar"
204
+ },
205
+ "counter": {
206
+ "en": "Stay out of the roughly 5.75-unit cone in front of his mouth; above or behind him is safe"
207
+ }
208
+ },
209
+ {
210
+ "id": "hammer",
211
+ "name": {
212
+ "en": "Hammer Swing"
213
+ },
214
+ "tell": {
215
+ "en": "Hops in place, walks to where you were, raises the hammer behind him and swings it over his head into the floor in front"
216
+ },
217
+ "effect": {
218
+ "en": "The swing covers his back, his head and about 4 units of floor in front for 1 health bar; one star drops in front of him on the ground hit"
219
+ },
220
+ "counter": {
221
+ "en": "Stand off, then inhale the dropped star and spit it back"
222
+ }
223
+ }
224
+ ]
225
+ },
226
+ {
227
+ "case_id": "kirby/kracko",
228
+ "boss": {
229
+ "en": "One-Eyed Thundercloud"
230
+ },
231
+ "summary": {
232
+ "en": "An aerial fight above the clouds: the cloud floats high and your ammunition is the one-eyed walkers it drops (bombs in the extended mode). It is easiest to hit at the bottom of a swoop"
233
+ },
234
+ "moves": [
235
+ {
236
+ "id": "move",
237
+ "name": {
238
+ "en": "Drift and Swoop"
239
+ },
240
+ "tell": {
241
+ "en": "Drifts about 12 units to the other side; if you are below on that side it rises, then swoops down near the floor and back up"
242
+ },
243
+ "effect": {
244
+ "en": "Touching the cloud costs 1 health bar; a swoop passes about 1.1 units above the floor"
245
+ },
246
+ "counter": {
247
+ "en": "Duck (S) under it or get out of the way; mid-swoop is the best moment to hit it"
248
+ }
249
+ },
250
+ {
251
+ "id": "beam",
252
+ "name": {
253
+ "en": "Spark Beams"
254
+ },
255
+ "tell": {
256
+ "en": "The cloud crackles; sparks shoot out from two opposite points and turn half a circle around it"
257
+ },
258
+ "effect": {
259
+ "en": "Touching a spark costs 1 health bar; they reach about 8.75 units from the centre"
260
+ },
261
+ "counter": {
262
+ "en": "Keep a long horizontal distance and stay off the diagonals"
263
+ }
264
+ },
265
+ {
266
+ "id": "doo",
267
+ "name": {
268
+ "en": "Release Walker"
269
+ },
270
+ "tell": {
271
+ "en": "A one-eyed walker pops out of the cloud and walks toward your side; one in two stops, flashes and sweeps a beam from overhead to the floor in front"
272
+ },
273
+ "effect": {
274
+ "en": "Contact or the beam costs 1 health bar"
275
+ },
276
+ "counter": {
277
+ "en": "This is your ammunition: face it, hold J to inhale it, then jump and spit it straight up at the cloud"
278
+ }
279
+ },
280
+ {
281
+ "id": "bombs",
282
+ "name": {
283
+ "en": "Bomb Drop"
284
+ },
285
+ "only": {
286
+ "en": "expert mode only"
287
+ },
288
+ "tell": {
289
+ "en": "The cloud loops out and back across the arena dropping three bombs that fall and burst above the floor"
290
+ },
291
+ "effect": {
292
+ "en": "A bomb burst that reaches you costs 1 health bar"
293
+ },
294
+ "counter": {
295
+ "en": "Inhale a falling bomb before it bursts; in this mode bombs are the only ammunition, and the far corner is out of reach"
296
+ }
297
+ },
298
+ {
299
+ "id": "charge",
300
+ "name": {
301
+ "en": "Dive Charge"
302
+ },
303
+ "only": {
304
+ "en": "expert mode only"
305
+ },
306
+ "tell": {
307
+ "en": "Rears back away from you, then dives fast down to the floor on your side and loops back"
308
+ },
309
+ "effect": {
310
+ "en": "Contact costs 1 health bar; it is the only attack in this mode that reaches the corner"
311
+ },
312
+ "counter": {
313
+ "en": "Duck under it with S"
314
+ }
315
+ }
316
+ ]
317
+ },
318
+ {
319
+ "case_id": "kirby/lololo_lalala",
320
+ "boss": {
321
+ "en": "Box-Pushing Twins"
322
+ },
323
+ "summary": {
324
+ "en": "A fight in castle corridors: two brothers come out of gates at the ends of a corridor to push a box. The key is turning the box into your weapon"
325
+ },
326
+ "moves": [
327
+ {
328
+ "id": "push",
329
+ "name": {
330
+ "en": "Box Push"
331
+ },
332
+ "tell": {
333
+ "en": "A brother pops out of a gate at one end of the corridor with a box in front of him, stands a moment, then starts pushing"
334
+ },
335
+ "effect": {
336
+ "en": "The box is pushed down the corridor and costs 1 health bar if it hits you"
337
+ },
338
+ "counter": {
339
+ "en": "Get into that corridor ahead of the box, inhale it, and spit the star straight back down the corridor; the brother is right behind it"
340
+ }
341
+ },
342
+ {
343
+ "id": "gate",
344
+ "name": {
345
+ "en": "Gate Change"
346
+ },
347
+ "tell": {
348
+ "en": "After a push ends, the brother goes back through his gate and the gate at the other end opens for the next one"
349
+ },
350
+ "effect": {
351
+ "en": "It does no damage itself, it only changes the direction of the push"
352
+ },
353
+ "counter": {
354
+ "en": "Watch which gate opens and move to that corridor to inhale the box"
355
+ }
356
+ }
357
+ ]
358
+ },
359
+ {
360
+ "case_id": "kirby/poppy_bros_sr",
361
+ "boss": {
362
+ "en": "Bomb-Throwing Jester"
363
+ },
364
+ "summary": {
365
+ "en": "A one-on-one on flat ground: he stays near his spot, and the threat comes from his bombs and big leaps. Bombs are your ammunition"
366
+ },
367
+ "moves": [
368
+ {
369
+ "id": "hop",
370
+ "name": {
371
+ "en": "Small Hops"
372
+ },
373
+ "tell": {
374
+ "en": "Small hops on the spot, back and forth, in two pairs"
375
+ },
376
+ "effect": {
377
+ "en": "His body costs 1 health bar on contact"
378
+ },
379
+ "counter": {
380
+ "en": "He only hops in place; stay a few units away and wait for the bomb"
381
+ }
382
+ },
383
+ {
384
+ "id": "throw",
385
+ "name": {
386
+ "en": "Bomb Throw"
387
+ },
388
+ "tell": {
389
+ "en": "Jumps straight up with a bomb overhead; either lobs it from the top of the jump, or hangs there, lands and rolls it along the floor"
390
+ },
391
+ "effect": {
392
+ "en": "The bomb comes toward you and bursts in a 5 by 5 unit blast where its path ends, costing 1 health bar"
393
+ },
394
+ "counter": {
395
+ "en": "Inhale the bomb first, then spit it back at him"
396
+ }
397
+ },
398
+ {
399
+ "id": "leap",
400
+ "name": {
401
+ "en": "Huge Leap"
402
+ },
403
+ "tell": {
404
+ "en": "A medium hop toward you and back, then a huge leap across the room; he always returns to his spot"
405
+ },
406
+ "effect": {
407
+ "en": "Contact near the landing costs 1 health bar; he drops no bomb during the leap"
408
+ },
409
+ "counter": {
410
+ "en": "Get clear of the landing, or duck (his box stops about 9 px above his feet)"
411
+ }
412
+ },
413
+ {
414
+ "id": "dash",
415
+ "name": {
416
+ "en": "Floor Dash"
417
+ },
418
+ "only": {
419
+ "en": "expert mode only"
420
+ },
421
+ "tell": {
422
+ "en": "Backs up a step and dashes across the floor at full speed, then runs back"
423
+ },
424
+ "effect": {
425
+ "en": "Contact costs 1 health bar"
426
+ },
427
+ "counter": {
428
+ "en": "Jump or float over the dash, or duck under his box"
429
+ }
430
+ }
431
+ ]
432
+ },
433
+ {
434
+ "case_id": "kirby/whispy_woods",
435
+ "boss": {
436
+ "en": "Ancient Apple Tree"
437
+ },
438
+ "summary": {
439
+ "en": "A stationary target on a grassy field: the tree stands at one end and attacks with air puffs and falling apples. Inhale its apples and spit them at the trunk"
440
+ },
441
+ "moves": [
442
+ {
443
+ "id": "puffs",
444
+ "name": {
445
+ "en": "Air Puff"
446
+ },
447
+ "tell": {
448
+ "en": "The mouth opens into an O, then an air puff shoots out low along the floor, drifting up or down"
449
+ },
450
+ "effect": {
451
+ "en": "A puff costs 1 health bar on contact and cannot be inhaled"
452
+ },
453
+ "counter": {
454
+ "en": "Hop or float over it, or duck under one drifting up"
455
+ }
456
+ },
457
+ {
458
+ "id": "puff_burst",
459
+ "name": {
460
+ "en": "Puff Burst"
461
+ },
462
+ "tell": {
463
+ "en": "Four puffs in quick succession, the mouth snapping open each time"
464
+ },
465
+ "effect": {
466
+ "en": "Each puff costs 1 health bar on contact"
467
+ },
468
+ "counter": {
469
+ "en": "Float above the floor until the burst passes"
470
+ }
471
+ },
472
+ {
473
+ "id": "apples",
474
+ "name": {
475
+ "en": "Falling Apples"
476
+ },
477
+ "tell": {
478
+ "en": "An apple blinks among the leaves, drops, then bounces along the floor toward you"
479
+ },
480
+ "effect": {
481
+ "en": "An apple hitting you costs 1 health bar"
482
+ },
483
+ "counter": {
484
+ "en": "Face it, hold J to inhale it, then spit it at the trunk; this is the only way to hurt the tree"
485
+ }
486
+ },
487
+ {
488
+ "id": "drop",
489
+ "name": {
490
+ "en": "Mixed Drop"
491
+ },
492
+ "only": {
493
+ "en": "expert mode only"
494
+ },
495
+ "tell": {
496
+ "en": "A spiky ball, then an apple, then either one, are dropped in turn"
497
+ },
498
+ "effect": {
499
+ "en": "A spiky ball costs 3 health bars on contact and cannot be inhaled"
500
+ },
501
+ "counter": {
502
+ "en": "Only the apples are ammunition; dodge the spiky balls"
503
+ }
504
+ }
505
+ ]
506
+ }
507
+ ]
508
+ }
environments/games/prototype/bossbench_llm/prompts/games/kof_remake.json ADDED
@@ -0,0 +1,811 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "schema": "bossbench-llm/game-prompt@1",
3
+ "game": "kof_remake",
4
+ "rules": "kof97-advanced-v8",
5
+ "title": {
6
+ "en": "Fighting Arena: One-on-One Duels"
7
+ },
8
+ "dimension": "2d",
9
+ "view": {
10
+ "en": "Side-view 2D fighting: you control the Flame Fist against one opponent on a flat stage. Health bars and power gauges are at the top left and right, with the round timer in the middle; the mouse is not used."
11
+ },
12
+ "goal": {
13
+ "en": "Empty the opponent's health bar to win; you lose if yours reaches zero. Each round is timed and, on timeout, the fighter with the larger share of health wins. Health does not regenerate by itself; only after knocking out an opponent do you recover a share depending on remaining time."
14
+ },
15
+ "mouse": {
16
+ "kind": "none",
17
+ "en": ""
18
+ },
19
+ "keys": [
20
+ {
21
+ "key": "W",
22
+ "en": "jump (same as Space)"
23
+ },
24
+ {
25
+ "key": "A",
26
+ "en": "move left; held while facing right it blocks"
27
+ },
28
+ {
29
+ "key": "S",
30
+ "en": "crouch; back-down blocks low attacks"
31
+ },
32
+ {
33
+ "key": "D",
34
+ "en": "move right; held while facing left it blocks"
35
+ },
36
+ {
37
+ "key": "Space",
38
+ "en": "jump (same as W)"
39
+ },
40
+ {
41
+ "key": "J",
42
+ "en": "light punch"
43
+ },
44
+ {
45
+ "key": "K",
46
+ "en": "light kick"
47
+ },
48
+ {
49
+ "key": "L",
50
+ "en": "heavy punch"
51
+ },
52
+ {
53
+ "key": "Q",
54
+ "en": "heavy kick"
55
+ },
56
+ {
57
+ "key": "Shift",
58
+ "en": "roll (same as J+K pressed together); while blocking, a one-gauge guard cancel"
59
+ },
60
+ {
61
+ "key": "E",
62
+ "en": "enter MAX mode (one gauge, same as J+K+L together)"
63
+ },
64
+ {
65
+ "key": "R",
66
+ "en": "super helper key (needs one gauge): triggers the charged flame sweep"
67
+ }
68
+ ],
69
+ "notes": [
70
+ {
71
+ "en": "Directions are absolute left/right and do not flip with facing; read which way you face from the screen, then convert forward/back. When facing left, mirror the left/right in the commands below."
72
+ },
73
+ {
74
+ "en": "Your command specials (key sequences facing right; middle diagonals may be omitted): down, down-forward, forward + punch = dash punch (heavy punch = heavy dash punch); forward, down, down-forward + punch = rising fire punch (anti-air, brief invulnerability on start-up); down, down-forward, forward + kick = two-hit kick; back, down, down-back + kick = leaping downward kick; forward, down-forward, down, down-back, back + kick = dash kick."
75
+ },
76
+ {
77
+ "en": "Supers need one gauge: down, down-forward, forward, down, down-forward, forward + punch = multi-hit rush combo; down, down-back, back, down-back, down, down-forward, forward + punch = charged flame sweep, or simply press R. Without a gauge the same input only produces the final special."
78
+ },
79
+ {
80
+ "en": "Commands are lenient: middle diagonals may be skipped and the button may be pressed about 50 ms before the direction. Normal attacks can only cancel into specials or supers."
81
+ },
82
+ {
83
+ "en": "Block by holding back: standing back blocks mid attacks and jump-ins, back-down blocks lows; holding back in the air blocks air attacks and projectiles. Command throws cannot be blocked or teched."
84
+ },
85
+ {
86
+ "en": "Up close, forward or back plus heavy punch/kick is a throw; press heavy punch or kick to tech a normal throw. Heavy punch + heavy kick is a launcher, and while blocking it is a one-gauge guard cancel. Combo keys must be pressed within about 50 ms."
87
+ },
88
+ {
89
+ "en": "Power gauge: it rises when you hit, when you are blocked and when you are hit, and carries over between rounds. Supers in MAX mode are stronger. Both fighters pause briefly when a super starts."
90
+ },
91
+ {
92
+ "en": "Depending on difficulty a match can be 1 to 3 opponents in a row, one round each; after a knockout there is a short swap, and more remaining time restores more health (limited fraction)."
93
+ }
94
+ ],
95
+ "compact_glossary": {
96
+ "direction": {
97
+ "en": "direction or command direction sequence (absolute left/right); the attack button below is pressed on the last sub-step of a sequence",
98
+ "options": {
99
+ "none": "no direction",
100
+ "left": "hold left",
101
+ "right": "hold right",
102
+ "down": "hold down (crouch)",
103
+ "down_left": "hold down-left (crouch block when facing right)",
104
+ "down_right": "hold down-right (crouch block when facing left)",
105
+ "down_short": "down for two sub-steps then release",
106
+ "tap_left": "tap left on sub-step 1 (for roll / close throw)",
107
+ "tap_right": "tap right on sub-step 1 (for roll / close throw)",
108
+ "dash_left": "double-tap left and hold (run when facing left)",
109
+ "dash_right": "double-tap right and hold (run when facing right)",
110
+ "double_left": "double-tap left (back hop when facing right)",
111
+ "double_right": "double-tap right (back hop when facing left)",
112
+ "jump_up": "vertical jump (up for 3 sub-steps)",
113
+ "jump_left": "jump left",
114
+ "jump_right": "jump right",
115
+ "hop_left": "short hop left (up on sub-step 1 only)",
116
+ "hop_right": "short hop right (up on sub-step 1 only)",
117
+ "superjump_left": "down then up-left: high jump left",
118
+ "superjump_right": "down then up-right: high jump right",
119
+ "qcf_left": "quarter-circle motion toward the left, done on sub-step 3",
120
+ "qcf_right": "quarter-circle motion toward the right, done on sub-step 3",
121
+ "dp_left": "rising-punch motion toward the left, done on sub-step 3",
122
+ "dp_right": "rising-punch motion toward the right, done on sub-step 3",
123
+ "hcb_left": "half-circle motion ending left, done on sub-step 5",
124
+ "hcb_right": "half-circle motion ending right, done on sub-step 5",
125
+ "double_qcf_left": "simplified double quarter-circle leftward, done on sub-step 4",
126
+ "double_qcf_right": "simplified double quarter-circle rightward, done on sub-step 4"
127
+ }
128
+ },
129
+ "button": {
130
+ "en": "attack button and press timing within the 200 ms packet; combine with a command direction to perform a special",
131
+ "options": {
132
+ "none": "no attack button",
133
+ "lp_1": "light punch pressed on sub-step 1",
134
+ "lp_3": "light punch pressed on sub-step 3",
135
+ "lp_4": "light punch pressed on sub-step 4",
136
+ "lp_5": "light punch pressed on sub-step 5",
137
+ "lk_1": "light kick pressed on sub-step 1",
138
+ "lk_3": "light kick pressed on sub-step 3",
139
+ "lk_4": "light kick pressed on sub-step 4",
140
+ "lk_5": "light kick pressed on sub-step 5",
141
+ "hp_1": "heavy punch pressed on sub-step 1",
142
+ "hp_3": "heavy punch pressed on sub-step 3",
143
+ "hp_4": "heavy punch pressed on sub-step 4",
144
+ "hp_5": "heavy punch pressed on sub-step 5",
145
+ "hk_1": "heavy kick pressed on sub-step 1",
146
+ "hk_3": "heavy kick pressed on sub-step 3",
147
+ "hk_4": "heavy kick pressed on sub-step 4",
148
+ "hk_5": "heavy kick pressed on sub-step 5",
149
+ "lp_x3": "light punch three times (sub-steps 1,3,5)",
150
+ "lk_x3": "light kick three times (sub-steps 1,3,5)",
151
+ "super": "super helper key R (needs one gauge)",
152
+ "roll": "roll (Shift); guard cancel while blocking",
153
+ "max": "enter MAX mode (E, needs one gauge)",
154
+ "blowaway": "launcher: heavy punch + heavy kick together"
155
+ }
156
+ }
157
+ },
158
+ "scenes": [
159
+ {
160
+ "case_id": "kof97/iori",
161
+ "boss": {
162
+ "en": "Violet Claw"
163
+ },
164
+ "summary": {
165
+ "en": "A close-pressure fighter with ground flame shots, claw chains and an invulnerable rising anti-air; with gauge it unleashes a rush frenzy."
166
+ },
167
+ "moves": [
168
+ {
169
+ "id": "ground_flame",
170
+ "name": {
171
+ "en": "Ground Violet Flame"
172
+ },
173
+ "tell": {
174
+ "en": "He crouches and pushes out a violet flame along the ground."
175
+ },
176
+ "effect": {
177
+ "en": "Projectile with medium damage."
178
+ },
179
+ "counter": {
180
+ "en": "Jump over it and close in; punish the recovery."
181
+ }
182
+ },
183
+ {
184
+ "id": "claw_chain",
185
+ "name": {
186
+ "en": "Triple Claw Chain"
187
+ },
188
+ "tell": {
189
+ "en": "He leans forward and claws, possibly for three hits."
190
+ },
191
+ "effect": {
192
+ "en": "Close multi-hit attack of medium damage."
193
+ },
194
+ "counter": {
195
+ "en": "Punish after blocking the last hit; when pinned, use a one-gauge guard-cancel roll."
196
+ }
197
+ },
198
+ {
199
+ "id": "rising_flame",
200
+ "name": {
201
+ "en": "Rising Flame"
202
+ },
203
+ "tell": {
204
+ "en": "His body spins upward, invulnerable for a moment on start-up."
205
+ },
206
+ "effect": {
207
+ "en": "Anti-air counter with high damage."
208
+ },
209
+ "counter": {
210
+ "en": "Do not jump in carelessly; bait it and strike in the long landing recovery."
211
+ }
212
+ },
213
+ {
214
+ "id": "close_grab",
215
+ "name": {
216
+ "en": "Close Grab"
217
+ },
218
+ "tell": {
219
+ "en": "He opens both arms at close range."
220
+ },
221
+ "effect": {
222
+ "en": "A command throw that cannot be blocked or teched."
223
+ },
224
+ "counter": {
225
+ "en": "Jump or keep your distance."
226
+ }
227
+ },
228
+ {
229
+ "id": "dash_elbow",
230
+ "name": {
231
+ "en": "Dash Elbow"
232
+ },
233
+ "tell": {
234
+ "en": "He drops low and dashes forward with an elbow."
235
+ },
236
+ "effect": {
237
+ "en": "Dashing attack with high damage."
238
+ },
239
+ "counter": {
240
+ "en": "Block it; his long recovery lets you counter."
241
+ }
242
+ },
243
+ {
244
+ "id": "binding_flame",
245
+ "name": {
246
+ "en": "Binding Flame"
247
+ },
248
+ "tell": {
249
+ "en": "He spends one gauge and slowly pushes a blue-violet flame along the ground."
250
+ },
251
+ "effect": {
252
+ "en": "If it hits, you are pinned until the next hit; low damage."
253
+ },
254
+ "counter": {
255
+ "en": "It is slow with long recovery: jump or block, then counter."
256
+ }
257
+ },
258
+ {
259
+ "id": "rush_frenzy",
260
+ "name": {
261
+ "en": "Rush Frenzy"
262
+ },
263
+ "tell": {
264
+ "en": "After spending gauge he dashes into a flurry of strikes."
265
+ },
266
+ "effect": {
267
+ "en": "High-damage super."
268
+ },
269
+ "counter": {
270
+ "en": "Block back and wait for recovery; it hurts more in MAX mode."
271
+ }
272
+ }
273
+ ]
274
+ },
275
+ {
276
+ "case_id": "kof97/orochi",
277
+ "boss": {
278
+ "en": "Radiant Deity"
279
+ },
280
+ "summary": {
281
+ "en": "A ranged deity who controls space with huge shock waves, an energy mirror, light pillars and a barrier, plus a pull grab and screen-wide flash when he has gauge."
282
+ },
283
+ "moves": [
284
+ {
285
+ "id": "triple_wave",
286
+ "name": {
287
+ "en": "Triple Shock Wave"
288
+ },
289
+ "tell": {
290
+ "en": "Light gathers in front of his palm, then three large waves are pushed out."
291
+ },
292
+ "effect": {
293
+ "en": "Projectile with a tall hitbox."
294
+ },
295
+ "counter": {
296
+ "en": "Superjump over or roll through; a short hop gets hit."
297
+ }
298
+ },
299
+ {
300
+ "id": "mirror",
301
+ "name": {
302
+ "en": "Energy Mirror"
303
+ },
304
+ "tell": {
305
+ "en": "An energy mirror appears with almost no wind-up."
306
+ },
307
+ "effect": {
308
+ "en": "Reflects projectiles."
309
+ },
310
+ "counter": {
311
+ "en": "Attack after the mirror ends."
312
+ }
313
+ },
314
+ {
315
+ "id": "pillar",
316
+ "name": {
317
+ "en": "Light Pillar"
318
+ },
319
+ "tell": {
320
+ "en": "He raises a hand; a ring appears on the ground, then a pillar of light rises through the screen."
321
+ },
322
+ "effect": {
323
+ "en": "Strikes the position where you were seen; high damage."
324
+ },
325
+ "counter": {
326
+ "en": "Leave the spot during the wind-up; the pillar does not keep tracking."
327
+ }
328
+ },
329
+ {
330
+ "id": "barrier",
331
+ "name": {
332
+ "en": "Barrier"
333
+ },
334
+ "tell": {
335
+ "en": "A barrier opens in front of him; an angled one catches air attacks."
336
+ },
337
+ "effect": {
338
+ "en": "Catches ground attacks and counters."
339
+ },
340
+ "counter": {
341
+ "en": "Hold back when you see it and wait for recovery; throws and projectiles are not caught."
342
+ }
343
+ },
344
+ {
345
+ "id": "pull_grab",
346
+ "name": {
347
+ "en": "Pull Grab"
348
+ },
349
+ "tell": {
350
+ "en": "He spends one gauge and pulls a grounded opponent in from mid range."
351
+ },
352
+ "effect": {
353
+ "en": "A super with very high damage."
354
+ },
355
+ "counter": {
356
+ "en": "Stay out of range or jump and it whiffs, leaving long recovery."
357
+ }
358
+ },
359
+ {
360
+ "id": "close_throw",
361
+ "name": {
362
+ "en": "Close Throw"
363
+ },
364
+ "tell": {
365
+ "en": "He grabs at close range."
366
+ },
367
+ "effect": {
368
+ "en": "A throw that cannot be teched."
369
+ },
370
+ "counter": {
371
+ "en": "Do not linger up close."
372
+ }
373
+ },
374
+ {
375
+ "id": "screen_flash",
376
+ "name": {
377
+ "en": "Screen Flash"
378
+ },
379
+ "tell": {
380
+ "en": "He spends one gauge, spreads both arms and gathers a screen-wide flash."
381
+ },
382
+ "effect": {
383
+ "en": "A super with very high damage."
384
+ },
385
+ "counter": {
386
+ "en": "The wind-up is long: block back to reduce damage or roll on timing."
387
+ }
388
+ }
389
+ ]
390
+ },
391
+ {
392
+ "case_id": "kof97/orochi_chris",
393
+ "boss": {
394
+ "en": "Blaze Youth"
395
+ },
396
+ "summary": {
397
+ "en": "A fire fighter mixing slow fireballs, a hopping fire arm, an anti-air rising arm and an unblockable strike throw."
398
+ },
399
+ "moves": [
400
+ {
401
+ "id": "slow_fireball",
402
+ "name": {
403
+ "en": "Slow Fireball"
404
+ },
405
+ "tell": {
406
+ "en": "A slow multi-part fireball with short range."
407
+ },
408
+ "effect": {
409
+ "en": "Projectile of medium damage."
410
+ },
411
+ "counter": {
412
+ "en": "Jump forward or roll when you see the start."
413
+ }
414
+ },
415
+ {
416
+ "id": "hop_arm",
417
+ "name": {
418
+ "en": "Hopping Fire Arm"
419
+ },
420
+ "tell": {
421
+ "en": "A short hop then a downward swing of a flaming arm."
422
+ },
423
+ "effect": {
424
+ "en": "Dashing attack."
425
+ },
426
+ "counter": {
427
+ "en": "Crouch under it (it misses crouching) or block and counter."
428
+ }
429
+ },
430
+ {
431
+ "id": "rising_arm",
432
+ "name": {
433
+ "en": "Rising Fire Arm"
434
+ },
435
+ "tell": {
436
+ "en": "He swings a flaming arm upward as an anti-air."
437
+ },
438
+ "effect": {
439
+ "en": "Anti-air with medium-high damage."
440
+ },
441
+ "counter": {
442
+ "en": "Do not jump in head-on; his landing recovery is long."
443
+ }
444
+ },
445
+ {
446
+ "id": "strike_throw",
447
+ "name": {
448
+ "en": "Unblockable Punch Throw"
449
+ },
450
+ "tell": {
451
+ "en": "Up close: five fire punches then an upward kick."
452
+ },
453
+ "effect": {
454
+ "en": "An effectively unblockable strike throw with high damage."
455
+ },
456
+ "counter": {
457
+ "en": "Leave close range or jump."
458
+ }
459
+ },
460
+ {
461
+ "id": "fire_rush",
462
+ "name": {
463
+ "en": "Fireball Rush"
464
+ },
465
+ "tell": {
466
+ "en": "He spends one gauge and rushes in wrapped in fireballs."
467
+ },
468
+ "effect": {
469
+ "en": "A super."
470
+ },
471
+ "counter": {
472
+ "en": "Block, then punish."
473
+ }
474
+ },
475
+ {
476
+ "id": "dark_sweep",
477
+ "name": {
478
+ "en": "Dark Flame Sweep"
479
+ },
480
+ "tell": {
481
+ "en": "A one-gauge dark flame sweep that can be charged."
482
+ },
483
+ "effect": {
484
+ "en": "A super."
485
+ },
486
+ "counter": {
487
+ "en": "Block or back away."
488
+ }
489
+ }
490
+ ]
491
+ },
492
+ {
493
+ "case_id": "kof97/orochi_iori",
494
+ "boss": {
495
+ "en": "Frenzied Claw"
496
+ },
497
+ "summary": {
498
+ "en": "A berserk version of the Violet Claw with the same toolkit but more pressure; it also needs gauge for supers."
499
+ },
500
+ "moves": [
501
+ {
502
+ "id": "ground_flame",
503
+ "name": {
504
+ "en": "Ground Violet Flame"
505
+ },
506
+ "tell": {
507
+ "en": "He crouches and pushes a violet flame along the ground."
508
+ },
509
+ "effect": {
510
+ "en": "Projectile of medium damage."
511
+ },
512
+ "counter": {
513
+ "en": "Jump over it and punish the recovery."
514
+ }
515
+ },
516
+ {
517
+ "id": "claw_chain",
518
+ "name": {
519
+ "en": "Triple Claw Chain"
520
+ },
521
+ "tell": {
522
+ "en": "A berserk three-hit claw chain."
523
+ },
524
+ "effect": {
525
+ "en": "Close multi-hit attack."
526
+ },
527
+ "counter": {
528
+ "en": "Block the last hit and keep a low guard."
529
+ }
530
+ },
531
+ {
532
+ "id": "rising_flame",
533
+ "name": {
534
+ "en": "Rising Flame"
535
+ },
536
+ "tell": {
537
+ "en": "A rising violet-flame anti-air."
538
+ },
539
+ "effect": {
540
+ "en": "Anti-air with high damage."
541
+ },
542
+ "counter": {
543
+ "en": "Jump safely or counter on landing."
544
+ }
545
+ },
546
+ {
547
+ "id": "close_grab",
548
+ "name": {
549
+ "en": "Close Grab"
550
+ },
551
+ "tell": {
552
+ "en": "A close-range command grab."
553
+ },
554
+ "effect": {
555
+ "en": "Command throw that cannot be teched."
556
+ },
557
+ "counter": {
558
+ "en": "Avoid it by jumping or spacing."
559
+ }
560
+ },
561
+ {
562
+ "id": "dash_elbow",
563
+ "name": {
564
+ "en": "Dash Elbow"
565
+ },
566
+ "tell": {
567
+ "en": "He drops low and dashes with an elbow."
568
+ },
569
+ "effect": {
570
+ "en": "Dashing attack, high damage."
571
+ },
572
+ "counter": {
573
+ "en": "Block, then counter his long recovery."
574
+ }
575
+ },
576
+ {
577
+ "id": "binding_flame",
578
+ "name": {
579
+ "en": "Binding Flame"
580
+ },
581
+ "tell": {
582
+ "en": "One gauge: a slow blue-violet flame along the ground."
583
+ },
584
+ "effect": {
585
+ "en": "If it hits, you are pinned until the next hit."
586
+ },
587
+ "counter": {
588
+ "en": "Slow with long recovery: jump or block, then counter."
589
+ }
590
+ },
591
+ {
592
+ "id": "rush_frenzy",
593
+ "name": {
594
+ "en": "Rush Frenzy"
595
+ },
596
+ "tell": {
597
+ "en": "After spending gauge he dashes at high speed."
598
+ },
599
+ "effect": {
600
+ "en": "High-damage super."
601
+ },
602
+ "counter": {
603
+ "en": "Block, then punish."
604
+ }
605
+ }
606
+ ]
607
+ },
608
+ {
609
+ "case_id": "kof97/orochi_shermie",
610
+ "boss": {
611
+ "en": "Storm Dancer"
612
+ },
613
+ "summary": {
614
+ "en": "A fighter who places lingering electric orbs and uses lightning kicks; with gauge she has an anti-air spark punch and multi-hit flying kicks."
615
+ },
616
+ "moves": [
617
+ {
618
+ "id": "placed_orb",
619
+ "name": {
620
+ "en": "Placed Lightning Orb"
621
+ },
622
+ "tell": {
623
+ "en": "She blows, then an orb appears far away; its position depends on the button."
624
+ },
625
+ "effect": {
626
+ "en": "The orb lingers a long time and hurts on contact."
627
+ },
628
+ "counter": {
629
+ "en": "Roll through or wait until it disappears; do not stand on it."
630
+ }
631
+ },
632
+ {
633
+ "id": "spark_shot",
634
+ "name": {
635
+ "en": "Close Spark Shot"
636
+ },
637
+ "tell": {
638
+ "en": "Two chops, then a short-range electric shot."
639
+ },
640
+ "effect": {
641
+ "en": "Short-range multi-part attack."
642
+ },
643
+ "counter": {
644
+ "en": "Block, then close in."
645
+ }
646
+ },
647
+ {
648
+ "id": "spin_kick",
649
+ "name": {
650
+ "en": "Lightning Spin Kick"
651
+ },
652
+ "tell": {
653
+ "en": "A spin kick with lightning wrapped on the leg."
654
+ },
655
+ "effect": {
656
+ "en": "Close kick attack."
657
+ },
658
+ "counter": {
659
+ "en": "Block, then counter."
660
+ }
661
+ },
662
+ {
663
+ "id": "air_heel",
664
+ "name": {
665
+ "en": "Aerial Heel Drop"
666
+ },
667
+ "tell": {
668
+ "en": "A downward heel chop in the air."
669
+ },
670
+ "effect": {
671
+ "en": "Aerial downward chop."
672
+ },
673
+ "counter": {
674
+ "en": "Hit her out of the air."
675
+ }
676
+ },
677
+ {
678
+ "id": "anti_air_spark",
679
+ "name": {
680
+ "en": "Anti-air Spark Punch"
681
+ },
682
+ "tell": {
683
+ "en": "A one-gauge lightning punch with fast start-up."
684
+ },
685
+ "effect": {
686
+ "en": "Anti-air super with high damage."
687
+ },
688
+ "counter": {
689
+ "en": "Do not jump around when she has gauge."
690
+ }
691
+ },
692
+ {
693
+ "id": "flying_kicks",
694
+ "name": {
695
+ "en": "Multi-hit Flying Kicks"
696
+ },
697
+ "tell": {
698
+ "en": "A one-gauge horizontal flying kick."
699
+ },
700
+ "effect": {
701
+ "en": "Multi-hit but does not knock down."
702
+ },
703
+ "counter": {
704
+ "en": "Block, then punish."
705
+ }
706
+ }
707
+ ]
708
+ },
709
+ {
710
+ "case_id": "kof97/orochi_yashiro",
711
+ "boss": {
712
+ "en": "Grappler"
713
+ },
714
+ "summary": {
715
+ "en": "A heavyweight built around command throws: nearly every close move is a grab, plus a charged beam and a super slam when he has gauge."
716
+ },
717
+ "moves": [
718
+ {
719
+ "id": "instant_grab",
720
+ "name": {
721
+ "en": "One-frame Command Throw"
722
+ },
723
+ "tell": {
724
+ "en": "A grab at close range, possibly after a normal attack."
725
+ },
726
+ "effect": {
727
+ "en": "Command throw with high damage; cannot be teched."
728
+ },
729
+ "counter": {
730
+ "en": "Keep your distance; jump or step back."
731
+ }
732
+ },
733
+ {
734
+ "id": "back_slam",
735
+ "name": {
736
+ "en": "Back Slam"
737
+ },
738
+ "tell": {
739
+ "en": "A close-range slam command throw."
740
+ },
741
+ "effect": {
742
+ "en": "Command throw."
743
+ },
744
+ "counter": {
745
+ "en": "Same as above."
746
+ }
747
+ },
748
+ {
749
+ "id": "dash_suplex",
750
+ "name": {
751
+ "en": "Dash Suplex"
752
+ },
753
+ "tell": {
754
+ "en": "He dashes forward and follows with a suplex."
755
+ },
756
+ "effect": {
757
+ "en": "Dashing grab."
758
+ },
759
+ "counter": {
760
+ "en": "Interrupt the dash with a punch, or jump back."
761
+ }
762
+ },
763
+ {
764
+ "id": "leap_wrap",
765
+ "name": {
766
+ "en": "Leaping Wrap Grab"
767
+ },
768
+ "tell": {
769
+ "en": "He leaps, grabs and ends up behind you."
770
+ },
771
+ "effect": {
772
+ "en": "No damage itself; a throw follows."
773
+ },
774
+ "counter": {
775
+ "en": "Block right away once he is behind you."
776
+ }
777
+ },
778
+ {
779
+ "id": "charge_beam",
780
+ "name": {
781
+ "en": "Charged Beam"
782
+ },
783
+ "tell": {
784
+ "en": "He spends one gauge, charges, then fires a beam."
785
+ },
786
+ "effect": {
787
+ "en": "Unblockable when fully charged; high damage."
788
+ },
789
+ "counter": {
790
+ "en": "Close in or jump over when you see him charging."
791
+ }
792
+ },
793
+ {
794
+ "id": "super_slam",
795
+ "name": {
796
+ "en": "Super Slam"
797
+ },
798
+ "tell": {
799
+ "en": "A one-gauge close-range super throw."
800
+ },
801
+ "effect": {
802
+ "en": "His most painful move."
803
+ },
804
+ "counter": {
805
+ "en": "Do not throw out attacks at close range."
806
+ }
807
+ }
808
+ ]
809
+ }
810
+ ]
811
+ }
environments/games/prototype/bossbench_llm/prompts/games/mario64_remake.json ADDED
@@ -0,0 +1,646 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "schema": "bossbench-llm/game-prompt@1",
3
+ "game": "mario64_remake",
4
+ "rules": "sm64-bosses@5",
5
+ "title": {
6
+ "en": "3D Platformer: Boss Trials"
7
+ },
8
+ "dimension": "3d",
9
+ "view": {
10
+ "en": "Third-person 3D: a follow camera behind the player, a capped jumper. The HUD shows boss info and a pie-shaped power meter in a corner; arenas are floating platforms with a drop or lava beyond the edges."
11
+ },
12
+ "goal": {
13
+ "en": "Defeat the boss (each fight counts differently: hits or lava dunks until zero) to win; you lose when your power meter empties; each fight lasts at most 300 seconds and a timeout is not a win. Health does not regenerate"
14
+ },
15
+ "mouse": {
16
+ "kind": "camera",
17
+ "en": "Dragging the mouse rotates the camera continuously (double-click the screen to lock it); Q/E turn it 45 degrees at a time and R recenters. The compact actions offer only Q/E/R"
18
+ },
19
+ "keys": [
20
+ {
21
+ "key": "W",
22
+ "en": "move forward relative to the camera (full stick)"
23
+ },
24
+ {
25
+ "key": "A",
26
+ "en": "move left"
27
+ },
28
+ {
29
+ "key": "S",
30
+ "en": "move back"
31
+ },
32
+ {
33
+ "key": "D",
34
+ "en": "move right"
35
+ },
36
+ {
37
+ "key": "Space",
38
+ "en": "jump; press again on landing for a double then triple jump; while crouching it is a backflip; during a sharp turn a side flip; held longer jumps higher"
39
+ },
40
+ {
41
+ "key": "Shift",
42
+ "en": "crouch; while running it is a slide, then Space is a long jump; in the air it is the slam-down"
43
+ },
44
+ {
45
+ "key": "RMB",
46
+ "en": "same as Shift: crouch / slide / mid-air slam-down"
47
+ },
48
+ {
49
+ "key": "J",
50
+ "en": "punch-punch-kick combo; dive when running fast; flying kick in the air; grabs a grabbable target when close, throws when holding"
51
+ },
52
+ {
53
+ "key": "LMB",
54
+ "en": "same as J: attack / grab / throw"
55
+ },
56
+ {
57
+ "key": "K",
58
+ "en": "hold to walk slowly (half stick)"
59
+ },
60
+ {
61
+ "key": "Q",
62
+ "en": "turn camera left 45 degrees"
63
+ },
64
+ {
65
+ "key": "E",
66
+ "en": "turn camera right 45 degrees"
67
+ },
68
+ {
69
+ "key": "R",
70
+ "en": "snap camera behind you, facing the boss"
71
+ },
72
+ {
73
+ "key": "L",
74
+ "en": "toggle camera distance"
75
+ }
76
+ ],
77
+ "notes": [
78
+ {
79
+ "en": "Movement is relative to the camera: W is where the camera faces, so turning the camera changes what each key does"
80
+ },
81
+ {
82
+ "en": "Triple jump, long jump, backflip, side flip and slam-down are available; slam-down is Shift in mid-air and attacks on landing"
83
+ },
84
+ {
85
+ "en": "After being hurt you are briefly invulnerable; falling into lava or a deep drop is a heavy hit"
86
+ },
87
+ {
88
+ "en": "When grabbed, mash Space or flick the stick to break free"
89
+ },
90
+ {
91
+ "en": "A compact packet of 200 ms has 6 sub-steps; punching on a sub-step where the stick is released gives a punch instead of a dive"
92
+ }
93
+ ],
94
+ "compact_glossary": {
95
+ "move": {
96
+ "en": "stick direction for the whole 200 ms packet (relative to the camera), or a camera turn (Q/E/R); one packet is either movement or a camera turn",
97
+ "options": {
98
+ "none": "stand still",
99
+ "cam_left": "camera turns left 45 degrees (Q), stand still",
100
+ "cam_right": "camera turns right 45 degrees (E), stand still",
101
+ "cam_reset": "camera snaps behind you, facing the boss (R), stand still",
102
+ "w": "move forward",
103
+ "wa": "move forward-left",
104
+ "a": "move left",
105
+ "as": "move back-left",
106
+ "s": "move back",
107
+ "sd": "move back-right",
108
+ "d": "move right",
109
+ "wd": "move forward-right",
110
+ "m_w_a_s_d_w_a": "6 sub-steps of stick: forward, left, back, right, forward, left",
111
+ "m_wa_as_sd_wd_wa_as": "6 sub-steps of stick: forward-left, back-left, back-right, forward-right, forward-left, back-left",
112
+ "m_a_s_d_w_a_s": "6 sub-steps of stick: left, back, right, forward, left, back",
113
+ "m_as_sd_wd_wa_as_sd": "6 sub-steps of stick: back-left, back-right, forward-right, forward-left, back-left, back-right",
114
+ "m_s_d_w_a_s_d": "6 sub-steps of stick: back, right, forward, left, back, right",
115
+ "m_sd_wd_wa_as_sd_wd": "6 sub-steps of stick: back-right, forward-right, forward-left, back-left, back-right, forward-right",
116
+ "m_d_w_a_s_d_w": "6 sub-steps of stick: right, forward, left, back, right, forward",
117
+ "m_wd_wa_as_sd_wd_wa": "6 sub-steps of stick: forward-right, forward-left, back-left, back-right, forward-right, forward-left",
118
+ "m_w_x_w_w_w_w": "6 sub-steps of stick: forward, stop, forward, forward, forward, forward (a release lets a punch land as a punch instead of a dive)",
119
+ "m_wa_x_wa_wa_wa_wa": "6 sub-steps of stick: forward-left, stop, forward-left, forward-left, forward-left, forward-left (a release lets a punch land as a punch instead of a dive)",
120
+ "m_a_x_a_a_a_a": "6 sub-steps of stick: left, stop, left, left, left, left (a release lets a punch land as a punch instead of a dive)",
121
+ "m_as_x_as_as_as_as": "6 sub-steps of stick: back-left, stop, back-left, back-left, back-left, back-left (a release lets a punch land as a punch instead of a dive)",
122
+ "m_s_x_s_s_s_s": "6 sub-steps of stick: back, stop, back, back, back, back (a release lets a punch land as a punch instead of a dive)",
123
+ "m_sd_x_sd_sd_sd_sd": "6 sub-steps of stick: back-right, stop, back-right, back-right, back-right, back-right (a release lets a punch land as a punch instead of a dive)",
124
+ "m_d_x_d_d_d_d": "6 sub-steps of stick: right, stop, right, right, right, right (a release lets a punch land as a punch instead of a dive)",
125
+ "m_wd_x_wd_wd_wd_wd": "6 sub-steps of stick: forward-right, stop, forward-right, forward-right, forward-right, forward-right (a release lets a punch land as a punch instead of a dive)",
126
+ "m_w_w_x_w_w_w": "6 sub-steps of stick: forward, forward, stop, forward, forward, forward (a release lets a punch land as a punch instead of a dive)",
127
+ "m_wa_wa_x_wa_wa_wa": "6 sub-steps of stick: forward-left, forward-left, stop, forward-left, forward-left, forward-left (a release lets a punch land as a punch instead of a dive)",
128
+ "m_a_a_x_a_a_a": "6 sub-steps of stick: left, left, stop, left, left, left (a release lets a punch land as a punch instead of a dive)",
129
+ "m_s_s_x_s_s_s": "6 sub-steps of stick: back, back, stop, back, back, back (a release lets a punch land as a punch instead of a dive)",
130
+ "m_d_d_x_d_d_d": "6 sub-steps of stick: right, right, stop, right, right, right (a release lets a punch land as a punch instead of a dive)",
131
+ "m_wd_wd_x_wd_wd_wd": "6 sub-steps of stick: forward-right, forward-right, stop, forward-right, forward-right, forward-right (a release lets a punch land as a punch instead of a dive)",
132
+ "m_w_w_w_x_w_w": "6 sub-steps of stick: forward, forward, forward, stop, forward, forward (a release lets a punch land as a punch instead of a dive)",
133
+ "m_wa_wa_wa_x_wa_wa": "6 sub-steps of stick: forward-left, forward-left, forward-left, stop, forward-left, forward-left (a release lets a punch land as a punch instead of a dive)",
134
+ "m_a_a_a_x_a_a": "6 sub-steps of stick: left, left, left, stop, left, left (a release lets a punch land as a punch instead of a dive)",
135
+ "m_as_as_as_x_as_as": "6 sub-steps of stick: back-left, back-left, back-left, stop, back-left, back-left (a release lets a punch land as a punch instead of a dive)",
136
+ "m_s_s_s_x_s_s": "6 sub-steps of stick: back, back, back, stop, back, back (a release lets a punch land as a punch instead of a dive)",
137
+ "m_sd_sd_sd_x_sd_sd": "6 sub-steps of stick: back-right, back-right, back-right, stop, back-right, back-right (a release lets a punch land as a punch instead of a dive)",
138
+ "m_d_d_d_x_d_d": "6 sub-steps of stick: right, right, right, stop, right, right (a release lets a punch land as a punch instead of a dive)",
139
+ "m_wd_wd_wd_x_wd_wd": "6 sub-steps of stick: forward-right, forward-right, forward-right, stop, forward-right, forward-right (a release lets a punch land as a punch instead of a dive)",
140
+ "m_w_w_w_w_x_w": "6 sub-steps of stick: forward, forward, forward, forward, stop, forward (a release lets a punch land as a punch instead of a dive)",
141
+ "m_wa_wa_wa_wa_x_wa": "6 sub-steps of stick: forward-left, forward-left, forward-left, forward-left, stop, forward-left (a release lets a punch land as a punch instead of a dive)",
142
+ "m_a_a_a_a_x_a": "6 sub-steps of stick: left, left, left, left, stop, left (a release lets a punch land as a punch instead of a dive)",
143
+ "m_as_as_as_as_x_as": "6 sub-steps of stick: back-left, back-left, back-left, back-left, stop, back-left (a release lets a punch land as a punch instead of a dive)",
144
+ "m_s_s_s_s_x_s": "6 sub-steps of stick: back, back, back, back, stop, back (a release lets a punch land as a punch instead of a dive)",
145
+ "m_sd_sd_sd_sd_x_sd": "6 sub-steps of stick: back-right, back-right, back-right, back-right, stop, back-right (a release lets a punch land as a punch instead of a dive)",
146
+ "m_d_d_d_d_x_d": "6 sub-steps of stick: right, right, right, right, stop, right (a release lets a punch land as a punch instead of a dive)",
147
+ "m_wd_wd_wd_wd_x_wd": "6 sub-steps of stick: forward-right, forward-right, forward-right, forward-right, stop, forward-right (a release lets a punch land as a punch instead of a dive)",
148
+ "m_w_w_w_w_w_x": "6 sub-steps of stick: forward, forward, forward, forward, forward, stop (a release lets a punch land as a punch instead of a dive)",
149
+ "m_wa_wa_wa_wa_wa_x": "6 sub-steps of stick: forward-left, forward-left, forward-left, forward-left, forward-left, stop (a release lets a punch land as a punch instead of a dive)",
150
+ "m_a_a_a_a_a_x": "6 sub-steps of stick: left, left, left, left, left, stop (a release lets a punch land as a punch instead of a dive)",
151
+ "m_as_as_as_as_as_x": "6 sub-steps of stick: back-left, back-left, back-left, back-left, back-left, stop (a release lets a punch land as a punch instead of a dive)",
152
+ "m_s_s_s_s_s_x": "6 sub-steps of stick: back, back, back, back, back, stop (a release lets a punch land as a punch instead of a dive)",
153
+ "m_sd_sd_sd_sd_sd_x": "6 sub-steps of stick: back-right, back-right, back-right, back-right, back-right, stop (a release lets a punch land as a punch instead of a dive)",
154
+ "m_d_d_d_d_d_x": "6 sub-steps of stick: right, right, right, right, right, stop (a release lets a punch land as a punch instead of a dive)",
155
+ "m_wd_wd_wd_wd_wd_x": "6 sub-steps of stick: forward-right, forward-right, forward-right, forward-right, forward-right, stop (a release lets a punch land as a punch instead of a dive)",
156
+ "m_x_x_x_w_w_w": "6 sub-steps of stick: stop, stop, stop, forward, forward, forward (a release lets a punch land as a punch instead of a dive)",
157
+ "m_w_w_x_x_x_x": "6 sub-steps of stick: forward, forward, stop, stop, stop, stop (a release lets a punch land as a punch instead of a dive)",
158
+ "m_wd_wd_wd_d_d_d": "6 sub-steps of stick: forward-right, forward-right, forward-right, right, right, right",
159
+ "m_wa_wa_wa_a_a_a": "6 sub-steps of stick: forward-left, forward-left, forward-left, left, left, left",
160
+ "m_x_x_x_wd_wd_wd": "6 sub-steps of stick: stop, stop, stop, forward-right, forward-right, forward-right (a release lets a punch land as a punch instead of a dive)",
161
+ "m_d_d_d_sd_sd_sd": "6 sub-steps of stick: right, right, right, back-right, back-right, back-right",
162
+ "m_w_x_x_x_x_x": "6 sub-steps of stick: forward, stop, stop, stop, stop, stop (a release lets a punch land as a punch instead of a dive)",
163
+ "m_w_w_w_wa_wa_wa": "6 sub-steps of stick: forward, forward, forward, forward-left, forward-left, forward-left",
164
+ "m_wa_wa_wa_w_w_w": "6 sub-steps of stick: forward-left, forward-left, forward-left, forward, forward, forward",
165
+ "m_sd_sd_s_x_x_x": "6 sub-steps of stick: back-right, back-right, back, stop, stop, stop (a release lets a punch land as a punch instead of a dive)",
166
+ "m_x_x_x_x_x_w": "6 sub-steps of stick: stop, stop, stop, stop, stop, forward (a release lets a punch land as a punch instead of a dive)",
167
+ "m_x_x_x_x_wa_wa": "6 sub-steps of stick: stop, stop, stop, stop, forward-left, forward-left (a release lets a punch land as a punch instead of a dive)",
168
+ "m_d_d_d_wd_wd_wd": "6 sub-steps of stick: right, right, right, forward-right, forward-right, forward-right",
169
+ "m_a_a_a_as_as_as": "6 sub-steps of stick: left, left, left, back-left, back-left, back-left",
170
+ "m_a_a_a_wa_wa_wa": "6 sub-steps of stick: left, left, left, forward-left, forward-left, forward-left",
171
+ "m_w_w_w_s_s_s": "6 sub-steps of stick: forward, forward, forward, back, back, back",
172
+ "m_wd_wd_wd_w_w_w": "6 sub-steps of stick: forward-right, forward-right, forward-right, forward, forward, forward",
173
+ "m_x_w_x_w_x_w": "6 sub-steps of stick: stop, forward, stop, forward, stop, forward (a release lets a punch land as a punch instead of a dive)",
174
+ "m_w_w_w_wd_wd_wd": "6 sub-steps of stick: forward, forward, forward, forward-right, forward-right, forward-right",
175
+ "m_x_x_x_x_s_s": "6 sub-steps of stick: stop, stop, stop, stop, back, back (a release lets a punch land as a punch instead of a dive)",
176
+ "m_s_s_s_x_x_x": "6 sub-steps of stick: back, back, back, stop, stop, stop (a release lets a punch land as a punch instead of a dive)",
177
+ "m_x_x_wa_wa_wa_wa": "6 sub-steps of stick: stop, stop, forward-left, forward-left, forward-left, forward-left (a release lets a punch land as a punch instead of a dive)",
178
+ "m_w_x_w_x_w_x": "6 sub-steps of stick: forward, stop, forward, stop, forward, stop (a release lets a punch land as a punch instead of a dive)",
179
+ "m_s_s_s_sd_sd_sd": "6 sub-steps of stick: back, back, back, back-right, back-right, back-right",
180
+ "m_x_x_w_w_w_w": "6 sub-steps of stick: stop, stop, forward, forward, forward, forward (a release lets a punch land as a punch instead of a dive)",
181
+ "m_sd_sd_sd_d_d_d": "6 sub-steps of stick: back-right, back-right, back-right, right, right, right",
182
+ "m_x_x_x_x_wd_wd": "6 sub-steps of stick: stop, stop, stop, stop, forward-right, forward-right (a release lets a punch land as a punch instead of a dive)",
183
+ "m_x_x_x_x_w_w": "6 sub-steps of stick: stop, stop, stop, stop, forward, forward (a release lets a punch land as a punch instead of a dive)",
184
+ "m_x_w_w_w_w_w": "6 sub-steps of stick: stop, forward, forward, forward, forward, forward",
185
+ "m_w_w_w_x_x_x": "6 sub-steps of stick: forward, forward, forward, stop, stop, stop (a release lets a punch land as a punch instead of a dive)",
186
+ "m_x_x_wd_wd_wd_wd": "6 sub-steps of stick: stop, stop, forward-right, forward-right, forward-right, forward-right (a release lets a punch land as a punch instead of a dive)",
187
+ "m_wa_wa_x_x_x_x": "6 sub-steps of stick: forward-left, forward-left, stop, stop, stop, stop (a release lets a punch land as a punch instead of a dive)"
188
+ }
189
+ },
190
+ "action": {
191
+ "en": "action buttons within the packet (punch/grab/throw, jump, slam-down); jump and punch trigger on press",
192
+ "options": {
193
+ "none": "no action",
194
+ "punch_s1": "punch/kick/grab/throw pressed at sub-step 1",
195
+ "punch_s2": "punch/kick/grab/throw pressed at sub-step 2",
196
+ "punch_s3": "punch/kick/grab/throw pressed at sub-step 3",
197
+ "punch_s4": "punch/kick/grab/throw pressed at sub-step 4",
198
+ "punch_s5": "punch/kick/grab/throw pressed at sub-step 5",
199
+ "punch_s6": "punch/kick/grab/throw pressed at sub-step 6",
200
+ "jump_hold": "jump held for the whole packet (high jump)",
201
+ "jump_pound_s2": "jump 1 sub-step, then slam-down (Shift) at sub-step 2",
202
+ "jump_pound_s3": "jump 2 sub-steps, then slam-down (Shift) at sub-step 3",
203
+ "jump_short": "short jump, held 2 sub-steps (low hop)"
204
+ }
205
+ }
206
+ },
207
+ "scenes": [
208
+ {
209
+ "case_id": "mario64/whomp_king",
210
+ "boss": {
211
+ "en": "Toppling Slab"
212
+ },
213
+ "summary": {
214
+ "en": "On a stone-brick platform you face a huge slab that chases you and topples forward; beyond the edge is a deep drop."
215
+ },
216
+ "moves": [
217
+ {
218
+ "id": "chase",
219
+ "name": {
220
+ "en": "Chase"
221
+ },
222
+ "tell": {
223
+ "en": "The slab stands and walks toward you, speeding up as you get close"
224
+ },
225
+ "effect": {
226
+ "en": "It only closes in; no contact damage"
227
+ },
228
+ "counter": {
229
+ "en": "Stay at its front side to lure the jump"
230
+ }
231
+ },
232
+ {
233
+ "id": "slam",
234
+ "name": {
235
+ "en": "Topple slam"
236
+ },
237
+ "tell": {
238
+ "en": "At close range it stops, rocks back, jumps and falls flat toward you"
239
+ },
240
+ "effect": {
241
+ "en": "Anyone under the fallen slab is crushed for heavy damage"
242
+ },
243
+ "counter": {
244
+ "en": "Once it jumps the landing is fixed: run sideways out of its width, or stay in the gap right in front of its feet"
245
+ }
246
+ },
247
+ {
248
+ "id": "lie",
249
+ "name": {
250
+ "en": "Lying flat"
251
+ },
252
+ "tell": {
253
+ "en": "After the slam it lies still for a second or two; its back is a platform you can stand on"
254
+ },
255
+ "effect": {
256
+ "en": "This is the only opening"
257
+ },
258
+ "counter": {
259
+ "en": "Jump onto its back and slam down in the air; jump off before it rises"
260
+ }
261
+ },
262
+ {
263
+ "id": "rise",
264
+ "name": {
265
+ "en": "Rise up"
266
+ },
267
+ "tell": {
268
+ "en": "It shakes, then slowly stands up"
269
+ },
270
+ "effect": {
271
+ "en": "Anyone standing on its back is thrown off"
272
+ },
273
+ "counter": {
274
+ "en": "Leave its back before it stands"
275
+ }
276
+ }
277
+ ],
278
+ "phases": [
279
+ {
280
+ "en": "On higher tiers it chases faster and lies flat for less time"
281
+ }
282
+ ]
283
+ },
284
+ {
285
+ "case_id": "mario64/king_bobomb",
286
+ "boss": {
287
+ "en": "Grappler Orb"
288
+ },
289
+ "summary": {
290
+ "en": "On a grassy hilltop you face a big black iron ball that grabs you; you must grab it from behind and throw it."
291
+ },
292
+ "moves": [
293
+ {
294
+ "id": "walk",
295
+ "name": {
296
+ "en": "Walk toward you"
297
+ },
298
+ "tell": {
299
+ "en": "It walks toward you and keeps turning"
300
+ },
301
+ "effect": {
302
+ "en": "It tries to grab you once close"
303
+ },
304
+ "counter": {
305
+ "en": "Circle behind it and avoid standing in front"
306
+ }
307
+ },
308
+ {
309
+ "id": "grab",
310
+ "name": {
311
+ "en": "Grab and throw"
312
+ },
313
+ "tell": {
314
+ "en": "If it touches you while facing you, it lifts you, carries you toward the edge, then throws you"
315
+ },
316
+ "effect": {
317
+ "en": "You may land off the hilltop; on harder tiers the throw itself hurts"
318
+ },
319
+ "counter": {
320
+ "en": "While held, mash Space or flick the stick to break free"
321
+ }
322
+ },
323
+ {
324
+ "id": "held",
325
+ "name": {
326
+ "en": "Picked up by you"
327
+ },
328
+ "tell": {
329
+ "en": "A punch from behind lifts it"
330
+ },
331
+ "effect": {
332
+ "en": "This starts your counter"
333
+ },
334
+ "counter": {
335
+ "en": "After lifting it, throw with J so it lands on the hilltop to score; landing off the hill does not count"
336
+ }
337
+ },
338
+ {
339
+ "id": "hurt",
340
+ "name": {
341
+ "en": "Hurt and stomping"
342
+ },
343
+ "tell": {
344
+ "en": "After a hit it shudders, then turns to you"
345
+ },
346
+ "effect": {
347
+ "en": "Touching it now hurts"
348
+ },
349
+ "counter": {
350
+ "en": "Wait for the animation to end before approaching"
351
+ }
352
+ }
353
+ ],
354
+ "phases": [
355
+ {
356
+ "en": "On harder tiers it walks and turns faster and the throw hurts more"
357
+ }
358
+ ]
359
+ },
360
+ {
361
+ "case_id": "mario64/big_bully",
362
+ "boss": {
363
+ "en": "Horned Rammer"
364
+ },
365
+ "summary": {
366
+ "en": "On a small platform over lava you must knock a horned round opponent into the lava; there is no health bar, each lava dunk is one hit."
367
+ },
368
+ "moves": [
369
+ {
370
+ "id": "patrol",
371
+ "name": {
372
+ "en": "Patrol"
373
+ },
374
+ "tell": {
375
+ "en": "It paces slowly around the platform"
376
+ },
377
+ "effect": {
378
+ "en": "Switches to chasing when you come close"
379
+ },
380
+ "counter": {
381
+ "en": "Hold your ground and watch its facing"
382
+ }
383
+ },
384
+ {
385
+ "id": "charge",
386
+ "name": {
387
+ "en": "Charge"
388
+ },
389
+ "tell": {
390
+ "en": "It turns slowly toward you, then dashes suddenly"
391
+ },
392
+ "effect": {
393
+ "en": "A collision swaps momentum: you are knocked back softly, no damage"
394
+ },
395
+ "counter": {
396
+ "en": "Hit it with punch, kick, slam-down or land on it to send it flying along your facing toward the lava"
397
+ }
398
+ },
399
+ {
400
+ "id": "knock",
401
+ "name": {
402
+ "en": "Knocked back"
403
+ },
404
+ "tell": {
405
+ "en": "It slides, then resumes chasing when it slows"
406
+ },
407
+ "effect": {
408
+ "en": "If you are knocked off the edge you fall into lava and take heavy damage"
409
+ },
410
+ "counter": {
411
+ "en": "Stand between it and the lava rather than with your back to the edge"
412
+ }
413
+ }
414
+ ],
415
+ "phases": []
416
+ },
417
+ {
418
+ "case_id": "mario64/eyerok",
419
+ "boss": {
420
+ "en": "Twin Sandstone Fists"
421
+ },
422
+ "summary": {
423
+ "en": "On a desert plateau two sandstone fists attack in turn; you can hurt them only while a hand is open and its eye is showing."
424
+ },
425
+ "moves": [
426
+ {
427
+ "id": "pound",
428
+ "name": {
429
+ "en": "Fist pound"
430
+ },
431
+ "tell": {
432
+ "en": "A fist rises high over your position and drops after a pause"
433
+ },
434
+ "effect": {
435
+ "en": "Being caught under it crushes you for heavy damage"
436
+ },
437
+ "counter": {
438
+ "en": "Run sideways before it lands"
439
+ }
440
+ },
441
+ {
442
+ "id": "push",
443
+ "name": {
444
+ "en": "Push and sweep"
445
+ },
446
+ "tell": {
447
+ "en": "A fist slides along the ground to you, then sweeps sideways"
448
+ },
449
+ "effect": {
450
+ "en": "Being swept to the edge drops you off the plateau"
451
+ },
452
+ "counter": {
453
+ "en": "Dodge the sweep and stay away from the edge"
454
+ }
455
+ },
456
+ {
457
+ "id": "double",
458
+ "name": {
459
+ "en": "Double pound"
460
+ },
461
+ "tell": {
462
+ "en": "Both fists lift and slam in sequence"
463
+ },
464
+ "effect": {
465
+ "en": "Wider coverage"
466
+ },
467
+ "counter": {
468
+ "en": "Slip through the gap between the two"
469
+ }
470
+ },
471
+ {
472
+ "id": "eye",
473
+ "name": {
474
+ "en": "Open hand"
475
+ },
476
+ "tell": {
477
+ "en": "After a pound the fist opens to show an eye; it blinks, then closes"
478
+ },
479
+ "effect": {
480
+ "en": "The only opening"
481
+ },
482
+ "counter": {
483
+ "en": "Punch or kick the open hand while it is open"
484
+ }
485
+ }
486
+ ],
487
+ "phases": [
488
+ {
489
+ "en": "With one hand down, the other chases you with pushes and slams"
490
+ }
491
+ ]
492
+ },
493
+ {
494
+ "case_id": "mario64/wiggler",
495
+ "boss": {
496
+ "en": "Frenzy Crawler"
497
+ },
498
+ "summary": {
499
+ "en": "In a closed square cave room, a segmented crawler that keeps getting faster chases you; only stomping its head works."
500
+ },
501
+ "moves": [
502
+ {
503
+ "id": "walk",
504
+ "name": {
505
+ "en": "Crawl"
506
+ },
507
+ "tell": {
508
+ "en": "It crawls around the room, getting faster with each stomp"
509
+ },
510
+ "effect": {
511
+ "en": "Touching its body or head knocks you away for light damage"
512
+ },
513
+ "counter": {
514
+ "en": "Keep your distance and wait for its head"
515
+ }
516
+ },
517
+ {
518
+ "id": "stomp",
519
+ "name": {
520
+ "en": "Stomped"
521
+ },
522
+ "tell": {
523
+ "en": "When its head is stomped it swells, shrinks and goes dazed"
524
+ },
525
+ "effect": {
526
+ "en": "This is the only effective attack"
527
+ },
528
+ "counter": {
529
+ "en": "Use a short jump onto the head; a hit counts after the daze ends"
530
+ }
531
+ },
532
+ {
533
+ "id": "fury",
534
+ "name": {
535
+ "en": "Fury"
536
+ },
537
+ "tell": {
538
+ "en": "Before the last hit it hops and sprints"
539
+ },
540
+ "effect": {
541
+ "en": "Very fast; contact hurts"
542
+ },
543
+ "counter": {
544
+ "en": "Run in loops and avoid corners"
545
+ }
546
+ }
547
+ ],
548
+ "phases": [
549
+ {
550
+ "en": "Each stomp makes it faster; the last stretch is the fastest"
551
+ }
552
+ ]
553
+ },
554
+ {
555
+ "case_id": "mario64/bowser_dark_world",
556
+ "boss": {
557
+ "en": "Fire Shell Beast"
558
+ },
559
+ "summary": {
560
+ "en": "On a void octagon you grab a fire-breathing beast by the tail, spin it, and throw it into mines at the platform edge; beyond the edge is a bottomless void."
561
+ },
562
+ "moves": [
563
+ {
564
+ "id": "breath",
565
+ "name": {
566
+ "en": "Fire breath"
567
+ },
568
+ "tell": {
569
+ "en": "Facing you it lowers its head and spews a line of fireballs"
570
+ },
571
+ "effect": {
572
+ "en": "Flames burn you, cost health and bounce you up"
573
+ },
574
+ "counter": {
575
+ "en": "Run out of the line sideways; do not stand in front"
576
+ }
577
+ },
578
+ {
579
+ "id": "quickjump",
580
+ "name": {
581
+ "en": "Quick jump"
582
+ },
583
+ "tell": {
584
+ "en": "It crouches, then leaps, landing near you"
585
+ },
586
+ "effect": {
587
+ "en": "The shockwave hurts if close and stuns if farther"
588
+ },
589
+ "counter": {
590
+ "en": "Run away before it lands or hop over it"
591
+ }
592
+ },
593
+ {
594
+ "id": "walk",
595
+ "name": {
596
+ "en": "Walk"
597
+ },
598
+ "tell": {
599
+ "en": "It walks toward you and turns"
600
+ },
601
+ "effect": {
602
+ "en": "Body contact knocks you back and costs health"
603
+ },
604
+ "counter": {
605
+ "en": "Stay at its side and use the gap when it turns"
606
+ }
607
+ },
608
+ {
609
+ "id": "tail",
610
+ "name": {
611
+ "en": "Tail grab and spin"
612
+ },
613
+ "tell": {
614
+ "en": "From behind, punch or dive at its tail to grab it, then press W A S D in order to spin faster"
615
+ },
616
+ "effect": {
617
+ "en": "The faster the spin, the farther the throw"
618
+ },
619
+ "counter": {
620
+ "en": "Press J toward a mine; a mine hit counts, and the tail is untouchable for a while"
621
+ }
622
+ },
623
+ {
624
+ "id": "dance",
625
+ "name": {
626
+ "en": "Stomp dance"
627
+ },
628
+ "tell": {
629
+ "en": "Occasionally it stomps in place"
630
+ },
631
+ "effect": {
632
+ "en": "No attack"
633
+ },
634
+ "counter": {
635
+ "en": "Use it to get behind"
636
+ }
637
+ }
638
+ ],
639
+ "phases": [
640
+ {
641
+ "en": "After a mine hit the tail cannot be grabbed until it recovers"
642
+ }
643
+ ]
644
+ }
645
+ ]
646
+ }
environments/games/prototype/bossbench_llm/prompts/games/megaman_remake.json ADDED
@@ -0,0 +1,517 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "schema": "bossbench-llm/game-prompt@1",
3
+ "game": "megaman_remake",
4
+ "rules": "megaman-nes-20261105-r4",
5
+ "title": {
6
+ "en": "Blue Gunner: Boss Gauntlet"
7
+ },
8
+ "dimension": "2d",
9
+ "view": {
10
+ "en": "Side-view single-screen 2D room; you control the blue gunner with an arm gun and any weapons won; your health bar and the boss's health bar are at the top of the screen"
11
+ },
12
+ "goal": {
13
+ "en": "Empty the boss's health bar to win; you lose if your health reaches zero; there is a time limit and a timeout is not a win. Health does not regenerate"
14
+ },
15
+ "mouse": {
16
+ "kind": "none",
17
+ "en": ""
18
+ },
19
+ "keys": [
20
+ {
21
+ "key": "A",
22
+ "en": "move left (slow start, slides after release)"
23
+ },
24
+ {
25
+ "key": "D",
26
+ "en": "move right (slow start, slides after release)"
27
+ },
28
+ {
29
+ "key": "Space",
30
+ "en": "jump; hold to go higher, releasing mid-rise slows it at once"
31
+ },
32
+ {
33
+ "key": "J",
34
+ "en": "fire, one shot per press"
35
+ },
36
+ {
37
+ "key": "LMB",
38
+ "en": "fire (same as J)"
39
+ },
40
+ {
41
+ "key": "Q",
42
+ "en": "previous weapon"
43
+ },
44
+ {
45
+ "key": "E",
46
+ "en": "next weapon"
47
+ }
48
+ ],
49
+ "notes": [
50
+ {
51
+ "en": "Firing counts new presses, so release and press again for each shot; the arm gun allows at most 3 shots on screen, with no charge shot and no slide"
52
+ },
53
+ {
54
+ "en": "Defeating a boss wins its weapon; each shot costs weapon energy, fuse lob and block toss cost more; you cannot switch while a fuse lob or boulder is out"
55
+ },
56
+ {
57
+ "en": "For block toss, stand against a block facing it, press fire to lift and again to throw; only the blade tosser and quake hurler rooms have blocks"
58
+ },
59
+ {
60
+ "en": "After a hit you are knocked back about 0.5 s then flash invulnerable for about 2 s; weapons have strengths and weaknesses against different bosses"
61
+ },
62
+ {
63
+ "en": "One action packet lasts 200 ms and is split into 6 sub-steps"
64
+ }
65
+ ],
66
+ "compact_glossary": {
67
+ "move": {
68
+ "en": "Horizontal movement; half/4-substep options are short nudges (walking starts slow, then slides after release)",
69
+ "options": {
70
+ "none": "stand still",
71
+ "left": "hold left whole packet",
72
+ "right": "hold right whole packet",
73
+ "left_half": "left for first 3 sub-steps",
74
+ "right_half": "right for first 3 sub-steps",
75
+ "left_4": "left for first 4 sub-steps",
76
+ "right_4": "right for first 4 sub-steps"
77
+ }
78
+ },
79
+ "jump": {
80
+ "en": "Jump timing; holding longer jumps higher, releasing early cuts the rise",
81
+ "options": {
82
+ "none": "no jump",
83
+ "hold": "hold whole packet (highest)",
84
+ "tap": "press sub-step 1 only (lowest)",
85
+ "from_2": "hold from sub-step 2",
86
+ "from_3": "hold from sub-step 3",
87
+ "from_4": "hold from sub-step 4",
88
+ "from_5": "hold from sub-step 5",
89
+ "at_6": "press sub-step 6 only",
90
+ "first_2": "hold first 2 sub-steps (low)",
91
+ "first_5": "hold first 5 sub-steps",
92
+ "first_3": "hold first 3 sub-steps",
93
+ "first_4": "hold first 4 sub-steps",
94
+ "tap_rehold": "tap at sub-step 1, hold again from 3",
95
+ "tap_tap6": "tap at sub-step 1, press again at 6",
96
+ "tap_hold5": "tap at sub-step 1, hold again from 5"
97
+ }
98
+ },
99
+ "fire": {
100
+ "en": "Fire or switch weapon",
101
+ "options": {
102
+ "none": "no fire",
103
+ "fire": "fire 3 shots (sub-steps 1, 3, 5)",
104
+ "next_weapon": "next weapon (sub-step 1)",
105
+ "prev_weapon": "previous weapon (sub-step 1)"
106
+ }
107
+ }
108
+ },
109
+ "scenes": [
110
+ {
111
+ "case_id": "megaman/bomb_man",
112
+ "boss": {
113
+ "en": "Shard Lobber"
114
+ },
115
+ "summary": {
116
+ "en": "A flat small room; the opponent lobs bombs and leaps in, and each bomb bursts into shards on landing."
117
+ },
118
+ "moves": [
119
+ {
120
+ "id": "lob_bomb",
121
+ "name": {
122
+ "en": "Bomb lob"
123
+ },
124
+ "tell": {
125
+ "en": "After landing he holds a bomb up for about 0.25 s and lobs it at you; it lands slightly short of you, 1-3 per round"
126
+ },
127
+ "effect": {
128
+ "en": "The bomb explodes on landing or on hitting a wall and hurts; shots cannot destroy it"
129
+ },
130
+ "counter": {
131
+ "en": "Watch the landing spot and jump the shards or back off; he waits for one to burst before throwing the next"
132
+ }
133
+ },
134
+ {
135
+ "id": "shrapnel",
136
+ "name": {
137
+ "en": "Shards"
138
+ },
139
+ "tell": {
140
+ "en": "The bomb bursts into 12 pieces: fast ones up/down/left/right, diagonals and four slow ones"
141
+ },
142
+ "effect": {
143
+ "en": "Shards hurt on contact"
144
+ },
145
+ "counter": {
146
+ "en": "Ground-level shards are low, so jumping avoids them; stay away from the landing spot"
147
+ }
148
+ },
149
+ {
150
+ "id": "leap",
151
+ "name": {
152
+ "en": "Leap"
153
+ },
154
+ "tell": {
155
+ "en": "Each round starts with a random jump: a big leap at you or a small hop closer; after a small-hop round he hops away facing back"
156
+ },
157
+ "effect": {
158
+ "en": "Touching him during a leap hurts"
159
+ },
160
+ "counter": {
161
+ "en": "A big leap goes over you, so walk under it; he only charges after settling, which is your opening"
162
+ }
163
+ },
164
+ {
165
+ "id": "close_guard",
166
+ "name": {
167
+ "en": "Close-range pounce"
168
+ },
169
+ "tell": {
170
+ "en": "When you get very close he drops the bomb throw and jumps at you"
171
+ },
172
+ "effect": {
173
+ "en": "It breaks his rhythm but he jumps over you with contact damage"
174
+ },
175
+ "counter": {
176
+ "en": "Use it to break his throws, but mind where he lands"
177
+ }
178
+ }
179
+ ],
180
+ "phases": []
181
+ },
182
+ {
183
+ "case_id": "megaman/cut_man",
184
+ "boss": {
185
+ "en": "Blade Tosser"
186
+ },
187
+ "summary": {
188
+ "en": "The room has a step and blocks; the opponent throws a returning blade and leaps at close range."
189
+ },
190
+ "moves": [
191
+ {
192
+ "id": "return_blade",
193
+ "name": {
194
+ "en": "Returning blade"
195
+ },
196
+ "tell": {
197
+ "en": "He plants his feet and raises the blade for about 0.3 s, then throws it at you; it turns at the room edge and speeds back to his hand"
198
+ },
199
+ "effect": {
200
+ "en": "The return path also sweeps through your position and hurts"
201
+ },
202
+ "counter": {
203
+ "en": "While the blade is out he has no weapon, so close in and shoot; do not stand between him and the blade"
204
+ }
205
+ },
206
+ {
207
+ "id": "leap",
208
+ "name": {
209
+ "en": "Close leap"
210
+ },
211
+ "tell": {
212
+ "en": "When you are close he jumps; usually over you, sometimes right onto you or in front of you"
213
+ },
214
+ "effect": {
215
+ "en": "Landing on you does contact damage; he may throw the blade in mid-air"
216
+ },
217
+ "counter": {
218
+ "en": "When he jumps, walk under him or the other way"
219
+ }
220
+ },
221
+ {
222
+ "id": "chase",
223
+ "name": {
224
+ "en": "Wait-and-throw"
225
+ },
226
+ "tell": {
227
+ "en": "When you stand on the step and he is on the ground, he runs in place for about 1 s then throws"
228
+ },
229
+ "effect": {
230
+ "en": "After the wait the blade flies at you"
231
+ },
232
+ "counter": {
233
+ "en": "The step is a safe place to watch, but dodge once the blade is thrown"
234
+ }
235
+ },
236
+ {
237
+ "id": "hop_back",
238
+ "name": {
239
+ "en": "Hit-and-hop"
240
+ },
241
+ "tell": {
242
+ "en": "After being hit he flashes for about 1 second and hops away from you for the first half second"
243
+ },
244
+ "effect": {
245
+ "en": "Shots pass through him while he flashes; touching him still hurts"
246
+ },
247
+ "counter": {
248
+ "en": "Do not waste shots while he flashes; wait until he stops"
249
+ }
250
+ }
251
+ ],
252
+ "phases": []
253
+ },
254
+ {
255
+ "case_id": "megaman/elec_man",
256
+ "boss": {
257
+ "en": "Pouncer"
258
+ },
259
+ "summary": {
260
+ "en": "The opponent paces, firing at him triggers a counter-pounce, and his main damage is the zigzag arc."
261
+ },
262
+ "moves": [
263
+ {
264
+ "id": "zigzag_arc",
265
+ "name": {
266
+ "en": "Zigzag arc"
267
+ },
268
+ "tell": {
269
+ "en": "He stops and raises a hand for about 0.25 s, then releases a five-part zigzag arc that jumps forward and changes shape every moment"
270
+ },
271
+ "effect": {
272
+ "en": "The arc deals heavy damage on contact"
273
+ },
274
+ "counter": {
275
+ "en": "High arcs pass over you when standing; jump low arcs before they arrive, toward him is easier"
276
+ }
277
+ },
278
+ {
279
+ "id": "counter_leap",
280
+ "name": {
281
+ "en": "Counter-pounce"
282
+ },
283
+ "tell": {
284
+ "en": "If you fire while he paces, he pounces at once, sometimes as a feint in the other direction"
285
+ },
286
+ "effect": {
287
+ "en": "Landing on you does contact damage"
288
+ },
289
+ "counter": {
290
+ "en": "Do not fire while he paces; wait until he stands and discharges"
291
+ }
292
+ },
293
+ {
294
+ "id": "air_arc",
295
+ "name": {
296
+ "en": "Air arc"
297
+ },
298
+ "tell": {
299
+ "en": "If you fire while he is airborne, he charges in the air and releases one arc"
300
+ },
301
+ "effect": {
302
+ "en": "The arc deals heavy damage and its height follows his"
303
+ },
304
+ "counter": {
305
+ "en": "Watch the landing and fire less while he is airborne"
306
+ }
307
+ },
308
+ {
309
+ "id": "hop_back",
310
+ "name": {
311
+ "en": "Hit-and-hop"
312
+ },
313
+ "tell": {
314
+ "en": "After being hit he flashes for about 1 second and hops away from you for the first half second"
315
+ },
316
+ "effect": {
317
+ "en": "Shots pass through him while he flashes; touching him still hurts"
318
+ },
319
+ "counter": {
320
+ "en": "Do not waste shots while he flashes; wait until he stops"
321
+ }
322
+ }
323
+ ],
324
+ "phases": []
325
+ },
326
+ {
327
+ "case_id": "megaman/fire_man",
328
+ "boss": {
329
+ "en": "Wave Keeper"
330
+ },
331
+ "summary": {
332
+ "en": "The opponent keeps a fixed distance, sending ground waves that leave fire pillars."
333
+ },
334
+ "moves": [
335
+ {
336
+ "id": "ground_wave",
337
+ "name": {
338
+ "en": "Ground wave"
339
+ },
340
+ "tell": {
341
+ "en": "From a distance he gathers fire in his hand for about 0.4 s, then sends it along the ground; up to five per round, about one per second"
342
+ },
343
+ "effect": {
344
+ "en": "The wave hurts on contact"
345
+ },
346
+ "counter": {
347
+ "en": "Prepare to jump when the fire gathers and clear the wave near the top of your jump"
348
+ }
349
+ },
350
+ {
351
+ "id": "fire_pillar",
352
+ "name": {
353
+ "en": "Fire pillar"
354
+ },
355
+ "tell": {
356
+ "en": "When a wave passes under your feet, a fire pillar rises there for about 2 s"
357
+ },
358
+ "effect": {
359
+ "en": "The pillar hurts on contact"
360
+ },
361
+ "counter": {
362
+ "en": "Avoid pillars when landing; the old one dies when he sends the next wave"
363
+ }
364
+ },
365
+ {
366
+ "id": "keep_distance",
367
+ "name": {
368
+ "en": "Distance control"
369
+ },
370
+ "tell": {
371
+ "en": "He backs off when you approach and closes in when you retreat; cornered at a wall he turns and walks through you"
372
+ },
373
+ "effect": {
374
+ "en": "Walking through you does contact damage"
375
+ },
376
+ "counter": {
377
+ "en": "Shoot while he backs off; beware contact near walls"
378
+ }
379
+ },
380
+ {
381
+ "id": "retaliate",
382
+ "name": {
383
+ "en": "Retaliation"
384
+ },
385
+ "tell": {
386
+ "en": "About 0.23 s after being hit he starts a new round of fire"
387
+ },
388
+ "effect": {
389
+ "en": "He then sends waves"
390
+ },
391
+ "counter": {
392
+ "en": "Be ready to jump right after landing a hit"
393
+ }
394
+ },
395
+ {
396
+ "id": "stand_down",
397
+ "name": {
398
+ "en": "Stand-down after five"
399
+ },
400
+ "tell": {
401
+ "en": "After five shots he holds a pose and stops; any input from you or leaving the range band restarts him"
402
+ },
403
+ "effect": {
404
+ "en": "He does not attack while stopped"
405
+ },
406
+ "counter": {
407
+ "en": "This is a rule quirk; do not rely on it to win"
408
+ }
409
+ }
410
+ ],
411
+ "phases": []
412
+ },
413
+ {
414
+ "case_id": "megaman/guts_man",
415
+ "boss": {
416
+ "en": "Quake Hurler"
417
+ },
418
+ "summary": {
419
+ "en": "The room has a step; the opponent attacks with quaking leaps and thrown boulders."
420
+ },
421
+ "moves": [
422
+ {
423
+ "id": "quake_leap",
424
+ "name": {
425
+ "en": "Quake leap"
426
+ },
427
+ "tell": {
428
+ "en": "He crouches for about 0.25 s, jumps high, and the screen shakes for about 0.5 s on landing"
429
+ },
430
+ "effect": {
431
+ "en": "While the screen shakes, you are stunned for about 0.8 s if standing on the ground; contact also hurts"
432
+ },
433
+ "counter": {
434
+ "en": "Jump just as he lands and stay airborne until the shake ends; he is slow, so you can walk under him"
435
+ }
436
+ },
437
+ {
438
+ "id": "boulder_throw",
439
+ "name": {
440
+ "en": "Boulder throw"
441
+ },
442
+ "tell": {
443
+ "en": "He hops once, a boulder drops onto his hands, and after about 0.25 s of holding it he throws it straight at your feet"
444
+ },
445
+ "effect": {
446
+ "en": "The boulder hurts on contact; shots cannot destroy it"
447
+ },
448
+ "counter": {
449
+ "en": "He stands still while holding it, so shoot then; jump or move as he throws"
450
+ }
451
+ },
452
+ {
453
+ "id": "chunks",
454
+ "name": {
455
+ "en": "Chunks"
456
+ },
457
+ "tell": {
458
+ "en": "When the boulder hits a wall, floor or step it breaks into four pieces that keep flying the same way, two angling upward"
459
+ },
460
+ "effect": {
461
+ "en": "Chunks hurt on contact"
462
+ },
463
+ "counter": {
464
+ "en": "Chunks appear to the lower right of the impact and fly onward; walk back or jump once the boulder lands"
465
+ }
466
+ }
467
+ ],
468
+ "phases": []
469
+ },
470
+ {
471
+ "case_id": "megaman/ice_man",
472
+ "boss": {
473
+ "en": "V Gunner"
474
+ },
475
+ "summary": {
476
+ "en": "The opponent paces between fixed spots and fires piercing darts in a V pattern that speeds up over time."
477
+ },
478
+ "moves": [
479
+ {
480
+ "id": "v_volley",
481
+ "name": {
482
+ "en": "V volley"
483
+ },
484
+ "tell": {
485
+ "en": "At his spot he charges for about 0.25 s and jumps straight up; he fires one dart at each of three heights on the way down, hangs at the floor, then fires three more going up"
486
+ },
487
+ "effect": {
488
+ "en": "The darts deal heavy damage on contact"
489
+ },
490
+ "counter": {
491
+ "en": "Only the ground-level dart needs a jump; the middle and high ones pass over you; do not jump too high into the upper one"
492
+ }
493
+ },
494
+ {
495
+ "id": "patrol",
496
+ "name": {
497
+ "en": "Patrol"
498
+ },
499
+ "tell": {
500
+ "en": "He walks between four spots; every three landings the darts and hover timing speed up one level, four levels in all"
501
+ },
502
+ "effect": {
503
+ "en": "He does not attack while walking and has no hit reaction"
504
+ },
505
+ "counter": {
506
+ "en": "Walking and charging are the safest windows to shoot"
507
+ }
508
+ }
509
+ ],
510
+ "phases": [
511
+ {
512
+ "en": "Every three landings speed up one level, four in total"
513
+ }
514
+ ]
515
+ }
516
+ ]
517
+ }
environments/games/prototype/bossbench_llm/prompts/games/minecraft.json ADDED
@@ -0,0 +1,448 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "schema": "bossbench-llm/game-prompt@1",
3
+ "game": "minecraft",
4
+ "rules": "minecraft-arena@7",
5
+ "title": {
6
+ "en": "Blocky World: Boss Duel"
7
+ },
8
+ "dimension": "3d",
9
+ "view": {
10
+ "en": "3D blocky world, first person by default: the crosshair is at the centre and the sword or bow in hand at the lower right (third person can be chosen at reset, showing the Voxel Wanderer). The HUD shows the boss's name and health bar, your health and armor, and the hotbar (slot 1 sword, slot 2 bow)."
11
+ },
12
+ "goal": {
13
+ "en": "Empty the boss's health bar to win; you lose if your health hits zero; each fight lasts at most 300 seconds and a timeout is not a win. Health does not regenerate."
14
+ },
15
+ "mouse": {
16
+ "kind": "camera",
17
+ "en": "X>0 turns right, Y>0 looks down; there is no aim assist; pitch is limited to about ±89°. The wheel Z switches the hotbar slot, one notch per slot (1 sword, 2 bow)"
18
+ },
19
+ "keys": [
20
+ {
21
+ "key": "W",
22
+ "en": "move forward"
23
+ },
24
+ {
25
+ "key": "S",
26
+ "en": "move backward"
27
+ },
28
+ {
29
+ "key": "A",
30
+ "en": "strafe left"
31
+ },
32
+ {
33
+ "key": "D",
34
+ "en": "strafe right"
35
+ },
36
+ {
37
+ "key": "Space",
38
+ "en": "jump (hold to keep jumping)"
39
+ },
40
+ {
41
+ "key": "Shift",
42
+ "en": "sprint (only while holding W)"
43
+ },
44
+ {
45
+ "key": "J",
46
+ "en": "swing the sword; punches only when holding the bow"
47
+ },
48
+ {
49
+ "key": "LMB",
50
+ "en": "swing (same as J); punches only when holding the bow"
51
+ },
52
+ {
53
+ "key": "RMB",
54
+ "en": "hold to draw the bow, release to fire"
55
+ }
56
+ ],
57
+ "notes": [
58
+ {
59
+ "en": "At reset you choose the weapon (sword or bow) and the camera (first person by default, third person optional); in play the mouse wheel (Z in the action) switches between sword and bow, which resets the attack cooldown and cancels a draw."
60
+ },
61
+ {
62
+ "en": "The sword swings once per press and its damage scales with the attack cooldown charge (full in about 0.6 s), so mashing is weak. A fully charged, non-sprinting hit while falling is a critical; a sprinting full-charge hit adds knockback."
63
+ },
64
+ {
65
+ "en": "The bow needs RMB held across steps; about 1 second is a full, critical draw. Drawing slows you and stops sprinting. Arrows drop with gravity and stop on terrain."
66
+ },
67
+ {
68
+ "en": "Each hit gives about 0.5 seconds of damage immunity; a stronger hit inside it deals only the difference."
69
+ },
70
+ {
71
+ "en": "You can walk in only one direction at a time (W over S, A, D), so there is no diagonal movement."
72
+ }
73
+ ],
74
+ "compact_glossary": {
75
+ "move": {
76
+ "en": "Walking direction (one at a time; W > S > A > D)",
77
+ "options": {
78
+ "none": "stand still",
79
+ "forward": "walk forward",
80
+ "back": "walk backward",
81
+ "left": "strafe left",
82
+ "right": "strafe right",
83
+ "sprint": "sprint forward (W+Shift)"
84
+ }
85
+ },
86
+ "action": {
87
+ "en": "Attack, jump or switch weapon",
88
+ "options": {
89
+ "none": "do nothing",
90
+ "swing": "sword swing at the start of the 200 ms step",
91
+ "swing_late": "sword swing late in the step",
92
+ "draw": "hold the bow draw (RMB) for the step",
93
+ "jump": "jump",
94
+ "switch": "switch between sword and bow"
95
+ }
96
+ },
97
+ "aim": {
98
+ "en": "Camera turn and pitch; dx>0 turns right, dy>0 looks down",
99
+ "options": {
100
+ "none": "no camera change",
101
+ "r8_c0": "turn right 1.2 deg",
102
+ "l8_c0": "turn left 1.2 deg",
103
+ "c0_d40": "look down 6 deg",
104
+ "c0_u40": "look up 6 deg",
105
+ "r25_c0": "turn right 3.75 deg",
106
+ "r25_d40": "turn right 3.75 deg, look down 6 deg",
107
+ "r25_u40": "turn right 3.75 deg, look up 6 deg",
108
+ "l25_c0": "turn left 3.75 deg",
109
+ "l25_d40": "turn left 3.75 deg, look down 6 deg",
110
+ "l25_u40": "turn left 3.75 deg, look up 6 deg",
111
+ "r60_c0": "turn right 9 deg",
112
+ "r60_d40": "turn right 9 deg, look down 6 deg",
113
+ "r60_u40": "turn right 9 deg, look up 6 deg",
114
+ "l60_c0": "turn left 9 deg",
115
+ "l60_d40": "turn left 9 deg, look down 6 deg",
116
+ "l60_u40": "turn left 9 deg, look up 6 deg",
117
+ "r150_c0": "turn right 22.5 deg",
118
+ "r150_d40": "turn right 22.5 deg, look down 6 deg",
119
+ "r150_u40": "turn right 22.5 deg, look up 6 deg",
120
+ "l150_c0": "turn left 22.5 deg",
121
+ "l150_d40": "turn left 22.5 deg, look down 6 deg",
122
+ "l150_u40": "turn left 22.5 deg, look up 6 deg",
123
+ "r300_c0": "turn right 45 deg",
124
+ "l300_c0": "turn left 45 deg",
125
+ "r600_c0": "turn right 90 deg",
126
+ "l600_c0": "turn left 90 deg"
127
+ }
128
+ }
129
+ },
130
+ "scenes": [
131
+ {
132
+ "case_id": "3d/minecraft_ender_dragon",
133
+ "boss": {
134
+ "en": "Violet Breath Flyer"
135
+ },
136
+ "summary": {
137
+ "en": "A huge flying boss circling over the tower platform; stone pillars topped with healing crystals stand around the arena."
138
+ },
139
+ "moves": [
140
+ {
141
+ "id": "fireball",
142
+ "name": {
143
+ "en": "Violet Fireball"
144
+ },
145
+ "tell": {
146
+ "en": "It lines up on you and its mouth glows."
147
+ },
148
+ "effect": {
149
+ "en": "Fires a ball that leaves a purple cloud; standing in it deals steady magic damage that armor ignores."
150
+ },
151
+ "counter": {
152
+ "en": "Step out of the cloud; after firing it returns to circling."
153
+ }
154
+ },
155
+ {
156
+ "id": "perch",
157
+ "name": {
158
+ "en": "Perch and Roar"
159
+ },
160
+ "tell": {
161
+ "en": "It lands on the central platform and roars for about 2 seconds."
162
+ },
163
+ "effect": {
164
+ "en": "A purple cloud under its head deals damage over time."
165
+ },
166
+ "counter": {
167
+ "en": "Arrows bounce off, but sword hits on the head deal full damage; enough damage makes it take off."
168
+ }
169
+ },
170
+ {
171
+ "id": "charge",
172
+ "name": {
173
+ "en": "Charging Rush"
174
+ },
175
+ "tell": {
176
+ "en": "After about 5 seconds perched with nobody close, it lifts off to rush."
177
+ },
178
+ "effect": {
179
+ "en": "Head contact and wing sweeps both hurt and shove you."
180
+ },
181
+ "counter": {
182
+ "en": "Sidestep; it flies past and climbs back to circling."
183
+ }
184
+ },
185
+ {
186
+ "id": "crystals",
187
+ "name": {
188
+ "en": "Healing Crystals"
189
+ },
190
+ "tell": {
191
+ "en": "A white beam links the nearest crystal to it."
192
+ },
193
+ "effect": {
194
+ "en": "Crystals heal it; a crystal explodes when broken and hurts nearby."
195
+ },
196
+ "counter": {
197
+ "en": "Shoot crystals with the bow to damage it, staying clear of the blast."
198
+ }
199
+ }
200
+ ],
201
+ "phases": []
202
+ },
203
+ {
204
+ "case_id": "3d/minecraft_iron_golem",
205
+ "boss": {
206
+ "en": "Hurling Brute"
207
+ },
208
+ "summary": {
209
+ "en": "A huge melee guardian with a single heavy swing; kite it in circles."
210
+ },
211
+ "moves": [
212
+ {
213
+ "id": "swing",
214
+ "name": {
215
+ "en": "Two-Arm Swing"
216
+ },
217
+ "tell": {
218
+ "en": "Both arms are raised high."
219
+ },
220
+ "effect": {
221
+ "en": "Random damage within a range, reduced by armor, and it throws you."
222
+ },
223
+ "counter": {
224
+ "en": "It has a cooldown after each swing, so strike then; it cannot reach targets well above it."
225
+ }
226
+ },
227
+ {
228
+ "id": "chase",
229
+ "name": {
230
+ "en": "Closing In"
231
+ },
232
+ "tell": {
233
+ "en": "It walks straight at you."
234
+ },
235
+ "effect": {
236
+ "en": "It can only swing once you are in reach."
237
+ },
238
+ "counter": {
239
+ "en": "Back off and circle out of reach, then dash in after a miss."
240
+ }
241
+ }
242
+ ],
243
+ "phases": []
244
+ },
245
+ {
246
+ "case_id": "3d/minecraft_skeleton",
247
+ "boss": {
248
+ "en": "Strafing Bowman"
249
+ },
250
+ "summary": {
251
+ "en": "A ranged enemy that strafes while drawing its bow; ruins in the arena give cover."
252
+ },
253
+ "moves": [
254
+ {
255
+ "id": "arrow",
256
+ "name": {
257
+ "en": "Bow Shot"
258
+ },
259
+ "tell": {
260
+ "en": "The bow is raised and drawn for most of a second."
261
+ },
262
+ "effect": {
263
+ "en": "Fires an arcing arrow; damage rises with difficulty and armor reduces it."
264
+ },
265
+ "counter": {
266
+ "en": "About 3 seconds between shots (about 2 on hard); walls stop arrows, so strafe or hide."
267
+ }
268
+ },
269
+ {
270
+ "id": "kite",
271
+ "name": {
272
+ "en": "Kiting"
273
+ },
274
+ "tell": {
275
+ "en": "It backs off and strafes as you approach."
276
+ },
277
+ "effect": {
278
+ "en": "Deals no damage itself but makes melee hard."
279
+ },
280
+ "counter": {
281
+ "en": "Corner it against the ruins or arena wall, then press with the sword."
282
+ }
283
+ }
284
+ ],
285
+ "phases": []
286
+ },
287
+ {
288
+ "case_id": "3d/minecraft_warden",
289
+ "boss": {
290
+ "en": "Blind Shockwave Beast"
291
+ },
292
+ "summary": {
293
+ "en": "A heavy melee beast stalking through the dark cavern, able to release a ranged shockwave."
294
+ },
295
+ "moves": [
296
+ {
297
+ "id": "smash",
298
+ "name": {
299
+ "en": "Overhead Smash"
300
+ },
301
+ "tell": {
302
+ "en": "Arms rise and its chest glows."
303
+ },
304
+ "effect": {
305
+ "en": "A heavy close-range hit that armor reduces."
306
+ },
307
+ "counter": {
308
+ "en": "There is a cooldown but it keeps walking, so back off between swings."
309
+ }
310
+ },
311
+ {
312
+ "id": "shockwave",
313
+ "name": {
314
+ "en": "Charged Shockwave"
315
+ },
316
+ "tell": {
317
+ "en": "About 1.7 seconds of charging: chest lights up and rings gather."
318
+ },
319
+ "effect": {
320
+ "en": "The boom deals damage and knockback, ignoring armor and walls."
321
+ },
322
+ "counter": {
323
+ "en": "It only charges while you stay out of reach; about 1.3 seconds of recovery after the boom is your opening."
324
+ }
325
+ },
326
+ {
327
+ "id": "vision_dim",
328
+ "name": {
329
+ "en": "Vision Dim"
330
+ },
331
+ "tell": {
332
+ "en": "The screen pulses dark like a heartbeat."
333
+ },
334
+ "effect": {
335
+ "en": "Only impairs vision; no direct damage."
336
+ },
337
+ "counter": {
338
+ "en": "Slow down and rely on its outline and the HUD."
339
+ }
340
+ }
341
+ ],
342
+ "phases": []
343
+ },
344
+ {
345
+ "case_id": "3d/minecraft_wither",
346
+ "boss": {
347
+ "en": "Three-Headed Hover Gun"
348
+ },
349
+ "summary": {
350
+ "en": "A hovering three-headed cannon with a long spawn-in charge; it gains a shell at half health."
351
+ },
352
+ "moves": [
353
+ {
354
+ "id": "shell",
355
+ "name": {
356
+ "en": "Shell"
357
+ },
358
+ "tell": {
359
+ "en": "A head turns to you; black shells fly fast, blue shells slowly."
360
+ },
361
+ "effect": {
362
+ "en": "A hit hurts and applies black-heart drain; the blast also hurts within about 2 blocks."
363
+ },
364
+ "counter": {
365
+ "en": "Break line of sight behind cover and it stops firing; sidestep the slow blue shells."
366
+ }
367
+ },
368
+ {
369
+ "id": "spawn",
370
+ "name": {
371
+ "en": "Spawn Blast"
372
+ },
373
+ "tell": {
374
+ "en": "About 11 seconds of flickering blue while its health bar fills."
375
+ },
376
+ "effect": {
377
+ "en": "Explodes at its centre when done, weaker with distance and harmless beyond about 14 blocks."
378
+ },
379
+ "counter": {
380
+ "en": "Run far away before the blast."
381
+ }
382
+ },
383
+ {
384
+ "id": "armor",
385
+ "name": {
386
+ "en": "Half-Health Shell"
387
+ },
388
+ "tell": {
389
+ "en": "A translucent shell appears around it at half health."
390
+ },
391
+ "effect": {
392
+ "en": "The shell makes arrows ineffective."
393
+ },
394
+ "counter": {
395
+ "en": "Switch to the sword and fight it up close on the ground."
396
+ }
397
+ }
398
+ ],
399
+ "phases": [
400
+ {
401
+ "en": "At half health it enters the shell phase and must be fought with the sword."
402
+ }
403
+ ]
404
+ },
405
+ {
406
+ "case_id": "3d/minecraft_zombie_leader",
407
+ "boss": {
408
+ "en": "Horde Caller"
409
+ },
410
+ "summary": {
411
+ "en": "A melee boss that keeps calling helpers to surround you."
412
+ },
413
+ "moves": [
414
+ {
415
+ "id": "swipe",
416
+ "name": {
417
+ "en": "Lunging Swipe"
418
+ },
419
+ "tell": {
420
+ "en": "Arms rise high and it lunges."
421
+ },
422
+ "effect": {
423
+ "en": "Damage rises with difficulty and armor reduces it."
424
+ },
425
+ "counter": {
426
+ "en": "About a 1-second cooldown after each swipe; it is knocked back on every hit, so use that to space."
427
+ }
428
+ },
429
+ {
430
+ "id": "reinforcements",
431
+ "name": {
432
+ "en": "Call Reinforcements"
433
+ },
434
+ "tell": {
435
+ "en": "Smoke appears and a helper climbs out of the ground."
436
+ },
437
+ "effect": {
438
+ "en": "Each helper swipes just like its caller."
439
+ },
440
+ "counter": {
441
+ "en": "Kill the caller first: the helpers remain but the fight ends."
442
+ }
443
+ }
444
+ ],
445
+ "phases": []
446
+ }
447
+ ]
448
+ }
environments/games/prototype/bossbench_llm/prompts/games/nfsmw_remake.json ADDED
@@ -0,0 +1,519 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "schema": "bossbench-llm/game-prompt@1",
3
+ "game": "nfsmw_remake",
4
+ "rules": "nfsmw-arena@2",
5
+ "title": {
6
+ "en": "Street Racing: Original Sports Car in an Original Seaside City"
7
+ },
8
+ "dimension": "3d",
9
+ "view": {
10
+ "en": "Third-person view behind an original sports car. Speed and rev gauges are at the bottom; the top shows how far the event has come, rival gap or bust meter. Edge arrows point to rivals and police cars that are off screen"
11
+ },
12
+ "goal": {
13
+ "en": "Each event has its own win: finish the route, beat the rival, score a higher total, avoid finishing last, or escape the police. Running out of time, a rival finishing first, being caught or a wrecked car loses; each run lasts at most 300 seconds and a timeout is not a win. Nothing recovers by itself"
14
+ },
15
+ "mouse": {
16
+ "kind": "none",
17
+ "en": "This game does not use the mouse"
18
+ },
19
+ "keys": [
20
+ {
21
+ "key": "W",
22
+ "en": "throttle"
23
+ },
24
+ {
25
+ "key": "S",
26
+ "en": "brake; reverse at low speed"
27
+ },
28
+ {
29
+ "key": "A",
30
+ "en": "steer left (the longer held, the more angle; less angle at high speed; in drag races, change to the left lane)"
31
+ },
32
+ {
33
+ "key": "D",
34
+ "en": "steer right (in drag races, change to the right lane)"
35
+ },
36
+ {
37
+ "key": "Space",
38
+ "en": "handbrake, for drifting"
39
+ },
40
+ {
41
+ "key": "Shift",
42
+ "en": "nitrous"
43
+ },
44
+ {
45
+ "key": "J",
46
+ "en": "slow motion on / off (the world slows and downforce rises)"
47
+ },
48
+ {
49
+ "key": "K",
50
+ "en": "shift up (manual gearbox in drag races)"
51
+ },
52
+ {
53
+ "key": "L",
54
+ "en": "shift down (manual gearbox in drag races)"
55
+ },
56
+ {
57
+ "key": "R",
58
+ "en": "reset onto the route; for about 2 s afterwards (flashing) the police catch you more easily"
59
+ }
60
+ ],
61
+ "notes": [
62
+ {
63
+ "en": "A / D must be held for a while to wind the wheel on, and it eases back when released; at higher speed the angle is smaller."
64
+ },
65
+ {
66
+ "en": "Drag races use a manual gearbox: press K when the rev gauge reaches the green zone. A / D change lanes there instead of steering."
67
+ },
68
+ {
69
+ "en": "Nitrous is limited and takes time to recover. In toll and speed-trap events it pays most just before the key points."
70
+ },
71
+ {
72
+ "en": "Slow motion slows the world and adds downforce, which helps in tight corners; it drains with use, and J turns it off."
73
+ },
74
+ {
75
+ "en": "Walls and crashes scrub speed; staying on the route is usually fastest, and a reset costs time."
76
+ }
77
+ ],
78
+ "compact_glossary": {
79
+ "pedal": {
80
+ "en": "Throttle and brake",
81
+ "options": {
82
+ "none": "release, coast",
83
+ "throttle_light": "light throttle (1 of 6 sub-steps)",
84
+ "throttle": "full throttle",
85
+ "brake": "brake; reverse at low speed"
86
+ }
87
+ },
88
+ "steer": {
89
+ "en": "Steering as a duty cycle over the 6 sub-steps (no mouse)",
90
+ "options": {
91
+ "none": "no steering, wheel returns to centre",
92
+ "left_tap": "tap left (drag: change to the left lane)",
93
+ "left_ease": "left for 2 of 6 sub-steps: wheel slowly returns",
94
+ "left_hold": "left for 3 of 6: keep the current angle",
95
+ "left_hold_late": "left for 3 of 6, offset half a beat: keep the angle",
96
+ "left_more": "left for 4 of 6: wind more angle on",
97
+ "left_full": "left held fully",
98
+ "right_tap": "tap right (drag: change to the right lane)",
99
+ "right_ease": "right for 2 of 6 sub-steps: wheel slowly returns",
100
+ "right_hold": "right for 3 of 6: keep the current angle",
101
+ "right_hold_late": "right for 3 of 6, offset half a beat: keep the angle",
102
+ "right_more": "right for 4 of 6: wind more angle on",
103
+ "right_full": "right held fully"
104
+ }
105
+ },
106
+ "nitrous": {
107
+ "en": "Nitrous",
108
+ "options": {
109
+ "none": "off",
110
+ "nitrous": "nitrous on"
111
+ }
112
+ },
113
+ "press": {
114
+ "en": "Gear shift, slow motion, reset, handbrake",
115
+ "options": {
116
+ "none": "nothing",
117
+ "shift_up": "shift up (drag only)",
118
+ "shift_down": "shift down (drag only)",
119
+ "slowmo": "toggle slow motion",
120
+ "reset": "reset onto the route",
121
+ "handbrake": "handbrake held, drift"
122
+ }
123
+ }
124
+ },
125
+ "scenes": [
126
+ {
127
+ "case_id": "nfsmw/tollbooth",
128
+ "boss": {
129
+ "en": "Toll-gate time trial"
130
+ },
131
+ "summary": {
132
+ "en": "A solo run along the coast road through toll gates; each gate adds time, and you lose when the clock runs out. Traffic is on the road"
133
+ },
134
+ "moves": [
135
+ {
136
+ "id": "gate",
137
+ "name": {
138
+ "en": "Toll gate"
139
+ },
140
+ "tell": {
141
+ "en": "A gate and light beam on the road ahead"
142
+ },
143
+ "effect": {
144
+ "en": "Passing adds time to the clock; clearing the last gate wins"
145
+ },
146
+ "counter": {
147
+ "en": "Keep speed on the ideal line and use nitrous to gain time"
148
+ }
149
+ },
150
+ {
151
+ "id": "traffic",
152
+ "name": {
153
+ "en": "Road traffic"
154
+ },
155
+ "tell": {
156
+ "en": "Civilian cars driving slowly on the road ahead"
157
+ },
158
+ "effect": {
159
+ "en": "A crash scrubs a lot of speed or stops you"
160
+ },
161
+ "counter": {
162
+ "en": "Move to the clear side early; do not force an overtake in a corner"
163
+ }
164
+ }
165
+ ]
166
+ },
167
+ {
168
+ "case_id": "nfsmw/drag",
169
+ "boss": {
170
+ "en": "Drag rival"
171
+ },
172
+ "summary": {
173
+ "en": "Several drag races in a row against one rival on a straight four-lane strip. The car holds its line by itself; you change lanes and handle throttle, nitrous and gears"
174
+ },
175
+ "moves": [
176
+ {
177
+ "id": "launch",
178
+ "name": {
179
+ "en": "Launch"
180
+ },
181
+ "tell": {
182
+ "en": "The rev needle during the countdown"
183
+ },
184
+ "effect": {
185
+ "en": "Launching with revs in the target band gives a boost; too high spins the clutch"
186
+ },
187
+ "counter": {
188
+ "en": "Hold the throttle during the countdown and keep revs a little below the redline"
189
+ }
190
+ },
191
+ {
192
+ "id": "shift",
193
+ "name": {
194
+ "en": "Shift timing"
195
+ },
196
+ "tell": {
197
+ "en": "The rev gauge enters the green zone"
198
+ },
199
+ "effect": {
200
+ "en": "A well-timed upshift gives a bonus; sitting on the limiter builds heat and a blown engine loses"
201
+ },
202
+ "counter": {
203
+ "en": "Press K as soon as the gauge is in the green; do not sit on the limiter"
204
+ }
205
+ },
206
+ {
207
+ "id": "rival_nitrous",
208
+ "name": {
209
+ "en": "Rival nitrous"
210
+ },
211
+ "tell": {
212
+ "en": "Blue flame behind the rival's car"
213
+ },
214
+ "effect": {
215
+ "en": "The rival speeds up for a while and gains ground"
216
+ },
217
+ "counter": {
218
+ "en": "Use your own nitrous at a good moment"
219
+ }
220
+ },
221
+ {
222
+ "id": "crash",
223
+ "name": {
224
+ "en": "Crash wreck"
225
+ },
226
+ "tell": {
227
+ "en": "Traffic or an obstacle appears in your lane"
228
+ },
229
+ "effect": {
230
+ "en": "A hard hit at high speed drops too much speed and wrecks the car, losing the heat"
231
+ },
232
+ "counter": {
233
+ "en": "Change lanes early with A / D"
234
+ }
235
+ }
236
+ ]
237
+ },
238
+ {
239
+ "case_id": "nfsmw/speedtrap",
240
+ "boss": {
241
+ "en": "Speed-trap rival"
242
+ },
243
+ "summary": {
244
+ "en": "Drive through speed cameras along the coast road; the speeds at each camera add up and are compared with one rival. Cameras sit where speed is easiest to reach"
245
+ },
246
+ "moves": [
247
+ {
248
+ "id": "camera",
249
+ "name": {
250
+ "en": "Speed camera"
251
+ },
252
+ "tell": {
253
+ "en": "A roadside camera and gate; a light beam marks the next one"
254
+ },
255
+ "effect": {
256
+ "en": "Records your speed as you pass and adds it to your total"
257
+ },
258
+ "counter": {
259
+ "en": "Start nitrous 1 to 3 seconds before a camera and do not brake before it"
260
+ }
261
+ },
262
+ {
263
+ "id": "rival_boost",
264
+ "name": {
265
+ "en": "Rival boost at camera"
266
+ },
267
+ "tell": {
268
+ "en": "Blue flame behind the rival as it nears a camera"
269
+ },
270
+ "effect": {
271
+ "en": "The rival posts a higher speed at the camera and widens the gap"
272
+ },
273
+ "counter": {
274
+ "en": "Save nitrous for the cameras; you lose if the margin runs out"
275
+ }
276
+ },
277
+ {
278
+ "id": "traffic",
279
+ "name": {
280
+ "en": "Road traffic"
281
+ },
282
+ "tell": {
283
+ "en": "Civilian cars on the road"
284
+ },
285
+ "effect": {
286
+ "en": "A crash cuts speed and so the reading at that camera"
287
+ },
288
+ "counter": {
289
+ "en": "Change lanes early and do not get stuck behind a car before a camera"
290
+ }
291
+ }
292
+ ]
293
+ },
294
+ {
295
+ "case_id": "nfsmw/knockout",
296
+ "boss": {
297
+ "en": "Knockout field"
298
+ },
299
+ "summary": {
300
+ "en": "A night-time downtown circuit with several rivals; the last car over the line each lap is knocked out and you must not be last. You start on the back row"
301
+ },
302
+ "moves": [
303
+ {
304
+ "id": "knock",
305
+ "name": {
306
+ "en": "Lap knockout"
307
+ },
308
+ "tell": {
309
+ "en": "After cars finish the lap, the last rival disappears"
310
+ },
311
+ "effect": {
312
+ "en": "Finishing last means you lose"
313
+ },
314
+ "counter": {
315
+ "en": "Pass at least one rival every lap and do not lose speed in corners"
316
+ }
317
+ },
318
+ {
319
+ "id": "rival_pack",
320
+ "name": {
321
+ "en": "Rival pack"
322
+ },
323
+ "tell": {
324
+ "en": "Other cars driving the route ahead; the further forward, the faster"
325
+ },
326
+ "effect": {
327
+ "en": "They do not yield and nudge aside on contact; once far ahead they are hard to catch"
328
+ },
329
+ "counter": {
330
+ "en": "Take the inside line, get on the throttle early out of corners and use nitrous to catch up"
331
+ }
332
+ },
333
+ {
334
+ "id": "traffic",
335
+ "name": {
336
+ "en": "Road traffic"
337
+ },
338
+ "tell": {
339
+ "en": "A few civilian cars on the circuit"
340
+ },
341
+ "effect": {
342
+ "en": "A crash scrubs speed and drops you to the back"
343
+ },
344
+ "counter": {
345
+ "en": "Steer around them as soon as you see them"
346
+ },
347
+ "only": {
348
+ "en": "normal and hard tiers only"
349
+ }
350
+ }
351
+ ]
352
+ },
353
+ {
354
+ "case_id": "nfsmw/pursuit",
355
+ "boss": {
356
+ "en": "Police pursuit"
357
+ },
358
+ "summary": {
359
+ "en": "Free roam in the city: first raise a bounty, then lose the police; each cleared stage raises the heat and brings stronger police. You lose when the bust meter fills"
360
+ },
361
+ "moves": [
362
+ {
363
+ "id": "chase",
364
+ "name": {
365
+ "en": "Police chase"
366
+ },
367
+ "tell": {
368
+ "en": "Police cars behind or beside you with flashing lights"
369
+ },
370
+ "effect": {
371
+ "en": "When a cop is close and you are slow, the bust meter fills and you lose"
372
+ },
373
+ "counter": {
374
+ "en": "Keep speed high and open a gap; stay out of sight to build the escape"
375
+ }
376
+ },
377
+ {
378
+ "id": "pit",
379
+ "name": {
380
+ "en": "Cop ram"
381
+ },
382
+ "tell": {
383
+ "en": "A cop closes beside your rear, a red warning bar appears and the mirror frame turns red"
384
+ },
385
+ "effect": {
386
+ "en": "The hit spins you and bleeds speed"
387
+ },
388
+ "counter": {
389
+ "en": "Accelerate away on the warning, or steer outwards"
390
+ }
391
+ },
392
+ {
393
+ "id": "roadblock",
394
+ "name": {
395
+ "en": "Roadblock"
396
+ },
397
+ "tell": {
398
+ "en": "Police cars blocking the road ahead, with a distance warning bar at the bottom"
399
+ },
400
+ "effect": {
401
+ "en": "Hitting it slows you a lot, and its cops then join the chase"
402
+ },
403
+ "counter": {
404
+ "en": "Aim for the gap"
405
+ }
406
+ },
407
+ {
408
+ "id": "spikes",
409
+ "name": {
410
+ "en": "Spike strip"
411
+ },
412
+ "tell": {
413
+ "en": "A spike strip on the road, with a warning bar at the bottom"
414
+ },
415
+ "effect": {
416
+ "en": "Tyres are punctured and burst after about half a second; grip drops sharply"
417
+ },
418
+ "counter": {
419
+ "en": "Change lane early to avoid it"
420
+ }
421
+ },
422
+ {
423
+ "id": "trap",
424
+ "name": {
425
+ "en": "Destructible building trap"
426
+ },
427
+ "tell": {
428
+ "en": "A roadside structure that can be knocked down"
429
+ },
430
+ "effect": {
431
+ "en": "When knocked down it lands on cops behind you"
432
+ },
433
+ "counter": {
434
+ "en": "Speed past it so the cops follow into its collapse"
435
+ }
436
+ },
437
+ {
438
+ "id": "heli",
439
+ "name": {
440
+ "en": "Helicopter"
441
+ },
442
+ "tell": {
443
+ "en": "A helicopter and spotlight overhead"
444
+ },
445
+ "effect": {
446
+ "en": "It sees far, so hiding behind buildings is harder"
447
+ },
448
+ "counter": {
449
+ "en": "Keep moving fast until it runs out of fuel and leaves"
450
+ },
451
+ "only": {
452
+ "en": "higher heat stages only"
453
+ }
454
+ }
455
+ ],
456
+ "phases": [
457
+ {
458
+ "en": "Each escape raises the heat: more and faster police cars"
459
+ }
460
+ ]
461
+ },
462
+ {
463
+ "case_id": "nfsmw/street_champion",
464
+ "boss": {
465
+ "en": "Street champion"
466
+ },
467
+ "summary": {
468
+ "en": "A race through city streets against the street champion while police chase you too. You lose if the rival reaches the end first or you are caught"
469
+ },
470
+ "moves": [
471
+ {
472
+ "id": "champ_nitrous",
473
+ "name": {
474
+ "en": "Champion's nitrous"
475
+ },
476
+ "tell": {
477
+ "en": "Blue flame behind the rival's car"
478
+ },
479
+ "effect": {
480
+ "en": "It speeds up noticeably for a while and pulls ahead"
481
+ },
482
+ "counter": {
483
+ "en": "Use your own nitrous and take a shorter line to catch up"
484
+ }
485
+ },
486
+ {
487
+ "id": "cop",
488
+ "name": {
489
+ "en": "Police chase"
490
+ },
491
+ "tell": {
492
+ "en": "Police cars behind or beside you with flashing lights"
493
+ },
494
+ "effect": {
495
+ "en": "The bust meter fills when a cop is close; full means loss"
496
+ },
497
+ "counter": {
498
+ "en": "Keep speed up, avoid walls and keep moving forward"
499
+ }
500
+ },
501
+ {
502
+ "id": "block",
503
+ "name": {
504
+ "en": "Roadblocks and spikes"
505
+ },
506
+ "tell": {
507
+ "en": "Police cars blocking the road or a spike strip, with a warning bar at the bottom"
508
+ },
509
+ "effect": {
510
+ "en": "Hitting them slows you or bursts a tyre, letting the rival catch up"
511
+ },
512
+ "counter": {
513
+ "en": "Change lane early to go around"
514
+ }
515
+ }
516
+ ]
517
+ }
518
+ ]
519
+ }
environments/games/prototype/bossbench_llm/prompts/games/quake2_remake.json ADDED
@@ -0,0 +1,459 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "schema": "bossbench-llm/game-prompt@1",
3
+ "game": "quake2_remake",
4
+ "rules": "q2-arena@4",
5
+ "title": {
6
+ "en": "First-Person Shooter: Boss Arena"
7
+ },
8
+ "dimension": "3d",
9
+ "view": {
10
+ "en": "First-person 3D shooter: the crosshair is at the centre and your weapon at the lower right. The boss's name, phase and health bar are at the top; ammo, health, armour and the current weapon at the bottom. The arena has pillars, crates and other cover, with ammo, medical and armour pickups on the floor"
11
+ },
12
+ "goal": {
13
+ "en": "Empty the boss's health bar to win; you lose if your health reaches zero; each fight lasts at most 300 seconds and a timeout is not a win. Health does not regenerate: each medical or armour pickup can be taken only once, while ammo respawns over time"
14
+ },
15
+ "mouse": {
16
+ "kind": "camera",
17
+ "en": "Y > 0 looks down; pitch is limited to about ±89°"
18
+ },
19
+ "keys": [
20
+ {
21
+ "key": "W",
22
+ "en": "move forward"
23
+ },
24
+ {
25
+ "key": "S",
26
+ "en": "move backward"
27
+ },
28
+ {
29
+ "key": "A",
30
+ "en": "strafe left"
31
+ },
32
+ {
33
+ "key": "D",
34
+ "en": "strafe right"
35
+ },
36
+ {
37
+ "key": "Shift",
38
+ "en": "hold to run (move faster)"
39
+ },
40
+ {
41
+ "key": "Space",
42
+ "en": "jump"
43
+ },
44
+ {
45
+ "key": "L",
46
+ "en": "crouch (move slower)"
47
+ },
48
+ {
49
+ "key": "Q",
50
+ "en": "turn left with the keyboard"
51
+ },
52
+ {
53
+ "key": "E",
54
+ "en": "turn right with the keyboard"
55
+ },
56
+ {
57
+ "key": "J",
58
+ "en": "fire; hold for continuous fire"
59
+ },
60
+ {
61
+ "key": "LMB",
62
+ "en": "fire (same as J)"
63
+ },
64
+ {
65
+ "key": "K",
66
+ "en": "next weapon"
67
+ },
68
+ {
69
+ "key": "RMB",
70
+ "en": "next weapon (same as K)"
71
+ },
72
+ {
73
+ "key": "R",
74
+ "en": "previous weapon"
75
+ }
76
+ ],
77
+ "notes": [
78
+ {
79
+ "en": "Each fight starts with a fixed set of weapons (such as shotguns, machine guns, a rocket launcher or a coilgun, depending on the fight); switch weapons when ammo runs low"
80
+ },
81
+ {
82
+ "en": "Most boss attacks travel in straight lines: strafing and ducking behind cover work best"
83
+ },
84
+ {
85
+ "en": "Bosses flinch briefly when hit; heavy weapons such as rockets interrupt them more easily"
86
+ },
87
+ {
88
+ "en": "Coilgun-type attacks first lock onto where you are; a red warning appears at the centre of the screen, and strafing right after the lock dodges the shot"
89
+ }
90
+ ],
91
+ "compact_glossary": {
92
+ "move": {
93
+ "en": "movement (always running)",
94
+ "options": {
95
+ "none": "stand still",
96
+ "forward": "run forward",
97
+ "back": "run backward",
98
+ "left": "strafe left",
99
+ "right": "strafe right",
100
+ "forward_left": "run forward-left",
101
+ "forward_right": "run forward-right",
102
+ "back_left": "run backward-left",
103
+ "back_right": "run backward-right"
104
+ }
105
+ },
106
+ "turn": {
107
+ "en": "horizontal turn",
108
+ "options": {
109
+ "none": "no turn",
110
+ "left_3": "turn left 3°",
111
+ "right_3": "turn right 3°",
112
+ "left_10": "turn left 10°",
113
+ "right_10": "turn right 10°",
114
+ "left_30": "turn left 30°",
115
+ "right_30": "turn right 30°"
116
+ }
117
+ },
118
+ "pitch": {
119
+ "en": "look up / down",
120
+ "options": {
121
+ "none": "no pitch change",
122
+ "up_2": "look up 2°",
123
+ "down_2": "look down 2°"
124
+ }
125
+ },
126
+ "action": {
127
+ "en": "fire / jump / weapon",
128
+ "options": {
129
+ "none": "nothing",
130
+ "fire": "fire for the whole 200 ms",
131
+ "fire_late": "fire, starting late in the 200 ms",
132
+ "jump": "jump",
133
+ "next_weapon": "next weapon"
134
+ }
135
+ }
136
+ },
137
+ "scenes": [
138
+ {
139
+ "case_id": "quake2/supertank",
140
+ "boss": {
141
+ "en": "Tracked Gun Carrier"
142
+ },
143
+ "summary": {
144
+ "en": "A heavy tracked machine armed with a chain gun and rocket launchers rolls at you across an open-air arena."
145
+ },
146
+ "moves": [
147
+ {
148
+ "id": "attack1",
149
+ "name": {
150
+ "en": "Chain-gun burst"
151
+ },
152
+ "tell": {
153
+ "en": "It turns toward you; it always uses this at close range"
154
+ },
155
+ "effect": {
156
+ "en": "A stream of instant-hit bullets that continues as long as it can see you"
157
+ },
158
+ "counter": {
159
+ "en": "Break line of sight behind cover"
160
+ }
161
+ },
162
+ {
163
+ "id": "attack2",
164
+ "name": {
165
+ "en": "Triple rockets"
166
+ },
167
+ "tell": {
168
+ "en": "At longer range it turns toward you and fires three rockets about 0.3 s apart"
169
+ },
170
+ "effect": {
171
+ "en": "The rockets fly straight at where you were when fired and splash on impact"
172
+ },
173
+ "counter": {
174
+ "en": "Strafe so they miss, and stay off walls"
175
+ }
176
+ }
177
+ ],
178
+ "phases": []
179
+ },
180
+ {
181
+ "case_id": "quake2/hornet",
182
+ "boss": {
183
+ "en": "Flying Gunship"
184
+ },
185
+ "summary": {
186
+ "en": "A heavy gunship hovering above you attacks with twin machine guns and rocket salvos; cover only blocks low shots."
187
+ },
188
+ "moves": [
189
+ {
190
+ "id": "attack_mg",
191
+ "name": {
192
+ "en": "Twin machine guns"
193
+ },
194
+ "tell": {
195
+ "en": "About 0.9 s of wind-up as it turns; it always uses this at close range"
196
+ },
197
+ "effect": {
198
+ "en": "Both guns fire continuously, and it keeps firing more often while you are in front of it"
199
+ },
200
+ "counter": {
201
+ "en": "Get to its side or put a full-height pillar between you"
202
+ }
203
+ },
204
+ {
205
+ "id": "attack_rocket",
206
+ "name": {
207
+ "en": "Rocket salvo"
208
+ },
209
+ "tell": {
210
+ "en": "After about 1.2 s of wind-up it launches four rockets at once"
211
+ },
212
+ "effect": {
213
+ "en": "Each rocket aims at you and hits hard"
214
+ },
215
+ "counter": {
216
+ "en": "Start strafing as soon as you see the wind-up"
217
+ }
218
+ }
219
+ ],
220
+ "phases": [
221
+ {
222
+ "en": "It always flies a little above you, so low cover does not block its fire"
223
+ }
224
+ ]
225
+ },
226
+ {
227
+ "case_id": "quake2/makron",
228
+ "boss": {
229
+ "en": "Twin-Cannon Mech → Armoured Pilot"
230
+ },
231
+ "summary": {
232
+ "en": "A two-phase fight: first a twin chain-gun mech, then the pilot that jumps out of it when it is destroyed; the two share one health bar."
233
+ },
234
+ "moves": [
235
+ {
236
+ "id": "jorg_attack1",
237
+ "name": {
238
+ "en": "Twin chain guns (mech)"
239
+ },
240
+ "tell": {
241
+ "en": "After about 0.8 s of wind-up both chain guns fire together"
242
+ },
243
+ "effect": {
244
+ "en": "Instant-hit bullets that continue while it can see you"
245
+ },
246
+ "counter": {
247
+ "en": "Break line of sight with a pillar"
248
+ }
249
+ },
250
+ {
251
+ "id": "jorg_attack2",
252
+ "name": {
253
+ "en": "Energy orb (mech)"
254
+ },
255
+ "tell": {
256
+ "en": "After a short wind-up it launches a slow, large green orb"
257
+ },
258
+ "effect": {
259
+ "en": "In flight the orb zaps visible targets nearby, and its hit or blast is extremely damaging"
260
+ },
261
+ "counter": {
262
+ "en": "Get far from it and behind cover"
263
+ }
264
+ },
265
+ {
266
+ "id": "makron_attack3",
267
+ "name": {
268
+ "en": "Energy orb (pilot)"
269
+ },
270
+ "tell": {
271
+ "en": "The pilot in the second phase also launches the large green orb"
272
+ },
273
+ "effect": {
274
+ "en": "Same as above, extremely damaging"
275
+ },
276
+ "counter": {
277
+ "en": "Get away and behind cover"
278
+ }
279
+ },
280
+ {
281
+ "id": "makron_attack4",
282
+ "name": {
283
+ "en": "Pulse sweep (pilot)"
284
+ },
285
+ "tell": {
286
+ "en": "After a short wind-up it fires a stream of blue energy bolts sweeping from one side to the other"
287
+ },
288
+ "effect": {
289
+ "en": "The bolts are fast and hit everything along the sweep"
290
+ },
291
+ "counter": {
292
+ "en": "Strafe or back behind cover before the sweep reaches you"
293
+ }
294
+ },
295
+ {
296
+ "id": "makron_attack5",
297
+ "name": {
298
+ "en": "Coilgun (pilot)"
299
+ },
300
+ "tell": {
301
+ "en": "While charging, a coilgun-charging warning appears, then it locks onto your position at that moment (red aim line / warning)"
302
+ },
303
+ "effect": {
304
+ "en": "An instant piercing shot along the locked line, very damaging"
305
+ },
306
+ "counter": {
307
+ "en": "Strafe the moment the lock warning appears"
308
+ }
309
+ }
310
+ ],
311
+ "phases": [
312
+ {
313
+ "en": "Phase one is the twin-cannon mech; once it is destroyed the pilot appears and phase two begins"
314
+ }
315
+ ]
316
+ },
317
+ {
318
+ "case_id": "quake2/tank_commander",
319
+ "boss": {
320
+ "en": "Chain-Gun Heavy Trooper"
321
+ },
322
+ "summary": {
323
+ "en": "A humanoid heavy machine in a factory arena that attacks with energy-gun triple shots, rockets and a sweeping chain gun."
324
+ },
325
+ "moves": [
326
+ {
327
+ "id": "attack_blast",
328
+ "name": {
329
+ "en": "Energy-gun triple shot"
330
+ },
331
+ "tell": {
332
+ "en": "It turns toward you, steps back slightly and fires three energy bolts"
333
+ },
334
+ "effect": {
335
+ "en": "The bolts fly straight at you"
336
+ },
337
+ "counter": {
338
+ "en": "Strafe out of the way"
339
+ }
340
+ },
341
+ {
342
+ "id": "attack_rocket",
343
+ "name": {
344
+ "en": "Triple rockets"
345
+ },
346
+ "tell": {
347
+ "en": "At longer range it winds up for about 2 seconds, then fires three rockets"
348
+ },
349
+ "effect": {
350
+ "en": "The rockets hit and splash hard"
351
+ },
352
+ "counter": {
353
+ "en": "The long wind-up is a good window to attack; dodge once it fires"
354
+ }
355
+ },
356
+ {
357
+ "id": "attack_chain",
358
+ "name": {
359
+ "en": "Chain-gun sweep"
360
+ },
361
+ "tell": {
362
+ "en": "After briefly turning it fires for about 2 seconds without turning further"
363
+ },
364
+ "effect": {
365
+ "en": "A stream of instant-hit bullets"
366
+ },
367
+ "counter": {
368
+ "en": "It does not track you while firing, so run sideways out of its line"
369
+ }
370
+ }
371
+ ],
372
+ "phases": []
373
+ },
374
+ {
375
+ "case_id": "quake2/gladiator",
376
+ "boss": {
377
+ "en": "Blade-Arm Gunner"
378
+ },
379
+ "summary": {
380
+ "en": "A heavy soldier with a giant blade on one arm and a coilgun on the other, fighting at both ranges in an arena ringed by pillars."
381
+ },
382
+ "moves": [
383
+ {
384
+ "id": "attack_melee",
385
+ "name": {
386
+ "en": "Blade slash"
387
+ },
388
+ "tell": {
389
+ "en": "Up close it raises its blade, with a swing sound and motion"
390
+ },
391
+ "effect": {
392
+ "en": "Two heavy slashes that knock you back"
393
+ },
394
+ "counter": {
395
+ "en": "Do not stand next to it; keep a medium distance"
396
+ }
397
+ },
398
+ {
399
+ "id": "attack_gun",
400
+ "name": {
401
+ "en": "Coilgun"
402
+ },
403
+ "tell": {
404
+ "en": "When you are a little away, it first locks onto your position (the HUD shows the lock and an aim line), then fires about 0.4 s later"
405
+ },
406
+ "effect": {
407
+ "en": "An instant piercing shot along the locked line, very damaging"
408
+ },
409
+ "counter": {
410
+ "en": "Strafe as soon as you see the lock; it does not use this when you are very close"
411
+ }
412
+ }
413
+ ],
414
+ "phases": []
415
+ },
416
+ {
417
+ "case_id": "quake2/mutant",
418
+ "boss": {
419
+ "en": "Clawed Pouncer"
420
+ },
421
+ "summary": {
422
+ "en": "An agile clawed beast that leaps across a lab arena to close in, then strikes with both claws."
423
+ },
424
+ "moves": [
425
+ {
426
+ "id": "attack",
427
+ "name": {
428
+ "en": "Claw combo"
429
+ },
430
+ "tell": {
431
+ "en": "Up close it swings its left and right claws in turn"
432
+ },
433
+ "effect": {
434
+ "en": "Each claw hurts and pushes you back slightly; it keeps clawing while you stay in reach"
435
+ },
436
+ "counter": {
437
+ "en": "Back away and shoot while retreating"
438
+ }
439
+ },
440
+ {
441
+ "id": "jump",
442
+ "name": {
443
+ "en": "Pounce"
444
+ },
445
+ "tell": {
446
+ "en": "When it is some distance away at a similar height, it leaps at you"
447
+ },
448
+ "effect": {
449
+ "en": "The pounce hurts on hit; it cannot be interrupted until it lands"
450
+ },
451
+ "counter": {
452
+ "en": "Move sideways right after it takes off, then hit it as it lands"
453
+ }
454
+ }
455
+ ],
456
+ "phases": []
457
+ }
458
+ ]
459
+ }
environments/games/prototype/bossbench_llm/prompts/games/sekiro_remake.json ADDED
@@ -0,0 +1,1008 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "schema": "bossbench-llm/game-prompt@1",
3
+ "game": "sekiro_remake",
4
+ "rules": "sekiro@12",
5
+ "title": {
6
+ "en": "Third-person Swordplay: Six Boss Duels"
7
+ },
8
+ "dimension": "3d",
9
+ "view": {
10
+ "en": "Third-person 3D: you control a shinobi. Top left: boss name, execution points and health bar; top centre: boss posture bar; bottom left: your health, revive points, gourd and poison/dread gauges; bottom centre: your posture bar. A red danger mark appears over you before a perilous attack."
11
+ },
12
+ "goal": {
13
+ "en": "Empty the boss's health bars and land the required executions to win; you lose if health reaches zero with no revive left; each fight lasts at most 300 seconds and a timeout is not a win. Health does not regenerate; only the gourd restores it."
14
+ },
15
+ "mouse": {
16
+ "kind": "camera",
17
+ "en": "The camera starts free: horizontal mouse (dx) turns it at any time, X>0 turns right. After E locks on, the camera follows the boss and mouse movement has no effect."
18
+ },
19
+ "keys": [
20
+ {
21
+ "key": "W",
22
+ "en": "move forward relative to the camera"
23
+ },
24
+ {
25
+ "key": "A",
26
+ "en": "move left"
27
+ },
28
+ {
29
+ "key": "S",
30
+ "en": "move backward"
31
+ },
32
+ {
33
+ "key": "D",
34
+ "en": "move right"
35
+ },
36
+ {
37
+ "key": "Shift",
38
+ "en": "tap to dash-step (short dodge with invulnerable start); hold while moving to run; tap during a posture-break stagger to recover faster"
39
+ },
40
+ {
41
+ "key": "Space",
42
+ "en": "jump; press again in the air to kick (used to clear low sweeps)"
43
+ },
44
+ {
45
+ "key": "J",
46
+ "en": "tap to slash, hold to charge a thrust; a fresh press up close when a red dot shows on the enemy is an execution"
47
+ },
48
+ {
49
+ "key": "LMB",
50
+ "en": "slash (same as J)"
51
+ },
52
+ {
53
+ "key": "K",
54
+ "en": "hold to guard; a fresh press just before impact is a deflect"
55
+ },
56
+ {
57
+ "key": "RMB",
58
+ "en": "guard/deflect (same as K)"
59
+ },
60
+ {
61
+ "key": "Q",
62
+ "en": "drink the gourd to restore health; you cannot attack while drinking"
63
+ },
64
+ {
65
+ "key": "E",
66
+ "en": "toggle lock-on to the boss (starts unlocked)"
67
+ },
68
+ {
69
+ "key": "R",
70
+ "en": "revive after death (limited uses)"
71
+ }
72
+ ],
73
+ "notes": [
74
+ {
75
+ "en": "Fights are won through posture: deflects and hits fill the enemy's posture bar; when full they stagger and can be executed. Your own full posture bar breaks your guard."
76
+ },
77
+ {
78
+ "en": "Guarding is held; a deflect needs a fresh guard press just before impact. The window is short and mashing shortens it."
79
+ },
80
+ {
81
+ "en": "Perilous attacks show a red danger mark: dash toward thrusts, jump low sweeps, dash sideways or back out of grabs; none can be guarded."
82
+ },
83
+ {
84
+ "en": "When lightning strikes, jump to catch it and press attack again before landing to return it."
85
+ },
86
+ {
87
+ "en": "Full poison or dread gauges drain health or kill instantly; stay away from the source."
88
+ },
89
+ {
90
+ "en": "Actions are chosen per 200 ms packet, split into 6 sub-steps; press timing is counted in sub-steps."
91
+ }
92
+ ],
93
+ "compact_glossary": {
94
+ "move": {
95
+ "en": "Movement and camera turn (12 options)",
96
+ "options": {
97
+ "none": "no movement",
98
+ "forward": "hold W",
99
+ "forward_start": "W in first half of the packet",
100
+ "forward_end": "W in second half",
101
+ "forward_tap": "one short W step",
102
+ "back": "hold S",
103
+ "left": "hold A",
104
+ "right": "hold D",
105
+ "back_left": "S+A",
106
+ "back_right": "S+D",
107
+ "turn_left_30": "turn camera left about 30 degrees",
108
+ "turn_right_30": "turn camera right about 30 degrees"
109
+ }
110
+ },
111
+ "act": {
112
+ "en": "Action: slash, guard, deflect, dash, jump, items (one per packet)",
113
+ "options": {
114
+ "none": "no action",
115
+ "attack_0": "slash pressed at sub-step 1",
116
+ "deflect_0": "fresh guard press (deflect) at sub-step 1",
117
+ "jump_0": "jump/air kick pressed at sub-step 1",
118
+ "attack_1": "slash pressed at sub-step 2",
119
+ "deflect_1": "fresh guard press (deflect) at sub-step 2",
120
+ "jump_1": "jump/air kick pressed at sub-step 2",
121
+ "attack_2": "slash pressed at sub-step 3",
122
+ "deflect_2": "fresh guard press (deflect) at sub-step 3",
123
+ "jump_2": "jump/air kick pressed at sub-step 3",
124
+ "attack_3": "slash pressed at sub-step 4",
125
+ "deflect_3": "fresh guard press (deflect) at sub-step 4",
126
+ "jump_3": "jump/air kick pressed at sub-step 4",
127
+ "attack_4": "slash pressed at sub-step 5",
128
+ "deflect_4": "fresh guard press (deflect) at sub-step 5",
129
+ "jump_4": "jump/air kick pressed at sub-step 5",
130
+ "attack_5": "slash pressed at sub-step 6",
131
+ "deflect_5": "fresh guard press (deflect) at sub-step 6",
132
+ "jump_5": "jump/air kick pressed at sub-step 6",
133
+ "step_0": "dash-step at sub-step 1",
134
+ "step_1": "dash-step at sub-step 2",
135
+ "step_2": "dash-step at sub-step 3",
136
+ "step_3": "dash-step at sub-step 4",
137
+ "step_4": "dash-step at sub-step 5",
138
+ "deflect_attack_0_1": "guard at sub-step 1, slash at 2",
139
+ "deflect_attack_0_2": "guard at sub-step 1, slash at 3",
140
+ "deflect_attack_0_3": "guard at sub-step 1, slash at 4",
141
+ "deflect_attack_0_4": "guard at sub-step 1, slash at 5",
142
+ "deflect_attack_0_5": "guard at sub-step 1, slash at 6",
143
+ "deflect_attack_1_2": "guard at sub-step 2, slash at 3",
144
+ "deflect_attack_1_3": "guard at sub-step 2, slash at 4",
145
+ "deflect_attack_1_4": "guard at sub-step 2, slash at 5",
146
+ "deflect_attack_1_5": "guard at sub-step 2, slash at 6",
147
+ "deflect_attack_2_3": "guard at sub-step 3, slash at 4",
148
+ "deflect_attack_2_4": "guard at sub-step 3, slash at 5",
149
+ "deflect_attack_2_5": "guard at sub-step 3, slash at 6",
150
+ "deflect_attack_3_4": "guard at sub-step 4, slash at 5",
151
+ "deflect_attack_3_5": "guard at sub-step 4, slash at 6",
152
+ "deflect_attack_4_5": "guard at sub-step 5, slash at 6",
153
+ "deflect_0_4": "two deflect presses at sub-steps 1 and 5",
154
+ "deflect_0_5": "two deflect presses at sub-steps 1 and 6",
155
+ "deflect_2_4": "two deflect presses at sub-steps 3 and 5",
156
+ "deflect_2_5": "two deflect presses at sub-steps 3 and 6",
157
+ "deflect_3_5": "two deflect presses at sub-steps 4 and 6",
158
+ "deflect_2_4_5": "deflect presses at sub-steps 3, 5 and 6",
159
+ "step_alt_0": "repeated dash-steps from sub-step 1, every other",
160
+ "step_alt_1": "repeated dash-steps from sub-step 2, every other",
161
+ "jump_kick_0": "jump then air kick starting sub-step 1",
162
+ "jump_kick_1": "jump then air kick starting sub-step 2",
163
+ "jump_kick_2": "jump then air kick starting sub-step 3",
164
+ "jump_kick_3": "jump then air kick starting sub-step 4",
165
+ "jump_attack_0_1": "jump at sub-step 1, slash (lightning return) at 2",
166
+ "jump_attack_0_2": "jump at sub-step 1, slash (lightning return) at 3",
167
+ "jump_attack_0_3": "jump at sub-step 1, slash (lightning return) at 4",
168
+ "jump_attack_1_2": "jump at sub-step 2, slash (lightning return) at 3",
169
+ "jump_attack_1_3": "jump at sub-step 2, slash (lightning return) at 4",
170
+ "jump_attack_1_4": "jump at sub-step 2, slash (lightning return) at 5",
171
+ "jump_attack_2_3": "jump at sub-step 3, slash (lightning return) at 4",
172
+ "jump_attack_2_4": "jump at sub-step 3, slash (lightning return) at 5",
173
+ "jump_attack_2_5": "jump at sub-step 3, slash (lightning return) at 6",
174
+ "jump_attack_3_4": "jump at sub-step 4, slash (lightning return) at 5",
175
+ "jump_attack_3_5": "jump at sub-step 4, slash (lightning return) at 6",
176
+ "jump_attack_4_5": "jump at sub-step 5, slash (lightning return) at 6",
177
+ "guard_hold_2": "hold guard sub-steps 1-2",
178
+ "guard_hold_3": "hold guard sub-steps 1-3",
179
+ "guard_hold_6": "hold guard the whole packet",
180
+ "guard_hold_late": "hold guard sub-steps 4-6",
181
+ "run": "hold Shift to run",
182
+ "heal_0": "drink gourd at sub-step 1",
183
+ "heal_2": "drink at sub-step 3",
184
+ "heal_4": "drink at sub-step 5",
185
+ "revive": "revive after death",
186
+ "lock_toggle": "toggle boss lock-on"
187
+ }
188
+ }
189
+ },
190
+ "scenes": [
191
+ {
192
+ "case_id": "sekiro/demon",
193
+ "boss": {
194
+ "en": "Flame Behemoth"
195
+ },
196
+ "summary": {
197
+ "en": "A circular yard before a burning gate. The boss never guards and has hyper armour; it only staggers when its poise breaks. Standing under its belly dodges most attacks."
198
+ },
199
+ "moves": [
200
+ {
201
+ "id": "arm_swing",
202
+ "name": {
203
+ "en": "Arm swing"
204
+ },
205
+ "tell": {
206
+ "en": "Raises an arm then sweeps forward"
207
+ },
208
+ "effect": {
209
+ "en": "Single melee hit that costs health and posture"
210
+ },
211
+ "counter": {
212
+ "en": "Deflect or guard it, or move in under the belly"
213
+ }
214
+ },
215
+ {
216
+ "id": "stomp",
217
+ "name": {
218
+ "en": "Stomp"
219
+ },
220
+ "tell": {
221
+ "en": "Lifts a foot and holds about a second"
222
+ },
223
+ "effect": {
224
+ "en": "Ground impact with heavy damage"
225
+ },
226
+ "counter": {
227
+ "en": "Sidestep or dash before it lands, then counterattack"
228
+ }
229
+ },
230
+ {
231
+ "id": "fire_combo",
232
+ "name": {
233
+ "en": "Fire arm"
234
+ },
235
+ "tell": {
236
+ "en": "An arm ignites then slams down"
237
+ },
238
+ "effect": {
239
+ "en": "Cannot be deflected; guarding only reduces damage and builds burn"
240
+ },
241
+ "counter": {
242
+ "en": "Dash or back away; do not guard it"
243
+ }
244
+ },
245
+ {
246
+ "id": "fireballs",
247
+ "name": {
248
+ "en": "Fireballs"
249
+ },
250
+ "tell": {
251
+ "en": "Hands wave and each wave lobs a fireball"
252
+ },
253
+ "effect": {
254
+ "en": "Bursts on landing and leaves fire on the ground"
255
+ },
256
+ "counter": {
257
+ "en": "Dash through or stay clear of landing spots"
258
+ }
259
+ },
260
+ {
261
+ "id": "blast_leap",
262
+ "name": {
263
+ "en": "Blast leap"
264
+ },
265
+ "tell": {
266
+ "en": "Crouches then leaps high"
267
+ },
268
+ "effect": {
269
+ "en": "Large explosion on landing; cannot be guarded"
270
+ },
271
+ "counter": {
272
+ "en": "Run away or be airborne at landing; about a second of opening afterwards"
273
+ }
274
+ },
275
+ {
276
+ "id": "charge",
277
+ "name": {
278
+ "en": "Perilous charge"
279
+ },
280
+ "tell": {
281
+ "en": "A red danger mark appears and the boss rushes"
282
+ },
283
+ "effect": {
284
+ "en": "Perilous attack with heavy damage"
285
+ },
286
+ "counter": {
287
+ "en": "Jump over it"
288
+ }
289
+ },
290
+ {
291
+ "id": "fire_ring",
292
+ "name": {
293
+ "en": "Fire ring"
294
+ },
295
+ "tell": {
296
+ "en": "A ring of fire spreads on the ground (third phase)"
297
+ },
298
+ "effect": {
299
+ "en": "Touching it knocks you back and burns you; comes with a perilous sweep"
300
+ },
301
+ "counter": {
302
+ "en": "Jump over the ring"
303
+ },
304
+ "only": {
305
+ "en": "some phases only"
306
+ }
307
+ }
308
+ ],
309
+ "phases": [
310
+ {
311
+ "en": "Once burn fills, health drains continuously and posture stops recovering"
312
+ },
313
+ {
314
+ "en": "The third phase adds the fire ring, homing fireballs and a whip of fire"
315
+ }
316
+ ]
317
+ },
318
+ {
319
+ "case_id": "sekiro/genichiro",
320
+ "boss": {
321
+ "en": "Bow-and-Blade Swordsman"
322
+ },
323
+ "summary": {
324
+ "en": "A rectangular rooftop arena. He mixes sword and bow and has several health bars; in the last he becomes a lightning-calling swordsman."
325
+ },
326
+ "moves": [
327
+ {
328
+ "id": "slash",
329
+ "name": {
330
+ "en": "Slash"
331
+ },
332
+ "tell": {
333
+ "en": "Raises his sword for a straight cut"
334
+ },
335
+ "effect": {
336
+ "en": "Single hit costing health and posture"
337
+ },
338
+ "counter": {
339
+ "en": "Best deflected; guarding also works"
340
+ }
341
+ },
342
+ {
343
+ "id": "passage",
344
+ "name": {
345
+ "en": "String of cuts"
346
+ },
347
+ "tell": {
348
+ "en": "Two opening cuts, a spin, then many cuts ending in an uppercut"
349
+ },
350
+ "effect": {
351
+ "en": "Multi-hit string; the last hit pushes both back"
352
+ },
353
+ "counter": {
354
+ "en": "Deflect each cut; do not mash"
355
+ }
356
+ },
357
+ {
358
+ "id": "thrust",
359
+ "name": {
360
+ "en": "Perilous thrust"
361
+ },
362
+ "tell": {
363
+ "en": "Red danger mark, blade pointed forward"
364
+ },
365
+ "effect": {
366
+ "en": "Thrust with heavy damage"
367
+ },
368
+ "counter": {
369
+ "en": "Dash toward him to stomp the thrust for big posture damage"
370
+ }
371
+ },
372
+ {
373
+ "id": "sweep",
374
+ "name": {
375
+ "en": "Perilous sweep"
376
+ },
377
+ "tell": {
378
+ "en": "Red danger mark, blade sweeps low"
379
+ },
380
+ "effect": {
381
+ "en": "Low sweep"
382
+ },
383
+ "counter": {
384
+ "en": "Jump it; kick in the air"
385
+ }
386
+ },
387
+ {
388
+ "id": "grab",
389
+ "name": {
390
+ "en": "Perilous grab"
391
+ },
392
+ "tell": {
393
+ "en": "Red danger mark, he reaches out"
394
+ },
395
+ "effect": {
396
+ "en": "Grab that cannot be blocked"
397
+ },
398
+ "counter": {
399
+ "en": "Dash sideways or backwards"
400
+ }
401
+ },
402
+ {
403
+ "id": "volley",
404
+ "name": {
405
+ "en": "Bow shots"
406
+ },
407
+ "tell": {
408
+ "en": "Backs off and draws his bow, firing single or charged arrows"
409
+ },
410
+ "effect": {
411
+ "en": "Arrows hurt; charged shots have armour"
412
+ },
413
+ "counter": {
414
+ "en": "Dash aside, then close in"
415
+ }
416
+ },
417
+ {
418
+ "id": "lightning_slash",
419
+ "name": {
420
+ "en": "Lightning strike"
421
+ },
422
+ "tell": {
423
+ "en": "Final bar: he crouches and leaps, then lightning strikes (danger mark)"
424
+ },
425
+ "effect": {
426
+ "en": "Bolt along a line or arc; very heavy damage"
427
+ },
428
+ "counter": {
429
+ "en": "Jump to catch the bolt in the air, then press attack before landing to return it"
430
+ },
431
+ "only": {
432
+ "en": "some phases only"
433
+ }
434
+ },
435
+ {
436
+ "id": "heal_punish",
437
+ "name": {
438
+ "en": "Punishes healing"
439
+ },
440
+ "tell": {
441
+ "en": "You drink while he is idle"
442
+ },
443
+ "effect": {
444
+ "en": "He always answers with a charged shot or a dive thrust"
445
+ },
446
+ "counter": {
447
+ "en": "Do not drink while he stands idle"
448
+ }
449
+ }
450
+ ],
451
+ "phases": [
452
+ {
453
+ "en": "The first two bars are the swordsman; the last becomes the lightning swordsman with bolts"
454
+ },
455
+ {
456
+ "en": "Each bar needs an execution to finish"
457
+ }
458
+ ]
459
+ },
460
+ {
461
+ "case_id": "sekiro/guardian_ape",
462
+ "boss": {
463
+ "en": "Valley Giant Ape"
464
+ },
465
+ "summary": {
466
+ "en": "A round valley pool. First form: a hyper-armoured four-legged beast with poison. Second form: a headless apparition with a sword."
467
+ },
468
+ "moves": [
469
+ {
470
+ "id": "slam_combo",
471
+ "name": {
472
+ "en": "Slam combo"
473
+ },
474
+ "tell": {
475
+ "en": "Raises fists and slams four times"
476
+ },
477
+ "effect": {
478
+ "en": "Multi-hit slams"
479
+ },
480
+ "counter": {
481
+ "en": "Guardable; deflect each if possible"
482
+ }
483
+ },
484
+ {
485
+ "id": "swipe_grab",
486
+ "name": {
487
+ "en": "Perilous grab"
488
+ },
489
+ "tell": {
490
+ "en": "Red danger mark, a huge arm sweeps to grab"
491
+ },
492
+ "effect": {
493
+ "en": "Ground grab; cannot be guarded"
494
+ },
495
+ "counter": {
496
+ "en": "Jump over it"
497
+ }
498
+ },
499
+ {
500
+ "id": "belly_flop",
501
+ "name": {
502
+ "en": "Belly flop"
503
+ },
504
+ "tell": {
505
+ "en": "Danger mark, it throws itself down"
506
+ },
507
+ "effect": {
508
+ "en": "Body slam that cannot be jumped"
509
+ },
510
+ "counter": {
511
+ "en": "Back away"
512
+ }
513
+ },
514
+ {
515
+ "id": "fart",
516
+ "name": {
517
+ "en": "Poison gas and dung"
518
+ },
519
+ "tell": {
520
+ "en": "Releases a gas cloud then flees and throws dung"
521
+ },
522
+ "effect": {
523
+ "en": "Fills the poison gauge; once full, health drains"
524
+ },
525
+ "counter": {
526
+ "en": "Leave the cloud and dodge the throw"
527
+ }
528
+ },
529
+ {
530
+ "id": "sword4",
531
+ "name": {
532
+ "en": "Four cuts"
533
+ },
534
+ "tell": {
535
+ "en": "Headless form chops four times"
536
+ },
537
+ "effect": {
538
+ "en": "Multi-hit melee, deflectable"
539
+ },
540
+ "counter": {
541
+ "en": "Deflect each cut"
542
+ },
543
+ "only": {
544
+ "en": "some phases only"
545
+ }
546
+ },
547
+ {
548
+ "id": "diving_lunge",
549
+ "name": {
550
+ "en": "Diving lunge"
551
+ },
552
+ "tell": {
553
+ "en": "Headless form leaps and dives"
554
+ },
555
+ "effect": {
556
+ "en": "Heavy hit; afterwards its neck is exposed"
557
+ },
558
+ "counter": {
559
+ "en": "Deflect or dodge, then attack the exposed neck"
560
+ },
561
+ "only": {
562
+ "en": "some phases only"
563
+ }
564
+ },
565
+ {
566
+ "id": "scream_long",
567
+ "name": {
568
+ "en": "Blood roar"
569
+ },
570
+ "tell": {
571
+ "en": "Headless form throws back its head and roars (danger mark)"
572
+ },
573
+ "effect": {
574
+ "en": "Fills the dread gauge; full means instant death; guarding is useless"
575
+ },
576
+ "counter": {
577
+ "en": "Get out of range"
578
+ },
579
+ "only": {
580
+ "en": "some phases only"
581
+ }
582
+ },
583
+ {
584
+ "id": "overhead_slam",
585
+ "name": {
586
+ "en": "Perilous slam"
587
+ },
588
+ "tell": {
589
+ "en": "Danger mark, jump then heavy slam"
590
+ },
591
+ "effect": {
592
+ "en": "Heavy damage; deflect for big posture damage"
593
+ },
594
+ "counter": {
595
+ "en": "Deflect or dodge"
596
+ },
597
+ "only": {
598
+ "en": "some phases only"
599
+ }
600
+ }
601
+ ],
602
+ "phases": [
603
+ {
604
+ "en": "The first execution is fake; it rises again with a hidden bar"
605
+ },
606
+ {
607
+ "en": "The second form drops poison and uses the roar to build dread"
608
+ }
609
+ ]
610
+ },
611
+ {
612
+ "case_id": "sekiro/gyoubu",
613
+ "boss": {
614
+ "en": "Mounted Spear General"
615
+ },
616
+ "summary": {
617
+ "en": "A large circular yard before a gate. The mounted boss never guards and has hyper armour until poise breaks; there is no grappling hook, and after riding off he always charges back."
618
+ },
619
+ "moves": [
620
+ {
621
+ "id": "combo3",
622
+ "name": {
623
+ "en": "Three cuts"
624
+ },
625
+ "tell": {
626
+ "en": "Three close cuts"
627
+ },
628
+ "effect": {
629
+ "en": "The third is heavy; deflecting it staggers him"
630
+ },
631
+ "counter": {
632
+ "en": "Deflect the third cut"
633
+ }
634
+ },
635
+ {
636
+ "id": "thrust_near",
637
+ "name": {
638
+ "en": "Perilous thrust"
639
+ },
640
+ "tell": {
641
+ "en": "Danger mark, close spear thrust"
642
+ },
643
+ "effect": {
644
+ "en": "Heavy thrust"
645
+ },
646
+ "counter": {
647
+ "en": "Dash toward him to stomp it"
648
+ }
649
+ },
650
+ {
651
+ "id": "horse_kick",
652
+ "name": {
653
+ "en": "Horse kick"
654
+ },
655
+ "tell": {
656
+ "en": "Hooves rise when you stand directly behind"
657
+ },
658
+ "effect": {
659
+ "en": "Kick that staggers"
660
+ },
661
+ "counter": {
662
+ "en": "Stay out of the rear"
663
+ }
664
+ },
665
+ {
666
+ "id": "charge_sweep",
667
+ "name": {
668
+ "en": "Perilous charge"
669
+ },
670
+ "tell": {
671
+ "en": "Danger mark, he gallops at you"
672
+ },
673
+ "effect": {
674
+ "en": "Rides through, then rides off and turns back"
675
+ },
676
+ "counter": {
677
+ "en": "Jump or sidestep"
678
+ }
679
+ },
680
+ {
681
+ "id": "figure8",
682
+ "name": {
683
+ "en": "Figure-eight"
684
+ },
685
+ "tell": {
686
+ "en": "Circles you with repeated strikes"
687
+ },
688
+ "effect": {
689
+ "en": "Multiple hits"
690
+ },
691
+ "counter": {
692
+ "en": "Deflect each or back off"
693
+ }
694
+ },
695
+ {
696
+ "id": "rope_sweep",
697
+ "name": {
698
+ "en": "Rope-spear sweep"
699
+ },
700
+ "tell": {
701
+ "en": "Swings a roped spearhead in wide circles"
702
+ },
703
+ "effect": {
704
+ "en": "Three wide circles; guardable"
705
+ },
706
+ "counter": {
707
+ "en": "Guard or deflect"
708
+ }
709
+ },
710
+ {
711
+ "id": "rope_thrust",
712
+ "name": {
713
+ "en": "Rope-spear thrust"
714
+ },
715
+ "tell": {
716
+ "en": "Danger mark, spearhead shot in a line"
717
+ },
718
+ "effect": {
719
+ "en": "Line attack that cannot be guarded"
720
+ },
721
+ "counter": {
722
+ "en": "Deflect only, or sidestep"
723
+ }
724
+ },
725
+ {
726
+ "id": "jump_attack",
727
+ "name": {
728
+ "en": "Jump attack"
729
+ },
730
+ "tell": {
731
+ "en": "Leaps then slams twice"
732
+ },
733
+ "effect": {
734
+ "en": "Two heavy slams"
735
+ },
736
+ "counter": {
737
+ "en": "Deflect or back away"
738
+ }
739
+ }
740
+ ],
741
+ "phases": [
742
+ {
743
+ "en": "Hits land but cannot interrupt him; jumping cuts above the waist deal large posture damage"
744
+ }
745
+ ]
746
+ },
747
+ {
748
+ "case_id": "sekiro/isshin",
749
+ "boss": {
750
+ "en": "Old Sword-and-Spear Master"
751
+ },
752
+ "summary": {
753
+ "en": "A circular grass field. First a lightning swordsman, then the old master with sword, with spear and matchlock, and finally with lightning added."
754
+ },
755
+ "moves": [
756
+ {
757
+ "id": "cross",
758
+ "name": {
759
+ "en": "Cross cut"
760
+ },
761
+ "tell": {
762
+ "en": "Two crossing cuts"
763
+ },
764
+ "effect": {
765
+ "en": "Two hits"
766
+ },
767
+ "counter": {
768
+ "en": "Deflect both"
769
+ }
770
+ },
771
+ {
772
+ "id": "dragon_flash",
773
+ "name": {
774
+ "en": "Ranged slash"
775
+ },
776
+ "tell": {
777
+ "en": "Red blade wave at range (unblockable)"
778
+ },
779
+ "effect": {
780
+ "en": "Long-range slash"
781
+ },
782
+ "counter": {
783
+ "en": "Dash or run away"
784
+ }
785
+ },
786
+ {
787
+ "id": "mortal_blade",
788
+ "name": {
789
+ "en": "Dark blade"
790
+ },
791
+ "tell": {
792
+ "en": "Black-red blade spreads out"
793
+ },
794
+ "effect": {
795
+ "en": "Unblockable, twice"
796
+ },
797
+ "counter": {
798
+ "en": "Dash through or run"
799
+ }
800
+ },
801
+ {
802
+ "id": "wind_v",
803
+ "name": {
804
+ "en": "Energy blade"
805
+ },
806
+ "tell": {
807
+ "en": "Sword launches a wave"
808
+ },
809
+ "effect": {
810
+ "en": "Guarding bleeds health; deflecting does not hurt posture"
811
+ },
812
+ "counter": {
813
+ "en": "Sidestep vertical waves; jump flat ones"
814
+ }
815
+ },
816
+ {
817
+ "id": "pose_thrust",
818
+ "name": {
819
+ "en": "Perilous thrust"
820
+ },
821
+ "tell": {
822
+ "en": "Pose then perilous thrust"
823
+ },
824
+ "effect": {
825
+ "en": "Heavy damage"
826
+ },
827
+ "counter": {
828
+ "en": "Dash toward him to stomp it"
829
+ }
830
+ },
831
+ {
832
+ "id": "spear_sweep",
833
+ "name": {
834
+ "en": "Perilous spear sweep"
835
+ },
836
+ "tell": {
837
+ "en": "Spear danger-mark sweep"
838
+ },
839
+ "effect": {
840
+ "en": "Low sweep"
841
+ },
842
+ "counter": {
843
+ "en": "Jump"
844
+ },
845
+ "only": {
846
+ "en": "some phases only"
847
+ }
848
+ },
849
+ {
850
+ "id": "quad_shot",
851
+ "name": {
852
+ "en": "Four-shot volley"
853
+ },
854
+ "tell": {
855
+ "en": "Backs off and fires four times, the last delayed"
856
+ },
857
+ "effect": {
858
+ "en": "Guarding costs much posture; deflecting costs less"
859
+ },
860
+ "counter": {
861
+ "en": "Dash or deflect; a perilous attack always follows"
862
+ },
863
+ "only": {
864
+ "en": "some phases only"
865
+ }
866
+ },
867
+ {
868
+ "id": "thunder_chop",
869
+ "name": {
870
+ "en": "Lightning chop"
871
+ },
872
+ "tell": {
873
+ "en": "Cannot be interrupted while charging; bolt falls"
874
+ },
875
+ "effect": {
876
+ "en": "Heavy lightning damage"
877
+ },
878
+ "counter": {
879
+ "en": "Jump and return the bolt"
880
+ },
881
+ "only": {
882
+ "en": "some phases only"
883
+ }
884
+ }
885
+ ],
886
+ "phases": [
887
+ {
888
+ "en": "Lightning swordsman, sword, spear and matchlock, then lightning added; several bars"
889
+ },
890
+ {
891
+ "en": "Each bar needs an execution"
892
+ }
893
+ ]
894
+ },
895
+ {
896
+ "case_id": "sekiro/lady_butterfly",
897
+ "boss": {
898
+ "en": "Thread Kunoichi"
899
+ },
900
+ "summary": {
901
+ "en": "A courtyard with rows of pillars. She uses threads, kunai and aerial grabs; the second phase adds illusions and homing butterflies."
902
+ },
903
+ "moves": [
904
+ {
905
+ "id": "kunai_throw",
906
+ "name": {
907
+ "en": "Kunai throw"
908
+ },
909
+ "tell": {
910
+ "en": "Throws two kunai in quick succession"
911
+ },
912
+ "effect": {
913
+ "en": "Ranged damage"
914
+ },
915
+ "counter": {
916
+ "en": "Sidestep or deflect"
917
+ }
918
+ },
919
+ {
920
+ "id": "three_strike",
921
+ "name": {
922
+ "en": "Three strikes"
923
+ },
924
+ "tell": {
925
+ "en": "Two cuts then a downward strike"
926
+ },
927
+ "effect": {
928
+ "en": "Multi-hit"
929
+ },
930
+ "counter": {
931
+ "en": "Deflect each"
932
+ }
933
+ },
934
+ {
935
+ "id": "sweep",
936
+ "name": {
937
+ "en": "Perilous sweep"
938
+ },
939
+ "tell": {
940
+ "en": "Danger mark, two low sweeps"
941
+ },
942
+ "effect": {
943
+ "en": "Low, heavy damage"
944
+ },
945
+ "counter": {
946
+ "en": "Jump-kick for large posture damage"
947
+ }
948
+ },
949
+ {
950
+ "id": "drop_grab",
951
+ "name": {
952
+ "en": "Perilous aerial grab"
953
+ },
954
+ "tell": {
955
+ "en": "She climbs a thread, then dives with a danger mark"
956
+ },
957
+ "effect": {
958
+ "en": "Grab that cannot be jumped"
959
+ },
960
+ "counter": {
961
+ "en": "Back away"
962
+ }
963
+ },
964
+ {
965
+ "id": "illusion",
966
+ "name": {
967
+ "en": "Illusions"
968
+ },
969
+ "tell": {
970
+ "en": "Summons decoys that become homing butterflies"
971
+ },
972
+ "effect": {
973
+ "en": "Butterflies chase you"
974
+ },
975
+ "counter": {
976
+ "en": "Slash decoys; run straight and use pillars to block butterflies"
977
+ },
978
+ "only": {
979
+ "en": "some phases only"
980
+ }
981
+ },
982
+ {
983
+ "id": "flurry",
984
+ "name": {
985
+ "en": "Flurry"
986
+ },
987
+ "tell": {
988
+ "en": "Kick then many cuts, ending in a perilous sweep"
989
+ },
990
+ "effect": {
991
+ "en": "Multi-hit with a perilous finish"
992
+ },
993
+ "counter": {
994
+ "en": "Deflect cuts, jump the finish"
995
+ },
996
+ "only": {
997
+ "en": "some phases only"
998
+ }
999
+ }
1000
+ ],
1001
+ "phases": [
1002
+ {
1003
+ "en": "After the first execution she rises into the illusion phase"
1004
+ }
1005
+ ]
1006
+ }
1007
+ ]
1008
+ }
environments/games/prototype/bossbench_llm/prompts/games/soulknight_remake.json ADDED
@@ -0,0 +1,652 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "schema": "bossbench-llm/game-prompt@1",
3
+ "game": "soulknight_remake",
4
+ "rules": "knight-arena@6",
5
+ "title": {
6
+ "en": "Pixel Dungeon: Boss Rooms"
7
+ },
8
+ "dimension": "2d",
9
+ "view": {
10
+ "en": "Top-down 2D dungeon room with crates, pillars or trees as cover. You control an armoured gunner, and the mouse moves a crosshair; your health (red), armour (grey) and energy (blue) are at the top left, the boss's name, health bar and phase at the top centre, and your current weapon at the bottom right"
11
+ },
12
+ "goal": {
13
+ "en": "Empty the boss's health bar to win; you lose if your health reaches zero; each fight lasts at most 300 seconds and a timeout is not a win. Health does not regenerate"
14
+ },
15
+ "mouse": {
16
+ "kind": "pointer",
17
+ "en": "Weapons attack toward the crosshair; if you leave the mouse still for about 2 seconds while the boss is in sight, the crosshair pulls toward the boss automatically"
18
+ },
19
+ "keys": [
20
+ {
21
+ "key": "W",
22
+ "en": "move up"
23
+ },
24
+ {
25
+ "key": "A",
26
+ "en": "move left"
27
+ },
28
+ {
29
+ "key": "S",
30
+ "en": "move down"
31
+ },
32
+ {
33
+ "key": "D",
34
+ "en": "move right"
35
+ },
36
+ {
37
+ "key": "J",
38
+ "en": "hold to attack: guns keep firing, the broad blade swings; with a gun at point-blank range you stab with a knife automatically"
39
+ },
40
+ {
41
+ "key": "LMB",
42
+ "en": "hold to attack (same as J)"
43
+ },
44
+ {
45
+ "key": "K",
46
+ "en": "skill \"duplicate weapon\": wield a second copy of the current weapon for 5 seconds, then a 10-second cooldown"
47
+ },
48
+ {
49
+ "key": "RMB",
50
+ "en": "skill \"duplicate weapon\" (same as K)"
51
+ },
52
+ {
53
+ "key": "Q",
54
+ "en": "switch to the next weapon: basic pistol → repeater gun → bullet-clearing broad blade"
55
+ }
56
+ ],
57
+ "notes": [
58
+ {
59
+ "en": "WASD combine into eight directions; you move slower while holding attack"
60
+ },
61
+ {
62
+ "en": "Armour absorbs damage before health; after about 3 seconds without being hit, armour regenerates 1 point per second"
63
+ },
64
+ {
65
+ "en": "The repeater gun and the broad blade use energy per attack; the basic pistol is free, so switch back to it when energy runs out"
66
+ },
67
+ {
68
+ "en": "The broad blade's swing destroys ordinary bullets inside its arc"
69
+ },
70
+ {
71
+ "en": "Switching weapons ends \"duplicate weapon\" immediately"
72
+ },
73
+ {
74
+ "en": "At half health the boss enters its second phase (enraged): it attacks faster, its bullets fly faster, and it gains new attacks"
75
+ },
76
+ {
77
+ "en": "There is no roll or jump; dodge by moving and using cover"
78
+ }
79
+ ],
80
+ "compact_glossary": {
81
+ "move": {
82
+ "en": "movement",
83
+ "options": {
84
+ "none": "stand still",
85
+ "right": "walk right",
86
+ "down_right": "walk down-right",
87
+ "down": "walk down",
88
+ "down_left": "walk down-left",
89
+ "left": "walk left",
90
+ "up_left": "walk up-left",
91
+ "up": "walk up",
92
+ "up_right": "walk up-right"
93
+ }
94
+ },
95
+ "aim": {
96
+ "en": "crosshair",
97
+ "options": {
98
+ "none": "keep the crosshair still (after 2 s it auto-aims at a visible boss)",
99
+ "right_40": "move the crosshair 40 px right",
100
+ "down_right_40": "move the crosshair 40 px down-right",
101
+ "down_40": "move the crosshair 40 px down",
102
+ "down_left_40": "move the crosshair 40 px down-left",
103
+ "left_40": "move the crosshair 40 px left",
104
+ "up_left_40": "move the crosshair 40 px up-left",
105
+ "up_40": "move the crosshair 40 px up",
106
+ "up_right_40": "move the crosshair 40 px up-right"
107
+ }
108
+ },
109
+ "act": {
110
+ "en": "attack / skill / weapon",
111
+ "options": {
112
+ "none": "do not attack",
113
+ "fire": "hold attack",
114
+ "fire_skill": "hold attack and use the duplicate-weapon skill",
115
+ "switch": "switch to the next weapon (then keep attacking)"
116
+ }
117
+ }
118
+ },
119
+ "scenes": [
120
+ {
121
+ "case_id": "soulknight/goblin_priest",
122
+ "boss": {
123
+ "en": "Meteor Caller"
124
+ },
125
+ "summary": {
126
+ "en": "A caster walks around an open room, calling meteors, orbiting orbs, turrets and star bullets."
127
+ },
128
+ "moves": [
129
+ {
130
+ "id": "meteor",
131
+ "name": {
132
+ "en": "Meteors"
133
+ },
134
+ "tell": {
135
+ "en": "Several impact markers appear on the ground (more when enraged)"
136
+ },
137
+ "effect": {
138
+ "en": "Meteors hit the marked spots"
139
+ },
140
+ "counter": {
141
+ "en": "Leave the marked spots as soon as they appear"
142
+ }
143
+ },
144
+ {
145
+ "id": "orbs",
146
+ "name": {
147
+ "en": "Orbiting orbs"
148
+ },
149
+ "tell": {
150
+ "en": "Two orbs circle the boss and can stack up"
151
+ },
152
+ "effect": {
153
+ "en": "Touching an orb hurts"
154
+ },
155
+ "counter": {
156
+ "en": "Keep your distance from the boss"
157
+ }
158
+ },
159
+ {
160
+ "id": "turrets",
161
+ "name": {
162
+ "en": "Turrets"
163
+ },
164
+ "tell": {
165
+ "en": "It fires a shot that leaves a line of turrets behind it"
166
+ },
167
+ "effect": {
168
+ "en": "The turrets fire sideways, perpendicular to the line"
169
+ },
170
+ "counter": {
171
+ "en": "Do not stand beside the turret line; the broad blade can destroy turrets"
172
+ }
173
+ },
174
+ {
175
+ "id": "stars",
176
+ "name": {
177
+ "en": "Star burst"
178
+ },
179
+ "tell": {
180
+ "en": "It releases a ring of six stars"
181
+ },
182
+ "effect": {
183
+ "en": "Each star splits into three smaller bullets"
184
+ },
185
+ "counter": {
186
+ "en": "Slip through the gaps between the stars"
187
+ }
188
+ }
189
+ ],
190
+ "phases": [
191
+ {
192
+ "en": "When enraged it calls four meteors instead of three and attacks faster"
193
+ }
194
+ ]
195
+ },
196
+ {
197
+ "case_id": "soulknight/christmas_treant",
198
+ "boss": {
199
+ "en": "Ram Timber"
200
+ },
201
+ "summary": {
202
+ "en": "A walking tree that hides among two rings of crates; it holds up an energy ball that sprays bullets, sends shockwaves, and rams you once enraged."
203
+ },
204
+ "moves": [
205
+ {
206
+ "id": "hold",
207
+ "name": {
208
+ "en": "Held energy ball"
209
+ },
210
+ "tell": {
211
+ "en": "It raises a big energy ball overhead"
212
+ },
213
+ "effect": {
214
+ "en": "The ball sprays bullets in every direction"
215
+ },
216
+ "counter": {
217
+ "en": "Hide behind crates"
218
+ }
219
+ },
220
+ {
221
+ "id": "throw",
222
+ "name": {
223
+ "en": "Ball throw"
224
+ },
225
+ "tell": {
226
+ "en": "It throws the held ball at you"
227
+ },
228
+ "effect": {
229
+ "en": "It sprays bullets in flight and explodes on impact"
230
+ },
231
+ "counter": {
232
+ "en": "Sidestep its flight path"
233
+ }
234
+ },
235
+ {
236
+ "id": "waves",
237
+ "name": {
238
+ "en": "Shockwaves"
239
+ },
240
+ "tell": {
241
+ "en": "Lines appear on the ground and shockwaves travel along them"
242
+ },
243
+ "effect": {
244
+ "en": "The shockwaves hurt"
245
+ },
246
+ "counter": {
247
+ "en": "Step off the drawn lines"
248
+ }
249
+ },
250
+ {
251
+ "id": "charge",
252
+ "name": {
253
+ "en": "Ram"
254
+ },
255
+ "tell": {
256
+ "en": "A charge band toward you appears on the ground; when it brightens the direction is locked"
257
+ },
258
+ "effect": {
259
+ "en": "It dashes straight along the band, smashing through crates, and takes no damage while charging"
260
+ },
261
+ "counter": {
262
+ "en": "Leave the band as soon as it brightens"
263
+ }
264
+ },
265
+ {
266
+ "id": "homing",
267
+ "name": {
268
+ "en": "Homing shots"
269
+ },
270
+ "tell": {
271
+ "en": "It releases five homing shots that start chasing you after a short pause"
272
+ },
273
+ "effect": {
274
+ "en": "They hurt on hit"
275
+ },
276
+ "counter": {
277
+ "en": "Circle around cover so they hit obstacles"
278
+ }
279
+ },
280
+ {
281
+ "id": "cross",
282
+ "name": {
283
+ "en": "Cross bullets"
284
+ },
285
+ "tell": {
286
+ "en": "It fires big cross-shaped bullets all around"
287
+ },
288
+ "effect": {
289
+ "en": "They hurt on hit"
290
+ },
291
+ "counter": {
292
+ "en": "Stand in the gaps between them"
293
+ }
294
+ },
295
+ {
296
+ "id": "line",
297
+ "name": {
298
+ "en": "Shockwave line"
299
+ },
300
+ "tell": {
301
+ "en": "It sends a line of shockwaves toward you"
302
+ },
303
+ "effect": {
304
+ "en": "The shockwaves hurt"
305
+ },
306
+ "counter": {
307
+ "en": "Move sideways off the line"
308
+ }
309
+ }
310
+ ],
311
+ "phases": [
312
+ {
313
+ "en": "Entering the enraged phase it sends shockwaves in seven directions, then adds the ram, homing shots, cross bullets and the shockwave line"
314
+ }
315
+ ]
316
+ },
317
+ {
318
+ "case_id": "soulknight/devils_snare",
319
+ "boss": {
320
+ "en": "Spin Bloom"
321
+ },
322
+ "summary": {
323
+ "en": "A poison flower that almost always sits in its own poison pool, pressing you with slow bubbles, rotating bullet streams and poison shots; it sprouts tentacles when enraged."
324
+ },
325
+ "moves": [
326
+ {
327
+ "id": "bubbles",
328
+ "name": {
329
+ "en": "Slow bubbles"
330
+ },
331
+ "tell": {
332
+ "en": "It blows a ring of slow bubbles that fade after a few seconds"
333
+ },
334
+ "effect": {
335
+ "en": "Bubbles hurt on contact"
336
+ },
337
+ "counter": {
338
+ "en": "Weave slowly between them"
339
+ }
340
+ },
341
+ {
342
+ "id": "rotate",
343
+ "name": {
344
+ "en": "Rotating streams"
345
+ },
346
+ "tell": {
347
+ "en": "Bullet streams fire from four points in four directions and rotate; they are slower than you"
348
+ },
349
+ "effect": {
350
+ "en": "The streams hurt on hit"
351
+ },
352
+ "counter": {
353
+ "en": "Circle in the same direction as the rotation"
354
+ }
355
+ },
356
+ {
357
+ "id": "beams",
358
+ "name": {
359
+ "en": "Poison beams"
360
+ },
361
+ "tell": {
362
+ "en": "It fires green beam-like bullets all around"
363
+ },
364
+ "effect": {
365
+ "en": "They hurt and poison you"
366
+ },
367
+ "counter": {
368
+ "en": "Get behind cover or back off"
369
+ }
370
+ },
371
+ {
372
+ "id": "pool",
373
+ "name": {
374
+ "en": "Poison pool"
375
+ },
376
+ "tell": {
377
+ "en": "It spreads a poison pool beneath itself"
378
+ },
379
+ "effect": {
380
+ "en": "Standing in it poisons and slows you"
381
+ },
382
+ "counter": {
383
+ "en": "Do not fight up close; attack from outside the pool"
384
+ }
385
+ },
386
+ {
387
+ "id": "corner",
388
+ "name": {
389
+ "en": "Corner shots"
390
+ },
391
+ "tell": {
392
+ "en": "Four fast bullets fly toward the room's corners, leaving spreading bubble trails"
393
+ },
394
+ "effect": {
395
+ "en": "Both the bullets and the bubbles hurt"
396
+ },
397
+ "counter": {
398
+ "en": "Stay off the lines toward the corners"
399
+ }
400
+ },
401
+ {
402
+ "id": "pull",
403
+ "name": {
404
+ "en": "Pulling wave"
405
+ },
406
+ "tell": {
407
+ "en": "It releases a wave that pulls you toward it"
408
+ },
409
+ "effect": {
410
+ "en": "It deals no damage but drags you toward danger; walls partly block it"
411
+ },
412
+ "counter": {
413
+ "en": "Move away from it and hug a wall"
414
+ }
415
+ }
416
+ ],
417
+ "phases": [
418
+ {
419
+ "en": "When enraged the flower opens and four tentacles appear; it then adds corner shots and the pulling wave, and mixes poison shots into the rotating streams"
420
+ }
421
+ ]
422
+ },
423
+ {
424
+ "case_id": "soulknight/grand_slime",
425
+ "boss": {
426
+ "en": "Swell Jelly"
427
+ },
428
+ "summary": {
429
+ "en": "A big jelly boss in a room with slowing and speeding floor tiles: it slams the ground for bullets, summons small jellies, and once enraged swells up and explodes after taking enough hits."
430
+ },
431
+ "moves": [
432
+ {
433
+ "id": "slam",
434
+ "name": {
435
+ "en": "Ground slam"
436
+ },
437
+ "tell": {
438
+ "en": "It slams the ground twice"
439
+ },
440
+ "effect": {
441
+ "en": "Clusters of red bullets fly out in random directions at random speeds"
442
+ },
443
+ "counter": {
444
+ "en": "Back off and find gaps between the bullets"
445
+ }
446
+ },
447
+ {
448
+ "id": "rings",
449
+ "name": {
450
+ "en": "Bullet rings"
451
+ },
452
+ "tell": {
453
+ "en": "It fires four rings of bullets in quick succession"
454
+ },
455
+ "effect": {
456
+ "en": "The bullets stop mid-air after a distance and slowly form a flower shape"
457
+ },
458
+ "counter": {
459
+ "en": "Pass through the gaps between the petals"
460
+ }
461
+ },
462
+ {
463
+ "id": "spawn",
464
+ "name": {
465
+ "en": "Summon small jellies"
466
+ },
467
+ "tell": {
468
+ "en": "It spawns a small jelly beside itself"
469
+ },
470
+ "effect": {
471
+ "en": "Small jellies hurt on contact"
472
+ },
473
+ "counter": {
474
+ "en": "Clear them as you go"
475
+ }
476
+ },
477
+ {
478
+ "id": "goo",
479
+ "name": {
480
+ "en": "Goo slam"
481
+ },
482
+ "tell": {
483
+ "en": "It slams the ground, leaving a green poison pool and lingering bullets"
484
+ },
485
+ "effect": {
486
+ "en": "The pool poisons you and the bullets hurt"
487
+ },
488
+ "counter": {
489
+ "en": "Stay out of the pool"
490
+ }
491
+ }
492
+ ],
493
+ "phases": [
494
+ {
495
+ "en": "Once enraged it explodes right away (the expanding circle is the blast radius), and again after about 15 more hits; the slow and boost tiles affect the boss too"
496
+ }
497
+ ]
498
+ },
499
+ {
500
+ "case_id": "soulknight/varkolyn_leader",
501
+ "boss": {
502
+ "en": "Violet Sweeper"
503
+ },
504
+ "summary": {
505
+ "en": "A cloaked boss in a room with no cover at all, casting purple poison pools, tentacles and a sweeping laser; it is invulnerable while standing in a pool."
506
+ },
507
+ "moves": [
508
+ {
509
+ "id": "pools",
510
+ "name": {
511
+ "en": "Purple pools"
512
+ },
513
+ "tell": {
514
+ "en": "It lays four purple pools in a line toward you"
515
+ },
516
+ "effect": {
517
+ "en": "The pools poison and slow you; the boss is invulnerable while it stands in one"
518
+ },
519
+ "counter": {
520
+ "en": "Avoid the pools; while it is in one, dodge and wait until it steps out"
521
+ }
522
+ },
523
+ {
524
+ "id": "tentacles",
525
+ "name": {
526
+ "en": "Tentacles"
527
+ },
528
+ "tell": {
529
+ "en": "Four tentacles sprout at random spots in the room"
530
+ },
531
+ "effect": {
532
+ "en": "The tentacles attack you when you are near"
533
+ },
534
+ "counter": {
535
+ "en": "Keep away from them, or destroy them first"
536
+ }
537
+ },
538
+ {
539
+ "id": "ring",
540
+ "name": {
541
+ "en": "Bullet ring"
542
+ },
543
+ "tell": {
544
+ "en": "It fires small bullets in every direction"
545
+ },
546
+ "effect": {
547
+ "en": "They hurt on hit"
548
+ },
549
+ "counter": {
550
+ "en": "Find the gaps between them"
551
+ }
552
+ },
553
+ {
554
+ "id": "laser",
555
+ "name": {
556
+ "en": "Sweeping laser"
557
+ },
558
+ "tell": {
559
+ "en": "It rings a sharp chime, and the starting line and the swept sector are drawn on the floor"
560
+ },
561
+ "effect": {
562
+ "en": "The laser sweeps through the sector for heavy damage; it does nothing else while firing"
563
+ },
564
+ "counter": {
565
+ "en": "Leave the drawn sector at the chime, then counterattack after the sweep"
566
+ }
567
+ },
568
+ {
569
+ "id": "orb",
570
+ "name": {
571
+ "en": "Spiral orb"
572
+ },
573
+ "tell": {
574
+ "en": "It fires a large bullet that keeps spinning out spirals of small bullets"
575
+ },
576
+ "effect": {
577
+ "en": "Both hurt; the spirals stop only when the large bullet is destroyed"
578
+ },
579
+ "counter": {
580
+ "en": "Destroy the large bullet first"
581
+ }
582
+ }
583
+ ],
584
+ "phases": [
585
+ {
586
+ "en": "When enraged it attacks more often, and the laser charges faster and sweeps faster"
587
+ }
588
+ ]
589
+ },
590
+ {
591
+ "case_id": "soulknight/volcanic_sandworm",
592
+ "boss": {
593
+ "en": "Burrow Bomber"
594
+ },
595
+ "summary": {
596
+ "en": "A big worm in a room with stacked crates in the corners fires explosive shells and spreads, burrows underground, and surfaces near you."
597
+ },
598
+ "moves": [
599
+ {
600
+ "id": "explosive",
601
+ "name": {
602
+ "en": "Explosive shell"
603
+ },
604
+ "tell": {
605
+ "en": "It leans back and fires a large explosive shell; its blast radius is drawn around it in flight"
606
+ },
607
+ "effect": {
608
+ "en": "It explodes on hitting a wall, a crate or you, over a wide area"
609
+ },
610
+ "counter": {
611
+ "en": "Sidestep it and leave the drawn blast circle"
612
+ }
613
+ },
614
+ {
615
+ "id": "spread",
616
+ "name": {
617
+ "en": "Wide spread"
618
+ },
619
+ "tell": {
620
+ "en": "It fires a wide fan of big bullets that slow down as they travel"
621
+ },
622
+ "effect": {
623
+ "en": "They burst in a small blast on impact"
624
+ },
625
+ "counter": {
626
+ "en": "Back off and slip between them"
627
+ }
628
+ },
629
+ {
630
+ "id": "dig",
631
+ "name": {
632
+ "en": "Burrow"
633
+ },
634
+ "tell": {
635
+ "en": "It sinks underground and only a moving dirt mound is visible (the HUD shows that it cannot be attacked)"
636
+ },
637
+ "effect": {
638
+ "en": "Burrowing and surfacing cause shockwaves, and it leaves stars that fire bullets around"
639
+ },
640
+ "counter": {
641
+ "en": "Stay away from the mound and attack after it surfaces"
642
+ }
643
+ }
644
+ ],
645
+ "phases": [
646
+ {
647
+ "en": "When enraged it burrows faster and makes several quick dives, briefly surfacing between them, and leaves more bullets each time it comes up"
648
+ }
649
+ ]
650
+ }
651
+ ]
652
+ }
environments/games/prototype/bossbench_llm/prompts/games/terraria_remake.json ADDED
@@ -0,0 +1,462 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "schema": "bossbench-llm/game-prompt@1",
3
+ "game": "terraria_remake",
4
+ "rules": "terraria-1458-arena-r7",
5
+ "title": {
6
+ "en": "Pixel Arena: Sword and Bow"
7
+ },
8
+ "dimension": "2d",
9
+ "view": {
10
+ "en": "Side-view 2D arena: two wooden platforms you can stand on above the ground, with pillars at both edges. You control an adventurer with a sword and a bow, and the mouse moves a crosshair; your health, flight and mana bars are at the top left, the boss's name, health bar and phase at the top right"
11
+ },
12
+ "goal": {
13
+ "en": "Empty the boss's health bar to win; you lose if your health reaches zero; each fight lasts at most 300 seconds and a timeout is not a win. Health does not regenerate on its own; only hearts sometimes dropped by defeated minions or boss segments restore it"
14
+ },
15
+ "mouse": {
16
+ "kind": "pointer",
17
+ "en": "The bow fires toward the crosshair; the crosshair starts at the centre of the arena"
18
+ },
19
+ "keys": [
20
+ {
21
+ "key": "A",
22
+ "en": "move left (speeds up to a sprint)"
23
+ },
24
+ {
25
+ "key": "D",
26
+ "en": "move right (speeds up to a sprint)"
27
+ },
28
+ {
29
+ "key": "Space",
30
+ "en": "jump, higher the longer you hold it; holding it in the air flies for a short time, and once flight runs out holding it glides"
31
+ },
32
+ {
33
+ "key": "S",
34
+ "en": "drop down through the wooden platform you stand on"
35
+ },
36
+ {
37
+ "key": "J",
38
+ "en": "use the current weapon (sword or bow)"
39
+ },
40
+ {
41
+ "key": "LMB",
42
+ "en": "use the current weapon (same as J)"
43
+ },
44
+ {
45
+ "key": "Q",
46
+ "en": "switch the current weapon between sword and bow"
47
+ },
48
+ {
49
+ "key": "E",
50
+ "en": "shoot the bow at the crosshair directly"
51
+ },
52
+ {
53
+ "key": "RMB",
54
+ "en": "swing the sword directly"
55
+ }
56
+ ],
57
+ "notes": [
58
+ {
59
+ "en": "Flight refills when you land and lasts about 1.5 seconds"
60
+ },
61
+ {
62
+ "en": "The bow fires about every 0.33 s and the sword swings about every 0.38 s; holding the attack key repeats automatically"
63
+ },
64
+ {
65
+ "en": "The sword sweeps an arc in the direction you face and can hit several targets at once; arrows fly toward the crosshair and stop at the first target. Both can destroy the boss's projectiles"
66
+ },
67
+ {
68
+ "en": "You are briefly invulnerable after being hit; attacking or flying gives no invulnerability"
69
+ },
70
+ {
71
+ "en": "The easy, normal and hard tiers all use classic rules; moves tagged [expert mode only] appear only at difficulty 0.75 or above"
72
+ }
73
+ ],
74
+ "compact_glossary": {},
75
+ "scenes": [
76
+ {
77
+ "case_id": "terraria/king_slime",
78
+ "boss": {
79
+ "en": "Bouncing Gel Giant"
80
+ },
81
+ "summary": {
82
+ "en": "A giant gel creature keeps leaping to crush you, sheds small gel blobs when hit, and sometimes vanishes and reappears near you."
83
+ },
84
+ "moves": [
85
+ {
86
+ "id": "jump",
87
+ "name": {
88
+ "en": "Leap"
89
+ },
90
+ "tell": {
91
+ "en": "Watch the direction and arc of its jump"
92
+ },
93
+ "effect": {
94
+ "en": "It lands on you with its body; touching it hurts"
95
+ },
96
+ "counter": {
97
+ "en": "Step aside from the landing spot and attack while it pauses after landing"
98
+ }
99
+ },
100
+ {
101
+ "id": "low_jump",
102
+ "name": {
103
+ "en": "Low leap"
104
+ },
105
+ "tell": {
106
+ "en": "The third of every four jumps is lower and faster sideways"
107
+ },
108
+ "effect": {
109
+ "en": "It rushes in low and fast; touching it hurts"
110
+ },
111
+ "counter": {
112
+ "en": "Jump over it, or fly briefly and let it pass underneath"
113
+ }
114
+ },
115
+ {
116
+ "id": "high_jump",
117
+ "name": {
118
+ "en": "High leap"
119
+ },
120
+ "tell": {
121
+ "en": "The fourth of every four jumps goes very high"
122
+ },
123
+ "effect": {
124
+ "en": "It comes down from high up over a wide area"
125
+ },
126
+ "counter": {
127
+ "en": "Run along the ground away from where it is heading"
128
+ }
129
+ },
130
+ {
131
+ "id": "teleport",
132
+ "name": {
133
+ "en": "Teleport"
134
+ },
135
+ "tell": {
136
+ "en": "Its body fades out over about a second, then reappears over half a second, usually not far from you"
137
+ },
138
+ "effect": {
139
+ "en": "Once it reappears it can hit you again"
140
+ },
141
+ "counter": {
142
+ "en": "Keep moving once it starts fading, then attack after it reappears"
143
+ }
144
+ }
145
+ ],
146
+ "phases": [
147
+ {
148
+ "en": "It shrinks and jumps more often as it loses health, and spawns small gel blobs when damaged"
149
+ }
150
+ ]
151
+ },
152
+ {
153
+ "case_id": "terraria/eye_of_cthulhu",
154
+ "boss": {
155
+ "en": "Charging Giant Eye"
156
+ },
157
+ "summary": {
158
+ "en": "A huge floating eyeball that summons small eyes and then charges at you repeatedly; after losing half its health it transforms and charges harder."
159
+ },
160
+ "moves": [
161
+ {
162
+ "id": "dash",
163
+ "name": {
164
+ "en": "Triple charge"
165
+ },
166
+ "tell": {
167
+ "en": "It hovers, then charges at you three times; each charge keeps its direction once it starts"
168
+ },
169
+ "effect": {
170
+ "en": "Contact damage"
171
+ },
172
+ "counter": {
173
+ "en": "Move sideways once it commits, then attack as it slows at the end of the charge"
174
+ }
175
+ },
176
+ {
177
+ "id": "transform",
178
+ "name": {
179
+ "en": "Transformation"
180
+ },
181
+ "tell": {
182
+ "en": "It spins in place and its pupil turns into a mouth (in expert mode it also summons extra small eyes)"
183
+ },
184
+ "effect": {
185
+ "en": "Afterwards it enters its second form and charges faster"
186
+ },
187
+ "counter": {
188
+ "en": "You can hit it while it transforms; watch the small eyes still around"
189
+ }
190
+ },
191
+ {
192
+ "id": "chain_dash",
193
+ "name": {
194
+ "en": "Rapid charges"
195
+ },
196
+ "tell": {
197
+ "en": "In its second form it adds faster rushes after the three normal charges, almost nonstop at low health"
198
+ },
199
+ "effect": {
200
+ "en": "Contact damage"
201
+ },
202
+ "counter": {
203
+ "en": "Keep changing direction; never stand still"
204
+ },
205
+ "only": {
206
+ "en": "expert mode only"
207
+ }
208
+ }
209
+ ],
210
+ "phases": [
211
+ {
212
+ "en": "In the first form it summons small eyes that ram you; it transforms into the second form at about half health"
213
+ }
214
+ ]
215
+ },
216
+ {
217
+ "case_id": "terraria/skeletron",
218
+ "boss": {
219
+ "en": "Twin-Handed Giant Skull"
220
+ },
221
+ "summary": {
222
+ "en": "A giant skull with two independent hands: the hands slam and sweep, and the skull periodically spins after you."
223
+ },
224
+ "moves": [
225
+ {
226
+ "id": "hand_sweep",
227
+ "name": {
228
+ "en": "Hand slams"
229
+ },
230
+ "tell": {
231
+ "en": "Each hand rises and slams down, or lines up with you and sweeps sideways"
232
+ },
233
+ "effect": {
234
+ "en": "The hands hurt on contact"
235
+ },
236
+ "counter": {
237
+ "en": "Destroy the hands first; the skull becomes weaker and spins slower"
238
+ }
239
+ },
240
+ {
241
+ "id": "spin",
242
+ "name": {
243
+ "en": "Spinning chase"
244
+ },
245
+ "tell": {
246
+ "en": "After hovering for a while it roars, then spins after you for several seconds"
247
+ },
248
+ "effect": {
249
+ "en": "The spinning skull hurts on contact"
250
+ },
251
+ "counter": {
252
+ "en": "Its defence drops while spinning; dodge and hit it"
253
+ }
254
+ },
255
+ {
256
+ "id": "skull_shot",
257
+ "name": {
258
+ "en": "Homing skulls"
259
+ },
260
+ "tell": {
261
+ "en": "Once the skull is hurt enough or a hand is destroyed, it fires skulls that home in on you; not while spinning"
262
+ },
263
+ "effect": {
264
+ "en": "The projectiles hurt on hit"
265
+ },
266
+ "counter": {
267
+ "en": "Change direction to shake them off"
268
+ },
269
+ "only": {
270
+ "en": "expert mode only"
271
+ }
272
+ }
273
+ ],
274
+ "phases": []
275
+ },
276
+ {
277
+ "case_id": "terraria/eater_of_worlds",
278
+ "boss": {
279
+ "en": "Burrowing Great Worm"
280
+ },
281
+ "summary": {
282
+ "en": "A long worm made of dozens of segments that tunnels through the ground and platforms after you; breaking a middle segment splits it in two."
283
+ },
284
+ "moves": [
285
+ {
286
+ "id": "burrow",
287
+ "name": {
288
+ "en": "Burrowing chase"
289
+ },
290
+ "tell": {
291
+ "en": "It speeds toward you while inside the ground or a platform and falls under gravity when it leaves them; there is no extra warning"
292
+ },
293
+ "effect": {
294
+ "en": "Both head and body hurt on contact; the head hurts most"
295
+ },
296
+ "counter": {
297
+ "en": "Avoid the head and attack the body as it passes"
298
+ }
299
+ },
300
+ {
301
+ "id": "split",
302
+ "name": {
303
+ "en": "Splitting"
304
+ },
305
+ "tell": {
306
+ "en": "When a middle segment is destroyed the worm breaks into two, each growing a new head and tail"
307
+ },
308
+ "effect": {
309
+ "en": "More worms chase you"
310
+ },
311
+ "counter": {
312
+ "en": "Focus heads and tails, or use the sword to hit several segments at once"
313
+ }
314
+ },
315
+ {
316
+ "id": "acid_spit",
317
+ "name": {
318
+ "en": "Corrosive spit"
319
+ },
320
+ "tell": {
321
+ "en": "Segments that can see you spit projectiles at you; the tail does not"
322
+ },
323
+ "effect": {
324
+ "en": "The projectiles hurt on hit"
325
+ },
326
+ "counter": {
327
+ "en": "Any attack destroys a spit in one hit"
328
+ },
329
+ "only": {
330
+ "en": "expert mode only"
331
+ }
332
+ }
333
+ ],
334
+ "phases": [
335
+ {
336
+ "en": "You win when every segment is gone; dying segments sometimes drop hearts"
337
+ }
338
+ ]
339
+ },
340
+ {
341
+ "case_id": "terraria/queen_bee",
342
+ "boss": {
343
+ "en": "Charging Giant Bee"
344
+ },
345
+ "summary": {
346
+ "en": "A giant bee that charges back and forth horizontally, summons small bees, or fires stingers from above you."
347
+ },
348
+ "moves": [
349
+ {
350
+ "id": "charge",
351
+ "name": {
352
+ "en": "Horizontal charges"
353
+ },
354
+ "tell": {
355
+ "en": "It flies to your left or right at your height, then charges horizontally back and forth three times; it always opens with this"
356
+ },
357
+ "effect": {
358
+ "en": "Contact damage"
359
+ },
360
+ "counter": {
361
+ "en": "Once you see the height it lines up at, jump or switch platform level, then hit it from behind after it passes"
362
+ }
363
+ },
364
+ {
365
+ "id": "summon",
366
+ "name": {
367
+ "en": "Bee swarm"
368
+ },
369
+ "tell": {
370
+ "en": "It hovers above you and releases a swarm of small bees"
371
+ },
372
+ "effect": {
373
+ "en": "The small bees chase you and hurt on contact"
374
+ },
375
+ "counter": {
376
+ "en": "The small bees are fragile, so clear them with arrows or the sword; she is an easy target while hovering"
377
+ }
378
+ },
379
+ {
380
+ "id": "stingers",
381
+ "name": {
382
+ "en": "Stinger volley"
383
+ },
384
+ "tell": {
385
+ "en": "She drifts left and right above you, firing yellow stingers"
386
+ },
387
+ "effect": {
388
+ "en": "Stingers hurt on hit and may poison you"
389
+ },
390
+ "counter": {
391
+ "en": "Move sideways out of the spread and attack while she repositions"
392
+ }
393
+ }
394
+ ],
395
+ "phases": []
396
+ },
397
+ {
398
+ "case_id": "terraria/brain_of_cthulhu",
399
+ "boss": {
400
+ "en": "Teleporting Flesh Brain"
401
+ },
402
+ "summary": {
403
+ "en": "A translucent brain ringed by guardian eyes; only after you clear the eyes does it expose its heart and take damage, and then it teleports after you."
404
+ },
405
+ "moves": [
406
+ {
407
+ "id": "guard_charge",
408
+ "name": {
409
+ "en": "Guardian eye lunges"
410
+ },
411
+ "tell": {
412
+ "en": "About 20 guardian eyes circle the translucent brain and take turns lunging at you; the brain cannot be hurt meanwhile"
413
+ },
414
+ "effect": {
415
+ "en": "The eyes hurt on contact"
416
+ },
417
+ "counter": {
418
+ "en": "Clear the eyes first: they are fragile, the sword can hit several at once, and the one lunging at you is easiest to hit"
419
+ }
420
+ },
421
+ {
422
+ "id": "teleport",
423
+ "name": {
424
+ "en": "Teleport"
425
+ },
426
+ "tell": {
427
+ "en": "At first it drifts closer, flickers and teleports to another spot near you; once its heart is exposed it fades in and out often and chases you closely"
428
+ },
429
+ "effect": {
430
+ "en": "Contact damage"
431
+ },
432
+ "counter": {
433
+ "en": "It cannot touch you until it has fully faded in; spot the new position and turn to attack at once"
434
+ }
435
+ },
436
+ {
437
+ "id": "illusions",
438
+ "name": {
439
+ "en": "Mirror decoys"
440
+ },
441
+ "tell": {
442
+ "en": "In the second phase three mirror-image decoys appear around you, more convincing as its health drops"
443
+ },
444
+ "effect": {
445
+ "en": "The decoys deal no damage; they only confuse you"
446
+ },
447
+ "counter": {
448
+ "en": "Only the real brain flashes when hit; the decoys mirror around you, so follow the real one's movement"
449
+ },
450
+ "only": {
451
+ "en": "expert mode only"
452
+ }
453
+ }
454
+ ],
455
+ "phases": [
456
+ {
457
+ "en": "In the first phase the guardian eyes protect the brain from damage; once they are cleared the second phase begins and the exposed brain can be hurt"
458
+ }
459
+ ]
460
+ }
461
+ ]
462
+ }