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

Some fruits on the platter randomly disappear when an explosion happens at the end of a combo #29319

Closed
nagi-desuuu opened this issue Aug 7, 2024 · 1 comment · Fixed by #29403

Comments

@nagi-desuuu
Copy link

Type

Cosmetic

Bug description

I've seen it happen first while I was playing Alt Futur where the last fruit of a catch combo disappears right before the explosion of the fruits inside the platter, so I decided to try this on other maps too.

Screenshots or videos

osu.2024-08-07.16-56-01.mp4
osu.2024-08-07.17-30-42.mp4

Also replicable on built-in skins

osu.2024-08-07.17-35-04.mp4

Version

2024.731.0

Logs

1723022597.network.log
1723022597.performance.log
1723022597.runtime.log
1723022597.updater.log
1723022598.nauth.log
1723022597.auth.log

(For some reason, my logs weren't being exported when I hit the export logs button, but that could just be me)

@smoogipoo
Copy link
Contributor

smoogipoo commented Aug 7, 2024

I've done some preliminary investigation into this, and it looks to be because hitobjects are removed from their parenting container prior to their state being copied over to a new representation (for the purpose of being dropped), leading to things like DrawPosition being incorrectly calculated.

A simple demonstrative fix is the following:

diff --git a/osu.Game.Rulesets.Catch.Tests/TestSceneCatcher.cs b/osu.Game.Rulesets.Catch.Tests/TestSceneCatcher.cs
index b03fa00f76..6f62fc2742 100644
--- a/osu.Game.Rulesets.Catch.Tests/TestSceneCatcher.cs
+++ b/osu.Game.Rulesets.Catch.Tests/TestSceneCatcher.cs
@@ -57,6 +57,21 @@ public partial class TestSceneCatcher : OsuTestScene
             };
         });

+        [Test]
+        [Solo]
+        public void TestWangs()
+        {
+            AddStep("catch normal fruit", () =>
+            {
+                attemptCatch(new Fruit());
+            });
+
+            AddStep("catch normal fruit", () =>
+            {
+                attemptCatch(new Fruit { IndexInBeatmap = 2, LastInCombo = true });
+            });
+        }
+
         [Test]
         public void TestCatcherHyperStateReverted()
         {
diff --git a/osu.Game.Rulesets.Catch/UI/Catcher.cs b/osu.Game.Rulesets.Catch/UI/Catcher.cs
index dca01fc61a..4c0dafe2de 100644
--- a/osu.Game.Rulesets.Catch/UI/Catcher.cs
+++ b/osu.Game.Rulesets.Catch/UI/Catcher.cs
@@ -427,11 +427,10 @@ private void clearPlate(DroppedObjectAnimation animation)
         {
             var caughtObjects = caughtObjectContainer.Children.ToArray();

-            caughtObjectContainer.Clear(false);
-
             // Use the already returned PoolableDrawables for new objects
             var droppedObjects = caughtObjects.Select(getDroppedObject).ToArray();

+            caughtObjectContainer.Clear(false);
             droppedObjectTarget.AddRange(droppedObjects);

             foreach (var droppedObject in droppedObjects)

However, take note of the comment.

I still have questions - haven't pieced together the entire puzzle:

  1. Why is DrawPosition getting affected? CaughtObject isn't using relative position.
  2. Why is the fruit representation (in the test - whether it's green or red) affected? If, rather than the above diff, copy just the position from before the Clear() across, then both hitobjects in the test will be green.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants