Advertisement Jump to content
Sign in to follow this  
oenda

Terrain or 3d model with physics?

This topic is 1778 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

Hi.I want to know that how game developers create a 3d world?For example Skyim.Are they using terrain algorithms and create a terrain?Or they create a 3d model with 3ds Max/Blender then add physics?I am waiting for your reply smile.png

 

Share this post


Link to post
Share on other sites
Advertisement

Skyrim (and Oblivion) are both based on heightmaps made with a heightmap editor. However, only a fairly small area around the player is rendered this way. For more distant terrain they use 3D models derived from the heightmap data, to reduce the number of polygons for different LODs.

 

If you own a copy of Skyrim (or Oblivion) it's really easy to see how they do it - just open the console and enter:

 

tcl

twf

 

The first command allows you to fly around, and the second shows wireframe view.

Edited by mark ds

Share this post


Link to post
Share on other sites

"A lot" is very vague. More, for sure.

Height maps allow you to reduce the memory required for each vertex: instead of having xyz vertices you can go along with xy vertices, with z pulled from the heightmap.

On top of that, the same "heightmap sampling" mesh can be reused for each chunk.

As a fact, in many cases it is possible to just build the vertices procedurally so you don't even need xy at all.

Share this post


Link to post
Share on other sites

Here's Skyrim showing how it's done (for those that don't own the game)

 

[attachment=20202:ScreenShot5.jpg]

 

[attachment=20201:ScreenShot4.jpg]

 

Whiterun is centre bottom, and is surrounded by a high-res mesh with samples taken from the heightmap. The rest is made from 3D models.

Share this post


Link to post
Share on other sites

Skyrim (and Oblivion) are both based on heightmaps made with a heightmap editor. However, only a fairly small area around the player is rendered this way. For more distant terrain they use 3D models derived from the heightmap data, to reduce the number of polygons for different LODs.

I thought the map in Skyrim was very clever.

 

They basically thought "See all the lower level LODs rendered in Oblivion? What if we make a map out of them?". It is just like that, the ingame map just renders the lowest detailed terrain meshes and lays them up so you can get an overview of them.

 

Compute LOD for the entire game and get a very cool map for free.

 

One particular thing about Skyrim/Oblivion is that Bethesda pre computed the LOD levels of the terrain, you don't have any fancy algorithm to generate lower detailed meshes at runtime,¡ but it streams the lower LODs from disk as needed. World is divided on squared cells so you have the cell the player is currently on, a few surrounding cells loaded at full detail so the player can see enemies at some distance, and the rest is lower detailed meshes.

 

Skyrim also caches "interior cells", I think it was the last 2 or 3 that you visited, so you don't hit full reload time if you say, got out of a shop forgot to buy something so you head back again.

 

While terrain level of detail varies a lot, I think items and actors not. When you see an enemy at 200m, it has fully detailed meshes (armor, weapons, body, etc). 

 

In games like Mount & Blade where having many actors in screen is crucial (ie, 200 vs 200 battle), there are various levels of detail for everything, from landscape rocks, to armor, weapons and body meshes.

Share this post


Link to post
Share on other sites

Skyrim (and Oblivion) are both based on heightmaps made with a heightmap editor. However, only a fairly small area around the player is rendered this way. For more distant terrain they use 3D models derived from the heightmap data, to reduce the number of polygons for different LODs.

 

If you own a copy of Skyrim (or Oblivion) it's really easy to see how they do it - just open the console and enter:

 

tcl

twf

 

The first command allows you to fly around, and the second shows wireframe view.

What would happen if the player arrived at the "once was distant terrain"? Would the level of detail changed relative to where the player is located or if the player is looking at that direction?

 

This thread is just an "eye-opener"!

Edited by warnexus

Share this post


Link to post
Share on other sites

 
In an open world with somewhat sparse vegetation (eg. real life where I live near the edge of a desert on the edge of a mountain range) I can go to one mountain peak that is about 2000 meters above the valley floor nearby. I can look out over the horizon, out over the sand dunes that disappear over the curve of the Earth, or I can look across the city in the valley and see a huge range of mountains that extends off to the distance as far as occlusion allows. I can look to a distant cliff that is almost 200km away, pay attention to a specific tree or rock face, climb down, drive across the valley while still paying attention to the tree and watch as the details and visual quality continually increase until I am standing next to it.
 
 
Open world games do all they can to simulate that kind of environment and some of them do an amazing job at it.
 
Up close many games use a height map. This is just a grayscale image. Darker pixels are lower, brighter pixels are higher. The exact resolution is going to depend on the game, maybe one pixel every 5 meters or so. This is augmented by placing 3D modeled objects on top of the terrain, rocks and boulders and grass and trees, so it doesn't look so flat.
While this works pretty well for nearby data, it doesn't work too well for the distance. Height maps for a small area can be a few kilobytes in size, sometimes a few megabytes, depending on how they map in terms of meters-per-pixel. But going back to the mountain peak example, if you want to store a very large area you are suddenly looking at hundreds of megabytes or gigabytes of heightmap data, plus their splatmaps to figure out what to draw on them.
 
Because this is basically simple pictures, the size requirements grow by the square. If you want 1 square kilometer say it takes 4KB of data. If you want 2 square kilometers it takes 16KB of data. Those aren't bad.  But if you want to see the mountains and foothills in the distance all around you, suddenly your requirements are massive. A good-sized valley (like the one I live near) may be around 1500 square kilometers, and if you want the surrounding mountains to show up you'll need to cover around 3,000 square kilometers, which at that scale is 36 gigabytes of height maps just for the nearby visible terrain . . .
Some will trade off precision . . .
Others will use a height map for nearby stuff and use a pre-rendered skybox image for distant items.
Still others will put the player into a bowl so they can't see the edge of the nearby terrain, giving a ring of actual terrain, a ring of models, and a distant skybox.
The complexity of data management and the sheer size of the content are two reasons many games shy away from large, continuous, open worlds

Very insightful post.
My game interests is basically open world and racing games. Realism is crucial and it'll be mostly PC games.
When playing a gta game and you're riding in a car, for instance. You see another car out your left side. Why is it that the car magically disappears when you look away for a second?
Imagine a 7km * 7km open world game where oceans, lakes, forests, little deserts, a city and a total npc population of 1,000,000+ is present. Isn't it possible to have a system that saves what happens because in all gta games i've played, driving through an area isn't that fun because let's say you could hit down a tree, if you came back after 30seconds - 3minutes later, you won't see a trace of that fallen tree or cars that got hit by the tree or the bodies of the people that died and that isn't realistic.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!