Catch the ball
by Mathieu Marquis-Bolduc · 05/11/2006 (8:46 pm) · 2 comments
Well, I finally found a few hours tonight to work on my AI engine and demo.
I now have a new agent ("Catcher") in my demo. He will stand around, watching me and waiting for me to throw a ball. When I throw the ball, he will run to it and try to catch it before I do.
This may sound simple, but in fact I added several new functionalities to the AI engine. The main of these functionalities is event handling. In this case, I used the events "BallThrown" and "BallCatched". The agent decide on how to react to those events depending on its current stack of goals, as well as conditions set in the AI script. For example, in my demo the event "BallThrown" make the goal "waitforthrow" succeed, while the event "BallCatched" make the "CatchBall" goal succeed, but only if the agent is the one who catched it. They could also make the agent perform an action, or add a new goal.
I also worked on making my XML-based AI script simpler and mostly shorter. The behavior described on top is all described in a very tiny XML script.
I need to think a bit about how to best handle the goals when a goal fails. Then I can move on to tackle the next big feature, clause arguments. Write now, I only use logical clauses similar to "Athenian()". I need to move on to something like "Athenian( Socrate )". Arguments are already supported in the engine interface, that is the AI engine can already pass arguments to the actual game (and vice-versa). But it is not yet done in the AI script. The major problem with arguments in a logical script language is the unification of variables. Im not sure if it will be an issue right now, but I have to think ahead.
Well, enough for tonight!
I now have a new agent ("Catcher") in my demo. He will stand around, watching me and waiting for me to throw a ball. When I throw the ball, he will run to it and try to catch it before I do.
This may sound simple, but in fact I added several new functionalities to the AI engine. The main of these functionalities is event handling. In this case, I used the events "BallThrown" and "BallCatched". The agent decide on how to react to those events depending on its current stack of goals, as well as conditions set in the AI script. For example, in my demo the event "BallThrown" make the goal "waitforthrow" succeed, while the event "BallCatched" make the "CatchBall" goal succeed, but only if the agent is the one who catched it. They could also make the agent perform an action, or add a new goal.
I also worked on making my XML-based AI script simpler and mostly shorter. The behavior described on top is all described in a very tiny XML script.
I need to think a bit about how to best handle the goals when a goal fails. Then I can move on to tackle the next big feature, clause arguments. Write now, I only use logical clauses similar to "Athenian()". I need to move on to something like "Athenian( Socrate )". Arguments are already supported in the engine interface, that is the AI engine can already pass arguments to the actual game (and vice-versa). But it is not yet done in the AI script. The major problem with arguments in a logical script language is the unification of variables. Im not sure if it will be an issue right now, but I have to think ahead.
Well, enough for tonight!
About the author
#2
05/12/2006 (10:01 am)
nice work Mathieu. it just so happens that I'm at the AI design phase of my project right now. my ai wont be nearly as complex as yours. I'm still trying to develop the right scheme for my game. it'll end up being just a straight sequential state machine in general, but working out the perfect scheme is proving to be rather difficult. sometimes I wish torque wasn't so damn flexible! =) 
Associate Chris Calef
BrokeAss Games