ikemen-engine / Ikemen-GO

An open-source fighting game engine that supports MUGEN resources.
https://ikemen-engine.github.io
Other
728 stars 125 forks source link

Incorrect sprite position durning grab #2089

Open Kiwi1444 opened 1 week ago

Kiwi1444 commented 1 week ago

Describe the bug

When you choose The Mask by Mammalman and thatguy and trying to throw Pig by Kazecat, sprite position of Pig is shown incorrectly. My version is that the reason for the bug is that Pig uses SFF v2.010, since that bug only occurs on characters with this version of SFF. Currently I can't confirm it and change version of The Pig SFF from 2.010 to other version.

To Reproduce

  1. Download characters from Mugenarchive: The Mask and Pig
  2. Start the match and try to throw Pig (F+HP near the opponent)

Expected behavior

As in Mugen 1.1

Screenshots / Video

Mugen:

https://github.com/user-attachments/assets/ebe3b4ba-f566-4015-ab07-8702da346137

Ikemen Go (sprite position is wrong):

https://github.com/user-attachments/assets/08274640-d0ab-4ba8-88df-53efa43dbe90

Engine Version (or source code date)

Nightly 20240903

Operating system

Windows

Extra context or search terms

No response

potsmugen commented 1 week ago

Have you checked the current build? That reminds me of some other issue that was fixed.

Kiwi1444 commented 1 week ago

Problem persists in current nightly build (2024-10-24).

SuperFromND commented 2 days ago

Was able to repro this on latest Nightly as well (Oct. 27 2024 as of this writing). I tried to also convert the SFF to both 2.0 and 1.0 via FF3 to see if that was somehow affecting things, doesn't appear to be the case.

My guess is this is some sort of math-related issue in either Localcoords or the ChangeAnim2 SCTRL (maybe a bit of both); I'm not 100% sure how Mugen handles it, but when testing I noticed that adjusting the width value affects the position of Pig's head both vertically and horizontally, while adjusting the height value affects absolutely nothing as far as I can tell. ikemen087 ikemen090

Sushiman3000 commented 1 day ago

At first, I thought the issue was caused by characters with different localcoord values, but it doesn’t seem to be the case. Whenever the characters have different sizes, even without defined localcoord values, the issue occurs. The larger the size difference, the more noticeable the issue. Here’s a character to reproduce the issue, along with screenshots demonstrating it.

Juri: https://www.mediafire.com/file/g0cjmnh2w2c9mo6/CFJ_JuriHan.zip/file

Chars are in a grab state; I've applied a static animation for easier measurement. To trigger the grab, just get close to the target and press 'a' or 'z.' The issue can be reproduced with any char that has a different size than Juri. Tested on the latest nightly build.

Red line is aligned with Juri. Ikemen issue 2

The issue affects both height and width.

Ikemen issue 3

Even the slightest difference in size causes misalignment compared to MUGEN. The grabbed character does not align in the exact same position as in MUGEN, even though it is exactly the same character.

Ikemen Issue 4

Sorry if the images are too big 😭 first time making a post on github.

potsmugen commented 22 hours ago

The issue here is that the offset in the animation should be multiplied by the animation owner's scale rather than the character's own scale. However that's easier said than done. The way the code is set up it'll need a good bit of refactoring before that's possible.