Game scene generation method and device, equipment and storage medium

By obtaining and adjusting the closed curve in the rendering engine, the problem of difficult to modify after the game scene is generated is solved, and the flexibility and efficiency of game scene generation is improved.

CN119303306APending Publication Date: 2025-01-14NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411336861.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-24
Publication Date
2025-01-14

AI Technical Summary

Technical Problem

The existing game scene generation methods lack modifiability after the spread point generation, and need to be recalculated through algorithms to achieve modification requirements, resulting in inefficiency.

Method used

By obtaining the closed curve based on the spreading point distribution area transformation in the rendering engine, and adjusting the closed curve in real time in the rendering engine, it can achieve rapid adjustment of the spreading point results, and non-destructive control of the placement position of the target scene object.

Benefits of technology

It realizes the ability to adjust the spreading results in real time in the rendering engine, improves the flexibility and efficiency of game scene generation, and reduces the need for algorithm recalculation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119303306A_ABST
    Figure CN119303306A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a game scene generation method, device and equipment and a storage medium, and is applied to a rendering engine, the method comprises the steps that a closed curve for a scattering point distribution area is obtained, and the closed curve is obtained through conversion based on the scattering point distribution area; performing point scattering on the interior of the closed curve to obtain a point scattering result; wherein each point in the point scattering result is used for indicating the placement position of a target scene object; and in response to an adjustment instruction for the closed curve, adjusting the point scattering result to obtain a final placement position of the target scene object. According to the method, the closed curve obtained through conversion based on the scattering point distribution area is obtained in the rendering engine, the closed curve is adjusted through the rendering engine, so that execution of scattering point logic is achieved through the rendering engine, the scattering point function is achieved in the engine, and then the scattering point result can be adjusted in real time through the rendering engine; the effect of quickly adjusting the point scattering result in the rendering engine can be achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of rendering technology, and in particular to a game scene generation method, a game scene generation device, a corresponding electronic device, and a corresponding computer-readable storage medium. Background Art

[0002] Most current games are large-world scenes. A game scene can be quickly generated through programmatic generation. In the process of programmatic generation of game scenes, algorithms are usually involved to implement regional division and point scattering of terrain in the game scene to reduce a large amount of manual operations.

[0003] However, the programmatically generated scatter points lack modifiability. After the scatter points are generated, if there is a need to modify them, they need to be recalculated by the algorithm. Summary of the invention

[0004] In view of the above problems, embodiments of the present invention are proposed to provide a game scene generation method, a game scene generation device, a corresponding electronic device and a corresponding computer-readable storage medium that overcome the above problems or at least partially solve the above problems.

[0005] The embodiment of the present invention discloses a method for generating a game scene, which is applied to a rendering engine. The method comprises:

[0006] Obtaining a closed curve for a scattered point distribution area, wherein the closed curve is obtained by converting the scattered point distribution area;

[0007] Scattering points inside the closed curve to obtain a scattering result; wherein each point in the scattering result is used to indicate a placement position of a target scene object;

[0008] In response to the adjustment instruction for the closed curve, the point scattering result is adjusted to obtain the final placement position of the target scene object.

[0009] The embodiment of the present invention further discloses a game scene generation device, which is applied to a rendering engine. The device includes:

[0010] A closed curve acquisition module, used to acquire a closed curve for a scattered point distribution area, wherein the closed curve is obtained by conversion based on the scattered point distribution area;

[0011] A point scattering module is used to scatter points inside the closed curve to obtain a point scattering result; wherein each point in the point scattering result is used to indicate the placement position of the target scene object;

[0012] The closed curve adjustment module is used to respond to the adjustment instruction of the closed curve, adjust the point scattering result, and obtain the final placement position of the target scene object.

[0013] An embodiment of the present invention further discloses an electronic device, comprising: a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program implements any one of the game scene generation methods when executed by the processor.

[0014] The embodiment of the present invention further discloses a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, any one of the game scene generation methods is implemented.

[0015] The embodiments of the present invention include the following advantages:

[0016] In an embodiment of the present invention, by obtaining a closed curve obtained based on the conversion of the point distribution area, points are scattered inside the closed curve to obtain a point scattering result for indicating the placement position of the target scene object. At this time, the point scattering result inside the closed curve can be adjusted by responding to the adjustment instruction of the closed curve, and then the final placement position of the target scene object can be obtained, thereby realizing the generation control of the game scene. By obtaining the closed curve obtained based on the conversion of the point distribution area in the rendering engine, and adjusting the closed curve by the rendering engine, the execution of the point scattering logic is realized by the rendering engine, and the point scattering function is realized inside the engine, and then the point scattering result can be adjusted in real time by the rendering engine, and the effect of quickly adjusting the point scattering result in the rendering engine can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 It is a flowchart of the steps of an embodiment of a method for generating a game scene of the present invention;

[0018] Figure 2 is a flowchart of another embodiment of a method for generating a game scene according to the present invention;

[0019] FIG. 3A to FIG. 3E is a schematic diagram of generating a scatter point distribution area provided by an embodiment of the present invention;

[0020] Figure 4 It is a schematic diagram of visual identification of the distribution area of ​​scattering points provided by an embodiment of the present invention;

[0021] FIG. 5A to FIG. 5E is a schematic diagram of generating a closed curve provided by an embodiment of the present invention;

[0022] FIG. 6A to FIG. 6B is a schematic diagram of scene object placement provided by an embodiment of the present invention;

[0023] FIG. 7A to FIG. 7B is an example diagram of closed curve adjustment provided by an embodiment of the present invention;

[0024] Figure 8 It is a structural block diagram of an embodiment of a game scene generation device of the present invention. DETAILED DESCRIPTION

[0025] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0026] The embodiment of the present invention obtains a closed curve based on the conversion of the scattering distribution area in the rendering engine, and adjusts the closed curve through the rendering engine, so that the execution of the scattering logic is implemented by the rendering engine, and the scattering function is realized inside the engine, and then the scattering result can be adjusted in real time through the rendering engine, and the effect of quickly adjusting the scattering result in the rendering engine can be achieved. Specifically, after the scattering distribution area is generated in a programmatic manner, a closed curve can be obtained based on the conversion of the scattering distribution area, and the scattering distribution area can be controlled based on the real-time adjustment of the closed curve in the rendering engine, and then the scattering result is controlled in real time, and the scattering function is realized inside the rendering engine, so as to achieve the effect of adjusting the scattering in a non-destructive manner.

[0027] Reference Figure 1 , shows a flowchart of a game scene generation method embodiment of the present invention, which is applied to a rendering engine, such as a UE engine, a Houdini engine, etc., and may specifically include the following steps:

[0028] Step 101, obtaining a closed curve for a scattered point distribution area;

[0029] The point distribution area may refer to the area to be scattered, and the point distribution area to be scattered may be implemented in a programmatic manner, and specifically may be implemented by dividing the terrain in the game scene into regions through an algorithm.

[0030] Each point in the point scattering result of the point scattering performed in the area to be scattering can be used to indicate the placement position of the target scene object. In order to adjust the point scattering result, the embodiment of the present invention can be implemented by implementing the point scattering function inside the rendering engine.

[0031] The point scattering function implemented within the rendering engine can be expressed as a real-time adjustment of the closed curve of the point scattering distribution area, thereby achieving adjustment of the point scattering result.

[0032] In some embodiments of the present invention, the closed curve of the scattered point distribution area may be obtained first, so as to adjust the closed curve later.

[0033] Specifically, the closed curve can be obtained based on the conversion of the scattered point distribution area. Specifically, after the scattered point distribution area is generated, the closed curve can be converted based on the scattered point distribution area, so that the closed curve obtained by conversion is adjusted in the rendering engine to realize the scattered point function inside the rendering engine. The specific conversion method of the closed curve is not limited by the embodiment of the present invention.

[0034] Optionally, after the closed curve is obtained, a type value may be added to the closed curve. The added type value may be mainly used to indicate the object type of the scene object placed in the distribution sub-region inside the closed curve.

[0035] In practical applications, when acquiring a closed curve, the target object type of the target scene object to be placed may be acquired, and then a closed curve of a corresponding type value may be read based on the target object type, thereby acquiring the closed curve.

[0036] Step 102, scattering points inside the closed curve to obtain a scattering result;

[0037] Based on converting the scattered point distribution area into a closed curve, the scattered point function is implemented inside the rendering engine.

[0038] The closed curve is a curve generated for the point distribution area. The points scattered in the point distribution area are expressed as points scattered inside the closed curve. The points scattered inside the closed curve, and each point in the point scattering result can also be used to indicate the placement position of the target scene object.

[0039] The curve generated for the point distribution area is a closed figure. In some embodiments of the present invention, points can be evenly scattered in the area enclosed by the curve, i.e., the point distribution area, inside the rendering engine to obtain a point scattering result. Optionally, after evenly scattering the points, the evenly scattered points can be randomly moved to disrupt the even distribution of the scattered points, thereby increasing randomness, and further increasing the randomness of the placement of the target scene object on the terrain.

[0040] Step 103, in response to the closed curve adjustment instruction, adjust the point scattering result to obtain the final placement position of the target scene object.

[0041] The point scattering function within the rendering engine is also reflected in the real-time adjustment of the closed curve of the point scattering distribution area, thereby achieving the adjustment of the point scattering result.

[0042] In some embodiments of the present invention, each point in the point scattering result of the closed curve can be used to indicate the placement position of the target scene object. At this time, the point scattering result can be adjusted in a non-destructive manner in the rendering engine by real-time adjustment of the closed curve.

[0043] In actual applications, the rendering engine can automatically make real-time adjustments to the aforementioned point scattering results by responding to adjustment instructions for the closed curve, wherein the adjustment instructions can be generated based on operations such as the movement of the closed curve by the user in the rendering engine. Specifically, the point scattering results can be controlled in real time by moving the closed curve to obtain the final placement position of the target scene object, thereby achieving the effect of adjusting the point scattering positions in the point scattering results in a non-destructive manner in the rendering engine.

[0044] In an embodiment of the present invention, by obtaining a closed curve obtained based on the conversion of the point distribution area, points are scattered inside the closed curve to obtain a point scattering result for indicating the placement position of the target scene object. At this time, the point scattering result inside the closed curve can be adjusted by responding to the adjustment instruction of the closed curve, and then the final placement position of the target scene object can be obtained, thereby realizing the generation control of the game scene. By obtaining the closed curve obtained based on the conversion of the point distribution area in the rendering engine, and adjusting the closed curve by the rendering engine, the execution of the point scattering logic is realized by the rendering engine, and the point scattering function is realized inside the engine, and then the point scattering result can be adjusted in real time by the rendering engine, and the effect of quickly adjusting the point scattering result in the rendering engine can be achieved.

[0045] Reference Figure 2 , shows a flowchart of another game scene generation method embodiment of the present invention, which may specifically include the following steps:

[0046] Step 201, generating a scatter point distribution area;

[0047] In order to adjust the point scattering result, the embodiment of the present invention can be implemented by implementing the point scattering function inside the rendering engine. The point scattering function implemented inside the rendering engine can be expressed as real-time adjustment of the closed curve of the point scattering distribution area, thereby achieving adjustment of the point scattering result.

[0048] In some embodiments of the present invention, the scattered point distribution area may be first converted into a curve portion, which is specifically manifested in that after the scattered point distribution area is generated in a programmatic manner, a closed curve may be obtained based on the conversion of the scattered point distribution area.

[0049] The point distribution area may refer to an area to be scattered, and the point distribution area to be scattered may be realized in a programmatic manner, mainly by realizing the regional division of the terrain in the game scene through an algorithm.

[0050] Optionally, for the generation of the scattered distribution area, the scene terrain of the game scene can be obtained, and then the scene terrain can be converted into a mesh body. At this time, the target terrain area in the mesh body can be eliminated to obtain the scattered distribution area.

[0051] In a specific implementation, the target terrain area to be eliminated may refer to a terrain area where a target scene object does not need to be placed, and the target scene object may refer to any virtual object in the game scene, such as vegetation, etc. Taking vegetation as an example, terrain areas where vegetation does not need to be placed may include but are not limited to roads, seas, etc.

[0052] For example, assuming that Figure 3A In the scene terrain shown in FIG. 1 , the target terrain area in the scene terrain can be removed according to factors such as roads, villages, slopes, and sea levels in the scene terrain to place a certain target scene object, so as to realize the generation of the aforementioned scene object in the scene terrain; in order to facilitate the removal of the target terrain area, the following can be Figure 3A The scene terrain shown in the figure is converted into a specific mesh, that is, Figure 3B A scene Landscape shown with multiple meshes.

[0053] The target terrain area to be eliminated may be a first target terrain area whose second mask pixel value is less than a preset first threshold, and / or a second target terrain area whose area is less than a preset second threshold.

[0054] In practical applications, the two-mask pixel values ​​of each terrain area in the grid body can be obtained, and then the first target terrain area in the grid body whose two-mask pixel value is less than the preset first threshold is eliminated to obtain the intermediate scattering distribution area. At this time, the intermediate scattering distribution area is not the final generated scattering distribution area; at this time, the area of ​​each terrain area in the intermediate scattering distribution area can be obtained, and then the second target terrain area in the intermediate scattering distribution area whose area is less than the preset second threshold is eliminated to obtain the final scattering distribution area.

[0055] Optionally, the preset first threshold may be 0.5, which may be based on Figure 3A The scene terrain shown obtains masks (masks, usually used to mark specific areas in an image) of various terrain areas, and then determines the portion of the mask area that is less than a preset first threshold, i.e., 0.5. The portion of the mask area that is less than 0.5 usually refers to an area in a binary mask where the pixel value is less than 0.5, wherein if a certain pixel value in the mask is less than 0.5, it may mean that the pixel is considered to be a background or an area of ​​no interest. Then, the first target terrain area to be removed mainly refers to the area composed of all pixels with pixel values ​​less than 0.5 in the mask image of the scene terrain, which is usually considered to be a background or an area of ​​no interest.

[0056] For example, assuming that Figure 3A The dark part of the scene terrain shown is the part where the mask area is less than 0.5. At this time, the mesh corresponding to the dark part can be culled, such as Figure 3C As shown, an intermediate dot - scattering distribution area is obtained.

[0057] After obtaining the intermediate dot - scattering distribution area, the current intermediate dot - scattering distribution area can be trimmed. The trimming mainly involves removing the second target terrain areas with areas smaller than a preset second threshold in the intermediate dot - scattering distribution area to obtain the final dot - scattering distribution area.

[0058] Specifically, in order to reduce the computational load of the rendering engine and avoid subsequent adjustments to a single closed curve affecting too many terrain areas, the intermediate dot - scattering distribution area can be divided into small terrain areas to obtain terrain blocks. Then, the area of each individual terrain block is calculated, and the terrain blocks and individual points with areas smaller than the preset second threshold are removed to obtain the final dot - scattering distribution area formed by the remaining terrain blocks.

[0059] Exemplarily, the divided terrain blocks can be as Figure 3D shown. Different terrain blocks can be identified using Node = 0~32 to calculate the areas of different terrain blocks accordingly and store / record them associatively, so as to facilitate the removal of terrain blocks with areas smaller than the preset second threshold. The associative storage / recording of some terrain blocks and their areas can be as shown in Table 1 below:

[0060] Node <![CDATA[Area(km 2 )]]> 0 2.03849 1 2.03684 2 2.05507 3 4.10581 4 4.08764 5 4.07482 6 4.06484 7 4.05892 8 2.02869 9 2.05422 10 4.11154 11 4.09928 12 4.08166 13 4.06888 14 4.06101 15 4.05617 16 4.05613

[0061] Table 1 Associative storage table of single - block area

[0062] For the removal of terrain blocks with areas smaller than the preset second threshold, it can be implemented through the following code:

[0063] / / Total area of a single block

[0064] float area_amount = 0.0; / / Initialize the variable: area_amount is used to accumulate the total area of the current terrain block;

[0065] float min_area = ch("min_area"); / / Initialize the variable: obtain the preset minimum area threshold from the parameters of Houdini;

[0066] for(int i = 0; i < nprimitives(0); i++) / / Traverse all primitives, nprimitives(0) is used to obtain the number of primitives in the current geometry;

[0067] {

[0068] float area = prim(0, "area", i); / / Obtain the area of the i - th primitive;

[0069] area_amount+=area; / / Add the area of ​​each primitive to area_amount;

[0070] }

[0071] / / Judge whether the total area of ​​the current terrain block is less than the preset second threshold

[0072] if(area_amount <min_area)

[0073] {

[0074] setdetailattrib(0,"delete",1,"set"); / / If the total area is less than the preset second threshold, set an attribute named "delete" in the detail attributes of the current geometry and set its value to 1 to mark the primitive or geometry to be deleted based on delete=1;

[0075] }

[0076] For example, the preset second threshold value may be 500m 2 At this time, the small terrain block area whose area is smaller than the preset second threshold can be eliminated, and the final point distribution area obtained after elimination can be as follows Figure 3E It should be noted that the specific value of the preset second threshold value can be adjusted and set according to the effect, and the embodiment of the present invention does not limit this.

[0077] In a preferred embodiment of the present invention, in order to prevent the subsequent adjustment of a single closed curve from affecting too many terrain areas, the scattered point distribution area can be divided into multiple distribution sub-areas, so that different distribution sub-areas can be controlled by different curves, and the distribution sub-areas controlled by different closed curves are separated. Specifically, after obtaining the scattered point distribution area, each terrain area in the scattered point distribution area can be divided to obtain multiple distribution sub-areas.

[0078] For example, in order to facilitate the subsequent existence of more closed curves for control in the rendering engine, the embodiment of the present invention converts the following Figure 3E When segmenting the large scattered point distribution area shown in the figure, the clustering calculation nodes provided in Houdini can be used to divide the Figure 3E The total area of ​​the scattered point distribution area is divided by a preset third threshold, for example, 5000m 2 At this time, the distribution area can be divided into areas of 5000m 2 The resulting multiple distribution sub-areas are 5000m 2The multiple distribution sub-areas can be the calculation results of the cluster obtained with the help of Houdini.

[0079] Optionally, after segmenting to obtain multiple distribution sub-regions, such as Figure 4 As shown, each distribution sub-area can be marked with different colors. Different colors can be used for visual classification marking to distinguish different contour lines of different distribution sub-areas, and then define the type value of the closed curve subsequently generated by different distribution sub-areas, so as to achieve the independence of the distribution sub-areas controlled by different closed curves.

[0080] Step 202, obtaining a closed curve based on the point distribution area conversion;

[0081] The point scattering function implemented within the rendering engine can be expressed as a real-time adjustment of the closed curve of the point scattering distribution area, thereby achieving adjustment of the point scattering result.

[0082] In some embodiments of the present invention, a closed curve can be obtained based on the conversion of the scattered point distribution area. Specifically, after the scattered point distribution area is generated, a closed curve can be obtained based on the conversion of the scattered point distribution area, so that the closed curve obtained by conversion can be adjusted in the rendering engine to realize the scattered point function inside the rendering engine.

[0083] Optionally, the contour lines of each distribution sub-area in the scattered point distribution area can be obtained, and then the contour lines are smoothed, and the contour points of the smoothed contour lines are resampled (which can be normal surface subdivision), and then the target contour points located in the contour line part where the degree of directional change is less than a preset degree are eliminated to obtain a closed curve (that is, points in the area where the direction does not change much are eliminated to obtain the final curve, where the degree of directional change can be determined based on the angle between adjacent contour points).

[0084] For example, for Figure 4 For each distribution sub-region marked with different colors, the contour line of each distribution sub-region can be obtained. Suppose a distribution sub-region is as follows Figure 5A As shown, the distribution sub-area is usually polygonal, and the following can be obtained: Figure 5B The contour line of the polygon shown in the figure is too rigid, so the contour points on the contour line can be smoothed. The smoothing process can be expressed as smoothing and deletion operations on the contour points on the contour line, so that the closed curve output later can be better controlled and adjusted; for the contour line after smoothing, the contour points can be resampled. Figure 5C The contour points shown above may refer to resampling points, and the resampling strategy may be normal surface subdivision, which is not limited in the embodiment of the present invention.

[0085] After obtaining the contour line with the resampled points, the target contour points located in the contour line part where the direction change degree is less than the preset degree can be eliminated, that is, the points in the area where the direction change is not large can be eliminated, and the following can be obtained: Figure 5D The closed curve shown.

[0086] Optionally, the degree of change in direction of a contour line portion can be determined based on the size of the angle between adjacent contour points, that is, when the angle between adjacent contour points is less than a preset angle threshold, it can be determined that the degree of change in direction of the contour line portion formed by the adjacent contour points is less than a preset degree, and at this time, one of the adjacent contour points located on the aforementioned contour line portion can be removed. For the method of removing points in an area with little change in direction, other methods can also be used, and the embodiments of the present invention are not limited to this.

[0087] It should be noted that for Figure 4 Each distribution sub-area marked by color in the figure is subjected to the above-mentioned contour smoothing, resampling and point elimination processes, and the following is obtained: Figure 5E The effect shown.

[0088] Step 203, adding a type value to the closed curve;

[0089] Optionally, after obtaining the closed curve, a type value can be added to the closed curve. The added type value can be mainly used to indicate the object type of the scene object placed in the distribution sub-area inside the closed curve, so that the subsequent rendering engine can read the corresponding closed curve based on the type value when placing a scene object.

[0090] For example, a closed curve may be tagged to define a type value of the closed curve, so that a subsequent rendering engine can read the closed curve for placing different scene objects. For example, a closed curve for placing vegetation may have a type value of tag=greentree.

[0091] Step 204, obtaining the target object type of the target scene object to be placed, and reading a closed curve of a corresponding type value based on the target object type;

[0092] In some embodiments of the present invention, when there is a need to place a scene object, that is, there is a need to generate a target scene object in the game scene terrain, the target object type of the target scene object to be placed can be obtained to read a closed curve of the corresponding type value based on the target object type.

[0093] For example, assuming that the target scene object to be placed is vegetation, the rendering engine can read a closed curve with tag=greentree.

[0094] Step 205, scattering points inside the closed curve to obtain a scattering result;

[0095] When reading a closed curve of a corresponding type value, curve data can also be obtained. The curve data may include but is not limited to the terrain area enclosed by the curve. At this time, points can be scattered inside the closed curve to achieve point scattering within the terrain area and obtain a point scattering result.

[0096] In some embodiments of the present invention, points may be evenly scattered in the area enclosed by the aforementioned curve, i.e., the point distribution area, inside the rendering engine to obtain a point scattering result. Optionally, after evenly scattering the points, the evenly scattered points may be randomly moved to disrupt the even distribution of the scattered points, thereby increasing randomness, and further increasing the randomness of the placement of the target scene object on the terrain.

[0097] Among them, each point in the scattering result can be used to indicate the placement position of the target scene object.

[0098] For example, Fig. 6A As shown, the scattering result can be projected onto the scene terrain, where the scattering result can refer to Fig. 6A Each block in the image can be used to indicate the placement position of the target scene object. The target scene object is vegetation or trees. At this time, the vegetation or trees can be placed according to the position of the blocks. During the placement process, some positions can be randomly moved, and the size of the scene object can be randomly scaled to obtain the following: Figure 6B The rich game scenes shown.

[0099] Step 206, in response to the closed curve adjustment instruction, adjust the point scattering result to obtain the final placement position of the target scene object.

[0100] The point scattering function within the rendering engine is also reflected in the real-time adjustment of the closed curve of the point scattering distribution area, thereby achieving the adjustment of the point scattering result.

[0101] In some embodiments of the present invention, each point in the point scattering result inside the closed curve can be used to indicate the placement position of the target scene object. At this time, the closed curve can be adjusted in real time to achieve the effect of adjusting the points in a non-destructive manner in the rendering engine.

[0102] In actual applications, the rendering engine can automatically make real-time adjustments to the aforementioned point scattering results by responding to adjustment instructions for the closed curve, wherein the adjustment instructions can be generated based on operations such as the movement of the closed curve by the user in the rendering engine. Specifically, the point scattering results can be controlled in real time by moving the closed curve to obtain the final placement position of the target scene object, thereby achieving a non-destructive point scattering adjustment effect in the rendering engine.

[0103] In the specific implementation, for Figure 6B The rendering engine can execute the following logic inside the generated result: respond to the closed curve adjustment instruction, re-scatter points inside the adjusted closed curve to obtain the final placement position of the target scene object, that is, when the closed curve is adjusted, the final placement position of the target scene object is obtained. Fig. 7A The closed curve shown is moved, assuming that Fig. 7A The closed curve moves to Figure 7B When the closed curve shown in the figure is moved, the scattering logic will be re-executed for the closed curve to regain the placement position of the vegetation or trees, so as to achieve rapid adjustment within the rendering engine, and then place the vegetation or trees at the adjusted scattering position to achieve the generation of vegetation on the terrain of the game scene.

[0104] It should be noted that the game scene generation method provided by the embodiment of the present invention is not limited to the generation of vegetation on the terrain of the game scene, but can also be applied to the distribution and generation control of other scene objects in the game scene, which is not limited by the embodiment of the present invention.

[0105] In an embodiment of the present invention, by obtaining a closed curve obtained based on the conversion of the scattering distribution area in the rendering engine, and adjusting the closed curve by the rendering engine, the execution of the scattering logic is implemented by the rendering engine, and the scattering function is realized inside the engine, and then the scattering result can be adjusted in real time by the rendering engine, and the effect of quickly adjusting the scattering result in the rendering engine can be achieved. Specifically, after the scattering distribution area is generated in a programmatic manner, a closed curve can be obtained based on the conversion of the scattering distribution area, and the scattering distribution area can be controlled based on the real-time adjustment of the closed curve in the rendering engine, and then the scattering result can be controlled in real time, and the scattering function is realized inside the rendering engine, so as to achieve the effect of adjusting the scattering in a non-destructive manner.

[0106] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

[0107] Reference Figure 8 , shows a structural block diagram of an embodiment of a game scene generation device of the present invention, which is applied to a rendering engine and may specifically include the following modules:

[0108] A closed curve acquisition module 801 is used to acquire a closed curve for a scattered point distribution area, wherein the closed curve is obtained by converting the scattered point distribution area;

[0109] The point scattering module 802 is used to scatter points inside the closed curve to obtain a point scattering result; wherein each point in the point scattering result is used to indicate the placement position of the target scene object;

[0110] The closed curve adjustment module 803 is used to respond to the closed curve adjustment instruction, adjust the point scattering result, and obtain the final placement position of the target scene object.

[0111] In some embodiments of the present invention, before obtaining the closed curve for the scattered point distribution area, the apparatus provided by the embodiment of the present invention may further include the following modules:

[0112] The closed curve conversion module is used to generate a scattered point distribution area, and obtain a closed curve based on the scattered point distribution area.

[0113] In some embodiments of the present invention, the closed curve conversion module may include the following submodules:

[0114] The scatter point distribution area generation submodule is used to obtain the scene terrain of the game scene, convert the scene terrain into a grid body, and eliminate the target terrain area in the grid body to obtain the scatter point distribution area.

[0115] In some embodiments of the present invention, the point distribution area generation submodule may include the following units:

[0116] The point scattering distribution area generation unit is used to obtain the two-mask pixel value of each terrain area in the grid body; eliminate the first target terrain area in the grid body whose two-mask pixel value is less than the preset first threshold value to obtain the intermediate point scattering distribution area; obtain the area of ​​each terrain area in the intermediate point scattering distribution area; eliminate the second target terrain area in the intermediate point scattering distribution area whose area is less than the preset second threshold value to obtain the final point scattering distribution area.

[0117] In some embodiments of the present invention, after obtaining the scattering distribution area, the scattering distribution area generating submodule may further include the following units:

[0118] The color identification unit is used to segment each terrain area in the scattered point distribution area to obtain multiple distribution sub-areas; and to identify each distribution sub-area with a different color.

[0119] In some embodiments of the present invention, the closed curve conversion module may include the following submodules:

[0120] The closed curve conversion submodule is used to obtain the contour lines of each distribution sub-area in the scattered point distribution area; smooth the contour lines; resample the contour points of the smoothed contour lines; and eliminate the target contour points located in the contour line part where the direction change degree is less than a preset degree to obtain a closed curve.

[0121] In some embodiments of the present invention, after obtaining the closed curve, the closed curve conversion module may further include the following submodules:

[0122] The type value adding submodule is used to add a type value to the closed curve; the type value is used to indicate the object type of the scene object placed in the distribution sub-area inside the closed curve.

[0123] In some embodiments of the present invention, the closed curve acquisition module 801 may include the following submodules:

[0124] The closed curve acquisition submodule is used to acquire the target object type of the target scene object to be placed; and read a closed curve of a corresponding type value based on the target object type.

[0125] In some embodiments of the present invention, the closed curve adjustment module 803 may include the following submodules:

[0126] The point scattering result adjustment submodule is used to respond to the adjustment instruction of the closed curve and re-scatter points inside the adjusted closed curve to obtain the final placement position of the target scene object.

[0127] In an embodiment of the present invention, the game scene generation device provided by the embodiment of the present invention obtains a closed curve obtained based on the conversion of the scattering distribution area, scatters points inside the closed curve, and obtains a scattering result for indicating the placement position of the target scene object. At this time, the scattering result inside the closed curve can be adjusted by responding to the adjustment instruction of the aforementioned closed curve, and then the final placement position of the target scene object can be obtained, thereby realizing the generation control of the game scene. By obtaining the closed curve obtained based on the conversion of the scattering distribution area in the rendering engine, and adjusting the closed curve by the rendering engine, the execution of the scattering logic is realized by the rendering engine, and the scattering function is realized inside the engine, and then the scattering result can be adjusted in real time by the rendering engine, and the effect of quickly adjusting the scattering result in the rendering engine can be achieved.

[0128] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0129] An embodiment of the present invention further provides an electronic device, including:

[0130] It includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, the various processes of the above-mentioned game scene generation method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0131] An embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the above-mentioned game scene generation method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0132] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0133] It will be appreciated by those skilled in the art that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0134] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0135] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0136] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0137] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.

[0138] Finally, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0139] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0140] The game scene generation method, the game scene generation device, the corresponding electronic device and the corresponding computer-readable storage medium provided by the present invention are introduced in detail above. The principles and implementation methods of the present invention are explained in this article using specific examples. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A method for generating a game scene, characterized in that: Applied to a rendering engine, the method comprises: Obtaining a closed curve for a scattered point distribution area, wherein the closed curve is obtained by converting the scattered point distribution area; Scattering points inside the closed curve to obtain a scattering result; wherein each point in the scattering result is used to indicate a placement position of a target scene object; In response to the adjustment instruction for the closed curve, the point scattering result is adjusted to obtain the final placement position of the target scene object.

2. The method according to claim 1, characterized in that Before obtaining the closed curve for the scattered point distribution area, the method further includes: A scatter point distribution area is generated, and a closed curve is obtained based on the scatter point distribution area.

3. The method according to claim 2, characterized in that The generating of the scatter point distribution area comprises: Obtaining a scene terrain of the game scene, and converting the scene terrain into a mesh; Eliminate the target terrain area in the grid volume to obtain a scattered point distribution area.

4. The method according to claim 3, characterized in that The step of eliminating the target terrain area in the grid volume to obtain a scattered point distribution area includes: Obtaining a two-mask pixel value of each terrain area in the grid volume; Eliminate the first target terrain area in the grid volume where the second mask pixel value is less than a preset first threshold, and obtain an intermediate scattered point distribution area; Obtaining the area of ​​each terrain region in the intermediate scattering point distribution area; The second target terrain area whose area is smaller than a preset second threshold value in the intermediate point distribution area is eliminated to obtain a final point distribution area.

5. The method according to claim 3 or 4, characterized in that: After obtaining the scattering distribution area, the method further includes: Segmenting each terrain area in the scattered point distribution area to obtain a plurality of distribution sub-areas; Each distribution sub-area is marked with a different color.

6. The method according to claim 2, characterized in that The step of converting the area based on the scattered points to obtain a closed curve includes: Obtaining contour lines of each distribution sub-area in the scattered point distribution area; Smoothing the contour line; Resample the contour points of the smoothed contour line; The target contour points located in the contour line portion where the direction change degree is less than a preset degree are eliminated to obtain a closed curve.

7. The method according to claim 6, characterized in that After obtaining the closed curve, the method further includes: A type value is added to the closed curve; the type value is used to indicate the object type of the scene object placed in the distribution sub-area inside the closed curve.

8. The method according to claim 7, characterized in that The step of obtaining a closed curve for the area to be sprinkled includes: Get the target object type of the target scene object to be placed; A closed curve of a corresponding type value is read based on the target object type.

9. The method according to claim 1, characterized in that: The step of responding to the closed curve adjustment instruction, adjusting the point scattering result, and obtaining the final placement position of the target scene object includes: In response to the instruction to adjust the closed curve, points are re-scattered inside the adjusted closed curve to obtain a final placement position of the target scene object.

10. A game scene generating device, characterized in that: Applied to a rendering engine, the device comprises: A closed curve acquisition module, used to acquire a closed curve for a scattered point distribution area, wherein the closed curve is obtained by conversion based on the scattered point distribution area; A point scattering module is used to scatter points inside the closed curve to obtain a point scattering result; wherein each point in the point scattering result is used to indicate the placement position of the target scene object; The closed curve adjustment module is used to respond to the adjustment instruction of the closed curve, adjust the point scattering result, and obtain the final placement position of the target scene object.

11. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the game scene generation method as described in any one of claims 1 to 9 is implemented.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the game scene generation method according to any one of claims 1 to 9 is implemented.