Newsgroups: comp.ai.games
Path: cantaloupe.srv.cs.cmu.edu!rochester!udel!gatech!newsfeed.internetmci.com!tank.news.pipex.net!pipex!howland.reston.ans.net!swrinde!elroy.jpl.nasa.gov!lll-winken.llnl.gov!fnnews.fnal.gov!gw1.att.com!nntpa!not-for-mail
From: nak@gwe486.cb.att.com ()
Subject: Re: Cheating by AI in games (long)
Message-ID: <DFMGxA.Ly1@nntpa.cb.att.com>
Sender: news@nntpa.cb.att.com (Netnews Administration)
Nntp-Posting-Host: gwe486.cb.att.com
Organization: AT&T GBCS/Bell Labs
References: <34969.0427546296@localhost> <44bide$r7i@ixnews7.ix.netcom.com> <44cc47$jmn@nyx.cs.du.edu> <44d6os$hv8@eos.cs.cornell.edu>
Date: Thu, 28 Sep 1995 15:41:34 GMT
Lines: 106

In article <44d6os$hv8@eos.cs.cornell.edu>,
Szu-Wen Huang <szuwen@cs.cornell.edu> wrote:
>In article <44cc47$jmn@nyx.cs.du.edu> cmckeith@nyx.cs.du.edu (Cliff McKeithan) writes:
>>>Absolutely!  I agree 110% with that.  The goal of a computer game AI
>>>should be to provide an entertaining opponent.
>
>>So would you say that as long as the 'cheats' add to the entertainment value
>>of the game without causing so much grief as to reduce it, then they are
>>okay?
>
>I would think moderation is essential.  If the AI cheats excessively,
>it quickly becomes an annoying game.  If the AI does not cheat but
>dies miserably every time, it quickly becomes a boring game.  Look
>at it this way - ain't no way you can be perfectly fair and stand a
>chance against a human if all you have is -one- million cycle box and
>four lousy megs of ram.  (I'm excluding "simpler" games such as chess).

I take a differing view.  I've written code for "MIP in a box" Unix
machines and it played a challenging game.  To be precise, 1 MIP, 4M ram,
140 MB disk, 20 users playing in the same game space on one side against 20
machine opponents.  The AI was *NOT* the slowest part of the code.  It ran
far faster than the humans could get their moves plotted.  The
line-of-sight code was by far the slowest piece of code.

I suggest that if you can not write an AI that is challenging, it is a
reflection of the designer/programmer more than anything else.  Before
you flame, let me explain.  As the person in charge, you have total
control.  

1) Design a game (or re-design your game) so that it's easy to write
an AI for.  "Design for AI" for all you DFX fans.  This is easier to do
after you have done one or two and found your first games lacking in things
that hamper you in writing your AI code.  

For example:  My first game did not identify "teams" explicitly, since the
players all knew who was or was not on their team, and sometime they wanted
to "stab in the back" some of their comrades.  This was hell on my attempts
at AI.

2) Having done that, the hard part of AI is abstracting behavior
into code.  That abstraction step is the linchpin of good
conventional AI code.  If you can't easily and fluidly analyze
behaviors and abstract them into neat code, your attempts at AI will be
in trouble.  

But do not despair.  This ability come from practice.  Write some "bad" AI
that does not violate any rules and is easy to code.  Emphasize easy to
code.  Test it.  Improve one thing, no matter who small.  Test to see that
it got at least a tiny bit better.  Improve another thing, no matter how
small.  Test again.  Observe how a good player plays.  The exercise will
improve your ability to improve your code.  Like an athlete, it takes
practice.  But synthesizing the behaviors into simple bits of code will
allow you to see a new desired behavior in terms of code that you can
write.  The little fixes are the practice steps that will allow you to
have an "aha! experience" later that will give you the way to write
a sweeping or powerful change in your code.  I claim that the abstraction
step is the hard one.  You can't get there if you don't write something and
test the heck out of it, and test often.  The time required to do this can
run afoul of deadlines.

3) It gets more complex as you increase the scale of the task.  If you
require that you individual tanks, for example, fight well, you will need
to work on scaling issues.  Good behavior for one tank needs to be modified
to allow good behavior of a platoon of tanks.  And so on up the line until
you get to "the blue army" vs "the red army."  

If this is the case, consider how your player wants to play.  If they don't
want to control every last tank, write your AI at the level the human plays
at.  [ If they do want to control every last tank, your code has plenty of
think time while the user is issuing orders. ] There's no need to simulate
the game at any lower level than the player is playing at.  

I my case, I clearly needed two levels of play; the individual unit, and the
team of those units.  I saw every now and then that it might be fun to add a
third level of control to coordinate the teams.  I did not see any need at all
for four levels, since putting that many players into it would be
difficult, and groups of players that large often prefer fighting each
other no matter how good the AI is.  For single player games, there is a
similar progression.  Railroad Tycoon is neat, but the end game is hard
because the amount of tending needed for each train does not drop off very
much and the number of trains keeps rising.  

But at each level, assuming that you have to use the low level simulation
to determine results of large scale events, you have to abstract how the
myriad behaviors you have written fall into simpler categories that can be
handled at the next level up.  You are simulating a military command and
control setup, even if all you are doing is making sure that each train
maximizes revenue and minimizes costs.  But again, the abstraction step is
the hard one.  It's why good games with good AI get lots of play, even if
they may or may not sell well.

>Actually, does anybody even know a game that doesn't cheat in some
>form?
>-- 
>				Steven ?:)

Mine didn't (and won't).  I don't have the pressures of commercial sales
forcing me to get them out the door before they are ready.  If you do, you
literally may not have the time required to develop a good AI.  If you
don't, keep making it better until your playtest group starts to sweat.
You know you are there when they ask if it cheats.
---
Neil Kirby	DoD# 0783	nak@archie.cb.att.com
AT&T Bell Labs  Columbus OH     USA (614) 860-5304
President Internet BMW Riders
The BMW R1100RSL - Because the Britten V 1000 is not street legal.
