YesNoOk
avatar

AI Coding Tips, Suggestions, etc. (Read 3469 times)

Started by The Lord of the Flies, October 11, 2007, 12:43:37 am
Share this topic:
AI Coding Tips, Suggestions, etc.
#1  October 11, 2007, 12:43:37 am
  • ****
  • Am I evil?
Alright, the thread's title is self-explainatory.

I've have currently made two characters: God Rugal and Violent Ken. Both are almost always being updated and such. As of now, Violent Ken is in the process of being constantly updated (see Release Thread for its topic). Most of the feedback I get I get around them and fix them. But there's always an issue with the AI code. While some people like it, others don't. I personally don't like the AI on both characters a lot. Especially in Violent Ken.

So I ask you, experimented AI coders, suggestions, tips, critics, etc. on coding a non-repetitive, fun, challenging AI? Considering the fact that I aim for G.Rugal to be a boss-type AI (somewhat cheap) and V.Ken a sub-boss type AI (challenging but not overwhelming). Or just some general advice on this thing.

Btw, I HIGHLY recommend people who want to implement AI on characters, use Winane's AI activation method ;).
[/advertising]

Sig made by TempesT :)
Re: AI Coding Tips, Suggestions, etc.
#2  October 11, 2007, 01:38:10 am
  • ******
  • Limited time to use Infinite power !
    • France
    • network.mugenguild.com/cybaster/
I like the style he has, but whatever...

First of all, saying "I want him to be sub-boss, but not overwhelming" is nice, but how do you want him to fight exactly ? As now, but not as strong ? Or do you want to define a completely new play style ?
Do you want him to rely on his close combos or be a projectile spammer ? Do you want him to alternate between all the moves or use only few of them very efficiently ?

I won't be helping you much here, but it's all about how much you want him to perform the same combo for example, so for the attacks triggered with a previous stateno, modify the random triggers until they suit your needs.

To have variety, it's all about : VKen is in one condition, this condition can lead to 3 different actions according to the various triggers involved (opponent is attacking and is close enough, so VKen should shoryuken, evade or teleport, for example). You'd want him to teleport more often than he evades, then you must set the random factors so that the teleport has more chances to come out than evade. You want him to do shoryuken only if the opponent jumps on him, then add a p2dist Y trigger. etc. etc. etc.

To make him easier to fight, just put the various "random" to a lower value.

But then again, you didn't really state what you didn't like : the style or the difficulty.
Re: AI Coding Tips, Suggestions, etc.
#3  October 11, 2007, 02:48:52 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
I'm never happy with AI. AI if done to give a challenge will ALWAYS be a high level challege. You can drop it a little and get a crap AI (like in my sasuke) but if you want it to be clever at all it's always going to be on the cheap side.

I'd suggest working out what moves you want him to use and when and setting the randoms to lower or higher. Tightening your conditions can be a really good idea. Like never allowing hadoken if p2dist X< 160 for eg. Giving more specific conditions can give a more balanced and capable AI that relies less on spam.


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.
Re: AI Coding Tips, Suggestions, etc.
#4  October 11, 2007, 02:56:33 am
  • ****
  • Am I evil?
Hmm alright. I imagine this Ken being more of a combo guy than a projectile spammer. You know what, Warusaki3's cvs Violent Ken is the ideal "gameplay" I'd like my Ken to have.

Let me then rephrase: What are common Ken AI patterns, stuff that he always does. Does he spam shoryuken to no end? Do crouching attacks a lot? Hypers, does he chain into them or just trigger them randomly, etc.

I like the style he currently has, but there are some lapses (as you have said, Cy) that he just does nothing. Either he just stands there or jumps around stupidly. Also he sometimes goes hadouken-happy.

So I think my triggers could also be polished. Triggers I usually use are: P2bodydist X/Y, ctrl, MoveHit, Random...

Edit: I was gonna post, but then I read Cyanide post. I guess the only thing I can do for now is test-n-try. But all above still applies, though.


Sig made by TempesT :)
Re: AI Coding Tips, Suggestions, etc.
#5  October 11, 2007, 03:17:04 am
  • ******
  • Limited time to use Infinite power !
    • France
    • network.mugenguild.com/cybaster/
My pattern with Ken is pretty simple, but I'm not sure I fight as a good Ken user does : Hadoken spam at long/medium distance. Come closer quickly using Rasetsu Kyaku and Tatsumaki Zankuu kyaku, switching between the two and sometimes chaining both 1 to 3 times. Shoryukken at close distance, to combo from basic attacks, or when opponent jumps over me.
I never use Ryusen Kyaku... maybe I suck, dunno.

I've seen some codes using the life trigger to modify the AI during the match, making it more and more aggressive when the char loses life, or making him defend more. You could perhaps slightly modify the random triggers depending on Ken's life.

You can also use p2statetype and p2stateno as trigger for your AI, so that he doesn't spam some techniques at the wrong moment.
Re: AI Coding Tips, Suggestions, etc.
#6  October 11, 2007, 04:05:19 am
  • avatar
  • ****
I can't really help you coding wise, but just to contribute a bit on how I play Ken mostly (not yours specifically, but Ken in general):

- Turtle ~ No where near opponent, to build bar: Standing MP, crouching MP, jump backwards short Tatsumaki, occasionally standing HP. These are generally safe if you use your common sense (if your opponent closes in, then you stop. If your opponent throws a projectile, then you parry, etc), you could probably make it so if the opponent is a whole screen away (or almost) and if Ken has less life than the opponent and Ken has no bar, you can make him turtle a bit to get some bar and make him stop if the opponent is close or if Ken has a power stock.
- Crouching MK whenever the opportunity arises, maybe even Crouching HK, depends on the opponent and situation. c.MK can lead into a Hadouken in case your opponent guarded it so you're safe from any punishment (since Hadouken generally has big guard velocity), it can also lead to any Tatsumaki for a quick combo (too bad this isn't as useful with Ken as it is with Ryu, since Ryu scores a knockdown with this), or even hit confirm Shippu Jinrai Kyaku if you have bar, in this case, Kuzuryu Reppa.
- At close range, and you think Crouching HK is going to connect, then you cancel it into Hadouken for the same reason you do it with c.MK, or you short Tatsumaki to get bar and cover distance (and yes, it's not supposed to hit). I generally like to spam crouching LK after a guarded crouching HK because most opponents don't see it coming. Remember, sometimes you do moves that aren't supposed to hit, but are beneficial for other reasons.
- At close range, I like to do close MP>close HP (works with SF3 Ken, not sure about other Kens), and if they hit then I link into MP Shoryuken for extra damage.
- If opponent likes to jump in, then its good to MP Shoryuken, if they're too far for MP Shoryuken, then you can make them land on a crouching HK, both scoring a knockdown. If they're a air projectile user, then you can duck under, or if its too far to duck or if its too fast to duck, then parry and punish with MP Shoryuken. If it's a Shin Gouki situation, you're generally screwed unless you're damnnn good at parrying.
- You're good at zoning and you think you're in the perfect position to bait a jump in, then by all means do so by throwing a Hadouken or do a funky kick just for fun. Anything that will make your opponent think, 'time to jump in'. Instead, you make them land on a crouching HK or you Shoryuken them out of the air and short Tatsumaki to cover lost distance, or if their in a corner, even better.
- If the opponent likes to spam projectiles, depending on the character/situation I do the following:
1. If your Ken has lots of invulnerability on startup of Shoryuken (like SF2), then you can dodge a projectile with a jab Shoryuken and do your own Hadouken afterwards. I like doing fierce Hadouken in this situation, but it's all mostly situation dependant and personal preference.
2.  Counter with your own projectiles. In projectile VS. projectile situation, always use fierce Hadouken. There are simply no benefits to using another strength.
3. Jump into the air and Tatsumaki to their part of the screen. This is unsafe, but it IS an option. And especially with VKen's horizontal Tatsumaki, you can basically close in or escape from anything as long as you time it right.
4. Parry and throw your own fierce Hadouken or jump in. Position yourself correctly or you will jump into a Shoryuken or something similar.
- The only basic link any Ken needs is close MP>close HP. I don't see the need for anything else. This can lead into a Shoryuken for extra damage and a knockdown, and is generally safe when guarded.
- Don't make your Ken do fierce Shoryuken unless there's like a P2BodyDist X >= 10 trigger or something. There's nothing fierce Shoryuken can do that MP Shoryuken can't do and MP Shoryuken does it better.

There's more but I hope that helped at least a bit. :)
Re: AI Coding Tips, Suggestions, etc.
#7  October 11, 2007, 04:19:07 am
  • ****
  • Am I evil?
I can't really help you coding wise, but just to contribute a bit on how I play Ken mostly (not yours specifically, but Ken in general):

STUFF

There's more but I hope that helped at least a bit. :)
Nice! This helps a lot, thx Siu Wong. I'll incorporate some ideas of these into the AI while also taking in account Cybaster's and Cyanide's advises. I'm still taking advice (as always) concerning AI coding.
 
Btw, if anyone got some stuff like these (Siu Wong's stuff), for GOD RUGAL, I'd very much be grateful for it. Think of God Rugal's AI from CvS2 in teh highest difficulty, if you can :P.

(Is this still the right place for this thread?)

Sig made by TempesT :)
Re: AI Coding Tips, Suggestions, etc.
#8  October 11, 2007, 04:49:42 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Development discussion may in fact be more suitable. We're not talking about any specific issue but more how to AI in general.


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.
Re: AI Coding Tips, Suggestions, etc.
#9  October 11, 2007, 05:32:07 pm
  • ******
  • [E]
    • Mexico
i use a statemap for ai, to avoid overcomplicating the code with triggers and add speed of reaction to the character, also, i loet the mugen ai decide how to move around, to make it more random, same for blocking but i am thinking on implementing some blocking in the ai.
Re: AI Coding Tips, Suggestions, etc.
New #10  October 13, 2007, 06:39:20 am
  • ***
  • Master of Vicodin
Tips for Rugal:

*Your AI must play as a rush-down char, I believe. Rugal players aways tries to corner his opponents for stand/crouch medium kick -> Reppuken spam and a mind game using normal grab, Genocide Cutter and short Asura Senkuu backward.

*Since you're going for offense, do not give him much Genocide Cutter probability (for balance, too). Instead he could use some Asura Senkuu to evade it.

*Another good way to corner God Rugal's opponents is actually turtle from a good distance, making p2 go to attack. When he's about to corner Rugal, Asura Senkuu forward.

*Remember: God Press = instant corner.

*His Hcb+K is just too cheap. Do not abuse of this move.

Overall:
Keep in mind that if you're willing to give your AI a humanistic feeling, then you must focus on a specific play style. Don't give  too many options for both offense and defence. ;)
Last Edit: October 13, 2007, 06:53:27 am by Don Corleone