-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Make NodeSamples editable #23443
Make NodeSamples editable #23443
Conversation
@OliBomby hoping to get to this soon, but just to confirm forward direction (I think we may have discussed this so forgive me): This is adding parity back, but the end goal will be to split the "addition bank" to be applied on a per-sample level, correct? This will have implications on the UI when we get to that point (basically the stuff in this PR will be replaced), so I'm curious if you already explored that direction and confirmed it's going to be a much larger scoped change before we go ahead with this smaller piece. |
A few initial things: Please check 114f12a. I've moved the local logic of deciding which bank to use on creating new additions to the common method, since it felt awkward doing the same thing in multiple places when this method was intended to cover those cases. Maybe a limitation of the implementation, but attempting to change the addition bank when there are no additions present will reset it back to the "normal" bank. Either this needs to be fixed, or the text box should be disabled when there are not yet any additions. I'd probably go with the latter as it feels like a better UX. osu.2023-05-30.at.05.07.42.mp4There's no test coverage of the new behaviour. It'd be nice to have at least a bit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initial pass, see attached feedback.
Yes, the intention is to eventually replace this UI so you can apply banks on a per-sample level. The reason I didn't go that direction yet is because the file encoding hasn't quite caught up yet, so saving banks on a per-sample level isn't possible with the legacy encoder. The purpose of this PR is to bring parity with stable so people can edit hitsounds just like on stable (minus the custom samples). |
Cool, we're on the same page then. Make sure to review my follow-up comment with some actionable feedback. |
@Speykious I guess making it a dropdown is alright, since the purpose right now is only to bring parity with stable. Though eventually it will need to be a textbox again.
I don't think this bank context menu is necessary in the first place. You can just use the hitsound sample point thingy below the object on the timeline.
@peppy Thank you for reviewing my PR! I agree with the changes, this is much cleaner.
Yeah it's impossible to add an additions bank when there are no additions to add the bank to. I agree with disabling the option in such case.
I'll add some simple test cases to make sure that using these controls actually updates the hitsounds. @peppy Should I invert the colours of the sample point pieces on sliders? so the pieces on node samples are pink and the piece for the main hitobject |
Can you take a screenshot showing what you mean? |
I'm aware that there are always two sample point pieces overlapping at the sliderhead. I'm not really sure what to do about that. You could make them narrower and put them next to eachother like in my follow-up PR, or merge them into one piece somehow, or just remove the piece for the sliderbody bank entirely. |
I just realized 114f12a broke some special logic in Also I cant disable the additions bank textbox. When clicking a sample point piece with no additions you want the addition bank textbox to be disabled and show the value it would get once an addition is added in gray. However if you disable the textbox when the drawable is created it will throw an exception because the textbox tries to change the bindable value on its |
@Tais993 work not on https://github.com/orgs/ppy/projects/13 is currently being heavily deprioritised. I hope you understand. |
@OliBomby wanna fix conflicts on this one just to keep it up-to-date? |
Sure |
@OliBomby I fixed conflicts here, please double check resolution. |
// As per stable, all non-normal "addition" samples should use the same bank. | ||
if (sampleName != HitSampleInfo.HIT_NORMAL) | ||
{ | ||
if (Samples.FirstOrDefault(s => s.Name != HitSampleInfo.HIT_NORMAL) is HitSampleInfo existingAddition) | ||
return existingAddition.With(newName: sampleName); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain why this change was made in this PR and what it impacts?
It does not seem immediately relevant or useful for the stated goal of it ("making node samples editable"), and I am going to have to go double-check stable to confirm that whatever this is claiming is true, which I'm not even sure how to do right now because my brain immediately shuts down at the word salad that is the comment attempting to explain this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change was made by @peppy
It seems to be a code duplication cleanup for logic that determines the correct bank to apply to a new hitsample. For example if you are making a new hitwhistle sample which is an 'addition', then this code tries to find an existing addition sample to take the bank name of.
In stable, all addition samples have the same bank, because you can only set one bank for all addition samples. This doesn't have to be true in lazer, but currently lazer behaves the same as stable for this in that you can only set one bank for all addition samples.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplication from where though? If it was deduplication I'd expect the same chunk of code to be gone from somewhere else. But I haven't seen any of that in this diff.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Read #23443 (comment) for the reasoning.
I think this PR introduced the need for the chunk of code that was duplicated and subsequently deduplicated, that's why you don't see it in the final diff.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well the thing is that I'm not confident that it's a safe change to make. Yes CreateHitSampleInfo()
is frequently used in editor contexts, but it also is frequently used in non-editor contexts. Such as:
: new SpinnerBonusTick { StartTime = startTime, SpinnerDuration = Duration, Samples = new[] { CreateHitSampleInfo("spinnerbonus") } }); |
osu/osu.Game.Rulesets.Taiko/UI/DrumSampleTriggerSource.cs
Lines 43 to 52 in a8a2e54
var baseSample = hitObject.CreateHitSampleInfo(hitType == HitType.Rim ? HitSampleInfo.HIT_CLAP : HitSampleInfo.HIT_NORMAL); | |
if (strong) | |
{ | |
PlaySamples(new ISampleInfo[] | |
{ | |
baseSample, | |
hitObject.CreateHitSampleInfo(hitType == HitType.Rim ? HitSampleInfo.HIT_WHISTLE : HitSampleInfo.HIT_FINISH) | |
}); | |
} |
So as far as I can tell this probably changes sample playback behaviour for some objects. So I'd like to know whether this was a change made specifically for the editor flows, or something that is supposed to be valid for everything everywhere.
@peppy mind providing context / commentary on this when able?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did some analysis:
It seems the change allows SpinnerBonusTick to receive an addition bank if the spinner has additions.
This is probably incorrect because spinnerbonus-max and spinnerspin seem to both always use the primary bank.
For taiko Hit and StrongableHitObject, this change allows clap and finish samples added by the Type and IsStrong bindables to use the addition bank.
I think this change is desirable in this case because the user is able to change the addition bank (since this PR), so probably expects all the whistle, clap, and finish samples to have the same addition bank. It would be weird if for example the user sets the clap sample to the normal bank, sets IsStrong to true, and finds a finish sample with the soft bank from the primary bank.
For DrumSampleTriggerSource, this change makes it possible to play the rim and centre samples on different banks if the most valid object has different primary and addition banks. It adds a little bit of mapper intention but maybe we don't want this.
I'm not familiar with taiko hitsounding, but it seems like taiko always plays a single sample per hit so having two different banks on the same object might be a silly idea. If that's the case then we should probably go back and always take the bank of the hitnormal in taiko.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I looked into this myself a bit further and well.....
Here's a test map that I did: Moderat - Rusty Nails - Copy.zip
The thing to note here is that I had all of the sample files just be a speech synthesizer that says the name of the bank. As such:
- For the spinner thing, now I believe it to be an irrelevant concern because stable did not support banks for
spinnerbonus
at all. So the fact this even works is a lazer-only thing and not really advertised as supported anywhere, so I'm fine with leaving it as "undefined behaviour". - For the taiko thing... well let's just say neither
master
nor this PR appear to follow what stable does.- On stable, I can't get the drum to produce anything audible other than "normal". Which means stable does not appear to care about sample bank on individual objects at all. The only thing that appears to have an effect there is the "default sample settings" list thing in setup (it'll be all normal, all soft, or all drum, always).
- On
master
, every object with additions will follow its "primary" /hitnormal
bank, - while on this branch, every object with additions will follow its "addition" bank.
I'm not sure what to think of the taiko thing. I'll go ask the taiko NAT maybe for some advice because I'm stupid and know nothing about mapping, but I'm not sure this needs to be a blocking concern for this PR.
With that said I'm going to just probably be looking to get this in and address any issues later. @ppy/team-client any objections to that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what to think of the taiko thing.
As far as I've experienced, taiko players they expect to hear a taiko drum sound and hitsounds either take a backseat being "whatever" or (as we did in lazer) are more present to the point of annoying them.
With that said I'm going to just probably be looking to get this in and address any issues later. @ppy/team-client any objections to that?
Sounds fine.
osu.Game/Screens/Edit/Compose/Components/Timeline/TimelineHitObjectBlueprint.cs
Outdated
Show resolved
Hide resolved
updateAdditionBank(val.NewValue); | ||
updateAdditionBankPlaceholderText(); | ||
}); | ||
additionBank.OnCommit += (_, _) => updateAdditionBankText(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not much has simplified here. Speaking from personal experience (and I've made the same mistake myself), having multiple update methods like updateAdditionBankText
and updateAdditionBankVisual
and updateAdditionBank
(with a bool) is not good news. Ideally you'd want just one updateState
that gets everything correct.
Can you explain what the issues are here before I try and go in with a hammer to simplify this?
…o edit-nodesample
I felt that the contrast with this between the dark pink bg and the black text was pretty dreadful so I lightened it up a touch in 7d5dc75: The only remaining concern to me with this is this review thread. If we can revert this change / localise it to the editor, or justify its correctness in all contexts somehow, then I think this is good to go. |
I like the change to the contrast of the alternative colour.
I'll look into it to see what this change exactly means for all the usages of this method. |
…while not having an editable addition bank
@@ -76,6 +76,8 @@ protected override void CreateNestedHitObjects(CancellationToken cancellationTok | |||
{ | |||
base.CreateNestedHitObjects(cancellationToken); | |||
|
|||
this.PopulateNodeSamples(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is every single implementation of CreateNestedHitObjects
going to have to call this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Every IHasRepeats
would need to I suppose. Not entirely sure how to fix that without introducing eldritch abstract entities.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@smoogipoo do you have strong opinions on this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not at the moment, no
One other thing I didn't really consider (which was pointed out to me in a reddit discussion) is that this UI does not work with buzz sliders: @OliBomby thoughts on how we can remedy this? I wouldn't block this PR over this but yeah. |
I can think of a few workarounds but the UX leaves a lot to be desired. As a workaround you can zoom in really far in the timeline to create more space so the sample points dont overlap anymore. The information density of buzz sliders is pretty hard to handle on the timeline. Maybe a fix could be to merge the sample point pieces into a single expanding box whenever they overlap too much. Clicking it would then expend it down vertically and show every node to be edited. This still would work for super long buzz sliders though. Other idea could be to cycle between overlapped sample point pieces by clicking in the same spot multiple times. It would need an extra indicator to make it clear which samples are currently open. |
The more these sorts of issues pop up, the more I think we need a new dedicated screen for hitsounding. A few of the ideas you proposed popped up in my head too but I'm not super sure they are going to work well in practice. |
I want to add a dedicated screen for hitsounding too, alongside being able to do basic hitsounds in the compose screen. This is because some people prefer hitsounding while mapping. A dedicated screen for hitsounding will definitely make hitsounding a lot better of an experience for anything that isn't just adding simple whistle, finish, claps. |
This change allows editing and modding of the
IHasRepeats.NodeSamples
. AlsoSamplePointPiece
has been upgraded to include a 'addition bank', achieving parity with stable.Still can't edit the custom sample index for legacy samples though. Not sure if we want to include that in the editor.
This checks two boxes in #12020
Closes #22187
Closes #20595