Mail Archives: djgpp/1997/02/14/20:45:18
On 14 Feb 1997 19:57:06 GMT "Jason Goelzer" <jasong AT rconnect DOT com> writes:
>Anybody know where I can get some info on AI???
>I need to know how to make the computer be a good opponent.
>--
> Jason Goelzer
>
>Email: jasong AT rconnect DOT com
>
READ A BOOK :) Seriously, I looked at some recently (sorry, can't
remember the name - something like 'An Introduction to Artificial
Intelligence') and it was INCREDIBLE - however, a lot of AI has nothing
to do with games. What I figured out was, that for AI you need to:
Decide on EVERY action the computer can take,
Decide on a representation,
Find a method to allow the computer to use a simple method of finding the
right branch based on the right circumstances.
As I recall, the best (fastest) method was to use an array, use certain
condition flags as indices into it, each element represents a number.
One method I like:
Create a function for each possible action,
Create an array pointers to functions,
Store the addresses of these functions into the array,
Set flags during movement phase,
Use the flags variable as a lookup into the array of functions to call
(ie 'comp_ai[FLAGS](npc_1);' where FLAGS is the flags variable and npc_1
has been defined to 1, as in the first computer character. Several
variations on this are possible).
...Chambers
- Raw text -