make wasm full-game web build wears the playground code-panel shell (shell.html) instead of shell_game.html #384

Closed
opened 2026-07-16 01:42:20 +00:00 by john · 0 comments
Owner

Summary

The make wasm build (build-emscripten/, what make serve serves and what the release McRogueFace-<ver>-WASM.zip is packaged from) bundles the full game (src/scripts/game.py = Crypt of Sokoban) but renders it inside src/shell.html — the playground shell, which has a CodeMirror editor / Run button / a default snippet. So the "full game for web" shows the game running behind an interactive Python code panel it should not have.

Root cause

Two independent CMake options:

  • MCRF_PLAYGROUND selects scripts (CMakeLists.txt:451): playground → src/scripts_playground, else full game src/scripts.
  • MCRF_GAME_SHELL selects the shell HTML (CMakeLists.txt:455): ON → shell_game.html (no panel), OFF (default) → shell.html (code panel).

The make wasm target sets neither MCRF_PLAYGROUND nor MCRF_GAME_SHELL, so it gets full-game scripts and the default shell.html (code panel). make wasm-game is a near-duplicate that does set -DMCRF_GAME_SHELL=ON and is correct, but serve/release use build-emscripten (from wasm), not build-wasm-game.

Verified: build-emscripten/mcrogueface.data contains the Sokoban scripts; shell.html contains CodeMirror/<textarea>/runCode while shell_game.html contains none of them.

Blast radius

  • make serve (local) → game + code panel.
  • dist/McRogueFace-<ver>-WASM.zip (release, Makefile:567-569 zips build-emscripten) → shipped WASM game carries the code panel. 0.2.8 is affected.
  • Not affected: the deployed site /playground/ — it is built from make playground (MCRF_PLAYGROUND=ON), bundles PlaygroundScene/scripts_playground (not game.py), and correctly has the code panel. So #382 snippet-links target a clean playground.

Fix

Add -DMCRF_GAME_SHELL=ON to the make wasm target so build-emscripten is a clean full-game build (game.py + shell_game.html, no panel). This makes wasm and wasm-game identical — collapse the duplication (alias or drop wasm-game) to prevent the two drifting again.

Note: the wasm targets only run cmake when build-<dir>/Makefile is absent, so an existing build-emscripten/ must be cleaned (make clean-wasm) before the flag takes effect.

Sibling context: #382 (playground snippet-links) — this is the "deploying the playground" adjacent build-hygiene fix.

## Summary The `make wasm` build (`build-emscripten/`, what `make serve` serves **and** what the release `McRogueFace-<ver>-WASM.zip` is packaged from) bundles the full game (`src/scripts/game.py` = Crypt of Sokoban) but renders it inside `src/shell.html` — the **playground** shell, which has a CodeMirror editor / Run button / a default snippet. So the "full game for web" shows the game running behind an interactive Python code panel it should not have. ## Root cause Two independent CMake options: - `MCRF_PLAYGROUND` selects scripts (`CMakeLists.txt:451`): playground → `src/scripts_playground`, else full game `src/scripts`. - `MCRF_GAME_SHELL` selects the shell HTML (`CMakeLists.txt:455`): ON → `shell_game.html` (no panel), OFF (default) → `shell.html` (code panel). The `make wasm` target sets neither `MCRF_PLAYGROUND` nor `MCRF_GAME_SHELL`, so it gets full-game scripts **and** the default `shell.html` (code panel). `make wasm-game` is a near-duplicate that *does* set `-DMCRF_GAME_SHELL=ON` and is correct, but `serve`/release use `build-emscripten` (from `wasm`), not `build-wasm-game`. Verified: `build-emscripten/mcrogueface.data` contains the Sokoban scripts; `shell.html` contains `CodeMirror`/`<textarea>`/`runCode` while `shell_game.html` contains none of them. ## Blast radius - `make serve` (local) → game + code panel. - `dist/McRogueFace-<ver>-WASM.zip` (release, `Makefile:567-569` zips `build-emscripten`) → shipped WASM game carries the code panel. 0.2.8 is affected. - **Not affected:** the deployed site `/playground/` — it is built from `make playground` (`MCRF_PLAYGROUND=ON`), bundles `PlaygroundScene`/`scripts_playground` (not game.py), and correctly has the code panel. So #382 snippet-links target a clean playground. ## Fix Add `-DMCRF_GAME_SHELL=ON` to the `make wasm` target so `build-emscripten` is a clean full-game build (game.py + `shell_game.html`, no panel). This makes `wasm` and `wasm-game` identical — collapse the duplication (alias or drop `wasm-game`) to prevent the two drifting again. Note: the wasm targets only run cmake when `build-<dir>/Makefile` is absent, so an existing `build-emscripten/` must be cleaned (`make clean-wasm`) before the flag takes effect. Sibling context: #382 (playground snippet-links) — this is the "deploying the playground" adjacent build-hygiene fix.
john closed this issue 2026-07-16 04:42:51 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
john/McRogueFace#384
No description provided.