YesNoOk
avatar

Diary of the creation of a P.o.t.S character Part 3: Perfect Guard (Read 2411 times)

Started by Ziltoid, September 01, 2020, 09:20:01 am
Share this topic:
Diary of the creation of a P.o.t.S character Part 3: Perfect Guard
New #1  September 01, 2020, 09:20:01 am
  • **
  • Indeed
Previous parts:

Part 1: Basic Movements

Part 2: Run, Dash, Evade, Power Charge, Zero Counter, Parry

Next parts:

Part 4: Lose and Intro animations

Part 5: Constants, Win animations, Taunts

Part 6: Universal Helpers


Part 3: Custom Combo, Recovery, Guard

Greetings! I'm proud to announce that I'm COVID free. I had to get tested yesterday because some untrustful coworkers didn't believe me when I told them that I didn't spend my very short vacations in crowded places. I despise crowds, why should I put myself into one NOW, of all historical times? Especially when I have more important stuff to do, such as sleeping? But at least now I know I'm clean from this fetid disease.


That said, let's dive in. In this section I'll tackle one of the iconic features of P.o.t.S-ish characters: the infamous Custom Combo. Later on, we'll work on the fall recovery and guard states.


CUSTOM COMBO
This is, in my opinion, one of the best, most iconic, and most fun features of P.o.t.S, and something I looked forward to learn how to implement, since its presence/absence is one of the most striking differences between characters.
In fact, for a long time, if you asked me what was the difference between certain P.o.t.S styled characters, I would have just answered "some have the Custom Combo mode, some have the Max Mode". Sweet summer child, was I...

Being this an universal feature, I didn't really expect any difference between reference characters, and in fact I didn't find any except for the grunt sounds and Explod position.

Old Ryu had this mechanic under the StateDef 760. As usual, since this is my main goal, I'll be changing it to the more modern version which is 900.

Spoiler, click to toggle visibilty

The code itself was surprisingly straightforward. It consists pretty much on the activation of a flying variable that changes the properties of moves, and the rest are just fancy visual effects and a timer.

At the start of the code we triggered (or rather, un-triggered) the fvar(5) giving it a value of zero for the duration of the StateDef. It has been described as "amount of corner push", so it's pretty clear to me that this is the true heart of the Custom Combo mode. How this fvar does this, we'll see in a later part. That's all we need to know right now.

Now we'll handle the aerial version, which will have the same code with some difference due to this move being, well, aerial. Most notably, a landing finish state.

Spoiler, click to toggle visibilty

Nothing we haven't seen in the previous section. Ryu's states were 762 and 763 before. We'll be adding some new anims.

Spoiler, click to toggle visibilty


SAFE FALL
This part is unchanged between Ryu and every character I checked. Again, there's no real reason to mess with this mechanic.

Spoiler, click to toggle visibilty

In this part, there are some VelSets to look upon, which I highlighted below. I compared the values with Jmorphman's Ken for reference and I found out they were the same. I don't know if they are universal for CvS-styled characters or something like that, or if the values are the same because of the similar looking animation 5200 between them. Considering what KarmaChameleon explained me earlier, I'm more inclined towards thinking they are universal values, or at least semi-universal.

EDIT: KarmaChameleon confirmed there are universal values.

The sound, fx and helper are definitely universal. Some characters also have a landing dust explod, some (including old Ryu and Jmorphman's Ken) don't. I decided to add it, I tested it, I was not convinced, and I took it out.

Spoiler, click to toggle visibilty

And now the air version of the safe recovery. The VelSet was interesting to study: basically, the directional input does nothing more than changing your falling velocity as an evasive maneuver by some universal amounts. Looking at the codes is making me appreciate more these details.

Spoiler, click to toggle visibilty

Ok, we have a pretty bunch of related fall and recovery animations to add.

Spoiler, click to toggle visibilty

To be honest, I'm not sure why this part is always at this point of the System.st file. On Ryu it was almost at the end, which makes sense in a way.


GUARD
Now we'll study the guard states. This will be long, but not very difficult since we're dealing with universal mechanics. Let's get to it piece by piece.

Below we'll see some basic StateTypeSet that will dictate if we're in a standing, crouching or jumping state, a VelSet that makes our character stop, some commands to switch between standing and crouching guard, and AI controllers. We're aiming to standardize the characters, so these need to be universal.

Unsurprisingly, I found this block to be identical to old Ryu's.

Spoiler, click to toggle visibilty

This one was identical too (except for the land sound, which I need to regroup, again). Here are some AI controllers plus a command controller to switch to crouch guard or stop guarding, plus the landing sound and explods.

Spoiler, click to toggle visibilty

Nothing to say I haven't said earlier. Let's move on.

Spoiler, click to toggle visibilty

Something new here: a sysvar that, as far as I understand, gives a recoil effect to the air guarding by maneuvering the velocities through various VelSets and VarSets. I might be wrong though, I'll like to have some insight from someone more knowledgeable.

But again, it's conserved and universal, so I'll just take it and put it in.

Spoiler, click to toggle visibilty

This code dictates how the character switches back from the guard state. So, most is stuff I've already covered.

Spoiler, click to toggle visibilty

The following is a long-ass bunch of codes that dictate how the character behaves when he's hit. Among the new stuff we see a ChangeState triggered by a HitShakeOver, which leads to the subsequent knocked back states. It's good to try to dissect everything, but again, we're dealing with universal core mechanics so it's not really necessary for my purposes.

Spoiler, click to toggle visibilty

The air jump version of these states, again, are a bit different from the ground version for having the sysvar that controls the velocities.

Spoiler, click to toggle visibilty

There was zero differences between all characters I checked, including old Ryu. This comes of no surprise. Time to port the corresponding animations. Again, the hiboxes are taken from Ken.

Spoiler, click to toggle visibilty

Two words on the anims, since I slightly edited them. The guard end animations were multi-sprite in some characters, I guess it depends on how many sprites your character have. I added a sprite on Ryu's to make it smoother.
The jumping guard end always needs some sprites from the landing animation, of course. Ryu had only three. I edited a bit Ryu's using Jmorphman's Ken's as a template, again, to make it smoother.


And that's it for today! A bit long, but nothing really hard to understand or translate to the new template. Next time I'll deal with the initialize states (5900, 5901), I'll set some variables in the config file, after that there will be some cool but not-really-essential things such as wins and intros.

As always, feel free to correct, criticize, insult, whatever. And now that you know I'm COVID free, you can also slap me in the face safely. Until next time!


Previous parts:

Part 1: Basic Movements

Part 2: Run, Dash, Evade, Power Charge, Zero Counter, Parry


Next parts:

Part 4: Lose and Intro animations

Part 5: Constants, Win animations, Taunts

Part 6: Universal Helpers

Last Edit: September 12, 2020, 07:37:16 pm by Ziltoid
Re: Diary of the creation of a P.o.t.S character Part 3: Perfect Guard
#2  September 01, 2020, 01:36:44 pm
  • ***
  • In a few minutes, bitch
    • Germany
Heyy. Since most of the stuff here is quite generic and doesn't need changes, I'll only focus on the couple things that are worth pointing out:

* On State 5201 (Ground Fall Recovery)

Code:
[State 5201, VelSet]
type = VelSet
trigger1 = AnimElem = 5
x = 0

This determines when the character stops moving. It's necessary in the sense that does make changes towards how the move works. If you don't introduce this, Ryu will move thru the duration of AnimElem = 5. If it's 3 ticks, it's 3 extra ticks that he's moving. There are characters with longer animations, like Jmorphman's Benimaru. If he hadn't had a VelSet like this he would move for about 11 more ticks.

* On State 5210 (Air Fall Recovery)

Code:
[State 5210, NotHitBy]
type = NotHitBy
trigger1 = AnimElemTime(6) < 0
value = SCA
time = 1

[State 5210, CtrlSet]
type = CtrlSet
trigger1 = AnimElemTime(6) >= 0
value = 1

This controllers determine the invincibility and control of the move. The idea is to make it invulnerable until he's falling. Once again, there are characters with longer animations like Jmorphman's Benimaru. His animation has 9 elements, so Jmorphman changed triggers to match that.

In the Ground Fall recovery once again, the .air file does the lifting and that's the part that needs customization. While the values are universal (at least in POTS System but probably on source too), every character will have different animations for these two mechanics, and these are the important timings to mimic.

These are things that are not gamebreaking but they're worth pointing out.

Another thing that you should pay attention to are the hitboxes and hurtboxes. If you look Jmorphman's Benimaru hitboxes (CvS2 ones) you'll notice that he reuses the stance boxes for... A LOT of animations. This is a behavior consistent with CvS2 and Ryu should change accordingly. Hurtboxes behave differently from game to game. Vampire Savior, for example, alter their boxes whenever the characters are hit, which matters a lot for comboing as certain attacks won't connect into certain characters. This part is such an important part of fighting game design that by Vampire Savior 2 Capcom nerfed one character's standing hurtbox by making it bigger. Neutral boxes are important too, which is why in the same game Q Bee got a bigger crouching hurtbox.

For things that are even more overlooked, like transition animations between Standing and Crouching, I suggest you to look up for fuzzy guard.

I'm glad you tested negative for COVID :)
Re: Diary of the creation of a P.o.t.S character Part 3: Perfect Guard
#3  September 01, 2020, 03:53:38 pm
  • **
  • Indeed
Hey man! As always, your insights are deeply appreciated!

* On State 5201 (Ground Fall Recovery)

Code:
[State 5201, VelSet]
type = VelSet
trigger1 = AnimElem = 5
x = 0

This determines when the character stops moving. It's necessary in the sense that does make changes towards how the move works. If you don't introduce this, Ryu will move thru the duration of AnimElem = 5. If it's 3 ticks, it's 3 extra ticks that he's moving. There are characters with longer animations, like Jmorphman's Benimaru. If he hadn't had a VelSet like this he would move for about 11 more ticks.

Ok so, this means that Ryu is supposed to stop at AnimElem = 5, and if I don't put the VelSet he'll stop right at the end of this AnimElem instead. Got this, thanks!

* On State 5210 (Air Fall Recovery)

Code:
[State 5210, NotHitBy]
type = NotHitBy
trigger1 = AnimElemTime(6) < 0
value = SCA
time = 1

[State 5210, CtrlSet]
type = CtrlSet
trigger1 = AnimElemTime(6) >= 0
value = 1

This controllers determine the invincibility and control of the move. The idea is to make it invulnerable until he's falling. Once again, there are characters with longer animations like Jmorphman's Benimaru. His animation has 9 elements, so Jmorphman changed triggers to match that.

I think I figured that out actually, but thanks for clarifying. What I meant in the commentary is that P.o.t.S decided the point in which the invincibility and control is activated by considering the absolute time, instead of on the animation itself. What I did was trying to understand at what point in the animation this happens in other characters. I saw that it happens when the character is falling, regardless of the animation itself (reason why Benimaru has it triggered differently). Am I understanding this correctly?

In the Ground Fall recovery once again, the .air file does the lifting and that's the part that needs customization. While the values are universal (at least in POTS System but probably on source too), every character will have different animations for these two mechanics, and these are the important timings to mimic.

Can you elaborate a bit on this?

Another thing that you should pay attention to are the hitboxes and hurtboxes. If you look Jmorphman's Benimaru hitboxes (CvS2 ones) you'll notice that he reuses the stance boxes for... A LOT of animations. This is a behavior consistent with CvS2 and Ryu should change accordingly. Hurtboxes behave differently from game to game. Vampire Savior, for example, alter their boxes whenever the characters are hit, which matters a lot for comboing as certain attacks won't connect into certain characters. This part is such an important part of fighting game design that by Vampire Savior 2 Capcom nerfed one character's standing hurtbox by making it bigger. Neutral boxes are important too, which is why in the same game Q Bee got a bigger crouching hurtbox.

First thing, gotta say I'm impressed by your overall fighting game knowledge. Now I understand why most details fly over my head. Also, I played a lot of Darkstalkers 3 (but never the other versions, unfortunately), and this explains why combos were such a russian roulette.

Most importantly for the topic at hand, I wasn't aware that in CvS the hitboxes were mostly consistent between characters. In short, you're suggesting me to borrow the hitboxes from those characters to coordinate Ryu with CvS's standards, right?
Last Edit: September 01, 2020, 04:12:14 pm by Ziltoid
Re: Diary of the creation of a P.o.t.S character Part 3: Perfect Guard
#4  September 01, 2020, 04:33:56 pm
  • ***
  • In a few minutes, bitch
    • Germany
I think I figured that out actually, but thanks for clarifying. What I meant in the commentary is that P.o.t.S decided at what point activating the invincibility and control based on the absolute time, instead of the animation itself. What I did was trying to understand at what point in the animation this happens in other characters. I.e. when he's falling, independently of the animation itself, reason why Benimaru has it triggered differently. Am I understanding this correctly?
Yes! You are.

In the Ground Fall recovery once again, the .air file does the lifting and that's the part that needs customization. While the values are universal (at least in POTS System but probably on source too), every character will have different animations for these two mechanics, and these are the important timings to mimic.

Can you elaborate a bit on this?
Sure.

Once again the universal velocity is the same:

Code:
[State 5201, VelSet]
type = VelSet
trigger1 = !Time
x = -5
y = 0

[State 5201, VelSet]
type = VelSet
trigger1 = AnimElem = X
x = 0

What you can custom in here is when it stops (AnimElem = X). For example, Jman's Ken and Benimaru both stop at AnimElem = 5. Does this mean they travel the same distance? Not really, because as said, the .air does the lifting here. The tickcount for Benimaru's AnimElem 1-4 is 10, while Ken's is 13. This means that Ken will stop 3 ticks later than Benimaru, essentially traveling 15 more pixels worth of distance. Once again, the timings on .air decide when to "press the brakes". My Yun has AnimElem = 6 as trigger, but what's important is that the tickcount for his AnimElem 1-5 is 15, so he'll move 2 ticks more than Ken, traveling 10 more pixels than Ken and 25 more pixels than Benimaru.

Again, universal internal velocities, different distances due to animation timings, just like roll. Is it really THAT important? Nah. But 25 pixels is the difference between my Yun doing close or far forward.

First thing, gotta say I'm impressed by your overall fighting game knowledge. Now I understand why most details fly over my head. Also, I played a lot of the console Darkstalkers 3 (but never the other versions, unfortunately), and this explains why combos were such a russian roulette.

Most importantly for the topic at hand, I wasn't aware that in CvS the hitboxes were mostly consistent between characters. In short, you're suggesting me to borrow the hitboxes from those characters to coordinate Ryu with CvS's standards, right?
I might have been confusing with my wording.

They're consistent in the way they're implemented in the game, no between each other. Chun Li and Ryu will have different standing hitboxes, but both will use their respective standing hurtboxes for the same animations.

Compare Jmorphman Ken hurtboxes for Standing (0), Turning (5), Walking (20, 21), Landing (47, 57), Dashing (105, 106, 110, 111), Being Hit (5000-5017), Guarding (120), Taunting (195), Power Charging (730), and even Throwing (800). You can check out some of the startup boxes on the attacks too.

You'll find out that he's using the exact same hurtboxes for every single one of them. This is not him being lazy, this is how CvS2 handles hurtboxes. Do the same exercise for Chuns, Benimaru, or any of my characters.

What I'm "suggesting" is to settle down on one hurtbox for standing/crouching/jumping and recycle them every time they're needed. You can borrow Jman's Ken boxes as I'm 99% sure that the system hitboxes for Ryu and Ken are the same in source.
Re: Diary of the creation of a P.o.t.S character Part 3: Perfect Guard
#5  September 01, 2020, 04:55:47 pm
  • **
  • Indeed
Once again the universal velocity is the same:

Code:
[State 5201, VelSet]
type = VelSet
trigger1 = !Time
x = -5
y = 0

[State 5201, VelSet]
type = VelSet
trigger1 = AnimElem = X
x = 0

What you can custom in here is when it stops (AnimElem = X). For example, Jman's Ken and Benimaru both stop at AnimElem = 5. Does this mean they travel the same distance? Not really, because as said, the .air does the lifting here. The tickcount for Benimaru's AnimElem 1-4 is 10, while Ken's is 13. This means that Ken will stop 3 ticks later than Benimaru, essentially traveling 15 more pixels worth of distance. Once again, the timings on .air decide when to "press the brakes". My Yun has AnimElem = 6 as trigger, but what's important is that the tickcount for his AnimElem 1-5 is 15, so he'll move 2 ticks more than Ken, traveling 10 more pixels than Ken and 25 more pixels than Benimaru.

Again, universal internal velocities, different distances due to animation timings, just like roll. Is it really THAT important? Nah. But 25 pixels is the difference between my Yun doing close or far forward.

Ok it's clearer now, it's pretty much the same principle as the back dash. It may be not really important, but this is the kind of detail I want to learn to pay attention to.

Also, if the universal value is x = -5 I need to change it. I put the x = -8 I found on old Ryu. I'm also noticing there's no VelMul on your and Jmorphman's characters, I'll take it out too.

I might have been confusing with my wording.

They're consistent in the way they're implemented in the game, no between each other. Chun Li and Ryu will have different standing hitboxes, but both will use their respective standing hurtboxes for the same animations.

Compare Jmorphman Ken hurtboxes for Standing (0), Turning (5), Walking (20, 21), Landing (47, 57), Dashing (105, 106, 110, 111), Being Hit (5000-5017), Guarding (120), Taunting (195), Power Charging (730), and even Throwing (800). You can check out some of the startup boxes on the attacks too.

You'll find out that he's using the exact same hurtboxes for every single one of them. This is not him being lazy, this is how CvS2 handles hurtboxes. Do the same exercise for Chuns, Benimaru, or any of my characters.

What I'm "suggesting" is to settle down on one hurtbox for standing/crouching/jumping and recycle them every time they're needed. You can borrow Jman's Ken boxes as I'm 99% sure that the system hitboxes for Ryu and Ken are the same in source.

Oooooooh ok, it makes MUCH more sense now! Ok, before doing the next part I'll update all the animation I've got 'til now following this principle. Thank you!