Text Box: Research Lab

This section is for normal mugen developers. The motive is to aid developers with some codes I discover when developing KOFRemix and KOFRemix 2. Feel free to use anything here in your own projects. 

As the whole game had been encrypted, all data files are not accessible in your download. To be in track with the tutorials, you can download part of the data files here.

Files
KOFRemix common1.cns
KOFRemix Iori’s character files

Links
Better Corner Push Method
Prevent Opponent To Slide Over You When You Are At Left Corner
Freeze Current Anim

I will add in more tutorials used in KOFRemix and KOFRemix 2 when I have the time. Come back once in a while to check for updates.

 

Text Box: Better Corner Push Method

This code is been revised a lot of time. Normal mugen environment use “cornerpush.veloff” method in hitdef to push opponent away when target is been hit at the corner. This is a very poor method. When developing your characters, you often finds that your combos that works in normal does not works when opponents is at corner. This can be real frustrating if your are very particular with the character’s combos.

 With the new method, the attacker will slide off exactly the same distance declared as the normal slide velocity. Please not that the code may need some modification on the triggers when use in Simul mode, but I will teach you the idea how it works.

First of all, you need to set all your hitdef’s “cornerpush.veloff” to zero like this: 

ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0

Then you need to add some code in your [statedef -2]. Firstly,

[State -2, 1.1]
type = Varset
triggerall = (target, BackEdgeBodyDist <= 0) || target, FrontEdgeBodyDist <= 0)
triggerall = target, movetype = H
triggerall = target, GetHitVar(yvel) = 0
triggerall = ProjContact = 0, < 20
trigger1 = target, statetype = S
trigger2 = target, statetype = C
fvar(17) = ifelse(target, BackEdgeBodyDist <= 0,target, vel x,-enemy(0), vel x)
ignorehitpause = 1

Basically, the above will detect if target is at the corner. If it is, it will detect other stuff like you must be on ground, target is in hurt state on ground and save the target’s velocity x to a float var. This velocity should be the sliding velocity created by the hitdef. Next, 

[State -2, 1.2]
type = Varset
triggerall = (target, BackEdgeBodyDist <= 0) || (target, FrontEdgeBodyDist <= 0)
triggerall = target, movetype = H
triggerall = target, gethitvar(hitshaketime) = 0
triggerall = target, GetHitVar(yvel) = 0
triggerall = ProjContact = 0, < 20
triggerall = fvar(17) = 0
trigger1 = target, stateno = 5000
trigger2 = target, stateno = 5010
trigger3 = target, stateno = 150
trigger4 = target, stateno = 152
fvar(17) = ifelse(facing = -1 && target, BackEdgeBodyDist <= 0, target, gethitvar(xvel),- target, gethitvar(xvel))
ignorehitpause = 1

The above code is basically the same as the previous one, but this one will trigger only at the last tick when the target is shaking. Notice that the target will only start sliding after the hitpause. This is what “cornerpush.veloff” is not doing. It push the opponent off before target hitpause ended. Next, is the opponent sliding code itself.

[State -2, 1.3]
type = posadd
trigger1 = fvar(17) != 0
trigger1 = vel y = 0
x = fvar(17)

The above code is not complete. Add more trigger to prevent it sliding like when doing a pause/super pause, or when opponent is doing a move like Iori’s Scum Gale where velocity x is impart to opponent but not a sliding velocity. Be sure to add all the require triggers or this will cause a major bug as the opponent will be sliding more than it desire to be. Lastly, a controller to reset fvar velocity after pushing opponent away.

[State -2, 1.4]
type = Varset
trigger1 = 1
fvar(17) = 0

Guess you are done with it. Quite a high price to pay to implement this code, but is definitely worth the job.

<< Return

 

Text Box: Prevent Opponent To Slide Over You When You Are At Left Corner

This is not really a great code, but it kill the bug mugen created. Notice that mugen always have left/right imbalance issue. You can experience this using a normal KOF-mugen character that never implement this code and try to slide forward when the opponent is at left corner. You will notice after sliding, you will end up at the left corner yourself. Surprisingly, this does not happen when the opponent is at the right corner. 
Just copy and paste this short code under your [statedef -3] and the problem will be resolve.

[State -3, Prevent Corner Push]
type = Width
trigger1 = 1
edge = 10,0 

<< Return

 

Text Box: Freeze Current Anim

To those who wanted to freeze any current anim you are current in, here is a way to do it. It is useful when you wanted an attack when hit, your opponent freeze at it current anim for a few ticks before he going into get hit anim.

[State 1220, Freeze Anim]
type = varset
trigger1 = time = 0
var(1) = AnimElemNo(0)

[State 1220, Freeze Anim]
type = Changeanim
trigger1 = time <= 5
value = anim
elem = var(1)

This method is just in 2 pieces of code. The first code saves your current anim element to a temporary variable. The second code simply keeps changing the same anim & element where you stop at. 

<< Return