YesNoOk
avatar

Need help on attack clash/trade attack (both miss) (Read 1282 times)

Started by aaaeeeo, December 19, 2020, 07:47:35 AM
Share this topic:
Need help on attack clash/trade attack (both miss)
#1  December 19, 2020, 07:47:35 AM
  • avatar
So I'm trying to create my first character, and I am facing a problem that I cannot replicate in mugen same as the original game.

It's when 1P and 2P attack each other with the same move at the same time, I want them to become both miss or both hit.

So basically there are 3 frames in a punch, one punch starting frame, one punch frame which will actually do the attack with attack box and hitdef, and a recovering frame. I used the hit_type in priority but there are 2 issues (I am able to resolve the first one but still need help on the second one, tks!!) :

1.
I get the behavior that when 1P and 2P are not very close, an attack clash will happen as expected. However. when 1P and 2P are fairly close, one will always win, hit the other, and stop his attack, so that attack clash will never happen no matter how I press the keys at the same time.
After some debugging, I think it's because mugen only triggers the trade when the red box hits the blue box inside a red box. And one of the characters is always one tick faster than the other one. This is okay when they are away with each other where only arm/wapon area will overlap during the entire punch. However. when they are close, one will always hit the other's body 1 tick earlier which prevents the clash from happening.
This is unrealistic and not what in the original game.

Okay, so I am able to find out what I did wrong. I only put red boxes and hitdef on attack frame 2, looks like many people as far as from the examples are also doing that?
So I am able to resolve this by also putting red boxes on attack starting frame 1. Take punch as an example, frame 1 is you make a fist and frame 2 is you move the fist forward. I make the red box on frame 1 small so that it can rarely hit anyone unless it's overlapped with my body. Now, when 1P is a little bit faster at frame 2 and 2P at frame 1, the clash and both hit can happen as expected. We can make it more realistic by adding more frames, for example, a frame that the fist is halfway through between 1 and 2 so that the red box can progressively become larger.


2.
For the case of both miss, looks like mugen just treat it as nothing happened, this is also not what I want. In my case. I'm trying to do a both miss on weapon collision where I would like a guard spark, a sound and push both characters away a little bit or even better changing to a different animation/state.
What's more frustrating to me on both miss is the hitdef continues after the miss. So if 1P is 1 tick faster than 2P, when they both reach the hit frame 2, both miss will happen. But when 1P make it to recover frame 3 and 2P is still at frame 2, 2P will hit 1P on his recovery because there is no red box on that frame. This will make the slower character cleanly beat the faster character which seems not acceptable... Is there any way to stop the hit after the clash?
I tried looking into all parameters of HitDef and didn't find anything that could help me do that.

Tks!
Last Edit: December 19, 2020, 07:51:46 PM by aaaeeeo
Re: Need help on attack clash/trade attack (both miss)
#2  December 19, 2020, 08:55:03 PM
  • ***
  • Non est hoc propter hoc sed propter est hoc
    • USA
    • doubletrend-zeta.neocities.org/
You're going to want to put a reversal Def in and set the p1 and p2 states to be one's where you force clash or slide back or whatever
Re: Need help on attack clash/trade attack (both miss)
#3  December 19, 2020, 09:48:09 PM
  • ****
  • CPU Purple Heart
    • USA
    • www.dailymotion.com/2a8130871d2742d2f4da3b069
 That wouldn't work because you can't have a reversaldef and hitdef active in the same state. What you really want to go for is have the hitdef in the root's attack state and spawn a helper during the attack that possesses a reversaldef.
Re: Need help on attack clash/trade attack (both miss)
#4  December 20, 2020, 12:30:24 AM
  • ***
  • Non est hoc propter hoc sed propter est hoc
    • USA
    • doubletrend-zeta.neocities.org/
It depends on if it's a full game environment or not, because in that case it seems like unnecessary work when you can have a variable flag at the beginning of the state in both characters determining 1 or 0 for move quality and then checking for if both are attacking and comparing the two variables. If they match, reversaldef can be active.

Otherwise, I don't recall if there are any triggers for move priority (there should be if not), and you'd have to work with what, movecontact? That would be a little unreliable because it would return 0 constantly on whiff.