Skip to content

Restore Yardline RC phone-controller bridge - #30

Merged
vetonshabani0 merged 1 commit into
mainfrom
fix/yardline-rc-controller-bridge
Jul 24, 2026
Merged

Restore Yardline RC phone-controller bridge#30
vetonshabani0 merged 1 commit into
mainfrom
fix/yardline-rc-controller-bridge

Conversation

@vetonshabani0

Copy link
Copy Markdown
Collaborator

Problem

Since the 2026-07-23 deduped-Babylon rebuild (#27) that fixed the missing cars, Yardline RC is undrivable from a phone. The map and cars render and it plays with a keyboard, but the mobile controller does nothing.

Root cause: that rebuild came from a game-source tree without the console embed bridge. sc:analog/analog appears 0 times in the current bundle (present in every build through #26). Losing the bridge broke input two ways:

  1. The game no longer declares its pad layout (sc:controls), so the phone falls back to a d-pad instead of the steering wheel + gas/brake.
  2. The game no longer listens for sc:analog driving frames or sc:intent buttons, so no input reaches the car.

The launcher and controller apps are unchanged and fine — only the game lost its listener.

Fix

The game's real source lives in a separate repo (Artan0/razing) that isn't available here, so — consistent with how BUILD.md already hand-patches this vendored bundle — the bridge is restored without a rebuild:

  • index.html — inline bridge <script> that mirrors the original: declares sc:controls per race phase, feeds sc:analog frames into the car (setTouchDrive/Brake/Handbrake), and routes sc:intent buttons (reset / powerup / pause, menu nav, results screen).
  • assets/index-CSoa7UUc.js — two tiny, unique-anchored injections expose the surviving runtime instances the bridge drives: window.__scInput (input controller) and window.__scRace (race state machine).
  • BUILD.md — documents the patch + a post-rebuild check so it can't silently regress again.

Verification

  • Bundle still passes node --check; BUILD.md's `/assets/ invariant stays 0; single entry chunk preserved.
  • CI-safe: eslint ignores yardline-rc/** and the stamper copies it verbatim (NO_STAMP), so the patch flows to gh-pages unchanged.
  • Bridge routing tested end-to-end against mock runtime handles: pad-on-load = d-pad ✓, analog → drive/brake/handbrake ✓, reset/powerup/pause ✓, menu nav → synthetic keys ✓, results → returnToMenu ✓, malformed payloads ignored ✓.
  • Not yet tested: the live WebRTC round-trip on a real phone — please confirm via this branch's Pages preview before merging.

Proper long-term fix

Restore the embed bridge in Artan0/razing and rebuild, then drop the inline shim.

The 2026-07-23 deduped-Babylon rebuild (#27) fixed the missing cars but was
built from a source tree without the console embed bridge, so the phone fell
back to a d-pad and no input reached the car — the map and cars render but the
game is undrivable from a phone.

Restore the bridge without a rebuild (source lives in Artan0/razing, not here),
matching how BUILD.md already hand-patches this vendored bundle:

- index.html: inline bridge script that declares the phone pad per race phase
  (sc:controls), feeds sc:analog frames into the car, and routes sc:intent
  buttons (reset/powerup/pause, menu nav, results screen) — mirroring the
  original in-bundle bridge.
- assets/index-CSoa7UUc.js: expose the two runtime instances the bridge drives
  (window.__scInput = input controller, window.__scRace = race state machine).
- BUILD.md: document the patch and a post-rebuild check so it can't silently
  regress again.
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Preview for fix/yardline-rc-controller-bridge: https://space-console.github.io/games/preview/fix-yardline-rc-controller-bridge-5b95/

@vetonshabani0
vetonshabani0 merged commit 8fa08bf into main Jul 24, 2026
4 checks passed
@vetonshabani0
vetonshabani0 deleted the fix/yardline-rc-controller-bridge branch July 24, 2026 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant