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

GetHitVar(HitTime) behavior #1034

Closed
potsmugen opened this issue Mar 11, 2023 · 3 comments · Fixed by #1072
Closed

GetHitVar(HitTime) behavior #1034

potsmugen opened this issue Mar 11, 2023 · 3 comments · Fixed by #1072
Labels
bug Something isn't working

Comments

@potsmugen
Copy link
Contributor

Describe the bug

This GetHitVar is reset outside of Movetype = H in Ikemen, but in Mugen it keeps counting down normally.

Mikage's Touhou characters (wrongly) use Movetype = I for some guarding states, so this happens:
https://imgur.com/aeQ2FY4

Here's the same but against another character:
https://imgur.com/hmZctjl

To Reproduce

  1. Change one of the knocked back states in common1.cns.zss (151, 5001, etc) to MoveType = I
  2. Have a character block or be hit into those states
  3. They will exit the state immediately because of GetHitVar(HitTime) resetting

Expected behavior

These Touhou chars worked normally in Mugen. Only when Mugenapple put them in Ikemen did he notice the difference.

I think this small difference is hiding more bugs in other characters that we just haven't found yet.

Screenshots / Video

No response

Engine Version (or source code date)

0.99 RC1

Operating system

Windows

Extra context or search terms

No response

@K4thos
Copy link
Member

K4thos commented Mar 11, 2023

there seems to be a contradiction in docs:

hittime: Returns time before player regains control and returns to an idle state after being hit. This counts down by 1 per game tick, as long as hitshaketime (see above) is greater than 0. It stops counting down when the value reaches -1. (int) "GetHitVar(hittime) < 0" is equivalent to the HitOver trigger.

but the HitOver trigger says:

If the player is in a gethit state, returns 1 when the hittime has expired, and 0 otherwise. For an explanation of hittime, see the HitDef documentation.

so can GetHitVar(hittime) be >= 0 while HitOver = 1 in mugen or not? In other words should HitOver have additional gethit state check, since based on this report we should remove it from GetHitVar(hittime) counter.

@potsmugen
Copy link
Contributor Author

potsmugen commented Mar 11, 2023

I think that's a mistake in the documentation. Here I'm forcing KFM to have Movetype = I instead of H:

Image1

(Mugen 1.1)

HitOver behaves the same as in MoveType = H. The "GetHitVar(hittime) < 0" part seems about right. That's apparently all that HitOver is.

@K4thos K4thos added the bug Something isn't working label Mar 12, 2023
K4thos added a commit that referenced this issue Mar 19, 2023
fix: hittime, hitshaketime reset if movetype != H (#1034)
@potsmugen
Copy link
Contributor Author

potsmugen commented Mar 30, 2023

Figure I'll post it here instead of opening a new ticket, since it's related. The way hittime is counting down is slightly off. If you pull up the debug in Mugen 1.1, you'll see that at time = 0 of the sliding back state (5001 etc) it gets decreased by 1, but in Ikemen it doesn't. This means the hittimes will be off in every single character.

It works correctly in 0.98.2.

Edit: Already addressed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants