Is there such things as MUGEN classes?

Started by Fumo, November 12, 2010, 06:44:27 PM

Previous topic - Next topic

Fumo

This coding stuff is really annoying to learn.
I don't know how this AI coding works and I don't know how to make my attacks into commands. I know the little stuff, like the hitdefs and the sounds and the collision boxes and the sprites but the ai coding and commands I just have no idea on. You know like how when Ryu does a shoryuken, in his .air file his sprites show him doing it in place but in the game he launches up into the air I don't know how it does that.
I wish there were mugen classes. Tutorials never really answer ALL my questions.

I was told to edit KFM and learn from his coding and the comments on it. But I don't want to look at Ryu's cns if I want to learn how to make my own shoryuken, I want to know how to make it my own and how to test it for bugs. For some reason the newest Fight Factory doesn't start mugen so I have to manually close out of Fighter Factory and start mugen myself.



Anyone have tips on getting started? I appreciate any help I can get. I am eager to learn and the best way to do that is by asking questions.
W.I.P ...


Captain Falcon: 68%
(on hold)

Duos.act

Don't worry about coding AI, it's not a necessity at all.

As for your other problem, sounds like an axis issue.  You can look at another Ryu in Mugen and use his axis for reference if you wish.

aznperson569M

Do you mean you have problems adding commands into the CMD, or making AI? Because AI is usually the last thing I look for in a charater.

uguu

Fumo

#3
I have problems making the commands for the attacks and then making an AI. I have no idea how to make the AI do what I want or how to make commands for my fighters moves.

I'm worried about making all my sprites and then saying "Oh ****.... now what do I do?"
W.I.P ...


Captain Falcon: 68%
(on hold)

Cyanide

The quick answer to that is try. Break stuff. Figure out what it does. READ about some of it in the docs. KFM has attacks that move. Open them, take a look. Find out WHY they move, look up all the things in them to find out what might be doing it. Then attempt to replicate.

I mean if a state has the following things in it

varset
playsnd
explod
velset
veladd
hitdef
changestate
You can look at each and every one in the docs and find out what it's for.


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.

2OS

Spoiler: AI necessities (click to show)
Quote from: Some other forum, by me
[Command]
name = "CPU_001"
command = y,a,B,b,a, D,a,B,b,a, D,U,U ;; Yes, Yabba Dabba Doo >__>""
time = 1

[Command]
name = "CPU_002"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_003"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_004"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_005"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_006"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_007"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_008"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_009"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_010"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_011"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_012"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_013"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_014"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_015"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_016"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_017"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_018"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_019"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_020"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_021"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_022"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_023"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_024"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_025"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_026"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_027"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_028"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_029"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_030"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_031"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_032"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_033"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_034"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_035"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_036"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_037"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_038"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_039"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_040"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_041"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_042"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_043"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_044"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_045"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_046"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_047"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_048"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_049"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_050"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1


[Statedef -1]

[State 2OS]
type=varset
triggerall=roundstate=2&&!ishelper
trigger1=command="CPU_001"||command="CPU_002"||command="CPU_003"||command="CPU_004"||command="CPU_005"||command="CPU_006"||command="CPU_007"||command="CPU_008"||command="CPU_009"||command="CPU_010"
trigger2=command="CPU_011"||command="CPU_012"||command="CPU_013"||command="CPU_014"||command="CPU_015"||command="CPU_016"||command="CPU_017"||command="CPU_018"||command="CPU_019"||command="CPU_020"
trigger3=command="CPU_021"||command="CPU_022"||command="CPU_023"||command="CPU_024"||command="CPU_025"||command="CPU_026"||command="CPU_027"||command="CPU_028"||command="CPU_029"||command="CPU_030"
trigger4=command="CPU_031"||command="CPU_032"||command="CPU_033"||command="CPU_034"||command="CPU_035"||command="CPU_036"||command="CPU_037"||command="CPU_038"||command="CPU_039"||command="CPU_040"
trigger5=command="CPU_041"||command="CPU_042"||command="CPU_043"||command="CPU_044"||command="CPU_045"||command="CPU_046"||command="CPU_047"||command="CPU_048"||command="CPU_049"||command="CPU_050"
var(9)=3
ignorehitpause=1
persistent=1
pausemovetime=9999999
supermovetime=9999999


P2 attacking state


triggerall=var(9)=3
triggerall=enemy,movetype=a||enemy(enemy,teammode=simul),movetype=a


P2 projectiles


triggerall=var(9)=3
triggerall=enemy,numproj||enemy(enemy,teammode=simul),numproj


Ground Comboing


[State 2OS]
value=200
type=changestate
triggerall=var(9)=3
triggerall=statetype!=a&&ctrl ;; state type not air and has control of the character [ state types — s = stand, c = crouch, a = air ]
trigger1=p2dist<50&&random<50

[State 2OS]
value=210
type=changestate
triggerall=var(9)=3
triggerall=statetype!=a&&ctrl
trigger1=stateno=200&&movecontact

[State 2OS]
value=220
type=changestate
triggerall=var(9)=3
triggerall=statetype!=a&&ctrl
trigger1=stateno=210&&movecontact


If you're coding for 1.0+, disregard the 50 CPU commands, and the varset, and instead use

triggerall=ailevel>=0

instead of

triggerall=var(9)=3


As mostly everyone here said, AI isn't really important, specially if you're new and / or you don't know what you're doing yet

I would suggest studying state controllers and triggers before doing any sort of coding

Seravy

About AI :
http://elecbyte.com/wiki/index.php/AI

About Commands :

Making a command work consists of two parts.

Part I is the command itself : It is very well explained in KFM how they work.
They go to the first part of the .cmd file, and look like this :
[Command]
name = "grand"
command = ~D, DF, F, a
time=20

D is for Down, F is for Forward, a is for the a button, read kfm.cmd for more details on the rest.
name="" is the name of your command, this can be anything you want. time is how long the player can take from the first button to the last while using the command in ticks (1/60th of a second).

Part II is a Changestate, placed in your statedef -1 (usually located in the second half of the .cmd file).
Changestate is a state controller, like a hitdef, varset, etc.
It only has one parameter you need here : value.
You have to set your attack's state number there.

For example if you coded your light punch into [Statedef 200], then you have to use
[State -1]
Type=Changestate
value=200

All the rest are the triggers, and you have to figure out those yourself.
They are the conditions you want the attack to work at.
This generally includes
-Having control
-Being in the correct statetype (Standing, Air, Crouching)
-Having the necessary costs for the attack (power for a super)
-Having the command actually entered by the player

A simple example would look like this
[State -1]
Type=Changestate
value=200 ; Go to state 200 when all the conditions are true
Trigger1=command="LightPunch" ; The light punch command was entered
Trigger1=ctrl ; the player has control (isn't already attacking)
Trigger1=Statetype!=A ; and is not in the air, as this is a standing light punch, not an aerial one.


After this adding AI is mostly adding more conditions to these Changestate parts, as described at the link above.

You'll also need to keep in mind that the Changestates are processed in the order they appear in the file.
If you have similar commands that can activate at the same time (like a and QCFa, both ending with a thus activating the same time), you have to put the one you want to work in this case first, which is usually the longer one (in this case QCFa)

AI actually is very important.
It is not important when you are playing the character, but it is very important when you are playing against it.
As the most common is that people play their 5-10 favorites while have 100+ characters they play against, 90% of the time, AI does matter, a lot.
Unless you are lucky enough to always have a friend to play against instead of playing against the AI, AI will matter.

Cyanide

QuoteAI actually is very important.
It is not important when you are playing the character, but it is very important when you are playing against it.
As the most common is that people play their 5-10 favorites while have 100+ characters they play against, 90% of the time, AI does matter, a lot.
Unless you are lucky enough to always have a friend to play against instead of playing against the AI, AI will matter.
AI has no bearing upon the quality of a character. If you have made it well even mugen's default can be a bit of a challenge. AI is the single LEAST important thing in mugen coding and should be done last at all times.


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.

Fumo

Seravy hit the nail right on the head.
That's exactly what I needed clarification on.
As for the AI, I will probably deal with that later.

I'll come back to this thread if happen to need anymore assistance so I would like to keep this thread unlocked.
W.I.P ...


Captain Falcon: 68%
(on hold)

Werewood

I think A.I. matters especially for bossess  :twisted:
* Pleasing other people is nice, but when creating for Mugen, you're supposed to please yourself first. -- Cybaster

Cyanide

Still has no bearing on the quality of a character. If a character is shit, good AI doesn't make it better. If it's good, good AI won't make it better because the quality is there already. The AI doesn't improve it's overall feel or look. it just makes the fight harder.

On the flipside of that. Bad AI can make a good character worse.


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.

Matgonor

#11
Man, start reading all the CNS and CMDs u can, then a light will show up in ur head and u´ll get it alone.
Tutorials help, but practice makes perfection

Jesuszilla

#12
I seriously started by just observing the coding of a character whose style I wanted. In my case, it was Warusaki's coding (mostly Terry).

This quote is kinda relevant I think:
Quote from: JmorphmanIf you want to do a character in "Pots style", do what I did: steal his code.



There's not a single damn good tutorial out there for telling you how to do what you want. You gotta find it yourself, even if it means starting with a base.


AI isn't the most important thing, either... though it is boring as hell fighting a character with no AI. I'm only just now experimenting with it after five years, so there's no need to hurry.

Cyanide

Also, AI is pretty easy to make if you wanna be slack. Copy your [statedef -1] in the .cmd, remove the commands and swap them for random and AIlevel, instant shitty AI.

It will never be hard to make AI, just time consuming and dull.


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.

Riptide

I thought that was the standard way to make AI.

On a side note, there are coding styles pot's, Warusaki's ? I thought it was just think of a move and figure out how to code it.

Cyanide

Blah style simply means they have a somewhat custom gameplay aspect to their characters that's not in the game that's consistent over everything they make. It doesn't really mean shyte. Code how you like and what you like.


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.

Jesuszilla

There ARE certain styles in which creators write their code, though. PotS and Vans bunch together similar SCTRLs, Reu's has no spacing whatsoever, Ahuron says [State A, 0] because he has lackeys who copypaste everything, and I use proper capitalization because I'm a grammar nazi. Though this has nothing to do with how the code turns out, it's just interesting to point out.

Zuhukanah

Quote from: Jesuszilla on November 19, 2010, 04:55:09 AM
Ahuron says [State A, 0] because he has lackeys who copypaste everything,
lol, I did that a lot with my Lich King. Although I think I have edited some of those to give the proper stateno and some type of description :P


Links lead to their original Elecbyte posts.

Cyanide

That wouldn't be recognisable to your average mugen player who considers anything with non CvS2 gameplay but having CvS2 sparks as someone trying to imitate "pots style"

Although yes, in terms of code people do tend to do things a certain way. The bunched up code is horrible if you want to read it later though. It's fine while you're doing it, but if you come back to it it's kinda ick.

Capitalisation is actually a good trait and can make the code more readable.

After [E] mentioned it all my states now get labeled [state Changestate] instead of [state 1000,1] It actually works pretty well and means that you don't need to change so much if you go copy pasting code around.


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.

2OS

Quote from: Jesuszilla on November 19, 2010, 04:55:09 AM
Reu's has no paragraph breaking whatsoever



lol @ [state a]





A parameter / trigger can only take so many characters, one of the reasons why I code 100 % optimized, no spacing, no paragraph breaking, no capitals, except for what I put in brackets, which is usually just my authorname unless it's a descriptive tutorial I'm giving


[State 2OS, Annoying Just Defend With Pauses Whore Must Die Immediately]
type=varset
trigger1=1
var(17)=ifelse(enemy,name="Ayu Tukimiya"&&enemy,authorname="shikkoku"&&enemy,palno=12||enemy(enemy,teammode=simul),name="Ayu Tukimiya"&&enemy(enemy,teammode=simul),authorname="shikkoku"&&enemy(enemy,teammode=simul),palno=12,0,1)
ignorehitpause=1
persistent=1
pausemovetime=9999999
supermovetime=9999999

^ If the vars value had spaces in it AFTER the equal sign, odds are the engine wouldn't read the entire thing due to there are too many characters on the parameter and show as an error, since it's optimized, it works just fine


If for whatever reason I ever take an entire piece of code or state from another author, I credit the author through its brackets like so


[State Reu]
type=null
trigger1=1

[State Warusaki3]
type=null
trigger1=1

[State JUN]
type=null
trigger1=1

[State 608]
type=null
trigger1=1

[State pkrs]
type=null
trigger1=1

etc.