From: sl859@cc.usu.edu
Newsgroups: rec.games.programmer
Subject: Computer Opponents... Some Random ideas
Date: 13 Aug 92 13:34:03 MDT
Organization: Utah State University

OK, 
	I am going to try to give a few simple ideas on different types
of games.  The reason this is so difficult is that it IS without a doubt
game dependent.  I really haven't given too much thought to some types
of games, but I can attempt to give an idea or two to the others, and 
based from what I have already read, I can see many others have given this
subject a lot more thought than I have.  
	Gametype:  Chess, Checkers, TicTacToe...  A "classic technique"
for a game which switches sides and all is to build a game tree.  It is 
a data structure nightmare, in which you formulate nodes for each move 
the computer player can make and then use a point base for the value of
each move.  What makes this method a pain is that the number of moves
is the number of branches in the tree, which is best implemented by nasty
pointers, which might not be something you like in a game.  In addition
it can take lots of memory depending on how many "Look-ahead Levels"
you want.  You can simplify the model, if you can think of a nice point
scheme, to tell which move is more valuable than another...  All this 
however is a pain because you have to account for the players move every
other level of the tree, and if you want the best computer player you 
must antecipate that the player is the best as well...
	Gametype:  Shoot'em ups  You may have noticed this is one of the
more difficult methods as well, because it must base decisions in real
time.  Because this is so, the gaming industry has placed certain restrictions
on the computer opponent.  For example, a game may have guns you have to fly 
by, but they restrict the gun from moving.  This takes a dimension of 
difficulty out of the game, (this could also be accomplished with a stationary
star base, with guns, or whatever)  I have noticed that the gun tracking 
systems have been based certain things which make the computer opponent a 
hard one or a difficult one.  These factors are:
	1)  Gun tracks on current position.  The gun fires and if you dont move
then you are dead.
	2)  Shot speed.  In combination with different methods (like firing
at current positions (then you have to move faster!))it can bereally difficult
to avoid.
	3)  Gun antecipates next move.  If you stay going in one direction 
it predicts the linear intersect, based on your speed and the shot speed.
	4)  Gun fires a steady stream.  Essentially cutting off a part of the
screen.
	5)  Gun fires a sweep.  This is really nasty in combination with 
a steady stream of shots and the speed...
	6)  Shot explosions blow up big chunks of the screen.  (this is
obvious, if the shot explodes across the entire play field, you get hit 
automatically! (duh.))
	7)  Random.  It may sound dumb, but it can be a pain to predict 
shots.  (It seems to me the old asteroid opponent had this type of attack,
and it drove me NUTS, trying to kill it before it hit me on my old Atari!)
        8)  Other factors, like shot damage and range also account for
fun amounts of variation

Movement.  Obviously this is going to add an additional dimension of 
complexity to the game.  But it is definately needful for fun games.
	In playing StarControl (Melee is great, try it!)  we have come
to depend on the computer, being a computer and we take advantage of its
little quirks.  Like when an enemy ship attacks on a horizontal straight
line it is easy to just get slightly out of the way and keep the same 
velocity and pick it apart, because it doesn't change course when it is hit!
But as was discussed in another posting, the computer player is usually 
an expert system of some type.  A bunch of conditions must be used.  I saw
suggestions that a Neural Network should be used to train and make a computer
opponent. I sort of had to laugh!  I have been doing Neural Network research
this summer, and I can say it is NOT worth it!  At least not yet.  It might 
be something to consider in the future, but we simply don't have them set up
to handle such complex scenarios, such as games... and What would you use to
train it?  HUH!?  You would probably need to develope a set of input classes
and output classes, the vectors in which would be enormous!  (If the game had
any options)  There is a quote I like regarding Neural Networks, by an official
on the subject (Wasserman), "The actual intelligence exhibited by the most
sophisticated artificial neural networks is below the level of a tapeworm." 
(Of course this could be way to intelligent for most Game Players!  :) )
Anyway there is usually some setup of "ifs" that dictate the movement of the
opponent...   I really feel like there are a lot more people out there
who know more about this and I have really enjoyed your postings!  I will 
tell my other friend Josh Dinerstein to post what he has discovered, if he
gets a chance, about more on the enemy ship thing.  The problem is that each
game has a set of perks that are different, which make a computer player 
a truly difficult task to program, but definately worthy of this newsgroup's 
discussion...
						wReam...

P.S.  I wasn't flaming you Peter, I was addressing myself mostly to those
people who came after or before, you actually posted intelligently, I just
used your posting as a springboard!  (It was a beautiful dive, too.  
Olympic Class 9.9 or 10.0 for sure!!!)  

:)  <--- Usual disclaimer  (for safety!)

Newsgroups: rec.games.programmer