AI glitch

Started by BC, July 19, 2008, 04:34:19 PM

Previous topic - Next topic

BC

ok i officialy HATE coding AI lol

some methods were working as far as triggers were concerned, it just seems moves are getting repeated  too frequently no matter how much of a low percentage i make it random.

but obv theres something wrong in my code.

the most noticable move was the hadouken(strong)

[State -1, AI Gou Hadoken Strong]
type = ChangeState
value = 1002
triggerall = var(7) && roundstate = 2
triggerall = StateType  != A
triggerall = StateType = S
trigger1 = p2dist X > 100 && random < 20
trigger2 = !inguarddist && random < 20
trigger3 = p2movetype !=A && random < 35

now i cant find what it is in the code, but when watching my character he uses hadouken strong like constantly till p2 dies....i also forgot to add in numproj = 0 but thats not whats causing the prob.

any tips and suggestions on my code and what to add or replace?

help much apreciated
Accepting commissions

Bastard Mami


Aadmi

you forgot the

trigger = ctrl



BC

QuoteUse my method

havent seen your method, do you have a link?


Quotetrigger = ctrl

ah yes so i did lol.....

would that be a triggerall or a trigger?
Accepting commissions

Aadmi

if you want to use movecontacts in the future for your attacks it's best to place it under the triggers that will not be a combo. triggerall will disable fluent combos.

but if you don't plan on ever using a combo for a specific attack, then trigerall is the way to go. ifelse just use single triggers

Cheers,RajaBoy

BC

Quoteif you want to use movecontacts in the future for your attacks it's best to place it under the triggers that will not be a combo. triggerall will disable fluent combos.

but if you don't plan on ever using a combo for a specific attack, then trigerall is the way to go. ifelse just use single triggers

ok cheers dude.

anyone got a link for satou's method?
Accepting commissions

Bastard Mami

study ishida uryu's kim's ai. It's the only public char with that method implemented.

BC

ok thanks ill check it out,


much apreciated.
Accepting commissions

BC

#8
Quotestudy ishida uryu's kim's ai. It's the only public char with that method implemented.

ok had a good read through, from what i understand,...correct me if im wrong



you create a helper....then code it in the cns that controls various custom states and situations like crouching near and crouching far, and gives triggeralls for them scenarios.

then in the cmd, where the helper is created use your AI trigger and the helper number (the one you created) and the stateno of the scenario in the helper eg 101330 which is used for crouching light punch

triggeralls  are read from the custom state therefore doesnt read the triggers in the cmd?  :D
please tell me i atleast have some idea lol i been reading it a good while now.

what im not sure of is how does the var(59) interact with the helper(100000)?

offtopic..........what does enemynear(0) mean? im guessing but does it mean when p2 is near and doesnt have ctrl?
Accepting commissions

Bastard Mami

you got most of it.

the helper states are used as triggers in the cmd in teh same way the commands are, that makes sure that the char won't break any rules while ai controlled.

enemy(0) is almost the same as p2, it is used to check what i player 2 doing.

var59 does not really need to interact with the helper, var59 =1 means that the ai is active, so in the triggeralls, if the ai is active, the trigger checks for the helper, is the ai is not active, it checks for commands.

BC

cool, thats what i thought you just explained it better than me lol  ;D

i really like this method, im looking to release my character (akuma) soon, but i want to get his AI right and i may as well try this out, like i said ive tried many methods but havent been happy with them and not always had the best working triggers to suit the move.

thanks again  :smartass2:
Accepting commissions

BC

whilst looking at your method that was used on kim i noticed something that i didnt understand,

in the variable list generated by fighter factory(under float variables) i noticed it didnt have any float variables used for the character but in one of the AI helper states triggers i noticed the line.......

trigger1 = time>( 5 * fvar(0) )

which is used fairly often? 

and i noticed this line...

triggerall = time>=Ceil( 5 * fvar(0) )

could you or someone explain what that trigger means(i have an idea but prob not right)

and (to [E])

where is this variable defined?

i didnt see a varset for it.

my character is using a fvar(12) but its been defined.
just wondering about fvar(0)

Accepting commissions

Aadmi

#12
fighter factory does that sometimes especially if the varset is in the command.

triggerall = time>=Ceil( 5 * fvar(0) )


this means trigger when, time =  fvar(0)*5 rounded up to the highest closest interger

for example

say if

fvar(0)=.4

.4*5=.20

since it's .20 it will round it up to 1, it's triggered like this because time has to be a positive interger, not a float which is why ceil is a necessity here.

BC

makes sense now
but what im unsure of is what fvar(0)  =

i realise its fvar(0) * 5

and in the Example you said say if fvar(0) = .4

im unsure of what the value of it actually is.
Accepting commissions

Aadmi

Quote from: blackchaos07 on July 20, 2008, 03:39:44 PM
makes sense now
but what im unsure of is what fvar(0)  =

i realise its fvar(0) * 5

and in the Example you said say if fvar(0) = .4

im unsure of what the value of it actually is.

diplay to clip board

use %F instead of %d for floats

BC

im completely new to DisplayToClipboard

looking through kims files this was used

[State -2]
Type = DisplayToClipboard
trigger1 = 1
Text = "MoveSpam = %d, P2 Dead = %d, Slam = %d, FED = %d, BED = %d"
Params = Var(0), Var(11), Var(16), frontedgebodydist, backedgebodydist
ignorehitpause = 1

and in the .cmd this was used

;debug
[State cpb]
Type = DisplayToClipboard
trigger1 = IsHelper(100000)
Text = "parent ai %d , stateno %d, pos X %f, parentposx %f, reaction time %f"
Params = (parent, movecontact), stateno, Pos X, (Parent, Pos X), (Parent, P2bodydist X);fvar(0)*5
ignorehitpause = 1;(Parent, Var(59) )

where does it display it?

EDIT: i think i found it.......its set in the cmd file.........

;value of 1.0 means 100% reaction time, 2.0 200% reaction time (slower), 0.5 50% reaction time (two times as fast).
[State reaction time]
type = VarSet
trigger1 = IsHelper(100000)
;fvar(0)= 0.1;1.0
fvar(0)= 1.0001 - ((1000 - Parent,Life)/1000.0)
;fvar(0)= 1.0001 - ((P2Life - Parent,Life)/1000.0)
;fvar(0)= (Parent,Life)/1500.0
Accepting commissions

Aadmi

Quotefighter factory does that sometimes especially if the varset is in the command
. ;D

cheers,RajaBoy

BC

lol yea soz completely went over my head  :hanged:



cheers dude
Accepting commissions

Bastard Mami

fvar(5) is the difficulty or speed of reaction var, since the ai is basedon changestates, it controls how fast they take to happen, to test your ai in potimal conditions set it to 0.1, the varset is in the cmd file.

BC

#19
Quotefvar(5) is the difficulty or speed of reaction var, since the ai is basedon changestates, it controls how fast they take to happen, to test your ai in potimal conditions set it to 0.1, the varset is in the cmd file.

thank you.

but ive come to a decision, although i understand your method, im not sure i want to make the AI as complicated as that, ive tried it out, but i prefer a more basic way.....although its a really cool method you have.

im glad to say im giving him a more basic method and its working alright so far.... i have a question

whats the difference between these 2 pieces of code and which one would be more effective

[State -1, sgs]
type = ChangeState
value = 4000
triggerall = var(7) && statetype !=A && ctrl && power >= 3000
trigger1 = enemynear, p2movetype != A && random <= 70
trigger2 = enemynear, p2statetype != L && random <= 30
trigger3 = enemynear, movetype != H && random <= 25
trigger4 = p2bodydist X < 250


adding no random condition to the triggerall but with random on the triggers
or adding a random condition to the triggerall and leaving triggers without random



[State -1, sgs]
type = ChangeState
value = 4000
triggerall = var(7) && statetype !=A && ctrl && power >= 3000 && random <= 70
trigger1 = enemynear, p2movetype != A
trigger2 = enemynear, p2statetype != L
trigger3 = enemynear, movetype != H
trigger4 = p2bodydist X < 250


EDIT: well i just tried them out, using debug and f3 to give them full power, and it seems the code with the random on the triggerall happens less frequently than the code with the  randoms on the triggers

which is what i want.......what happens when you add persistent = 0?
Accepting commissions