Newsgroups: comp.ai.games
Path: cantaloupe.srv.cs.cmu.edu!bb3.andrew.cmu.edu!nntp.sei.cmu.edu!news.psc.edu!hudson.lm.com!news.math.psu.edu!ra.nrl.navy.mil!lamarck.sura.net!newsfeed.internetmci.com!tank.news.pipex.net!pipex!in1.uu.net!ncrgw2.ncr.com!ncrhub6!daynews!falcon!news
From: Dick Menninger <Dick.Menninger@DaytonOH.ATTGIS.COM>
Subject: Re: Obstacle avoidance
X-Nntp-Posting-Host: 149.25.99.44
Message-ID: <DDvvxJ.EKD@falcon.daytonoh.attgis.com>
Sender: news@falcon.daytonoh.attgis.com (News administrative Login)
Reply-To: Dick.Menninger@DaytonOH.ATTGIS.COM (mennid)
Organization: AT&T Global Information Solutions
X-Newsreader: DiscussIT 2.5.1.2 for MS Windows [AT&T Software Products Division]
References: <1995Aug25.144556.9466@alder.cc.kcl.ac.uk>
Date: Fri, 25 Aug 1995 20:36:55 GMT
Lines: 96


> ==========azathoth, 8/25/95==========
> 
> David Catmull (dtc@pixar.com) wrote:
> : In article <1995Aug24.160256.9451@alder.cc.kcl.ac.uk>,
> : azathoth@zippy.spods.dcs.kcl.ac.uk (azathoth) wrote:
> 
> : [snip]
> : >         A diffusion map would do it, but in this case the
> area is usually
> : > about 300*40*8 locations across, so since this is a
> real-time game it might
> : > be just a little slow.
> : [snip]
> 
> : Could someone please explain to me what a diffusion map is,
or give me
> : pointers to where I can find this kind of info? I'm a little
> new to this
> : AI thing. Thanks!
> 
> I may be wrong but what I mean by a diffusion map is the
> following excellent
> way to move units...
> 
> Divide all squares into blocked and free.
> Give the square you are 'hunting' a very high value, like two to the
> power of the length of the playing area divided by two.
> Give all adjacent free squares half that value.  Blocked ones
are always
> value 0.
> Work your way out in ever increasing squares from the hunted
> square, giving
> each free square a value which is the sum of the values of adjacent
> squares.
> Wait for a while for this to finish. *yawn*
> Now, it's easy for an enemy on one square to find the hunted
> square... all
> it has to do is move to the highest-valued of the squares
adjacent to it
> repeatedly until it moves onto the hunted square.
> 
> Simple but ingenious -- it's da perfect crime!
> 

You seem to be describing an interative method.  But distance
is readily solved without iteration.  Every square has a cost to
enter it.
I will assume straight costs (directional entry costs are only a minor
change to thealgorithm), and carry-over (partial completion of a move).
Some other rules may make it more complicated to use the resulting array.
There is a maximum theoretical cost to the worst possible length
traversal.
For instance, "the number of squares on board" * ("worst
non-blocked cost" + 1)
is an upper bound (and not even close to the least upper bound).
Give the square you are hunting a value of 0 and all of the others your
upper bound.  You have a list of lists of candidates. You only need
max nonblocked cost + 1 lists (linked I presume).  You have a counter
of candidates left and the current distance.  Initialize the
current distance
to 0, the count to 1, and put the hunted square on the list.

While there are candidates left, get the next candidate (cycling the
pointer into the circular list of lists when the current list is empty
which also means bumping the current distance).
For the candidate: loop through its immediate neighbors.
For each neighbor, add its cost of entry to the current distance
and compare it to its previous cost. If the new distance is better,
you put it on the new cost queue and bump the candidate count.
(If you use directional entry costs you check for old distance less
than the upper bound, and if so, you first remove it from that
candidate queue and decrement the candidate count.)

Of course, whether this information provides the optimal course of
action is affected by other considerations such as the real
target being able to move.

> 
> 
> : David Catmull
> : dtc@pixar.com
> 
> --
> strategy_game_type arena256 = WRITTEN;
> arcade_strategy_game_type Ankhband = IN_PROGRESS;
> if(currentgame==IN_PROGRESS)
>      {writecode(ALL_DAY,EVERY_DAY,FOR_AGES);} //takes time to execute!
>   
> 
> 


Good Day
Dick

