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 ?
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.
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.
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.
I thought the game's difficulty would overwrite the AI.Then what's the point of a Difficulty level then?
Cybaster said, July 06, 2007, 02:41:45 amAnyway, 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.
Lv3 P.o.t.S. said, August 27, 2007, 11:38:46 amLatter. Each helper has its own set of vars, fvars, sysvars and sysfvars. This is... l337!
R[E]ika said, August 27, 2007, 02:34:56 pmthe 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?
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.
???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.
Cybaster said, August 28, 2007, 10:57:16 am???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?
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.
R[E]ika said, August 28, 2007, 05:19:15 pmguys, 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 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).