A place to have fun with Mugen
 
PortalHomeFAQMemberlistSearchRegisterComic WIP TrackerDownloadsLog inChat
Translate the Website
Log in
Username:
Password:
Log in automatically: 
:: I forgot my password
Latest topics
» Request stage from video
by yolomate Today at 10:27 am

» Dc Cheetah Wip
by yolomate Today at 9:56 am

» doctrine dark from street fighter ex released!
by volzzilla Today at 7:48 am

» CAPCOM VS SNK - STAGE PACK 2016
by volzzilla Today at 7:47 am

» Eric Draven [The Crow]
by volzzilla Today at 7:45 am

» my new full game wip
by Fabry Taz Today at 7:41 am

Special Features at MMV








Share | 
 

 Shirayuki33desu's way to make your MUGEN character's A.I. block/guard better

View previous topic View next topic Go down 
AuthorMessage
borewood2013



Posts : 3162
Join date : 2014-08-11

PostSubject: Shirayuki33desu's way to make your MUGEN character's A.I. block/guard better   March 4th 2016, 10:05 am

A MUGEN author Shirayuki33desu in his/her/its MUGEN blog suggested some way to make a MUGEN character's A.I. block/guard better:
http://shirayuki33desu.blog.fc2blog.us/blog-entry-5.html

Some important points by Shirayuki33desu:

In the MUGEN character's Statedef -3:

** Var(59) is a MUGEN Variable to check whether the MUGEN character is controlled by human or A.I.
  You can of course use your own MUGEN A.I. activation flag...


Code:
[State -3, ChangeState] ; crouching block/guard
type = ChangeState
value = 131
triggerall = !IsHelper
triggerall = RoundState = 2
triggerall = Alive
triggerall = Var(59) && StateType ! = A
triggerall = P2StateType = C
triggerall = NumEnemy
triggerall = !EnemyNear, HitDefAttr = SCA,NT,ST,HT
triggerall = Ctrl && P2StateType != A
trigger1 = InGuardDist
trigger1 = Facing != EnemyNear, Facing
trigger2 = P2BodyDist x < 0 && P2MoveType = A




Code:
[State -3, ChangeState] ; standing block/guard
type = ChangeState
value = 130
triggerall = !IsHelper
triggerall = RoundState = 2
triggerall = Alive
triggerall = Var(59) && StateType ! = A
triggerall = P2StateType != C
triggerall = NumEnemy
triggerall = !EnemyNear, HitDefAttr = SCA,NT,ST,HT
triggerall = Ctrl
trigger1 = InGuardDist
trigger1 = Facing != EnemyNear, Facing
trigger2 = Facing = EnemyNear, Facing
trigger2 = P2Dist X > 0
trigger2 = P2BodyDist X = [-10,60] ; to be changed for your own need
trigger2 = P2MoveType = A
trigger3 = P2BodyDist X < 0 && P2MoveType = A




Code:
[State -3, ChangeState] ; in-air block/guard
type = ChangeState
value = 132
triggerall = !IsHelper
triggerall = RoundState = 2
triggerall = Alive
triggerall = Var(59) && StateType = A
trigger1 = InGuardDist
trigger2 = P2BodyDist X < 0 && P2MoveType = A



Next, in the MUGEN default block/guard states, Statedef 120-155, need to be rewritten to take care of the MUGEN A.I.
Like, for each MUGEN statement that have "command = " lines, a MUGEN A.I. version is needed in order to make the MUGEN character's A.I. react correctly for the MUGEN Enemy's StateType.  Since MUGEN people re-write their Statedef 120-155 differently, there is no
certain version, or you can try to look at Shirayuki33desu's Statedef 120-155 re-write way:
http://shirayuki33desu.blog.fc2blog.us/blog-entry-5.html

Now, the actual MUGEN A.I. move ChangeState...in the MUGEN character's Statedef -1 (I prefer Statedef -3 personally though)...for example, the standing light punch, you need a human-only version and a MUGEN A.I.-only version:


Code:
;Stand Light Punch
[State -1, Stand Light Punch] ; human-only version
type = ChangeState
value = 200
triggerall = !IsHelper
triggerall = RoundState = 2
triggerall = Alive
triggerall = !Var(59)
triggerall = Command = "x"
triggerall = Command != "holddown"
triggerall = StateType != A
trigger1 = Ctrl




Code:
;Stand Light Punch
[State -1, Stand Light Punch] ; MUGEN A.I.-only version
type = ChangeState
value = 200
triggerall = !IsHelper
triggerall = RoundState = 2
triggerall = Alive
triggerall = Var(59)
triggerall = StateType != A
triggerall = Ctrl
triggerall = Time % 2 = 0 ; it is like 50%-50% happening ratio, or use your own conditions...
trigger1 = !InGuardDist   ; making sure MUGEN A.I. will not attack when its Enemy is attacking, and you can add more conditions like MUGEN Life value, MUGEN Power value, distances to MUGEN Enemy, or even some animation times,...etc...
trigger2 = NumEnemy       ; it is for when MUGEN Enemy is put behind your MUGEN character
trigger2 = EnemyNear, Facing = Facing && Abs(EnemyNear, Pos X - Pos X) > 15 ; to be changed for your own need



In addition, some MUGEN people try to disable the MUGEN A.I.'s default block/guard behavior:
A way by Seravy:


Code:
[State -1, Disable the MUGEN A.I.'s default block/guard]
type = Assertspecial
triggerall = !IsHelper
triggerall = RoundState = 2
triggerall = Alive
triggerall = Var(59)
trigger1 = StateNo != [120,155]
flag = noairguard
flag2 = nocrouchguard
flag3 = nostandguard



More Shirayuki33desu's MUGEN A.I. ways here:
http://shirayuki33desu.blog.fc2blog.us/blog-entry-5.html
Back to top Go down
View user profile https://onedrive.live.com/?cid=7DB65F02B0BBD12E
btony89



Posts : 2136
Join date : 2015-06-04
Location : México

PostSubject: Re: Shirayuki33desu's way to make your MUGEN character's A.I. block/guard better   March 4th 2016, 11:16 am

Interesting, this are really good tips, thanks for posting it here.
Back to top Go down
View user profile https://www.youtube.com/channel/UC0y46-XHBIoPw2vo3yDmO2w
volzzilla



Posts : 5516
Join date : 2012-05-02

PostSubject: Re: Shirayuki33desu's way to make your MUGEN character's A.I. block/guard better   March 7th 2016, 12:05 pm

are you saying just insert that code into a character to improve its AI?
Back to top Go down
View user profile
borewood2013



Posts : 3162
Join date : 2014-08-11

PostSubject: Re: Shirayuki33desu's way to make your MUGEN character's A.I. block/guard better   March 10th 2016, 6:14 am

@volzzilla wrote:
are you saying just insert that code into a character to improve its AI?

Hmmmmmmmm........sorry, no. Embarassed

For the ChangeState to 131/130/132 MUGEN code, you might add it directly to your [Statedef -3], and you must make sure it is for MUGEN A.I. only, like, Var(59) used in the example is the MUGEN A.I. flag.  But since different MUGEN makers use different MUGEN A.I. flag methods so Var(59) can mean something unrelated to MUGEN A.I. in some others.  Also some MUGEN Triggers like "P2BodyDist X = [-10,60]" does not work for all MUGEN characters too because every MUGEN character can have it own custom sizes and block/guard states so the numbers in [] need to be changed for your own MUGEN character.  Same thing for the "the standing light punch" in the example, every MUGEN character's "standing light punch" can be coded differently. Neutral

The only care-free MUGEN code to insert directly might be the "Disable the MUGEN A.I.'s default block/guard" one.........yet again you need to define your own MUGEN A.I. flag (be it Var(59) or by any other means) first.......

Simple put, all the MUGEN code samples are for demonstration little tutorial only, and Shirayuki33desu's MUGEN A.I. blog serves as a guideline too.  You still need to study fully your own MUGEN character(s) to try to make custom MUGEN A.I. study
Back to top Go down
View user profile https://onedrive.live.com/?cid=7DB65F02B0BBD12E
 
Shirayuki33desu's way to make your MUGEN character's A.I. block/guard better
View previous topic View next topic Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
The Mugen Multiverse :: Mugen :: Mugen Resources-
Jump to: