YesNoOk
avatar

Wave Dashing System ala VS games (or MvC-MvC2 style games) (Read 8419 times)

Started by FerchogtX, September 08, 2012, 09:30:42 am
Share this topic:
Wave Dashing System ala VS games (or MvC-MvC2 style games)
New #1  September 08, 2012, 09:30:42 am
  • ***
  • Fuck Windows 8!!!! I use adult OSes to work!!!
    • Mexico
Hi there people!!!!

Well, while doing some stuf, I realized that my current dash system is shit, so I decided to take a closer look o the Dash system in MvC and I found interesting info so far, so, as an introduction, I'll writte what I found and after, how you can implement this to your MvC styled chars:

How does it work?
It's quite simple indeed, you alredly know that a dash is a short aproaching movement towards an enemy, can be a hop or a short run, however, this has features that are different from running, the first is that the dash stops automatically after certain amount of ticks and not when releasing the direction arrow.

The second is that you are able to crouch, guard and attack inmediately after executing dash.

But, this is not so simple, you may think: "ctrl 1 will do... isn't it?" Shotr answer: No...

Inside Dashing Codes
When you execute a dash, at least in vs styled games, there are a few features that makes this move somewhat tricky to code, the first is that, when you back dash, if you used ctrl 1 to enable attacks and other moves, and you crouch from it, you inmediately get vel X = 0, which is wrong... when you crouch from a dash, you are supposed to slide before reaching vel x = 0.

Because of this, you need to disable ctrl in all your dash states, yeah... that's right, no control. Now you will find that you cannot do moves as you did before, but a trigger containing stateno = 100 or stateno = [100,106] will do it just fine. For other stuff like guarding and crouching you might add a changestate in the dash states so you can do that inmediately after dashing if needed. This solves sliding stuff, but wave dashing? Here we go then...

Wave Dashing... the headache?
You may notice that, if you played any vs game and you know how to wave dash, most of vs styled chars are not able to do it as they did in their original games, this is why: In mugen, any dash state has a statetype of S and can only be executed while you are in a S statetype also, and here comes the trick... whether is a bug in vs system engine or not, this disables wave dashing in mugen.

In vs games, Dash states INHERIT statetypes from previous states, and also can be executed from state 10 along with state 0, 20 or even 52, yes, state 10, not 11 or 12, 10... Because of this, if you dash from state 0, you inherit statetype S, BUT if you do it from state 10, you inherit C statetype... crazy isn't it? but ths is not the end...

Also, if you press down while you execute the dash command (this leading you to execute from state 10) and inherit this statetype, you can do CROUCHING attacks inmediately without crouching... yes you guessed right, you are already in statetype = C, so you don't need to crouch again. More tricky? if you are in C staetype in dash AND you release down command, you then recover S statetype... CRAZY!!! this is the part that enables wave dashing.

As you can see, is really weird how capcom handles this stuff, but because of this we get a feature widely used in tournaments and stuff, the wave dash.

Enough babling, GIMME THE CODE!!!!!!!!
Sure...

First, override state 10 (DO NOT REPLACE UNLESS YOU KNOW WHAT YOU ARE DOING) with this:
Code:
;---------------------------------------------------------------------------
; Stand to Crouch
[Statedef 10]
type    = C
physics = N
anim = 10

[State 10, 1]
type = VelSet
trigger1 = abs(vel x) < Const(movement.crouch.friction.threshold)
x = 0

[State 10, 2]
type = VelMul
trigger1 = !(PrevStateNo = [100, 106])
x = const(movement.crouch.friction)

[State 10, 3]
type = ChangeState
triggerall = !ctrl
trigger1 = AILevel = 0 && command != "holddown"
value = 12
ctrl = 1

[State 10, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
ctrl = 1

The important part here is the changestate to state 12 when NOT IN CONTROL, you will need that changestate controller otherwise, weird behaviours may occur while crouching from the dash state. Also note that friction is not aplied if you come from dashing states.

Now, the Dash states:
Code:
;-------------------------------------------------------------------
; Dash Foward
[Statedef 100]
type    = U ;Original Capcom Value, normal should be S
movetype = I
physics = N
anim = 100
ctrl = 0
sprpriority = 1

[State 101, 2]
type = VelSet
trigger1 = Time = 0
y = 0

[State 101, 3]
type = PosSet
trigger1 = Time = 0
y = 0

[State 100, 1]
type = VelSet
trigger1 = AnimElem = 3
x = const(velocity.run.fwd.x)

; Due to Statetype bug in vs games, you obviously
; cannot crouch if your state is already crouch.
[State 1xx, Crouch]
type = ChangeState
triggerall = StateType = S
trigger1 = AILevel = 0 && command = "holddown"
value = 10

[State 1xx, Jump]
type = ChangeState
trigger1 = AILevel = 0 && command = "holdup"
value = 40

[State 1xx, Guard]
type = ChangeState
trigger1 = AILevel = 0 && (command = "holdback" && InGuardDist)
value = 120

 ;Capcom has a bug in their dash states in vs games, this
; is added to emulate that bug...
[State 1xx, DSH-BUG.n] ;This thing makes possible to wavedash ala mvc2
type = StateTypeSet
triggerall = StateType = C
trigger1 = AILevel = 0 && command != "holddown"
statetype = S

[State 100, 2]
type = ChangeState
trigger1 = Time = 20
value = 101

;-------------------------------------------------------------------
; Dash Foward (stop)
[Statedef 101]
type    = U ;Original Capcom Value, normal should be S
movetype = I
physics = S
ctrl = 0
anim = 101

[State 106, 1]
type = VelSet
trigger1 = abs(vel x) < Const(movement.stand.friction.threshold)
x = 0

[State 101, 2]
type = VelSet
trigger1 = Time = 0
y = 0

[State 101, 3]
type = PosSet
trigger1 = Time = 0
y = 0

; Due to Statetype bug in vs games, you obviously
; cannot crouch if your state is already crouch.
[State 1xx, Crouch]
type = ChangeState
triggerall = StateType = S
trigger1 = AILevel = 0 && command = "holddown"
value = 10

[State 1xx, Jump]
type = ChangeState
trigger1 = AILevel = 0 && command = "holdup"
value = 40

[State 1xx, Guard]
type = ChangeState
trigger1 = AILevel = 0 && (command = "holdback" && InGuardDist)
value = 120

 ;Capcom has a bug in their dash states in vs games, this
; is added to emulate that bug...
[State 1xx, DSH-BUG.n] ;This thing makes possible to wavedash ala mvc2
type = StateTypeSet
triggerall = StateType = C
trigger1 = AILevel = 0 && command != "holddown"
statetype = S

[State 101, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Dash Back
[Statedef 105]
type    = U ;Original Capcom Value, normal should be S
movetype = I
physics = N
ctrl = 0
anim = 105
sprpriority = 1

[State 101, 2]
type = VelSet
trigger1 = Time = 0
y = 0

[State 101, 3]
type = PosSet
trigger1 = Time = 0
y = 0

[State 105, VelAdd]
type = VelAdd
trigger1 = AnimElemNo(0) >= 2
y = const(movement.yaccel)

[State 105, 1]
type = VelSet
trigger1 = AnimElem = 2
x = const(velocity.run.back.x)
y = const(velocity.run.back.y)

; Due to Statetype bug in vs games, you obviously
; cannot crouch if your state is already crouch.
[State 1xx, Crouch]
type = ChangeState
triggerall = StateType = S
trigger1 = AILevel = 0 && command = "holddown"
value = 10

[State 1xx, Jump]
type = ChangeState
trigger1 = AILevel = 0 && command = "holdup"
value = 40

[State 1xx, Guard]
type = ChangeState
trigger1 = AILevel = 0 && (command = "holdback" && InGuardDist)
value = 120

 ;Capcom has a bug in their dash states in vs games, this
; is added to emulate that bug...
[State 1xx, DSH-BUG.n] ;This thing makes possible to wavedash ala mvc2
type = StateTypeSet
triggerall = StateType = C
trigger1 = AILevel = 0 && command != "holddown"
statetype = S

[State 105, 2]
type = ChangeState
trigger1 = Pos Y >= 0 && Vel Y > 0
value = 106

;---------------------------------------------------------------------------
; Dash Back (stop)
[Statedef 106]
type    = U ;Original Capcom Value, normal should be S
movetype = I
physics = S
ctrl = 0
anim = 106

[State 106, 1]
type = VelSet
trigger1 = abs(vel x) < Const(movement.stand.friction.threshold)
x = 0

[State 106, 2]
type = VelSet
trigger1 = Time = 0
y = 0

[State 106, 3]
type = PosSet
trigger1 = Time = 0
y = 0

; Due to Statetype bug in vs games, you obviously
; cannot crouch if your state is already crouch.
[State 1xx, Crouch]
type = ChangeState
triggerall = StateType = S
trigger1 = AILevel = 0 && command = "holddown"
value = 10

[State 1xx, Jump]
type = ChangeState
trigger1 = AILevel = 0 && command = "holdup"
value = 40

[State 1xx, Guard]
type = ChangeState
trigger1 = AILevel = 0 && (command = "holdback" && InGuardDist)
value = 120

 ;Capcom has a bug in their dash states in vs games, this
; is added to emulate that bug...
[State 1xx, DSH-BUG.n] ;This thing makes possible to wavedash ala mvc2
type = StateTypeSet
triggerall = StateType = C
trigger1 = AILevel = 0 && command != "holddown"
statetype = S

[State 106, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

As you can see, this thing is very generic, at this point, this allows you to jump, crouch and guard even at time = 0 in that states, changestate to state 10 SHOULD be like that and not giving control, otherwise wave dashing will be overriden by other commands, that's why we overrided state 10.

Then, in your command file you may add:
Code:
;--------------------------------------------------------------------------
;Dash Back
[State -1, Dash Back]
type = ChangeState
value = 105
triggerall = stateno = 0 || stateno = 5 || stateno = 10 || stateno = 20 || stateno = 52 || stateno = [100,101]
trigger1 = AILevel = 0 && (command = "BB" || ((command = "holdback") && (command = "x") && (command = "y")))

;--------------------------------------------------------------------------
; Dash Fwd
[State -1, Dash Fwd]
type = ChangeState
value = 100
triggerall = stateno = 0 || stateno = 5 || stateno = 10 || stateno = 20 || stateno = 52 || stateno = [105,106]
trigger1 = AILevel = 0 && (command = "FF" || ((command = "x") && (command = "y")))

If you got no state 5 (turning state) you can remove it, otherwise (like me for auto turning after landing) you can keep that.

With all of this you are supposed to enable your char for wave dashing just like it works on vs games.

Extras:
  • This works in both winmugen and mugen 1.0
  • AIlevel can be replaced with any var if you are using winmugen
  • Const(movement.stand.friction.threshold) can be replaced with either 0 or 2 as a value if you use winugen. Or you can simply remove those sctrls since they are used only in MUGEN 1.0 and above...
  • "FF" or "BB" command can be replaced with any comand label you have defined for dashing, in fact any command for dashing can be replaced, but as suggestion, it works beter with x and y commands by themselves and hold back in case of back dash, "FF" and "BB" are the really optional ones...
  • You can customize the velset parameter for aplying your vel to the dash states, in this case is animelem = 3, but can be time = 0 or animelem = 2... with this, the character slides in the wave dash (between state 10 and the new dash) and doesn't stop, just like in vs games!!!. Time to change from state 100 to 101 and 105 to 106 and / or triggers can be customized for you character needs also.
  • Remember to add stateno = [100,106] trigger to your attack states along with ctrl && statetype = whatever (specially for crouching and standing attacks) since this states now have no control, also you don't need to add noutoturn or nowalk assertspecials because ctrl = 0 does that for you.
  • All your stand or crouching attacks should face your opponent if facing is equal to his from dashing (or not), if not, you should add a Turn sctrl to every land attack you have.
  • For crouching attacks, you may notice you cannot execute them inmediately after crouching from any dash, you solve that issue adding a ctrl || stateno = 10 to those state triggers...
  • For any attack you add, you need to add the stateno = [100,106] or/and stateno = [10,12] so you can execute them without issues.

I hope this work for you guys :) If you got questions, feel free to ask.

See ya!!! :D

P.D. Added a lil' change in the state 10 changestate into state 12, added the line ctrl = 1, solving minor issues in super move execution.
This is the era in which we will see reason triumphing against brutality... May be better to open your mind to the future.
------------------------------------------------------
<- [Clicky - Clicky]
Current Universal War Official Artwork
Last Edit: September 17, 2012, 02:41:32 am by FerchogtX