Repository navigation
Learn the first lap of a grid start from the start line - #156
Merged
Merged
Conversation
From the grid, FH6 restarts the lap clock at the start line but keeps packet lap 0 and records no lap time. The lap tracker read that as a clock disagreement, held, then reacquired, so the first timed lap was lost and the delta waited a lap longer. Saved-run review read the same sample as a rewind, so a saved first lap showed as partial. One rule, GridStartLine, recognises that crossing, and both the live tracker and saved-run review start the first timed lap there. A race (re)start with agreeing clocks is no longer held either. Rewinds, restarts, resets and Time Attack keep their paths. Fixes #141.
8 of 9 tasks
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
Fixes #141. On a circuit raced from the grid, Wisp loses the first timed lap. The track map stays on the run up to the line for in-game lap 1, and the lap delta waits until in-game lap 3. When automatic lap recording saves that lap, saved-run review shows it as a partial lap with no time.
Thanks to @GreenXDShadow for the report, the lap logs and the diagnosis in #141.
Root cause and solution
Root cause. From the grid, FH6 restarts the lap clock at the start line but keeps packet lap 0 and records no lap time. The race clock keeps running.
Solution.
GridStartLine.IsFirstCrossingis one shared rule for that sample: the same packet lap, no lap timed yet, the lap clock back at the line, and the race clock still running. A rewind or restart takes the race clock back too, so neither matches.Validation
All on this branch, Release configuration, .NET SDK 8.0.425:
Wisp.Core.Tests: 781 passed, 0 failed. This includes the race simulator, which now starts even seeds from a grid slot 60–120 m behind the line; its restarts begin on the line.Wisp.App.Testsfiltered to ReleaseNotes, LapRunCapture, LapDelta and LapReview: 191 passed, 0 failed.dotnet format --verify-no-changeson the changed files passes, andTest-RepositoryPolicy.ps1passes and validates the 2.7.0 release content.New tests:
FirstCrossingFromTheGridStartsTheFirstTimedLapuses the two logged crossings from [Bug] Circuit map freezes on the run to the line and the delta waits an extra lap #141 (race clock 5.884 → 5.900 s and 5.650 → 5.667 s, lap clock to 0.017 s, 92 m from the grid at 29 m/s). It checks that the lap records from the line, the map redraws without the grid run-up, the lap completes for automatic lap recording, and the next lap compares against it.RaceFromTheGridKeepsItsFirstTimedLap: a full recording has a partial grid run-up and complete laps 1 and 2 with their game lap times.AutomaticallySavedFirstLapFromTheGridIsComplete: an automatically saved first lap is one complete lap.RewindJustAfterTheGridLineStaysARewind: a rewind that takes the lap clock back near the line is still a rewind.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.
Steam and Xbox app / Microsoft Store. Both platforms send the same 324-byte Data Out packet. Wisp parses it with one layout, and neither the lap tracker nor saved-run review branches by platform, so the change applies to both.
Outstanding validation