Full notes
Full City-Racing update
Read the full published notes in a cleaner layout. The original post stays linked below.
What changed
- Gameplay
- Fixes
City-Racing changes
🏎️ Recap: What We Just Did to CRAILearningSystem.cs
Here's a breakdown of the three big upgrades and why each one makes the AI noticeably better.
---
🗑️ Killed the global minWaypointSpeed / maxWaypointSpeed
Before: Every car on every track was hard-clamped between two magic numbers (e.g. 30–250 km/h) in the inspector. A Formula car and a city sedan got the same ceiling, and a tight roundabout had the same floor as a freeway.
After: Bounds are derived per-waypoint from baseSpeed (the designer-tuned value cloned into the per-car / dynamic container):
·Sharp corners: ceiling shrinks toward 0.85 × baseSpeed
·Straights: ceiling opens up to 1.4 × baseSpeed
·Floor: 0.4 × baseSpeed
Why it's better: The dynamic per-car waypoints are now the single source of truth for "how fast is reasonable here." No more babysitting two sliders per scene/car combo, and a hairpin literally can't be clamped at the same number as the back straight.
---
🧠 Predictive Backward Braking — the actual cornering fix
This is the big one. The complaint was"cars at 100 mph just plow to the middle of the road and never make the turn."That happens because the AI was only braking at the corner, not before it.
New method: PropagateCornerBrakingBackward(currentWP) — runs every frame after ApplyLearnedSpeedsAhead().
It walks cornerLookAhead waypoints out (default 8) and, for every adjacent pair, enforces a physical braking budget:
prevWP.targetSpeed ≤ aheadWP.targetSpeed + (distance × maxBrakingPerMeter)
…and sharper corners shrink that per-meter budget, so steeper turns force earlier brake points.
Crucially, the lower ceiling is written back into learningData[prevWP].optimalSpeed — so the car remembers the new brake point next lap instead of re-discovering it by overshooting again.
Why it's better:
·A 90° corner learned at 50 km/h now automatically drags the previous 1–8 waypoints down to a deceleration curve the car can physically achieve.
·High-speed cars finally make the turn instead of understeering across the centerline.
·It's a physics-aware look-ahead, not just "copy the speed onto the next 2 waypoints."
---
💾 Save / Restore now includes Corner Detection + Learning History
Before: Only optimalSpeed was persisted. Corner classification, sharpness, best offset, navigation count, and good/bad streaks were all thrown away on scene reload — so the car effectively started from scratch every race.
After — PassData now persists:
· baseSpeed
· isCorner + cornerSharpness
· bestOffsetAchieved
· averageOffsetFromCenter
· timesNavigated
· consecutiveGoodPasses / consecutiveBadPasses
ApplyLoadedLearningData() restores all of it and immediately stamps the learned speeds onto the per-car waypoints, so the AI is racing at its learned pace from frame 1.
Why it's better:
·The corner "memory" survives scene reloads, restarts, and car swaps.
·Saved data is keyed by trackName + vehicleName, so each car has its own learning per track — exactly matching the per-car/dynamic waypoint container Waypoints, {Scene}, {Car}.
·Old save files still load (new fields just default to 0/false until the next save).
---
🚀 Net Result
[table equalcells="1" colwidth=",,"]
---
🔮 Where to go next (low-hanging fruit)
· Tune maxBrakingPerMeter per car class (a sports car can shed 2.0 km/h/m, a truck maybe 0.8).
· Save speedTrendUp/Down too, so the "confidence" momentum survives reloads.
· Visualize the brake propagation in OnDrawGizmos — draw a colored line from each waypoint's pre-propagation speed to its post-propagation speed, so you can see where the AI brakes.
· Auto-tune sharpCornerAngle per track based on average corner geometry instead of a fixed 35°.
We are stoked — this is exactly the kind of foundation where each lap genuinely makes the AI faster. 🏁
Created/Developed By Anton Opic & Copilot Claude OPUS 4.7 7x 4/23/2026
Source
Changelog.gg summarizes and formats this update. How we read updates.
