Jump to content
  • Advertisement
Cloooouuuud

How big 3d Engine load game level ?

Recommended Posts

1) I was wondering how the big 3d engine load game level like a 3d shooter level in Crysis or Call of duty what is it ? a heighmap ? have they made the entire level in a 3d level editor and they load it in one shot and you walk around in it or it's more loaded pieces by pieces each tower, box, wall etc ?

2) Theses games level are made with what are they created in a 3d program like 3d max, Blender or they create a specific file format with all the 3d objects in it and load that with a premade collision detection who detect where you can walk ?

3) What's the best way to manage your 3d assets graphics when your alone learning C++ and loading them in a mini 3d engine your creating ? is there library for that or its all included in Directx ?

4) Which 3d graphics API is the best to learn first when your new ? Vulkan ? Dx11? Dx12? Opengl ? Is it true its better to start with Unity3d and C# to learn the basics of 3d graphics and later on if your serious about it and when to work in the industry go the native route with C++ and learn to build everything from scratch ? (because you can't develop everything alone you need a team at one point its like making a movie)

Thanks for your time

Share this post


Link to post
Share on other sites
Advertisement

1) It depends on the game, but usually if you have duplicate objects in the world, it is only one model that is drawn multiple times. Here's a post about loading that I wrote recently: 

 

2) It starts with a 3D program, but there is usually a process that converts it from a 3D program model to a format that is more suitable for the engine.

3) There are libraries for loading of common 3D formats. I used Assimp before, (although I didn't use it with DirectX).

4) I don't know this, it depends on what you know beforehand. I guess someone with a good knowledge of 3D math and linear algebra learning a graphics API "from scratch", while someone who doesn't can benefit more from exposure to existing solutions first.

Share this post


Link to post
Share on other sites

It doesn't answer what I wanted to know, is the 3d level like a Crysis or Call of duty level a full 3d world loaded when you start and you move in it or they load everything pieces by pieces ? or another method loading the terrain and loading each object on the terrain while you move in the level like you said earlier.. take Unity3d level editor for example you can draw world with it, do you think they load that world first and load the object around the player after when the player move load others objects around him with a radius etc

Share this post


Link to post
Share on other sites

You can do any of the things you ask about, but you're not required to.  The engines do not decide which types of level loading approach you should use.

Share this post


Link to post
Share on other sites

The level is split up into chunks of geometry based on visibility (what room / area you can see from where). This was done with BSP trees traditionally, but I think now there are more advanced algorithms (Bethesda games use Umbra visibility solution library). I don't know about Vulkan or DirectX, but in OpenGL it helps to minimize number of draw calls, so chunks have to be big enough to only have a few of them in any given frame.

Share this post


Link to post
Share on other sites

Ground and vegetation
FarCry2 seems to compress forest instancing by having a pre-defined pattern of where vegetation is located within a certain tile. Then just check a compact intensity map and see if there should be a tree on a certain location. Blend maps and different compositions are commonly used to make multiple repeated textures appear like one huge texture drawn over a heightmap.

Buildings
Many open world games have low-resolution assets loaded early and only loads higher resolution textures and models when getting close. A whole city block  as an instance allow efficient rendering if you have too many draw commands to send to the GPU, but this require sorting triangles based on normals to reduce overlapping pixel drawing when you have more than one large convex shape.

Share this post


Link to post
Share on other sites
19 hours ago, Cloooouuuud said:

It doesn't answer what I wanted to know, is the 3d level like a Crysis or Call of duty level a full 3d world loaded when you start and you move in it or they load everything pieces by pieces ? or another method loading the terrain and loading each object on the terrain while you move in the level like you said earlier.. take Unity3d level editor for example you can draw world with it, do you think they load that world first and load the object around the player after when the player move load others objects around him with a radius etc

It depends on the size of the level: if you can fit everything into your memory limit, you can load everything at the start. If you can't (and most modern games can't), then you load only the important things in the beginning, and maybe low resolution version of far away things (look up "Level Of Detail"), and then when the game starts you can slowly load the rest. When you are out of memory, you unload things that you don't need right now so you can load more things that you need, that's called "streaming".

Share this post


Link to post
Share on other sites

Geometry

The biggest show-stopper are draw-calls, the more vertices fit into a mesh the better is it handled by the GPU and the faster your level. There is atechnique named static mesh baking in the major leading engines that combines meshes that never change into a set of full capacity vertex buffers (every vertex buffer has a limit so this will be split to fit into N buffers) and so produce just one draw-call at a time. The same is used for HUD/UI on AAA engines. It is less costly to change a set of vertex buffers than drawing every UI element one by one.

I have worked on a console game where every tile of the game was made as a single block or element from the original designers like drawing pixels in the 90's. After baking the whole scene in 3D Max, the game run 60% faster.

 

Vegetation

Depends on the kind of vegetation. Trees and other bigger plants are a combination of mesh and shader; they are flattened to a 2D fake tree that always 'looks' to a players location and expand into full blown 3D meshes when the player is into certain distance. This effect can be watched on The Elder Scrolls series when using a cheat to fly high, the trees below become flat at some distance.

Gras and foliage is rendered using a Geometry Shader that creates those at the player's spot to simulate endless meadow, it is also used to have it moving 'in the wind' or when the player walks through.

 

Dynamic Units

Those enemies, items and whatever is moving in the world is loaded as a flat data class in memory and simulated as long as it isn't necessary to render a full blown 3D model. When a player enters certain distance to the model, it will be loaded/shown on demand and unloaded/hidden when the distance and certain threshold is leaved.

I have worked on a car driving game where we needed to simulate a highway full of cars in both directions. We used just arround 50 - 100 models at a time to simulate traffic of 1000 or 10.000 cars per world chunk simply by putting the cars that got out of reach for the player into a pool and took those cars from the pool if they entered the visibility distance. Anything else was just a plain data description in memory

 

Conclusion

There is no real 'they did it so' answer to your question and you shouldn't refer to Crysis (or Cry Engine) anymore because they get obsolete these days. 90% of all games are made with Unity or Unreal these days except for the AAA inhouse engines big studios use. So this will always be an own research thing by case of a game

Share this post


Link to post
Share on other sites

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

  • 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!