[PR #224] Feature: Driver Chase Cam View with Dashboard HUD #232

Open
opened 2026-05-07 00:19:19 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/IAmTomShaw/f1-race-replay/pull/224
Author: @darsh-shah4548
Created: 2/7/2026
Status: 🔄 Open

Base: mainHead: feature/driver-chase-cam


📝 Commits (2)

  • 3e49748 Add tyre strategy timeline panel (resolves #95)
  • a1792ce Add driver chase cam view with smooth top-down camera tracking

📊 Changes

5 files changed (+1167 additions, -12 deletions)

View changed files

📝 main.py (+1 -0)
📝 src/arcade_replay.py (+3 -1)
📝 src/f1_data.py (+64 -0)
📝 src/interfaces/race_replay.py (+377 -11)
📝 src/ui_components.py (+722 -0)

📄 Description

I understand this feature may not be fully aligned with the pit wall-style vision and direction of this project. Apologies if this PR deviates from that. I'm happy to adjust or close if it doesn't fit the roadmap.

Summary

  • Adds a driver chase cam mode activated by pressing V after selecting a driver on the leaderboard
  • Top-down camera zooms into the selected driver with smooth rotation aligned to their heading direction
  • Full dashboard HUD with large speed/gear display, horizontal throttle/brake bars, DRS indicator, tyre compound/age, real-time gap intervals to drivers ahead and behind, and a mini-map showing all car positions
  • Uses Camera2D with sub-frame interpolation between 25 FPS data frames and heavy heading smoothing for butter-smooth rendering at any playback speed
  • Left/Right arrows cycle between drivers while in chase cam; ESC or V exits back to normal view

Technical Details

  • Camera system: Dual-camera rendering — Camera2D for world-space (track + cars), default_camera for screen-space HUD overlay
  • Smooth rendering: Sub-frame position interpolation eliminates discrete jumps at zoom level; circular-mean heading buffer (size 20) with slow angle lerp (0.04) prevents rotation shimmer
  • Frame sync: Chase cam update runs after frame_index is finalized in on_update, ensuring camera and rendered cars use identical frame data (no 1-frame desync)
  • Performance: Pre-rotated track points computed once at init, pre-created arcade.Text objects for all HUD elements, reduced track point density for chase cam rendering
  • Gap calculation: Uses the same proven formula as DriverInfoComponent (distance / 10.0 / 55.56 at 200 km/h reference speed)

Files Changed

File Changes Impact
src/interfaces/race_replay.py +355 lines Chase cam state, camera methods, world rendering, key handlers — all additive
src/ui_components.py +387 lines New ChaseCamHUDComponent class + 1 help entry — appended at end

Zero existing contributor code deleted or overwritten. All modifications are strictly additive: new imports, tuple extensions, guard clauses in key handlers, and a popup height increase (+20px) to fit the new help entry.

Screenshots

Screenshot 2026-02-06 at 7 54 18 PM Screenshot 2026-02-06 at 7 54 20 PM Screenshot 2026-02-06 at 7 54 45 PM Screenshot 2026-02-06 at 7 55 28 PM

Test plan

  • Select a driver on the leaderboard, press V — verify camera zooms into the driver
  • Verify smooth camera rotation aligned to driver heading
  • Check dashboard HUD: speed, gear, DRS, tyre info, throttle/brake bars
  • Verify Ahead/Behind gap intervals update in real-time
  • Press Left/Right arrows to cycle between drivers
  • Verify mini-map shows all car positions with chased driver highlighted
  • Press V or ESC to exit — verify normal view returns exactly as before
  • Press H to confirm "V - Chase Cam (select driver)" appears in controls help
  • Test at different playback speeds (1x, 4x, 32x) for smooth camera movement
  • Resize window during chase cam to verify layout adjusts
  • Test on multiple races/circuits to verify universal compatibility

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/IAmTomShaw/f1-race-replay/pull/224 **Author:** [@darsh-shah4548](https://github.com/darsh-shah4548) **Created:** 2/7/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feature/driver-chase-cam` --- ### 📝 Commits (2) - [`3e49748`](https://github.com/IAmTomShaw/f1-race-replay/commit/3e497489098aa99dedc4a0b0eba34b913e16eb74) Add tyre strategy timeline panel (resolves #95) - [`a1792ce`](https://github.com/IAmTomShaw/f1-race-replay/commit/a1792ce82a5065339a16f10ed871bb3370d27365) Add driver chase cam view with smooth top-down camera tracking ### 📊 Changes **5 files changed** (+1167 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `main.py` (+1 -0) 📝 `src/arcade_replay.py` (+3 -1) 📝 `src/f1_data.py` (+64 -0) 📝 `src/interfaces/race_replay.py` (+377 -11) 📝 `src/ui_components.py` (+722 -0) </details> ### 📄 Description > I understand this feature may not be fully aligned with the pit wall-style vision and direction of this project. Apologies if this PR deviates from that. I'm happy to adjust or close if it doesn't fit the roadmap. ## Summary - Adds a **driver chase cam mode** activated by pressing `V` after selecting a driver on the leaderboard - Top-down camera zooms into the selected driver with smooth rotation aligned to their heading direction - Full dashboard HUD with large speed/gear display, horizontal throttle/brake bars, DRS indicator, tyre compound/age, real-time gap intervals to drivers ahead and behind, and a mini-map showing all car positions - Uses `Camera2D` with sub-frame interpolation between 25 FPS data frames and heavy heading smoothing for butter-smooth rendering at any playback speed - Left/Right arrows cycle between drivers while in chase cam; `ESC` or `V` exits back to normal view ## Technical Details - **Camera system**: Dual-camera rendering — `Camera2D` for world-space (track + cars), `default_camera` for screen-space HUD overlay - **Smooth rendering**: Sub-frame position interpolation eliminates discrete jumps at zoom level; circular-mean heading buffer (size 20) with slow angle lerp (0.04) prevents rotation shimmer - **Frame sync**: Chase cam update runs after `frame_index` is finalized in `on_update`, ensuring camera and rendered cars use identical frame data (no 1-frame desync) - **Performance**: Pre-rotated track points computed once at init, pre-created `arcade.Text` objects for all HUD elements, reduced track point density for chase cam rendering - **Gap calculation**: Uses the same proven formula as `DriverInfoComponent` (`distance / 10.0 / 55.56` at 200 km/h reference speed) ## Files Changed | File | Changes | Impact | |------|---------|--------| | `src/interfaces/race_replay.py` | +355 lines | Chase cam state, camera methods, world rendering, key handlers — all additive | | `src/ui_components.py` | +387 lines | New `ChaseCamHUDComponent` class + 1 help entry — appended at end | **Zero existing contributor code deleted or overwritten.** All modifications are strictly additive: new imports, tuple extensions, guard clauses in key handlers, and a popup height increase (+20px) to fit the new help entry. ## Screenshots <img width="2559" height="1440" alt="Screenshot 2026-02-06 at 7 54 18 PM" src="https://github.com/user-attachments/assets/62e7029e-cdba-4d1d-ac49-8a4656f6ddda" /> <img width="398" height="335" alt="Screenshot 2026-02-06 at 7 54 20 PM" src="https://github.com/user-attachments/assets/b6be8a68-d60d-4288-b618-bd29fa66e64f" /> <img width="776" height="1493" alt="Screenshot 2026-02-06 at 7 54 45 PM" src="https://github.com/user-attachments/assets/4644c77a-ed8d-4dc9-b5c3-a930f6360ad1" /> <img width="1668" height="1434" alt="Screenshot 2026-02-06 at 7 55 28 PM" src="https://github.com/user-attachments/assets/56001f45-e54f-4e5b-8439-5af87e1a192f" /> ## Test plan - [ ] Select a driver on the leaderboard, press `V` — verify camera zooms into the driver - [ ] Verify smooth camera rotation aligned to driver heading - [ ] Check dashboard HUD: speed, gear, DRS, tyre info, throttle/brake bars - [ ] Verify Ahead/Behind gap intervals update in real-time - [ ] Press Left/Right arrows to cycle between drivers - [ ] Verify mini-map shows all car positions with chased driver highlighted - [ ] Press `V` or `ESC` to exit — verify normal view returns exactly as before - [ ] Press `H` to confirm "V - Chase Cam (select driver)" appears in controls help - [ ] Test at different playback speeds (1x, 4x, 32x) for smooth camera movement - [ ] Resize window during chase cam to verify layout adjusts - [ ] Test on multiple races/circuits to verify universal compatibility --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/f1-race-replay#232
No description provided.