Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (107)
games submitted by our members
Games in WIP (536)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Tile maps - generating islands or continents?  (Read 2371 times)
0 Members and 1 Guest are viewing this topic.
Offline markww

Junior Newbie


Medals: 1



« Posted 2012-08-25 15:39:02 »

Hi,

I have a 2d tile game, and I'd like to generate random maps (of size 100x50). I'd like to be able to create small islands, or large continents.

It seems like a standard way to do this is to use perlin noise. You generate a random heightmap, pick a threshold for the water line, and assign tiles their terrain type from that.

Looking at perlin noise implementations, I can't find a description of the domain of the different parameters, or how/if they can be combined to generate small islands vs large continents. Perlin noise seems to have a few parameters:

    persistence
    frequency
    amplitude
    octaves

Is anyone familiar enough with this to describe them, and how they can be combined to create the "clump" size I'm after? I found a posting by a member here that made an interactive demo of perlin noise:

    http://www.java-gaming.org/topics/perlin-landscape-applet/24141/view

but I'm basically just playing with the parameters without really knowing what they're doing. I'm not even sure what the min/max range of each of the above params can be.

I found this article which is pretty much exactly what I want:

    http://www.nolithius.com/game-development/world-generation-breakdown

but the author is using flash which has a perlin noise function built in, so I'm not sure how its version of perlin noise and its parameters map to a .. "standard"? version of perlin noise. The author says:

"Generate a Fractal Grayscale Perlin Noise with an x-frequency of half the width, a y-frequency of half the height, and 8 octaves. For more loose islands, or for larger maps, you can drop the frequency to 1/4th of the width and height or lower, to fit your purposes."

Matching that up with the sample applet from the above user didn't yield expected results.

If anyone is knowledgable about this it'd be awesome to get a clear description memorialized on the nets.

Thank you
Offline Best Username Ever

Junior Member





« Reply #1 - Posted 2012-08-25 19:03:55 »

Persistence, frequency, amplitude, and octaves are not relevant to Perlin noise. Perlin noise basically just calculates "random" values at specific locations on a grid and tries to smoothly interpolate values between points on the grid (1D, 2D, 3D, etc.) The four values you describe are used with all kinds of noise and are part of a noise layering pattern, not a noise generation pattern. The process will work with any type of noise.

Amplitude is proportional to the "height" of the original noise layer. Frequency (1 / period) determines the distance between "hills." The period is the actual distance. It's often constant between different layers but doesn't need to be. Persistence is how much the amplitude "decays" between each layer. It can be done using amp = amp * persistence; (0 < persistence < 1). Octaves is the number of layers of noise you use. Since the amplitude decays between layers, it acts like a geometric series. If you used an infinite number of octaves, then the highest octave would have an infinitesimally small (almost zero) amplitude and the lowest/first octave/layer would have a height equal to amplitude. Since the amplitude decreases, the number of octaves determines the "detail" of the final layered noise pattern.
Offline Nolithius

Innocent Bystander





« Reply #2 - Posted 2012-10-19 20:53:21 »

Hey markww,

Nolithius from nolithius.com here.

In your applet, over at http://www.hayles.demon.co.uk/perlin/perlin.html, it looks like the following terminology is used:

Applet -> Flash
Persistence -> ?
Octaves -> Octaves
Horizontal Scale -> x-frequency AND y-frequency
Vertical Scale -> amplitude (not used in Flash, basically a multiplier to polarize the values).

Hope that helps!

Ebyan "Nolithius" Alvarez-Buylla
http://www.nolithius.com

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

CogWheelz (8 views)
2014-07-30 21:08:39

Riven (20 views)
2014-07-29 18:09:19

Riven (14 views)
2014-07-29 18:08:52

Dwinin (12 views)
2014-07-29 10:59:34

E.R. Fleming (32 views)
2014-07-29 03:07:13

E.R. Fleming (12 views)
2014-07-29 03:06:25

pw (42 views)
2014-07-24 01:59:36

Riven (42 views)
2014-07-23 21:16:32

Riven (29 views)
2014-07-23 21:07:15

Riven (30 views)
2014-07-23 20:56:16
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!