Skip to content

feat: implement speed-dependent tire pitch scaling and highway joint thumps#114

Open
swarup-developer wants to merge 1 commit into
Orinks:mainfrom
swarup-developer:feat/road-feel
Open

feat: implement speed-dependent tire pitch scaling and highway joint thumps#114
swarup-developer wants to merge 1 commit into
Orinks:mainfrom
swarup-developer:feat/road-feel

Conversation

@swarup-developer

Copy link
Copy Markdown

What changed and why

  • Implemented speed-dependent tire pitch scaling for the tire-on-asphalt hum loop. As the truck accelerates, the frequency slides up; as it slows, it slides down into a deep rumble. This eliminates the static/flat feeling of the road.
  • Implemented periodic concrete highway expansion joint thumps. The tires now thump rhythmically over joints every 14-18 meters (with organic random variance) above 5 m/s.
  • Triggered brief low-frequency haptic joint thumps through the controller when crossing joints.

What players or maintainers will notice

  • The tire road hum pitch changes dynamically with speed (BASS backend).
  • Rhythmic, soft tire thumps over concrete joints (both audio clicks and subtle controller haptic pulses) at speed-proportional intervals.
  • Silent joints and low-frequency hum when stopped or crawling.

Tests and checks run

  • Full test suite run (uv run pytest), all 1341 tests pass.
  • Ruff checks (uv run ruff check) are completely clean.
  • Added specific unit tests:
    • test_joint_is_low_frequency_only_and_stops in tests/test_rumble.py
    • test_bass_road_noise_frequency_changes_with_speed in tests/test_audio_backends.py
    • test_road_joint_thumps_accumulate_distance_and_trigger in tests/test_driving_features.py

Accessibility impact

  • Fully keyboard and screen reader accessible. Checked that spoken/audio cues do not overlap awkwardly, and the soft thump volume scales down to be non-intrusive.

Changelog

  • I added a player-facing bullet under ## Unreleased in CHANGELOG.md, written in plain player language and matching the style of the existing entries.
  • This change is not player-facing, and every commit message in this PR includes [skip changelog].

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0e220b2460

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +541 to +543
moved_mi = self.trip.last_moved_mi
if moved_mi > 0.0:
moved_m = moved_mi * 1609.344

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use unscaled distance for road-joint timing

At normal gameplay pace this accumulator uses trip.last_moved_mi, but Trip.update computes that value from velocity_mps * dt * effective_time_scale (default 10x, selectable up to 40x), so the new joint thumps are scheduled on compressed route distance rather than the truck's real wheel distance. At 65 mph the intended 14–18 m spacing should sound roughly every half second, but the default pace makes it about 10x faster and fast pace can trigger nearly every frame; use an unscaled physical delta such as t.velocity_mps * dt for this audio/haptic effect.

Useful? React with 👍 / 👎.

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