Reference for current phone-side sound and vibration feedback. This is useful when tuning the game feel because controller feedback is part of the driving model, not just polish.
- Audio is generated with Web Audio on the phone controller.
- Motion steering prefers
deviceorientation, falls back todevicemotiongravity tilt, then tries Chrome's Generic SensorGravitySensor/Accelerometerpath when legacy orientation events do not deliver. iOS Safari/WebKit requires an explicitEnable Tilttap so the browser can show its motion/orientation permission prompt. Chrome/Chromium and iOS Safari/WebKit require HTTPS; plain LANhttp://can leave the app in touch steering fallback even when the API exists. - Race countdown captures a stable median neutral baseline before sending motion steering. If the phone stays portrait, the app asks the player to turn sideways instead of saving a portrait steering center. Race motion steering also re-centers when the phone changes orientation frame.
- Race touch steering deliberately overrides motion steering while an arrow is held. This prevents partial/noisy sensor events from fighting the fallback controls on mobile browsers.
- Vibration uses
navigator.vibrate(). - Web vibration can vary pulse duration and patterns, but not reliable motor amplitude/intensity/sharpness like native Android or iOS haptics.
- iOS Safari does not support web vibration. Android Chromium/Samsung-style browsers are the main target. Firefox Android may expose partial or no-op support.
- Android Chrome/Samsung browsers can expose the API and return success while the phone suppresses the motor. Check Silent mode, Do Not Disturb, power saving, and the Android/Samsung touch vibration or system haptics settings when the app says a pulse was requested but nothing is felt.
- Start/test cue: short confirmation tone when audio is enabled or tested.
- Audio test also triggers a small on-screen pulse preview on the phone controller.
- Countdown: server-marked 5/4/3/2/1 beeps after audio is unlocked, followed by a louder/lower
GOcue only after the server reports the race phase has started. - Engine: persistent tone follows car speed and throttle.
- Tire: filtered noise follows slip, grass/off-road driving, and curb contact.
- Brake: tone fades in during braking at speed.
- Curb: low rumble follows curb contact at speed.
- Impact: short thud cue when impact is above threshold.
- Explosive crash: stronger boom cue for the crashing player when an actual car-to-car crash or very hard wall hit emits a shared crash event.
- Nearby rivals: during racing, each phone receives only the nearest few rival audio descriptors and mixes a quiet stereo-panned engine/air layer for close cars and pass-bys.
- Nearby crashes: non-self crash events inside a short radius play as lighter panned booms so nearby players hear them without getting the crashing player's strongest cue.
- Race exit: all persistent layers fade out outside countdown/racing.
Speed thresholds below use the same km/h scale shown on the in-game speedometer.
- Test pulse:
[120, 60, 180]. - Haptic test also triggers a small on-screen pulse preview on the phone controller.
- Explosive crash:
[120, 45, 190, 55, 90]for the crashing player. - Impact: one pulse, roughly
45-140msdepending on impact strength. - Hard braking:
[18, 24, 18]when braking hard above about35 km/h. - Curb:
18mspulse while on curbs above about18 km/h. - Grass/off-road:
24mspulse while on grass above about20 km/h. - High slip:
16mspulse when slip is high above about25 km/h. - Tuk-tuk tip risk: provisional
[14, 38, 20]warning pattern when speed, steering, slip, and curb load are close to rollover. Keep this under review; it should feel like a useful warning, not a constant alarm.
- Clean cornering g-force is not a separate continuous haptic layer.
- Cornering feedback currently comes through tire sound and high-slip vibration when the car starts to slide.
- Full scene-wide spatial audio is not implemented. Current relative audio is intentionally limited to nearby rival cars and nearby crash cues; earphones still make the layered feedback clearer.