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 argon/classic osu!mania combo counter #26254

Merged
merged 23 commits into from
Aug 15, 2024

Conversation

frenzibyte
Copy link
Member

@frenzibyte frenzibyte commented Dec 30, 2023

Adds support for classic osu!mania combo counter, as well as a very basic implementation for "Argon" skin to increase its usability (cc @peppy for adding animations to the argon one if wanted).

This does not include turning the combo colour to yellow during a hold note, especially since hold notes don't have ticks anymore, which makes the yellow state look odd.

Preview:

CleanShot.2023-12-30.at.07.25.25-converted.mp4

Argon preview (again, not final):

CleanShot.2023-12-30.at.07.34.03-converted.mp4

@mcendu
Copy link
Contributor

mcendu commented Jun 13, 2024

I think this can be used for taiko as well?

@frenzibyte
Copy link
Member Author

Yes but it's not in scope of this PR.

/// Whether this component supports the "closest" anchor.
/// </summary>
/// <remarks>
/// This is disabled by some components that shift position automatically.
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

What's an example of this? I don't quite understand.

Copy link
Member Author

Choose a reason for hiding this comment

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

Disabled by LegacyManiaComboCounter because its position is shifted when the user flips the scrolling direction. I don't recall why though.

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 seems like an odd choice. So the user can still choose an anchor and it will just flip? I'd say that closest should still be allowed and the flip is only applied if the counter is in a certain region of the screen (or have a certain anchor applied).

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've removed this for now as I can't really understand why it is required. It would make more sense to completely disable anchors (or a certain subset) but honestly I'd just leave this up to the user, and adjust the automatic flipping logic to only work in the cases where it makes sense.

/// <summary>
/// Uses the 'x' symbol and has a pop-out effect while rolling over.
/// </summary>
public partial class LegacyDefaultComboCounter : LegacyComboCounter
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 honestly not sure this abstraction was required. Could have just copy-pasted and spent less effort? And potentially had more maintainable / legible code.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure.

Copy link
Sponsor Member

Choose a reason for hiding this comment

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

No need to change it at this point, I'll do so if the review is painful enough.

@peppy peppy self-requested a review August 9, 2024 04:37
@peppy peppy force-pushed the mania-combo-counter branch 2 times, most recently from 08df05c to b95e05f Compare August 9, 2024 06:14
This may have had a good reason to be added, but I can't find that
reason, so let's keep things simple for the time being.
Comment on lines +26 to +27
// two schedules are required so that updateAnchor is executed in the next frame,
// which is when the combo counter receives its Y position by the default layout in ArgonManiaSkinTransformer.
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

really dunno but willing to overlook for now because it works.

@peppy
Copy link
Sponsor Member

peppy commented Aug 9, 2024

@frenzibyte I've made sizable changes to this PR. Want to give it a once-over?

peppy
peppy previously approved these changes Aug 9, 2024
@peppy peppy self-requested a review August 9, 2024 08:18
Copy link
Member Author

@frenzibyte frenzibyte left a comment

Choose a reason for hiding this comment

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

Combo counter does not seem to show up on argon skin:
CleanShot 2024-08-10 at 11 20 20

I also kinda don't like the "x" symbol in the argon counter, looks weird when it's placed on top of the playfield. Would try to remove it.

It's also incorrectly pushed away on classic skin:
CleanShot 2024-08-10 at 11 19 44

@peppy
Copy link
Sponsor Member

peppy commented Aug 10, 2024

Combo counter does not seem to show up on argon skin

can you look into this? it shows fine here.

@frenzibyte
Copy link
Member Author

frenzibyte commented Aug 12, 2024

I began investigating this and posted some observations in discord until all of a sudden everything started working again and I have no idea why. See #26254 (comment)

Comment on lines 33 to 34
Anchor &= ~(Anchor.y0 | Anchor.y2);
Anchor |= direction.Value == ScrollingDirection.Up ? Anchor.y2 : Anchor.y0;
Copy link
Member Author

Choose a reason for hiding this comment

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

The legacy part handles the case where the anchor is set to center, but this one doesn't?

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 didn't change this 🙈

Copy link
Member Author

Choose a reason for hiding this comment

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

Whoops 😅

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've updated this to match but there still seems to be something weird going on here.

  • Set scroll direction to "Down"
  • Put the combo counter near the bottom of the screen
  • Change scroll direction

The combo won't move the first time changing direction.

Copy link
Member Author

@frenzibyte frenzibyte Aug 15, 2024

Choose a reason for hiding this comment

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

Alleviated the issue in 66adddb. This is the reason why "Closest" anchor was disabled in this PR (in response to #26254 (comment)).

To explain briefly, I am using the sign of the Y coordinate as an indicator for whether the combo counter is in the correct position or not. When the scroll direction is "Down", the anchor is set to top and the Y position is made sure to be positive. When the scroll direction is "Up", the anchor is set to bottom and the Y position is made sure to be negative.

When the "Closest" anchor is selected, if the user moves their combo counter from top to bottom or vice versa, the anchor will change, and defies everything that the logic above does, therefore breaking apart.

@frenzibyte
Copy link
Member Author

frenzibyte commented Aug 12, 2024

As you touched on in discord, it turns out that the cause of this issue is that I had "beatmap skins" enabled, which makes the beatmap skin layer return a LegacyComboCounter with a zero combo position.

The reason why the combo position is zero is because of the lookup only happening on the beatmap skin layer, and the beatmap skin layer disables mania lookups entirely (see AllowManiaConfigLookups override), therefore the fallback value in the lookup line (which is 0) is assigned and therefore the combo counter is stuck at the top.

I'm not sure what is the best way to solve this, one way could be to use the isLegacySkin flag which determines whether the skin is user or beatmap and then return null when returning the default mania HUD layout if it's a beatmap skin, but I'm not really sure that's a good way to handle things.

peppy
peppy previously approved these changes Aug 15, 2024
@frenzibyte frenzibyte dismissed peppy’s stale review August 15, 2024 08:56

The merge-base changed after approval.

@peppy peppy merged commit 5710f0f into ppy:master Aug 15, 2024
13 checks passed
@frenzibyte frenzibyte deleted the mania-combo-counter branch August 15, 2024 12:27
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.

Mania LegacyComboCounter get a shadow backdrop when counter increases
3 participants