YesNoOk
avatar

Alternative KOF Cornerpush coding by YongMing. (Read 12020 times)

Started by 外音リザ, October 28, 2005, 08:35:29 pm
Share this topic:
Alternative KOF Cornerpush coding by YongMing.
#1  October 28, 2005, 08:35:29 pm
  • ****
  • Lost all his MUGEN stuff in hard disk crash. :(
  • CHIKARA TO EIKOU!!!
    • Philippines
    • Skype - o_hermanm
    • www.rotbrc.com
YongMing and I were discussing earlier about how much of KOF hitdefs are mere copy-paste between the games. Then he mentioned to me that the cornerpush system of MUGEN is borked when it comes to KOF accuracy. And so, for KOF Remix, he wrote a longhand but accurate method to do this.

Note that when you have this system on, you will never need to rely on cornerpush.veloff ever again.

1. Prepare your character for integration. Add or substitute the values below in every basic attack hitdef.
Code:
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0

2. Paste the following in statedef -2.

Code:
; Alternate Cornerpush by YongMing
[State -2, Corner Push]
type = Varset
triggerall = numtarget >= 1
triggerall = (target, BackEdgeBodyDist <= 0) || (target, FrontEdgeBodyDist <= 0)
triggerall = target, movetype = H
triggerall = target, vel y = 0
triggerall = ProjContact = 0, < 50
trigger1 = target, statetype = S
trigger2 = target, statetype = C
fvar(6) = ifelse(target, BackEdgeBodyDist <= 0,target, vel x,-target, vel x)
ignorehitpause = 1

[State -2, Corner Push]
type = Varset
triggerall = numtarget >= 1
triggerall = fvar(6) = 0
triggerall = (target, BackEdgeBodyDist <= 0) || (target, FrontEdgeBodyDist <= 0)
triggerall = target, gethitvar(hitshaketime) = 0
triggerall = target, GetHitVar(yvel) = 0
triggerall = ProjContact = 0, < 50
trigger1 = target, stateno = 5000
trigger2 = target, stateno = 5010
trigger3 = target, stateno = 150
trigger4 = target, stateno = 152
fvar(6) = ifelse(facing = -1 && target, BackEdgeBodyDist <= 0,target, gethitvar(xvel),-target, gethitvar(xvel));left right inbalance bugs cause by mugen!!!!
ignorehitpause = 1

[State -2, Corner Push]
type = posadd
triggerall = numtarget >= 1
trigger1 = fvar(6) != 0
x = fvar(6)

[State -2, Corner Push]
type = Varset
trigger1 = numtarget = 0
fvar(6) = 0

You may need to do adjustments for the coding afterwards.

3. If your character moves during a superpause, program all 4 controllers NOT to trigger during superpauses.

4. Testplay and tweak until the desired effects are achieved.
Orochi Herman: MUGEN Creator, Producer Video Editor and Web Programmer

And possibly more other shady things lol

https://www.facebook.com/OrochiHerman/
Re: Alternative KOF Cornerpush coding by YongMing.
#2  February 03, 2007, 08:36:58 am
  • ****
  • "Moyashi tsuku shite yaru..."
There's one big problem in this code and I don't know how to fix it. When you do a combo in the corner and all hits land cornerpush velocity "sums up" resulting in pushing back your character nearly at the other edge of the screen :-X :S --;
Re: Alternative KOF Cornerpush coding by YongMing.
#3  February 04, 2007, 07:38:43 pm
  • ****
  • "Moyashi tsuku shite yaru..."
I guess nobody else cares for now... :-X
Re: Alternative KOF Cornerpush coding by YongMing.
#4  February 04, 2007, 09:41:24 pm
  • ******
  • [E]
    • Mexico
i do care, personally, instead of saving to a var and checking corner dist, what i would do is jsut modify the front edge. here is a rant about corner pushing i wrote while researching hitdefs.
Quote
* About corner push (ground)
corner push is totally diferent, it is not affected by the char's friction ,that is the reason it
is only a very vague (less than 80%) aproximate to kof >.< )
the friction is .7 , it is aplyed after the first tick,unlike the normal friction (when
physics = S or  C) the movement stops when the vel is < 0  or, when p1 touches the ground,
if an aerial attack then. The aproximate kof friction is .82,while in mugen is .7,

air one is totally screwed, since it works totally opossed as in kof (in kof , the vel
starts being applyed in the moment it stops being so in mugen).So, i made it so you have
a vel = 5 ,and a dist of 44 after 6 ticks for hard attacks , init vel = 17 a vel = 2 ,
and a dist of 23 after 6 ticks for weak attacks, init vel = 9
That is is +50% (or *1.5) relative to the first kof displacement
A more acurate way should be to use width ctrls ,

Re: Alternative KOF Cornerpush coding by YongMing.
#5  February 19, 2007, 09:09:20 pm
  • ****
  • "Moyashi tsuku shite yaru..."
The most accurate KOF cornerpushes were made by zzzasd in his Kyo, but I have no idea how he made it
Re: Alternative KOF Cornerpush coding by YongMing.
#6  May 13, 2007, 12:56:32 am
  • ****
  • "Moyashi tsuku shite yaru..."
Now that I've gained some knowledge in mugen, I'll try to tweak YongMing's system to fit KOF XI gameplay.
Re: Alternative KOF Cornerpush coding by YongMing.
#7  May 13, 2007, 03:02:33 am
  • ****
  • "Moyashi tsuku shite yaru..."
Well, here's what I changed and everything seems to be working like in KOF XI.
; Alternate Cornerpush by YongMing
[State -2, Corner Push]
type = Varset
triggerall = numtarget >= 1
triggerall = (target, BackEdgeBodyDist <= 0) || (target, FrontEdgeBodyDist <= 0)
triggerall = target, movetype = H
triggerall = target, vel y = 0
triggerall = ProjContact = 0, < 50
triggerall = StateType != A; To prevent cornerpushing while in air
trigger1 = target, statetype = S
trigger2 = target, statetype = C
fvar(21) = ifelse(target, BackEdgeBodyDist <= 0,target, vel x,-target, vel x)
ignorehitpause = 0; Set to 0 to match KOF XI gameplay

[State -2, Corner Push]
type = Varset
triggerall = numtarget >= 1
triggerall = fvar(21) = 0
triggerall = (target, BackEdgeBodyDist <= 0) || (target, FrontEdgeBodyDist <= 0)
triggerall = target, gethitvar(hitshaketime) = 0
triggerall = target, GetHitVar(yvel) = 0
triggerall = ProjContact = 0, < 50
trigger1 = target, stateno = 5000
trigger2 = target, stateno = 5010
trigger3 = target, stateno = 150
trigger4 = target, stateno = 152
fvar(21) = ifelse(facing = -1 && target, BackEdgeBodyDist <= 0,target, gethitvar(xvel),-target, gethitvar(xvel));left right inbalance bugs cause by mugen!!!!
ignorehitpause = 0; Set to 0 to match KOF XI gameplay

[State -2, Corner Push]
type = posadd
triggerall = numtarget >= 1
trigger1 = fvar(21) != 0
x = fvar(21)

[State -2, Corner Push]
type = Varset
trigger1 = numtarget = 0
trigger2 = target,HitShakeOver; This is the main fix of the original code. This fixes the problem described by me in post #2 :)
fvar(21) = 0
Last Edit: May 13, 2007, 04:10:45 am by Elix
Re: Alternative KOF Cornerpush coding by YongMing.
#8  August 09, 2007, 03:20:12 am
  • ****
  • "Moyashi tsuku shite yaru..."
That one wasn't accurate (:P to myself)

Apart some minor mistakes, there was a huge flaw which made this code (not speaking of original Yong Ming's one) not being KOF-accurate: cornerpush started only after pausetime for P2 was over. It's P1's pausetime that should've been on this place.

Anyway, here's the code (I'll write some comments to make things more clear):

;-------------------------------------------------------------------------------
;--------------------- KOF Cornerpush by YongMing & Elix -----------------------
;-------------------------------------------------------------------------------
[Statedef -2]

[State -2, HitShakeOver VelSet]
type = VarSet
triggerall = NumTarget >= 1; Player gains a target when he attacks and his attack land on opponent (MoveContact), AFAIK.
triggerall = (target, BackEdgeBodyDist <= 0) || (target, FrontEdgeBodyDist <= 0); Being in the corner.
triggerall = target, MoveType = H; P2 is being in a hit state.
triggerall = target, Vel Y = 0; P2 is not being hit in the air.
triggerall = ProjContact = 0, < 50; Projectiles' attacks are not counted.
triggerall = StateType != A; Prevents cornerpush while being in the air.
trigger1 = target, StateType = S
trigger2 = target, StateType = C
fvar(0) = ifelse(target, BackEdgeBodyDist <= 0,target, Vel X,-target, Vel X)

[State -2, HitShake VelSet]
type = VarSet
triggerall = NumTarget >= 1
triggerall = fvar(0) = 0
triggerall = (target, BackEdgeBodyDist <= 0) || (target, FrontEdgeBodyDist <= 0)
triggerall = !HitPauseTime; The main difference between the old and this version. This stands instead of "target, GetHitVar(HitShakeTime) = 0"
triggerall = target, GetHitVar(yvel) = 0; Cornerpush isn't applied if the attack sends opponent in the air.
triggerall = ProjContact = 0, < 50
trigger1 = target, StateNo = 5000
trigger2 = target, StateNo = 5010
trigger3 = target, StateNo = 150
trigger4 = target, StateNo = 152
IgnoreHitPause = 1; Important for this controller to work.
fvar(0) = ifelse(facing = -1 && target, BackEdgeBodyDist <= 0,target, GetHitVar(xvel),-target, GetHitVar(xvel))

[State -2, Corner Push]
type = PosAdd
triggerall = NumTarget >= 1
triggerall = !NumExplod(3000); Explod that should be created to avoid cornerpush during SuperPause.
triggerall = HitShakeOver; Another important addition. This is needed when you and your opponent attack each other at the same time while being in the corner.
trigger1 = fvar(0) != 0
x = fvar(0)

[State -2, Velocity Reset]
type = VarSet
triggerall = fvar(0) != 0; I added this to reduce the amount of needless work for MUGEN when persistently resetting fvar(0).
trigger1 = !NumTarget
trigger2 = target,HitShakeOver
fvar(0) = 0

[State -2, SuperPause Explod]; An example of explod that is made
type = Explod
trigger1 = StateNo = 3000 && AnimElem = 1,=1; Just be sure not to set Time at 0 since negative states cannot process that.
IgnoreHitPause = 1
Anim = 9999; Blank animation
ID = 3000; Use whatever number you like
Pos = 0,0
PosType = P1
SprPriority = -7
Shadow = -1
RemoveTime = 28; The duration of your superpause here.
SuperMove = 1
PauseMove = 1
SuperMoveTime = 28; The duration of your superpause here.
PauseMoveTime = 28
It is not yet perfect. For example, I don't know why when your opponent and you attack each other at the same time sometimes the cumulative velocity is applied (this is how it should be) and sometimes not.

And don't forget to add this in every HitDef that have velocity set:

ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
Well, for you too see how this system works I implemented it on Kung-Fu Man.
http://www.4shared.com/file/21649726/356355d9/kfm_cornerpush.html

Any feedback is welcome.
Re: Alternative KOF Cornerpush coding by YongMing.
#9  August 10, 2007, 03:57:36 am
  • ******
    • Portugal
    • network.mugenguild.com/pots/
Sorry, I was just leaving by the time you sent the PM so I couldn't test it right away.
Tested with your KFM btw, to make sure we're talking about the same thing.

The biggest issue I found, that pretty much makes your code unusable as is, is that it makes the cornerpushed char always go farther than he should, eg the distance between KFM and opponent after a weak punch is 15 in the middle of the screen, but 20 in the corner. Doesn't seem to happen with YongMing's version.


Smaller stuff also present in the original:

Quote
triggerall = target, MoveType = H; P2 is being in a hit state.
Redundant, targets are only targets because they're in movetype=H, the moment they leave it they stop being targets.

Quote
triggerall = ProjContact = 0, < 50; Projectiles' attacks are not counted.
What if you manage to hit the opponent as they are being hit by a projectile (quite possible with some chars)? Didn't try it myself, but I guess the char wouldn't be cornerpushed.

Quote
trigger1 = target, StateType = S
trigger2 = target, StateType = C
No cornerpush when the char is hit on the floor? Never checked if it's supposed to cornerpush you, though.
You can help with Ikemen GO's development by trying out the latest development build and reporting any bugs on GitHub.
My Mugen and Ikemen content can also be found here.
Re: Alternative KOF Cornerpush coding by YongMing.
#10  August 10, 2007, 09:13:42 am
  • ****
  • "Moyashi tsuku shite yaru..."
Thanks for the feedback! I'll try to fix these issues.
Re: Alternative KOF Cornerpush coding by YongMing.
#11  September 06, 2007, 10:10:39 pm
  • ****
  • "Moyashi tsuku shite yaru..."
Quote
cornerpush started only after pausetime for P2 was over. It's P1's pausetime that should've been on this place.
Actually, that's not true. Disregard that last code. This is the code I currently use:
;-------------------------------------------------------------------------------
;------------------- Alternate Cornerpush by Yong Ming & Elix ------------------
;-------------------------------------------------------------------------------
[State -2, HitShakeOver VelSet]
type = VarSet
triggerall = NumTarget; Player gains a target when he attacks and his attack land on opponent (MoveContact), AFAIK.
triggerall = (target,BackEdgeBodyDist <= 0) || (target,FrontEdgeBodyDist <= 0); P2 being in the corner.
triggerall = !target, Vel Y; P2 is not being hit in the air.
triggerall = ProjContact = 0,<32; Projectiles' attacks are not counted. Set the value to a sum of your projectile's pausetime (for P2) and hittime.
triggerall = StateType != A; Prevents cornerpush while being in the air.
trigger1 = target, StateType = S
trigger2 = target, StateType = C
IgnoreHitPause = 0
fvar(21) = ifelse(target, BackEdgeBodyDist <= 0,target, Vel X,-target, Vel X)

[State -2, HitShake VelSet]
type = VarSet
triggerall = NumTarget
triggerall = !fvar(21)
triggerall = (target,BackEdgeBodyDist <= 0) || (target,FrontEdgeBodyDist <= 0)
triggerall = !target,GetHitVar(HitShakeTime)
triggerall = !target, GetHitVar(yvel); Cornerpush isn't applied if the attack sends opponent in the air.
triggerall = ProjContact = 0,<32
trigger1 = target, StateNo = 5000
trigger2 = target, StateNo = 5010
trigger3 = target, StateNo = 150
trigger4 = target, StateNo = 152
IgnoreHitPause = 0
fvar(21) = ifelse(facing = -1 && target,BackEdgeBodyDist <= 0,target,GetHitVar(xvel),-target,GetHitVar(xvel))

[State -2, Corner Push]
type = PosAdd
triggerall = !NumExplod(52086); Explod that should be created to avoid cornerpush during SuperPause.
triggerall = NumTarget
trigger1 = fvar(21) != 0
x = fvar(21)

[State -2, Velocity Reset]
type = VarSet
triggerall = fvar(21) != 0; I added this to reduce the amount of needless work for MUGEN when persistently resetting fvar(0).
trigger1 = !NumTarget
trigger2 = target,HitShakeOver
fvar(21) = 0

[State -2, SuperPause Explod]; An example of explod that is made
type = Explod
trigger1 = StateNo = 3000 && AnimElem = 1,=1; Just be sure not to set Time at 0 since negative states cannot process that.
IgnoreHitPause = 1
Anim = 52086; Blank animation
ID = 52086; Use whatever number you like
Pos = 0,0
PosType = P1
SprPriority = -7
Shadow = -1
RemoveTime = 28; The duration of your superpause here.
SuperMove = 1
PauseMove = 1
SuperMoveTime = 28; The duration of your superpause here.
PauseMoveTime = 28
Please, report any bugs.