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

Add star rating to the beatmap metadata in player loading screen #12717

Merged
merged 29 commits into from
May 15, 2021

Conversation

frenzibyte
Copy link
Member

@frenzibyte frenzibyte commented May 8, 2021

Closes #12414

Went with the simplest way of adding a StarRatingDisplay, as desired in the issue thread, looks harmonious enough.

CleanShot.2021-05-08.at.11.33.54.mp4

(in case it isn't obvious, this is from a test scene, not from game)

Follows the way working beatmap is passed, not sure why mods are passed as a bindable though, don't wanna bother too much with that.
@bdach
Copy link
Collaborator

bdach commented May 8, 2021

the test scene is showing a one-frame flicker when the mods are starting to display.

2021-05-08.14-34-06.mp4

you can slow down to 0.1x or something to see it better.

osu.Game/Screens/Play/BeatmapMetadataDisplay.cs Outdated Show resolved Hide resolved
osu.Game/Screens/Play/BeatmapMetadataDisplay.cs Outdated Show resolved Hide resolved
osu.Game/Screens/Play/BeatmapMetadataDisplay.cs Outdated Show resolved Hide resolved
Comment on lines 111 to 113
background.Colour = difficulty.DifficultyRating == DifficultyRating.ExpertPlus
? ColourInfo.GradientVertical(Color4Extensions.FromHex("#C1C1C1"), Color4Extensions.FromHex("#595959"))
: (ColourInfo)colours.ForDifficultyRating(difficulty.DifficultyRating);
Copy link
Collaborator

Choose a reason for hiding this comment

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

not super sure about the lack of any sort of fade out transition here

Copy link
Member Author

Choose a reason for hiding this comment

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

to clarify, you mean fading colours of the background?

Copy link
Collaborator

Choose a reason for hiding this comment

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

that, and the text sprites

Copy link
Member Author

@frenzibyte frenzibyte May 8, 2021

Choose a reason for hiding this comment

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

I've added proper transitioning along with rolling counter for the star rating display, I can imagine cases where the difficulty would need time to calculate before its shown, which would look bad on the player UX if it hides and shows back, moving the entire metadata flow back and forward.

CleanShot.2021-05-08.at.23.10.03.mp4

Not sure on the design of the placeholder though.

Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure why this was added in this PR, but it's weird due to the font being right aligned and not fixed width.

Copy link
Member Author

Choose a reason for hiding this comment

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

Using fixed-width made it look really weird so I refrained from doing that, and I thought it wasn't that big of a change to split it, but can do.

Copy link
Member

Choose a reason for hiding this comment

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

Well it's affecting a global component and you've updated it in a local usage. There's nothing to say you actually checked how this works in every other usage.

I'm not saying it should be fixed width, but if anything it should not be right aligned and should definitely not affect the size of the parent container to the point it's bouncing around.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not really sure about how to fix this, I've checked fixed-width one more time to record a video of it and the results are indeed not appealing: (especially with 1.23 due to font being right-aligned as you mentioned)

CleanShot.2021-05-10.at.07.37.51.mp4

Also fixing the width of the star rating display to 60px makes it look a bit questionable:

CleanShot.2021-05-10.at.07.49.16.mp4

The StarRatingDisplay in general looks to be designed to not be changeable and make the numbers roll around, not sure how to proceed forward without leaving this as-is (or going with the second option of fixing width to 60px).

Copy link
Member

Choose a reason for hiding this comment

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

Fixed width looks okay I think. If it's decided it doesn't then the numbers should not roll in the first place.

Copy link
Member Author

Choose a reason for hiding this comment

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

It shouldn't update all the time, only when the difficulty calculation is heavy, so I think it's fine to remove the rolling altogether and call it a day for this design.

@frenzibyte
Copy link
Member Author

frenzibyte commented May 8, 2021

the test scene is showing a one-frame flicker when the mods are starting to display.

2021-05-08.14-34-06.mp4

you can slow down to 0.1x or something to see it better.

Resolved with initial fade in on test scenes, the underlying issues can be dealt with later on. (if I were to suggest a temporary resolution, the fading container in ModDisplay should have AlwaysPresent = true)

@peppy peppy self-requested a review May 10, 2021 03:25
}

[Test]
public void TestRandomFromDatabase()
Copy link
Member

Choose a reason for hiding this comment

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

really not sure about adding more test scenes which depend on the local beatmaps to function correctly

Copy link
Member Author

Choose a reason for hiding this comment

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

added it to check how metadata would look on real local beatmaps, and I imagined it to be useful for others (especially when it comes to tweaking the design).

unless you think it's better not to rely on local databases all the time and always go with the option of adding programmatically written beatmaps.

peppy added 4 commits May 10, 2021 12:34
Makes no sense to add a test intended to test visual behaviour with one
of the main elements missing. Not sure how you would be able to test the
flow with the logo's presence.
@peppy
Copy link
Member

peppy commented May 10, 2021

I've made some preliminary changes to the test scene to make it behave more like how it does within the game. Also added back the logo.

@frenzibyte
Copy link
Member Author

FWIW I've added the ruleset steps to be able to see the difficulty changing in the beatmap metadata display, simulates the case where star difficulty for a certain beatmap may take some time before the calculation finishes.

But it's a small benefit and can only be useful in the TestRandomFromDatabase test case, so no problem in removing it.

@peppy
Copy link
Member

peppy commented May 10, 2021

Make a test specifically for the star difficulty display, in the same PR where you split that functionality out.

Also make sure it's done in a way it doesn't cause the test scene to display nothing on first load. You probably want one [Test] per ruleset or something like that.

@frenzibyte
Copy link
Member Author

Just to be extra clear, can you elaborate more on that? do you mean writing a new test scene that hooks up a star rating display to a bindable difficulty from the cache, on a written beatmap, to ensure it works?

@bdach
Copy link
Collaborator

bdach commented May 10, 2021

simulates the case where star difficulty for a certain beatmap may take some time before the calculation finishes

That's the same thing as not setting difficulty initially and then setting it later after a delay, right? In that case, why not just skip interfacing with any beatmaps or difficulty caches whatsoever - or am I misunderstanding the intent?

@frenzibyte
Copy link
Member Author

frenzibyte commented May 10, 2021

That is right, but I don't want to hack around with the BeatmapMetadataDisplay to allow the tests to change/set the star difficulty when they want (currently the display gets them directly from the cache, and nothing else), but I could make that happen with an altered difficulty cache that waits for TaskCompletionSource, probably the easiest solution.

@peppy
Copy link
Member

peppy commented May 11, 2021

It's fine as is, but this PR still needs the removal of the animated counter.

peppy
peppy previously approved these changes May 15, 2021
Copy link
Member

@peppy peppy left a comment

Choose a reason for hiding this comment

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

seems fine for now

Shouldn't guard against that here.
@peppy peppy merged commit 50a3775 into ppy:master May 15, 2021
@frenzibyte frenzibyte deleted the player-loader-star-rating branch May 15, 2021 09:28
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.

Add star rating to be visible in player loader screen
4 participants