• Welcome, Guest. Please login.
 
October 31, 2024, 08:03:30 PM

News:

Anyone found direct-linking to our files will be perma-banned. Click here for more info.


Interactive KOF Character Tutorial

Started by KoopaKoot, February 07, 2013, 04:09:34 PM

Previous topic - Next topic

devilgenemugen

May 04, 2013, 04:20:16 AM #15 Last Edit: May 04, 2013, 05:29:06 AM by devilgenemugen
Since I got some free time, I would like to clarify some things:
Quote
For head.pos and mid.pos, I would recommend using sprite 5010,0 to get these. My reasoning is that most moves that have the player bound to an opponent's head use this sprite. Also the head position is usually closer to the position the character's head is during their stance than any other get hit sprite. for head.pos try to make it so the position is the top of the players head. I recommend using Scal's Chris or Clark to check to see if  head.pos is correct (mid.pos is somewhat less important lol).
In one of my thread that I made: http://www.trinitymugen.net/forum/index.php?topic=2548.0 there seems to be no accurate ways to get the head.pos, it need self adjusting to just get it right and quite accurate, it is just approximately untill it looks pretty simillar to the original kof game like maybe I rip a screenshot of the original kof from the kawaks emulator with clark performing his Frankensteiner on the character you plan to make like this:

(With all the other sprites disable and leave only clark and your character)
What I did was to use kfm's head.pos: head.pos = -5, -90 and keep on adjusting the value from there to get it right and look exactly the same like in the original kof game by comparing the original kof screenshot and your adjusted head.pos screenshot:
Compare 1 using KFM's head.pos and kof2002's head.pos:

It is not correct so I keep on adjusting until I have got it quite right, head.pos = -5,-88 which looks pretty much the same as in original kof:
Compare 2 using adjusted head.pos and kof2002's head.pos:

that is how I get the head.pos


Another request:
For your Coding. Constants and Overrides, is it possible to show which sprite and animation is used for that part of code like in this way:


Quote
;RUN BACK
[Statedef 105]
type    = S
physics = S
ctrl = 0
anim = 105+var(1)*30000
sprpriority = 1

[State 105, 3]
type = ChangeState
trigger1 = animtime = 0
value = 106


Quote
; RUN_BACK
[Statedef 106]
type    = A
physics = N
ctrl = 0
anim = 106+var(1)*30000
sprpriority = 1

[State 105, 1]
type = VelSet
trigger1 = 1
x = (const(velocity.run.back.x)*exp((const(velocity.airjump.back.x))*(time)))

[State 105, 1]
type = VelSet
trigger1 = !time
y = const(velocity.run.back.y)

[State 105, VelAdd]
type = VelAdd
trigger1 = time > 0
y = const(velocity.airjump.fwd.x)

[State -3, hop]
type = PlaySnd
trigger1 = !time
value = 2+(var(32)*10),12

[State 105, 3]
type = ChangeState
trigger1 = Vel Y + Pos Y >= 0
value = 107


Quote
[Statedef 107]
type    = S
physics = S
ctrl = 0
anim = 107+var(1)*30000

[State -3, land]
type = PlaySnd
trigger1 = !time
value =  2+(var(32)*10),2

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

[State 107, CtrlSet]
type = CtrlSet
trigger1 = time = 2
value = 1

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

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

because it is pretty confusing especially the Downed get-hit (hit ground from fall) up till the HIT_FALLRECOVER (on the ground)'s state. Sorry if it is pretty troublesome as I want to understand it more. I would also like all the codes that you are going to explain it in this way in future, maybe I would understand it more and clearer.

and one last request:
could you explain this in more depth what it does:
QuoteState 5050. Change the changestate for hitting the floor to

[State 5050, 6]
type = ChangeState
trigger1 = Vel Y + Pos Y >= 0
value = 5100 ;HIT_BOUNCE

So you character changes state to when they hit the ground, instead of falling through the ground. Also add this same ctrl to state 5071, so your character goes into the bounce state when tripped instead of going into the lie down state.

KoopaKoot

Time for the long awaited reply (ran out of excuses).  :sho:

I never said there was an accurate way to get head.pos. I explained what looks best and my reasoning. The only way to get head pos 100% accurate is to make the move that targets the opponent's head character specific (I did this for the Whip in my full game).

https://www.youtube.com/watch?v=kUpmWMgf_LU (like so)

As for showing which sprite goes with an anim, that wouldn't be advisable as every character has their own unique frame/s for moves like that.

This ctrl:

[State 5050, 6]
type = ChangeState
trigger1 = Vel Y + Pos Y >= 0
value = 5100 ;HIT_BOUNCE

Is a replacement for:

[State 5050, 6]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= ifelse((anim = [5051,5059]) || (anim = [5061,5069]), 0, Const(movement.air.gethit.groundlevel))
value = 5100 ;Downed get-hit (hit ground from fall)

This ensures that p1 changes to the correct state as soon as they reach ground level. This is how it looks with the latter ctrl:



and I think that about covers it.


Click Here.

KoopaKoot

Please excuse my tardiness. I wanted to have the character complete so I could explain everything without a hitch. :)

Part 3-3: Hitdefs and Juggling

Coding a move with correct positioning and velocities should be easy to you know, so it's time to explain the hitdefs. Luckily for you (and me) Vans made a post here that explains most of what I wanted to explain about hiidefs. So I'm gonna be super cheeky and paste that here:

Quotesparkxy

There's no reliable way of getting sparkxy that I know of. I usually try to get the y position of the spark relative to P2, and run with that.

Other times, I align it by eye (I am a very lazy person when it comes to this). Keep in mind that the x-parameter depends on P2.

Pausetimes, keep in mind pausetime is the number of ticks the character will be frozen for.

In Iori's example, his standing D lasts for 4-frames. If this attack hits, Iori is frozen in this frame for 16 ticks.

This means that the pausetime is the difference between these two values, 16-4 = 12. 12 ticks of pausetime.

Keep in mind that if the mugenversion is 1.0, these become 11 for the attacker.

Calculating guard pausetimes uses the same principle.

Priority. Impossible, there is no "priority" concept in KOF, everything is decided via CLSN.

The only reason we all keep using these priority parameters is because they were standards set by previous KOF creators (CCIronmugen, OrochiKOF97 among others).

We keep them in order to maintain whatever sense of balance we managed to achieve. But technically, priority should be the same for every single move.

Guard.ctrltime

This value starts counting from pausetime onwards. To calculate, hit an opponent. As soon as they enter the blocking animation, start counting down.

For Iori's close HP you can clearly see it lasts for 28 ticks.

Air.velocity. KOF uses exponential friction for several air gethits, it has only been recently that we've started adding these via custom states.

The values you see in Iori_WLS are merely approximations to replicate the same velocity structure using MUGEN's calculations.

The only way around this is making everything a custom state, but by doing that you are violating a fellow author's gameplay standards. This (in my case) should be avoided as much as possible, and due to this, I've decided to use approximations for these values in order to preserve my opponent's states.

The custom states will be explained in the last (next) part of the tutorial. Now I'll add some additional info.

-For triggers, don't use !time or time = 0. If you see this in my old characters, it's because I was a lazy so and so who couldn't be bothered to do it right. By using those triggers, your hitdef will not respond correctly to changes from other triggers. For example, if you want a move to only hit an airborne opponent, it will only check on the first tick. So if p2 was on the ground when the move starts and in the air when the move is about to hit, it may miss.

-Mugen can be buggy at times and you need to keep this in mind. Using p1stateno and p2stateno in a hitdef that isn't a throw can lead to problems if 2 of the same hitdefs trade with one another. Moves with reversaldefs and hitdefs can sometimes add extra hits when they shouldn't (I don't know how to fix this (Cyanide help!)).

Projectiledefs have the same problems as hitdefs with !time triggers. I would recommend using helpers with hitdefs to make projectiles as it's easier to control their functionality. If you really want to use projectilesdefs, you may want to try having a projectile that lasts only one tick (so it responds to the situation in real time, but this is a waste of time).




Now I will explain juggling. It's done with magic/science/however mugen feels like. This concludes this section of the tutorial.

Ahem.

I used a modified version of the method listed in this post:

http://mugenguild.com/forum/msg.791508

You can use vars to set what moves juggle and....I really don't want to explain how to do this just yet. Everyone has their own way of doing juggling so I would recommend trying stuff out that suits you (hell, K.O.D was able to get juggling to work without any fancy juggle code (more or less)).

This concludes this section of the tutorial. The next part will be the last part and will cover custom states. I was hoping that this thread would stay open for discussions afterwards or maybe if people wanted help in doing character specific things, they could ask.


Click Here.

devilgenemugen

June 20, 2013, 11:30:48 PM #18 Last Edit: June 20, 2013, 11:33:02 PM by devilgenemugen
Quote from: KoopaKoot on May 01, 2013, 11:18:00 AM
Part 3-2:  Artmoney, the heads and tails. Plus clearing up things mentioned in Vans' data tutorial.

Now for the fun part. Using artmoney to get data. Obviously you'll need artmoney for this part. Available from here:

http://www.artmoney.ru/

This part of the tutorial is mainly a reiteration of Vans' KOF Data Tutorial found (you'll also need his artmoney tables):

Here: http://www.vans.trinitymugen.net/
Here: http://www.trinitymugen.net/forum/index.php?topic=1172.msg10299#msg10299
and here: http://mugen guild.com/forum/topics/kof-data-tutorial-90085.msg784274.html#msg784274 (fill the gap (but why))

Most of the instructions are self explanatory, so I'll just go over some key parts

QuoteClick 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 left 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 (or right click and 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.

-There's an easier way to do this. Move p2 all the way to the right and move p1 all the way to the left.
-Click on "search" and use type "Integer (standard)" Search as "exact value = "480""
-move p1 all the way to the right so they are right next to a cornered p2
-click on "filter", Exact value = 704", click OK.
-You should get 3 to 4 search results. It's usually the 2nd value if you have 4 results and the 1st if you have 3.
-select "P1 Pos X" on the list at the right and press CTRL + A Noooo~
-select "P1 Pos X" on the list at the right and press Alt + A

and your kawaks will be synched to artmoney. So let's get some vels.  :sho:

Still using Kyo 98 as my example, I have him move forwards. Artmoney shows "P1 Vel X Integer" as "3" and "P1 Vel X Float" as "5376." The integer is good as is to add to mugen, but the float needs to be converted to decimal. To get this from a "positive" velocity, divide the float by 65536. In this case we get 0.08203125. So Kyo's walk.fwd in mugen will be 3.08203125, which of course is the total of the Interger + the converted float.

When we have Kyo walk backwards, Artmoney shows "P1 Vel X Integer" as "65532" and "P1 Vel X Float" as "60160." Clearly this isn't right (well it is, but you know what I mean). This is how "negative" values appear. Here's how you convert them. For a negative integer, subtract 65535 from it. In this case we get -3. For a negative float, subtract 65536 (-5376)  and then divide a positive version of that result by 65536. This gives us 0.08203125.

[spoiler]I guess now would be a good time to tell you that walk.fwd and walk.back use the same vels, but negative for back. They are also the same values as jump.fwd and jump.back (for kof 94-2002). :P[/spoiler]

I was gonna go to Y velocites next, but let's cover something a lot more advanced involving x vels (besides you can just use Vans' tutorial for that). You can skip this part and do it the "easy" way as mentioned in Vans' tutorial.

[spoiler=X vels the hard way]
QuoteI 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.

K's hard Minute 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.

The accurate X velset controller would be as follows:

[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" used in the equation 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.

Umm....scary much? The part I bolded is the scary part it's never explained how such a number was acquired. HOWEVER.

Quote from: Mukashi mukashiKoopaKoot: what's the formula for finding a natural logarithm or should I just cheat with the ln button on the calculator? : P
Vans: I don't know the formula
Use the button
lol

So there you have it. If you don't have a calculator like that on your computer, use this site, http://www.calculator-tab.com/ :)

[/spoiler]

Now for Y velocities. Still using kyo, I tap (not hold) up, the pause. Before Kyo even jumps it shows the y integer as 10 and the float as 16896. This means that his jump.neu is 0,-10.2578125 (the 0 is the x vel). Artmoney shows the "P1 Vel Y yaccel" as 40448. After converting that gives us 0.6171875. This is our yaccel in mugen. One tick before Kyo jumps his jump vel drops to 7 int 4992 float or 7.076171875. This is the 1st vel of Kyo's short hop. By tapping up to jump instead of holding, You're able to get both vels at once. But where do you put the short hop vel in mugen? I'll explain that in the next part.

Vans' tutorial mentions all the other basic things you need to know, so I'll just give you a few tips:

-Know when to use posadd and when to use velset
-The max life in 2002 is 102, 103 in 98 and 120 in 2002 UM. I don't know the rest. :D
-You can get positive x values in artmoney for moves with negative x values, by performing that move when your character is facing left.

Before my browser crashes again, I'm gonna wrap up this section of the tutorial. If you have anything to ask/add, please feel free to do so.
This only work for Window Vista and above, When I used my Window XP computer, I can't find any values after I have done the first step:
QuoteClick on "Search", and use type "Custom". Uncheck everything but "Integer 2 bytes" and click OK. Click OK again to start the search.
Quote-There's an easier way to do this. Move p2 all the way to the right and move p1 all the way to the left.
-Click on "search" and use type "Integer (standard)" Search as "exact value = "480""
It shows me no address found, only work for Vista and above  :sho: hopefully I can get a new Vista computer so that I can get to work on my character again, my previous vista computer was destroyed by me yesterday

but luckily most of my Mugen project, I put it in my email :iori: and hopefully if I get the new vista computer and I can use PS2 emulator, then I may try using artmoney on PS2 emulator  :iori:

KoopaKoot

I didn't know that Artmoney ran differently on other OSs  :'(


Click Here.

Jesuszilla

Uh, it shouldn't.... I used ArtMoney on XP all the time, and it transferred over to 7 just fine.


Just try to keep things peaceful.

devilgenemugen

??? that is odd, mine can't maybe is it service pack issue? Mine is Service Pack 1. I have brought a Window 8's laptop, hopefully the winkawaks will be working with the art money, otherwise I am going to commit suicide:
Hokuto No Ken M.U.G.E.N. version - Shin's Suicide KO
Heard that my new laptop will be able to work with ps2 emulator, I got to try it later so that I can have fun finding values for the ps2 kof games :iori:

Websta


devilgenemugen

Sorry about that I am not familiar with Window 8, but now it is okay already, everything works fine now I can sync art money on winkawaks
as I am using the new version of art money, this is the one that make me can't sync with the winkawaks which is a new feature for the art money:

I should choose Custom in the Address range drop down list, then it is working  :iori: even in Window XP :sho: later I will be trying the PCX2 emulator with my new Window 8 and see how it is going :iori:

devilgenemugen

Hi, just one question, when you make character, which way do you recommend?

1) First you compile the sff file, putting every sprites in like all the basics, all the specials, all the supers, all the effects etc, next you compile the air file, all of the animation sprites, then go to cmd to programmed all the moves and finally cns

2) First, you would compile Kyo's Yami Barai special move with his sprite animation and his projectile into his sff. Second, you make his Yami Barai's animation to his air file, third you programmed his Yami Barai move in his cmd then followed by cns file. After you completed making his Yami Barai Special move, you make his Oniyaki special move by adding his sprites in sff, followed by air, cmd then cns...

Jesuszilla

For me, it depends on the complexity of the character and how I feel. If I were making Balrog/Vega, I'd be adding in the mask sprites as I go. For pretty much anyone else, I try to add all the sprites first. Waiting on edits to be done can also play a role in this.

For animations, I do them as I code the move. For KOF, perhaps you could do all the animations first, but for Capcom games which complicate things with turbo, I would not recommend it.


Just try to keep things peaceful.

KoopaKoot

I make the whole sff first because there are times where a move will have a frame from another move and some of the sprite packs I use don't have duplicates.



Click Here.

devilgenemugen

Quote from: KoopaKoot on May 01, 2013, 11:18:00 AM
Part 3-2:  Artmoney, the heads and tails. Plus clearing up things mentioned in Vans' data tutorial.

Now for the fun part. Using artmoney to get data. Obviously you'll need artmoney for this part. Available from here:

http://www.artmoney.ru/

This part of the tutorial is mainly a reiteration of Vans' KOF Data Tutorial found (you'll also need his artmoney tables):

Here: http://www.vans.trinitymugen.net/
Here: http://www.trinitymugen.net/forum/index.php?topic=1172.msg10299#msg10299
and here: http://mugen guild.com/forum/topics/kof-data-tutorial-90085.msg784274.html#msg784274 (fill the gap (but why))

Most of the instructions are self explanatory, so I'll just go over some key parts

QuoteClick 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 left 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 (or right click and 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.

-There's an easier way to do this. Move p2 all the way to the right and move p1 all the way to the left.
-Click on "search" and use type "Integer (standard)" Search as "exact value = "480""
-move p1 all the way to the right so they are right next to a cornered p2
-click on "filter", Exact value = 704", click OK.
-You should get 3 to 4 search results. It's usually the 2nd value if you have 4 results and the 1st if you have 3.
-select "P1 Pos X" on the list at the right and press CTRL + A Noooo~
-select "P1 Pos X" on the list at the right and press Alt + A

and your kawaks will be synched to artmoney. So let's get some vels.  :sho:

Still using Kyo 98 as my example, I have him move forwards. Artmoney shows "P1 Vel X Integer" as "3" and "P1 Vel X Float" as "5376." The integer is good as is to add to mugen, but the float needs to be converted to decimal. To get this from a "positive" velocity, divide the float by 65536. In this case we get 0.08203125. So Kyo's walk.fwd in mugen will be 3.08203125, which of course is the total of the Interger + the converted float.

When we have Kyo walk backwards, Artmoney shows "P1 Vel X Integer" as "65532" and "P1 Vel X Float" as "60160." Clearly this isn't right (well it is, but you know what I mean). This is how "negative" values appear. Here's how you convert them. For a negative integer, subtract 65535 from it. In this case we get -3. For a negative float, subtract 65536 (-5376)  and then divide a positive version of that result by 65536. This gives us 0.08203125.

[spoiler]I guess now would be a good time to tell you that walk.fwd and walk.back use the same vels, but negative for back. They are also the same values as jump.fwd and jump.back (for kof 94-2002). :P[/spoiler]

I was gonna go to Y velocites next, but let's cover something a lot more advanced involving x vels (besides you can just use Vans' tutorial for that). You can skip this part and do it the "easy" way as mentioned in Vans' tutorial.

[spoiler=X vels the hard way]
QuoteI 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.

K's hard Minute 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.

The accurate X velset controller would be as follows:

[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" used in the equation 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.

Umm....scary much? The part I bolded is the scary part it's never explained how such a number was acquired. HOWEVER.

Quote from: Mukashi mukashiKoopaKoot: what's the formula for finding a natural logarithm or should I just cheat with the ln button on the calculator? : P
Vans: I don't know the formula
Use the button
lol

So there you have it. If you don't have a calculator like that on your computer, use this site, http://www.calculator-tab.com/ :)

[/spoiler]

Now for Y velocities. Still using kyo, I tap (not hold) up, the pause. Before Kyo even jumps it shows the y integer as 10 and the float as 16896. This means that his jump.neu is 0,-10.2578125 (the 0 is the x vel). Artmoney shows the "P1 Vel Y yaccel" as 40448. After converting that gives us 0.6171875. This is our yaccel in mugen. One tick before Kyo jumps his jump vel drops to 7 int 4992 float or 7.076171875. This is the 1st vel of Kyo's short hop. By tapping up to jump instead of holding, You're able to get both vels at once. But where do you put the short hop vel in mugen? I'll explain that in the next part.

Vans' tutorial mentions all the other basic things you need to know, so I'll just give you a few tips:

-Know when to use posadd and when to use velset
-The max life in 2002 is 102, 103 in 98 and 120 in 2002 UM. I don't know the rest. :D
-You can get positive x values in artmoney for moves with negative x values, by performing that move when your character is facing left.

Before my browser crashes again, I'm gonna wrap up this section of the tutorial. If you have anything to ask/add, please feel free to do so.
I can get PCSX2 emulator to work but it is quite slow and I am able to input many moves without any problem but I can't seems to sync with art money, I used the table in Vans's website, ko98um, the pcsx2 emulator I am using is version Pcsx2_0.9.4, I am able to get 7 values from the first step which is the search but when I start to filter, I get no addresses

Jesuszilla

Try using PCSX2 1.0 from the official site. It's more stable.


Just try to keep things peaceful.

KoopaKoot

What Jesuszilla said. 1.0 is the very best when it comes to pcsx2. If you would like, I could explain how I would synch a table for the ps2 games.


Click Here.