[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] [Pygame] Generating a map



On Mon, August 6, 2007 7:06 pm, Jérôme Brilland wrote:
> Hello,
>
>
> I would like to develop a strategy game using Python and Pygame. I would
> like to know if it's possible to generate a random map divided into regions
> with Pygame. Is there a tutorial for this feature ?

I don't know of a tutorial on exactly what you want, but we've been
talking a little recently about random terrain generation. One technique
worth looking at is "Perlins noise," one way of implementing which is to
draw various surfaces full of random data, overlay them with different
"weights," and use the result to decide gameplay features such as the
height of terrain.

I built a crude terrain generator with an ad-hoc method. I think that the
code for it is "castor.py" in
<http://kschnee.xepher.net/code/070530ShiningSeaSource.zip>. The results
look like this: <http://kschnee.xepher.net/pics/070615zonemap.jpg>

It'd be helpful to know what kind of features you want to focus on, and
whether the terrain is to be 2D or 3D.