ppy / osu

rhythm is just a *click* away!
https://osu.ppy.sh
MIT License
14.65k stars 2.17k forks source link

Mania note snap color #8583

Closed KoleckOLP closed 3 years ago

KoleckOLP commented 4 years ago

Screenshot_20200402_213536 Above screenshot is from another VSRG.

explaining color: 4th notes = red 8th notes = blue (except those that are already assigned red for exmample 2/8, 4/8...) 12th notes = purple (except those that are already assigned red or blue 3/12, 6/12...) and so on

It's easier to read if specific snapping is colored differently, It could be some option in new osu!mania skinning. Coloring notes in osu!standart we have option of picking color for our skin. I bet something like that could be on option for mania.

smoogipoo commented 3 years ago

Bumping in priority for now since mania users have requested this for years and it's definitely something that needs to happen.

JustusFT commented 3 years ago

Hi, person who's new to the osu codebase here :wave:. So I took a look into implementing this feature. Here's what it looks like so far. It's still incomplete though (that's why I didn't put up a PR)

osu_2021-04-17_14-44-06 osu_2021-04-17_14-44-26

I'm using the same colors that stepmania uses. Here's the colors for reference:

Type Color
1/4 Red
1/8 Blue
1/12 Purple
1/16 Yellow
1/24 Pink
1/32 Orange
1/48 Light Blue
1/64 Lime
Everything else Gray

From what I can tell through the beatmap editor, all the snap options are covered by the above table, so I believe that there are no gray notes in any of the ranked beatmaps so far.

So about my implementation: AFAIK there's no snap data in the .osu file, just the times when to hit them. So in order to get the snap, I have to calculate it by checking which color is the closest based on the hit time. Since I'm working with doubles it may be possible that this might give a wrong color due to precision error. But if we assume there's no gray notes this is not really a problem, just pick the closest non-gray color.

But it looks like you guys will be adding odd timing signatures, see this issue: https://github.com/ppy/osu/issues/2316

If that gets added, then notes should be gray if they are not "close enough" to anything in the above table. I'm not sure how much millisecond difference is reliably "close enough" though.

For example: if a song is 60BPM, a red note plays every second. So a red note could appear at 1s, a note blue note at 1.5s, a yellow at 1.25s, etc. But what about 0.99s? Should it round up to 1s and be red or should it be gray?


So yeah, just putting this out here if anyone else is considering a similar approach

I think a better approach would be to add the timing data for each note in the .osu file instead, what do you guys think?

peppy commented 3 years ago

We already have algorithms to handle snap coverage in the editor. Also, I believe the colours should match the editor specifications by default. And use the same code as possible.

Naxesss commented 3 years ago

I'm not sure how much millisecond difference is reliably "close enough" though.

I'd use the same threshold the Ranking Criteria uses, so < 2 ms from the closest beat divisor.

Reason for 2 ms is that stable has rounding errors when copy-pasting that commonly cause 1 ms unsnaps, and slider ends are already decimally snapped causing that to become 1.X unsnaps instead.

bdach commented 3 years ago

As a side note:

I think a better approach would be to add the timing data for each note in the .osu file instead, what do you guys think?

I believe that the "legacy" file formats (.osu/.osr/.osb) are feature-locked and adding new features to them should be avoided until a new (hopefully better) format is in place.

peppy commented 3 years ago

In addition, nothing like that is required. Just snap to nearest snap and colour based on that?

JustusFT commented 3 years ago

In addition, nothing like that is required. Just snap to nearest snap and colour based on that?

Yeah we could do that, but if a note is aligned to a weird beat, I think we should make it gray like how other 4key games do it. For example: a 1/7 beat. The closest snap to 1/7 is a 1/64 note (lime color), its pretty close but not exact. I think it might be confusing to players coming from other 4key games, but I'm no pro 4key player so I'm not sure.

peppy commented 3 years ago

In osu!, at least for ranked beatmaps, no such hitobjects exist as the are considered incorrectly timed by the ranking criteria.

JustusFT commented 3 years ago

In that case, the color table from my first comment should be sufficient.

Side note: I noticed there's a PR that adds some more divisors like 1/7: https://github.com/ppy/osu/pull/2403 If a new divisor becomes rankable, then all I need to do is add it to the table. So gray notes won't be a problem :smile: (Edit: The editor already has it's own color table so I'm using that instead now)

peppy commented 3 years ago

Implemented via #12558.

puyoxyz commented 1 year ago

Implemented via #12558.

this has probably already been said somewhere but i'm still gonna say it:

this is a good start, but it's missing a few things

peppy commented 1 year ago

The last two are already possible via skin.ini. The first is discussed in the PR thread as being left for a future implementation.