7

I've recently been experimenting with a simple Voxel-based 3d engine (think Minecraft) which uses heightmaps to define terrain in the following format:

http://en.wikipedia.org/wiki/Heightmap

Does anyone know of the best software for producing these kind of maps? Preferably with the ability to define a texturemap also. Are terrogen and picogen the only real alternatives?

Rory Harvey
  • 1,422
  • 2
  • 14
  • 16

3 Answers3

2

Rolling your own is nice, since then you can just create maps, without needing to supply an image, or at least make the image optional. I use Perlin noise in my voxel game for terrain generation. It works pretty well, but is fairly plain compared to the maps that Minecraft produces. I imagine Notch does a lot more than just Perlin noise.

In my game I use 2D Perlin noise to generate the basic flow of the landscape. Then do some carving with another grid of 2D Perlin noise to make a more rugged look. Then I carve tunnels using a wandering path through the terrain.

Perlin noise is a pretty standard way to go:

https://stackoverflow.com/questions/4753055/perlin-noise-generation-for-terrain

Then this guy Paul Martz has an application that makes such maps, and the source code for doing so.

http://www.gameprogrammer.com/fractal.html

There's also a nice article in Game Developer that goes into procedurally generating voxel terrain. It goes into 2D height maps, and 3D noise for generating maps.

There is an article in the April issue on page 21 (Creator of Worlds) That's rather good, however it looks like it's paid access if you don't already have a subscription.

House
  • 73,224
  • 17
  • 184
  • 273
2

I'm a little confused about what you're trying to do. If you represent your terrain as a single 2D heightmap, then you won't be able to form the same kind of terrain as minecraft, as it is a 3D voxel terrain (i.e. arbitrary placement of cubes anywhere in 3D).

One benefit of voxels is that you can have overhangs and tunnels and floating blocks, which are all impossible with a heightmap like you describe.

In terms of minecraft, a single 2D texture can only provide you with information about a single layer of blocks.

If you really do want to create a 2D heightmap, Vue has excellent tools for doing so. (Although it is quite expensive.)

If you want to generate an interesting 3D terrain from scratch consider this often quoted GPU Gems article: Generating Complex Procedural Terrains Using the GPU, and simply ignore all the hard parts of generating a mesh from the voxels, and just use the voxel generation method by itself (just a combination of trig functions).

Texture colors can be generated based on slope and height.

fospathi
  • 149
  • 4
Olhovsky
  • 3,519
  • 1
  • 24
  • 31
  • 1
    Incorrect. A single 2D height map has 3 dimensions of information, each pixel has an X, a Y and a color. So for example, when the color is white the height of that area is 0, when the color is black the height is the map maximum, everywhere in between is a different height. – House May 13 '11 at 16:55
  • 2
    I didn't say that a heightmap doesn't have 3 pieces of information. Read my answer again. I said that all you can represent with a heightmap is a single layer of blocks laid out in 3D. To have 10 layers of blocks, you would need 10 height maps. This is why games like minecraft do not use heightmaps to represent the data. – Olhovsky May 13 '11 at 16:57
  • You can have a look at my own procedural terrain here if you want to be convinced that I'm not just making things up: http://www.olhovsky.com/category/dbp2011/ – Olhovsky May 13 '11 at 16:58
  • Think of it this way each pixel has 0-255 values available. If the value was 120, you would put a cube into spaces 0 through 120. The pixel value defines the height of a column of blocks. – House May 13 '11 at 17:02
  • Consider that DirectX has 3D textures as well as "regular" textures (also called 2D textures in this article): http://msdn.microsoft.com/en-us/library/bb205133%28v=vs.85%29.aspx The pictures there might help you visualize the difference. – Olhovsky May 13 '11 at 17:02
  • Byte56: It can only represent one block in that column. Then you are just filling in everything underneath. Sure you can do that, but you lose one of the benefits of voxels, as per my answer. – Olhovsky May 13 '11 at 17:04
  • 1
    A 3D texture contains 4 dimensions of information, a position in 3D space AND a color. – House May 13 '11 at 17:05
  • If you want to represent multiple blocks in the column (instead of just always filling in the whole column), then you'll need multiple heightmaps stacked on top of one-another. – Olhovsky May 13 '11 at 17:05
  • Byte56: Yes, a 3D texture contains 4 pieces of information. So what? Technically you can represent many pieces of information in a 3D texture. It has several color channels. It has many bits per color, etc. – Olhovsky May 13 '11 at 17:05
  • 1
    You don't lose the benefits of voxels. Sure, you're not utilizing all the benefits (when using a single height map), but you're not losing any. Clearly height maps are not the ONLY answer, further deformations, tunnel carving, etc. are required. – House May 13 '11 at 17:08
  • Sure, you're not utilizing all the benefits, but you're not losing any. Are we just arguing about semantics now? If you're not using all of the benefits, then isn't that pretty much the same as "losing" one or more benefits? – Olhovsky May 13 '11 at 17:11
  • The point is that creating a tunnel using a single heightmap is very very difficult compared to storing the voxels in a 4D array of some kind -- so it is unusual to talk about 2D heightmap textures and voxels at the same time. – Olhovsky May 13 '11 at 17:13
  • I'm not arguing. It's clear you're not losing the benefits. If you were losing the benefits, then you wouldn't be able to utilize them in the future, obviously you are. I also didn't recommend using a height map for creating a tunnel. I recommend using a height map for creating a land-like surface that can then be conditioned with other methods to produce the desired results. – House May 13 '11 at 17:19
  • OH. You're suggesting that we use a 2D texture to start the terrain, and then go from there. Okay, that's pretty valid. It's not what I would do (nor is it what Minecraft does IIRC), but it's a good place to start. – Olhovsky May 13 '11 at 17:23
  • Yep, sorry that wasn't clear. I updated my post with a article from Game Developer, it's pretty good and goes into both 2D and 3D "height maps". – House May 13 '11 at 17:29
  • The link is broken :( – Olhovsky May 13 '11 at 17:58
  • Updated, might not work for long! Save it to disk :) – House May 13 '11 at 18:05
  • Sadly you can't save it to disk. It lets you view a few pages before kicking you out. Or maybe the link is just dead again :P – Olhovsky May 13 '11 at 18:48
  • Bummer, sorry! Could be worth buying the digital download. It was a fairly good article. – House May 13 '11 at 19:12
2

World Machine

http://www.world-machine.com/

World Machine has a non-commercial free version which only has a few limitations compared to the commercial version. I can't speak highly enough about this software.

Produces both a heightmap and texturemap procedurally.

I used it to create the island and texturemap for this techdemo

USC GamePipe Island Tech Demo "Paradise"

Forget what you know about editing terrains. Unlike many other terrain editors that function like paint programs, World Machine operates on a procedural level. A World Machine world file is not the terrain, but the steps that creates the terrain. This is the source of both its power and its complexity.

When working in World Machine, your role is to determine the overall appearance and characteristics of the terrain, and then allow the generators and effects to create and detail the appearance of your world. This way of working and thinking at a higher level takes some getting used to, but the rewards are huge: You can create impressive terrains with relatively little work, and once you have created a terrain that you like, you can use the same world file with different random "seeds" to produce a different terrain with the same feel.

David Young
  • 3,310
  • 1
  • 22
  • 41