Newsgroups: comp.ai.games
Path: cantaloupe.srv.cs.cmu.edu!newshost!goldenapple.srv.cs.cmu.edu!das-news2.harvard.edu!cam-news-feed3.bbnplanet.com!rosnet!news.itis.ru!ns.itep.ru!Radio-MSU.net!Gamma.RU!srcc!stdio!iglou!news
From: Ed Snyder <figlet@iglou.com>
Subject: A smarter random map generator...HELP!
X-Nntp-Posting-Host: lou-3-17.iglou.net
X-Nntp-Posting-User: figlet
Message-ID: <2176.7015T1215T1186@iglou.com>
Sender: news@iglou.com (News Administrator)
Organization: IgLou Internet Services (1-800-436-4456)
X-Newsreader: THOR 2.4 (Amiga;TCP/IP) *UNREGISTERED*
Date: Mon, 17 Mar 1997 15:15:23 GMT
Lines: 53

Hi.

I'm currently working on the map editor portion of a strategy game and have a
question or two....

What is the best way to randomly create terrain masses? Ok, first let me
explain the way it works at the moment.

There are 16 terrain types (ok actually only 15. #16 is a city image placed on
a valid terrain, such as land). I allow the user to set the size of the map as
well as the percentage of each terrain type to be generated, not larger than
100% of course. The map is in hexes BTW. :) The current routine figures the
total number of hexes based on the map size. Then it starts with the first
terrain type and generates hexes at various points on the map for that
terrain. If the user left a terrain at 0% then it is skipped. The process
continues until the last terrain type is generated, more or less covering the
map completely. Then the user can select the number of cities to generate and
it will then randomly place them on the map, checking to be sure the terrain
is a valid one for cities (can't have cities in the water, at least not in
this version! :) ).

My problem is this: It plots a hex and then plots a circle of hexes around the
initial hex, checking to make sure a hex hasn't already been plotted there. On
the smaller maps this has a nice effect. Land and water masses look good.
However, on the large scale maps it looks like a bunch of spots. I want to add
a setting (that the user can set) for creating a better organized cluster of
terrain. Something like islands and continents, but the shape and size of each
determined randomly.

So, what would be the best way (in C or C++) to accomplish this???

Any help would be greatly appreciated and proper credit would be given of
course! Although the game is currently FREEware. :)

Thanks!

Ed


--
           "The body may be dead, but the soul lives on."

 Ed Snyder                  | Member *TEAM AMIGA* and *ASK*
                            |
 figlet@iglou.com           | TerraSoft/FIGware
                            | "Providing continued support for
 On the WEB...              | the *AMIGA* and the users of it!"

 http://members.iglou.com/figlet
 http://www.iglou.com/terrasoft

<tsb>

