YesNoOk
avatar

Having animations play through hitpause (Capcom converters PLEASE READ!) (Read 15041 times)

Started by Jesuszilla, February 21, 2014, 08:52:36 am
Share this topic:
Having animations play through hitpause (Capcom converters PLEASE READ!)
#1  February 21, 2014, 08:52:36 am
  • ******
  • Loyal to the Game
    • USA
    • http://jesuszilla.trinitymugen.net/
Have you ever looked at a Capcom character and noticed that their animation plays through the pausetime? Think it's just there to make the animations look nice?

Yyyyyeah, turns out, no, it's more than just aesthetics. It's actually VERY important.

Kyosuke, for instance, absolutely HAS to do this in order for links to work properly:

Without:


With:


See the frame advantage? A whopping +5 as opposed to +2. If he didn't have this, his s.LP → s.HP (close) link would be impossible to do.


So, how do you do it?

Code:
[State 205, Time Offset]
type = VarSet
trigger1 = moveContact = 1
var(x) = Time
ignorehitpause = 1
persistent = 0
[State 205, Play Anim]
type = ChangeAnim
triggerall = AnimElemTime(y) >= 0 && AnimElemTime(z) <= 0
trigger1 = hitPauseTime = [1,{pausetime} - ({total number of frames up until the end of the first frame of animation} - Var(x))]
value = anim
elem = z
ignorehitpause = 1

(simplified for the sake of education since my system has scary-looking variables)

So, let's use Kyosuke as an example:


You see the circled 3 ticks? Fighter Factory displays this. What it's saying is, "3 ticks will have passed after this frame ends." The current frame lasts 2 ticks, so 2 ticks AND ONLY 2 ticks of that frame need to play, regardless of any pause. That's why we have the time offset variable.

Now, that's AnimElem 2, and we want it to skip to the next AnimElem, which is 3, and then pause there. The time you use for pausetime is the EXACT pausetime you define in the HitDef.

Code:
pausetime = 9,9



So, with all that in mind, now the code will look something like this:

Code:
[State 205, Time Offset]
type = VarSet
trigger1 = moveContact = 1
var(x) = Time
ignorehitpause = 1
persistent = 0
[State 205, Play Anim]
type = ChangeAnim
triggerall = AnimElemTime(2) >= 0 && AnimElemTime(3) <= 0
trigger1 = hitPauseTime = [1,9 - (3 - Var(x))]
value = anim
elem = 3
ignorehitpause = 1

But what about custom combo? It halves the pausetime! No problem!

Code:
[State 205, Time Offset]
type = VarSet
trigger1 = moveContact = 1
var(x) = Time
ignorehitpause = 1
persistent = 0
[State 205, Play Anim]
type = ChangeAnim
triggerall = AnimElemTime(2) >= 0 && AnimElemTime(3) <= 0
trigger1 = hitPauseTime = [1,ceil(9*(2-(Var(c)>0))/2) - (3 - Var(x))]
value = anim
elem = 3
ignorehitpause = 1

Where Var(x) is your time offset variable, and Var(c) is your custom combo variable.





Now, you've probably seen a different method used in Warusaki3's and GM's stuff that accomplishes this same thing, but that requires making a "buffer" for each move during custom combo. That's a pain to have to do. This method lets you bypass all of that!


Big thanks goes to H" for finding this method.
Re: Having animations play through hitpause (Capcom converters PLEASE READ!)
#2  February 23, 2014, 09:33:26 am
  • ***
    • Canada
I may be misinterpreting this, but isn't it easier to use just the pausetime parameter for this?

From my understanding you are trying to accomplish this

-- ORIGINAL SETUP --
Frame | Animelem | Action
1 | 1 | startup frames
*** 2 - 5 are the same ***
6 | 2 | Hitpause for 9 frames, Target Shakes for 9 frames
7 | 2 | 2nd frame of animelem 2 plays, you are released from hitstun, opponent is released from hitstun
8 | 2 | 3rd frame of animelem 2 plays, you are released from hitstun, opponent is released from hitstun
9 | 3 | Next animation frame, animelem 3
...
*** Attack ends, leaves you at +2 ***

-- WANTED SETUP --
Frame | Animelem | Action
1 | 1 | startup frames
*** 2 - 5 are the same ***
6 | 2 | Hitpause begins lasts for 5 frames, you are released on the 6th frame, Target Shakes for 9 frames
7 | 2 | 2nd frame of animelem 2 plays, opponent is still in hit stun
8 | 2 | 3rd frame of animelem 2 plays, opponent is still in hit stun
9 | 3 | Next animation frame, opponent is released from hitstun
*** Attack ends, leaves you at +5 ***

I believe you can accomplish this by having an unequal pausetime.

In this case you want

pausetime = 6, 9

If you are in custom combo mode, you can then halve the first pausetime to get the same effect

pausetime = ifelse( <custom combo var( x ) IS SET>, 3, 6 ), 9
The double-curse of Blue Beard Baboon lies in these words you see. Read them once, then read them twice and your island is history.
Re: Having animations play through hitpause (Capcom converters PLEASE READ!)
#3  February 23, 2014, 09:38:43 am
  • ****
    • Japan
MUGEN hitpause activates instantly along with the hitdef, what Capcom games do sometimes is activate the hitpause in the next frame of the animation rather than the active one. You could force the frame data to work by using uneven pausetimes, but really specific stuff like cancels during active frames would be affected.

That's why the animation element is changed manually during a specific portion of the pausetime.
Re: Having animations play through hitpause (Capcom converters PLEASE READ!)
#4  February 23, 2014, 09:53:04 am
  • ******
  • I'm not pushing you away,
  • I'm pulling *me* towards myself!
    • USA
    • network.mugenguild.com/jmorphman
The time offset variable doesn't really seem to matter unless the active frame is longer than the hitpause, no? (gameplay-wise, at least, I guess it would change when the advancement to the next frame occurs in the hitpause)
Re: Having animations play through hitpause (Capcom converters PLEASE READ!)
#5  February 23, 2014, 10:17:17 am
  • ****
  • A frame here, a pixel there.
I had been wondering about how to replicate this property in Mugen, I know Darkstalkers uses it a lot. Thanks for the helpful tutorial.
Re: Having animations play through hitpause (Capcom converters PLEASE READ!)
#6  February 23, 2014, 10:47:28 pm
  • ******
  • Loyal to the Game
    • USA
    • http://jesuszilla.trinitymugen.net/
The time offset variable doesn't really seem to matter unless the active frame is longer than the hitpause, no? (gameplay-wise, at least, I guess it would change when the advancement to the next frame occurs in the hitpause)

Time offset is there in case the move hits at another tick of that same animation (tick 3 instead of tick 2, for instance, which can happen if the opponent dashes in or jumps into it). The time offset is there for this correction, because that frame should play for 2 ticks and ONLY 2 ticks.
Re: Having animations play through hitpause (Capcom converters PLEASE READ!)
#7  February 24, 2014, 03:26:30 am
  • ******
  • I'm not pushing you away,
  • I'm pulling *me* towards myself!
    • USA
    • network.mugenguild.com/jmorphman
That's what I mean; it's an minor aesthetic issue (IMO) unless the hitpause is shorter than the active frame.

basically I am coming up with a justification so that I don't have to devote a variable for what I'm currently using (don't tell anyone this)
Re: Having animations play through hitpause (Capcom converters PLEASE READ!)
#8  February 24, 2014, 08:09:27 am
  • ******
  • Loyal to the Game
    • USA
    • http://jesuszilla.trinitymugen.net/
It could possibly add on more time if you don't use an offset variable, making it more than just an aesthetic issue.


C'mon dude, if I have free variables, I KNOW you do.
Re: Having animations play through hitpause (Capcom converters PLEASE READ!)
#9  June 04, 2014, 04:38:45 pm
  • ******
    • www.justnopoint.com/
I want to clarify something on this.

what Capcom games do sometimes is activate the hitpause in the next frame of the animation rather than the active one.
Sometimes being the key word, correct? In most instances you will not use this it seems. I'm going through Ryu's hit properties in CVS2 and most of his basics do not need this. His close SK however does.

So this is primarily for animations where there is either a blur effect on sprites indicating animation (you would want the frame without the blur to be the one paused), or in CVS2 where there is little blur you would use this for the most extended part of the animation (pausing on the frame after where the clothing and arm/leg is less exaggerated). Like in Ryu's close SK.

I'm simply wanting to clarify this because when I 1st read this thread I thought it meant I should apply this to every attack. So others may have thought the same.

EDIT: Yes, this works exactly as I described. Works perfectly!!! You only need to use this for the attacks I described above. Of course if you are studying accuracy you will clearly see what I mean when you get to coding the hitdef properties.

     Posted: June 04, 2014, 09:16:07 pm
New problem. How do you turn this off after it has hit once? Ryu's close SK is a 2 hit move. So when you connect with the 1st hit all is well. But when you connect with the second hit it returns back to the hit from the 1st.
Last Edit: June 04, 2014, 09:16:07 pm by Just No Point
Re: Having animations play through hitpause (Capcom converters PLEASE READ!)
#10  June 04, 2014, 09:16:40 pm
  • ******
    • www.justnopoint.com/
New problem. How do you turn this off after it has hit once? Ryu's close SK is a 2 hit move. So when you connect with the 1st hit all is well. But when you connect with the second hit it returns back to the hit from the 1st.

Looks like I need to turn off auto merge here
Re: Having animations play through hitpause (Capcom converters PLEASE READ!)
#11  June 04, 2014, 09:42:37 pm
  • *****
  • Gaps? Where we're going, we don't need gaps...
    • USA
    • ricepigeon.neocities.org
I'm under the assumption that you'd have to duplicate the controllers for each instance, so for example, say the move has active frames on animation elements 3 and 5, then your code would be:

Code:
[State 205, Time Offset]
type = VarSet
trigger1 = animelemtime(3)>=0&&animelemtime(4)<0
trigger1 = moveContact = 1
var(x) = Time
ignorehitpause = 1
persistent = 0

[State 205, Time Offset]
type = VarSet
trigger1 = animelemtime(5)>=0&&animelemtime(6)<0
trigger1 = moveContact = 1
var(x) = Time
ignorehitpause = 1
persistent = 0

[State 205, Play Anim]
type = ChangeAnim
triggerall = hitPauseTime = [1,9 - (3 - Var(x))]
trigger1 = AnimElemTime(3) >= 0 && AnimElemTime(4) <= 0
trigger2 = AnimElemTime(5) >= 0 && AnimElemTime(6) <= 0
value = anim
elem = ifelse(AnimElemTime(3) >= 0 && AnimElemTime(4)<=0,4,6)
ignorehitpause = 1

You'd probably need to use a movehitreset controller or some other type of flag to get it to work perfectly, but this should illustrate the general idea.

But from what I can tell, this seems to solve the issue of having to wait for the hitpause to end before being able to cancel into something else? Though I only noticed a 1 frame difference in the frame advantages as opposed to the 3 frame difference in the OP, unless there's something there that I'm missing.

Edit: Scratch that. I goofed by putting the number of active frames instead of the total duration that would have elapsed after the last active frame. Another question is that the above code assumes that there are non-active frames in between each active frame for each hit, what about cases where the two active frames are back to back? Would they be handled the same way?
Last Edit: June 04, 2014, 09:58:49 pm by Ricepigeon
Re: Having animations play through hitpause (Capcom converters PLEASE READ!)
#12  June 04, 2014, 10:10:06 pm
  • ******
    • www.justnopoint.com/
Right now I'm on my phone so I haven't tried anything. But the way this particular move works is 2 active frames 1 hitdef for 1st hit. Second hit is 1 active frame and another hitdef.

The hit pause happens on the 2nd active frame of the 1st hit. The hit pause on the 2nd hit happens on it's only active frame. Meaning I can use the default hit pause from the 2nd hitdef. I'm going to fool around with what you said and what Byakko mentioned in my WIP thread. But I also have another idea. To tell it to trigger another animelem after elem 5 is completed. Telling it to go onto elem 6.

Maybe that will stop the loop.
Re: Having animations play through hitpause (Capcom converters PLEASE READ!)
#13  June 04, 2014, 11:06:13 pm
  • ******
    • www.justnopoint.com/
Byakko's simplistic idea solved the issue.

Code:
    [State 255, Time Offset]
    type = VarSet
    trigger1 = moveContact = 1
    var(2) = Time
    ignorehitpause = 1
    persistent = 0

   
    [State 255, Play Anim]
    type = ChangeAnim
    ;triggerall = AnimElemTime(22) >= 0 && AnimElemTime(27) <= 0
    triggerall = AnimElemNo(0) = 3
    trigger1 = hitPauseTime = [1,8 - (27 - Var(2))]
    value = anim
    elem = 4
    ignorehitpause = 1

To test this you'll notice that I changed the 1st attack frame to be 22 ticks. This way I could have player 2 land on it after the 1st tick easier and see if it would work correctly. It did, the 1st frame continued to go through the remaining ticks to 22 then went to the next frame where it proceeded to apply the hitpause.

I don't know why JZ used AnimElemTime instead of just AnimElemNo but this seems to work correctly and is simpler!

*old coding commented out in example

     Posted: June 04, 2014, 11:28:46 pm
Okay, the mistake was all mine

Spoilering where Byakko pointed out I just wasn't grasping animelemno at all apparently Long story short, JZ's coding is right and I was just dumb =p

Spoiler, click to toggle visibilty
Re: Having animations play through hitpause (Capcom converters PLEASE READ!)
#14  June 05, 2014, 04:10:49 am
  • *****
  • Gaps? Where we're going, we don't need gaps...
    • USA
    • ricepigeon.neocities.org
Something just came across my mind while taking another look at this: explods. Specifically, Explods that are part of an attack's effect and, thus, ignore hitpause. Since Mugen doesnt give the option to ignore part of the hitpause like what's being accomplished here, wouldn't this cause desynchronization?
Re: Having animations play through hitpause (Capcom converters PLEASE READ!)
#15  August 21, 2014, 12:20:19 am
  • ******
  • Loyal to the Game
    • USA
    • http://jesuszilla.trinitymugen.net/
If they ignore hitpause, what's the issue?

Also, the explods I've usually seen on moves usually play right through this. If they don't, then worst case scenario, you have to use a helper. You could also split up the explod frame-by-frame in order to account for this.
Re: Having animations play through hitpause (Capcom converters PLEASE READ!)
#16  September 19, 2014, 12:57:04 am
  • *****
  • Shame on you!
    • USA
I could have used this a while back. Bookmarked for sure. I've had a couple moves where I've totally had to readjust the animation(s) and hitdef's timings. I think my Juri718 will like this code a lot. She has a lot of "hop over" kicks that stick in the air and dont come down fast enough. This is ideal for those moves.
vVv Wheat Stage Released vVv
Re: Having animations play through hitpause (Capcom converters PLEASE READ!)
New #17  April 01, 2018, 11:44:33 pm
  • avatar
    • Benin
Greetings everyone, I've also found a simple way to solve the problem. But note that this method gives priority to the pausetime attribute of your hitdef. If its value is > 0, your hitpausetime ends before the changeanim time starts. Also, if the time used in the changeanim state is < to your hitdef's pausetime, the anim won't continue to play until hitpausetime finishes.
Okay, just give it a try. Here is the code :

Code:
[state <number>, time offset]
type = VarSet
trigger1 = movecontact
var(x) = <integer>

[state <number>, ChangeAnim]
type = ChangeAnim
trigger1 = movecontact
trigger1 = time <= var(x)
value = anim
elem = z ;to play your anim starting from frame number 'z'
persistent = 1
Last Edit: April 02, 2018, 12:00:39 am by Novames00