# Tag Info

15

You want to mix different wave lengths with different levels of intensity. E.G. Have one long wave, that has a high intensity, and a short wave with low intensity. Now add the two(or more) waves together. Black line being long waves and high intensity. Red line being short waves with low intensity. Green being the final result. float getHeight(float x) ...

14

If you're willing to spare some computational power for this, then you could use a similar technique to what the author of this blog did. (NB: If you wish to directly copy his code, it's in ActionScript). Basically, he generates quasi-random points (i.e. looks relatively uniform) and then uses these to create Voronoi polygons. He then sets the outside ...

13

You are ONLY generating Perlin noise. This is actually the same as using only one octave, at any frequency. You can base yourself to implent FBM (Fractional Brownian Motion), It is actually what all engines use to make Perlin noise more fractal looking. Bringing it down to code, you can use it like this: //pseudo code function fBm(float x, float y, float z,...

12

Generate regular noise with a bias for higher values towards the center. If you're wanting square-ish island shapes like you show in your example, I would use the distance to the closest edge as your factor. With that factor, you can use something like the following when generating the mask noise: maxDVal = (minIslandSolid - maxIslandSolid) getMaskValueAt(...

11

Castle Story looks like this due to technical constraints: Were there to be a heightmap per each voxel in the entire volume, rather than only a heightmap per each surface voxel, storage cost would be vastly greater, on the order of O(n^3) which can be prohibitive, as opposed to a more favourable O(n^2), where n is the side length of a cubic voxel space ...

11

I don't recommend using the "increase the dimensions and orbit in a cylinder" trick here. It has several disadvantages: More expensive to compute: Perlin noise needs to select and interpolate $d^2$ gradient vectors per evaluation, so going from 2 dimensions to 5 means doing 8x more work. More distortion: by evaluating it on a membrane in higher-...

10

Terrain generation falls under the form part of development. It's an artistic endeavor, so I'm not so sure there's a correct answer. However, I can try to tell you about the knobs you can turn to get different results, and it'll be up to you to turn them to get the result you want. Compress/expand: You can stretch or shrink the noise along a specific axis ...

10

You could combine approaches (2) and (3) like this: First, use GPU to generate a number of noise textures and save them. This wll be your "noise cache"; you can only do it once on the first run. To generate a texture in-game, combine a few textures from cache - this should be real fast. Then, if needed, add special effects like vortices on top of that. ...

10

Noise along any of the axes will be consistent noise. Just imagine you're flying through a cloud of noise sampling a single line of data. So yes, return noise(x, 0, 0); is exactly like traveling along a single line of noise inside a cloud of noise. You'll be traveling along the line that represents the x axis. You could even do return noise(x, x, x); and ...

10

I think it helps to compare it side-by-side with regular Perlin noise. As explained in the Gustavson paper, Perlin noise works by assigning pseudo-random values (gradient vectors) to each corner of a square grid and then doing some interpolation for points in the interior of a grid cell. So the first step in evaluating Perlin noise is to figure out which ...

10

For this particular mapping, I'd stick to 2D Perlin noise. To recap, 2D Perlin noise works by... dividing space into square cells, and examining the one cell our sample point falls inside picking a pseudorandom gradient vector at each corner of the square cell (in a consistent way, so repeated samples in the same vicinity all agree) interpolating the four ...

9

Add another layer of noise to control the amplitude. Scale the noise up (on the X axis) to make the changes in amplitude gradual. Further, you can apply the amplitude changes in a exponential fashion. By applying them in this way, the difference in the noise values of .3 to .4 are not nearly as significant as the difference in the values .9 to 1. This ...

9

You will need to learn how the terms Octave, Persistence, Frequency, and Lacunarity are used. What you have is a good first step, it looks just like noise should. The basic idea is that you need to combine multiple noise sources into one result to achieve the final look. This combination can be something simple like addition, but you can take many ...

8

What you are looking for is Fractal Noise generation algorithms, the most popular of which being Perlin noise with successive octave noise generation (in addition to simplex noise, which is patented by Nokia, however the patent expires in a 2021 and if you want to take the risk, technically doesn't apply to terrain generation (only that which "generates an ...

8

(1) Using the same perlin seed (map) as used for terrain You could treat ranges in the perlin result as different materials. Thus at a certain threshold, you transition from air / vacuum to matter, say rock; then at another, higher threshold, you might transition to iron, then to gold etc. The problem here is that as the values build up in a region, you ...

7

No, you should avoid doing that. 3D Perlin noise is 7 or 8 times as expensive as 1D Perlin noise. You'd be better off reimplementing the 1D function, because it's very simple. If I'm not mistaken: static public double noise(double x) { int X = (int)Math.floor(x) & 255; x -= Math.floor(x); double u = fade(x); return lerp(u, grad(p[X ], x ), ...

7

Perlin noise is great for many things - localised terrain, clouds, waves - but when it comes to mountain ranges it's somewhat lacking. The problem is that the output looks like, well, noise. Mountain ranges however are the result of tectonic plates pushing against each other, forming ridges, and so look somewhat like ripples on fabric or paper that's ...

6

When I had this problem in 3D, i solved it by blending values from both noise generators near seam. I blended not only height, but everything: textures, terraint details, etc. Here's how it worked out: http://nevermind.wdfiles.com/local--files/_unity%3Aroentgen/WebPlayer.html (unity web player). As you can see, blending works almost perfectly.

6

Though there are some answers here that would work, most of them are complicated, slow and problematic. All you really need to do is use a periodic noise generation function. That's it! An excellent public domain implementation based on Perlin's "advanced" noise algorithm can be found here. The function you need is pnoise2. The code was written by Stefan ...

6

I don't entirely understand why, but I shouldn't have been doing 1-normX/Y. Instead, I looked at the question posted here and our approaches were similar enough that I could make It work. Changing from 1-x to x-1 seemed to do the trick.

6

You have conflicting goals. A flat 2D map that wraps along the X & Y axis doesn't map to a sphere, it maps to a torus (donut). To visualize this, imagine you have a sheet of elastic. First, bend it into a horizontal tube. This corresponds to having the Y axis wrap. Next bend it so that the open ends of the tube meet. This corresponds to having the X axis ...

5

Most perlin noise algorithms will allow you to retrieve the noise value at any given location, with something like noise(x,y,z). This makes it fairly trivial to generate noise on a chunk by chunk basis. All you need to do is pass the global position, instead of the chunk position. for(int i = 0; i < CHUNKMAX_X; i++) for(int j = 0; j < CHUNKMAX_Y; ...

5

The noise values are between -1 and 1. Simply set specific ranges to be certain colors. You can do this a few different ways: Method One if ( noise <= -0.5 ) { //color 1 } else if ( noise <= 0 ) { //color 2 } else if ( noise <= 0.5 ) { //color 3 } else { //color 4 } Method Two noise = ( noise + 1 ) / 2.0; //noise is now between 0 ...

5

The values specified when you create your gradient, are your endpoints. So for example, when you create a gradient with the values (x1=0, x2=0, y1=0, y2=1), you are creating a gradient line on the y-axis with its endpoints being 0 and 1, on the y-axis. Okay, so you have a gradient on your y-axis, starting at point 0, all the way to point 1. What does this ...

5

Use many layers of perlin noise (or better simplex noise) differing in scale, range and dimensionality. There is a nice post on gamedev.net. And its continuation. For the basic shape, use a combination of 2d and 3d noise. Using just the 3d part wouldn't result in noticeable distinction between a solid ground and free air. Using only the 2d part wouldn't ...

5

You'll probably want to do a 2nd pass and carve caves after doing the regular quick height-map generation pass. Find a steep slope in the low-frequency height map layer (if you use multiple resolution height map layers) and dig a cave started by using the slope's negated normal. Same goes with crevices, canyons, and other terrain faults. Once you build a ...

4

I actually implemented this starting from bummzack excellent answer. Here are the steps I ended up with: Generate an image with Perlin noise Floodfill where you want some terrain Dilation + erosion to remove the hollows that are too small Remove the remaining background regions inside the terrain Antialiasing And this is an example of the result: I wrote ...

4

Here's a much much simpler way to do tiled noise: You use a modular wrap around for each scale of the noise. These fit the edges of the area no matter what frequency scale you use. So you only have to use normal 2D noise which is a lot faster. Here is the live WebGL code which can be found at ShaderToy: https://www.shadertoy.com/view/4dlGW2 The top three ...

4

I think this is how it works in Minecraft. Each worm has a maximum length (let's call it M). The heads of each worm are calculated based on the chunk position. When you render each chunk, you have to check all chunks within an M radius, and follow all of their worms. It's not ideal in terms of performance, but it does work.

Only top voted, non community-wiki answers of a minimum length are eligible