SC Tuning captures real-time telemetry from Forza Motorsport 7 and processes it through a multi-stage pipeline. This document explains each component and how they connect.

Pipeline Overview

┌─────────────────────────────────────────────────────────────────────────┐
│                         SC TUNING PIPELINE                              │
├─────────────────────────────────────────────────────────────────────────┤
│                                                                         │
│   ┌──────────────┐     UDP 7777      ┌──────────────────┐              │
│   │   FM7 Game   │ ────────────────► │ Telemetry        │              │
│   │   (Xbox/PC)  │    60 packets/sec │ Receiver (VPS)   │              │
│   └──────────────┘                   └────────┬─────────┘              │
│                                               │                         │
│                                               │ raw.bin files           │
│                                               ▼                         │
│                                      ┌──────────────────┐              │
│                                      │ Session Storage  │              │
│                                      │ data/sessions/   │              │
│                                      └────────┬─────────┘              │
│                                               │                         │
│                                               │ rsync                   │
│                                               ▼                         │
│                                      ┌──────────────────┐              │
│                                      │  Metrics API     │              │
│                                      │  (Go, port 8081) │              │
│                                      └────────┬─────────┘              │
│                                               │                         │
│                                               │ REST / SSE              │
│                                               ▼                         │
│                                      ┌──────────────────┐              │
│                                      │  WebUI Dashboard │              │
│                                      │  (Next.js, 3001) │              │
│                                      └──────────────────┘              │
│                                                                         │
└─────────────────────────────────────────────────────────────────────────┘

Component Details

1. Telemetry Source (FM7)

Forza Motorsport 7 has a built-in “Data Out” feature that broadcasts telemetry over UDP.

SettingValue
ProtocolUDP
Port7777
Packet size311 bytes
Frequency60Hz (every ~16ms)
Fields85 per packet

The game sends data continuously while driving, including:

2. Telemetry Receiver

A Go service running on a VPS captures UDP packets and writes them to disk.

Responsibilities:

Session structure:

data/sessions/
├── 2026-01-23T14-30-00/
│   ├── raw.bin          # Binary packet stream
│   └── metadata.json    # Session info
├── 2026-01-23T15-45-00/
│   ├── raw.bin
│   └── metadata.json

3. Session Storage

Raw telemetry is stored as binary files for efficient replay and analysis.

Why binary?

Sync strategy:

4. Metrics API

A Go REST API that parses raw telemetry and exposes processed metrics.

EndpointMethodDescription
/api/v1/sessionsGETList available sessions
/api/v1/sessions/{id}GETSession metadata
/api/v1/sessions/{id}/telemetryGETPaginated telemetry frames
/api/v1/sessions/{id}/metricsGETComputed metrics
/api/v1/sessions/{id}/streamSSEReal-time telemetry stream

Current metrics (9 implemented):

5. WebUI Dashboard

A Next.js application for visualizing telemetry and metrics.

Current pages:

Tech stack:


Data Flow Example

Here’s what happens when you complete a lap:

  1. FM7 broadcasts ~3,600 packets (60Hz × 60 seconds)
  2. Receiver writes packets to raw.bin as they arrive
  3. Metrics API parses the binary when requested
  4. API computes lap time from position delta + timestamp
  5. Dashboard displays lap time and telemetry graphs

Current Capabilities

CapabilityStatus
UDP packet capture✅ Working
85-field packet parsing✅ Working
Session management✅ Working
REST API✅ Working
SSE streaming✅ Working
806 car database✅ Working
Metrics computation✅ 9 metrics
Dashboard visualization⚠️ Partial
Track identification🔄 In progress
ML models📋 Planned

Technology Choices

LayerTechnologyWhy
ReceiverGoFast, low memory, easy deployment
APIGoSame binary, simple REST
DashboardNext.jsReact ecosystem, SSR, fast iteration
StorageBinary filesSimple, portable, efficient
StreamingSSESimpler than WebSockets for one-way data

Next Steps

The current pipeline handles data capture and basic metrics. Upcoming work:

  1. Rule-based diagnostics - Encode tuning wisdom as detection rules
  2. Statistical analysis - Identify patterns across sessions
  3. Track fingerprinting - Auto-identify tracks from telemetry patterns
  4. ML integration - Train models for lap time prediction and anomaly detection