mugen chars, rare characters
Mugen | CHAT | A.I. programming - Forum | Registration | Login
[New messages · Members · Forum rules · Search · RSS ]
  • Page 1 of 1
  • 1
A.I. programming
BabricogurlDate: Tuesday, 2010-04-13, 4:38 PM | Message # 1
Hero
Group: contributor
Messages: 429
Awards: 3
Reputation: 7
Reproofs: 0%
Status: Offline
--------------------------------------------------------------------------------
========================
AI Programming Tutorial
========================

---------------------------------------------------------------------------
Programming a character's custom AI is something extra; It's not needed in any
character, but most people seem to want to do it anyway, whether it is to kick
another character's arse, increase the gameplay of the character, or just for
watch mode.
---------------------------------------------------------------------------

When programming an AI, it is recommended that you have completed most of
the character. It will makes things easier, so you won't have to go back and change
anything in the script if you decide to add in more stuff.

Think about the moves for your character; How you want it to use a projectile,
when to guard, and when to attempt to throw the opponent? It's up to you. A well
planned AI is important, as poorly made AI's can end up extremely glitchy.

This example shows how your character will attempt to throw the opponent, only
when it is close to the opponent, and when the opponent is on the floor. I choose
to do the AI programming under StateDef -3, but this can be done under StateDef -2, or
even StateDef -1 of the CMD file.

[State -2: ChangeState]
type = ChangeState
trigger1 = (Var(0) > 0)
trigger1 = (Random <= 499)
trigger1 = (StateType != A) && (Ctrl)
trigger1 = (P2BodyDist X <= 40) && (P2StateType = S)
value = ****;this is where you put the statedef of the move you want to do.

The 1st trigger, "(Var(0) > 0)" means that the move can only be read by the AI.
Remember, the AI Activation sets the value of Var(0) to 1.

2nd trigger, "(Random <= 499)" means that the AI will make an attempt to throw the
opponent, but only half the time. This should be used, so your character
is not too predictable.

3rd trigger, is simply used, so that the character can only make the throw attempt
when he is on the ground, (StateType != A) and is able to do so. (Ctrl)

Finally, the 4th trigger, "(P2BodyDist X <= 40) && (P2StateType = S)" means that
the character will throw the opponent, only when the opponent is close, (P2BodyDist X <= 40)
and when the opponent is on the ground as well. (P2StateType = S)

Given this idea as how it is done, you can come up with your own character AI's.


http://www.youtube.com/user/TheBabricogurl
 
ŁfenrirŁDate: Saturday, 2010-04-24, 8:54 AM | Message # 2
Angel
Group: contributor
Messages: 1346
Awards: 1
Reputation: 3
Reproofs: 0%
Status: Offline
omg I cant thank you enough i was just about to ask this question happy

WIP SoiFon Picture Ripped by Dan Mt
95% click sig to get latest version
 
adjgokuDate: Thursday, 2010-08-05, 3:44 PM | Message # 3
Adult
Group: Users
Messages: 48
Awards: 0
Reputation: 0
Reproofs: 0%
Status: Offline
wow great tut. i was curious about A.I. programming.
 
buyDate: Thursday, 2010-08-05, 5:51 PM | Message # 4
Angel
Group: Administrators
Messages: 1243
Awards: 2
Reputation: 14
Status: Offline
Ai is the soul of a char
 
MGSSJ2Date: Thursday, 2010-08-05, 8:01 PM | Message # 5
Mystic Coder
Group: contributor
Messages: 2954
Awards: 5
Reputation: 47
Reproofs: 0%
Status: Offline
Quote (buy)
Ai is the soul of a char

Then I guess I'll have to post the AI I made for my Sasuke... Soon ^^


 
BabricogurlDate: Friday, 2010-08-06, 7:04 AM | Message # 6
Hero
Group: contributor
Messages: 429
Awards: 3
Reputation: 7
Reproofs: 0%
Status: Offline
[State -1, AI Crouch Light Punch]
type = ChangeState
value = 300
triggerall = var(58) = 1
triggerall = P2MoveType != A
trigger1 = p2bodydist x = [10,40]
trigger1 = p2bodydist y = [-5,5]
trigger1 = statetype = S
trigger1 = ctrl
trigger1 = random < 999
trigger2 = p2bodydist x = [10,40]
trigger2 = p2bodydist y = [-5,5]
trigger2 = statetype = C
trigger2 = ctrl
trigger2 = random < 999
trigger3 = stateno = 200
trigger3 = moveguarded
trigger3 = pos y = 0
trigger3 = random < 999
trigger4 = stateno = 303
trigger4 = hitcount <= 6
trigger4 = random < 999

[State -1,AI Crouch Weak Kick]
type = ChangeState
value = 302
triggerall = var(58) = 1
trigger1 = stateno = 300
trigger1 = movehit
trigger1 = random < 999
trigger2 = p2bodydist x = [10,40]
trigger2 = p2bodydist y = [-5,5]
trigger2 = random <= 700 && statetype = S && ctrl
trigger2 = p2stateno = 5120

[State -1,AI Crouch Strong Punch]
type = ChangeState
value = 301
triggerall = var(58) = 1
trigger1 = stateno = 302
trigger1 = movecontact
trigger1 = random < 999
trigger2 = var(18) = 11

[State -1,AI Crouch Strong Kick]
type = ChangeState
value = 303
triggerall = var(58) = 1
trigger1 = stateno = 301
trigger1 = moveguarded
trigger1 = random < 999

[State -1,AI Stand Strong Punch]
type = ChangeState
value = 201
triggerall = var(58) = 1
trigger1 = stateno = 200
trigger1 = movehit

[State -1,AI Stand Light Kick]
type = ChangeState
value = 211
triggerall = var(58) = 1
trigger1 = stateno = 201
trigger1 = movehit

[State -1, AI Standing Strong Kick]
type = ChangeState
value = 215
triggerall = var(58) = 1
trigger1 = stateno = 211
trigger1 = movecontact

[State -1, AI Jump Light Punch]
type = ChangeState
value = 400
triggerall = p2life != 0 && var(58) = 1 && stateno != 2001
trigger1 = p2bodydist x = [0,30]
trigger1 = P2BodyDist Y = [-30, 30]
trigger1 = statetype = A
trigger1 = ctrl
trigger2 = stateno = 250000
trigger2 = hitcount > 4
trigger3 = stateno = 255000
trigger3 = movecontact
trigger4 = stateno = 104000
trigger4 = movehit && animtime = 0
trigger4 = p2bodydist x = [0,30]
trigger4 = p2bodydist y = [-5,5]
trigger4 = pos y < 0

[State -1, AI Jump Light Punch]
type = ChangeState
value = 400
triggerall = p2life != 0 && var(58) = 1 && stateno != 2001
trigger1 = p2bodydist x = [0,30]
trigger1 = P2BodyDist Y = [-10, 10]
trigger1 = statetype = A
trigger1 = ctrl
trigger2 = stateno = 250000
trigger2 = hitcount > 4
trigger3 = stateno = 255000
trigger3 = movecontact
trigger4 = stateno = 104000
trigger4 = movehit && animtime = 0
trigger4 = p2bodydist x = [0,30]
trigger4 = p2bodydist y = [-5,5]
trigger4 = pos y < 0

[State -1, AI Jump Strong Punch]
type = ChangeState
value = 401
triggerall = p2life != 0 && var(58) = 1
trigger1 = stateno = 400
trigger1 = movecontact
trigger1 = random < 999

[State -1, AI Jump light likck]
type = ChangeState
value = 402
triggerall = p2life != 0 && var(58) = 1
trigger1 = stateno = 401
trigger1 = movecontact
trigger1 = random < 999

[State -1, AI Jump strong likck]
type = ChangeState
value = 403
triggerall = p2life != 0 && var(58) = 1
trigger1 = stateno = 402
trigger1 = movecontact
trigger1 = random < 999


http://www.youtube.com/user/TheBabricogurl
 
ŁfenrirŁDate: Friday, 2010-08-06, 10:39 PM | Message # 7
Angel
Group: contributor
Messages: 1346
Awards: 1
Reputation: 3
Reproofs: 0%
Status: Offline
Quote (Babricogurl)
random < 999

just had a question about this random stuff not really to sure about it?????????????
how do you make one attack activate more often


WIP SoiFon Picture Ripped by Dan Mt
95% click sig to get latest version
 
BabricogurlDate: Saturday, 2010-08-07, 4:00 AM | Message # 8
Hero
Group: contributor
Messages: 429
Awards: 3
Reputation: 7
Reproofs: 0%
Status: Offline
Higher the random the more it executes the move

biggrin


http://www.youtube.com/user/TheBabricogurl
 
12scratchDate: Monday, 2011-01-03, 9:40 AM | Message # 9
Baby
Group: Users
Messages: 6
Awards: 0
Reputation: 0
Reproofs: 0%
Status: Offline
Thank you very much, this really helped me out, just wondering if I wanted to apply the "P2BodyDist X <= 40" to all of the attacks of character does it require me to put it in one by one or is there a way to do it by group

@MGSSJ2: would you mind telling me how to disable the auto-kawarii on your characters (Naruto, Itachi, Sasuke) when i use certain characters against them, they auto matically dodging all attacks and not receiving any damage


 
sgn_15Date: Monday, 2011-01-03, 11:45 AM | Message # 10
God
Group: contributor
Messages: 2518
Awards: 4
Reputation: 31
Reproofs: 0%
Status: Offline
Quote (Babricogurl)

Added (2011-01-03, 11:45 Am)
---------------------------------------------

Quote (Babricogurl)

if i use these things do i still have to do those 30-50 impossible commands (time = 0 or 1) and the varset code in state -1 ?
because thats how i learned AI coding although it may be a noobish way to code AI


 
  • Page 1 of 1
  • 1
Search:

Copyright MyCorp © 2025 Create a free website with uCoz