I am a technical artist TA responsible for the direction of procedural generation. My personal interest is mainly in the direction of automatic generation of large world scenes .
In the past, scene production basically relied on the free play of art, so although the artistic creativity of art can be better utilized, it requires a lot of labor to stack resources, and once the scene design is modified, the art resources of the entire scene are basically required. Tear down and redo, so the development efficiency and modification cost of traditional scene production are relatively high.
In order to speed up the production efficiency of the scene, the procedural generation technology has become the only choice, which is also one of the emerging technologies that I am most concerned about.
In the process of procedural generation, the procedural TA is mainly responsible for the design of module splitting, the sampling of generation rules, the realization of generation algorithms, and the construction of programmatic generation tool flow.
Based on the data source, many things can be made by procedural generation, such as the generation of terrain, rivers, vegetation, infrastructure (roads, bridges, buildings, blocks), atmosphere (such as materials affected by acid rain) corrosion, building dirt from top to bottom), etc.
In short, procedural generation technology can automatically generate the entire scene with only a small amount of curve data and module resources required .
How does programmatic generation work? It is mainly divided into several steps.
The first step is to obtain data sources , such as the distribution of rivers, the contours of lakes, the distribution of roads, the contours of buildings, etc. This part can generally be expressed in the form of curves + attributes.
The terrain is generally described by a uniform grid + height map, and the grid is generally generated by the engine runtime, so how to generate the terrain is actually how to generate this height map.
If it is based on real map data, the DEM data (Digital Elevation Model) of the corresponding area can be downloaded online, or it can be generated iteratively through algorithms, such as noise map overlay, thermal erosion, water erosion and other algorithms for fitting.
The length and direction of roads and rivers can be represented by curves. Data such as name and width can be obtained through the attributes of each segment, as well as the high and low trends of the terrain, and the road model and river model can be generated programmatically. The influence of some constraints on the terrain should also be considered when generating. For example, in rolling mountains and forests, the road is always flat, and the slope cannot exceed a certain threshold.
Buildings and lakes can obtain their position in the scene through the closed curve, determine the generation style of the building through the type attribute, and obtain how many floors the building has through the height attribute.
There are generally two sources of curve data, one is the game scene based on real map data (for example, map data can be downloaded through OpenStreetMap). Another way is to lay out the road network by manually editing the curves yourself.
The second step is to complete the data. In addition to filling by manual editing, there are some ways to automatically fill in the data.
For example, through road network data, we can divide the map into multiple blocks, and we can design our own algorithm to fill each block with buildings. In addition to considering the distribution method of buildings (such as office buildings, we can adopt the distribution along the street, single-family buildings). Buildings can be distributed centrally), and different types of buildings with different heights (such as commercial areas, residential areas) can be matched according to the type of blocks, and finally the “gap” formed between the buildings can obtain the data information of the path.
For another example, point cloud data of vegetation distribution can be generated by combining the elevation information of the terrain, the distribution information of the water area, the landform information, and the urban distribution information. If you are not satisfied with the generated results, you can also manually control the distribution area and types of vegetation by brushing the range.
The third step is to algorithmically transform the data into a 3D model. There are two generation methods. One is to generate an independent model through an algorithm. This method is more suitable for the generation of special models in the game, such as irregular intersections and guardrails with relatively large radians.
The other is to use pre-prepared assets to distribute the model on the corresponding point cloud data according to certain rules. For example, a point cloud such as grass, trees, and street lights represents an object. Or similar to building modules, a set of point cloud data represents an object, as shown in the figure:
The walls of large building facades can be created by splicing several modules. The advantage of this splicing method is that it can save the resources of models and textures, and Instance Draw can be used to draw in the game, thereby reducing the overhead of real-time rendering.
The fourth step is the filling of scene decorations and the filling of environmental atmosphere , such as building pendants, street lights on the street, guardrails, etc. All of these can be generated by sampling some distribution rules and automatically scattering points.
For example, if a designer wants to express a scene of the end of the world, he can generate some environmental elements for the scene according to the trend of the terrain. For example, some moss can be generated on the flooded road, and vines can be generated on the building. According to different seasons , vegetation color, density can be adjusted, vegetation in areas hit by tsunami, simulation of terrain damage, etc.
In the direction of procedural generation of the big world, the most impressive content for me recently is “The Matrix Awakens: Unreal Engine 5 Experience” launched by Epic Games.
This technical demo introduces a complete set of procedural generation solutions for modern cities based on Houdini. It not only considers how to restore the effect of real objects, but also considers how to use a more economical way to achieve the effect, thereby reducing performance and cost. pressure on resources.
For example, in building generation, it introduces a complete set of solutions for how to generate modern buildings, including how to reasonably dismantle building modules, how to splicing buildings, how to use Instance Draw to reduce rendering pressure, and some production methods. Small tricks to prevent module interpenetration, such as processing of acute angle and obtuse angle building corner modules, use a common link angle to eliminate the phenomenon of interpenetration that may be caused by model splicing.
For example, in terms of material production, it introduces how to realize the effect of depth-based 3D fake indoor. Not only the performance effect can simulate the real indoor scene, but also from the perspective of performance, a single material rendering is used to replace the model rendering of the real 3D indoor field. , which effectively reduces the performance overhead.
The Unreal Store also gave the resource package of this project, and you can directly view all the resources of the project and related plug-ins produced by procedural generation. Through in-depth analysis of this project, it can help us to understand how to use an industrialized way to produce 3A-quality games, and at the same time, we can practice how to generate new worlds by ourselves.
Finally, imagine the future of this technology. The current industrial production is still mainly in the stage of developer application. In the future, if the generation algorithm of Houdini is moved to the game engine, combined with the characteristics of real-time lighting and GI, this editor function can be transformed into a DIY one for players. Game features, such as building a system with greater freedom, custom level design, etc. Let players experience the thrill of producing high-quality scenes.
For TA, I personally feel that there are several directions for further research:
1. How to speed up the algorithm so that the generation work that usually takes several minutes can be completed in seconds or even milliseconds. For example, you can consider moving the algorithm to ComputeShader and use the parallelism of the GPU for acceleration. You can also consider using multi-threading, block and other methods to divide the super-large tasks that need to be calculated into smaller task blocks for multiple processing.
2. How to turn boring editing tools into fun. On the one hand, the editing method is considered to be more suitable for the player’s usage habits. On the other hand, some dynamic effects can be added during editing, such as adding some trailing effects when drawing lines, adding some interesting appearance methods when generating objects, etc.
Source: Zhihu www.zhihu.com
Author: AllenP
[Zhihu Daily] The choice of tens of millions of users, to be a big cow of new things in the circle of friends.
click to download
There are 8 more answers to this question, see all.
Further reading:
What will the tuyere sharing project do in 2022?
This article is reproduced from: http://www.zhihu.com/question/534520143/answer/2504050253?utm_campaign=rss&utm_medium=rss&utm_source=rss&utm_content=title
This site is for inclusion only, and the copyright belongs to the original author.