LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   A.I. Programming, following by my previous thread aobut turning an airplane (https://www.linuxquestions.org/questions/programming-9/a-i-programming-following-by-my-previous-thread-aobut-turning-an-airplane-163823/)

feetyouwell 03-29-2004 01:24 PM

A.I. Programming, following by my previous thread aobut turning an airplane
 
ok, i got my little airplane turning and and shooting bullets and all that. Works great. Now it's time to program the a.i. plane.

What's the generic algorithm to programing the a.i. plane which includes:
1. when it turn its direction to user
2. when it shoots its bullets
3. when it speed up / slow down

i know it somehow has to relate back to the user plane with a certain amount of randomness in it. Can anyone with previous a.i. experience to tell a little more about what's to consider in programming a.i. object?

kev82 03-29-2004 03:26 PM

my ai experience is pretty limited but i would consider using a finite state machine. its a bit difficult to explain but ive looked for a simple article on the subject and cant find one so here goes:

lets take the example of a guy looking for gold in a maze, there are a few things he can do, he can
a) wonder randomly
b) go to a location he's already been to
c) wonder systematically(turn right continuously, etc)
d) etc...

these are the different states the ai can be in

a finite state machine is nothing more than a finite set of states (3 in this example) and some rules that dictate switching between them

so here are a simplistic set of rules

1 if see gold - get and goto exit
2 explore randomly

slightly better rules

1 if see gold - get and goto exit
2 if in new location - explore randomly
3 goto unexplored location

so basically you need to come up with some simple things your ai can do -

chase ship
patrol
run away

then come up with some rules to choose going from one state to another

if patrol and see ship then chase ship
if chase ship and ship bigger than you then run away
...
...

you could try looking at some of the ai articles on www.gamedev.net


All times are GMT -5. The time now is 11:35 PM.