Infinity MUGEN Team

IMT Main => M.U.G.E.N Help => Topic started by: xPreatorianx on October 23, 2007, 09:23:01 PM

Title: [Help] How do i code an extremely good AI
Post by: xPreatorianx on October 23, 2007, 09:23:01 PM
Basically how do i code an extremely good kickass combo mastering AI? Because i have no clue how to do it!
Title: Re: [Help] How do i code an extremely good AI
Post by: Fallen_Angel on October 23, 2007, 11:56:34 PM
First you need to make a var that activates the IA, I think the easiest way its making the inhuman commands ( I dont remember well the name), after that the codes of the AI, its about making decisions, to make a good AI, you need to try to be really specific, like putting that the command its in the air or stuff like that, the AI, combos are made like in the cmd using the stateno= ## && movehit, you can add time =##, there are a lot of things that you can do.

If you want on saturday or sunday, I explain these to you, really detailed,
Title: Re: [Help] How do i code an extremely good AI
Post by: xPreatorianx on October 24, 2007, 09:37:02 AM
kk ill wait till then
Title: Re: [Help] How do i code an extremely good AI
Post by: light on October 24, 2007, 07:43:04 PM
i am also interested in this?

what is the var , i see it in cmd but i have no clue the use or logic of it.
Title: Re: [Help] How do i code an extremely good AI
Post by: Fallen_Angel on October 26, 2007, 11:46:57 PM
These is one method to add Ai to your char, I take these from the Sykotik's tutorial    http://www.angelfire.com/jazz/xmurex/ver2/sykchar.htm

these goes in the cmd

;-| AI Commands |----------------------------------------------------------

[Command]
name = "cpu1"
command = U, U, U, U
time = 1
[Command]
name = "cpu2"
command = U, U, U, D
time = 1
[Command]
name = "cpu3"
command = U, U, D, D
time = 1
[Command]
name = "cpu4"
command = U, D, D, D
time = 1
[Command]
name = "cpu5"
command = D, D, D, D
time = 1
[Command]
name = "cpu6"
command = D, D, D, U
time = 1
[Command]
name = "cpu7"
command = D, D, U, U
time = 1
[Command]
name = "cpu8"
command = D, U, U, U
time = 1
[Command]
name = "cpu9"
command = U, D, U, U
time = 1
[Command]
name = "cpu10"
command = U, U, D, U
time = 1
[Command]
name = "cpu11"
command = D, U, U, D
time = 1
[Command]
name = "cpu12"
command = U, D, D, U
time = 1
[Command]
name = "cpu13"
command = D, U, D, U
time = 1
[Command]
name = "cpu14"
command = U, D, U, D
time = 1
[Command]
name = "cpu15"
command = F, F, F, F
time = 1
[Command]
name = "cpu16"
command = B, B, B, B
time = 1
[Command]
name = "cpu17"
command = F, B, F, F
time = 1
[Command]
name = "cpu18"
command = F, F, B, F
time = 1
[Command]
name = "cpu19"
command = B, F, F, F
time = 1
[Command]
name = "cpu20"
command = F, F, F, B
time = 1
[Command]
name = "cpu21"
command = F, B, B, F
time = 1
[Command]
name = "cpu22"
command = B, F, F, B
time = 1
[Command]
name = "cpu23"
command = F, B, F, B
time = 1
[Command]
name = "cpu24"
command = B, F, B, F
time = 1
[Command]
name = "cpu25"
command = D, F, D, F
time = 1
[Command]
name = "cpu26"
command = D, B, D, B
time = 1
[Command]
name = "cpu27"
command = D, B, D, F
time = 1
[Command]
name = "cpu28"
command = D, F, D, B
time = 1
[Command]
name = "cpu29"
command = U, F, D, B
time = 1
[Command]
name = "cpu30"
command = U, B, D, F
time = 1
[Command]
name = "cpu31"
command = B, D, F, U
time = 1
[Command]
name = "cpu32"
command = F, D, B, U
time = 1
[Command]
name = "cpu33"
command = U, U, U, U
time = 1
[Command]
name = "cpu34"
command = U, U, U, D
time = 1
[Command]
name = "cpu35"
command = U, U, D, D
time = 1
[Command]
name = "cpu36"
command = U, D, D, D
time = 1
[Command]
name = "cpu37"
command = D, D, D, D
time = 1
[Command]
name = "cpu38"
command = D, D, D, U
time = 1
[Command]
name = "cpu39"
command = D, D, U, U
time = 1
[Command]
name = "cpu40"
command = D, U, U, U
time = 1
[Command]
name = "cpu41"
command = U, D, U, U
time = 1
[Command]
name = "cpu42"
command = U, U, D, U
time = 1
[Command]
name = "cpu43"
command = D, U, U, D
time = 1
[Command]
name = "cpu44"
command = U, D, D, U
time = 1
[Command]
name = "cpu45"
command = D, U, D, U
time = 1
[Command]
name = "cpu46"
command = U, D, U, D
time = 1
[Command]
name = "cpu47"
command = F, F, F, F
time = 1
[Command]
name = "cpu48"
command = B, B, B, B
time = 1
[Command]
name = "cpu49"
command = F, B, F, F
time = 1
[Command]
name = "cpu50"
command = F, F, B, F
time = 1
[Command]
name = "cpu51"
command = B, F, F, F
time = 1
[Command]
name = "cpu52"
command = F, F, F, B
time = 1
[Command]
name = "cpu53"
command = F, B, B, F
time = 1
[Command]
name = "cpu54"
command = B, F, F, B
time = 1
[Command]
name = "cpu55"
command = F, B, F, B
time = 1
[Command]
name = "cpu56"
command = B, F, B, F
time = 1
[Command]
name = "cpu57"
command = D, F, D, F
time = 1
[Command]
name = "cpu58"
command = D, B, D, B
time = 1
[Command]
name = "cpu59"
command = D, B, D, F
time = 1
[Command]
name = "cpu60"
command = D, F, D, B
time = 1
[Command]
name = "cpu61"
command = U, F, D, B
time = 1
[Command]
name = "cpu62"
command = U, B, D, F
time = 1
[Command]
name = "cpu63"
command = B, D, F, U
time = 1
[Command]
name = "cpu64"
command = F, D, B, U
time = 1

*Just Copy This Under The Statedef -1, I Am Too Lazy To Explain Everything*

;-|AI Routine|----------------------------------------------------------------------------

;-|Signal AI Routines|--------------------------------------------------------------------
[State -1]
type = VarSet
v = 7
value = 1
triggerall = RoundState = 1 || RoundState = 2 || RoundState = 3 || RoundState = 4
triggerall = ctrl = 0 || ctrl = 1
trigger1 = command = "cpu1"
trigger2 = command = "cpu2"
trigger3 = command = "cpu3"
trigger4 = command = "cpu4"
trigger5 = command = "cpu5"
trigger6 = command = "cpu6"
trigger7 = command = "cpu7"
trigger8 = command = "cpu8"
trigger9 = command = "cpu9"
trigger10 = command = "cpu10"
trigger11 = command = "cpu11"
trigger12 = command = "cpu12"
trigger13 = command = "cpu13"
trigger14 = command = "cpu14"
trigger15 = command = "cpu15"
trigger16 = command = "cpu16"
trigger17 = command = "cpu17"
trigger18 = command = "cpu18"
trigger19 = command = "cpu19"
trigger20 = command = "cpu20"
trigger21 = command = "cpu21"
trigger22 = command = "cpu22"
trigger23 = command = "cpu23"
trigger24 = command = "cpu24"
trigger25 = command = "cpu25"
trigger26 = command = "cpu26"
trigger27 = command = "cpu27"
trigger28 = command = "cpu28"
trigger29 = command = "cpu29"
trigger30 = command = "cpu30"
trigger31 = command = "cpu31"
trigger32 = command = "cpu32"
trigger33 = command = "cpu33"
trigger34 = command = "cpu34"
trigger35 = command = "cpu35"
trigger36 = command = "cpu36"
trigger37 = command = "cpu37"
trigger38 = command = "cpu38"
trigger39 = command = "cpu39"
trigger40 = command = "cpu40"
trigger41 = command = "cpu41"
trigger42 = command = "cpu42"
trigger43 = command = "cpu43"
trigger44 = command = "cpu44"
trigger45 = command = "cpu45"
trigger46 = command = "cpu46"
trigger47 = command = "cpu47"
trigger48 = command = "cpu48"
trigger49 = command = "cpu49"
trigger50 = command = "cpu50"
trigger51 = command = "cpu51"
trigger52 = command = "cpu52"
trigger53 = command = "cpu53"
trigger54 = command = "cpu54"
trigger55 = command = "cpu55"
trigger56 = command = "cpu56"
trigger57 = command = "cpu57"
trigger58 = command = "cpu58"
trigger59 = command = "cpu59"
trigger60 = command = "cpu60"
trigger61 = command = "cpu61"
trigger62 = command = "cpu62"
trigger63 = command = "cpu63"
trigger64 = command = "cpu64"


;---------------------------------
The chars used by the cpu randomizes the moves, (commands), so using these method the var of the Ai would activate when the cpu use one of the commands (if you put more it would be easier to activate the var).

Now that you have the var, you need to made changestates (these is the states that you want to code), for example
[State -1,200]
type = ChangeState
value = 200 ; light punch
triggerall = var(7) = 1 ; means that these will activate when the var its activated
triggerall = p2statetype  = S , these means that these would only activate when the opponent its on the stand position
trigger1 = statetype = S ; when the char its in stand position
trigger2 = statetype != A; when the char isn't in the air
trigger2 = statetype != C
trigger3 = p2bodydist X = [-20,20] ; when the opponent its between -20 and 20 pixels
trigger4 = stateno = 210 ; these works like the combos in the cmd, hese state activates after the char made the state 210, you can add && movehit  ; when the state 210 hits the opponent, or && time = 20, if you know how much time does the opponent char recovers from the 210 hit you can use the time 
if it was an special triggerall = power >= 1000

When coding try to make it the most specific that you can, so the char would do exactly what you want. and to make the char no to be predictable, you  can add trigger1= random <=xxx; there 999 numbers in the random the attack would activate if the number its less or equal to xxx.

I hope it helps you
Title: Re: [Help] How do i code an extremely good AI
Post by: dafamily on October 27, 2007, 12:25:30 AM
sweet, I've been looking for something like this too!
Title: Re: [Help] How do i code an extremely good AI
Post by: 2dgameplay on January 25, 2008, 02:16:09 PM
do this woork
Title: Re: [Help] How do i code an extremely good AI
Post by: Fallen_Angel on January 26, 2008, 08:55:19 AM
yes it does you only need to check that you arent repeating the vars..and put everything n the right place
Title: Re: [Help] How do i code an extremely good AI
Post by: xPreatorianx on January 26, 2008, 11:52:27 AM
kk ill try this have not done it yet... if anyone can contact syn( as im not able to atm) can you get him to send me the shin lv 2 akuma sprites ( just tell him to pm me on the forums)
SimplePortal 2.3.5 © 2008-2012, SimplePortal