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

osu!taiko pooling [seems like incorrect way] #31294

Closed
wants to merge 6 commits into from

Conversation

Nikita-str
Copy link

@Nikita-str Nikita-str commented Dec 26, 2024

Don't read text below there is more simpler approach

Help Wanted:

  • One thing that I don't understand how to fix after the changes is: why can <editor right-click-menu click action> and <editor key down action> for the same action (W/R key: set rim types for the selection) perform different behavior? Action is correct for right-click-menu but only do redo/undo record for W/R key down. There is changes in TaikoSelectionHandler:SetRimState but as I can understand it's called for both click & key down. Seems like it's not expected from EditorSelectionHandler to remove/create objects? And therefore some events don't called? Sorry for uncertainty.
  • Another thing is why on undo/redo action in Editor can change Samples.Volume (only for HitRim class that is differ from HitCentre)? Seems like the problem is about Samples changing/setting, but I couldn't find where it, and maybe something like this already happened before and so it's simpler to ask.

Please also see See.1 in the end of PR comment


Try to fix #21072


About The Issue Solution:
Added HitCentre: Hit & HitRim: Hit classes that corresponding to don & katsu circles. They cannot change Hit.Type and now we can do:

RegisterPool<HitRim, DrawableHitRim>(50);
RegisterPool<HitCentre, DrawableHitCenter>(50);

in TaikoPlayfield.
And with them there are problems mentioned in Help Wanted section.

Also added pool for KiaiHitExplosion (first commit), with it there no problem.

Just for case, do I understand correctly that changing the Content in DrawableHitObject is long performing operation that should be optimized? (because if not, and the long operation is creating new SkinnableDrawable and we can change them dynamically in Content then this changes can be done more-more simpler)


Should be solved before non-Draft:
Except for problems mentioned in Help Wanted section, there is some todo's that is just question about how to do better & simple bugs that do not require help, but should to be mentioned and closed before make PR non-Draft:

  • DefaultKiaiHitExplosion.cs: strong hit looks better with greater X scaling. but I don't sure about perf & it's not about this PR actually (question).
  • TaikoPlayfield.cs: seems like Kiai explosion should be displayed only whin hit(when result.IsHit). Am I wrong? (question)
  • Is there benchmarks for taiko playfield drawing during game? how to run it? Or how I can test performance of the canhges in pooling? (question)
  • DrawableFlyingHit.cs: what should we draw on hit? I use swell circle but don't sure that it's correct. Before we draw DrawableHit with dynamic SkinnableDrawable. In osu!stable draws yellow-to-red Hit Cirlce, so maybe there should be some additional TaikoSkinComponents? (question)
  • strong taiko circle drawn with filled star (bug).

One more time, sorry for big uncertainty, real help needed only for Help Wanted section because it takes more time than I expected.

See.1:
Maybe the solution approach is bad, maybe there is more good way to do all this changes without splitting Hit into HitCentre & HitRim? but how else can we pool it? Maybe give a way to get your pool in Playfield.cs:IPooledHitObjectProvider.GetPooledDrawableRepresentation if there no RegisterPool? and then we can give correct pool for Hit without splitting it into HitCentre & HitRim? Such approach seems more simpler.

* Is pooling faster than caching for sure?
KiaiHitExplosion:
```
        [Cached(typeof(DrawableHitObject))]
        public readonly DrawableHitObject JudgedObject;
```

TODO:
* `DefaultKiaiHitExplosion.cs`: strong hit looks better with greater X scaling. but I don't sure about perf & it's not about this PR actually
* `TaikoPlayfield.cs`: seems like Kiai explosion should be displayed only whin hit. Am I wrong? (`result.IsHit`)
DrawableHit & Hit types splitted into two

TODO:
* correct way (currently not working) for TaikoModSwap
* correct way (currently exception ^~^) for editor
* remove `ChangeType` (at least current realization)
* fix Tests XD
* run benchmarks -- is the changes useful at all?
. `EditorBeatmap:ChangeOnSelection`:
seems like `EditorSelectionHandler` don't expected to create / remove HitObjects and therefore it don't called redraw.
BUT
object redrawing don't called only when we call this by keydown (and in that way savestates (redo/undo) works! and work correctly), but if we perform HitObject change by rightclick menu then it work correctly, and display correctly but there no undo/redo record :/

need to fix tests, maybe they say where the problem
@Nikita-str Nikita-str changed the title [HELP WANTED] osu!taiko pooling osu!taiko pooling [seems like incorrect way] Dec 26, 2024
@bdach
Copy link
Collaborator

bdach commented Dec 26, 2024

I am so confused by all of this. Do you want help or not? Is this pull request "the correct way" or not? Should I "read the text" in the OP or not? Why is this open even?

@Nikita-str
Copy link
Author

Nikita-str commented Dec 26, 2024

Do you want help or not?

Right now I don't need help, except for question in the end of this comment.
Current approach is too bad and I only find better solution when make this PR. So I redoing it. You shouldn't read OP comment. Sorry for readability one more time.

THIS WAY IS NOT CORRECT

Meanwhile, can you say how I can get Playfield from EditorSelectionHandler / EditorBeatmap is there a way?

@Nikita-str
Copy link
Author

A better solution has been found therefore this PR closed.

@Nikita-str Nikita-str closed this Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

osu!taiko is not benefitting from pooling
2 participants