-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use correct check for slider path extension #24848
Conversation
Currently failing this edge case due to a discrepancy between Stable and Lazer path calculation:
Slider used in the test, from #15303: Relevant methods: osu/osu.Game/Rulesets/Objects/SliderPath.cs Line 242 in 163b6df
osu/osu.Game/Rulesets/Objects/SliderPath.cs Line 282 in 163b6df
Results for the methods:
In osu/osu.Game/Rulesets/Objects/SliderPath.cs Line 267 in 163b6df
There's 2 simple ways to fix this, either exclude the starting point of each sub path in |
Doing a SR sheet for this overnight as a preliminary step. Haven't reviewed the logic closely yet, just want to see how much changes. |
Seems like diffcalc... doesn't care again? https://docs.google.com/spreadsheets/d/15Vgipe7vv7sK-4SUDwL1kj0WFE6g1v2VsPaXlIcqEoM/edit#gid=11450370 I'll have to do a manual check against stable source then... |
Ok, upon comparison with stable source I believe this is correct, although I was almost convinced it wasn't for a while... Relevant snippet: while (path.Count > 0)
{
Line lastLine = path[path.Count - 1];
float lastLineLength = Vector2.Distance(lastLine.p1, lastLine.p2);
if (lastLineLength > excess + MIN_SEGMENT_LENGTH)
{
if (lastLine.p2 != lastLine.p1)
{
lastLine.p2 = lastLine.p1 +
Vector2.Normalize(lastLine.p2 - lastLine.p1) * (lastLine.rho - (float)excess);
}
break;
}
path.Remove(lastLine);
excess -= lastLineLength;
} And yes, @Magnus-Cosmos Since you appear to somehow have access to stable source (judging by the debugger screenshots from #24708), it would be appreciated if you provided specific information as to which parts of stable specifically these types of changes are based on. It would make review much faster in the future if you should wish to continue submitting such PRs. |
// No need to calculate path when there is only 1 vertex | ||
if (segmentVertices.Length == 1) | ||
calculatedPath.Add(segmentVertices[0]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This new special case appears to be a mostly unrelated optimisation, but I can't see it being wrong and sheets are silent, so I guess I'll let it be...
Did some further checking against maps mentioned in #15109, confirmed that this change doesn't regress either case mentioned there. I can't find any more fault with this change so I'm just gonna take a somewhat calculated risk on it and hope for the best... |
Currently, Lazer uses the last two control points of a slider to check if it needs an extension:
osu/osu.Game/Rulesets/Objects/SliderPath.cs
Lines 331 to 336 in 163b6df
42196
, this discrepancy causes the sliders at46060ms
and123348ms
to skip path extension in Lazer, making the sliders shorter compared to Stable.Closes #24798.
While fixing this, I noticed that there are also some other slider length discrepancies:
I believe these issues can be ignored or addressed later, as I have yet to encounter any edge cases where these make a noticeable difference.