Learning Fundamentals

Started by Lemures, March 14, 2010, 12:12:05 AM

Previous topic - Next topic

Lemures

Hello all. First off, I hope I'm putting this in the right section.

After about two years of playing MUGEN, I've decided to finally jump in and take a shot at creating. I'm not into the visual aesthetics as much as I am into the control and "feel" or a character so, rather than spriting, I'll be learning to code.

I started by downloading a bunch of tutorials off youtube and although they do cover a lot of topics, there are a few basic fundamentals that seem to have been overlooked (at least in those tutorials I've watched). So I've been hitting various speedbumps and snags along the road, but I've managed to find my way through those parts of the maze.

What I hope for is to become a proficient coder. I'm not interested in just cutting and snipping and editting bits and pieces of code. What I want is to understand the code and be able to piece it together myself. To this end, I'm hoping I can get some help from whoever's willing to provide it.

I know I'm going to have a LOT of questions on this road and it would benefit no one for me to make a new thread for every little bump along the road. So I wish to make of this a thread that will provide answers not only for me, but for others who are just starting and don't yet have he familiarity with fighterfactory to figure their way out of every detail.

I've managed to get through the most basic of elements - stance, jump, backjump, fwdjump, standing attacks, backdash, crouch. I'm currently working on my character's jumping attacks. So here are the questions i have so far.

1. When my airborne character attacks, whether he is jumping straight up, back or forward, he will drop straight down with the attack. How do I repair this?

2. My character has a standing light kick that attacks the shin and I would like to make it unblockable by a standing character (must crouch to block) very much like KoF's Iori Yagami. How do i implement this?

3. Is there a master StateDef list available? Sometimes MUGEN will notify my of an invalid action and when I search for it in the constants, I'm unable to find it. For example, I have no idea what "invalid action 5000" is.

4. What are some reasonable damage parameters for attacks? Currently, I'm using 15 for light attacks, 25 for medium attacks and 40 for strong attacks. Though I favor games like CVS and SFA, I'm not really looking for exact accuracy - just something reasonable and fair.

Well, thats it for now. I actually have hundreds of questions, but one-step-at-a-time, right? Once I have my jump-attack issue resolved, we'll move forward.

Many thanks.

LaQuak

It's nice to hear that you want to get a better feel at gameplay rather then visuals. Seems like you're really interested in really going all the way with this. Different people have different methods but pretty much after first character you'd be using alot of your old code work and just add on additional peices.

To answer you're questions:
Quote
1. When my airborne character attacks, whether he is jumping straight up, back or forward, he will drop straight down with the attack. How do I repair this?
You need to make sure your characters Physics point to Air. You can also open up common.cns that can be found in Data folder and modify that to your liking as far as Aerial attacks go but you shouldnt need to. You could also animate a dummy falling animation in your .AIR so at the end of an air attack you just add in 2 falling down sprites and loop the pre last one.

Quote
2. My character has a standing light kick that attacks the shin and I would like to make it unblockable by a standing character (must crouch to block) very much like KoF's Iori Yagami. How do i implement this?
For this you would want to make use of a hitflag and guardflag parameter in the HitDef to specify how you should attack and how p2 should block it.

Quote
3. Is there a master StateDef list available? Sometimes MUGEN will notify my of an invalid action and when I search for it in the constants, I'm unable to find it. For example, I have no idea what "invalid action 5000" is.
Using debug to notify you of these is a great way to figure out where a problem is so just find a state that you get the debug flood on and go from there. Apart from required sprites group/numbers and lifebar/versus portraits there is no right or wrong way to use any type of statedef. You can make what you like really.

Quote
4. What are some reasonable damage parameters for attacks? Currently, I'm using 15 for light attacks, 25 for medium attacks and 40 for strong attacks. Though I favor games like CVS and SFA, I'm not really looking for exact accuracy - just something reasonable and fair.
This one is totaly up to you as far as damage values. In the long run you would want to use a Damage Dampner and there are different types and some only work with the way your HitDef triggers are. You have to decide if you're into long chain stings or more impact special/super cancels.

A universal suggestion is to check out the Mugen docs inside your Data folder in your Mugen folder. A thorough read through to see how Mugen works should be alright to get you of the ground.

Lemures

Thanks so much for your reply.

1. As per FF's ElecbytePlayer template, my jumping light punch is action600. Its the same for all three jumps (bk, fwd, up). My physics ARE indeed set for air (A). So its not like my characters disappears out of the air and reappears on the ground. He goes through the entire animation no matter what direction he jumps in, but its as if he hits an invisible barrier as soon as he swings and falls stright down.

2. I found the guardflag and hitflag you refered to.

guardflag = MA
hitflag = MAF

What do "ma" and "maf" mean and what modification is necessary to nail that low hit?

3. The debug flood helped me figure out where to place my basic animations such as standing strikes, walk, stance, etc. But all of a sudden it'll say action 5000 is invalid and i have no idea what its asking for. So is it acceptable for me to just ignore it?

4. I'm going through it now. Funny how sometimes you don't look for something in the most obvious of places.

Sorry if I'm being a pain, but I've only been a coder for about 24hrs now  :P



LaQuak

1.) Is there a ChangeState at the bottom of the state? Did you double check your animation in .AIR and/or try to add in 2 falling looking sprites and loop the pre last sprite?

2.)To find out what the parameters mean and what you need to do for a Low attack double check the docs :D

3.) You need required sprites in those groups/numbers 5000-5072. Go inside docs folder and open spr.img and look at how KFM is placed and how you need to place the sprites in .sff

kakkoii superhero

1.
do you want to make it sudenly drop vertically like May (guilty gear) drop anchor attack, chunli, etc. if you want this then add y velocity
or
do you want to avoid it (do you want to momentarily hold your position in mid air while executing the attack)? if you want this in the air attack statedef,
set physics = N
and then don't forget to changestate into
45 (if your char have air jump & performing air jump "holdup")
or
50 (if you just let it land afterward)

2.
not a good idea for this one, some will say it unfair, unless the animation is obvious enough (he/she lower itself low enough or if it is a sweep movement to sign opponent that it was a low attack, but just a simple jab kick to the shin while the rest of his posture is normal standing and expecting opponent to duck for it is rather cheap)
anyway in Hitdef parameter set the guardflag = L

3.
i'm as confused as you in scrutinize which is the initial faulty state when a wall of debug flooding my screen sorry can't help there, but most of the time maybe it is a lost animation, missing helper, or ai related debug error.

4.
try to fight some other characters to get the feeling of their damage versus your damage.
my light attack damage is around 18-20
my heavy attack damage is around 40-50 (depend on how easy it hit opponent with, the more difficult the sweeter the damage)
then on 3rd hit combo it would be dampened with some percentage.

Cyanide

1: All previous suggestions incorrect. You have velset = 0,0 at the top of the state. Remove it, you'll do a normal attack now.

2: MA MAF etc, all explained inside mugen\docs\sctrls.html. Look up hitdef (this folder will help you heaps if you're actually serious

3: Folder above. air.txt spr.txt cns.txt. Those list anim's and states. Common1.cns in the data folder is also states you should make use of.

4: Well, if you're doing accurate it's count pixels. Common damages are 30-45 for lights, 70-90 for med, and up to 150 for heavy.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.

Lemures

Thanks for you reply, Cyanide. I found all your points very useful, beginning with my "jump attack" issue. Through your response I learned that velset affects the characters vertical and horizontal movement and that omitting the command altogether defaults the character to its previous momentum.

I've been working with sctrls and the tutorial in docs and i'm making some progress. I've got my opponent responding to my attacks based on power and target (animtype and groundtype) and have set up the appropriate guardflags. I've even added some sound, giving my char a more solid feel and making him a little more enjoyable to playtest.

Another question for anyone willing to help...

I'm having trouble implementing my char's legsweep. As per sctrls, I tried using "animtype=back" but the opponent wasn't knocked off his feet. For the moment, I'm simply using "fall=1" but that doesn't take the opponent into state 5070 (tripped). How do I take my opponent into state 5070?

Thanks again to any who've replied and those who will. Hopefully its evident now that I'm quite serious about this new hobby, so if anyone's willing to take a few minutes to answer a question or two, it won't be time wasted. Eventually my creation(s) will hopefully be good enough to make it into a few permanent rosters.

Cyanide

groundtype = trip

Docs again.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.

Lemures

Hello again.

Well, I've been keeping myself busy with required sprites and states and I've got my debug screen clear. I've added sound to the attacks as well(the"woosh" of the swings, the yells as my char attacks and the impact sounds when the attack connects). I'm currently playing around with hitsparks and throws and have a few issues I could use help with.

1. I'm using cvs2 hitsparks and there several of them, exploding in different directions and different angles. At first I had assumed it was a different angle of spark for each attack's strength level (200, 400, 600 then 210, 410, 610, etc.) but testing that theory out with a cvs char debunked it. I saw that the differently-angled orange sparks appeared randomly, regardless of which normal attack was being used. How do I implement this into my char and how do i ensure that only the orange sparks are used? (there are also blue and purple sparks for special and hyper attacks)

2a. My char's throw consists of two strikes - strong punch and strong kick, ending in animelem5 with the remaining frames accounting for the opponent flying out. I added sound to each simulated impact (animelems 2 & 5). I tried adding hitsparks to these frames, but couldn't get them to appear at all. How do I get the hitsparks to appear? Am I approaching this the wrong way and strike-throws must include the actual strike-states?

2b. When my char finishes the opponent with a throw, the opponent doesn't die until he hits the ground, even though state 820 (the corresponding "thrown" animation) has the damage split betwen animelem 2 & 5. How do I get the "kill=1" to activate at the throws final strike?

For questions 2a and 2b, I'll include my throw's code...

And if it makes any difference, I started my char on Fighter Factory and am now working on it on Fighter Factory Ultimate. I used the"throw creator" feature to match up the sprites.

Quote
[Statedef 800]
type = S
movetype= A
physics = S
juggle = 0
velset = 0,0
ctrl = 0
anim = 800

[State 800, 1]
type = HitDef
Trigger1 = Time = 0
attr = S, NT
hitflag = M
priority = 1, Miss
sparkno = -1
sprpriority = 1
p1facing = ifelse (command = "holdfwd", -1, 1)
p2facing = 1
p1stateno = 810
p2stateno = 820
fall = 1

[State 800, 2]
type = ChangeState
Trigger1 = AnimTime = 0
value = 0
ctrl = 1

;----------------------------------------------------------------------
[Statedef 810]
type = S
movetype= A
physics = N
anim = 810
poweradd = 60

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem= 2
value = s2, 2
volume = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem= 5
value = s2, 5
volume = 0

[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElem = 1
pos = 54, 0
[State 810, Bind 2]
type = TargetBind
trigger1 = AnimElem = 2
pos = 67, 0
[State 810, Bind 3]
type = TargetBind
trigger1 = AnimElem = 3
pos = 67, 2
[State 810, Bind 4]
type = TargetBind
trigger1 = AnimElem = 4
pos = 67, 0
[State 810, Bind 5]
type = TargetBind
trigger1 = AnimElem = 5
pos = 67, 0
[State 810, Bind 6]
type = TargetBind
trigger1 = AnimElem = 6
pos = 69, 15
[State 810, Bind 7]
type = TargetBind
trigger1 = AnimElem = 7
pos = 99, 18
[State 810, Bind 8]
type = TargetBind
trigger1 = AnimElem = 8
pos = 119, 31
[State 810, Bind 9]
type = TargetBind
trigger1 = AnimElem = 9
pos = 139, 57
[State 810, Hurt]
type = TargetLifeAdd
trigger1 = AnimElem = 9
value = -78

[State 810, Throw]
type = TargetState
trigger1 = AnimElem = 9
value = 821

[State 810, State End]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;----------------------------------------------------------------------
[Statedef 820]
type = A
movetype = H
physics = N
velset = 0,0

[State 820, 1]
type = ChangeAnim2
Trigger1 = Time = 0
value = 820

;----------------------------------------------------------------------
[Statedef 821]
type = A
movetype = H
physics = N
velset = 0,0
poweradd = 40

[State 821, 1] ;Gravity
type = VelAdd
Trigger1 = 1
y = .4

[State 821, 2] ; Recover near ground (use ChangeState)
type = ChangeState
triggerall = Vel Y > 0
triggerall = Pos Y >= -20
triggerall = alive
triggerall = CanRecover
trigger1 = Command = "recovery"
value = 5200 ;HITFALL_RECOVER

[State 821, 3] ; Recover in mid air (use SelfState)
type = SelfState
triggerall = Vel Y > 0
triggerall = alive
triggerall = CanRecover
trigger1 = Command = "recovery"
value = 5210 ;HITFALL_AIRRECOVER

[State 821, 4] ;Hit ground
type = SelfState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 5100 ;Hit ground

Thanks.

LaQuak

1. For hitsparks say you have 4 orange cvs sparks for normal attacks then you group them like 6000,6001,6002,6003. animate then the same way and in the hitdef use sparkno = s6000+(random%4) and only sparks from groups 6k will play and randomize 4 times because you have 4 of them right.

2a. Use Explods, Pretty much the same tactic like in question 1 as far as sparks are done.

2b. You said it yourself with kill = 1. You just need to use Target/LifeAdd and kill before your custom state hits the ground. So sync up an animelem is where I would start troubleshooting.

kakkoii superhero

since your throw is ended with just a kick, why not just a normal hitdef for a kick, and instead of give the damage to the kick right away, use the fall.damage instead, that way opponent only dies when touching the floor.

Lemures

Thanks for the replies, guys.

Its a slow crawl, but I'm making progress. I got the hitsparks working appropriately, including those in the grab via Explods.

And I finally figured out what the problem with the throw's "flying-out" animation was - I wasnt making ANY use of state 821. Instead, p2t flying-out was all part of state 820, so the whole thing was TargetBind. By the time the TargetBind ended, p2 was practically already on the floor, which is why "kill=1" wasnt kicking in til he hit the floor. So I had the TargetBind end at the moment of the throw's kick, then toyed with the VelSet to get p2 to fly out appropriately.

I've figured out a few things on my own this past week, each taking a couple of hours trying different triggers, reading docs, trial-and-error, etc. I got my char delivering different normal attacks based on how close he is to p2, learning to use IfElse triggers in the process. Also figured out how to give my char a different jump-attack depending on which direction he's jumping.

I'm currently working on "fwd+button" moves, such as an overhead attack to hit crouching opponents. This was my first foray into the Commands file, having to add "command != holdfwd" into a couple of normal attacks. So I have that attack working properly, including the hit/guard flags.

What I could use help with now is another of my "fwd+button" moves. In the move, takes a quick step/hop forward and throws a kick. My problem is with his movement forward. I pretty much want him to move forward during the entire attack.

In the StateDef, I toyed with the x-value in VelSet. He certainly moves forward, but he always stops abruptly. He'll move forward as far as I want him to, but the movement isn't present throughout the whole attack.

Then I tried using VelAdd, but that didnt get me the results I wanted. With x=1, my char will move forward slightly, but with x=2 he just shoots across the entire screen. And apprarently, VelAdd doesnt care much for decimals because I cant get the subtle variations I was hoping for with 1.1, 1.5, etc.

Then I played around with VelMul and VelSet, tried different values and combination between the 3 Vel sctrls but I just cant find anything that works. I just want him to move forward throughout the entire attack.

Any suggestions would be greatly appreciated. Thanks guys.

Cyanide

2 choices.

physics = N

This will remove all friction from your character for the duration of the move and cause him to retain whatever vel you set at any time.

The other one is just a constant trigger on a velset

trigger1 = time >= 0
x = 1.5

for example That will last the whole attack through. time = 0 will only trigger once you see.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.

Lemures

Thanks, Cyanide. Physics = N worked perfectly.

Well, I think thats about it as far as the character's base goes - I got the throw, the required sprites, attack variation depending on proximity to p2, jump attack variation depending on jump direction, appropriate sounds and sparks. I'm playing with him frequently to look for problems and, for a first attempt at least, I think he's coming along solidly.

Before I move on to Special Moves, I want to add a handful of features. The first two will be Dodge and Roll (forward and backward), a la KoF.

My guess is I have two choices for these evasive moves - either use NotHitBy and pretty much list every kind of attack under it, or omit clsn boxes altogether. Is there any reason why I should use one and not the other?

Or, in my novice naivette, are both of these bad ideas and I'm approaching this the wrong way altogether?

Danke.

Cyanide

nothitby
AA, AP

hitby
AT

Don't leave off clsns. If you do that you can't be thrown. Make use of playerpush to pass through people.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.

Lemures

Thanks again, Cyanide. I got the dodge working. I'll be working on the evasive rolls later because there's something else I need to work on first.

I wasn't 100% happy with my sprite alignment. It looked okay, but there were a few little twitches and shifts that were bugging me AND I found alignment to be extremely tedious. I was hoping to find an easier way and after looking for some tutorial vids, I found one that mentioned sprites by "DreamSlayer". They were recommended because they weren't pre-cropped and so were already perfectly aligned. So I'm going to start my SFF from scratch again. Sure, I'm throwing away quite a bit of time's worth of work, but the end result will be precise alignment and it'll save me a lot of time in the long run. But now I have this issue...

I pretty much have two sets of sprites to work with. Most of my character will be done with Dreamslayer sprites. However, the first set of sprites I was working with has several custom sprites I want to use as well, such as a set of running sprites.

I've already added over a hundred dreamslayer sprites to my new SFF and want to go ahead and add the custom sprites from the previous set. What I can't figure out is how to adapt these few custom sprites to my palette. I've tried to old Fighter Factory and FFU, but I can't find a way to make it work.

I'm sure there are several steps involved and might not be something where a quick explanation will suffice. If so, is there a thread or tutorial anyone could point me toward so I can make this work?

Thanks, y'all.

Cyanide

Most of use a program capable of manipulating palettes. You'd take the old sprites, make them 32bit, then apply your palette to them.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.

Lemures

Is there any program (short of the too-expensive-for-me photoshop) that can do this? I have IrfanView, which is free, but it seems to only be able to use "PAL" files. I'm guessing I need something that can read ".act"?

Cyanide

Try gimp. If you have a sprite with a palette, gimp will pick that up. You can then save it in the gimp palette format, and reapply it to whatever you like.

Please don't ask me how to do this, i use PSP7 (which was free for me) i am unsure how to use gimp. It is free though.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.

kakkoii superhero


there is palette location in Gimp's interface.