0e8121d0271b1623224af8befeb69a4bd7e42ce8
3
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
0e8121d027 |
fix(divergence): release the parked ball during multiball
Bug: with crazy-mode balls on the table, hitting the effect target while "release ball" (effect seven) was lit did nothing. The ball parked in the special hole stayed there. Cause: the release kept the original two-slot guard "only when no second ball exists" (balls.len() == 1), plus a check that the triggering ball's slot number differs from the hole's contact word. Both made sense when the released ball could only ever become slot two, but they block the release whenever more balls are in play. Fix: - Effect seven now releases whenever the special hole actually holds a parked ball (special_hole_active: multiball Ready and contact set), at most once per callback. The slot-number check is gone; with one ball it never mattered, and with more balls it blocked slot two. - publish_spawned_balls appends the released ball and makes it the owner of the special-hole contact under its real slot number, so it clears the contact itself as it rolls out. With one ball in play that number is 2, identical to the original's contact word. - While multiball is Active, remove_ball renumbers (or clears) that owner when an earlier ball leaves, like the claw and lock-hole owners. In Ready the word is the "ball parked" marker and stays untouched. The single-ball release path is unchanged; all existing special-hole and effect-seven tests still pass. Test Plan: - cargo test release_ball_frees_the_parked_ball_during_multiball: three balls in play, release spawns a fourth at the hole, the owner follows a removal, and the released ball leaves the hole and clears it. - Manual: in crazy mode, park a ball in the special hole (top left), light release ball, hit the effect target; a new ball rolls out. |
||
|
|
a8cc0fc5fc |
feat(divergence): make every ball identical and bind crazy mode to 0
Crazy mode first shipped as a side list of "crazy balls" with reduced physics (walls, bumpers, flippers only) next to the original primary and secondary slots. That is not what was wanted: a ball in the machine is a ball, with no main/second/extra distinction. This replaces the two-slot engine with one ordered list and moves the shortcut to a single key. Ball model (src/game.rs) - Game::balls: Vec<Ball> replaces `ball`, `secondary_ball`, and `crazy_balls`. The list is never empty while the game runs; a waiting ball is simply a ball with in_launcher set. - advance_ball_slots runs one timer callback: every ball, in slot order, integrates up to `substeps` steps through the single integrator step_ball (record scan, ball-to-ball contact, rule dispatch, drain) and stops after its first collision, exactly like the original slot pass. - BallPass carries the ball's current index plus the slot number and ball count from the start of the callback. The original keeps slot two numbered 2 for the rest of a callback even after slot one drained, and type-three contact records publish that number as their owner; keeping it per pass preserves that. - Effect seven's ball goes to `spawned_balls` and joins after all slot passes, as the original publishes slot two only after slot one's pass. - lose_ball removes a drained ball while others remain (Drain event, normal scoring once one ball is left) and only the last ball takes the special respawn or ends the player's ball. remove_ball keeps the claw's captured/entry indices and the claw and lock-hole contact owners pointing at the same physical ball when an earlier slot leaves. - The claw stores a ball index instead of a Primary/Secondary enum. - Nudge, flipper kicks, multiball scoring, and the "no third ball from effect seven" guard are expressed over the list. With one or two balls the original order, random draws, and ownership rules are unchanged; all existing parity and multiball tests pass after a mechanical port (test-only shims fixed_update, advance_secondary_ball, drain, secondary/set_secondary/take_secondary keep them readable). - Crazy mode adds ten ordinary balls (capped at MAX_BALLS = 64 because contact records reserve 99 as a sentinel) and marks the player. Deliberate differences from the original (also in PARITY_AUDIT.md), mostly because there is no longer a special slot one: - A ball resting on the shooter stop returns to an empty launcher from any slot; the original deleted a slot-two ball there. If the launcher is occupied the ball leaves the table without costing a ball. - Flipper kicks, record countdowns, and target rotation keep running for balls in play while another ball waits in the launcher. - Ball-to-ball contact skips only the claw-held ball; every ball's hit is published as last_collision_id. - Stress runs with 10-64 balls showed balls trapped forever: two balls settle into one lock hole, one fills it (contact 99), and the rim then reflects the other from the inside. A filled hole's rim now only repels balls moving towards its center. Lock-hole owners of a removed ball are cleared/renumbered like the claw owner. Input (src/app.rs) - Crazy mode is the bare main-row 0 key. It overlaps no original or modern binding and has no browser default action, so the WASM build receives it. The Ctrl+Shift+0 combo and its Shift-release nudge suppression are gone. - Rendering draws every ball not held by the claw. Simulator: snapshots report `balls: [...]` instead of `ball` and `secondary_ball`; autoplay flips for any ball near a flipper. Test Plan: - cargo test (160 tests), including new ones: a_ball_moves_the_same_in_any_slot (same ball in slot one vs. behind a waiting ball follows the identical trajectory), crazy_mode_adds_ten_ordinary_balls_and_marks_the_player, the_turn_ends_only_when_the_last_ball_drains, shooter_stop_rearms_a_returning_ball_from_any_slot, crazy_mode_is_capped_and_rejected_after_the_game. - A temporary release-mode stress test (not committed) ran 12 seeded two-player games with crazy mode, autoplay flippers, and nudges to completion, and 4 seeds at the 64-ball cap for 30k frames, asserting finite state, a non-empty ball list, and valid claw indices. - Manual: during a game press 0 (also in the browser build); ten balls appear, each can be captured by the claw, lock holes, and targets, and the turn ends only after the last ball drains. |
||
|
|
faf66f1ac0 |
docs(audit): record final player-experience parity
Build TDK Pinball / build (macos-latest) (push) Canceled after 0s
Build TDK Pinball / build (ubuntu-latest) (push) Canceled after 0s
Build TDK Pinball / build (windows-latest) (push) Canceled after 0s
Add the requirement-by-requirement audit for the Rust rewrite. It ties visual, audio, input, physics, timer, rule, multiball, player, persistence, random, and build claims to the preserved binary, complete readable C, focused tests, deterministic framebuffers, and stopped-Wine differential probes. The audit distinguishes native-window and portable-storage substitutions from gameplay semantics, records both relative-slingshot position/velocity/spin probes, and lists the reproducible final gates used for the completion decision. Test Plan: - `cargo build --profile production` -- passed - `cargo test --workspace --all-targets --all-features` -- 125 passed - `cargo clippy --workspace --all-targets --all-features -- -D warnings` -- passed - Windows and macOS `cargo check` targets -- passed - `bash original/tools/test_reconstructed_c.sh` -- passed - `python3 original/tools/audit_reconstruction.py --require-complete` -- passed with zero incomplete or unclassified units - original executable, timer DLL, and preserved raw hashes -- matched - `rumdl check --flavor commonmark README.md RECONSTRUCTION.md PARITY_AUDIT.md CHANGELOG.md` -- passed - `git diff --cached --check` -- passed |