ikemen-engine / Ikemen-GO

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

Mirrored/flipped sprites' position if off by 1 pixel versus Mugen #1864

Closed Kasasagi77 closed 2 months ago

Kasasagi77 commented 3 months ago

Describe the bug

You can programatically mirror/flip sprites in Mugen in two ways that I know of:

  1. Using a negative scalestart, e.g. scalestart = -1,1.
  2. In the animation definition (air format), by using optional parameters H or V, e.g. 15,1, 0,0, 5, H.

In both of those cases the position of the mirrored/flipped sprite will be off-by-one in Ikemen in comparison to Mugen.

To Reproduce

I do not have a ready test case at this time, but I wanted to at least leave a note of the problem.

You can create your own test case (preferably lowres for easier visibility) by using the parameters described above and comparing with Mugen.

Expected behavior

Matching Mugen.

Screenshots / Video

No response

Engine Version (or source code date)

2024-06-29

Operating system

Linux

Extra context or search terms

No response

potsmugen commented 3 months ago

Simple char test case. Make this the standing animation of any char (preferably KFM):

[Begin Action 0]
9000,1, 0,-150, 1
9000,1, 0,-150, 1, H

You can see that there's a pixel of overlap between both frames in Ikemen but not Mugen 1.1. I can see where Suehiro was coming from, though, because Winmugen acts the same as Ikemen. But Mugen 1.1 does seem like the correct way to do it.

potsmugen commented 2 months ago

After locating it in the source code, it looks like this is indeed deliberately replicating a Winmugen bug. In Mugen 1.1 they fixed it more or less. More or less because the magnitude of the error varies with game resolution.

Should we just get rid of the bug?

Kasasagi77 commented 2 months ago

In my personal opinion the default behaviour should not replicate a bug from a specific Mugen version.

At most, if anything at all, such behaviour should be enable using a specific mugenversion parameter?

potsmugen commented 2 months ago

Agreed on the first point. For the second point we'd need to do some workarounds in the code, which doesn't sound worth it. I'll add it to my next PR.