YesNoOk
avatar

Discovery: Explod ownership is bugged (aka "how to make P1 use P2's sprites) (Read 4191 times)

Started by Ricepigeon, April 18, 2017, 06:42:15 pm
Share this topic:
Discovery: Explod ownership is bugged (aka "how to make P1 use P2's sprites)
#1  April 18, 2017, 06:42:15 pm
  • *****
  • Thanks and God bless
    • USA
    • ricepigeon.neocities.org
Seems like 2017 is the year of discoveries for the mugen engine. Thanks to a bug report someone submitted regarding some of my characters, I came across the following:

Quote
Rice - Today at 11:50 AM: hah
Rice - Today at 11:50 AM: turns out explods are bugged in mugen
The 14th Doctor - Today at 11:51 AM: Mugen is never safe from the bugs
Rice - Today at 11:51 AM: let me put this way
Rice - Today at 11:51 AM: if an explod is spawned by a helper, and the helper destroys itself while the explod still exists, the next helper to be spawned that used the previous helper's playerID will become the owner of the explod
Rice - Today at 11:51 AM: which means you can have explods on p1's side using p2's sprites and animation data
Superteletubbies64 - Today at 11:52 AM: holy shit
Superteletubbies64 - Today at 11:52 AM: are there videos of that
Rice - Today at 11:52 AM: no but I have a screenshot thanks to Plas's bug report
Rice - Today at 11:52 AM:
Rice - Today at 11:53 AM: take a close look at Flandre's spellcard selection menu, its using Ichirin's sprites
Superteletubbies64 - Today at 11:53 AM: oh f*ck

So what's going on here? Basically explods are tied to the playerID of the helper (or player) that creates it, and persists even after the helper that spawned it calls a destroyself controller. For players, this isn't an issue since players never can call destroyself, but if another helper from Player 2's side is spawned and uses the PlayerID of the helper that spawned the explod (very likely when the PlayerID is a lower value), thus the explod is now owned by Player2's helper, thus it inherits player2's animation & sprite data, causing the bug in the screenshot. The solution?

Quote
Rice - Today at 11:54 AM: the solution to this problem was the easiest one, just have the helper stay on screen until the explod is gone, preferably through a changestate

tldr; be careful when using helpers to spawn explods.
Re: Discovery: Explod ownership is bugged (aka "how to make P1 use P2's sprites)
#2  April 18, 2017, 07:59:27 pm
  • *****
  • Thanks and God bless
    • USA
    • ricepigeon.neocities.org
Decided to dig a little deeper and replaced one of the explod's anims with a new animation number showing the character's select screen portrait, an animation which doesn't exist in p2's AIR file. If p2's animation data is used in the bug, then the explod should theoretically be blank, but if its using p1's anim data with p2's sprites, then it should display p2's select portrait:



So there it is. Player 1's animation data is preserved, but it now uses Player 2's sprite data instead (similar to the changeanim2 controller, but for explods).

EDIT: neglected to mention this earlier, but all this was tested in Mugen 1.0.
Last Edit: April 18, 2017, 08:09:56 pm by Ricepigeon

2OS

Re: Discovery: Explod ownership is bugged (aka "how to make P1 use P2's sprites)
#3  April 19, 2017, 01:52:52 am
  • ****
  • 608 Wannabe
  • Ich schicke dich zur HOELLE!! STIRB DU FEIGLING!!
    • Egypt
i've known this for years. i didn't think anyone would care so i didn't share it.

i discovered it through bindtime; after destroyself it looks for a new host to bind to and picks the next player (helper) to spawn regardless of who owns it.
Re: Discovery: Explod ownership is bugged (aka "how to make P1 use P2's sprites)
#4  April 19, 2017, 01:58:38 am
  • ***
    • Spain
    • https://ikutronhd.wixsite.com/ikutronsite/yo
Decided to dig a little deeper and replaced one of the explod's anims with a new animation number showing the character's select screen portrait, an animation which doesn't exist in p2's AIR file. If p2's animation data is used in the bug, then the explod should theoretically be blank, but if its using p1's anim data with p2's sprites, then it should display p2's select portrait:



So there it is. Player 1's animation data is preserved, but it now uses Player 2's sprite data instead (similar to the changeanim2 controller, but for explods).

EDIT: neglected to mention this earlier, but all this was tested in Mugen 1.0.

How strange to me does not appear that mistake.
Re: Discovery: Explod ownership is bugged (aka "how to make P1 use P2's sprites)
#5  April 19, 2017, 04:12:26 am
  • ******
  • Double-Crosser
  • I'm not standing out. This isn't weird at all.
    • USA
LOL this bug popped up when I was developing Mr. Satan. The Saibamen have that kamikaze move where they blow themselves up so if they did it when Mr. Satan has an audience up, the audience would get attached to the Saibamen. It was hilarious and I wish I screenshotted it.

I "solved" this issue by making it impossible to go into Champ Mode (like how the other characters don't) when fighting Saibamen, but now that I know it's a global MUGEN bug, I'll try to find a better fix for it. Thanks!