YesNoOk
avatar

A.I. Unresponsive to Crouch Attacks! (Read 238 times)

Started by Zaibatsu, December 31, 2011, 12:31:23 am
Share this topic:
A.I. Unresponsive to Crouch Attacks!
#1  December 31, 2011, 12:31:23 am
  • **
  • "To the world without light!"
    • USA
    • http://mugencoder.com/authors/view/zaibatsu
Hi, I used the AI coding from Romeotantan's tutorial it worked for standing attacks and air attacks but it seems as though it doesn't work for crouching attacks heres my code.

[State -1, Crouching Light PunchAI]
type = ChangeState
value = 400
triggerall = roundstate = 2
triggerall = var(59) = 1
triggerall = statetype != A
triggerall = random < 800
triggerall = p2statetype != L
triggerall = p2bodydist x = [0,40]
triggerall = p2statetype != A
triggerall = movetype != H
triggerall = p2stateno != 5120
triggerall = !(enemynear,hitfall)
trigger1 = ctrl = 1
trigger2 = enemy,statetype = C  && ctrl

Is there something I missed in the coding?

Where you can download my MUGEN stuff
http://mugencoder.com/authors/view/zaibatsu
Back up MUGEN website in progress...
Re: A.I. Unresponsive to Crouch Attacks!
#2  December 31, 2011, 12:34:44 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Make it simpler. Test. Then make it more complex. If you can't get it to work with something simple you have a different problem.


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: A.I. Unresponsive to Crouch Attacks!
#3  December 31, 2011, 12:35:37 am
  • **
  • "To the world without light!"
    • USA
    • http://mugencoder.com/authors/view/zaibatsu

Where you can download my MUGEN stuff
http://mugencoder.com/authors/view/zaibatsu
Back up MUGEN website in progress...
Re: A.I. Unresponsive to Crouch Attacks!
#4  December 31, 2011, 12:56:00 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Of something simple? Really? God i hate the tutorials some people write, where is the troubleshooting.

[State -1]
type = changestate
triggerall = var(59) = 1
trigger1 = statetype != A && ctrl
trigger1 = random < 300
value = 400

There. You can even leave the random out if you like. The idea is to confirm that the AI will do the move. Once it does you can restrict WHEN it can do the move. I bet you're just copy pasting out of his tutorial too.


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: A.I. Unresponsive to Crouch Attacks!
#5  December 31, 2011, 01:00:00 am
  • **
  • "To the world without light!"
    • USA
    • http://mugencoder.com/authors/view/zaibatsu
Of something simple? Really? God i hate the tutorials some people write, where is the troubleshooting.

[State -1]
type = changestate
triggerall = var(59) = 1
trigger1 = statetype != A && ctrl
trigger1 = random < 300
value = 400

There. You can even leave the random out if you like. The idea is to confirm that the AI will do the move. Once it does you can restrict WHEN it can do the move. I bet you're just copy pasting out of his tutorial too.
No I'm not, I was reading romeotantan's tutorial and trying to do it, I wasn't copying and pasting anything just studying the tutorial. and thanks for the example!

Where you can download my MUGEN stuff
http://mugencoder.com/authors/view/zaibatsu
Back up MUGEN website in progress...
Re: A.I. Unresponsive to Crouch Attacks!
#6  December 31, 2011, 01:07:58 am
  • ****
    • Hungary
    • seravy.x10.mx/Wordpress
There are quite some unnecessary lines there, like :
Code:
triggerall = roundstate = 2
var(59) should be 0 when roundstate is not 2. If it is, then this line is unnecessary.
If it isn't then make sure it is. You only have to do that once, while if you don't, roundstate=2 needs to be on everything AI related you code, which is a lot more work for you.

Code:
triggerall = random < 800
That's 80% chance to do the attack if it's possible to. Way too high. 200 or less for maximum difficulty, and significantly less for easier. (80% also means that there is only 20% chance to not do the attack and do another attack instead, too)
And yeah, if you make an AI you should consider to have difficulty levels now that Mugen actually supports it (at least after you complete it first).

Code:
triggerall = movetype != H
Normally there is no way to have control if you are being hit, unless a hit state is bugged, so this does nothing.

Code:
triggerall = p2stateno != 5120
5120 is an L type state, so P2statetype!=L already does this. Completely unnecessary.

Code:
triggerall = !(enemynear,hitfall)
If the enemy is falling, that means they are in air or on the ground (as you don't fall while standing on crouching, that doesn't makes sense, if a character does that, they're bugged.), and you already disabled those with P2movetype!=A and L.

Code:
trigger2 = enemy,statetype = C  && ctrl
Trigger1 already lets you use the move if you have control. Which does include having control while crouching, obviously. So this line also has no additional effect.

So yeah, you went a bit overboard with those triggers, half of them do nothing at all.




Last Edit: December 31, 2011, 01:11:48 am by Seravy
Re: A.I. Unresponsive to Crouch Attacks!
#7  January 01, 2012, 02:12:49 am
  • **
  • "To the world without light!"
    • USA
    • http://mugencoder.com/authors/view/zaibatsu
There are quite some unnecessary lines there, like :
Code:
triggerall = roundstate = 2
var(59) should be 0 when roundstate is not 2. If it is, then this line is unnecessary.
If it isn't then make sure it is. You only have to do that once, while if you don't, roundstate=2 needs to be on everything AI related you code, which is a lot more work for you.

Code:
triggerall = random < 800
That's 80% chance to do the attack if it's possible to. Way too high. 200 or less for maximum difficulty, and significantly less for easier. (80% also means that there is only 20% chance to not do the attack and do another attack instead, too)
And yeah, if you make an AI you should consider to have difficulty levels now that Mugen actually supports it (at least after you complete it first).

Code:
triggerall = movetype != H
Normally there is no way to have control if you are being hit, unless a hit state is bugged, so this does nothing.

Code:
triggerall = p2stateno != 5120
5120 is an L type state, so P2statetype!=L already does this. Completely unnecessary.

Code:
triggerall = !(enemynear,hitfall)
If the enemy is falling, that means they are in air or on the ground (as you don't fall while standing on crouching, that doesn't makes sense, if a character does that, they're bugged.), and you already disabled those with P2movetype!=A and L.

Code:
trigger2 = enemy,statetype = C  && ctrl
Trigger1 already lets you use the move if you have control. Which does include having control while crouching, obviously. So this line also has no additional effect.

So yeah, you went a bit overboard with those triggers, half of them do nothing at all.
Thanks I didnt expect you to help!

Where you can download my MUGEN stuff
http://mugencoder.com/authors/view/zaibatsu
Back up MUGEN website in progress...