News:

MFG's Character of the Month: October 2026 Voting

Main Menu

How to program better AIs?

Started by DNZRX768, June 24, 2008, 02:56:41 AM

Previous topic - Next topic

DNZRX768

Right now, all of my AIs are something like "do this attack when he is this close" and "do super once you have this amount of energy".

This kind of AI can be a bit repeative and expotable. It also almost never do any combos at all.

How to program an AI that can "do this attack, then this attack, then this attack, followed up by a super if all three previous attacks did not get blocked or miss"?
Hug the Pikachus!

Hug A Pikachu Today!

Fallen_angel

to make a combo use as trigger x = stateno =xxx && movehit ;so it will make that if you are on the state xx and the movehit, the AI, could change to that state

Aadmi

well my friend, it depends, on how you code, the AI doesn't even have to have the same combo's as you would if you weren't AI
it's not a short process, you'll need to lesarn, triggers, more than you already, do, things, like, ifelse. target, partner,enemynear,life, and even more, the docs, should help with the triggers, also random, is widly used so the AI won't be extrememly repeitive,
you'll have to not only trigger when the Enemy, does something but when your chaacter does, something, to, also.

it's not only necessary to code the Ai in wherever, your doing it, for some complicated moves, you must code the AI in their statedef,

example charge move you can't make the AI stop chargeing innthe AI command.

you must, go to the statedef, of it


and add something like

[State,0]
type=changestate/or change anim whichever type of chsrge code you have but you shoul get the point.
trigger1 = p2bodydist x <200
trigger2 = power>=3000
value = state of stop charging

cheers,Rajaboy

Cyanide

If you set up AI combos it tends to spam them a little too effectively.

I've found that best for a challenge is leave all the basics and specials to the default AI apart from throws and add something like run or jump in when p2 is a long way off. Just set up AI for the supers. You might find that intelligent use of supers is really all it takes for an AI to fight ok.


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.

BC

QuoteYou might find that intelligent use of supers is really all it takes for an AI to fight ok.

i found that using combos for the AI even with random was repetetive also

i might take this point on board and just code AI for the supers

great method.
Accepting commissions

Bastard Mami

I will forget oone layer of abstraction about my ai helper and just generalize on how I code some of my ais.


a)Check for the current range; choose between 5-10 possible moves for that range.

That's about it in a simplistic manner, as far as combos go, I first check for the currently hitting attack, then for the range, and the 5-10 possible moves include moves that are not good combo ideas, not to mention that the ai can choose not to continue the combo at all.