Which is the best format to use on terrain maps?

Started by
4 comments, last by Flambergeman 16 years, 10 months ago
I want to load some terrains in my application, but which format can I use? Don't know of any good format. Just for the sprites, that in this case I'm using MS3D. I want to render a dungeon terrain here.
Advertisement
I guess you're talking about a 3d terrain ... ?

In general, terrains are just a big 2D grid of quads (example 512x512 quads) generated by the application. This grid represent basically a texture of the same size where each vertex correspond to a pixel in the texture. The pixel color is interpreted as the height of the terrain at that location. So engines are generating the mesh based only on a texture with only one channel (grayscale) called a heightmap. Different level of detail techniques are also apply to reduce the number of triangles in the areas far from the camera. But the brute force method works ok for small terrain.

We can see an example of heightmap and the resulting terrain here : http://en.wikipedia.org/wiki/Heightmap

To generate nice looking heightmap, you can use programs like:
World Machine : http://www.world-machine.com/
Terragen : http://www.planetside.co.uk/terragen/

I don't know what API you are using, but this are a lot of demo of terrain with source available on the internet

hope it helps
hum, ok, but this is for open scenarios. I want a dungeon, and so, the walls and the floor. I think I need a modeler to do that(Blender?). Or there's another way?
There are several ways to do world - terrains - levels.

Usually if your talking about a large scale outdoor scene your gonna want to use a height map for the basic structure thats just a grayscale image thats represents each pixel as a vertex. You would basicly load the image file and create the geometry inside the code by reading each pixel color which would represent the Y value of the vertex. After you have the terrain map generated you can apply textures to it.

Now, say you want to add an overhang to the world? Its not possible with just a height map alone, you would need real models ontop of the geometry or the entire world needs to be made from solid geometry.

Most games use a mix of height maps and models placed on top of the height map.

Now for strictly indoor scenes like dungeons, you don't need a massive model to represent the dungeon, in-fact thats really a wasteful way to create indoor scenes like dungeons. The best way to represent dungeons is just by making small pieces of indoor parts such as a hallway, corner, doorway. Then you arrange all these exactly how you would in a 2D tile engine. Doing it this way can open doors in procedural generation of dungeons so you dont have to break a sweat if you need to make 200 dungeons :D.

Putting all that in a map format usually calls for a custom format, or generate the heightmap in the modeler package and export everything out as one chunk of geometry your engine will render out. The only problem with dumping the entire world in 1 file is you have limited control over optimizations of the heightmap terrain since it has a large number of triangles there are ways you can batch render it to get the most speed out of it you normally couldn't if you just rendered it out.

I would recommend to just start with heightmap generation since its the simplest of all methods if you can read an image in and create basic shapes.
Quote:Original post by NegativeGeForce
Now for strictly indoor scenes like dungeons, you don't need a massive model to represent the dungeon, in-fact thats really a wasteful way to create indoor scenes like dungeons.
It's a bit more complicated than this. There's little difference between a FPS "closed" level and a dungeon. There's no rule a dungeon should be made of prefabs (and in fact, it shouldn't, unless the beings here are an extremely organized race).
Quote:Original post by NegativeGeForce
The best way to represent dungeons is just by making small pieces of indoor parts such as a hallway, corner, doorway. Then you arrange all these exactly how you would in a 2D tile engine. Doing it this way can open doors in procedural generation of dungeons so you dont have to break a sweat if you need to make 200 dungeons :D.
Some successful examples coming to mind: The Elder Scrolls 3: Morrowind (and very likely TES4: Oblivion as well).
This as said is a very compact representation but bugs (especially with lighting) seem to arise easily...
Quote:Original post by NegativeGeForce
I would recommend to just start with heightmap generation since its the simplest of all methods if you can read an image in and create basic shapes.

In that case, I suggest .png. It's well supported, features 16bit data as well and the lossless compression is interesting.

Previously "Krohm"

I'm really thinking in make a software, that do the construction work. A map editor that create a file format of my own. My dungeon is not random, or have places that are equal with each other. It is very singular in each place. Something that will generate a bunch of work. In that way, I can't use height maps.
So, I'm thinking in make a software in Qt for that.
Do you agree, disagree? :)
Thank you for the answers.

This topic is closed to new replies.

Advertisement