Unofficial Forza Horizon setup planner and A/B test toolkit for drivers and AI agents.
Plan gearing, tire pressure, brake balance and other setup changes, compare them under identical conditions, and analyze real lap records without losing the rollback values. MIT-licensed, with no runtime dependencies.
Python 3.11+ · no runtime dependencies · no proprietary datasets
This repository provides deterministic scalar formulas, candidate generation, A-B-A analysis and optimality certificates. It is not a complete vehicle rating calculator or lap simulator. Unsupported operations are listed explicitly instead of being estimated.
- Build a small, deterministic list of setup candidates instead of guessing one “best” build.
- Compare final-drive and individual gear ratios, tire pressures, brake balance and related setup changes.
- Run baseline → candidate → baseline experiments and see best lap, median, consistency and off-track cost.
- Separate “faster and repeatable” from “fast once but harder to drive”.
- Give an AI agent a concrete JSON workflow for planning tests and reporting evidence.
It is useful even without a simulator: you can bring your own model results or measured laps. It does not pretend to be a complete vehicle rating calculator or lap simulator.
- Binary32-ordered tire, brake, center-of-mass and wheel-mass formulas.
- A 26-row binned braking-table replay and straight-remaining predicate.
- Deterministic single-variable and combination candidate plans with limits and budgets.
- A-B-A valid-lap analysis, baseline drift and stability reporting.
- Pareto fronts, budget-limited certificates and exhaustive finite-domain certificates.
- A vehicle setup experiment guide for agents.
See src/setup_lab/capabilities.json and MISSING.md before requesting ratings, lap simulations or hardware-specific optimization.
python -m pip install .
setup-lab capabilities
setup-lab physics examples/physics_tire.json
setup-lab plan examples/plan.json
setup-lab analyze examples/aba.jsonWithout installation:
PYTHONPATH=src python -m setup_lab capabilitiesPowerShell:
$env:PYTHONPATH = "src"
py -m setup_lab capabilitiesEvery data command accepts - as the JSON input path for stdin.
setup-lab physics examples/physics_tire.json
# {"inertia": 0.5391262769699097, "mass": 7.624475002288818}Input example:
{
"operation": "tire_carcass",
"args": {"width_mm": 185, "aspect": 60, "wheel_diameter_in": 14}
}The functions validate inputs and preserve explicit binary32 operation order. They cover only the named scalar formulas and do not reconstruct a complete vehicle.
examples/plan.json produces one baseline, three single-variable candidates and two combinations. Candidate IDs and plan hashes are deterministic. planned_not_evaluated means the plan has not been run through an evaluator.
setup-lab analyze examples/aba.jsonThe example is synthetic and reports E0_unverified_run_data. For genuine measured runs, set:
{
"runs_verified": true,
"data_provenance": "Driver, event, conditions and recording date",
"stability_not_worse": true
}Invalid, off-track, non-finite and nonpositive laps never become fast scores. A fast best lap with worse consistency is labeled separately from a repeatable improvement.
from setup_lab.track import binned_brake_time_and_distance
seconds, meters = binned_brake_time_and_distance(speed_table, low_speed, high_speed)The caller supplies exactly 26 rows with at least eight finite columns. Columns 6 and 7 are used for time and distance. No captured table is bundled.
from setup_lab import (
analyze_aba,
best_found_certificate,
exhaustive_certificate,
generate_candidates,
pareto_front,
)best_found_under_budgetnever claims a global optimum.exhaustive_global_optimumrequires one unique result for every finite-domain entry, with valid or rejected status and finite positive valid laps.- Pareto comparisons require every candidate to have every declared finite metric.
PYTHONPATH=src python -B -m unittest discover -s tests -vTests use scalar regression vectors and synthetic experiments only. No private database, binary asset or network access is needed.
Agents should start with AGENTS.md and docs/EXPERIMENT_GUIDE.md. The design rationale and validation method are in docs/METHODOLOGY.md.
Forza and Forza Horizon are trademarks of the Microsoft group of companies.
This independent project is not affiliated with, endorsed by, or sponsored by Microsoft, Turn 10 Studios, or Playground Games. No game code, assets, logos, or user data are included.
MIT. See LICENSE and docs/PROVENANCE.md.