YesNoOk
avatar

Adaptative A.I. for mugen... (Read 15415 times)

Started by recruta42, July 06, 2007, 02:25:38 am
Share this topic:
Re: Adaptative A.I. for mugen...and useful ai triggers
#41  September 01, 2007, 07:40:15 am
  • ******
  • [E]
    • Mexico
i would rather use a state map , it has to be put in the helper, though otherwise it will mess up the player. another good point of those is that you can immediately move to a different map if you detect special opponents.

(yet another) example of a statemap.

fight starts. my player calls helper "AIstatemap" , and that helper's starting state is state 100,000.

[statedef 100 000]
;this is the starting state, herewe can check soem stuff and guess possible future actions.
;a lot of this can be reused for later states in the statemap.
; even some general checking can be added in state-2 with an ishelper 100 000 trigger to cover more stuff.
; the point of this is getting the ai code as apart from the char as possible.

; this changes to getting away from p2
type =changestate
value = 100 001
trigger1 = p2dist X < 100

; this changes to getting near to p2
type =changestate
value = 100 002
trigger1 = p2dist X > 100

; you keep on coding like that inside the helper's states for more situations
;then in the parent you check the helper state to know about the ai current mindset

type = changestate
value = shoryuken
triggerall= AI
trigger1 = helper 100,000 , stateno = 100,001 ; i.e., if we are geting away, we have higher chances of retaliating with a dp because
; p2 is near and he is following us

hjk

Re: Adaptative A.I. for mugen...
#42  September 02, 2007, 07:21:16 am
  • ****
  • Watch my fro grow as you go, go, go, go, go.
    • Afghanistan
Quote
Var overriding, as I believe PotS said, is almost impossible to avoid. Mugen can activate it's own and 'disobey' (shocker  Shocked), in the form of some glitches that still lie in the system.
Mugen does not ignore variables. I've never seen anything i've coded using variables ignore them unless i've done something dumb that allows it to. If this is to do with your AI experiments i'm sure we explained this.

My comment really is as far as my own experience goes.

I'm someone who hates coding in states dealing with AIR so I usually have a code in each of the chars I create and AI for, that triggers a dodge state as soon as stateno = 40 (if a char does have this as the jumpstart anim/state) is triggered randomly by the default AI, to be activated 100% of the time.
I have seen many of my AIs disobey what I have coded, a really low percentage of the time mind you. I'd have to guess it would be about 2% of the time, because I've run over 300 trials of  this (by simply watching my AIs fight) where the dodge state triggers more times than the jump, but where the jump may still complete itself.





Var overriding, as I believe PotS said, is almost impossible to avoid. Mugen can activate it's own and 'disobey' (shocker  :o), in the form of some glitches that still lie in the system.
what

I don't remember saying anything like that, Mugen will only "activate its own and disobey" if you're using sysvars without adapting the common states or if the opponent is flawed and messes with your vars during custom states.

That's my bad. It wasn't you and I believe I misread the post that I was referring to. I'm too lazy to re-read this topic right now, but again, I'm pretty sure I must have misread something.  :S



Side-Note:

We need a :shrug: smiley.

And I wanted to type a :huh get it: smiley or a :beg: smiley after that little side-note.
LOL, Caddie's the man!! ;)

I'm as real as the runnin, I just happen to rap, Nigaas London, Japan, and i'm scared of dat tap.

I suggest extending my banning, cuz when I come back, it's gonna be hell. You think I was annoying before, oh man, it's on now :)
hjk vs. 99% of MFG. I will win.

RIP Poo Bear Tell my Dead Homie isson, for the year my partner.
Re: Adaptative A.I. for mugen...
#43  September 02, 2007, 07:31:21 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Quote
I have seen many of my AIs disobey what I have coded, a really low percentage of the time mind you. I'd have to guess it would be about 2% of the time, because I've run over 300 trials of  this (by simply watching my AIs fight) where the dodge state triggers more times than the jump, but where the jump may still complete itself.

And as i stated in the other thread, this would be because there is also an evade state the human player can use. Just because AI is on does not mean this state will never be used. The default mugen AI is still in effect. Thats why moves that aren't specified in your AI code can still occur.

That would be something to consider for adaptative AI, disabling basic changestates if you plan to use it. Simple but not thought of.


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.

hjk

Re: Adaptative A.I. for mugen...
#44  September 02, 2007, 07:36:31 am
  • ****
  • Watch my fro grow as you go, go, go, go, go.
    • Afghanistan
Quote
I have seen many of my AIs disobey what I have coded, a really low percentage of the time mind you. I'd have to guess it would be about 2% of the time, because I've run over 300 trials of  this (by simply watching my AIs fight) where the dodge state triggers more times than the jump, but where the jump may still complete itself.

And as i stated in the other thread, this would be because there is also an evade state the human player can use. Just because AI is on does not mean this state will never be used. The default mugen AI is still in effect. Thats why moves that aren't specified in your AI code can still occur.

That would be something to consider for adaptative AI, disabling basic changestates if you plan to use it. Simple but not thought of.


I do disable the default AI states.
I always put in

Quote
triggerall = !var(59)

For commands I don't want to activate when the AI already has.







Quote
And as i stated in the other thread, this would be because there is also an evade state the human player can use. Just because AI is on does not mean this state will never be used. The default mugen AI is still in effect. Thats why moves that aren't specified in your AI code can still occur.

BTW I wasn't the one who asked about that. I think you may be mixing up my post about "Problems with Mugen Creation" with something else.
LOL, Caddie's the man!! ;)

I'm as real as the runnin, I just happen to rap, Nigaas London, Japan, and i'm scared of dat tap.

I suggest extending my banning, cuz when I come back, it's gonna be hell. You think I was annoying before, oh man, it's on now :)
hjk vs. 99% of MFG. I will win.

RIP Poo Bear Tell my Dead Homie isson, for the year my partner.
Last Edit: September 02, 2007, 07:42:15 am by Tee Hee Hee
Re: Adaptative A.I. for mugen...
#45  September 03, 2007, 07:27:54 pm
  • ******
  • [E]
    • Mexico
there are hard coded commands, like walking and jumping that still occur, as cyanide pointed out. you can try to ctrlset to 0 when the ai is on.

hjk

Re: Adaptative A.I. for mugen...
#46  September 03, 2007, 07:32:30 pm
  • ****
  • Watch my fro grow as you go, go, go, go, go.
    • Afghanistan
there are hard coded commands, like walking and jumping that still occur, as cyanide pointed out. you can try to ctrlset to 0 when the ai is on.

Yeah, but sometimes that leads to glitches or else freezing @_@


I usually just run over it by coding in a dodge state whenever the jump is triggered where I don't want it.





BTW R[E]ika got some new info for you ^_^
LOL, Caddie's the man!! ;)

I'm as real as the runnin, I just happen to rap, Nigaas London, Japan, and i'm scared of dat tap.

I suggest extending my banning, cuz when I come back, it's gonna be hell. You think I was annoying before, oh man, it's on now :)
hjk vs. 99% of MFG. I will win.

RIP Poo Bear Tell my Dead Homie isson, for the year my partner.
Re: Adaptative A.I. for mugen...
#47  September 03, 2007, 07:50:32 pm
  • ****
  • "Moyashi tsuku shite yaru..."
Make ChangeStates for standard commands. That could prevent AI from random changestates. Am I wrong? Examples:
[State -1, Jump]
type = ChangeState
value = 40
triggerall = !var(0)
triggerall = StateType != A
triggerall = Ctrl || StateNo = 100
trigger1 = command = "holdup" && command != "holddown"
trigger2 = command = "highjump"

[State -1, Walk]
type = ChangeState
value = 20
triggerall = !var(0) && Ctrl
triggerall = StateType = S
;triggerall = Pos Y = 0
triggerall = P2MoveType != A && !InGuardDist
triggerall = command != "holddown" && command != "holdup"
trigger1 = (command = "holdfwd" && command != "holdback") || (command = "holdback" && command != "holdfwd")

[State -1, Crouch]
type = ChangeState
value = 10
triggerall = !var(0) && Ctrl
triggerall = StateType = S
;triggerall = Pos Y = 0
triggerall = P2MoveType != A && !InGuardDist
trigger1 = command = "holddown"

hjk

Re: Adaptative A.I. for mugen...
#48  September 03, 2007, 07:58:58 pm
  • ****
  • Watch my fro grow as you go, go, go, go, go.
    • Afghanistan

Make ChangeStates for standard commands. That could prevent AI from random changestates. Am I wrong? Examples:
[State -1, Jump]
type = ChangeState
value = 40
triggerall = !var(0)
triggerall = StateType != A
triggerall = Ctrl || StateNo = 100
trigger1 = command = "holdup" && command != "holddown"
trigger2 = command = "highjump"

[State -1, Walk]
type = ChangeState
value = 20
triggerall = !var(0) && Ctrl
triggerall = StateType = S
;triggerall = Pos Y = 0
triggerall = P2MoveType != A && !InGuardDist
triggerall = command != "holddown" && command != "holdup"
trigger1 = (command = "holdfwd" && command != "holdback") || (command = "holdback" && command != "holdfwd")

[State -1, Crouch]
type = ChangeState
value = 10
triggerall = !var(0) && Ctrl
triggerall = StateType = S
;triggerall = Pos Y = 0
triggerall = P2MoveType != A && !InGuardDist
trigger1 = command = "holddown"


The thing about that is that sometimes the code for the jump isn't located anywhere within the character.
I don't know why, (me being a lazy person, I never put a lot of effort into checking), but I assume the common.cns can take care of the jump at default.


Moreover, many chars I've seen don't even define the jump (  [statedef 40]  or otherwise )  which has left me stumped. Nowhere in the CNS, nowhere in the CMD and I'm just lost as far as that goes.
LOL, Caddie's the man!! ;)

I'm as real as the runnin, I just happen to rap, Nigaas London, Japan, and i'm scared of dat tap.

I suggest extending my banning, cuz when I come back, it's gonna be hell. You think I was annoying before, oh man, it's on now :)
hjk vs. 99% of MFG. I will win.

RIP Poo Bear Tell my Dead Homie isson, for the year my partner.
Re: Adaptative A.I. for mugen...
#49  September 03, 2007, 08:01:29 pm
  • ******
  • [E]
    • Mexico
mugen's internal ai will sstill trigger the jump as long as you have control, that's why the assert specials for nowalk were created.

hjk

Re: Adaptative A.I. for mugen...
#50  September 03, 2007, 08:05:16 pm
  • ****
  • Watch my fro grow as you go, go, go, go, go.
    • Afghanistan
mugen's internal ai will sstill trigger the jump as long as you have control, that's why the assert specials for nowalk were created.


Thank You :wall:

Man that makes everyting so much harder. @_@



BTW I sent you a PM ^_^
LOL, Caddie's the man!! ;)

I'm as real as the runnin, I just happen to rap, Nigaas London, Japan, and i'm scared of dat tap.

I suggest extending my banning, cuz when I come back, it's gonna be hell. You think I was annoying before, oh man, it's on now :)
hjk vs. 99% of MFG. I will win.

RIP Poo Bear Tell my Dead Homie isson, for the year my partner.
Re: Adaptative A.I. for mugen...
#51  September 03, 2007, 08:06:33 pm
  • ******
  • [E]
    • Mexico
yah, i noticed. about the prevstateno thingie, that's why i suggest statemaps, though i know implementing statemaps just like that is hard.

hjk

Re: Adaptative A.I. for mugen...
#52  September 03, 2007, 08:13:25 pm
  • ****
  • Watch my fro grow as you go, go, go, go, go.
    • Afghanistan
LOL, Caddie's the man!! ;)

I'm as real as the runnin, I just happen to rap, Nigaas London, Japan, and i'm scared of dat tap.

I suggest extending my banning, cuz when I come back, it's gonna be hell. You think I was annoying before, oh man, it's on now :)
hjk vs. 99% of MFG. I will win.

RIP Poo Bear Tell my Dead Homie isson, for the year my partner.