Newsgroups: comp.ai.games
Path: cantaloupe.srv.cs.cmu.edu!bb3.andrew.cmu.edu!newsfeed.pitt.edu!scramble.lm.com!news.math.psu.edu!news.cse.psu.edu!uwm.edu!cs.utexas.edu!howland.reston.ans.net!agate!usenet.kornet.nm.kr!usenet.hana.nm.kr!usenet.seri.re.kr!news.imnet.ad.jp!wnoc-tyo-news!rena!ares!news2-tokyonet!tokyonet.ad.jp!tokyonet.ad.jp!sectrl!leichar!agove
From: agove@im.isl.secom.co.jp (P. Minovic)
Subject: Re: Straight Line Movement
In-Reply-To: asouthwick@vnet.ibm.com's message of 16 Apr 1996 19:07:00 GMT
Message-ID: <AGOVE.96Apr18180913@leichar.im.isl.secom.co.jp>
Sender: news@sectrl.isl.secom.co.jp
Nntp-Posting-Host: 192.168.200.139
Organization: SECOM Intelligent Systems Laboratory, JAPAN
References: <4l0r4l$jbf@watnews1.watson.ibm.com>
Date: Thu, 18 Apr 1996 09:09:13 GMT
Lines: 28

In article <4l0r4l$jbf@watnews1.watson.ibm.com> asouthwick@vnet.ibm.com (Andrew R. Southwick) writes:
> I often see discussions in this group on how to get a unit (on a square-grid
> map) to get from point A to point B in a relatively straight manner, and
> not being dumb and just moving at a 1:1 diagonal until the unit is level
> with the destination point, then moving straight accross.  Units must move
> across relatively large squares, and can only move one square at a time.

  [ Flow graph proposal deleted ]

Interesting question.  Your solution seems somewhat space-expensive, though.
If you'll settle for quick and dirty, how about this:

To get from any point A to any point B, you need a certain number of
cardinal moves (c) and diagonal moves (d).
At each step, just choose randomly, P(c) = c/(c+d).  This is cheap, easily
modifiable to be robust in the face of small obstacles, and requires
no state memory of any kind.

Possible problems:
Inconsistent.  You've found a safe path through the minefield, should be
able to send the rest of the army on through.  *Boom* whoops.

Random.  It may look like a Bresenham path on average, but not in
specific cases.  That's sort of what I mean by quick and dirty.

Comments?

Andrew Gove
