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 automatic generation of breaks in editor #28528

Merged
merged 12 commits into from
Jun 19, 2024
Merged

Conversation

bdach
Copy link
Collaborator

@bdach bdach commented Jun 19, 2024

2024-06-19.11-53-32.mp4

Breaks are automatically inserted between objects if there is ample time to do so, namely there must be at least:

  • 200ms between the last object before break and the break's start
  • 650ms for the break itself
  • 2 beat lengths between the break's end and the first object after break. This is a departure from stable wherein this was ruleset- and AR-dependent (by way of using preempt time), but in talking with the NAT it looked like most didn't know the specifics of how that worked so I decided I'd just use something simpler. This also probably works better for something like mania wherein the "preempt time" is largely user-settings-dependent (scroll speed).

Breaks that have been manually adjusted are not moved by the automatic regeneration on changes, unless they would break gameplay (by having an object's duration intersect a break), in which case they are forcibly removed. This manual adjustment tracking state is dodgy at best (will not work properly with undo/redo, because this info is not and should not be serialised out by the legacy beatmap encoder, which means that the manual tracking will be dropped upon undo), but it is what it is. That subsystem needs to get replaced by something else at some point anyway.

No manual add/remove of breaks right now, I'm mostly hoping we won't have to add it with this in (but will do if people request it for whatever reason I guess).

Code size is on the larger side but ~300 lines is tests so...

@bdach bdach changed the title Add automatic generation of breaks Add automatic generation of breaks in editor Jun 19, 2024
@bdach bdach self-assigned this Jun 19, 2024
peppy and others added 2 commits June 19, 2024 21:49
CodeFileSanity doesn't like records and it being a record wasn't doing
much anymore anyway.
@peppy peppy self-requested a review June 19, 2024 13:05
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 ok

@peppy peppy merged commit 9eb6752 into ppy:master Jun 19, 2024
7 of 11 checks passed
@bdach bdach deleted the break-autogeneration branch June 20, 2024 05:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Break time needs to be added when editing a beatmap
2 participants