random< ((AiLevel)*25)
AILevel**2 is equivalent to AILevel*AILevel, that means values will range from 0 to 64 (more ramp) - Red line
AILevel*2 will just double the level, that means values will range from 0 to 16 (less ramp) - Blue line
(http://xgargoyle.mugenguild.com/db/math101.png)
We decided to have the AILEvel using this formula: (AIlevel ** 2 / 64.0) as it gives more ladders between one level to the other, so please use this formula.
DOS/Winmugen characters used Winane's not-so-much-reliable AI routines, and we used an internal variable (var(53) or any other) to create a ramp AI.
With 1.0, it's no longer necessary, so the variable in cofig.txt needs to be removed. We are now using AILevel, which uses Mugen's internal difficulty level, and is 100% reliable
And, following JNP's post, a code like this:
trigger1 = (EnemyNear, MoveType = H) && (EnemyNear, HitFall) && Random < (50 * (AILevel ** 2 / 64.0))
Will have the following probabilities:
Level 0: (50 * (0 ** 2 / 64.0))= 0 (Human controlled)
Level 1: (50 * (1 ** 2 / 64.0))= 0.78
Level 2: (50 * (2 ** 2 / 64.0))= 3.12
Level 3: (50 * (3 ** 2 / 64.0))= 7.03
Level 4: (50 * (4 ** 2 / 64.0))= 12.5
Level 5: (50 * (5 ** 2 / 64.0))= 19.53
Level 6: (50 * (6 ** 2 / 64.0))= 28.12
Level 7: (50 * (7 ** 2 / 64.0))= 38.28
Level 8: (50 * (8** 2 / 64.0))= 50
Obviously, if you use a formula like Random < (450 * (AILevel ** 2 / 64.0)), the ramp would go from 7.03 (AI 1) to 450 (AI 8 ), a middle CPU (AI 4) will be 112.5
I remember reading about AI that learns or appears to learn in mugen also. Is there any character that this has been implemented in or other method of AI? I have thought of a couple ideas similar to this but I would love to dig into any existing code first.
This may be of some assistance. A quote from XGargoyle helping me and Alex understand the AI ramps in MUGENThat's the first time I've seen that formula, I never would have thought to do it that way. Thanks for sharing this one!Spoiler, click to toggle visibilty
I pull random ranges out of my ass, make sure they don't overlap, and hope for the best for the most part.A quick question on this. I have thought about this overlapping bit but if random fires off a different number each time it's used how could you really prevent it, Isn't it unavoidable in most cases?
I'm really interested in this! Thanks for pointing out Kamekaze's "neutrality" helper, I will be sure to dig through his code. I think he is actually the creator I was reading about for an learning AI.Spoiler, click to toggle visibilty
Yes, which is why I mentioned to use [E]'s method which uses the Random trigger and stores its value in a variable. I should really do this for my characters since it wouldn't be that hard to patch in.I pull random ranges out of my ass, make sure they don't overlap, and hope for the best for the most part.A quick question on this. I have thought about this overlapping bit but if random fires off a different number each time it's used how could you really prevent it, Isn't it unavoidable in most cases?
[state n, 1]
type = varset
trigger1 =
var(1) = random
[state n, 2]
type =changestate
trigger1 = var(1) = [0,100]
value = n
[state n]
type =changestate
trigger1 = random < 100
value = n
The second half E's post has still got me stumped though. Just over my head at this point I guess.
Are there any other known strategies for making a character appear to have learned? The simplest I could think of was to have a character count the seconds it was defeated in and update its "random conditions" accordingly as the match unfolds.
Are there any other known strategies for making a character appear to have learned? The simplest I could think of was to have a character count the seconds it was defeated in and update its "random conditions" accordingly as the match unfolds.
[State -2, Assert] ;nowalk
type = AssertSpecial
trigger1 = ailevel
flag = nowalk
ignorehitpause = 1
[State -2, no] ;nojump , nocrouch
type = changestate
triggerall = ailevel
trigger1 = stateno = 40
trigger2 = stateno = 10
value = 0
ignorehitpause = 1
When you limit the amount of options an AI has it tends to make better ones more often.But also more predictable