Organization of 3D game scenario data

Source: Internet
Author: User

The most important part of 3D games is the organization of scene data, which determines the speed of this 3D game, it also determines the quality of a 3D Game (because the faster the game is, the more special effects can be added ). The organization of scene data determines the dynamic balance of memory, visual tailoring, low-level granularity calculation, collision detection, communication, and other sequence of items that are the most important and fundamental thing for games, therefore, we need to develop an effective data structure to save our 3D scenarios. Let's take a simple look at these technologies.

3D scenarios are divided into indoor and outdoor scenarios. The two are completely different in terms of data organization and optimization, which is determined by their characteristics. The following compares their similarities and differences:

1,The indoor scene is small and the object is very close to the observer. Therefore, there is basically no need to use the level-of-detail (d) technology, but the alternative technology can be used;

The outdoor scene is large, and the contribution of objects in the distance to the observer is very small or even negligible. Therefore, we can use the level of detail technology and alternative technology.

2,There are a lot of large blocks in indoor scenarios. Even small blocks can cover large objects because they are very close to the observer, and the connection between indoor scenes is often limited, that is to say, we can only observe each other through some holes, so we can use portal technology and PVS technology;

In outdoor scenarios, objects are relatively scattered and scarce. In addition, the terrain and objects in the distance are processed with the level of detail (SLS), and there are not many polygon, but still need to be tailored, because there are still many buildings and trees distributed in the wild, at this time, we need to use horizon or hom technology, especially in outdoor scenarios in the city. However, we need to use horizon tailoring Technology of 2.5D, we can also use the backend encryption and fog provided by the hardware to achieve high performance.

3,In indoor scenarios, precise collision detection is generally required. BSP is used for this to achieve high efficiency;

Outdoor scene collision detection is relatively simple. collision with the ground, bridge, Castle, tree, etc. can be simplified to collision with a triangle or surrounded body.

4,Indoor scenarios are generally static, because they do not need to have a dashboard, so they can be organized into static data structures, such as bsp;

Outdoor scenarios are generally dynamic, because they use dbrs, so we can either dynamically generate scenarios, such as roam And vdmp, or use the block dump splicing technology. For these reasons, we can only organize the outdoor scenes into a quad-tree or an Ock-tree, which may not contain data. They are only used for tailoring.

5,There are few special effects in indoor scenarios, such as opening, turning off, fire, and explosion. Therefore, simple data structures can be used in most cases;

There are many special effects in outdoor scenarios, as well as the movement of solar light sources, weather, natural phenomena, day and night. These require a large amount of textures and complex data structures to back up.

6,Finally, it is hard to imagine that a small room in the room is crowded with 100 people. In the room, 100 people are very common in one scenario, this is a serious test of data communication and shielding, which also determines the differences between the indoor engine and the outdoor engine.

In the game, both the indoor and outdoor engines exist at the same time and they will be used at the same time, such as standing in the room and looking at the mountains in the distance through the window. How can we connect them? It can be manually or automatically completed by the editor you wrote. It is very difficult to automatically complete, so it is generally done manually.

Next we will introduce the organizational structure of an effective scenario. It may not be the best, but it is completely practical.

Outdoor engine:

An outdoor map is generally expressed as a height field, that is, a bitmap. Although there are mountains and lakes, they are relatively flat because the map is generally large, and we only care about large-scale tailoring, therefore, we use the toy tree to map the table rather than the toy tree. This toy tree not only covers the map, but also saves the buildings and trees on the map in the node, water and other objects, but do not contain dynamic objects (will move freely)

This quad-tree can also be used to implement

Indoor engine:

We use the portal to connect to each room. In this way, we can use the portal engine to express the scenario, and also use PVS. For small rooms, we use BSP directly, for rooms with large objects, we use the octree to indicate that each node in the tree has a small BSP tree, which makes collision detection more efficient.

Connection between the indoor engine and the outdoor engine:

Because the indoor engine uses the portal engine and the portal is used in the outdoor environment, we can place these portals to the nodes of the outdoor engine's quad-tree, in addition, it is indicated in the portal that the portal is connected between the interior and the exterior. During rendering, you need to switch the engine.

PortalGeneration:

A major problem with the indoor engine is how to generate a portal. Is it manually specified or a program? This is a trade-off problem. Manual designation is a waste of manpower and prone to errors, but it can achieve good results. It is easy to specify the program, but it encounters a large number of triangles, this will be a disaster, resulting in a lot of portals, and the efficiency will decrease in computing tailoring. After research, we found that the advantage of AI is that it can find a suitable portal, and the program is to generate. We combine these two advantages, the following half-human half-procedure is created: When a scenario is generated, the system manually specifies which objects are in the room, and then the program hides all objects other than these objects, then, the traditional portal generation method is used to calculate the portal.

Dynamic Object Management:

Dynamic objects include: People, monsters, transportation tools, magic and weapons from various people or monsters, bodies left on the ground after they die.

The above indoor and outdoor engines did not talk about how to handle moving objects. There are many ways to do this. One is to place these objects in the nodes of the engine's data structure, then, the local update technology is used to dynamically move them between nodes, which can effectively use the benefits of these structures, such as occlusion, and directly find the collision source, the disadvantage of this technology is that it is too complicated. Another way is to create an envelope Hierarchy Tree for these objects, such as a spherical tree, which is used to crop them, however, this technology does not cover any possible areas where information and collision needs to be calculated. The disadvantage of this technology is that it is slow.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.