ikemen-engine / Ikemen-GO

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

Hitcounts problem #1860

Open netyzh opened 4 months ago

netyzh commented 4 months ago

Describe the bug

Misaka Shiori(by DABA) 6426a's hitcounts is not correct.

To Reproduce

1 Download character from https://mugenarchive.com/forums/downloads.php?do=file&id=48267-shiori-misaka-daba 2 Press 6426a(stateno 2000) in the match,only 2 hits occured.

Expected behavior

According to code ,it should be at least 5 hits.Var(27) is always 1 during the skill in the video.

[State Combo];Hit回数初期化 type = VarSet trigger1 = AnimElem = 1 var(26) = 0 ignorehitpause = 1 [State Combo] type = VarSet trigger1 = AnimElem = 1 var(27) = 0 ignorehitpause = 1

[State Combo];Hit調整OK type = VarSet trigger1 = var(27) = 1 trigger1 = projcontact(2001) = 1 , >= 0 trigger1 = Random >= 750 var(27) = 0

[State HitDef] type = Projectile triggerall = Var(26) < 5 triggerall = Var(27) = 0 trigger1 = AnimElem = 4,=1 trigger2 = AnimElem = 5,=1 trigger3 = AnimElem = 6,=1 trigger4 = AnimElem = 7,=1 trigger5 = AnimElem = 8,=1 trigger6 = AnimElem = 9,=1 trigger7 = AnimElem = 10,=1 trigger8 = AnimElem = 11,=1 trigger9 = AnimElem = 12,=1 trigger10 = AnimElem = 13,=1 trigger11 = AnimElem = 14,=1 projid = 2001 projanim = 2001 projepriority = 60 projremovetime = 1 offset = 0, 0 velocity = 0, 0 Postype = p1 attr = S, HA ;立ち状態で、通常の攻撃(sは立ち、nは通常、aは攻撃を表す) damage = 52, 10 ;ダメージ量(左が当たった時、右はガードした時) animtype = Light ;当てた時の相手のポーズ(light/midium/hard/back)から選択 guardflag = M ;ガードできる状態(maは全ての状態でガード可能) hitflag = MAF ;当てる事のできる条件 priority = 5, Hit ;攻撃の優先権(0弱い 4通常 7強い pausetime = 1, 1 ;攻撃が当たった時の硬直時間(左が自分、右が相手) sparkno = s7030 ;ヒットエフェクトのスプライトステート(無ければ0) guard.sparkno = s7100 ;ガードエフェクトのスプライトステート(無ければ0) sparkxy = -10, floor(p2BodyDist Y-30);ヒットエフェクトを表示する場所(相手の座標で) hitsound = s2200, 0 ;ヒットした時の音(s,にすると自分の音を使う) guardsound = s120, 0 ;ガードした時の音(同上) ground.type = High ;相手のくらった場所(High:頭、体, Low:足, Trip:足払い) ground.slidetime = 8 ;相手が後にすべる時間 ground.hittime = 18 ;コンボが繋がる時間(高くしすぎない事) ground.velocity = 0, 0 ;地上で攻撃をくらった場合の相手の移動状況(xとyで小数点可) guard.velocity = IfElse(P2Dist X < 0,4.0,-4.0);地上で攻撃で防御した場合の相手の移動状況(xとyで小数点可) airguard.velocity = IfElse(P2Dist X < 0,2.5,-2.5),-5.0;空中で攻撃で防御した場合の相手の移動状況(xとyで小数点可) air.type = High ;空中で相手がくらった場所(上と同じ) air.velocity = 0, 0 ;空中で攻撃をくらった場合の相手の移動状況(xとyで小数点可) air.hittime = 9999 ;空中でコンボが繋がる時間 air.fall = 1 ;空中で相手をFall(落下)状態へ (1:ON 0:OFF) fall.recover = 0 ;相手がFall(落下)状態から回復するか(1:回復可 0:回復不可) fall.recovertime = 8000-IfElse(var(23)>10,10,var(23));回復可まで必要とする時間 getpower = 0, 12 ;パワーに付加(HIt時x,防御時y) p2stateno = 7861 ;投げが成功した場合の移動する2Pのステート

[State Combo];Hit回数確認 type = VarAdd trigger1 = projcontact(2001) = 1 var(26) = 1 [State Combo];Hit調整NG type = VarSet trigger1 = var(27) = 0 trigger1 = projcontact(2001) = 1 var(27) = 1 [State Combo, HitAdd];ヒットカウント type = HitAdd trigger1 = Projhit(2001) = 1 value = 1

Screenshots / Video

https://github.com/ikemen-engine/Ikemen-GO/assets/38396687/9d95eee6-4c03-4dd0-a414-a04784d55ee5

Engine Version (or source code date)

2024-06-27

Operating system

Windows

Extra context or search terms

No response

potsmugen commented 4 months ago

It does 4 hits for me in the same build. Against KFM. In Mugen 1.1 it can sometimes do 5 but I think it's just because juggling acceleration is slightly different (intentionally).

https://github.com/ikemen-engine/Ikemen-GO/assets/107247004/c71f04a6-2850-4f50-91e1-dbb296221413

Can you try against KFM? Or compare the same two chars in Mugen 1.1.

netyzh commented 4 months ago

Can you try against KFM? Or compare the same two chars in Mugen 1.1.

I've made a mistake. My character was ai patched by ARL. The origin chara use Movecontact in the code, but ARL patched chara use Projcontact. You can download chara and ai in: https://ux.getuploader.com/hamer5937/download/62 In mugen 1.1,the ARL patched chara does 8hits,it's strange.

https://github.com/ikemen-engine/Ikemen-GO/assets/38396687/e1fce211-a8e9-4cbd-83d1-f64b447a0d67

potsmugen commented 4 months ago

In State 2000 there's this block:

[State Combo];Hit調整OK
type = VarSet
trigger1 = var(27) = 1
trigger1 = projcontact(2001) = 1, >= 0
trigger1 = Random >= 750
var(27) = 0

I think that syntax for projcontact isn't implemented correctly in Ikemen. If you replace it with projcontacttime(2001) >= 0 it does the 8 hits.

K4thos commented 4 months ago

This is not a valid syntax for projcontact. See the mugen docs: https://www.elecbyte.com/mugendocs-11b1/trigger.html#projcontact If anything the engine should error out on loading or at least print debug flood to tell the creator that the character code is buggy.

potsmugen commented 4 months ago

I think the catch here is that Mugen does accept the syntax. And I don't mean it just tolerates it like some issues we've had in the past, but it actually works as you'd expect.

K4thos commented 4 months ago

got it, we can change the compiler.go to support both syntaxes. But what is the password for that https://ux.getuploader.com/hamer5937/download/62 ? I can't download from this site to test the solution.

netyzh commented 4 months ago

got it, we can change the compiler.go to support both syntaxes. But what is the password for that https://ux.getuploader.com/hamer5937/download/62 ? I can't download from this site to test the solution.

password is "mugen"