Newsgroups: comp.ai.games
Path: cantaloupe.srv.cs.cmu.edu!bb3.andrew.cmu.edu!newsfeed.pitt.edu!gatech!news.mathworks.com!fu-berlin.de!news.dfn.de!news.uni-augsburg.de!news
From: Pitbull <schaefer@malaga.math.uni-augsburg.de>
Subject: Re: Terrain AI for bridges
Content-Type: text/plain; charset=us-ascii
Message-ID: <DnJ7xp.57v@Yuri.CC.Uni-Augsburg.DE>
To: edybs@ix.netcom.com
Sender: news@Yuri.CC.Uni-Augsburg.DE (The News Administrator)
Nntp-Posting-Host: jaen.math.uni-augsburg.de
Content-Transfer-Encoding: 7bit
Organization: http://malaga.math.uni-augsburg.de/schaefer/
References: <4gv72k$89c@cloner4.netcom.com>
Mime-Version: 1.0
Date: Thu, 29 Feb 1996 10:03:24 GMT
X-Mailer: Mozilla 1.12IS (X11; I; IRIX 5.3 IP22)
X-Url: news:4gv72k$89c@cloner4.netcom.com
Lines: 75

edybs@ix.netcom.com(Eric Dybsand) wrote:
>
>Here is an AI problem related to terrain, that I
>thought may be of interest to the readers of this group:
>
>      ----- Finding a Bridge Span ------
>
>Given a grid based map (up to 1024x1024) that wraps (ie. it is 
>a torus) where each grid location is a square, and each grid 
>can contain one of a variety of terrain types (which include 
>but is not limited to: plains, river, forest, swamp, hills, 
>mountains and ocean).
>
>I would like to find appropriate places to build a bridge
>across river or ocean terrain, that connects 'land' terrain 
>(ie. plains, forest, swamp, hills and mountains.).
>
>The maximum span of the bridge can be MAX_SPAN squares in
>length and bridges can be oriented horizontally, vertically
>or diagnolly with the axes of the map.  The bridge span must
>begin and end on land terrain, and can cross land, river or
>ocean terrain.  The bridge span is a straight line, like a ray.
>
>Bridges should be placed appropriately based on the location
>of CITY squares which are placed only on land terrain.  And
>can only be placed some minimum distance from each other.
>

Perhaps you should do the 'select good starting location'
before the 'cast rays from locations'.
This works whenever  MAX_SPAN is comparatively small.

Step 1.
For all 'coastal' land squares
 For all cities within a maximum distance(air),
  sum up the distances from that square, and divide by the number of cities.  
  this is the rating. I came up with that formula because it may be nicer
  sometimes to connect three or four cities.
  record the city with the square.

Step2.
Start with the best rated square.
If raycasting succeds, remove all squares from the ordered list/tree of
squares whose cities already have been connected to each other.

Well, that doesn't work as exactly as your algorithm, but might be faster.
Also, it doesn't charge any costs for bridge-building.
Why not:

For all cities within a minimum distance from each other:
 Find Shortest path between two cities, charging higher movement costs
 for crossing river/seas. Build a bridge where you have to cross water,
 unless there already is a bridge near that can be used to cross there
 as well( That is, the path is shorter, charging standard movement costs ).

Peter
>
>Regards,
>
>Eric Dybsand
>Glacier Edge Technology
>Glendale, Colorado, USA
>

-- 
Peter Sch"afer

"office":
schaefer@malaga.math.uni-augsburg.de
http://wwwhoppe.math.uni-augsburg.de/schaefer

"leisure":
schaefer@mathpool.uni-augsburg.de     
http://www.mathpool.uni-augsburg.de/~schaefer

