[PR #192] [CLOSED] Add race comparison feature with dual-track support #210

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

📋 Pull Request Information

Original PR: https://github.com/IAmTomShaw/f1-race-replay/pull/192
Author: @thegreatalxx
Created: 1/24/2026
Status: Closed

Base: mainHead: main


📄 Description

Summary

Adds a race comparison feature that allows users to compare two F1 races side-by-side, supporting both same-circuit and different-circuit comparisons.

Features Added

  • Race comparison mode with three view modes:

    • Split view: Two tracks side-by-side with independent rendering
    • Overlay view: Single track with ghost cars from second race
    • Difference view: Color-coded position deltas between races
  • Dual-track support: Each race renders on its correct circuit layout (e.g., compare Monaco vs Singapore)

  • Multiple synchronization modes:

    • Lap-based: Compare lap 1 vs lap 1
    • Time-based: Align by race time (00:00 vs 00:00)
    • Distance-based: Match by track position percentage
  • GUI integration: New " Compare Races" button in race selection window with dual-race picker dialog

  • Live leaderboards: Shows top 10 positions for both races in split view

  • Playback controls: Pause, seek, speed adjustment (0.25x to 4x), view/sync mode toggling

Files Added

  • src/race_comparison.py - Core comparison logic and synchronization algorithms
  • src/interfaces/comparison_viewer.py - Arcade-based visualization with responsive rendering

Files Modified

  • main.py - Added comparison mode entry point and CLI arguments (--compare, --year-b, --round-b)
  • src/gui/race_selection.py - Added comparison dialog and GUI integration

Usage

CLI

python main.py --compare --year 2024 --round 5 --year-b 2023 --round-b 5

GUI

Click " Compare Races" button → Select two races → Click "Compare Races"

Controls

  • V: Toggle view mode (Split/Overlay/Difference)
  • S: Toggle sync mode (Lap/Time/Distance)
  • SPACE: Pause/Resume
  • ←/→: Seek backward/forward
  • ↑/↓: Adjust playback speed
  • R: Restart
  • L: Toggle driver labels
  • ESC: Close viewer

Technical Details

  • Auto-adjusts to window size with responsive viewports
  • Maintains track aspect ratios to prevent distortion
  • Handles races with different lap counts
  • Works with both Sprint and standard races

🔄 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/192 **Author:** [@thegreatalxx](https://github.com/thegreatalxx) **Created:** 1/24/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `main` --- ### 📄 Description ## Summary Adds a race comparison feature that allows users to compare two F1 races side-by-side, supporting both same-circuit and different-circuit comparisons. ## Features Added - **Race comparison mode** with three view modes: - Split view: Two tracks side-by-side with independent rendering - Overlay view: Single track with ghost cars from second race - Difference view: Color-coded position deltas between races - **Dual-track support**: Each race renders on its correct circuit layout (e.g., compare Monaco vs Singapore) - **Multiple synchronization modes**: - Lap-based: Compare lap 1 vs lap 1 - Time-based: Align by race time (00:00 vs 00:00) - Distance-based: Match by track position percentage - **GUI integration**: New "⚡ Compare Races" button in race selection window with dual-race picker dialog - **Live leaderboards**: Shows top 10 positions for both races in split view - **Playback controls**: Pause, seek, speed adjustment (0.25x to 4x), view/sync mode toggling ## Files Added - `src/race_comparison.py` - Core comparison logic and synchronization algorithms - `src/interfaces/comparison_viewer.py` - Arcade-based visualization with responsive rendering ## Files Modified - `main.py` - Added comparison mode entry point and CLI arguments (`--compare`, `--year-b`, `--round-b`) - `src/gui/race_selection.py` - Added comparison dialog and GUI integration ## Usage ### CLI ```bash python main.py --compare --year 2024 --round 5 --year-b 2023 --round-b 5 ``` ### GUI Click "⚡ Compare Races" button → Select two races → Click "Compare Races" ## Controls - **V**: Toggle view mode (Split/Overlay/Difference) - **S**: Toggle sync mode (Lap/Time/Distance) - **SPACE**: Pause/Resume - **←/→**: Seek backward/forward - **↑/↓**: Adjust playback speed - **R**: Restart - **L**: Toggle driver labels - **ESC**: Close viewer ## Technical Details - Auto-adjusts to window size with responsive viewports - Maintains track aspect ratios to prevent distortion - Handles races with different lap counts - Works with both Sprint and standard races --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-07 00:19:13 +02:00
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#210
No description provided.