Discussion:
[Algorithms] 2D Side Terrain generation
Joel B
2011-08-09 02:22:03 UTC
Permalink
Hello, I'm looking for algorithms for generating 2d terrain from a side view, like the old Defender game from the 80's, except with mountains grass, rocks, lakes etc instead of just lines.

Here is an example of what I have done in Photoshop:

Loading Image...

Anyone on this list have some suggestions? It doesn't have to be real time, although that would be interesting too.

- Joel
Brennan Rusnell
2011-08-09 03:39:48 UTC
Permalink
I'd recommend using Ridged Multifractals:

https://www.internal.pandromeda.com/engineering/musgrave/unsecure/S01_Course_Notes.html
http://www.ypoart.com/downloads/Musgrave.htm
http://vterrain.org/Elevation/Artificial/

This is a great book on the topic:
http://books.google.com/books/about/Texturing_modeling.html?id=bDlSJd8GfMcC

Hope this helps.
--
Brennan Rusnell
Post by Joel B
Hello, I'm looking for algorithms for generating 2d terrain from a side
view, like the old Defender game from the 80's, except with mountains grass,
rocks, lakes etc instead of just lines.
http://img855.imageshack.us/img855/8125/examplelp.png
Anyone on this list have some suggestions? It doesn't have to be real time,
although that would be interesting too.
- Joel
------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model
configuration take the hassle out of deploying and managing Subversion and
the tools developers use with it. Learn more about uberSVN and get a free
download at: http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
GDAlgorithms-list mailing list
https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list
http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list
Joel B
2011-08-09 04:46:02 UTC
Permalink
Thanks very much for the suggestions!

- Joel
Marc Hernandez
2011-08-09 05:34:07 UTC
Permalink
The big revelation for me was that I realized I could use fractals
as input functions to other fractals, as well as composing them from
adding or multiplying.

I tend to start with the standard perlin noise to define the major
continents, then use things like rigid multifractal to build mountains
into it.
Megan Fox
2011-08-09 13:49:44 UTC
Permalink
I'd also recommend Perlin - once you start mixing high or low passed
low-frequency Perlin noise with high/low-passed high-frequency noise, you
get some very, very interesting results.

The key, and what will define your continents and the feel of the resultant
shape, is the number of layers of noise, and how you scale or cut (high/low
pass) each layer.

Hugo Elias's page is an oldy, but it has some really great info on this
topic: http://freespace.virgin.net/hugo.elias/models/m_clouds.htm - that
page is the one that turned me on to how cool noise could be in the first
place (my version of his cloud algorithm:
I realize he's working in a
slightly different space, but those basic techniques can be applied from a
side view just as they can from a top-down view.
Post by Marc Hernandez
The big revelation for me was that I realized I could use fractals
as input functions to other fractals, as well as composing them from
adding or multiplying.
I tend to start with the standard perlin noise to define the major
continents, then use things like rigid multifractal to build mountains
into it.
Andy Farnell
2011-08-09 14:51:18 UTC
Permalink
An alternative take to random/quasi-stochastic methods I'll mention
an exercise we did with my London undergraduates for a Lunar Lander
terrain. The problem was to make the terrain controllable, in order to
insert plausible landing sites, (or IIRC "defender" well, you might
want to create volatile terrain to nicely hide ground based missle silos)

Rather than starting with a Perlin source and filtering as Megan suggests,
we found a great way was to Fourier construct with about 5 or 6 sine components.
By setting the frequency and amplitude coefficients the terrain could have
a useful "roughness" parameter, with local consistency, without unexpected
dicontinuities (effectively band limiting the terrain within the frame
resolution) and remain well bounded in height. Compared to a pink or
Perlin source and IIR filter it's swings and roundabouts in terms of cost.

- Andy


On Tue, 9 Aug 2011 07:49:44 -0600
Post by Megan Fox
I'd also recommend Perlin - once you start mixing high or low passed
low-frequency Perlin noise with high/low-passed high-frequency noise, you
get some very, very interesting results.
The key, and what will define your continents and the feel of the resultant
shape, is the number of layers of noise, and how you scale or cut (high/low
pass) each layer.
Hugo Elias's page is an oldy, but it has some really great info on this
topic: http://freespace.virgin.net/hugo.elias/models/m_clouds.htm - that
page is the one that turned me on to how cool noise could be in the first
http://youtu.be/kHvJqPxXUXM I realize he's working in a
slightly different space, but those basic techniques can be applied from a
side view just as they can from a top-down view.
Post by Marc Hernandez
The big revelation for me was that I realized I could use fractals
as input functions to other fractals, as well as composing them from
adding or multiplying.
I tend to start with the standard perlin noise to define the major
continents, then use things like rigid multifractal to build mountains
into it.
Joel B
2011-08-09 20:20:35 UTC
Permalink
Hi Andy, do you have any examples of the algorithm? Is it just a standard Fourier transform and use the waveform output as landscape?

- Joel
Post by Andy Farnell
An alternative take to random/quasi-stochastic methods I'll mention
an exercise we did with my London undergraduates for a Lunar Lander
terrain. The problem was to make the terrain controllable, in order to
insert plausible landing sites, (or IIRC "defender" well, you might
want to create volatile terrain to nicely hide ground based missle silos)
Rather than starting with a Perlin source and filtering as Megan suggests,
we found a great way was to Fourier construct with about 5 or 6 sine components.
By setting the frequency and amplitude coefficients the terrain could have
a useful "roughness" parameter, with local consistency, without unexpected
dicontinuities (effectively band limiting the terrain within the frame
resolution) and remain well bounded in height. Compared to a pink or
Perlin source and IIR filter it's swings and roundabouts in terms of cost.
- Andy
On Tue, 9 Aug 2011 07:49:44 -0600
Post by Megan Fox
I'd also recommend Perlin - once you start mixing high or low passed
low-frequency Perlin noise with high/low-passed high-frequency noise, you
get some very, very interesting results.
The key, and what will define your continents and the feel of the resultant
shape, is the number of layers of noise, and how you scale or cut (high/low
pass) each layer.
Hugo Elias's page is an oldy, but it has some really great info on this
topic: http://freespace.virgin.net/hugo.elias/models/m_clouds.htm - that
page is the one that turned me on to how cool noise could be in the first
http://youtu.be/kHvJqPxXUXM I realize he's working in a
slightly different space, but those basic techniques can be applied from a
side view just as they can from a top-down view.
Post by Marc Hernandez
The big revelation for me was that I realized I could use fractals
as input functions to other fractals, as well as composing them from
adding or multiplying.
I tend to start with the standard perlin noise to define the major
continents, then use things like rigid multifractal to build mountains
into it.
From there I use another perlin noise to add smaller hills and
valleys, and use yet another to define where to place all those.
Here's a 2d example of the output.
http://redmine.alephnought.com/projects/cubit/wiki/World#Pretty-pictures
I didnt have a terrain renderer yet, so I dont know what the
landscape looked like, but I liked the start of it.
For something like you're mentioning, I think I might treat it as a
strip of a standard 2d heightmap. That way you might get some neat
parallax as the ship flys through it.
On Mon, Aug 8, 2011 at 8:39 PM, Brennan Rusnell
https://www.internal.pandromeda.com/engineering/musgrave/unsecure/S01_Course_Notes.html
Post by Brennan Rusnell
http://www.ypoart.com/downloads/Musgrave.htm
http://vterrain.org/Elevation/Artificial/
http://books.google.com/books/about/Texturing_modeling.html?id=bDlSJd8GfMcC
Post by Brennan Rusnell
Hope this helps.
--
Brennan Rusnell
Post by Joel B
Hello, I'm looking for algorithms for generating 2d terrain from a side
view, like the old Defender game from the 80's, except with mountains
grass,
Post by Brennan Rusnell
Post by Joel B
rocks, lakes etc instead of just lines.
http://img855.imageshack.us/img855/8125/examplelp.png
Anyone on this list have some suggestions? It doesn't have to be real
time, although that would be interesting too.
- Joel
------------------------------------------------------------------------------
Post by Brennan Rusnell
Post by Joel B
uberSVN's rich system and user administration capabilities and model
configuration take the hassle out of deploying and managing Subversion
and
Post by Brennan Rusnell
Post by Joel B
the tools developers use with it. Learn more about uberSVN and get a
free
Post by Brennan Rusnell
Post by Joel B
download at: http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
GDAlgorithms-list mailing list
https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list
http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list
------------------------------------------------------------------------------
Post by Brennan Rusnell
uberSVN's rich system and user administration capabilities and model
configuration take the hassle out of deploying and managing Subversion
and
Post by Brennan Rusnell
the tools developers use with it. Learn more about uberSVN and get a free
download at: http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
GDAlgorithms-list mailing list
https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list
http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list
--
/// //
------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model
configuration take the hassle out of deploying and managing Subversion and
the tools developers use with it. Learn more about uberSVN and get a free
download at: http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
GDAlgorithms-list mailing list
https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list
http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list
--
Megan Fox
http://www.glassbottomgames.com/
--
------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model
configuration take the hassle out of deploying and managing Subversion and
the tools developers use with it. Learn more about uberSVN and get a free
download at: http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
GDAlgorithms-list mailing list
https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list
http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list
Jon Watte
2011-08-14 20:12:17 UTC
Permalink
Andy Farnell
2011-08-14 21:05:17 UTC
Permalink
Oops that was possibly my bad etiquette to fork off there,
I replied to Joel off-list because I wasn't sure about
policy on posting code. As it turns out it was less than
20 lines. Maybe Joel will post back some results later.

Actually it is simple, the synthesis components,
being interpolated lookups of a cosine table (or
math function), are summed and used directly, and if
there's several of them (between 5 and 10 maybe) the
terrain looks okay. Joel sent me a video clip to show
it working.

The next idea I had was maybe to provide some FM feedback
to get a range of quasi-noisy textures

see

Also, do you want heightfield-style terrain (each X has exactly 1 Y) or
overhangs/crags? That may change how you implement the subdivision.
That's an interesting thought.

Andy


On Sun, 14 Aug 2011 13:12:17 -0700
Jon Watte <***@gmail.com> wrote:
Joel B
2011-08-15 04:17:01 UTC
Permalink
Actually I got inspired by Andy's code to start writing code to read and write WAV files, it will be interesting to actually hear the output of his algorithm!

Sent from my iPhone
Post by Andy Farnell
Oops that was possibly my bad etiquette to fork off there,
I replied to Joel off-list because I wasn't sure about
policy on posting code. As it turns out it was less than
20 lines. Maybe Joel will post back some results later.
Actually it is simple, the synthesis components,
being interpolated lookups of a cosine table (or
math function), are summed and used directly, and if
there's several of them (between 5 and 10 maybe) the
terrain looks okay. Joel sent me a video clip to show
it working.
The next idea I had was maybe to provide some FM feedback
to get a range of quasi-noisy textures
see http://youtu.be/Hu9FR_1l0Nc
Also, do you want heightfield-style terrain (each X has exactly 1 Y) or
overhangs/crags? That may change how you implement the subdivision.
That's an interesting thought.
Andy
On Sun, 14 Aug 2011 13:12:17 -0700
From his description, it sounds as if he uses Fourier synthesis to generate
control values for some fractal algorithm. For example, subdivision
algorithms often have "roughness" parameters, which determine how much to
subdivide a segment once it's selected for subdivision; I would imagine
you'd get an interesting-looking terrain by varying roughness in some
locally-smooth but globally-varying way.
Also, do you want heightfield-style terrain (each X has exactly 1 Y) or
overhangs/crags? That may change how you implement the subdivision.
Sincerely,
jw
--
Americans might object: there is no way we would sacrifice our living
standards for the benefit of people in the rest of the world. Nevertheless,
whether we get there willingly or not, we shall soon have lower consumption
rates, because our present rates are unsustainable.
Hi Andy, do you have any examples of the algorithm? Is it just a standard
Fourier transform and use the waveform output as landscape?
- Joel
Post by Andy Farnell
An alternative take to random/quasi-stochastic methods I'll mention
an exercise we did with my London undergraduates for a Lunar Lander
terrain. The problem was to make the terrain controllable, in order to
insert plausible landing sites, (or IIRC "defender" well, you might
want to create volatile terrain to nicely hide ground based missle silos)
Rather than starting with a Perlin source and filtering as Megan
suggests,
Post by Andy Farnell
we found a great way was to Fourier construct with about 5 or 6 sine
components.
Post by Andy Farnell
By setting the frequency and amplitude coefficients the terrain could
have
Post by Andy Farnell
a useful "roughness" parameter, with local consistency, without
unexpected
Post by Andy Farnell
dicontinuities (effectively band limiting the terrain within the frame
resolution) and remain well bounded in height. Compared to a pink or
Perlin source and IIR filter it's swings and roundabouts in terms of
cost.
Post by Andy Farnell
- Andy
On Tue, 9 Aug 2011 07:49:44 -0600
Post by Megan Fox
I'd also recommend Perlin - once you start mixing high or low passed
low-frequency Perlin noise with high/low-passed high-frequency noise,
you
Post by Andy Farnell
Post by Megan Fox
get some very, very interesting results.
The key, and what will define your continents and the feel of the
resultant
Post by Andy Farnell
Post by Megan Fox
shape, is the number of layers of noise, and how you scale or cut
(high/low
Post by Andy Farnell
Post by Megan Fox
pass) each layer.
Hugo Elias's page is an oldy, but it has some really great info on this
topic: http://freespace.virgin.net/hugo.elias/models/m_clouds.htm -
that
Post by Andy Farnell
Post by Megan Fox
page is the one that turned me on to how cool noise could be in the
first
Post by Andy Farnell
Post by Megan Fox
http://youtu.be/kHvJqPxXUXM I realize he's working in
a
Post by Andy Farnell
Post by Megan Fox
slightly different space, but those basic techniques can be applied from
a
Post by Andy Farnell
Post by Megan Fox
side view just as they can from a top-down view.
Post by Marc Hernandez
The big revelation for me was that I realized I could use fractals
as input functions to other fractals, as well as composing them from
adding or multiplying.
I tend to start with the standard perlin noise to define the major
continents, then use things like rigid multifractal to build mountains
into it.
From there I use another perlin noise to add smaller hills and
valleys, and use yet another to define where to place all those.
Here's a 2d example of the output.
http://redmine.alephnought.com/projects/cubit/wiki/World#Pretty-pictures
Post by Andy Farnell
Post by Megan Fox
Post by Marc Hernandez
I didnt have a terrain renderer yet, so I dont know what the
landscape looked like, but I liked the start of it.
For something like you're mentioning, I think I might treat it as a
strip of a standard 2d heightmap. That way you might get some neat
parallax as the ship flys through it.
On Mon, Aug 8, 2011 at 8:39 PM, Brennan Rusnell
https://www.internal.pandromeda.com/engineering/musgrave/unsecure/S01_Course_Notes.html
Post by Andy Farnell
Post by Megan Fox
Post by Marc Hernandez
Post by Brennan Rusnell
http://www.ypoart.com/downloads/Musgrave.htm
http://vterrain.org/Elevation/Artificial/
http://books.google.com/books/about/Texturing_modeling.html?id=bDlSJd8GfMcC
Post by Andy Farnell
Post by Megan Fox
Post by Marc Hernandez
Post by Brennan Rusnell
Hope this helps.
--
Brennan Rusnell
Post by Joel B
Hello, I'm looking for algorithms for generating 2d terrain from a
side
Post by Andy Farnell
Post by Megan Fox
Post by Marc Hernandez
Post by Brennan Rusnell
Post by Joel B
view, like the old Defender game from the 80's, except with mountains
grass,
Post by Brennan Rusnell
Post by Joel B
rocks, lakes etc instead of just lines.
http://img855.imageshack.us/img855/8125/examplelp.png
Anyone on this list have some suggestions? It doesn't have to be real
time, although that would be interesting too.
- Joel
------------------------------------------------------------------------------
Post by Andy Farnell
Post by Megan Fox
Post by Marc Hernandez
Post by Brennan Rusnell
Post by Joel B
uberSVN's rich system and user administration capabilities and model
configuration take the hassle out of deploying and managing
Subversion
Post by Andy Farnell
Post by Megan Fox
Post by Marc Hernandez
and
Post by Brennan Rusnell
Post by Joel B
the tools developers use with it. Learn more about uberSVN and get a
free
Post by Brennan Rusnell
Post by Joel B
download at: http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
GDAlgorithms-list mailing list
https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list
http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list
------------------------------------------------------------------------------
Post by Andy Farnell
Post by Megan Fox
Post by Marc Hernandez
Post by Brennan Rusnell
uberSVN's rich system and user administration capabilities and model
configuration take the hassle out of deploying and managing Subversion
and
Post by Brennan Rusnell
the tools developers use with it. Learn more about uberSVN and get a
free
Post by Andy Farnell
Post by Megan Fox
Post by Marc Hernandez
Post by Brennan Rusnell
download at: http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
GDAlgorithms-list mailing list
https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list
http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list
Post by Andy Farnell
Post by Megan Fox
Post by Marc Hernandez
--
/// //
------------------------------------------------------------------------------
Post by Andy Farnell
Post by Megan Fox
Post by Marc Hernandez
uberSVN's rich system and user administration capabilities and model
configuration take the hassle out of deploying and managing Subversion
and
Post by Andy Farnell
Post by Megan Fox
Post by Marc Hernandez
the tools developers use with it. Learn more about uberSVN and get a
free
Post by Andy Farnell
Post by Megan Fox
Post by Marc Hernandez
download at: http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
GDAlgorithms-list mailing list
https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list
http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list
Post by Andy Farnell
Post by Megan Fox
--
Megan Fox
http://www.glassbottomgames.com/
--
------------------------------------------------------------------------------
Post by Andy Farnell
uberSVN's rich system and user administration capabilities and model
configuration take the hassle out of deploying and managing Subversion
and
Post by Andy Farnell
the tools developers use with it. Learn more about uberSVN and get a free
download at: http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
GDAlgorithms-list mailing list
https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list
http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list
------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model
configuration take the hassle out of deploying and managing Subversion and
the tools developers use with it. Learn more about uberSVN and get a free
download at: http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
GDAlgorithms-list mailing list
https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list
http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list
--
------------------------------------------------------------------------------
FREE DOWNLOAD - uberSVN with Social Coding for Subversion.
Subversion made easy with a complete admin console. Easy
to use, easy to manage, easy to install, easy to extend.
Get a Free download of the new open ALM Subversion platform now.
http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
GDAlgorithms-list mailing list
https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list
http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list
Marc Reynolds
2011-08-09 17:05:50 UTC
Permalink
Megan Fox [mailto:]
1970-01-01 00:00:00 UTC
Permalink
This is a multi-part message in MIME format.

------=_NextPart_000_0382_01CC56C7.5BDA1000
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit

At the risk of being anal: Hugo's page actually describes value noise and
not any flavor of Perlin's gradient noise.



From: Megan Fox [mailto:***@gmail.com]
Sent: Tuesday, August 09, 2011 3:50 PM
To: Game Development Algorithms
Subject: Re: [Algorithms] 2D Side Terrain generation



I'd also recommend Perlin - once you start mixing high or low passed
low-frequency Perlin noise with high/low-passed high-frequency noise, you
get some very, very interesting results.

The key, and what will define your continents and the feel of the resultant
shape, is the number of layers of noise, and how you scale or cut (high/low
pass) each layer.

Hugo Elias's page is an oldy, but it has some really great info on this
topic: http://freespace.virgin.net/hugo.elias/models/m_clouds.htm - that
page is the one that turned me on to how cool noise could be in the first
place (my version of his cloud algorithm:
http://youtu.be/kHvJqPxXUXM I realize he's working in a
slightly different space, but those basic techniques can be applied from a
side view just as they can from a top-down view.

On Mon, Aug 8, 2011 at 11:34 PM, Marc Hernandez <***@gmail.com> wrote:

The big revelation for me was that I realized I could use fractals
as input functions to other fractals, as well as composing them from
adding or multiplying.

I tend to start with the standard perlin noise to define the major
continents, then use things like rigid multifractal to build mountains
into it.
Continue reading on narkive:
Loading...