Skip to content
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

Rewrite osu!taiko playfield adjustment container to keep playfield height constant #26631

Merged
merged 7 commits into from Jan 26, 2024

Conversation

frenzibyte
Copy link
Member

@frenzibyte frenzibyte commented Jan 19, 2024

This arose from #26615 and few discord discussions.

Up until now, osu!taiko's playfield scaling was completely dependent on each component inside it, which was suboptimal for essential components like the "input drum", requiring to set a fill aspect ratio to appear correctly across different game resolutions.

Not only was it an issue with sizing, but also with offsetting components. To properly have a constant gap applied between the input drum and the hit target position, the hit target would have to have an X position that's proportionate to the input drum's width (because the input drum's width changes based on the game resolution, because the playfield height changes based on the game resolution, etc.).

Not to mention TaikoPlayfield having to apply the container paddings per update and LegacyInputDrum needing to scale itself.

All of this is now gone and simplified by simply making TaikoPlayfieldAdjustmentContainer directly upscale the playfield instead of changing its height.

Worthy of note that despite everything seemingly working well, there are changes like fa2c33c which I'm frankly not 101% sure how they contribute to the correctness of the new logic, but it makes this PR match master on all different aspect ratios, therefore I pushed it.

Comparison with no mod (osu! is latest release, osu!development is this PR):

CleanShot.2024-01-20.at.00.29.50-converted.mp4

Comparison with classic mod:

CleanShot.2024-01-20.at.00.31.37-converted.mp4

Children = new Drawable[]
{
new Container
{
Name = "Elements before hit objects",
RelativeSizeAxes = Axes.Both,
FillMode = FillMode.Fit,
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line alone sells me on this PR.

@peppy peppy self-requested a review January 22, 2024 09:15
Y = height;
Y = relativeHeight;

Scale = new Vector2(Math.Max((Parent!.ChildSize.Y / 768f) * (relativeHeight / base_relative_height), 1f));
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty sure this can be simplified, but not going to attempt that until we're first in a good state (ie. your PRs merged + #25919 is resolved).

@peppy peppy self-requested a review January 25, 2024 11:54
@pull-request-size pull-request-size bot added size/L and removed size/M labels Jan 25, 2024
@OliBomby
Copy link
Contributor

As far as I can tell this visually looks exactly the same as on master. I checked it on multiple resolutions scales with my ultrawide monitor and second monitor. So seems good!
osu!_cYfLciEPtD
osu!_AqFzE5N6ek

I compared these two screenshots from master and this PR and the positioning is pixel perfect.

@peppy
Copy link
Sponsor Member

peppy commented Jan 25, 2024

As mentioned on discord, TestSceneTaikoPlayfield needs some probable updating. I think it's likely doing something we'd never expect from gameplay, but still looks very wrong right now.

@peppy peppy merged commit e78f0bc into ppy:master Jan 26, 2024
15 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants