Repository navigation
Learn the circuit from the start line when the first timed lap begins - #153
Closed
GreenXDShadow wants to merge 3 commits into
Closed
GreenXDShadow wants to merge 3 commits into
GreenXDShadow wants to merge 3 commits into
Conversation
Owner
|
Thanks for the clear report, the lap logs and the fix, @GreenXDShadow. I'm closing this in favour of #156, which fixes #141 with the same start-line approach and also covers saved-run review: it read that first lap as a rewind, so automatically saved first laps showed as partial. #156 credits your report and diagnosis, and the fix ships in Wisp 2.7. |
Author
|
Totally missed the saved run review. Happy to contribute, and thanks for the work you do 👏 |
Owner
No worries, I'm sure next time you'll be on point! I'll be glad to add you as a contributor if you continue to help out. Thanks again for the report, and for the kind words! @GreenXDShadow |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
On a circuit, crossing the start line from the grid moves the in-game lap from 0 to 1 while the packet lap stays 0. The lap trace drawn on the way to the line stays where it is, and the car's dot keeps moving around the circuit. That whole first lap is lost. On in-game lap 2 (packet lap 1) the trace follows the car, but there is still no delta. Delta appears only on in-game lap 3 (packet lap 2).
Fixes #141.
Root cause and solution
Root cause. Forza does not increment the packet lap when the first timed lap begins. The lap clock snaps back to the line, the race clock keeps running, and the car is still driving.
LapDeltaTracker.Updatetreats that snap as a clock disagreement, returns the previous reading forHeldSamples(30), and thenReacquirekeeps the grid outline and clears the live trace.StartLaponly accepts a line start whileCurrentLapSeconds <= 0.25, so by the time the hold ends the first timed lap can no longer become the reference.Solution. Before the post-rewind hold,
SameLapLinerecognizes that one packet on lap 0: game laps, the same packet lap, last-lap time still 0, the lap clock back from above 0.25 s to at or under 0.25 s, the race clock still running within the existing 1 s gap, the car still driving, andRewindsTofalse. That packet skips the hold and callsStartLap, so the lap records from the line, the map redraws, and the lap can become the reference. A saved run keeps that lap through the existing completion path. A later line still uses the existing boundary path, because the packet lap increments. A restart is not held either: after the grid the race clock is ahead of the lap clock, and both clocks returning to zero would otherwise look like the post-rewind disagreement. Rewinds, resets, rolling starts, and Time Attack stay on their existing paths.Validation
I reproduced the bug in Forza Horizon 6 Steam on Wisp 2.6.13 (
621358e) without this change: from the grid, the trace froze for in-game lap 1 and the delta waited until in-game lap 3. With this change on the same Steam version, the trace followed the car from the start line and the delta showed on the next lap. Time Attack and a rewind also behaved correctly with the fix.LapDelta.cson currentmain(e354871) is unchanged since October 2 apart from this commit.Locally, on
fix/grid-start-line(0c59313), with SDK 8.0.426 (satisfiesglobal.json8.0.425 withlatestPatch):dotnet restore Wisp.sln --locked-mode -p:NuGetAudit=true -p:NuGetAuditMode=allpassed.dotnet format Wisp.sln --verify-no-changes --no-restorepassed.dotnet test Wisp.sln --configuration Release --no-restore --nologo --disable-build-servers -m:1 -p:UseSharedCompilation=falsedid not fully pass.Wisp.Core.Tests778 passed, includingSameLapLineSnapStartsTheLearningLapfor the logged crossings5.884 → 5.900and5.650 → 5.667, andRaceSessionsAgreeWithTheGamewith grid starts on even seeds.Wisp.Telemetry.Tests96,Wisp.Update.Tests144,Wisp.Updater.Tests75.Wisp.App.Testshad 1 failure:TachDiagnosticsTests.EnabledNeedleRecordingReportsOfflineCostWithoutATimingThreshold(expected 0 allocated bytes, actual 7112, on .NET 8.0.32). That test does not use the lap tracker. Run on its own, it passed on unmodifiedmainand on this branch.py -3 -m unittest discover -s tools/tests -p "test_*.py" -vpassed: 157 run, 2 skipped, 0 failed, using PowerShell 7.6.7.The change is within the approved scope.
The change improves usability, functionality, feel, reliability, or maintenance, or fixes a verified bug.
I have read and agree to the contributor-rights terms in
CONTRIBUTING.md.Regression coverage has been added or updated where appropriate.
Steam and Xbox app / Microsoft Store impacts, checks, and outstanding gaps are recorded separately as required by
docs/VALIDATION.md.The complete Release test suite passes.
No credentials, personal data, machine paths, game binaries, save data, private captures, or generated output are included, except matching shader bytecode for an approved shader change described in
docs/SHADERS.md.User-facing changes are recorded in
CHANGELOG.md.Native HUD assets are unchanged, or their distribution rights, provenance, and hashes are documented.
Outstanding validation
Wisp.App.Testsfailure above. An isolated rerun passed onmainand on this branch. CI on the pull request is the remaining full run.RaceSessionsAgreeWithTheGame, including after a grid start.