YesNoOk
avatar

Fair AI for charge characters in MUGEN: Is it possible? (Read 1273 times)

Started by GeorgeMP, October 07, 2019, 12:05:54 am
Share this topic:
Fair AI for charge characters in MUGEN: Is it possible?
#1  October 07, 2019, 12:05:54 am
  • **
  • Sad, strange little man
  • "My God, jelly donuts are so scary."
    • USA
Is it possible?
Quote
Girls are now typing. Please wait warmly and have some tea until the signature is ready.


Go check out Team Sonic Fighters!
https://mugenguild.com/forum/topics/team-sonic-fighters-188020.0.html
Re: Fair AI for charge characters in MUGEN: Is it possible?
#2  October 07, 2019, 12:44:55 am
  • ****
  • CPU Purple Heart
    • USA
    • https://www.pixiv.net/en/users/8108265
 Absolutely, if you're using a variable for charge motions (like most people do since MUGEN's default charge motions are pretty faulty), have every trigger1 be reserved for human players and have every trigger2 reserved for AI and substitute "command =" with every stateno that you believe would make sense for a character to be capable of using "charge motions" like a human player would.
Re: Fair AI for charge characters in MUGEN: Is it possible?
#3  October 07, 2019, 05:36:08 am
  • avatar
  • **
    • USA
I actually did a really basic AI charge system once.  It's a pretty simple setup.

Make a variable that increments 1/tic unless the CPU does something that should cancel its charge.  Make sure you're only checking time=0 for moves that have some duration.  You can jump forward or perform something like psycho crusher and still be charging DB!

Now have another variable that becomes 1 when the other variable is high enough to execute a charge move (say...45) and 0 if it isn't.  For every AI state that executes a charge move, check that this second variable is 0.  You could have multiple variables if you have moves with different charge durations.

Some example.  Not going to bother explaining it, but this really does work.
Code:
[state -2, AI Charging]
type = VarSet
triggerall = (AILevel > 0)
trigger1 = 1
var(1) = IfElse((stateno = (41||42||100||299||819||799||399) && time = 0),0,(var(1) + 1))

[state -2, AI nocheat]
type = VarSet
triggerall = (AILevel > 0)
trigger1 = stateno = (0||20)
var(1) = 0

[state -2, AI Charged]
type = VarSet
triggerall = (AILevel > 0)
trigger1 = 1
var(2) = IfElse((var(1) >= 45),1,0)
Re: Fair AI for charge characters in MUGEN: Is it possible?
#4  October 07, 2019, 10:59:40 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Ai is all based on how much effort you want to put in. Put in more effort get a better outcome. Less effort = spammy garbage. So of course it is. And there are a few ways to do it. But most people don't bother because its extra effort.


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.