Sign in to follow this  

Which is the best format to use on terrain maps?

This topic is 3832 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

This topic is 3832 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this