Codex commited on
Commit
5320df1
·
1 Parent(s): 12e74c8

Clean GameDojo environment package for research release

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. environments/LICENSE +29 -0
  2. environments/README.md +38 -4
  3. environments/THIRD_PARTY_NOTICES.md +7 -0
  4. environments/games/prototype/bossbench/compact.py +3 -4
  5. environments/games/prototype/bossbench/keymouse.py +1 -1
  6. environments/games/prototype/bossbench/mc4d.py +7 -41
  7. environments/games/prototype/bossbench/mcskin.py +3 -5
  8. environments/games/prototype/bossbench/play_server.py +2 -2
  9. environments/games/prototype/bossbench/scope.py +2 -10
  10. environments/games/prototype/bossbench/skin.py +0 -263
  11. environments/games/prototype/bossbench/tiers.py +4 -11
  12. environments/games/prototype/bossbench/webenv.py +1 -2
  13. environments/games/prototype/bossbench_llm/prompts/games/battlecity_remake.json +0 -7
  14. environments/games/prototype/bossbench_llm/prompts/games/cuphead_remake.json +0 -5
  15. environments/games/prototype/bossbench_llm/prompts/games/doom_remake.json +0 -10
  16. environments/games/prototype/bossbench_llm/prompts/games/genshin_remake.json +0 -13
  17. environments/games/prototype/bossbench_llm/prompts/games/hexen2_remake.json +0 -11
  18. environments/games/prototype/bossbench_llm/prompts/games/hollowknight_remake.json +0 -9
  19. environments/games/prototype/bossbench_llm/prompts/games/isaac_remake.json +0 -7
  20. environments/games/prototype/bossbench_llm/prompts/games/kirby_remake.json +0 -7
  21. environments/games/prototype/bossbench_llm/prompts/games/kof_remake.json +0 -6
  22. environments/games/prototype/bossbench_llm/prompts/games/mario64_remake.json +0 -8
  23. environments/games/prototype/bossbench_llm/prompts/games/megaman_remake.json +0 -7
  24. environments/games/prototype/bossbench_llm/prompts/games/minecraft.json +0 -8
  25. environments/games/prototype/bossbench_llm/prompts/games/nfsmw_remake.json +0 -14
  26. environments/games/prototype/bossbench_llm/prompts/games/quake2_remake.json +0 -9
  27. environments/games/prototype/bossbench_llm/prompts/games/sekiro_remake.json +0 -9
  28. environments/games/prototype/bossbench_llm/prompts/games/soulknight_remake.json +0 -8
  29. environments/games/prototype/bossbench_llm/prompts/games/terraria_remake.json +0 -9
  30. environments/games/prototype/bossbench_llm/prompts/games/tombraider_remake.json +0 -10
  31. environments/games/prototype/bossbench_llm/prompts/games/touhou_remake.json +0 -9
  32. environments/games/prototype/bossbench_llm/prompts/games/zelda_oot_remake.json +0 -7
  33. environments/games/prototype/bossbench_llm/run.py +2 -3
  34. environments/games/prototype/bossbench_llm/verify.py +1 -1
  35. environments/games/web/engine/case.js +1 -1
  36. environments/games/web/engine/sessions.js +0 -5
  37. environments/games/web/games/_boss3d/vendor/LICENSE +21 -0
  38. environments/games/web/games/battlecity_remake/bc_kit.js +2 -2
  39. environments/games/web/games/battlecity_remake/index.html +1 -1
  40. environments/games/web/games/battlecity_remake/scripted.js +2 -18
  41. environments/games/web/games/battlecity_remake/specs/bc_brick_front.spec.js +0 -15
  42. environments/games/web/games/battlecity_remake/specs/bc_jungle_ambush.spec.js +0 -15
  43. environments/games/web/games/battlecity_remake/specs/bc_river_delta.spec.js +0 -15
  44. environments/games/web/games/battlecity_remake/specs/bc_river_ice.spec.js +0 -15
  45. environments/games/web/games/battlecity_remake/specs/bc_steel_fort.spec.js +0 -15
  46. environments/games/web/games/battlecity_remake/specs/bc_steel_maze.spec.js +0 -15
  47. environments/games/web/games/cuphead_remake/game.js +1 -1
  48. environments/games/web/games/cuphead_remake/index.html +1 -1
  49. environments/games/web/games/cuphead_remake/specs/cagney.spec.js +0 -11
  50. environments/games/web/games/cuphead_remake/specs/goopy.spec.js +0 -11
environments/LICENSE ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 game titles, characters, artwork, and other third-party material remain the
20
+ property of their respective rights holders. GameDojo is independent of those
21
+ rights holders and has no affiliation, endorsement, or sponsorship from them.
22
+ This license grants no rights in third-party material. Separately licensed
23
+ components remain subject to their own terms. See THIRD_PARTY_NOTICES.md.
24
+
25
+ THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
26
+ IMPLIED, INCLUDING WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
27
+ PURPOSE, AND NON-INFRINGEMENT. TO THE EXTENT PERMITTED BY LAW, THE AUTHORS ARE
28
+ NOT LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY ARISING FROM THE MATERIALS
29
+ OR THEIR USE.
environments/README.md CHANGED
@@ -1,7 +1,41 @@
1
- # GameDojo game environments (local staging)
2
 
3
- This directory contains the game source and runtime files for 20 environments. It does not contain rendered videos, screenshots, example replays, model weights, local virtual environments, or development logs.
4
 
5
- Install Python 3.12 dependencies with `pip install -r requirements-games.txt` and Chromium with `python -m playwright install chromium`. Run `python check_games.py --game terraria_remake --out terraria-check.json` for a basic game check. The web game launcher can be served with `python -m http.server 8765 --directory games/web`.
6
 
7
- Runtime source and prompts are English.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ ## License
40
+
41
+ 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,7 @@
 
 
 
 
 
 
 
 
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
+ - Game titles, characters, and other third-party intellectual property belong to their respective owners. The GameDojo license grants rights in original GameDojo material only.
5
+ - 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.
6
+ - 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.
7
+ - Upstream references for Need for Speed: Most Wanted, Hexen II, Quake II, and Tomb Raider are recorded in their game manifests.
environments/games/prototype/bossbench/compact.py CHANGED
@@ -1,7 +1,6 @@
1
- """Compact discrete action spaces for the public BossBench env: bossbench/compact-actions@1 (2026-11-10).
2
 
3
- User 2026-11-10: every game except Terraria must have an action space below 1000 (here: fewer than 1000 actions),
4
- in the manner of ViZDoom.
5
  A game declares a few independent heads (move, turn, attack, ...), each a short list of options. One action
6
  picks one option per head and is held for one 200 ms packet, which is the ViZDoom frame-skip analogue. The
7
  action count is the product of the head sizes and must be below 1000.
@@ -46,7 +45,7 @@ from . import keymouse as km
46
  SCHEMA = 'bossbench/compact-actions@1'
47
  CONTRACT = 'bossbench/policy-compact@1'
48
  MAX_ACTIONS = 1000
49
- EXEMPT_GAMES = frozenset({'terraria_remake'}) # user 2026-11-10: "all games except Terraria"
50
  ROOT = Path(__file__).resolve().parents[2]
51
  _FOLDER = {'minecraft': 'minecraft_remake'}
52
  _LABEL = re.compile(r'[a-z0-9_]+\Z')
 
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.
 
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')
environments/games/prototype/bossbench/keymouse.py CHANGED
@@ -3,7 +3,7 @@
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 (tests/unified_env.py checks they agree), 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
 
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
environments/games/prototype/bossbench/mc4d.py CHANGED
@@ -1,7 +1,7 @@
1
  """3D Minecraft 1v1 v2: one voxel arena, seven boss cases, one shared rig.
2
 
3
  3d/minecraft_iron_golem ground melee: telegraphed slam that flings, knockback immune, walks around walls
4
- 3d/minecraft_zombie fast light melee, relentless pressure (FORMAL_CASES: kept exactly as in @4)
5
  3d/minecraft_ender_dragon aerial phases: circling, fireball strafes, perching with breath; healing end crystals
6
  3d/minecraft_wither hovering artillery: three heads of skulls, spawn blast, arrow-proof armor at half health
7
  3d/minecraft_warden blind juggernaut of the deep dark: crushing melee, darkness, a sonic boom for out-of-reach
@@ -19,39 +19,7 @@ the same 4-state machine so the observation vector keeps one layout across mobs.
19
  Rendering is a skin: boxes come from bossbench.rig, which the simulation poses once per tick;
20
  textures, per-state poses, particles, renderer and HUD all live in bossbench.mcskin.
21
 
22
- Rule version (RULES) - recordings, goldens and media must carry the version they were made under:
23
- minecraft-arena@1 the H200-era rules (tests/mc4d_golden.json): sword pitch auto-aimed, crit at charge > 0.848,
24
- hits inside the 10-tick immunity fully ignored, wither with a dash and arrow hits at any HP.
25
- minecraft-arena@2 2026-10-31 overnight, Java Edition 1.21 combat subset (
26
- real pitch (mouse dy) for every weapon, no aim assist; crit needs cooldown > 0.9 (84.8 % damage);
27
- vanilla immunity (a stronger hit inside the window deals the difference, no knockback); sprint
28
- knockback; a two-slot hotbar (sword, bow; wheel dz switches, switching resets the cooldown) and
29
- fist punches with the bow in hand; zombie armor 2; Java wither (11 s spawn charge + blast,
30
- 3 heads, black/blue skulls, Wither II, regen, armor at half HP immune to arrows, no dash);
31
- vanilla HP/contact damage for the dragon. Unfrozen: only the round-1 media used it (history).
32
- minecraft-arena@3 frozen 2026-11-01, pinned to Java 1.21.1: @2 plus no melee crits on the ender dragon (its parts
33
- are not LivingEntity) and the play/scripted fixes of rounds 2-3 (tests/mc4d_golden_20261031.json).
34
- minecraft-arena@4 2026-11-02, three public tiers (TIERS below; d = 0 / 0.5 / 1 = each TABLE row's easy / normal /
35
- hard knot): the player's kit is one fixed full-diamond loadout on every tier (only the boss
36
- scales); boss health, attack rate and damage rise easy -> hard, calibrated so the reference
37
- controller finishes in about 25 s / 1 min / 3 min; Java Easy / Normal / Hard damage per tier where
38
- Java has them. Ground mobs path-find around walls (a pillar on the straight line soft-locked the
39
- golem); the dragon calls off a fireball closer than fire_min (the scaled arena allowed point-blank
40
- shots) and its landing chance gets a land_base knob (tests/mc4d_golden_20261102.json).
41
- minecraft-arena@5 2026-11-03, six scenes: the zombie case becomes a leader zombie with Java reinforcements (on every
42
- tier: same fight, scaled chance and a cap on how many are alive) on a night field; new warden
43
- (deep dark) and skeleton archer (ruins) cases; the player's kit is part of a scene (KITS: iron sword
44
- and armor against the overworld mobs, diamond against the end-game bosses), identical on every
45
- tier. Iron golem, ender dragon and wither are unchanged from @4 (tests/mc4d_golden_20261103.json).
46
- Superseded the same day by @6: the leader had replaced a FORMAL_CASES scene.
47
- minecraft-arena@6 2026-11-03, the formal 3d/minecraft_zombie (FORMAL_CASES; its d = 0.5 was evaluated 16 times in
48
- the mc-bow-compare-20261020 campaign) is restored to its exact @4 table, behaviour, field arena,
49
- diamond kit, 90 s limit and observation layout; the @5 leader zombie with reinforcements is its
50
- own case 3d/minecraft_zombie_leader (night field, iron kit). The four formal scenes equal @4 and
51
- warden / skeleton / zombie leader equal @5 (tests/mc4d_golden_20261103_arena6.json).
52
- minecraft-arena@7 2026-11-07, no passive regeneration: the player's natural regeneration (Java, food >= 18:
53
- 1 HP every 80 vanilla ticks) is removed. The arena has no hunger, so it amounted to standing
54
- still to heal (user, 2026-11-07). Nothing else changed in the rules.
55
  """
56
  from __future__ import annotations
57
 
@@ -65,10 +33,10 @@ from . import mcskin
65
  from .rig import Rigged
66
 
67
  RULES = "minecraft-arena@7"
68
- # Public difficulty tiers (bossbench.tiers, 2026-11-02 meeting): every TABLE row below is (easy, normal, hard), so a tier
69
  # reads exactly one knot of each row. The continuous d in [0, 1] still interpolates between them for fine control.
70
  TIERS = {"easy": 0.0, "normal": 0.5, "hard": 1.0}
71
- S = 34 # arena side (blocks); was 24, enlarged so fights have room to kite
72
  MID = S / 2 # arena centre line (z of both spawns)
73
  AREA_K = (S - 2) ** 2 / 22 ** 2 # obstacle counts scale with floor area so density matches the 24 layout
74
  VT = 20 / FPS # one simulation tick in vanilla Minecraft ticks
@@ -949,7 +917,7 @@ class ZombieLeader(Mob):
949
  arena's free floor 7-12 blocks from the player instead of Java's 0 / +-7-40 blocks in darkness.
950
  """
951
  TABLE = { # (easy, normal, hard) = TIERS
952
- "hp": (215, 520, 1650), # TIER calibration (Java leader: 40-100 = 2-5x a zombie's 20); round 4
953
  "speed": (0.105, 0.117, 0.135), # vanilla b/t chase; Java 0.117 (see SPEED_NOTE), slower than a walk
954
  "dmg_min": (2.5, 3.0, 4.5), # Java easy / normal / hard (fixed per difficulty)
955
  "dmg_max": (2.5, 3.0, 4.5),
@@ -1738,7 +1706,7 @@ class Warden(Mob):
1738
  netherite, which this arena does not model). Hard keeps every other Java Hard trait: 36-tick cooldown, 4.2 s roar.
1739
  """
1740
  TABLE = { # (easy, normal, hard) = TIERS
1741
- "hp": (260, 820, 2100), # TIER calibration (Java 500 on every difficulty); round 4
1742
  "speed": (0.22, 0.26, 0.286), # vanilla b/t chase; Java 0.286 = attribute 0.3 x 1.2 (SPEED_NOTE),
1743
  # a sprinting player's pace (walk 0.216, sprint 0.281)
1744
  "dmg": (16.0, 23.0, 30.0), # melee before armor: Java Easy 16, midway, Java Normal 30 (see below)
@@ -2053,9 +2021,7 @@ class MobFight(Case):
2053
  # the formal zombie case has none, as in @4)
2054
  EXTRA_OBS = {"wither": 21, "skeleton": 21, "zombie_leader": 12, "warden": 3}
2055
 
2056
- # Default camera "first" (user 2026-11-11: "use first-person view in Minecraft", like the original's default view; F5-style third
2057
- # person stays available as reset option camera="third"). The camera only changes the picture: the same packets give
2058
- # the same fight and the same state hash in either view (checked on 3 recorded fights), so the rule version stays.
2059
  def __init__(self, mob="iron_golem", style="field", width=RES[0], height=RES[1], camera="first",
2060
  max_seconds=120.0, weapon='sword'):
2061
  self.default_weapon, self.default_camera = _weapon(weapon), _camera(camera)
 
1
  """3D Minecraft 1v1 v2: one voxel arena, seven boss cases, one shared rig.
2
 
3
  3d/minecraft_iron_golem ground melee: telegraphed slam that flings, knockback immune, walks around walls
4
+ 3d/minecraft_zombie fast light melee, relentless pressure (legacy case)
5
  3d/minecraft_ender_dragon aerial phases: circling, fireball strafes, perching with breath; healing end crystals
6
  3d/minecraft_wither hovering artillery: three heads of skulls, spawn blast, arrow-proof armor at half health
7
  3d/minecraft_warden blind juggernaut of the deep dark: crushing melee, darkness, a sonic boom for out-of-reach
 
19
  Rendering is a skin: boxes come from bossbench.rig, which the simulation poses once per tick;
20
  textures, per-state poses, particles, renderer and HUD all live in bossbench.mcskin.
21
 
22
+ Replay compatibility is tracked by the RULES identifier.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  """
24
  from __future__ import annotations
25
 
 
33
  from .rig import Rigged
34
 
35
  RULES = "minecraft-arena@7"
36
+ # Public difficulty tiers: every TABLE row below is (easy, normal, hard), so a tier
37
  # reads exactly one knot of each row. The continuous d in [0, 1] still interpolates between them for fine control.
38
  TIERS = {"easy": 0.0, "normal": 0.5, "hard": 1.0}
39
+ S = 34 # arena side in blocks
40
  MID = S / 2 # arena centre line (z of both spawns)
41
  AREA_K = (S - 2) ** 2 / 22 ** 2 # obstacle counts scale with floor area so density matches the 24 layout
42
  VT = 20 / FPS # one simulation tick in vanilla Minecraft ticks
 
917
  arena's free floor 7-12 blocks from the player instead of Java's 0 / +-7-40 blocks in darkness.
918
  """
919
  TABLE = { # (easy, normal, hard) = TIERS
920
+ "hp": (215, 520, 1650), # TIER calibration (Java leader: 40-100 = 2-5x a zombie's 20)
921
  "speed": (0.105, 0.117, 0.135), # vanilla b/t chase; Java 0.117 (see SPEED_NOTE), slower than a walk
922
  "dmg_min": (2.5, 3.0, 4.5), # Java easy / normal / hard (fixed per difficulty)
923
  "dmg_max": (2.5, 3.0, 4.5),
 
1706
  netherite, which this arena does not model). Hard keeps every other Java Hard trait: 36-tick cooldown, 4.2 s roar.
1707
  """
1708
  TABLE = { # (easy, normal, hard) = TIERS
1709
+ "hp": (260, 820, 2100), # TIER calibration (Java 500 on every difficulty)
1710
  "speed": (0.22, 0.26, 0.286), # vanilla b/t chase; Java 0.286 = attribute 0.3 x 1.2 (SPEED_NOTE),
1711
  # a sprinting player's pace (walk 0.216, sprint 0.281)
1712
  "dmg": (16.0, 23.0, 30.0), # melee before armor: Java Easy 16, midway, Java Normal 30 (see below)
 
2021
  # the formal zombie case has none, as in @4)
2022
  EXTRA_OBS = {"wither": 21, "skeleton": 21, "zombie_leader": 12, "warden": 3}
2023
 
2024
+ # The camera changes only the image. Third-person is available through the reset options.
 
 
2025
  def __init__(self, mob="iron_golem", style="field", width=RES[0], height=RES[1], camera="first",
2026
  max_seconds=120.0, weapon='sword'):
2027
  self.default_weapon, self.default_camera = _weapon(weapon), _camera(camera)
environments/games/prototype/bossbench/mcskin.py CHANGED
@@ -2,8 +2,7 @@
2
 
3
  Everything here is drawing. Pose functions read simulation state and write only to the rig
4
  (keyframes and rig.mem); particle helpers draw from case.fxrng; nothing reads or advances
5
- case.rng, so an episode stays a pure function of (case, seed, d, actions) and the golden digests
6
- do not move when this file changes.
7
 
8
  Borrowed from the 2D web client (web/games/hollowknight_remake/draw/wanderer.js + web/engine/renderer.js):
9
  * one pose table per boss state, with anticipation / follow-through keyed to state entry
@@ -1255,8 +1254,7 @@ FOG = {"field": (28.0, 76.0), "towers": (22.0, 62.0), "night": (20.0, 56.0), "de
1255
  "ruins": (24.0, 68.0)}
1256
  STARS = {"towers": 1.0, "night": 1.0}
1257
  # third-person camera height above the player's feet, per arena style (default 2.6): the overworld night mobs are as tall
1258
- # as Steve, so from 2.6 a zombie or skeleton straight ahead hides behind the player's own body, bow draw included
1259
- # (minecraft-arena@5 round 4); the approved scenes keep their camera
1260
  CAM_UP = {"night": 3.5, "ruins": 3.5}
1261
 
1262
 
@@ -1796,7 +1794,7 @@ def hud(img, c):
1796
  tw = d.textlength(tag, font=f2)
1797
  d.text(((w - tw) / 2 + 1, by + bh + int(5 * u) + 1), tag, font=f2, fill=(0, 0, 0))
1798
  d.text(((w - tw) / 2, by + bh + int(5 * u)), tag, font=f2, fill=tc)
1799
- # fight clock + native simulation rate, top right (2026-11-02 meeting: every game shows its native Hz)
1800
  f5 = _font(max(9, int(12 * u)), True)
1801
  clock = f"{c.t / FPS:6.1f} s {FPS}Hz"
1802
  cw5 = d.textlength(clock, font=f5)
 
2
 
3
  Everything here is drawing. Pose functions read simulation state and write only to the rig
4
  (keyframes and rig.mem); particle helpers draw from case.fxrng; nothing reads or advances
5
+ case.rng, so drawing cannot change an episode’s simulation state.
 
6
 
7
  Borrowed from the 2D web client (web/games/hollowknight_remake/draw/wanderer.js + web/engine/renderer.js):
8
  * one pose table per boss state, with anticipation / follow-through keyed to state entry
 
1254
  "ruins": (24.0, 68.0)}
1255
  STARS = {"towers": 1.0, "night": 1.0}
1256
  # third-person camera height above the player's feet, per arena style (default 2.6): the overworld night mobs are as tall
1257
+ # as Steve, so from 2.6 a zombie or skeleton straight ahead hides behind the player's own body, bow draw included.
 
1258
  CAM_UP = {"night": 3.5, "ruins": 3.5}
1259
 
1260
 
 
1794
  tw = d.textlength(tag, font=f2)
1795
  d.text(((w - tw) / 2 + 1, by + bh + int(5 * u) + 1), tag, font=f2, fill=(0, 0, 0))
1796
  d.text(((w - tw) / 2, by + bh + int(5 * u)), tag, font=f2, fill=tc)
1797
+ # fight clock + native simulation rate, top right
1798
  f5 = _font(max(9, int(12 * u)), True)
1799
  clock = f"{c.t / FPS:6.1f} s {FPS}Hz"
1800
  cw5 = d.textlength(clock, font=f5)
environments/games/prototype/bossbench/play_server.py CHANGED
@@ -1,7 +1,7 @@
1
  """Human play server for the Minecraft remake: the real mc4d simulation + ModernGL renderer behind a browser page.
2
 
3
- python prototype/bossbench/play_server.py # http://127.0.0.1:8765/
4
- python 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
 
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
environments/games/prototype/bossbench/scope.py CHANGED
@@ -27,12 +27,7 @@ FORMAL_CASES = MappingProxyType({
27
  })
28
 
29
  RETIRED_CASES = ("2d/tank_battle", "tank_battle_1v1")
30
- # Public interface eligibility is distinct from membership in a frozen experiment.
31
- # Adding an implementation here never changes FORMAL_CASES or starts training.
32
- #
33
- # 2026-11-02: every case a game registers (BB.CASES in its own JS, or its manifest.json for native games)
34
- # is publicly eligible automatically, so a game can add scenes without editing this file. FORMAL_CASES stays an
35
- # explicit, hand-written list: a new scene never enters the frozen training scope by being discovered.
36
  from . import WEB_GAME
37
  PUBLIC_WEB_CASES = MappingProxyType({
38
  case_id: {"game": game, "dimension": "2d", "engine": "web"}
@@ -51,10 +46,7 @@ POLICY_CASES = MappingProxyType({**FORMAL_CASES, **PUBLIC_WEB_CASES, **PUBLIC_PY
51
  key: {'game': value['game'], 'dimension': value['dimension'], 'engine': 'native'}
52
  for key, value in NATIVE_CASES.items()
53
  }})
54
- # The benchmark's scene list: every game has exactly six scenes (user 2026-11-10: "add a sixth Hexen scene and remove one Minecraft scene",
55
- # then "remove the Green Brawler"). A retired scene stays registered (bossbench.make, make_policy_env, FORMAL_CASES, frozen
56
- # experiments and old tests keep working); it only leaves what the benchmark lists: lobby, delivery and research pages,
57
- # media and compact checks, and new datasets. List pages and tools from BENCH_CASES, not from POLICY_CASES.
58
  BENCH_RETIRED = frozenset({
59
  "3d/minecraft_zombie", # Minecraft had 7; its tier calibration is the separate 3d/minecraft_zombie_leader
60
  })
 
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"}
 
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
  })
environments/games/prototype/bossbench/skin.py DELETED
@@ -1,263 +0,0 @@
1
- """Rendering adapters. None of this participates in judging: a renderer reads case.state()
2
- and nothing it computes may flow back into the simulation (architecture rule 1).
3
-
4
- raster numpy, no GPU -> render() default for 2D
5
- gl moderngl instanced boxes -> render() default for 3D
6
- godot the Godot client in skin/project, driven over a socket or by frame dumping
7
-
8
- Use:
9
- from bossbench import skin
10
- skin.shoot("3d/minecraft_iron_golem", "shots/golem", agent=my_policy) # PNG via Godot
11
- with skin.GodotRenderer(env): # env.render() now returns Godot pixels
12
- frame = env.render() # 480x854x3 uint8, same contract
13
- with skin.GodotPlayer(env): # live window you can play in
14
- env.step(...)
15
- """
16
- from __future__ import annotations
17
-
18
- import json
19
- import os
20
- import shutil
21
- import socket
22
- import subprocess
23
- import sys
24
-
25
- import numpy as np
26
-
27
- HERE = os.path.dirname(os.path.abspath(__file__))
28
- ROOT = os.path.dirname(HERE)
29
- PROJECT = os.path.join(ROOT, "skin", "project")
30
- from .core import FPS, RES
31
-
32
- GODOT = os.path.join(ROOT, "..", "tools", "Godot_v4.4.1-stable_win64_console.exe")
33
-
34
-
35
- def _plain(o):
36
- """numpy scalars / arrays -> json-native."""
37
- if isinstance(o, np.bool_):
38
- return bool(o)
39
- if isinstance(o, np.integer):
40
- return int(o)
41
- if isinstance(o, np.floating):
42
- return float(o)
43
- if isinstance(o, np.ndarray):
44
- return o.tolist()
45
- raise TypeError(type(o))
46
-
47
-
48
- def dumps(obj) -> str:
49
- return json.dumps(obj, default=_plain, separators=(",", ":"))
50
-
51
-
52
- def scene_msg(case) -> dict:
53
- """Everything static about the case, sent once. Enough for the client to build the world."""
54
- msg = {"cmd": "scene", "case": case.name, "arena": {}}
55
- H = getattr(case.arena, "H", None) # 3D voxel heightmap
56
- if H is not None:
57
- msg["arena"]["terrain"] = {f"{x},{z}": int(h) for (x, z), h in np.ndenumerate(H)}
58
- else:
59
- raise ValueError("This historical Godot skin supports Minecraft terrain only")
60
- return msg
61
-
62
-
63
- def frame_msg(env) -> dict:
64
- c = env.case
65
- return {"cmd": "frame", "tick": c.t, "t": c.t / FPS, **c.state(), "skin": skin_hints(c)}
66
-
67
-
68
- def skin_hints(case) -> dict:
69
- """Drawing-only facts that case.state() leaves out (facing, hit flicker, max HP).
70
-
71
- Read-only like everything else here; the client uses them for pose and tint, never for rules.
72
- """
73
- body, boss = case.body, case.boss
74
- h = {"body_iframes": int(getattr(body, "iframes", 0)), "boss_iframes": int(getattr(boss, "iframes", 0)),
75
- "body_max_hp": float(getattr(body, "max_hp", 1)), "boss_max_hp": float(getattr(boss, "max_hp", 1))}
76
- if hasattr(boss, "e"): # voxel entities carry a yaw
77
- h["boss_yaw_deg"] = round(float(np.degrees(boss.e.yaw)), 1)
78
- if hasattr(body, "since_swing"):
79
- h["body_swing"] = body.since_swing < 0.2 * FPS
80
- return h
81
-
82
-
83
- def rollout_frames(case_name, seed=0, d=0.5, agent=None, max_steps=6000, every=4, **env_kw):
84
- """Run one episode in Python and return the frame messages a client needs to draw it."""
85
- if agent is None:
86
- raise ValueError("rollout_frames requires an explicit policy; no implicit demo agent")
87
- import bossbench
88
- env = bossbench.make(case_name, difficulty=d, **env_kw)
89
- obs, info = env.reset(seed=seed)
90
- msgs = [scene_msg(env.case)]
91
- for _ in range(max_steps):
92
- obs, r, term, trunc, info = env.step(agent(env, obs, info))
93
- if env.case.t % every == 0:
94
- msgs.append(frame_msg(env))
95
- if term or trunc:
96
- break
97
- msgs.append({"cmd": "bye", "outcome": env.case.outcome() or "timeout"})
98
- return env, msgs
99
-
100
-
101
- def godot_binary() -> str:
102
- found = shutil.which("godot")
103
- if found:
104
- return found
105
- if os.path.exists(GODOT):
106
- return GODOT
107
- raise FileNotFoundError(
108
- "Godot not found: put godot on PATH, or unzip Godot 4.4 into BossBench/tools/.")
109
-
110
-
111
- def shoot(case_name, out_dir="shots", seed=0, d=0.5, agent=None, every=4, **env_kw):
112
- """Render one episode with the Godot client and write out_dir/frame_%04d.png."""
113
- env, msgs = rollout_frames(case_name, seed=seed, d=d, agent=agent, every=every, **env_kw)
114
- out_dir = os.path.abspath(out_dir)
115
- os.makedirs(out_dir, exist_ok=True)
116
- for f in os.listdir(out_dir): # stale frames from a longer episode
117
- if f.startswith("frame_") and f.endswith(".png"):
118
- os.remove(os.path.join(out_dir, f))
119
- tmp = out_dir + ".frames.json"
120
- with open(tmp, "w") as f:
121
- f.write(dumps(msgs))
122
- cmd = [godot_binary(), "--path", PROJECT, "--resolution", f"{RES[0]}x{RES[1]}",
123
- "--", "--shot", tmp, "--out", out_dir]
124
- r = subprocess.run(cmd, capture_output=True, text=True, timeout=900)
125
- if r.returncode != 0:
126
- sys.stderr.write(r.stdout[-2000:] + r.stderr[-2000:])
127
- raise RuntimeError(f"godot exited {r.returncode}")
128
- os.remove(tmp)
129
- return env.verifier(), sorted(
130
- os.path.join(out_dir, f) for f in os.listdir(out_dir) if f.endswith(".png"))
131
-
132
-
133
- class GodotPlayer:
134
- """Server side of the live link: serves case.state() and applies the client's action.
135
-
136
- The client is a display only; it never advances the world. With time_mode="paused" the
137
- simulation waits in step() until the client sends an action, so the window runs at
138
- whatever rate the renderer manages.
139
- """
140
-
141
- def __init__(self, env, host="127.0.0.1", port=8765, timeout=30.0, launch=True):
142
- self.env, self.host, self.port, self.timeout = env, host, port, timeout
143
- self.launch, self.srv, self.conn, self.buf, self.client = launch, None, None, "", None
144
-
145
- def __enter__(self):
146
- self.srv = socket.socket()
147
- self.srv.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
148
- self.srv.bind((self.host, self.port))
149
- self.srv.listen(1)
150
- self.srv.settimeout(self.timeout)
151
- if self.launch:
152
- print(f"launching skin client (godot --path {PROJECT} -- --port {self.port})")
153
- self.client = subprocess.Popen(
154
- [godot_binary(), "--path", PROJECT, "--resolution", f"{RES[0]}x{RES[1]}",
155
- "--", "--host", self.host, "--port", str(self.port)],
156
- stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
157
- self.conn, _ = self.srv.accept()
158
- self.conn.settimeout(self.timeout)
159
- self.send(scene_msg(self.env.case))
160
- return self
161
-
162
- def __exit__(self, *exc):
163
- try:
164
- self.send({"cmd": "bye", "outcome": self.env.case.outcome() or "quit"})
165
- self.conn.close()
166
- self.srv.close()
167
- finally:
168
- if self.client:
169
- self.client.terminate()
170
-
171
- def send(self, obj):
172
- self.conn.sendall((dumps(obj) + "\n").encode())
173
-
174
- def recv(self):
175
- while "\n" not in self.buf:
176
- chunk = self.conn.recv(4096)
177
- if not chunk:
178
- raise ConnectionError("skin client disconnected")
179
- self.buf += chunk.decode()
180
- line, self.buf = self.buf.split("\n", 1)
181
- return json.loads(line)
182
-
183
- def play(self, action_fn, max_steps=100000):
184
- """action_fn(info, state) -> action; the client's input is used when it returns None."""
185
- obs, info = self.env.reset(seed=0)
186
- self.send(frame_msg(self.env))
187
- for _ in range(max_steps):
188
- act = action_fn(info) if action_fn else None
189
- if act is None:
190
- act = self.recv()["act"]
191
- obs, r, term, trunc, info = self.env.step(np.array(act))
192
- self.send(frame_msg(self.env))
193
- if term or trunc:
194
- break
195
- return self.env.verifier()
196
-
197
-
198
- class GodotRenderer:
199
- """env.render() backend: Python sends case.state(), Godot draws it and returns the 480p frame.
200
-
201
- Judging is untouched -- the sim never waits on, or reads, anything but the frame it asked for.
202
- One Godot process per env; the scene is re-sent whenever the env has been reset.
203
- """
204
-
205
- def __init__(self, env, host="127.0.0.1", port=0, timeout=30.0, offscreen=True):
206
- self.env, self.host, self.port, self.timeout, self.offscreen = env, host, port, timeout, offscreen
207
- self.proc = self.conn = self.srv = None
208
- self.buf, self.episode = b"", None
209
-
210
- def __enter__(self):
211
- self.srv = socket.socket()
212
- self.srv.bind((self.host, self.port))
213
- self.srv.listen(1)
214
- self.srv.settimeout(self.timeout)
215
- port = self.srv.getsockname()[1]
216
- cmd = [godot_binary(), "--path", PROJECT, "--resolution", f"{RES[0]}x{RES[1]}"]
217
- if self.offscreen: # a real window (pixels need one), parked off-screen
218
- cmd += ["--position", "-10000,-10000"]
219
- self.proc = subprocess.Popen(cmd + ["--", "--host", self.host, "--port", str(port), "--serve"],
220
- stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
221
- self.conn, _ = self.srv.accept()
222
- self.conn.settimeout(self.timeout)
223
- self.conn.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
224
- self.env.renderer = self
225
- return self
226
-
227
- def __exit__(self, *exc):
228
- self.env.renderer = None
229
- for s in (self.conn, self.srv):
230
- if s:
231
- s.close()
232
- if self.proc:
233
- self.proc.terminate()
234
- self.proc.wait(10)
235
-
236
- def _read(self, n):
237
- while len(self.buf) < n:
238
- chunk = self.conn.recv(1 << 20)
239
- if not chunk:
240
- raise ConnectionError("Godot renderer disconnected")
241
- self.buf += chunk
242
- out, self.buf = self.buf[:n], self.buf[n:]
243
- return out
244
-
245
- def _line(self):
246
- while b"\n" not in self.buf:
247
- chunk = self.conn.recv(1 << 16)
248
- if not chunk:
249
- raise ConnectionError("Godot renderer disconnected")
250
- self.buf += chunk
251
- line, self.buf = self.buf.split(b"\n", 1)
252
- return json.loads(line)
253
-
254
- def __call__(self, env):
255
- out = []
256
- if self.episode != env.episode:
257
- out.append(scene_msg(env.case))
258
- self.episode = env.episode
259
- out.append({**frame_msg(env), "want_pixels": True})
260
- self.conn.sendall("".join(dumps(m) + "\n" for m in out).encode())
261
- head = self._line()
262
- img = np.frombuffer(self._read(head["pixels"]), np.uint8).reshape(head["h"], head["w"], 3)
263
- return img.copy()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
environments/games/prototype/bossbench/tiers.py CHANGED
@@ -1,8 +1,6 @@
1
- """Three public difficulty tiers shared by every BossBench game (2026-11-02).
2
 
3
- The meeting decision is that the standard evaluation interface exposes only three tiers — easy / normal /
4
- hard — instead of a scattering of per-parameter knobs. The continuous `difficulty` in [0, 1] stays underneath
5
- for anyone who needs fine control, so this module is a naming and calibration layer, not a new mechanic.
6
 
7
  env.reset(seed=1, options={"tier": "easy"}) # public: one of three tiers
8
  env.reset(seed=1, options={"difficulty": 0.37}) # still allowed: direct continuous control
@@ -17,11 +15,6 @@ page and this public interface all read one source of truth:
17
  A game that declares nothing uses DEFAULT_TIERS. Passing both `tier` and `difficulty` is rejected, so a
18
  recording can never be ambiguous about which one produced it.
19
 
20
- Acceptance targets agreed in the meeting (measured with the game's standard scripted controller):
21
-
22
- easy the reference script finishes in 20-30 s, boss health around the 500 mark
23
- normal about 1 minute
24
- hard about 3 minutes
25
  """
26
  from __future__ import annotations
27
 
@@ -34,7 +27,7 @@ TIER_NAMES = ("easy", "normal", "hard")
34
  DEFAULT_TIERS = MappingProxyType({"easy": 0.2, "normal": 0.5, "hard": 0.8})
35
  TIERS = DEFAULT_TIERS # backwards-compatible name
36
 
37
- # Scripted-controller completion windows, in seconds, from the 2026-11-02 meeting.
38
  TARGET_SECONDS = MappingProxyType({
39
  "easy": (20.0, 30.0),
40
  "normal": (45.0, 90.0),
@@ -99,6 +92,6 @@ def tier_of(difficulty, declared=None, tolerance=1e-9):
99
 
100
 
101
  def within_target(tier, seconds):
102
- """True when a scripted run's duration falls inside the meeting's window for that tier."""
103
  low, high = TARGET_SECONDS[tier]
104
  return low <= float(seconds) <= high
 
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
 
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
 
 
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),
 
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/webenv.py CHANGED
@@ -8,8 +8,7 @@ This module drives it through web/engine/bridge.js over one of two transports:
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. The rules are the same files either way, so
12
- the two transports produce identical trajectories (tests/unified_env.py checks this).
13
  """
14
  from __future__ import annotations
15
 
 
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
 
environments/games/prototype/bossbench_llm/prompts/games/battlecity_remake.json CHANGED
@@ -419,12 +419,5 @@
419
  }
420
  ]
421
  }
422
- ],
423
- "sources": [
424
- "web/games/battlecity_remake/game.js"
425
- ],
426
- "uncertain": [
427
- "Enemy counts, lives, and pursuit times for the three difficulties come from supplied materials and were not checked individually against code.",
428
- "The scenes have no named bosses; boss names are descriptive names for the arenas."
429
  ]
430
  }
 
419
  }
420
  ]
421
  }
 
 
 
 
 
 
 
422
  ]
423
  }
environments/games/prototype/bossbench_llm/prompts/games/cuphead_remake.json CHANGED
@@ -664,10 +664,5 @@
664
  }
665
  ]
666
  }
667
- ],
668
- "sources": [],
669
- "uncertain": [
670
- "Per-fight time limit is not stated in the sources, so goal gives no number.",
671
- "Compact sub-step timings come from the extracted note, not re-verified in code."
672
  ]
673
  }
 
664
  }
665
  ]
666
  }
 
 
 
 
 
667
  ]
668
  }
environments/games/prototype/bossbench_llm/prompts/games/doom_remake.json CHANGED
@@ -425,15 +425,5 @@
425
  ],
426
  "phases": []
427
  }
428
- ],
429
- "sources": [
430
- "web/games/doom_remake/game.js",
431
- "web/games/doom_remake/README.md",
432
- "web/games/doom_remake/manifest.json"
433
- ],
434
- "uncertain": [
435
- "Damage values and ranges are described qualitatively from code; exact weapon fire intervals were not checked.",
436
- "Pickup respawn was read from the README only; stated as single-use by analogy with other scenes.",
437
- "Simulation runs at 60 Hz with the original 35 Hz timing kept in seconds (doom-arena@11, game.js header); timings in this file are in seconds."
438
  ]
439
  }
 
425
  ],
426
  "phases": []
427
  }
 
 
 
 
 
 
 
 
 
 
428
  ]
429
  }
environments/games/prototype/bossbench_llm/prompts/games/genshin_remake.json CHANGED
@@ -1210,18 +1210,5 @@
1210
  }
1211
  ]
1212
  }
1213
- ],
1214
- "sources": [
1215
- "web/games/genshin_remake/manifest.json",
1216
- "web/games/genshin_remake/game.js",
1217
- "web/games/genshin_remake/boss_andrius.js",
1218
- "web/games/genshin_remake/boss_kenki.js",
1219
- "web/games/genshin_remake/boss_signora.js",
1220
- "web/games/genshin_remake/README.md"
1221
- ],
1222
- "uncertain": [
1223
- "On-screen move wind-up times are approximations converted from tick counts.",
1224
- "Move details for the floating array, cannon-backed giant, and tidal-pool summoner come from game.js values and the README; their visual behavior has not been checked individually.",
1225
- "Some move damage types and specific elements have not been verified item by item."
1226
  ]
1227
  }
 
1210
  }
1211
  ]
1212
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
1213
  ]
1214
  }
environments/games/prototype/bossbench_llm/prompts/games/hexen2_remake.json CHANGED
@@ -607,16 +607,5 @@
607
  }
608
  ]
609
  }
610
- ],
611
- "sources": [
612
- "web/games/hexen2_remake/README.md",
613
- "web/games/hexen2_remake/game.js",
614
- "web/games/hexen2_remake/telegraph.js (T.praevus)"
615
- ],
616
- "uncertain": [
617
- "REPRODUCTION_SPEC is an empty template. Moves come from source notes and numeric values are only approximate.",
618
- "Move damage scales with difficulty; the exact values are not listed here.",
619
- "The wind-up table for each rider has not been checked item by item.",
620
- "Scene 6 (star_volley_sorcerer) follows telegraph.js T.praevus; easy has four easy-only changes (shorter recharge invulnerability, 0.5 s teleport, 8 s entry protection) that the prompt does not spell out."
621
  ]
622
  }
 
607
  }
608
  ]
609
  }
 
 
 
 
 
 
 
 
 
 
 
610
  ]
611
  }
environments/games/prototype/bossbench_llm/prompts/games/hollowknight_remake.json CHANGED
@@ -989,14 +989,5 @@
989
  }
990
  ]
991
  }
992
- ],
993
- "sources": [
994
- "web/games/hollowknight_remake/game.js"
995
- ],
996
- "uncertain": [
997
- "All moves come from the engine-exported move table; the timing values have not been checked against code item by item.",
998
- "Move timings come from the engine skill table and were not re-checked against code.",
999
- "The berserker plunge stab duration of roughly 0.9 s is estimated by adding 0.58 s and 0.35 s.",
1000
- "The roughly 0.9 s for the berserker's plunge stab is summed from 0.58 + 0.35 s."
1001
  ]
1002
  }
 
989
  }
990
  ]
991
  }
 
 
 
 
 
 
 
 
 
992
  ]
993
  }
environments/games/prototype/bossbench_llm/prompts/games/isaac_remake.json CHANGED
@@ -530,12 +530,5 @@
530
  }
531
  ]
532
  }
533
- ],
534
- "sources": [
535
- "web/games/isaac_remake/game.js"
536
- ],
537
- "uncertain": [
538
- "Moves taken from the spec section 5 without re-reading game.js attack functions line by line; timings are approximate.",
539
- "Exact bomb damage and passive item set per scene are not stated to the model."
540
  ]
541
  }
 
530
  }
531
  ]
532
  }
 
 
 
 
 
 
 
533
  ]
534
  }
environments/games/prototype/bossbench_llm/prompts/games/kirby_remake.json CHANGED
@@ -504,12 +504,5 @@
504
  }
505
  ]
506
  }
507
- ],
508
- "sources": [
509
- "web/games/kirby_remake/game.js"
510
- ],
511
- "uncertain": [
512
- "Twins scene source lists only the push move; the door-change entry is inferred from the cue and not verified",
513
- "Which moves are expert-only is taken from the 'Extra Game' labels in the extracted skill table"
514
  ]
515
  }
 
504
  }
505
  ]
506
  }
 
 
 
 
 
 
 
507
  ]
508
  }
environments/games/prototype/bossbench_llm/prompts/games/kof_remake.json CHANGED
@@ -807,11 +807,5 @@
807
  }
808
  ]
809
  }
810
- ],
811
- "sources": [
812
- "web/games/kof_remake/compact_actions.json"
813
- ],
814
- "uncertain": [
815
- "Exact damage and gauge values are not given; the number of opponents in a match varies with difficulty."
816
  ]
817
  }
 
807
  }
808
  ]
809
  }
 
 
 
 
 
 
810
  ]
811
  }
environments/games/prototype/bossbench_llm/prompts/games/mario64_remake.json CHANGED
@@ -642,13 +642,5 @@
642
  }
643
  ]
644
  }
645
- ],
646
- "sources": [
647
- "web/games/mario64_remake/game.js"
648
- ],
649
- "uncertain": [
650
- "REPRODUCTION_SPEC.md states sm64-bosses@2; rules taken from game.js (@5)",
651
- "Hit counts, speeds and damage vary by tier and are not stated numerically",
652
- "Eyerok and Wiggler move descriptions are summarised from code state names; exact damage per hit not verified"
653
  ]
654
  }
 
642
  }
643
  ]
644
  }
 
 
 
 
 
 
 
 
645
  ]
646
  }
environments/games/prototype/bossbench_llm/prompts/games/megaman_remake.json CHANGED
@@ -513,12 +513,5 @@
513
  }
514
  ]
515
  }
516
- ],
517
- "sources": [
518
- "web/games/megaman_remake/game.js"
519
- ],
520
- "uncertain": [
521
- "Specific weapon-versus-boss weakness damage values were not verified.",
522
- "stand_down in the fire scene is a quirk copied from the extracted skill table."
523
  ]
524
  }
 
513
  }
514
  ]
515
  }
 
 
 
 
 
 
 
516
  ]
517
  }
environments/games/prototype/bossbench_llm/prompts/games/minecraft.json CHANGED
@@ -444,13 +444,5 @@
444
  ],
445
  "phases": []
446
  }
447
- ],
448
- "sources": [
449
- "web/games/minecraft_remake/manifest.json",
450
- "web/games/minecraft_remake/compact_actions.json"
451
- ],
452
- "uncertain": [
453
- "Exact time limit per fight not in the extracted sources, so goal gives no number.",
454
- "The 'chase' move for the Hurling Brute is inferred from general behaviour, not from the skills table."
455
  ]
456
  }
 
444
  ],
445
  "phases": []
446
  }
 
 
 
 
 
 
 
 
447
  ]
448
  }
environments/games/prototype/bossbench_llm/prompts/games/nfsmw_remake.json CHANGED
@@ -515,19 +515,5 @@
515
  }
516
  ]
517
  }
518
- ],
519
- "sources": [
520
- "web/games/nfsmw_remake/README.md",
521
- "web/games/nfsmw_remake/manifest.json",
522
- "web/games/nfsmw_remake/modes_tollbooth.js",
523
- "web/games/nfsmw_remake/modes_drag.js",
524
- "web/games/nfsmw_remake/modes_speedtrap.js",
525
- "web/games/nfsmw_remake/modes_knockout.js",
526
- "web/games/nfsmw_remake/modes_pursuit.js",
527
- "web/games/nfsmw_remake/cops.js"
528
- ],
529
- "uncertain": [
530
- "The manifest and game.js use rule version nfsmw-arena@2; the task brief says @1. This file follows the manifest.",
531
- "The heat levels at which helicopters appear, the police configuration in the champion event, and traffic appearing only at normal and hard difficulty in knockout races were read from code and not independently verified."
532
  ]
533
  }
 
515
  }
516
  ]
517
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
518
  ]
519
  }
environments/games/prototype/bossbench_llm/prompts/games/quake2_remake.json CHANGED
@@ -455,14 +455,5 @@
455
  ],
456
  "phases": []
457
  }
458
- ],
459
- "sources": [
460
- "web/games/quake2_remake/game.js (controls, arenas, health table)",
461
- "web/games/quake2_remake/q2monsters.js (moves frame tables)",
462
- "web/games/quake2_remake/README.md, draw.js (HUD strings)",
463
- "web/games/quake2_remake/compact_actions.json"
464
- ],
465
- "uncertain": [
466
- "The quake2/makron scene is a two-boss fight (mech then pilot); it is listed as one scene with both phases' moves."
467
  ]
468
  }
 
455
  ],
456
  "phases": []
457
  }
 
 
 
 
 
 
 
 
 
458
  ]
459
  }
environments/games/prototype/bossbench_llm/prompts/games/sekiro_remake.json CHANGED
@@ -1004,14 +1004,5 @@
1004
  }
1005
  ]
1006
  }
1007
- ],
1008
- "sources": [
1009
- "web/games/sekiro_remake/README.md",
1010
- "web/games/sekiro_remake/game.js",
1011
- "web/games/sekiro_remake/manifest.json"
1012
- ],
1013
- "uncertain": [
1014
- "Move names and timing for the old-master and mounted-general bosses are summarised from game.js tables and README; exact damage values not stated.",
1015
- "Execution counts per bar are approximate (README lists 2-4 per boss)."
1016
  ]
1017
  }
 
1004
  }
1005
  ]
1006
  }
 
 
 
 
 
 
 
 
 
1007
  ]
1008
  }
environments/games/prototype/bossbench_llm/prompts/games/soulknight_remake.json CHANGED
@@ -648,13 +648,5 @@
648
  }
649
  ]
650
  }
651
- ],
652
- "sources": [
653
- "web/games/soulknight_remake/game.js (controls; POOLS; ATTACKS comments)",
654
- "web/games/soulknight_remake/README.md (controls, rules, enrage, rooms)",
655
- "web/games/soulknight_remake/compact_actions.json"
656
- ],
657
- "uncertain": [
658
- "Move descriptions condensed from the attack-script comments in game.js; exact bullet counts and timings are left out on purpose."
659
  ]
660
  }
 
648
  }
649
  ]
650
  }
 
 
 
 
 
 
 
 
651
  ]
652
  }
environments/games/prototype/bossbench_llm/prompts/games/terraria_remake.json CHANGED
@@ -458,14 +458,5 @@
458
  }
459
  ]
460
  }
461
- ],
462
- "sources": [
463
- "web/games/terraria_remake/specs/*.yaml (moves: cue / punish / damage, = Case.manual().skills)",
464
- "web/games/terraria_remake/body_adventurer.js (P.keys, P.manual)",
465
- "web/games/terraria_remake/README.md (controls, mechanics, win conditions)",
466
- "web/tools/action_labels.json"
467
- ],
468
- "uncertain": [
469
- "Expert-only moves are tagged with `only`; the three public tiers (d 0.2/0.5/0.7) are all Classic, so they do not appear there."
470
  ]
471
  }
 
458
  }
459
  ]
460
  }
 
 
 
 
 
 
 
 
 
461
  ]
462
  }
environments/games/prototype/bossbench_llm/prompts/games/tombraider_remake.json CHANGED
@@ -495,15 +495,5 @@
495
  }
496
  ]
497
  }
498
- ],
499
- "sources": [
500
- "web/games/tombraider_remake/README.md",
501
- "web/games/tombraider_remake/game.js"
502
- ],
503
- "uncertain": [
504
- "Mouse steering is still pending a decision; this describes current game.js behaviour.",
505
- "The quadruped's level location and count are unverified.",
506
- "Move timings come from code constants and are approximate.",
507
- "Stage split and faint length come from source rules and are not shown on screen."
508
  ]
509
  }
 
495
  }
496
  ]
497
  }
 
 
 
 
 
 
 
 
 
 
498
  ]
499
  }
environments/games/prototype/bossbench_llm/prompts/games/touhou_remake.json CHANGED
@@ -806,14 +806,5 @@
806
  }
807
  ]
808
  }
809
- ],
810
- "sources": [
811
- "web/games/touhou_remake/game.js",
812
- "web/games/touhou_remake/README.md",
813
- "web/games/touhou_remake/manifest.json"
814
- ],
815
- "uncertain": [
816
- "Most spell-card projectile shapes, speeds, and counts were reconstructed from written sources and code structure; visual details may differ slightly.",
817
- "Patchouli and Remilia spell cards lack written sources. Their descriptions rely mainly on move names and code; verify against the game screen."
818
  ]
819
  }
 
806
  }
807
  ]
808
  }
 
 
 
 
 
 
 
 
 
809
  ]
810
  }
environments/games/prototype/bossbench_llm/prompts/games/zelda_oot_remake.json CHANGED
@@ -587,12 +587,5 @@
587
  }
588
  ]
589
  }
590
- ],
591
- "sources": [
592
- "web/games/zelda_oot_remake/manifest.json"
593
- ],
594
- "uncertain": [
595
- "Items in each scene and some phase transitions were inferred from the telegraph table and have not been checked against boss code.",
596
- "Per-scene items and some phase changes were not checked against boss code; they come from the telegraph table and inference."
597
  ]
598
  }
 
587
  }
588
  ]
589
  }
 
 
 
 
 
 
 
590
  ]
591
  }
environments/games/prototype/bossbench_llm/run.py CHANGED
@@ -5,10 +5,9 @@ semantic JSON) -> executed in the game. Default time mode is `paused`: the game
5
  not depend on inference speed and every run is replayable. `realtime`: every full 200 ms the model takes inserts
6
  one empty 200 ms window before its action (latency under 200 ms costs nothing).
7
 
8
- Examples (run from the package root with PYTHONPATH=prototype):
9
- python -m bossbench_llm.run --case terraria/king_slime --tier easy --seeds 1-3 --format lumine --lang zh \
10
  --policy chat --base-url http://127.0.0.1:8000/v1 --model my-model
11
- python -m bossbench_llm.run --policy replay --replay replays/terraria__king_slime__easy.replay.json # self-test
12
  python -m bossbench_llm.run --case terraria/queen_bee --tier easy --format semantic --policy random --max-steps 50
13
  """
14
  from __future__ import annotations
 
5
  not depend on inference speed and every run is replayable. `realtime`: every full 200 ms the model takes inserts
6
  one empty 200 ms window before its action (latency under 200 ms costs nothing).
7
 
8
+ Examples (run from the package root with PYTHONPATH=games/prototype):
9
+ python -m bossbench_llm.run --case terraria/king_slime --tier easy --seeds 1-3 --format lumine --lang en \
10
  --policy chat --base-url http://127.0.0.1:8000/v1 --model my-model
 
11
  python -m bossbench_llm.run --case terraria/queen_bee --tier easy --format semantic --policy random --max-steps 50
12
  """
13
  from __future__ import annotations
environments/games/prototype/bossbench_llm/verify.py CHANGED
@@ -4,7 +4,7 @@
4
  python -m bossbench_llm.verify replays/*.replay.json
5
 
6
  Accepts episode folders written by bossbench_llm.run (replay.json or semantic_replay.json inside) and plain
7
- bossbench/policy-replay@1 files (the packaged scripted wins). Also reports source files whose bytes differ from
8
  the ones recorded (a different game version), which is the usual reason a replay stops reproducing.
9
  """
10
  from __future__ import annotations
 
4
  python -m bossbench_llm.verify replays/*.replay.json
5
 
6
  Accepts episode folders written by bossbench_llm.run (replay.json or semantic_replay.json inside) and plain
7
+ bossbench/policy-replay@1 files. Also reports source files whose bytes differ from
8
  the ones recorded (a different game version), which is the usual reason a replay stops reproducing.
9
  """
10
  from __future__ import annotations
environments/games/web/engine/case.js CHANGED
@@ -1,5 +1,5 @@
1
  // Case = Arena + Body + Boss stepped at 60 Hz, and the Gym-style env of proposal 4.4 on top of it.
2
- // No DOM here: the same file runs in the browser and in Node (tests/, headless rollouts).
3
  // Game-agnostic: a game registers BB.CASES[id] = {title, Body, Boss} and provides BB.ARENA {W, H}.
4
  // Body contract: id, keys {action: 'K1|K2'}, manual [..], NAIL (damage per hit), reset, update(c, input), box,
5
  // hurtBox, centre, slashBox() -> {pts, tink, dir} | null, slashHits {}, slashFacing, onSlashContact(c, kind),
 
1
  // Case = Arena + Body + Boss stepped at 60 Hz, and the Gym-style env of proposal 4.4 on top of it.
2
+ // No DOM here: the same file runs in the browser and in Node.
3
  // Game-agnostic: a game registers BB.CASES[id] = {title, Body, Boss} and provides BB.ARENA {W, H}.
4
  // Body contract: id, keys {action: 'K1|K2'}, manual [..], NAIL (damage per hit), reset, update(c, input), box,
5
  // hurtBox, centre, slashBox() -> {pts, tink, dir} | null, slashHits {}, slashFacing, onSlashContact(c, kind),
environments/games/web/engine/sessions.js CHANGED
@@ -60,11 +60,6 @@
60
  var url=URL.createObjectURL(new Blob([JSON.stringify(run,null,2)],{type:'application/json'})),a=doc.createElement('a');a.href=url;a.download=run.case.replace('/','-')+'-seed'+run.seed+'.json';a.click();setTimeout(function(){URL.revokeObjectURL(url);},1000);
61
  });
62
  if($('load-run'))$('load-run').addEventListener('change',async function(){try{var f=this.files[0];if(f){if(f.size>8*1024*1024)throw Error('Replay file exceeds 8 MB.');load(JSON.parse(await f.text()),true);}}catch(e){showError(e);}this.value='';});
63
- var demos=BB.GAME_REPLAYS||{};
64
- if($('demo-run')){
65
- var select=$('demo-run');Object.keys(demos).forEach(function(key){var op=doc.createElement('option'),run=demos[key];op.value=key;op.textContent=BB.CASES[run.case].title+' · '+(run.d==null?'':('d='+run.d))+' · '+(run.verifier&&run.verifier.win?'Winning example':'Recorded replay');select.appendChild(op);});
66
- select.addEventListener('change',function(){try{if(this.value)load(demos[this.value],true);}catch(e){showError(e);}});
67
- }
68
  if($('replay-toggle'))$('replay-toggle').addEventListener('click',function(){if(active){notice=null;active.playing=!active.playing;acc=0;update();}});
69
  if($('replay-step'))$('replay-step').addEventListener('click',function(){if(!active)return;notice=null;active.playing=false;var end=Math.min((Math.floor(active.frame/12)+1)*12,active.parsed.length*12);while(active.frame<end&&!active.env.case.result)tick();api.redraw();update();});
70
  if($('replay-restart'))$('replay-restart').addEventListener('click',function(){if(active)load(active.run,false);});
 
60
  var url=URL.createObjectURL(new Blob([JSON.stringify(run,null,2)],{type:'application/json'})),a=doc.createElement('a');a.href=url;a.download=run.case.replace('/','-')+'-seed'+run.seed+'.json';a.click();setTimeout(function(){URL.revokeObjectURL(url);},1000);
61
  });
62
  if($('load-run'))$('load-run').addEventListener('change',async function(){try{var f=this.files[0];if(f){if(f.size>8*1024*1024)throw Error('Replay file exceeds 8 MB.');load(JSON.parse(await f.text()),true);}}catch(e){showError(e);}this.value='';});
 
 
 
 
 
63
  if($('replay-toggle'))$('replay-toggle').addEventListener('click',function(){if(active){notice=null;active.playing=!active.playing;acc=0;update();}});
64
  if($('replay-step'))$('replay-step').addEventListener('click',function(){if(!active)return;notice=null;active.playing=false;var end=Math.min((Math.floor(active.frame/12)+1)*12,active.parsed.length*12);while(active.frame<end&&!active.env.case.result)tick();api.redraw();update();});
65
  if($('replay-restart'))$('replay-restart').addEventListener('click',function(){if(active)load(active.run,false);});
environments/games/web/games/_boss3d/vendor/LICENSE ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ The MIT License
2
+
3
+ Copyright © 2010-2023 three.js authors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
environments/games/web/games/battlecity_remake/bc_kit.js CHANGED
@@ -2,7 +2,7 @@
2
  // Field = 208x208 px (13x13 blocks of 16 px, 26x26 cells of 8 px, brick cells split in 4 px quadrants).
3
  // Coordinates are integer field pixels, y grows downward, tank (x, y) = centre of a 16x16 box.
4
  // Frame order and constants follow the annotated ROM disassembly and two reverse-engineered ports
5
- // (see SOURCES.md / every engineering choice is marked there.
6
  (function(g){
7
  var BB=g.BB,BC=BB.BC={};
8
  BC.FIELD=208;BC.CELLS=26;
@@ -19,7 +19,7 @@
19
  BC.AI_TABLE=[0,0,0,1,0,3,2,2,2, 1,0,3,1,0,3,1,2,3]; // ROM $E486 aim rows (vertical-first / horizontal-first)
20
  // Original stage layouts (ROM $F07A, 13x13 nibbles: 0-3 brick halves R/B/L/T, 4 brick, 5-8 steel halves, 9 steel,
21
  // A water, B trees, C ice, D-F empty) and their 20-tank spawn order (ROM $E4EC + $E578), transcribed from the
22
- // MIT-licensed vgrichina/battlecity levels.js / game.js. Layout data is Namco's; see ASSET_RIGHTS.md.
23
  // pos = the stage's place in the 35-stage campaign; it only feeds the ROM formula $84 = 190 - 4*pos (C391).
24
  BC.STAGES={
25
  1:{rows:['ddddddddddddd','d4d4d4d4d4d4d','d4d4d4d4d4d4d','d4d4d494d4d4d','d4d4d3d3d4d4d','d3d3d1d1d3d3d','1d11d3d3d11d1',
 
2
  // Field = 208x208 px (13x13 blocks of 16 px, 26x26 cells of 8 px, brick cells split in 4 px quadrants).
3
  // Coordinates are integer field pixels, y grows downward, tank (x, y) = centre of a 16x16 box.
4
  // Frame order and constants follow the annotated ROM disassembly and two reverse-engineered ports
5
+
6
  (function(g){
7
  var BB=g.BB,BC=BB.BC={};
8
  BC.FIELD=208;BC.CELLS=26;
 
19
  BC.AI_TABLE=[0,0,0,1,0,3,2,2,2, 1,0,3,1,0,3,1,2,3]; // ROM $E486 aim rows (vertical-first / horizontal-first)
20
  // Original stage layouts (ROM $F07A, 13x13 nibbles: 0-3 brick halves R/B/L/T, 4 brick, 5-8 steel halves, 9 steel,
21
  // A water, B trees, C ice, D-F empty) and their 20-tank spawn order (ROM $E4EC + $E578), transcribed from the
22
+ // MIT-licensed vgrichina/battlecity levels.js / game.js. Layout data belongs to Namco.
23
  // pos = the stage's place in the 35-stage campaign; it only feeds the ROM formula $84 = 190 - 4*pos (C391).
24
  BC.STAGES={
25
  1:{rows:['ddddddddddddd','d4d4d4d4d4d4d','d4d4d4d4d4d4d','d4d4d494d4d4d','d4d4d3d3d4d4d','d3d3d1d1d3d3d','1d11d3d3d11d1',
environments/games/web/games/battlecity_remake/index.html CHANGED
@@ -9,7 +9,7 @@
9
  <div id="result" class="overlay hidden"><h2 id="rtitle"></h2><div id="rsub"></div><pre id="rjson"></pre><div class="row"><button class="b go" id="again">Play Again (R)</button><button class="b" id="back">Select Map (Esc)</button></div></div>
10
  <div id="play-actions" class="hidden"><button class="b" id="pause">Pause</button></div><div id="pausepanel" class="overlay hidden"><h2>Battle paused</h2><div class="row"><button class="b go" id="resume">Resume</button><button class="b" id="quit">Back to Map</button></div></div><div id="pausehint" class="hidden">P / Esc to pause · Press once per shot · Do not hit your own eagle base</div></div>
11
  <section id="help"><div class="box"><h3>Controls and Rules</h3><ul><li><kbd>W A S D</kbd> / arrow keys: drive in four directions (3 pixels every 4 frames); perpendicular turns align to the 8px grid, and other tanks block movement.</li><li><kbd>J</kbd> / <kbd>K</kbd> / <kbd>Space</kbd> / left mouse button: <b>fire one shot per press</b>; only one shell may be active by default; one star speeds up shells, two stars allow two shells, and three stars let shells pierce steel walls.</li><li>Each shell removes a 4px layer of brick. Water blocks tanks but not shells; trees hide tanks; ice locks your direction while sliding.</li><li>Any shell that hits the eagle base, including your own, causes immediate defeat. Losing all lives also ends the run (Easy: 4, Normal: 3, Hard: 2). Opposing shells cancel on contact.</li><li>Enemies 4, 11, and 18 in the spawn roster flash red (2 and 9 on Easy; repeated every 20 on Hard). Defeat one to drop a star, shield, base fortification, freeze, grenade that clears active enemies, or an extra life.</li><li>Difficulty tiers (benchmark extensions; frame-by-frame rules stay the same):<b>Easy</b> 10 enemies sampled from alternating roster entries, two starting stars, four lives, and half the enemy fire rate;<b>Normal</b> the original 20-enemy roster, original attack timing and fire rate, and a 150-frame spawn interval;<b>Hard</b> the roster repeated three times for 60 enemies; enemies rush the base after about 14 seconds on the original second-loop timer, fire 1.5 times as often, half use fast shells with red muzzles, and you have two lives.</li><li>Enemy tactics change over time: they patrol randomly, then chase the player, and finally rush the eagle base (shown at right).</li></ul></div><div class="box" id="skills"><h3>Stage Guide</h3><ul id="skilllist"></ul></div></section>
12
- <section class="box replay"><h3>Recording and Replay</h3><div class="row"><button class="b" id="save-run" disabled>Download Current Replay</button><label class="b">Import Replay <input id="load-run" type="file" accept="application/json,.json" style="width:170px"></label><select id="demo-run" aria-label="Example Replay"><option value="">Select Recorded Replay</option></select><button class="b" id="replay-toggle">Pause Replay</button><button class="b" id="replay-back">Back to Game</button></div><output id="replay-status">After a match, download the full action record. Example replays use the same rules and seed.</output></section>
13
  <p class="sub" style="font-size:12px;margin-top:14px">Independent code and original procedural art. The first three maps and spawn rosters transcribe original game data; the last three maps are original. Source details, ROM addresses, and approximations are documented in the project notes.</p>
14
  </main>
15
  <script src="../../engine/core.js"></script><script src="arena.js"></script><script src="bc_kit.js"></script><script src="specs/bc_brick_front.spec.js"></script><script src="specs/bc_river_ice.spec.js"></script><script src="specs/bc_steel_fort.spec.js"></script><script src="specs/bc_river_delta.spec.js"></script><script src="specs/bc_jungle_ambush.spec.js"></script><script src="specs/bc_steel_maze.spec.js"></script><script src="body_tank.js"></script><script src="../../engine/boss_kit.js"></script><script src="bosses/wave.js"></script><script src="../../engine/case.js"></script><script src="../../engine/juice.js"></script><script src="../../engine/art_kit.js"></script><script src="../../engine/renderer.js"></script><script src="art/scenes.js"></script><script src="draw.js"></script><script src="game.js"></script><script src="scripted.js"></script><script src="../../engine/input.js"></script><script src="../../engine/app.js"></script><script src="../../engine/sessions.js"></script>
 
9
  <div id="result" class="overlay hidden"><h2 id="rtitle"></h2><div id="rsub"></div><pre id="rjson"></pre><div class="row"><button class="b go" id="again">Play Again (R)</button><button class="b" id="back">Select Map (Esc)</button></div></div>
10
  <div id="play-actions" class="hidden"><button class="b" id="pause">Pause</button></div><div id="pausepanel" class="overlay hidden"><h2>Battle paused</h2><div class="row"><button class="b go" id="resume">Resume</button><button class="b" id="quit">Back to Map</button></div></div><div id="pausehint" class="hidden">P / Esc to pause · Press once per shot · Do not hit your own eagle base</div></div>
11
  <section id="help"><div class="box"><h3>Controls and Rules</h3><ul><li><kbd>W A S D</kbd> / arrow keys: drive in four directions (3 pixels every 4 frames); perpendicular turns align to the 8px grid, and other tanks block movement.</li><li><kbd>J</kbd> / <kbd>K</kbd> / <kbd>Space</kbd> / left mouse button: <b>fire one shot per press</b>; only one shell may be active by default; one star speeds up shells, two stars allow two shells, and three stars let shells pierce steel walls.</li><li>Each shell removes a 4px layer of brick. Water blocks tanks but not shells; trees hide tanks; ice locks your direction while sliding.</li><li>Any shell that hits the eagle base, including your own, causes immediate defeat. Losing all lives also ends the run (Easy: 4, Normal: 3, Hard: 2). Opposing shells cancel on contact.</li><li>Enemies 4, 11, and 18 in the spawn roster flash red (2 and 9 on Easy; repeated every 20 on Hard). Defeat one to drop a star, shield, base fortification, freeze, grenade that clears active enemies, or an extra life.</li><li>Difficulty tiers (benchmark extensions; frame-by-frame rules stay the same):<b>Easy</b> 10 enemies sampled from alternating roster entries, two starting stars, four lives, and half the enemy fire rate;<b>Normal</b> the original 20-enemy roster, original attack timing and fire rate, and a 150-frame spawn interval;<b>Hard</b> the roster repeated three times for 60 enemies; enemies rush the base after about 14 seconds on the original second-loop timer, fire 1.5 times as often, half use fast shells with red muzzles, and you have two lives.</li><li>Enemy tactics change over time: they patrol randomly, then chase the player, and finally rush the eagle base (shown at right).</li></ul></div><div class="box" id="skills"><h3>Stage Guide</h3><ul id="skilllist"></ul></div></section>
12
+ <section class="box replay"><h3>Recording and Replay</h3><div class="row"><button class="b" id="save-run" disabled>Download Current Replay</button><label class="b">Import Replay <input id="load-run" type="file" accept="application/json,.json" style="width:170px"></label><button class="b" id="replay-toggle">Pause Replay</button><button class="b" id="replay-back">Back to Game</button></div><output id="replay-status">After a match, download the full action record. Example replays use the same rules and seed.</output></section>
13
  <p class="sub" style="font-size:12px;margin-top:14px">Independent code and original procedural art. The first three maps and spawn rosters transcribe original game data; the last three maps are original. Source details, ROM addresses, and approximations are documented in the project notes.</p>
14
  </main>
15
  <script src="../../engine/core.js"></script><script src="arena.js"></script><script src="bc_kit.js"></script><script src="specs/bc_brick_front.spec.js"></script><script src="specs/bc_river_ice.spec.js"></script><script src="specs/bc_steel_fort.spec.js"></script><script src="specs/bc_river_delta.spec.js"></script><script src="specs/bc_jungle_ambush.spec.js"></script><script src="specs/bc_steel_maze.spec.js"></script><script src="body_tank.js"></script><script src="../../engine/boss_kit.js"></script><script src="bosses/wave.js"></script><script src="../../engine/case.js"></script><script src="../../engine/juice.js"></script><script src="../../engine/art_kit.js"></script><script src="../../engine/renderer.js"></script><script src="art/scenes.js"></script><script src="draw.js"></script><script src="game.js"></script><script src="scripted.js"></script><script src="../../engine/input.js"></script><script src="../../engine/app.js"></script><script src="../../engine/sessions.js"></script>
environments/games/web/games/battlecity_remake/scripted.js CHANGED
@@ -1,16 +1,4 @@
1
- // Standard scripted reference controller (BB.GAME.scripted), used by the harness, the policy-env page and the play
2
- // page's "Scripted Demo" button. Trusted: it reads the live simulation only through deep copies (own RNG copy), never
3
- // calls the live RNG or writes live state, and returns legal packets (<= 4 keys per hold set).
4
- // 1) heuristic: 8 px node BFS toward firing lanes on enemies / bonus / guard spot, taps J only on lanes that cannot
5
- // reach the eagle or the brick fortress; with no lane anywhere it closes in on the nearest tank, and once the AI clock
6
- // sends tanks at the eagle (DE72 base phase) every node pays GUARD per px away from the base (r5, for the tiers);
7
- // the pulls toward a power-up, toward a hidden tank and toward the base keep their straight-line value unless a wall
8
- // makes the real way much longer; then they use the path length (r6, for the self-made maze and river maps);
9
- // a move that turns at the next node stops 3 px short so the ROM turn-snap lands on it (r6, 16 px fords);
10
- // 2) one-step rollout: the heuristic packet and 10 uniform packets are each applied to a copy, the heuristic plays
11
- // H=32 more packets (6.4 s; 16 until r5 round 4, 24 until r6: a flank down the bottom row breaks the fortress in ~1.5 s
12
- // after a longer approach; at 4.8 s the r6 river map still lost 3/16 hard games that way, at 6.4 s none), and the
13
- // best-scoring first packet is emitted.
14
  (function(g){
15
  var BB=g.BB,BC=BB.BC,KEY=['W','A','S','D'],H=+(g.BC_H!=null?g.BC_H:32),GUARD=+(g.BC_GUARD!=null?g.BC_GUARD:.6); // dir 0 up,1 left,2 down,3 right
16
  var PILLPATH=g.BC_PILLPATH!=null?+g.BC_PILLPATH:2; // pill pull: 0 straight line (r5), 1 always path length, 2 path length only around walls (r6)
@@ -44,11 +32,7 @@
44
  return {hit:'edge',bricks:bricks};
45
  }
46
  function nodeFree(w,x,y){var cx=x>>3,cy=y>>3;for(var a=-1;a<=0;a++)for(var b=-1;b<=0;b++){var i=BC.idx(cx+a,cy+b),v=w.map[i];if(v===2||v===3||v===6||(v===1&&w.bits[i]))return false;}return true;}
47
- // r6: BFS distance (8 px nodes) from every node to the nodes whose 12 px pickup box reaches the pill. A straight-line
48
- // pull toward a pill behind a steel wall made a local optimum next to the wall; the BFS below never picks the current
49
- // node, so the tank stepped 9 px back and forth around it (steel_maze normal seed 7: 14 s while a tank reached the eagle).
50
- // Mode 2 keeps the r5 straight-line value wherever the path is not >= DETOUR px longer: always using the path length
51
- // (mode 1) changed every open-map decision too and cost 4 games on the approved maps (round-log r6 round 1).
52
  function bfs(w,src,key){var d={},q=[];src.forEach(function(p){var x=p[0],y=p[1],k=key(x,y);if(x<8||y<8||x>200||y>200||d[k]!=null||!nodeFree(w,x,y))return;d[k]=0;q.push([x,y]);});
53
  for(var h=0;h<q.length;h++){var X=q[h][0],Y=q[h][1],dd=d[key(X,Y)];for(var a=0;a<4;a++){var nx=X+BC.DX[a]*8,ny=Y+BC.DY[a]*8,nk=key(nx,ny);
54
  if(nx<8||ny<8||nx>200||ny>200||d[nk]!=null||!nodeFree(w,nx,ny))continue;d[nk]=dd+1;q.push([nx,ny]);}}
 
1
+ // The reference controller plans on copies. It compares a heuristic firing-lane packet and ten uniform packets, rolls each forward for 32 follow-up packets, and returns the best first packet.
 
 
 
 
 
 
 
 
 
 
 
 
2
  (function(g){
3
  var BB=g.BB,BC=BB.BC,KEY=['W','A','S','D'],H=+(g.BC_H!=null?g.BC_H:32),GUARD=+(g.BC_GUARD!=null?g.BC_GUARD:.6); // dir 0 up,1 left,2 down,3 right
4
  var PILLPATH=g.BC_PILLPATH!=null?+g.BC_PILLPATH:2; // pill pull: 0 straight line (r5), 1 always path length, 2 path length only around walls (r6)
 
32
  return {hit:'edge',bricks:bricks};
33
  }
34
  function nodeFree(w,x,y){var cx=x>>3,cy=y>>3;for(var a=-1;a<=0;a++)for(var b=-1;b<=0;b++){var i=BC.idx(cx+a,cy+b),v=w.map[i];if(v===2||v===3||v===6||(v===1&&w.bits[i]))return false;}return true;}
35
+ // Use a BFS distance when obstacles make the route to the target substantially longer than the straight-line distance.
 
 
 
 
36
  function bfs(w,src,key){var d={},q=[];src.forEach(function(p){var x=p[0],y=p[1],k=key(x,y);if(x<8||y<8||x>200||y>200||d[k]!=null||!nodeFree(w,x,y))return;d[k]=0;q.push([x,y]);});
37
  for(var h=0;h<q.length;h++){var X=q[h][0],Y=q[h][1],dd=d[key(X,Y)];for(var a=0;a<4;a++){var nx=X+BC.DX[a]*8,ny=Y+BC.DY[a]*8,nk=key(nx,ny);
38
  if(nx<8||ny<8||nx>200||ny>200||d[nk]!=null||!nodeFree(w,nx,ny))continue;d[nk]=dd+1;q.push([nx,ny]);}}
environments/games/web/games/battlecity_remake/specs/bc_brick_front.spec.js CHANGED
@@ -1,4 +1,3 @@
1
- // GENERATED from bc_brick_front.yaml by tools/gen_spec.py - edit the YAML, not this file.
2
  (function (g) { var BB = g.BB = g.BB || {}; BB.SPECS = BB.SPECS || {};
3
  BB.SPECS["bc_brick_front"] = {
4
  "schema": "bossbench/boss-spec@1",
@@ -110,20 +109,6 @@ BB.SPECS["bc_brick_front"] = {
110
  },
111
  "kinds": {
112
  "entropy": "continuous"
113
- },
114
- "skills_tested": [
115
- "base_defense",
116
- "terrain_destruction",
117
- "projectile_cancellation",
118
- "route_planning"
119
- ],
120
- "provenance": {
121
- "reference": "https://github.com/cyneprepou4uk/NES-Games-Disassembly/blob/6c145873e0f344ac4f132f451ac2dc7ea95cea6b/Battle%20City/bank_FF.asm",
122
- "target": "Battle City NES/Famicom 1985 single player",
123
- "retrieved": "2026-11-01",
124
- "scope": "Original stage 1 layout and spawn order (ROM //) with ROM frame rules: movement, probes, bullets, AI, pills, eagle.",
125
- "limitations": "RNG stream, stage-clear epilogue length and death/impact animation counters approximated. Public tiers easy/normal/hard (d 0.2/0.5/0.8) are a BENCHMARK EXTENSION, not an original mechanic: wave size, reinforcement interval, AI clock, fire rate, fast-shell share and starting lives/stars come from BC.TIER_TABLE in bc_kit.js (normal = ROM except the 150-frame interval). difficulty rows below are the BB.knobs view at d = 0 / 0.5 / 1 (wave durability in shell hits). See design/reproduction-cases/battlecity_remake.",
126
- "license": "Original code and procedural pixel art; stage layout/spawn data transcribed from the Namco ROM via MIT-licensed reverse-engineering projects (see ASSET_RIGHTS)."
127
  }
128
  };
129
  })(typeof window !== 'undefined' ? window : globalThis);
 
 
1
  (function (g) { var BB = g.BB = g.BB || {}; BB.SPECS = BB.SPECS || {};
2
  BB.SPECS["bc_brick_front"] = {
3
  "schema": "bossbench/boss-spec@1",
 
109
  },
110
  "kinds": {
111
  "entropy": "continuous"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
112
  }
113
  };
114
  })(typeof window !== 'undefined' ? window : globalThis);
environments/games/web/games/battlecity_remake/specs/bc_jungle_ambush.spec.js CHANGED
@@ -1,4 +1,3 @@
1
- // GENERATED from bc_jungle_ambush.yaml by tools/gen_spec.py - edit the YAML, not this file.
2
  (function (g) { var BB = g.BB = g.BB || {}; BB.SPECS = BB.SPECS || {};
3
  BB.SPECS["bc_jungle_ambush"] = {
4
  "schema": "bossbench/boss-spec@1",
@@ -110,20 +109,6 @@ BB.SPECS["bc_jungle_ambush"] = {
110
  },
111
  "kinds": {
112
  "entropy": "continuous"
113
- },
114
- "skills_tested": [
115
- "base_defense",
116
- "forest_occlusion",
117
- "reaction_speed",
118
- "route_planning"
119
- ],
120
- "provenance": {
121
- "reference": "https://github.com/cyneprepou4uk/NES-Games-Disassembly/blob/6c145873e0f344ac4f132f451ac2dc7ea95cea6b/Battle%20City/bank_FF.asm",
122
- "target": "Battle City NES/Famicom 1985 single player rules on a self-made stage",
123
- "retrieved": "2026-11-02",
124
- "scope": "BossBench original 13x13 layout and 20-tank roster under the ROM frame rules of the other cases; notional campaign position 24 for the ROM AI clock $84 = 190-4*24 = 94.",
125
- "limitations": "Not an original stage: layout, roster and campaign position are BossBench design. RNG stream, stage-clear epilogue and animation counters approximated as in all cases. Public tiers easy/normal/hard (d 0.2/0.5/0.8) are a BENCHMARK EXTENSION (BC.TIER_TABLE in bc_kit.js). difficulty rows below are the BB.knobs view at d = 0 / 0.5 / 1 (wave durability in shell hits). See design/reproduction-cases/battlecity_remake.",
126
- "license": "Original code, original layout and roster, procedural pixel art; no Namco stage data (see ASSET_RIGHTS)."
127
  }
128
  };
129
  })(typeof window !== 'undefined' ? window : globalThis);
 
 
1
  (function (g) { var BB = g.BB = g.BB || {}; BB.SPECS = BB.SPECS || {};
2
  BB.SPECS["bc_jungle_ambush"] = {
3
  "schema": "bossbench/boss-spec@1",
 
109
  },
110
  "kinds": {
111
  "entropy": "continuous"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
112
  }
113
  };
114
  })(typeof window !== 'undefined' ? window : globalThis);
environments/games/web/games/battlecity_remake/specs/bc_river_delta.spec.js CHANGED
@@ -1,4 +1,3 @@
1
- // GENERATED from bc_river_delta.yaml by tools/gen_spec.py - edit the YAML, not this file.
2
  (function (g) { var BB = g.BB = g.BB || {}; BB.SPECS = BB.SPECS || {};
3
  BB.SPECS["bc_river_delta"] = {
4
  "schema": "bossbench/boss-spec@1",
@@ -110,20 +109,6 @@ BB.SPECS["bc_river_delta"] = {
110
  },
111
  "kinds": {
112
  "entropy": "continuous"
113
- },
114
- "skills_tested": [
115
- "base_defense",
116
- "chokepoint_control",
117
- "long_range_fire",
118
- "route_planning"
119
- ],
120
- "provenance": {
121
- "reference": "https://github.com/cyneprepou4uk/NES-Games-Disassembly/blob/6c145873e0f344ac4f132f451ac2dc7ea95cea6b/Battle%20City/bank_FF.asm",
122
- "target": "Battle City NES/Famicom 1985 single player rules on a self-made stage",
123
- "retrieved": "2026-11-02",
124
- "scope": "BossBench original 13x13 layout and 20-tank roster under the ROM frame rules of the other cases; notional campaign position 16 for the ROM AI clock $84 = 190-4*16 = 126.",
125
- "limitations": "Not an original stage: layout, roster and campaign position are BossBench design. RNG stream, stage-clear epilogue and animation counters approximated as in all cases. Public tiers easy/normal/hard (d 0.2/0.5/0.8) are a BENCHMARK EXTENSION (BC.TIER_TABLE in bc_kit.js). difficulty rows below are the BB.knobs view at d = 0 / 0.5 / 1 (wave durability in shell hits). See design/reproduction-cases/battlecity_remake.",
126
- "license": "Original code, original layout and roster, procedural pixel art; no Namco stage data (see ASSET_RIGHTS)."
127
  }
128
  };
129
  })(typeof window !== 'undefined' ? window : globalThis);
 
 
1
  (function (g) { var BB = g.BB = g.BB || {}; BB.SPECS = BB.SPECS || {};
2
  BB.SPECS["bc_river_delta"] = {
3
  "schema": "bossbench/boss-spec@1",
 
109
  },
110
  "kinds": {
111
  "entropy": "continuous"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
112
  }
113
  };
114
  })(typeof window !== 'undefined' ? window : globalThis);
environments/games/web/games/battlecity_remake/specs/bc_river_ice.spec.js CHANGED
@@ -1,4 +1,3 @@
1
- // GENERATED from bc_river_ice.yaml by tools/gen_spec.py - edit the YAML, not this file.
2
  (function (g) { var BB = g.BB = g.BB || {}; BB.SPECS = BB.SPECS || {};
3
  BB.SPECS["bc_river_ice"] = {
4
  "schema": "bossbench/boss-spec@1",
@@ -110,20 +109,6 @@ BB.SPECS["bc_river_ice"] = {
110
  },
111
  "kinds": {
112
  "entropy": "continuous"
113
- },
114
- "skills_tested": [
115
- "base_defense",
116
- "bridge_control",
117
- "forest_occlusion",
118
- "ice_control"
119
- ],
120
- "provenance": {
121
- "reference": "https://github.com/cyneprepou4uk/NES-Games-Disassembly/blob/6c145873e0f344ac4f132f451ac2dc7ea95cea6b/Battle%20City/bank_FF.asm",
122
- "target": "Battle City NES/Famicom 1985 single player",
123
- "retrieved": "2026-11-01",
124
- "scope": "Original stage 28 layout and spawn order with ROM frame rules, including the ice glide lock (RAM $0103 player flags, ROM $E181).",
125
- "limitations": "RNG stream, stage-clear epilogue length and death/impact animation counters approximated. Public tiers easy/normal/hard (d 0.2/0.5/0.8) are a BENCHMARK EXTENSION, not an original mechanic: wave size, reinforcement interval, AI clock, fire rate, fast-shell share and starting lives/stars come from BC.TIER_TABLE in bc_kit.js (normal = ROM except the 150-frame interval). difficulty rows below are the BB.knobs view at d = 0 / 0.5 / 1 (wave durability in shell hits). See design/reproduction-cases/battlecity_remake.",
126
- "license": "Original code and procedural pixel art; stage layout/spawn data transcribed from the Namco ROM via MIT-licensed reverse-engineering projects (see ASSET_RIGHTS)."
127
  }
128
  };
129
  })(typeof window !== 'undefined' ? window : globalThis);
 
 
1
  (function (g) { var BB = g.BB = g.BB || {}; BB.SPECS = BB.SPECS || {};
2
  BB.SPECS["bc_river_ice"] = {
3
  "schema": "bossbench/boss-spec@1",
 
109
  },
110
  "kinds": {
111
  "entropy": "continuous"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
112
  }
113
  };
114
  })(typeof window !== 'undefined' ? window : globalThis);
environments/games/web/games/battlecity_remake/specs/bc_steel_fort.spec.js CHANGED
@@ -1,4 +1,3 @@
1
- // GENERATED from bc_steel_fort.yaml by tools/gen_spec.py - edit the YAML, not this file.
2
  (function (g) { var BB = g.BB = g.BB || {}; BB.SPECS = BB.SPECS || {};
3
  BB.SPECS["bc_steel_fort"] = {
4
  "schema": "bossbench/boss-spec@1",
@@ -110,20 +109,6 @@ BB.SPECS["bc_steel_fort"] = {
110
  },
111
  "kinds": {
112
  "entropy": "continuous"
113
- },
114
- "skills_tested": [
115
- "armor_followup",
116
- "upgrade_management",
117
- "base_defense",
118
- "corridor_control"
119
- ],
120
- "provenance": {
121
- "reference": "https://github.com/cyneprepou4uk/NES-Games-Disassembly/blob/6c145873e0f344ac4f132f451ac2dc7ea95cea6b/Battle%20City/bank_FF.asm",
122
- "target": "Battle City NES/Famicom 1985 single player",
123
- "retrieved": "2026-11-01",
124
- "scope": "Original stage 26 layout and spawn order with ROM frame rules; four-hit armor and steel tier.",
125
- "limitations": "RNG stream, stage-clear epilogue length and death/impact animation counters approximated. Public tiers easy/normal/hard (d 0.2/0.5/0.8) are a BENCHMARK EXTENSION, not an original mechanic: wave size, reinforcement interval, AI clock, fire rate, fast-shell share and starting lives/stars come from BC.TIER_TABLE in bc_kit.js (normal = ROM except the 150-frame interval). difficulty rows below are the BB.knobs view at d = 0 / 0.5 / 1 (wave durability in shell hits). See design/reproduction-cases/battlecity_remake.",
126
- "license": "Original code and procedural pixel art; stage layout/spawn data transcribed from the Namco ROM via MIT-licensed reverse-engineering projects (see ASSET_RIGHTS)."
127
  }
128
  };
129
  })(typeof window !== 'undefined' ? window : globalThis);
 
 
1
  (function (g) { var BB = g.BB = g.BB || {}; BB.SPECS = BB.SPECS || {};
2
  BB.SPECS["bc_steel_fort"] = {
3
  "schema": "bossbench/boss-spec@1",
 
109
  },
110
  "kinds": {
111
  "entropy": "continuous"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
112
  }
113
  };
114
  })(typeof window !== 'undefined' ? window : globalThis);
environments/games/web/games/battlecity_remake/specs/bc_steel_maze.spec.js CHANGED
@@ -1,4 +1,3 @@
1
- // GENERATED from bc_steel_maze.yaml by tools/gen_spec.py - edit the YAML, not this file.
2
  (function (g) { var BB = g.BB = g.BB || {}; BB.SPECS = BB.SPECS || {};
3
  BB.SPECS["bc_steel_maze"] = {
4
  "schema": "bossbench/boss-spec@1",
@@ -110,20 +109,6 @@ BB.SPECS["bc_steel_maze"] = {
110
  },
111
  "kinds": {
112
  "entropy": "continuous"
113
- },
114
- "skills_tested": [
115
- "base_defense",
116
- "maze_navigation",
117
- "armor_focus",
118
- "flank_defense"
119
- ],
120
- "provenance": {
121
- "reference": "https://github.com/cyneprepou4uk/NES-Games-Disassembly/blob/6c145873e0f344ac4f132f451ac2dc7ea95cea6b/Battle%20City/bank_FF.asm",
122
- "target": "Battle City NES/Famicom 1985 single player rules on a self-made stage",
123
- "retrieved": "2026-11-02",
124
- "scope": "BossBench original 13x13 layout and 20-tank roster under the ROM frame rules of the other cases; notional campaign position 30 for the ROM AI clock $84 = 190-4*30 = 70.",
125
- "limitations": "Not an original stage: layout, roster and campaign position are BossBench design. RNG stream, stage-clear epilogue and animation counters approximated as in all cases. Public tiers easy/normal/hard (d 0.2/0.5/0.8) are a BENCHMARK EXTENSION (BC.TIER_TABLE in bc_kit.js). difficulty rows below are the BB.knobs view at d = 0 / 0.5 / 1 (wave durability in shell hits). See design/reproduction-cases/battlecity_remake.",
126
- "license": "Original code, original layout and roster, procedural pixel art; no Namco stage data (see ASSET_RIGHTS)."
127
  }
128
  };
129
  })(typeof window !== 'undefined' ? window : globalThis);
 
 
1
  (function (g) { var BB = g.BB = g.BB || {}; BB.SPECS = BB.SPECS || {};
2
  BB.SPECS["bc_steel_maze"] = {
3
  "schema": "bossbench/boss-spec@1",
 
109
  },
110
  "kinds": {
111
  "entropy": "continuous"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
112
  }
113
  };
114
  })(typeof window !== 'undefined' ? window : globalThis);
environments/games/web/games/cuphead_remake/game.js CHANGED
@@ -1,6 +1,6 @@
1
  // v3 (2026-11-02): three public tiers. Each tier is one of the original modes (B.CUP.mode: easy = Simple, normal = Regular,
2
  // hard = Expert), so patterns, phase lists and aggression stay the source values; only the encounter's total HP is
3
- // calibrated per tier for the meeting's scripted time windows (B.CUP.TOTAL in arena.js, read at these difficulties).
4
  // v4 (same day, user decision): Horace Radiche on the secret branch keeps his source HP (B.CUP.HORACE_HP).
5
  // v5 (2026-11-03, expansion to 6 scenes): Cagney Carnation, Ribby and Croaks, Wally Warbles. The shared player code
6
  // gained guarded paths (thin / moving platforms, wind, a progress-only lever parry, shot-blocking targets) that the
 
1
  // v3 (2026-11-02): three public tiers. Each tier is one of the original modes (B.CUP.mode: easy = Simple, normal = Regular,
2
  // hard = Expert), so patterns, phase lists and aggression stay the source values; only the encounter's total HP is
3
+ // calibrated per tier for the reference-controller time windows (B.CUP.TOTAL in arena.js, read at these difficulties).
4
  // v4 (same day, user decision): Horace Radiche on the secret branch keeps his source HP (B.CUP.HORACE_HP).
5
  // v5 (2026-11-03, expansion to 6 scenes): Cagney Carnation, Ribby and Croaks, Wally Warbles. The shared player code
6
  // gained guarded paths (thin / moving platforms, wind, a progress-only lever parry, shot-blocking targets) that the
environments/games/web/games/cuphead_remake/index.html CHANGED
@@ -6,7 +6,7 @@
6
  <div id="result" class="overlay hidden"><h2 id="rtitle">KNOCKOUT!</h2><div id="rsub"></div><pre id="rjson"></pre><div class="row"><button class="b go" id="again">Play Another Reel (R)</button><button class="b" id="back">Select Reel (Esc)</button></div></div><div id="pausehint" class="hidden">P / Esc to pause · Q to return while paused</div></div>
7
  <div class="row hidden" id="play-actions"><button class="b" id="pause">Pause</button></div><div id="pausepanel" class="row hidden"><button id="resume" class="b">Resume</button><button id="quit" class="b">Back to Stages</button></div>
8
  <div id="help"><section class="box"><h3>Controls · Ground / Flight</h3><ul><li><kbd>A</kbd>/<kbd>D</kbd> to run; <kbd>W</kbd>/<kbd>S</kbd> to aim in eight directions. Hold <kbd>L</kbd> to stand still and aim. <kbd>S</kbd> crouches on the ground; crouch shots fire horizontally.</li><li><kbd>Space</kbd> to jump; press again in the air to parry a <strong style="color:#c84a83">pink</strong> target, bounce up, and gain one card.</li><li><kbd>Shift</kbd> to dash (no default invulnerability); <kbd>J</kbd> / left mouse button for rapid fire; <kbd>K</kbd> / right mouse button for EX (one card).</li><li>With five cards, <kbd>K</kbd> or <kbd>E</kbd> unleashes a super: a horizontal beam on the ground or a bomb transformation in flight.</li><li>In flight, <kbd>WASD</kbd> moves in eight directions. Hold <kbd>Shift</kbd> to shrink and move faster, with weaker short-range shots. <kbd>Q</kbd> switches between gun and bomb; <kbd>Space</kbd> parries.</li><li><kbd>P</kbd>/<kbd>Esc</kbd> pauses; <kbd>Q</kbd> returns to the menu while paused; <kbd>R</kbd> restarts after a result. Scripted Demo runs <code>BB.GAME.scripted</code>.</li></ul></section><section class="box" id="skills"><h3>Move List</h3><ul id="skilllist"></ul></section></div>
9
- <div class="replay-panel"><b>Film Room · Replay and Step-through</b><div class="row"><button id="save-run" class="b">Save This Replay</button><label class="b">Import Replay <input id="load-run" type="file" accept=".json" style="max-width:150px"></label><select id="demo-run" class="b" aria-label="Select Automatic Example"><option value="">Select Automatic Example…</option></select><button id="replay-toggle" class="b">Play / Pause</button><button id="replay-back" class="b">Exit Replay</button><span id="replay-status">One input packet every 200 ms; deterministic replay with the same seed and rules</span></div></div>
10
  <footer>Independent mechanical recreation with original procedural graphics. No charms; ground combat uses the basic rapid-fire gun and a sweeping beam. Exact enemy paths and unpublished frame counts use auditable approximations.</footer></div>
11
  <script src="../../engine/core.js"></script><script src="arena.js"></script><script src="specs/goopy.spec.js"></script><script src="specs/root_pack.spec.js"></script><script src="specs/hilda.spec.js"></script><script src="specs/cagney.spec.js"></script><script src="specs/ribby_croaks.spec.js"></script><script src="specs/wally.spec.js"></script><script src="body_cup.js"></script><script src="../../engine/boss_kit.js"></script><script src="bosses/goopy.js"></script><script src="bosses/root_pack.js"></script><script src="bosses/hilda.js"></script><script src="bosses/cagney.js"></script><script src="bosses/ribby_croaks.js"></script><script src="bosses/wally.js"></script><script src="../../engine/case.js"></script><script src="../../engine/juice.js"></script><script src="../../engine/art_kit.js"></script><script src="../../engine/renderer.js"></script><script src="art/scenes.js"></script><script src="draw/figures.js"></script><script src="draw/figures_v5.js"></script><script src="game.js"></script><script src="scripted.js"></script><script src="../../engine/input.js"></script><script src="../../engine/app.js"></script><script src="../../engine/sessions.js"></script>
12
  </body></html>
 
6
  <div id="result" class="overlay hidden"><h2 id="rtitle">KNOCKOUT!</h2><div id="rsub"></div><pre id="rjson"></pre><div class="row"><button class="b go" id="again">Play Another Reel (R)</button><button class="b" id="back">Select Reel (Esc)</button></div></div><div id="pausehint" class="hidden">P / Esc to pause · Q to return while paused</div></div>
7
  <div class="row hidden" id="play-actions"><button class="b" id="pause">Pause</button></div><div id="pausepanel" class="row hidden"><button id="resume" class="b">Resume</button><button id="quit" class="b">Back to Stages</button></div>
8
  <div id="help"><section class="box"><h3>Controls · Ground / Flight</h3><ul><li><kbd>A</kbd>/<kbd>D</kbd> to run; <kbd>W</kbd>/<kbd>S</kbd> to aim in eight directions. Hold <kbd>L</kbd> to stand still and aim. <kbd>S</kbd> crouches on the ground; crouch shots fire horizontally.</li><li><kbd>Space</kbd> to jump; press again in the air to parry a <strong style="color:#c84a83">pink</strong> target, bounce up, and gain one card.</li><li><kbd>Shift</kbd> to dash (no default invulnerability); <kbd>J</kbd> / left mouse button for rapid fire; <kbd>K</kbd> / right mouse button for EX (one card).</li><li>With five cards, <kbd>K</kbd> or <kbd>E</kbd> unleashes a super: a horizontal beam on the ground or a bomb transformation in flight.</li><li>In flight, <kbd>WASD</kbd> moves in eight directions. Hold <kbd>Shift</kbd> to shrink and move faster, with weaker short-range shots. <kbd>Q</kbd> switches between gun and bomb; <kbd>Space</kbd> parries.</li><li><kbd>P</kbd>/<kbd>Esc</kbd> pauses; <kbd>Q</kbd> returns to the menu while paused; <kbd>R</kbd> restarts after a result. Scripted Demo runs <code>BB.GAME.scripted</code>.</li></ul></section><section class="box" id="skills"><h3>Move List</h3><ul id="skilllist"></ul></section></div>
9
+ <div class="replay-panel"><b>Film Room · Replay and Step-through</b><div class="row"><button id="save-run" class="b">Save This Replay</button><label class="b">Import Replay <input id="load-run" type="file" accept=".json" style="max-width:150px"></label><button id="replay-toggle" class="b">Play / Pause</button><button id="replay-back" class="b">Exit Replay</button><span id="replay-status">One input packet every 200 ms; deterministic replay with the same seed and rules</span></div></div>
10
  <footer>Independent mechanical recreation with original procedural graphics. No charms; ground combat uses the basic rapid-fire gun and a sweeping beam. Exact enemy paths and unpublished frame counts use auditable approximations.</footer></div>
11
  <script src="../../engine/core.js"></script><script src="arena.js"></script><script src="specs/goopy.spec.js"></script><script src="specs/root_pack.spec.js"></script><script src="specs/hilda.spec.js"></script><script src="specs/cagney.spec.js"></script><script src="specs/ribby_croaks.spec.js"></script><script src="specs/wally.spec.js"></script><script src="body_cup.js"></script><script src="../../engine/boss_kit.js"></script><script src="bosses/goopy.js"></script><script src="bosses/root_pack.js"></script><script src="bosses/hilda.js"></script><script src="bosses/cagney.js"></script><script src="bosses/ribby_croaks.js"></script><script src="bosses/wally.js"></script><script src="../../engine/case.js"></script><script src="../../engine/juice.js"></script><script src="../../engine/art_kit.js"></script><script src="../../engine/renderer.js"></script><script src="art/scenes.js"></script><script src="draw/figures.js"></script><script src="draw/figures_v5.js"></script><script src="game.js"></script><script src="scripted.js"></script><script src="../../engine/input.js"></script><script src="../../engine/app.js"></script><script src="../../engine/sessions.js"></script>
12
  </body></html>
environments/games/web/games/cuphead_remake/specs/cagney.spec.js CHANGED
@@ -1,4 +1,3 @@
1
- // GENERATED from cagney.yaml by tools/gen_spec.py - edit the YAML, not this file.
2
  (function (g) { var BB = g.BB = g.BB || {}; BB.SPECS = BB.SPECS || {};
3
  BB.SPECS["cagney"] = {
4
  "schema": "bossbench/boss-spec@1",
@@ -134,16 +133,6 @@ BB.SPECS["cagney"] = {
134
  },
135
  "kinds": {
136
  "entropy": "continuous"
137
- },
138
- "skills_tested": [
139
- "read_telegraph",
140
- "timing_jump",
141
- "spacing",
142
- "aim",
143
- "parry"
144
- ],
145
- "provenance": {
146
- "license": "Original procedural art and implementation; source mechanics referenced from Cuphead Wiki"
147
  }
148
  };
149
  })(typeof window !== 'undefined' ? window : globalThis);
 
 
1
  (function (g) { var BB = g.BB = g.BB || {}; BB.SPECS = BB.SPECS || {};
2
  BB.SPECS["cagney"] = {
3
  "schema": "bossbench/boss-spec@1",
 
133
  },
134
  "kinds": {
135
  "entropy": "continuous"
 
 
 
 
 
 
 
 
 
 
136
  }
137
  };
138
  })(typeof window !== 'undefined' ? window : globalThis);
environments/games/web/games/cuphead_remake/specs/goopy.spec.js CHANGED
@@ -1,4 +1,3 @@
1
- // GENERATED from goopy.yaml by tools/gen_spec.py - edit the YAML, not this file.
2
  (function (g) { var BB = g.BB = g.BB || {}; BB.SPECS = BB.SPECS || {};
3
  BB.SPECS["goopy"] = {
4
  "schema": "bossbench/boss-spec@1",
@@ -134,16 +133,6 @@ BB.SPECS["goopy"] = {
134
  },
135
  "kinds": {
136
  "entropy": "continuous"
137
- },
138
- "skills_tested": [
139
- "read_telegraph",
140
- "timing_jump",
141
- "spacing",
142
- "aim",
143
- "parry"
144
- ],
145
- "provenance": {
146
- "license": "Original procedural art and implementation; source mechanics referenced from Cuphead Wiki"
147
  }
148
  };
149
  })(typeof window !== 'undefined' ? window : globalThis);
 
 
1
  (function (g) { var BB = g.BB = g.BB || {}; BB.SPECS = BB.SPECS || {};
2
  BB.SPECS["goopy"] = {
3
  "schema": "bossbench/boss-spec@1",
 
133
  },
134
  "kinds": {
135
  "entropy": "continuous"
 
 
 
 
 
 
 
 
 
 
136
  }
137
  };
138
  })(typeof window !== 'undefined' ? window : globalThis);