Trinity MUGEN

MUGEN => Tips, Tricks, and Tutorials. => Topic started by: Deleted User on November 26, 2008, 04:46:56 PM

Title: KOF Data Tutorial
Post by: Deleted User on November 26, 2008, 04:46:56 PM
This is mainly thanks to Fervicante, who was the first to apply this method for velocities (got the data directly from MAME), but Kira and I solved the equation to build the formula with any piece of KOF vel data.

This is also the method I use to get data for my characters, if something seems unclear, please ask here so I can explain further and correct it in the tutorial.

Sending a quick tut on how to get KOF data.

I will attach my KOF artmoney table.

This table will work in ANY KOF game from 94 up to 2002. (They changed the architecture in KOF2003). This table will give you ACCURATE values for velocities, hitvels, damage, power and offsets.

It is fairly easy to sync, for this matter I recommend using Winkawaks 1.58 for getting the data.

First off you must enter a training (or VS if it lacks the mode) session, and push your opponent all the way to the right, then you will move the character you want data from all the way to the left. Like so:


Open up the table with artmoney and make sure that Winkawaks is selected as the process you want to use it on, then open up the table.

Click on "Search", and use type "Custom". Uncheck everything but Integer 2 bytes and click OK. Click OK again to start the search.

Now move the character a bit to the right and press "filter", Unknown value, was increased. Click OK.

Now move the character all the way to the right again and click on "filter", Exact value = "480", click OK.

A few values should be on the list at your left, select one of them and select "P1 Pos X" on the list at the right and press CTRL + A (apply offset to all). You will know you synced with the correct value when the character no longer moves if you freeze the Pos X.

Artmoney should also look like this at this point:


You can get whatever you want with this method. Just a note on how to get the data right:


The way KOF handles velocities is simple and straight-forward, however, this may confuse you if it's your first time working with this kind of data, we'll start with easiest. The Y vel.

The Y vels in KOF are handled just like in MUGEN, it's a regular velset and veladd. With the exception of hitvels which have a velmul instead (I usually guess these) you can check what kind of Y vel you are dealing with if you take a sample of 2-3 ticks (I recommend 3).

The Y vels, however, cannot be accurately translated into MUGEN, as KOF adds the yaccel twice once the velocity is no longer negative. This causes a delay of 1 tick in the land states, which I personally decided to keep in order to maintain correct feeling (You can get around this if you use !animtime as the trigger for the land though).

To get these you need to check artmoney and the game frame by frame using Winkawaks. You can do this by pausing the game and pressing shift + space (Next frame). You can input commands this way too, to start with something simple we'll check K's Y normal jump vel (Note that you need to hold up 8 ticks in order for him to perform his normal jump).

We'll do this tick by tick while checking if artmoney updates the value located in "P1 Vel Y Integer" and "P1 Vel Y Float". After a while you'll notice these change to 10 and 16896 respectively. This is our first value.

Now that we have our first value, we need to remember that we can't use it yet as it is a HEX number. That means using 10.16896 would be incorrect, we must transform it into a decimal value first.

To do this we'll do a simple step, we'll divide the "float" value artmoney gave us with 65536 (0x1000 in HEX). You should get 0.2578125 as the result. This is our correct float value.

Now that we got the correct float value, we'll just add the int value artmoney gave us to it. That will mean that our first vel is 10.2578125.

But how do we find the Y accel? Easy, we just need to gather a sample of three values for this.

I will take a step ahead and note them down:

Code: [Select]
10.2578125 (Tick 1)
9.640625 (Tick 2)
9.0234375 (Tick 3)

Now we just need to get the difference between the first and second values. Which is 0.6171875. This is apparently the correct Y accel value, but just to make sure subtract that Y accel value we got to the second velocity value: 9.640625 - 0.6171875 = 9.0234375. Success!

This is the process you should follow for any move (hitvels may vary though), and it should give you perfect results. Just to make correct use of this, a KOF Y velset should look like this:

Quote from: Iori_WLS Heavy Oniyaki
[State 1101, VelSet]
type = VelSet
trigger1 = !time ;Can be anything
y = -9

[State 1101, pos]
type = Veladd
trigger1 = time > 0 ;Should be one tick after the velset was applied in order to prevent the controller from subtracting velocity before it should.
y = .50

Next is the X vel.

The X vel is harder to get than the Y vel, due to changes it may have during the move. I usually check the vel changes throughout the whole move to see if there are no sudden vel changes, if there aren't then you can easily implement it with few controllers, however, there are two ways to do it. The advanced way and the easy way.

The easy way is using a combination of velset + velmul. This, however, will result in distance loss (Few pixels).

We'll try to get the values for K's Hard Minute Spike.

Doing a frame by frame advance, we can observe that there are no sudden vel changes, this means we will only require a few controllers.

First, we'll need the usual three samples from the move:

Quote from: K's Hard Minutes Spike
9.53125 (Tick 1)
9.08447265625 (Tick 2)
8.6586456298828125 (Tick 3)

How do we work with these values and get the mul needed? Easy, you divide the second vel value with the first. That will give you your mul value, in this case, 0.953125.

Now to correctly use this data you will only need two controllers:

Quote from:  One of Iori's custom states
[State 1402, VelSet]
type = VelSet
trigger1 = AnimElem = 8 ;This is when the first velset should be applied.
x = -11.921875

[State 1402, VelMul]
type = VelMul
trigger1 = AnimElemTime(8 ) > 0 ;Just like in the veladd, one tick higher than the velset is required.
x = 0.8515625

That will provide correct velocities in an easy method, but as I mentioned earlier, this may not be 100% accurate.

I will now explain the "advanced" way, the advanced way involves Euler's constant. If you take the time to observe the game, you will notice that the accel values change in each tick, this is because there is a base accel value being affected by time and Euler's constant, that means that there are only two values needed  in order to calculate those velocities, a base accel and a base velocity. Can this be done in MUGEN? The answer is yes.

First off, we will need our usual three samples.

Quote from: K's Hard Minutes Spike
9.53125 (Tick 1)
9.08447265625 (Tick 2)
8.6586456298828125 (Tick 3)

And we will obtain the first accel value, 0.953125.

Now, the basic KOF velocity equation goes like this:  y = z ・e^(w ・x); This translates to: (current vel = basevel*e^(baseaccel*time)

I'm going to skip the demonstration and show you how to use it. First you need to take the natural logarithm (ln) of that first accel value, -0.048009219186360607752003625323445. That is your base accel value.

Now with those two values you can build the controller and have NEAR PERFECT velocities, this is quite simple as it takes very little time once you are used to the system. I will build the example controller for this move (K's Heavy Minutes Spike) in order to show you how it's done.

Quote from: Minute's Spike Accurate X VelSet
[State 1300, Velset]
type = VelSet
trigger1 = 1; This controller must trigger in EVERY TICK the vel is active. Can be changed for animelemtime(X) <=/>= if needed.
x = (9.53125*exp((-0.048009219186360607752003625323445)*(time))) ;Time here is EXTREMELY important, the time must ALWAYS be zero when the vel is set, that means that if you first trigger your vel in time = 3 of the character's state, you will need to use (time-3) in order for the equation to multiply by 0 in the first tick of your vel.

In addition, I recommend the use of displaytoclipboard in order to check that the first three vel values are like the ones you got in artmoney. If they are, you are good to go.

This method may look complicated, but it's shorter and very clean once you get used to it.

Don't forget that you also need to use physics = N for this.


Something I thought I'd mention, some KOFs will show this as a vel value, some won't. So I recommend you check if the character moved during a move in case it requires posadds, the pos values are integers so it's a basic operation here.

Damage / Power

Damage and Power maxes vary from KOF to KOF, you can see using the table the MAX value for that current KOF. The formula to convert the values to MUGEN is quite simple.

damagevalue / maxlife * 1000 = MUGEN damage value

This also works for POWER values, it is quite simple really.

Here is the artmoney table. ( (Right-click save as.)

I hope this helps you. Feel free to ask or check my works for help. :)