News:

MFG's Character of the Month: October 2026 Nominations

Main Menu

AI [state - 1] projectile question?

Started by mug3nM8n, February 08, 2008, 02:31:35 PM

Previous topic - Next topic

mug3nM8n

hey i would like to know how to make my character use his projectile more if anybody could reccomend some triggers   here is my code. var(5) = 1 is my AI trigger i have imput all the nessecary commands and set the variable trigger, but i just want to see him use this move alot more any tips?

[State -1, AI]
type = ChangeState
value = 777 ;plasma blast
triggerall = var(5)=1 && roundstate = 2 && statetype !=A
triggerall = (p2stateno!=[120,155]) && (p2statetype!=L)
triggerall = (enemy,vel y>-1)
triggerall = p2statetype = A
triggerall =  ctrl
trigger1 = p2bodydist x > 160 && random < 11

Cybaster

you have random<11, and random gives a number between  and 1000, so the chances of it coming out is very low.

Change it to something like random<250

mug3nM8n


aokmaniac13

Quote from: Cybaster on February 08, 2008, 02:47:19 PM
you have random<11, and random gives a number between  and 1000, so the chances of it coming out is very low.
That's true, however this trigger is being checked 60 times a second.
250 is an unreasonably high number by comparison.  It's almost guaranteed to go off in less than ten frames, this gives the AI a ridiculously high and consistent reaction speed.

Cybaster

Yeah, true.

Also :
Quotetriggerall = (enemy,vel y>-1)
This trigger means the ennemy is jumping. I don't see why the char would be performing his projectile only if the ennemy is in the air (unless it's a diagonal projectile, in which case p2bodydist Y would be a better choice).

Cyanide

#5
More accurately, enemy is jumping up, if enemy is static, or beginning his descent, then that trigger won't count either.

Ignore that it's wrong, wasn't reading properly.


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.

hjk

#6
Quote from: [C]yanide on February 08, 2008, 09:58:05 PM
Quote from: Cybaster on February 08, 2008, 03:54:11 PM
Also :
Quotetriggerall = (enemy,vel y>-1)
This trigger means the ennemy is jumping. I don't see why the char would be performing his projectile only if the ennemy is in the air (unless it's a diagonal projectile, in which case p2bodydist Y would be a better choice).
More accurately, enemy is jumping up, if enemy is static, or beginning his descent, then that trigger won't count either.
Is that what it means?
I thought the enemy would be in his/her descent if the yvel was greater than 0/-1.
I could be wrong, but I thought the 'less thans [less than 0s]' were rising, and 'greater thans [greater than 0s; in the case of -1 static or more]' the enemy is falling.
I believe that was in the Docs, but I can't remember now... checking.


Edit:
CNS Docs:
Quote4. Position, velocity and acceleration
...
A Y-position of zero is at ground level. As the player's Y-position gets larger he moves downwards. For example, a negative Y-position means he is in the air.
...
A player with positive Y-velocity is moving downward, and a negative Y-velocity means he is moving up.
LOL, Caddie's the man!! ;)

I'm as real as the runnin, I just happen to rap, Nigaas London, Japan, and i'm scared of dat tap.

I suggest extending my banning, cuz when I come back, it's gonna be hell. You think I was annoying before, oh man, it's on now :)
hjk vs. 99% of MFG. I will win.

RIP Poo Bear Tell my Dead Homie isson, for the year my partner.

Byakko

It's even true when the opponent is standing on the ground.
If I struggled to the end of my determination, to the end of my way of life with my followers, if the result is ruin, then this ruin is inevitable. Grieve. Shed tears. But you cannot regret.

Cyanide



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.

hjk

Quote from: [C]yanide on February 09, 2008, 12:07:19 AM
Oh sorry, got it backwards, oops.
I used to have a real problem with that.
I never understood why it was necessary for Mugen to be set up that way, but its not my place to complain  :S.
LOL, Caddie's the man!! ;)

I'm as real as the runnin, I just happen to rap, Nigaas London, Japan, and i'm scared of dat tap.

I suggest extending my banning, cuz when I come back, it's gonna be hell. You think I was annoying before, oh man, it's on now :)
hjk vs. 99% of MFG. I will win.

RIP Poo Bear Tell my Dead Homie isson, for the year my partner.

Bastard Mami

Quote from: Baiken on February 08, 2008, 11:07:09 PM
It's even true when the opponent is standing on the ground.

lol, yeah, actually i feel like rotfling...

Cyanide

I'm going to be ridiculed for that aren't I...

You're all bastards!!!!!!!!!  :P


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.

hjk

Quote from: [C]yanide on February 09, 2008, 01:00:43 AM
I'm going to be ridiculed for that aren't I...

You're all bastards!!!!!!!!!  :P
I still love you Cyanide  :-*
*BIG HUGZIZEZ*

You haven't tampered with Mugen for a while so it's perfectly OK
LOL, Caddie's the man!! ;)

I'm as real as the runnin, I just happen to rap, Nigaas London, Japan, and i'm scared of dat tap.

I suggest extending my banning, cuz when I come back, it's gonna be hell. You think I was annoying before, oh man, it's on now :)
hjk vs. 99% of MFG. I will win.

RIP Poo Bear Tell my Dead Homie isson, for the year my partner.

Bastard Mami

Quote from: [C]yanide on February 09, 2008, 01:00:43 AM
I'm going to be ridiculed for that aren't I...

You're all bastards!!!!!!!!!  :P
nah, i was laughing at the tought of an ai trying to shoryuken a character with a Y vel of 0, as byakko
pointed out.

mug3nM8n

can AI be coded in the state -3  as well as -1 ?

because i followed advice  by adding


[State -3, StandGuard]
type = ChangeState
triggerall = (Var(5) = 1) && (StateType = S) && (Pos Y >= 0) && (P2BodyDist Y <= 0)
triggerall = (P2BodyDist Y >= -120) && (P2StateType != C) && (P2MoveType = A)
trigger1 = (P2BodyDist X <= 120) && (Random <= 799) && (Ctrl)
trigger2 = (StateNo = [140, 155]) || (StateNo = [100, 105])
value = 130

[State -3, CrouchGuard]
type = ChangeState
triggerall = (Var(5) = 1) && (StateType != A) && (Pos Y >= 0) && (P2BodyDist Y <= 0)
triggerall = (P2BodyDist Y >= -50) && (P2StateType = C) && (P2MoveType = A)
trigger1 = (P2BodyDist X <= 120) && (Random <= 799) && (Ctrl)
trigger2 = (StateNo = [140, 155]) || (StateNo = [100, 105])
value = 131

[State -3, AirGuard]
type = ChangeState
triggerall = (Var(5) = 1) && (StateType = A) && (Pos Y < 0) && (P2BodyDist Y >= -120)
triggerall = (StateType = A) && (P2MoveType = A)
trigger1 = ((P2BodyDist X <= 120) && (Ctrl)) || (StateNo = [140, 155])
value = 132

does that mean you can code AI moves in state -3 then? optionally instead of state -1

hjk

Quote from: mug3nM8n on February 09, 2008, 01:25:38 AM
Spoiler (click to show)
can AI be coded in the state -3  as well as -1 ?

because i followed advice  by adding


[State -3, StandGuard]
type = ChangeState
triggerall = (Var(5) = 1) && (StateType = S) && (Pos Y >= 0) && (P2BodyDist Y <= 0)
triggerall = (P2BodyDist Y >= -120) && (P2StateType != C) && (P2MoveType = A)
trigger1 = (P2BodyDist X <= 120) && (Random <= 799) && (Ctrl)
trigger2 = (StateNo = [140, 155]) || (StateNo = [100, 105])
value = 130

[State -3, CrouchGuard]
type = ChangeState
triggerall = (Var(5) = 1) && (StateType != A) && (Pos Y >= 0) && (P2BodyDist Y <= 0)
triggerall = (P2BodyDist Y >= -50) && (P2StateType = C) && (P2MoveType = A)
trigger1 = (P2BodyDist X <= 120) && (Random <= 799) && (Ctrl)
trigger2 = (StateNo = [140, 155]) || (StateNo = [100, 105])
value = 131

[State -3, AirGuard]
type = ChangeState
triggerall = (Var(5) = 1) && (StateType = A) && (Pos Y < 0) && (P2BodyDist Y >= -120)
triggerall = (StateType = A) && (P2MoveType = A)
trigger1 = ((P2BodyDist X <= 120) && (Ctrl)) || (StateNo = [140, 155])
value = 132

does that mean you can code AI moves in state -3 then? optionally instead of state -1
If I remember correctly, it all depends on where you define it.
You must define [state -3]  (    [statedef -3]    ) seperately from everything else and make sure the char doesn't already have that state defined soemwhere else. Then you can place all of the code you want under [state -3] (hopefully the actual filetype you save it as isn't anal).



Quote from: R[E]ika on February 09, 2008, 01:14:15 AM
Quote from: [C]yanide on February 09, 2008, 01:00:43 AM
I'm going to be ridiculed for that aren't I...
You're all bastards!!!!!!!!!  :P
nah, i was laughing at the tought of an ai trying to shoryuken a character with a Y vel of 0, as byakko
pointed out.
I didn't even think of that :laugh4:
LOL, Caddie's the man!! ;)

I'm as real as the runnin, I just happen to rap, Nigaas London, Japan, and i'm scared of dat tap.

I suggest extending my banning, cuz when I come back, it's gonna be hell. You think I was annoying before, oh man, it's on now :)
hjk vs. 99% of MFG. I will win.

RIP Poo Bear Tell my Dead Homie isson, for the year my partner.

Cyanide

What do you mean haven't tampered, i'm making a character right now. My reading comprehension was well below average there.


Yes you can code in state -3, you can also code in state -2

Just remember if you have a movetype = H counter anywhere if it's in state -3 it won't trigger if you're put into a custom state. Also if you're using state -2 you must have the trigger roundstate = 2 or else you continue fighting when the match is over, for a little while anyway. (or sometimes when you're dead)


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.

mug3nM8n

lol i can just picture that trying to fight while dead...... in the lie down state punching the air lol

is it possible to make a character good without AI? (mine will have AI)
reason im asking is because theres this character called eric(looks like ken from SF and wears light blue)
i was browsing through his .cns file and .cmd file and noticed there wasnt any AI atall, and he fights quite good in watch mode...not the best but he fights ok. But i guess if u want your character to fight like evilryu evilken ect you need AI right?

Cyanide

If you want your character to fight on the wrong side of cheapness, then yes you need an AI. If you want your character to fight well, to a certain extent taking the impossible AI commands method, but applying them to your basic moves will make the mugen AI use them a little more. Psycho Shredder works on this theory and he has no AI, he just spams his moves because he's got lots to choose from.

Ie

move1 name = "attack"
command = QCFb

move2name = "attack"
command = abcxyzFBFBFBF

will allow that move to come out twice as often, but doesn't need AI. Not sure how effective it is really as it's not widely used (in fact, it's only in psycho shredder as far as i know and it works well there)


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.

hjk

Quote from: [C]yanide on February 09, 2008, 02:33:41 AM
What do you mean haven't tampered, i'm making a character right now. My reading comprehension was well below average there.
:rofl:
I'm just playing ^_^

Quote from: [C]yanide on February 09, 2008, 04:04:48 AM
Quote from: mug3nM8n on February 09, 2008, 03:03:12 AM
is it possible to make a character good without AI? (mine will have AI)
reason im asking is because theres this character called eric(looks like ken from SF and wears light blue)
i was browsing through his .cns file and .cmd file and noticed there wasnt any AI atall, and he fights quite good in watch mode...not the best but he fights ok. But i guess if u want your character to fight like evilryu evilken ect you need AI right?
If you want your character to fight on the wrong side of cheapness, then yes you need an AI. If you want your character to fight well, to a certain extent taking the impossible AI commands method, but applying them to your basic moves will make the mugen AI use them a little more. Psycho Shredder works on this theory and he has no AI, he just spams his moves because he's got lots to choose from.
Ie
move1 name = "attack"
command = QCFb
move2name = "attack"
command = abcxyzFBFBFBF
will allow that move to come out twice as often, but doesn't need AI. Not sure how effective it is really as it's not widely used (in fact, it's only in psycho shredder as far as i know and it works well there)
In addition to what Cyanide said, this is a funny little bit of (I guess semi-ignorant) info. The default AI has a tendency to go directly into your character's power charge state. When a character doesn't have that, the default AI usually appears decent, especially on smaller stages, and can even make your char seem as though it has AI. 
The thing that still baffles me about the default AI is that I don't understand just how it always seems to want to charge no matter what you label your states as  :S . I might be the simplicity of the command triggers, but that still makes me question why basics wouldn't override the charge?
LOL, Caddie's the man!! ;)

I'm as real as the runnin, I just happen to rap, Nigaas London, Japan, and i'm scared of dat tap.

I suggest extending my banning, cuz when I come back, it's gonna be hell. You think I was annoying before, oh man, it's on now :)
hjk vs. 99% of MFG. I will win.

RIP Poo Bear Tell my Dead Homie isson, for the year my partner.