www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/14/20:45:18

To: djgpp AT delorie DOT com
Subject: Re: Where to find AI info???
Message-ID: <19970214.172521.7647.3.chambersb@juno.com>
References: <01bc1ab1$4af5fd60$3e1a92ce AT jasong>
From: chambersb AT juno DOT com (Benjamin D Chambers)
Date: Fri, 14 Feb 1997 20:23:29 EST

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019