YesNoOk
avatar

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

Started by recruta42, July 06, 2007, 02:25:38 am
Share this topic:
Adaptative A.I. for mugen...
#1  July 06, 2007, 02:25:38 am
  • **
  • Call me Private42.
I didn't opened this topic to talk about 'A.I. Activation method!!!'

I opened this topic to discuss about implementing and adaptative algorithm for a "learning" A.I. for mugen. Anyone already had this idea, or know a good article concerning it ? 

Re: Adaptative A.I. for mugen...
#2  July 06, 2007, 02:41:45 am
  • ******
  • Limited time to use Infinite power !
    • France
    • network.mugenguild.com/cybaster/
As you may know, Elecbyte had started implementing "AI" , which you can do by creating an AI file, writing "ai = whatever.ai" in the def file. However, the AI file generated doesn't do much, even though people tested it a lot. At it's best, we saw that Orochi herman's Orochi guarded quite well.

Other than that, Mugen doesn't overwrite any file of any character.
Hence, an adaptative AI would only be possible during one single match : at the beginning of the match, the opponent has only the AI you actually coded, and he learns during the match. Once this match is over, he won't remember what he has just learned, since you came out of the match, and Mugen didn't overwrite any file.

Anyway, to make the AI learn something, I believe the way to do it is create one or several helpers (for the different sets of moves for example), and use the variables specific to these helpers.
During the fight, depending on how the opponent fights, the values of some variables would change, and the coded AI would react depending on the value of these variables.

For example (lame one, but whatever) : after 3 seconds of attacks, if none of the attacks touches the opponent, while p2bodydistx and p2bodydisty <15, then it means he's guarding. Set variable 1 of the helper called adaptative_ai to 1.
Then, in the already coded AI, the randomization for throw would change depending on the value of this var(1).

In a full game as yours, it may be possible to see if the opponent keeps jumping, or keeps using the same attacks, or whatever, keep record of that, and set variables to act accordingly to the opponent's style... but it's seems like a very hard work.

You may want to ask r[E]ika about this one. IINM, he was interrested in developping such kinds of AI, and may have thought a bit about it.
Re: Adaptative A.I. for mugen...
#3  July 06, 2007, 03:47:32 am
  • ******
  • [E]
    • Mexico
as cyb said, you can't really make an adaptative one, as it can't remember anithing form figh to figh, a helper tree based system seems like the best answer, as, based on certain atributes of the fight, it can slightly adjust the strategy. like, stand close to the oponent when hw is about to wake up, then do a meaty attack, if the character gets grabbed, it should be now aware he is fighting against a grappler and take the encesary measurements.
Re: Adaptative A.I. for mugen...
#4  July 06, 2007, 04:14:31 am
  • *****
    • Peru
Isn't that the way everyone codes AI? Using decision trees?
Re: Adaptative A.I. for mugen...
#5  July 06, 2007, 12:20:51 pm
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
We're talking decision trees based on your actions rather than your position and proximity.

If you tend to always throw out a super when p2 is waking up the AI will react to this by standing up blocking as any human would do. That sort of thing.

Current AI's would make that random.


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.

Animugen

Re: Adaptative A.I. for mugen...
#6  August 27, 2007, 04:30:47 am
I thought the game's difficulty would overwrite the AI.Then what's the point of a Difficulty level then?
Re: Adaptative A.I. for mugen...
#7  August 27, 2007, 04:34:00 am
  • ******
    • Portugal
    • network.mugenguild.com/pots/
It still works for chars that don't have custom A.I., which I believe is the majority of them.
You can help with Ikemen GO's development by trying out the latest development build and reporting any bugs on GitHub.
My Mugen and Ikemen content can also be found here.
Re: Adaptative A.I. for mugen...
#8  August 27, 2007, 09:17:28 am
  • ****
  • "Moyashi tsuku shite yaru..."
Anyway, to make the AI learn something, I believe the way to do it is create one or several helpers (for the different sets of moves for example), and use the variables specific to these helpers.
Specific to that helper? What do you mean, this?
triggerall = NumHelper(1000) && var(1)
I forgot, will setting a variable inside a helper overwrite parent' s var? Or does helper have its own variable set? Meh, unlikely.
Re: Adaptative A.I. for mugen...
#9  August 27, 2007, 11:38:46 am
  • ******
    • Portugal
    • network.mugenguild.com/pots/
Latter. Each helper has its own set of vars, fvars, sysvars and sysfvars.
You can help with Ikemen GO's development by trying out the latest development build and reporting any bugs on GitHub.
My Mugen and Ikemen content can also be found here.
Re: Adaptative A.I. for mugen...
#10  August 27, 2007, 02:32:10 pm
  • ****
  • "Moyashi tsuku shite yaru..."
Re: Adaptative A.I. for mugen...
#11  August 27, 2007, 02:34:56 pm
  • ******
  • [E]
    • Mexico
the problem wiht learning is that the vars get reset before any real learning can happen.
Re: Adaptative A.I. for mugen...
#12  August 27, 2007, 02:38:11 pm
  • ****
  • "Moyashi tsuku shite yaru..."
the problem wiht learning is that the vars get reset before any real learning can happen.
Not at all. Properly written AI would be able to learn really fast. It won't be so noticeable in Round 1, but the more rounds played, the smarter will be the AI. It was clear from the beginning that AI cannot save its experience throughout the battles so we don't even speak about it.
Or what did you mean? When do vars reset?
Re: Adaptative A.I. for mugen...
#13  August 28, 2007, 02:52:11 am
  • ******
  • [E]
    • Mexico
unless you use the ai as a companion for simul, it's vars willo only last 2 or 3 rounds, even less in turns mode; so a learning ai is pointless in that situation. on the other hand, an adaptative ai, and better methods to write ais are completely worth discussing.
Re: Adaptative A.I. for mugen...
#14  August 28, 2007, 10:50:57 am
  • ****
  • "Moyashi tsuku shite yaru..."
Why would vars exist 2-3 rounds?
Re: Adaptative A.I. for mugen...
#15  August 28, 2007, 10:57:16 am
  • ******
  • Limited time to use Infinite power !
    • France
    • network.mugenguild.com/cybaster/
???

Unless you reset them at the beginning of each round, the variables for a character last a whole fight. But they don't stay beween fights.

They even last between matches in arcade mode for example, as long as you don't lose a match (in win and lin mugen) and as long as you press continue in DOS Mugen.
That's how the Level system works for Randy Mc Green by Splode, and how the shop system works for Link (Zelda) by RMX Silencer and Mike Werewolf.
Re: Adaptative A.I. for mugen...
#16  August 28, 2007, 11:14:18 am
  • ****
  • "Moyashi tsuku shite yaru..."
???

Unless you reset them at the beginning of each round, the variables for a character last a whole fight. But they don't stay beween fights.
Yes, that's why R[E]ika's post confused me.
And do you know about survivor (endless) mode? Do vars persist between fights?
Re: Adaptative A.I. for mugen...
#17  August 28, 2007, 11:32:56 am
  • ******
  • Limited time to use Infinite power !
    • France
    • network.mugenguild.com/cybaster/
Good question. I'd have to check using Randy or Link tonight after coming back from the office.
Re: Adaptative A.I. for mugen...
#18  August 28, 2007, 05:19:15 pm
  • ******
  • [E]
    • Mexico
guys, guys, guys, we are talking about ai's there, there is no point on the vars lasting more than one fight, if teh character for the next fight is going to be a different one.
Re: Adaptative A.I. for mugen...
#19  August 28, 2007, 06:06:46 pm
  • ****
  • "Moyashi tsuku shite yaru..."
guys, guys, guys, we are talking about ai's there, there is no point on the vars lasting more than one fight, if teh character for the next fight is going to be a different one.
There IS point in that :P As I've said, it takes only one time for AI for it to learn. P1 got hit under certain conditions -> it won't happen again (roughly).
Re: Adaptative A.I. for mugen...
#20  August 28, 2007, 06:44:02 pm
  • ******
  • [E]
    • Mexico
oh, then now i get what you mean by "learn", let's not use learn, but use adapt, shall we ?