feat(maze): shrink map and rebalance compact gameplay

This commit is contained in:
2026-09-08 22:14:13 +03:00
parent 5346f9296f
commit f043b63732
18 changed files with 297 additions and 61 deletions
+202
View File
@@ -1173,3 +1173,205 @@ headline at random whenever a player opens the page.
helper falls back safely when unavailable. This satisfies every Milestone 013
acceptance criterion. Milestone 013 is `COMPLETE`; Milestone 014 remains
`NOT_STARTED`.
## Milestone 014 — Compact square maze and gameplay rebalance
**Status:** `COMPLETE`
### Objective
Reduce the default maze from `128 x 64` (8,192 cells) to a square `32 x 32`
maze (1,024 cells), exactly one eighth of the original area, and rebalance the
game so that its exploration, competition, and fairness requirements remain
meaningful at the smaller scale.
### Scope
- Change the canonical and implementation-default maze dimensions to
`32 x 32` while retaining central symmetry and bounded generation.
- Recalculate cycle density, exit separation, key-placement distance,
landmarks, artifacts, and compass placement for the reduced area.
- Preserve the rule that finding the key is no easier than the subsequent
search for an exit under the project's deterministic balance metric.
- Update player and observer presentation requirements for a square map.
- Update protocol bounds, tests, diagnostics, and balance documentation that
depend on the former `128 x 64` default.
- Revalidate memory, static-asset, and firmware partition budgets.
### Deliverables
- `32 x 32` authoritative maze generation and gameplay configuration.
- Rebalanced object placement and deterministic balance thresholds.
- Updated canonical gameplay, architecture, UI, generation, balance, and MVP
acceptance documentation.
- Updated host and browser tests for the compact square map.
### Acceptance criteria
1. The default authoritative map is exactly `32 x 32`, containing 1,024 cells,
and no production default remains dependent on `128 x 64` dimensions.
2. A 1,024-seed deterministic sweep produces connected, centrally symmetric
maps with valid starts, exits, objects, and no generation failure.
3. Rebalanced key and exit placement preserves the invariant that key
discovery is no easier than the subsequent exit search under the documented
deterministic metric.
4. Object counts and cycle density are scaled for the smaller map and remain
bounded, symmetric where required, reachable, and free of collisions.
5. Player and observer views render the complete square map correctly at the
responsive sizes defined in `docs/UI_STYLE.md`.
6. All host and browser tests pass, and firmware plus web images build within
their partition budgets.
7. The project owner confirms through representative two-player testing that
the compact map remains fair, understandable, and free of gameplay-blocking
defects, or explicitly approves an evidence deviation.
### Evidence
Implementation is complete and host-verified; representative two-player
confirmation remains pending.
- On 2026-09-08, `bash scripts/run_host_tests.sh` passed every health, Wi-Fi,
NVS, provisioning, lobby/protocol, maze, game, disconnect-recovery, browser,
and web-asset suite. The deterministic 1,024-seed sweep generated connected,
centrally symmetric `32 x 32` maps without failure, reported cycles
`19..19`, dead ends `74..128`, start-to-key distances `93..422`, key-to-exit
distances `84..352`, start-to-exit distances `26..242`, at most two
generation attempts, and preserved `start_to_key >= key_to_exit` for every
seed. Fixed maze plus workspace storage measured 5,596 of 65,536 bytes.
- The default configuration now uses 1,024 cells, two cross-half connection
pairs, eight extra cycle pairs, 22-cell minimum exit separation, two
landmark pairs, and one vision-artifact pair. The three-cell base view,
ten-successful-move artifact effect, 150 ms movement cooldown, compass rule,
and 200 ms draw window remain unchanged. Observer serialization passed with
1,024 cells, 12 objects, 88 bounded chunks, and a 490-byte largest chunk.
- The browser tests passed with explicit `32 x 32` dimension bounds and a
square-map fit scale. Web-asset reproduction reported SHA-256
`3461d20742e1999c1489465d7f3a68317d56b3acfc5ac5003341e1cf2d478eed`
using 20,314 of 1,572,864 allowed compressed bytes.
- A clean `pio run -e esp32-c6-devkitm-1` build passed for application version
`0.14.0`, using 58,868 of 327,680 RAM bytes and 1,027,934 of 2,097,152
application bytes. `firmware.bin` measured 1,028,560 bytes with SHA-256
`428e7690bed50d30caf61aca174d838f00d7de1a603f14ea669e996e3d167123`.
- `pio run -e esp32-c6-devkitm-1 --target buildfs` passed. The fixed LittleFS
image measured 2,031,616 of 2,031,616 partition bytes with SHA-256
`467f0a07413c83bff5ea246b5063289eb61f8bf40b95d16d639b3241ceda8a9d`.
- Acceptance criteria 1--6 have concrete evidence. Criterion 7 requires the
project owner's representative two-player confirmation or an explicitly
approved deviation, so Milestone 014 remains `IN_PROGRESS`.
- On 2026-09-08, the project owner confirmed representative two-player testing
of the compact `32 x 32` map: gameplay is fair and understandable, all
expected flows work as intended, and no gameplay-blocking defect was found.
Together with the deterministic sweep, browser, host, firmware, and
filesystem evidence above, this satisfies every Milestone 014 acceptance
criterion. Milestone 014 is `COMPLETE`; Milestone 015 remains `NOT_STARTED`.
## Milestone 015 — Pre-reader child-friendly game experience
**Status:** `NOT_STARTED`
### Objective
Redesign the mobile player experience so that children of early primary-school
age and younger can understand and enjoy the game without needing to read,
while preserving server authority, hidden-state protection, and all gameplay
rules.
### Scope
- Replace text-dependent status comprehension with large, distinct pictograms,
shapes, colors, motion, and optional local sound cues.
- Give each player a friendly visual character and color identity instead of
relying on the labels `P1` and `P2`.
- Enlarge and dynamically frame the visible maze so that the playable area is
the dominant mobile-screen element, including when the player is near a map
edge and receives fewer visible cells.
- Add a large on-screen joystick designed for one-thumb control. Its movable
circular handle follows the thumb within a bounded base, includes a forgiving
dead zone, and returns visibly to the center when released.
- Map joystick direction to the four existing orthogonal movement commands and
map displacement magnitude to a bounded command-repeat rate: a small
intentional displacement walks slowly, while a larger displacement moves at
the fastest server-approved rate. The browser never bypasses the
authoritative movement cooldown or predicts movement locally.
- Retain swipe and keyboard input as equivalent optional alternatives without
displaying the existing directional-arrow buttons during normal mobile play.
- Introduce a short, replayable, wordless onboarding sequence that demonstrates
movement, walls, keys, exits, compasses, vision artifacts, and meeting the
other player through animation and guided interaction.
- Communicate pickup, blocked movement, compass direction, enhanced vision,
opened exits, victory, defeat, draw, pause, and reconnection with immediate
icon-first animation and sound feedback.
- Keep concise Russian text as an optional secondary aid for readers and
accessibility technology, never as the only way to understand a required
action or game state.
- Provide visible mute and reduced-motion controls, avoid rapid flashes, and
ensure that meaning never depends on color alone.
- Preserve bounded local assets, offline operation, responsive behavior, and
the existing authoritative command and projection contracts.
### Deliverables
- Updated child-oriented visual language and mobile layout specification in
`docs/UI_STYLE.md`.
- Large icon-first player HUD, maze viewport, and touch-control design.
- Friendly player characters and locally stored visual/audio feedback assets.
- Wordless interactive onboarding that demonstrates dragging, holding, and
releasing the joystick, plus a replay control.
- Deterministic browser tests and viewport-based visual regression evidence.
- Facilitated usability-test guide for pre-readers and early readers.
### Acceptance criteria
1. At the canonical `412 x 916` mobile viewport, the visible maze is the
dominant element and uses the available play area without a large inactive
void around the current projection.
2. Movement is possible through an always-visible on-screen joystick with a
touch area of at least `160 x 160` CSS pixels. Its handle tracks a mouse,
touch, or pointer drag, remains bounded within the base, and snaps to the
center on release, cancellation, pause, disconnect, or loss of focus.
3. Joystick displacement maps monotonically to a documented bounded repeat
rate: increasing displacement never produces slower movement, the dead zone
sends no command, and maximum displacement cannot exceed the authoritative
server movement limit. Direction is resolved to exactly one of the four
existing orthogonal commands, with hysteresis preventing rapid direction
flicker near diagonal boundaries.
4. A child can distinguish their character, carried key, enhanced vision,
compass direction, exit state, blocked movement, and match result without
reading text or recognizing `P1`/`P2`.
5. First-time onboarding demonstrates joystick drag distance, direction,
release-to-stop, walls, and every required interaction through animation and
guided input; it can be replayed and can be skipped by an adult.
6. Essential state uses at least two visual channels such as icon plus shape,
motion, or pattern; color is never the sole signal.
7. Optional sound feedback has an obvious icon-only mute control, and reduced
motion preserves all information without rapid flashing or disorienting
effects.
8. Player-facing text remains Russian, semantic labels remain available to
assistive technology, and the interface does not require reading for normal
play.
9. Browser tests cover joystick dead-zone, displacement-to-rate mapping,
direction hysteresis, release and cancellation, icon-driven state
transitions, onboarding, mute, reduced motion, and the supported mobile
viewport; all existing host tests continue to pass.
10. The compressed local web payload remains within the 1.5 MiB asset budget
and the LittleFS partition, without internet or third-party runtime assets.
11. Facilitated observation with representative pre-readers confirms that they
can discover the joystick, move slowly and quickly, stop reliably, react to
a wall, recognize a key objective, and follow a compass cue without spoken
reading instructions, or the project owner explicitly approves a documented
evidence deviation.
### Evidence
Completion evidence is not yet available because implementation has not
started. A baseline inspection of the live game at a `412 x 915` viewport on
2026-09-08 found that the visible maze occupied only `80 x 140` pixels inside a
`381 x 729` play area, status labels were approximately `8--10.56` pixels,
status icons were `23 x 23` pixels, the player was identified primarily as
`P1`, and no directional touch controls were visible in the game area. These
observations define the principal redesign targets. The planned joystick
replaces directional-arrow buttons rather than adding them. Expected completion
evidence includes before-and-after viewport captures, deterministic browser
tests, `bash scripts/run_host_tests.sh`, a reproducible `buildfs` size report,
and the facilitated child-usability confirmation or an explicitly approved
deviation.