Method, device, electronic equipment and storage medium for game scene generation
By using bounding box segmentation and object configuration techniques in game scene generation, the problem of low efficiency in manual object configuration is solved, and efficient and detailed game scene generation is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING ZITIAO NETWORK TECH CO LTD
- Filing Date
- 2022-08-26
- Publication Date
- 2026-04-24
AI Technical Summary
In existing technologies for game scene generation, the manual configuration of objects cannot adapt to the exponential growth in the location and number of objects in complex game scenes, resulting in increased workload and a high risk of errors, and failing to achieve multi-class, high-precision scene generation.
The target area is divided into multiple sub-regions by using multiple bounding boxes, and the objects to be configured that match the sub-regions are determined according to preset information. The objects are automatically configured to each sub-region, and AABB and directed bounding boxes are used for precise segmentation and object placement.
It improves the efficiency of game scene production, generating game scenes with well-arranged object configurations and more refined, rich, and beautiful details.
Smart Images

Figure CN115359200B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of this disclosure relate to the field of computers, and more specifically, to methods, apparatus, electronic devices, and storage media for generating game scenes. Background Technology
[0002] In recent years, with the improvement of computing power and image processing capabilities of terminal devices, more complex and detailed game software has been developed and run. Correspondingly, the scale of scenes in game software has become larger, and the scene generation requires a higher level of detail.
[0003] Such game scenes can be, for example, three-dimensional game scenes. When players move the cursor on the game map, they will view various resource materials configured at different locations on the game map in a spatial coordinate system, thereby obtaining a realistic three-dimensional visual experience while judging the relative position in the game space.
[0004] As a configuration method for such game scenes, for example, in terrain-based game scenes, game developers will configure materials such as gravel, hills, cliffs, and other stone resources of different sizes for specific terrain locations to increase the richness of terrain details and visual realism. Summary of the Invention
[0005] The embodiments of this disclosure provide a scheme for game scene generation.
[0006] In a first aspect of this disclosure, a method for generating a game scene is provided. The method includes: determining a target region for a target scene containing an object to be configured; dividing the target region into multiple sub-regions using multiple bounding boxes based on preset information related to the object to be configured, such that each sub-region is surrounded by a corresponding bounding box; and determining an object to be configured that matches each of the multiple sub-regions and placing the matching object to be configured in each of the sub-regions.
[0007] In a second aspect of this disclosure, an apparatus for generating game scenes is provided. The apparatus includes: a region determination module configured to determine a target region for a target scene containing an object to be configured; a region segmentation module configured to segment the target region into multiple sub-regions using multiple bounding boxes based on preset information related to the object to be configured, such that each sub-region is surrounded by a corresponding bounding box; and an object configuration module configured to determine an object to be configured that matches each of the multiple sub-regions and place the matching object to be configured in each of the sub-regions.
[0008] In a third aspect of this disclosure, an electronic device is provided. The electronic device includes: at least one processor; and at least one memory storing computer-executable instructions, the at least one memory and the computer-executable instructions being configured, together with the at least one processor, to cause the electronic device to perform the method according to a first aspect of this disclosure.
[0009] In a fourth aspect of this disclosure, a computer-readable storage medium is provided. The computer-readable storage medium includes computer-executable instructions stored thereon, which, when executed, cause one or more devices to perform the method described in accordance with a first aspect of this disclosure.
[0010] The summary section is provided to present the chosen concepts in a simplified form, which will be further described in the detailed description below. The summary section is not intended to identify key or principal features of this disclosure, nor is it intended to limit the scope of this disclosure. Attached Figure Description
[0011] The above and other objects, features and advantages of this disclosure will become more apparent from the accompanying drawings, in which like reference numerals generally denote like parts.
[0012] Figure 1A A flowchart of a process for generating a game scene according to some embodiments of the present disclosure is shown;
[0013] Figure 1B A schematic diagram of an interface for processing game scene generation according to some embodiments of the present disclosure is shown;
[0014] Figure 1C A schematic diagram of a target scenario according to some embodiments of the present disclosure is shown;
[0015] Figure 1D A schematic diagram of a target region according to some embodiments of the present disclosure is shown;
[0016] Figure 1E A schematic diagram of sub-regions according to some embodiments of the present disclosure is shown;
[0017] Figure 2 Further flowcharts regarding the region determination process according to some embodiments of this disclosure are shown;
[0018] Figure 3A Further flowcharts regarding region segmentation processing according to some embodiments of this disclosure are shown;
[0019] Figure 3BThe diagram illustrates an interface schematic for region segmentation processing according to some embodiments of the present disclosure;
[0020] Figure 3C A schematic diagram of region segmentation using a first AABB bounding box is shown according to some embodiments of the present disclosure; Figure 3D A schematic diagram of region segmentation using a second AABB bounding box is shown according to some embodiments of the present disclosure;
[0021] Figure 4A Further flowcharts regarding object configuration processing according to other embodiments of this disclosure are shown;
[0022] Figure 4B The diagram illustrates an interface schematic related to object configuration processing according to some embodiments of the present disclosure;
[0023] Figure 4C A schematic diagram of a directed bounding box with a directed bounding sub-region is shown according to some embodiments of the present disclosure;
[0024] Figure 5 A schematic block diagram of an apparatus 500 for game scene generation according to some embodiments of the present disclosure is shown; and
[0025] Figure 6 A schematic block diagram of an example device 700 that can be used to implement embodiments of the present disclosure is shown. Detailed Implementation
[0026] The principles of this disclosure will now be described with reference to several exemplary embodiments illustrated in the accompanying drawings. While preferred embodiments of this disclosure are shown in the drawings, it should be understood that these embodiments are described merely to enable those skilled in the art to better understand and implement this disclosure, and are not intended to limit the scope of this disclosure in any way.
[0027] The term "comprising" and its variations as used herein signify open inclusion, i.e., "including but not limited to". Unless otherwise stated, the term "or" means "and / or". The term "based on" means "at least partially based on". The terms "one example embodiment" and "one embodiment" mean "at least one example embodiment". The term "another embodiment" means "at least one additional embodiment". The terms "first", "second", "third", etc., may refer to different or the same objects. Other explicit and implicit definitions may also be included below.
[0028] As used in this article, the term "game scene" refers to the natural environment in a game, including mountains, cliffs, deserts, and plains; the social environment, including roads and buildings; and the interior environment of buildings. It is typically composed of various object resources (such as stones, trees, and furniture) that match the different environments, and is implemented using 3D technology. In game scenes, terrain-based scenes refer to environments that showcase the shapes and landforms of features. For example, they can be composed of distributed pebbles, hills, cliffs, and other stone resources of varying sizes, creating a variety of undulating terrains. Different areas within the terrain can be defined by different parameters (such as slope, height, erosion, and undulation).
[0029] As game software demands larger-scale and more refined scene generation, the inventors have noticed that manually configuring objects to their corresponding scene locations is only suitable for smaller scenes or scenes with lower granularity. This approach cannot adapt to the exponential growth in both the number and location of objects in game scenes. If game developers rely solely on manual object configuration, their workload increases exponentially, errors and deviations are easily introduced, and the generation of diverse and highly accurate scenes remains unsuccessful.
[0030] To at least address the aforementioned issues, an example embodiment of this disclosure proposes a scheme for game scene generation. For a target scene, a target region of an object to be configured is determined. Based on preset information related to the object to be configured, the target region is divided into multiple sub-regions using multiple bounding boxes, such that each sub-region is surrounded by a corresponding bounding box. Furthermore, objects to be configured that match each of the multiple sub-regions are determined, and the matching objects to be configured are placed in their respective sub-regions.
[0031] The scheme for game scene generation disclosed herein can automatically determine the larger area in the game scene that needs to be configured with objects, and can divide the larger area into smaller areas with finer granularity by at least one segmentation process according to the size of the objects. Appropriate objects are placed in each of the smaller areas to match each other, thereby automatically realizing the object configuration in complex game scenes, greatly improving the production efficiency of game scenes, and at the same time, it can produce game scenes with well-arranged object configuration and more refined, rich and beautiful details.
[0032] Figure 1A A flowchart of a process for generating game scenes according to some embodiments of the present disclosure is shown. Figure 1B The diagram illustrates an interface schematic for processing game scene generation according to some embodiments of the present disclosure. Figure 1C A schematic diagram of a target scenario according to some embodiments of the present disclosure is shown. Figure 1D A schematic diagram of a target region according to some embodiments of the present disclosure is shown. Figure 1E A schematic diagram of a sub-region according to some embodiments of the present disclosure is shown.
[0033] In the process of creating a game scene, the terrain of the game scene is usually formed before configuring objects. Generally, the terrain of a game scene can be configured in a three-dimensional coordinate system, and the terrain can have terrain parameters such as slope, height, and erosion. The undulations of different areas in the terrain can be defined by different terrain parameters.
[0034] First, for the target scenario, the execution area is determined.
[0035] like Figure 1A and Figure 1B As shown, terrain data of target scene 100 is acquired. In step S100, for target scene 100, the target area 200 of the object to be configured 400 is determined. For example, as... Figure 1C As shown, the target scene 100 is an example of undulating mountains. In a 3D coordinate system, its x-axis coordinates are (-50000, 50000), its y-axis coordinates are (-50000, 50000), and its z-axis coordinates are (0, 20000). The coordinate unit is, for example, pixels. It should be noted that the target scene 100 does not necessarily have to fill the entire coordinate axis; it can be only a portion of the x, y, and z axes. Furthermore, while the coordinate unit is shown as pixels in the example above, it is not limited to this and can also be any unit such as millimeters, centimeters, or meters.
[0036] Furthermore, the target regions 200 determined after the region determination process have their own coordinates in the three-dimensional coordinate system, and their dimensions are determined by their respective coordinates. For example, the coordinates of one target region 200 may be (-5000, 0) on the x-axis, (-5000, 0) on the y-axis, and (0, 1000) on the z-axis, with a size of 5000×5000×1000; the coordinates of another target region may be (5000, 10000) on the x-axis, (-1500, -1000) on the y-axis, and (500, 1000) on the z-axis, with a size of 5000×500×500.
[0037] Figure 2 Further flowcharts regarding the region determination process according to some embodiments of this disclosure are shown.
[0038] In some embodiments, such as Figure 2As shown, step S100 may further include steps S110 and S120 to obtain preset information related to the object to be configured 400, and to determine one or more target regions 200 from the target scene 100 based on the preset information and the terrain parameters of the target scene 100. For example, the preset information includes the size of the object to be configured 400, which is determined based on at least one of length, width, and height.
[0039] First, in step S110, based on the terrain parameters of the target scene 100, one or more target areas 200 in the target scene 100 whose terrain parameter values fall between the maximum and minimum values of the terrain parameters are determined. For example, the terrain parameter can be slope, where the slope value is defined as a maximum of 100% and a minimum of 50%. From the target scene 100, target areas 200 in the target scene 100 whose slope values fall between the maximum of 100% and the minimum of 50% are determined; for example, it could be a target area with a slope of 60% or a target area with a slope of 80%. It should be noted that target areas 200 can be determined from the target scene 100 based on different combinations of terrain parameters, and are not limited to determination based on only one terrain parameter.
[0040] Then, in step S120, target regions are further determined based on the connectivity between target regions 200 (e.g., whether they are connected to each other). For example, target regions 200 are re-determined from among the target regions 200 in such a way that target regions 200 that are connected to each other among the determined target regions 200 are determined as one target region 200, or target regions 200 that are not connected to any other target region 200 among the determined target regions 200 are determined as one target region 200. As a result, target regions 200 that are connected to each other can be merged to obtain one or more independent target regions 200 as objects of region segmentation processing.
[0041] Here, the method of determining the target area based on preset information and terrain parameters is not limited to this. You can also choose an appropriate method as needed, as long as you can select the area of the object to be configured.
[0042] The region determination process disclosed herein enables more efficient determination of target regions suitable for region segmentation.
[0043] Then, for the target region determined after the execution region determination process, the execution region segmentation process is performed.
[0044] Next, as Figure 1A and Figure 1BAs shown, in step S200, based on preset information related to the object to be configured 400, the target region 200 is divided into multiple sub-regions 300 using multiple bounding boxes, such that each sub-region 300 is surrounded by a corresponding bounding box. For example, as... Figure 1C As shown, the darker areas in the target game scene 100 represent the target region 200. Further, for example, Figure 1D It shows Figure 1C One of the target regions 200 shown. For example, Figure 1E Further demonstration of the targeting Figure 1D The target region 200 shown is divided into sub-regions 300 after the segmentation process. Each sub-region 300 has its own coordinates in a three-dimensional coordinate system, and its size is determined by these coordinates. For example, for a target region 200 with x-axis coordinates of (-5000, 0), y-axis coordinates of (-5000, 0), and z-axis coordinates of (0, 1000), the region segmentation process can divide it into 3,125,000 sub-regions 300. The coordinates of one sub-region 300 could be x-axis coordinates of (-5, 0), y-axis coordinates of (-2, 0), and z-axis coordinates of (0, 1), with a size of 5 × 2 × 1. Further, in step S200, the target region 200 is divided into multiple sub-regions 300 through multiple rounds of segmentation. This multi-round segmentation refers to the process of dividing the target region 200 into sub-regions 300 through multiple rounds. Each round of segmentation yields a smaller region, which is more suitable for matching the size of the object to be configured or the various parameters of the target region.
[0045] Here, bounding boxes, based on algorithms for finding the optimal bounding space for a discrete set of points, utilize relatively large and simple geometric shapes (such as cubes, cuboids, cylinders, spheres, etc.) to completely enclose (e.g., include, wrap, contain, cover, etc.) a geometric object (in this context, an object in the game scene) to form a closed space. In this paper, bounding boxes include AABB bounding boxes, directed bounding boxes, bounding spheres, and fixed-direction convex hulls. An AABB (Axis-Aligned Bounding Box) is a hexahedron with each side parallel to a coordinate plane, and its length, width, and height can be different from each other. An OBB (Oriented Bounding Box) is a bounding box whose size and orientation are determined in the most compact way based on the geometry of the geometric object itself.
[0046] Here, the object to be configured 400 may include at least one object resource (such as stone, tree, furniture, etc.) of different sizes for configuring the game scene. The size of the object to be configured 400 is determined according to at least one of length, width, and height. The parameters of the object to be configured 400, including its size, color, style, etc., can be stored in advance.
[0047] Figure 3A Further flowcharts regarding region segmentation processing according to some embodiments of this disclosure are shown. Figure 3B The diagram shows an interface schematic for region segmentation processing according to some embodiments of the present disclosure. Figure 3C A schematic diagram illustrating region segmentation using a first AABB bounding box according to some embodiments of the present disclosure is shown. Figure 3D A schematic diagram of region segmentation using a second AABB bounding box is shown according to some embodiments of the present disclosure.
[0048] In some embodiments, step S200 may further include steps S211 to S215. As described above, in step S200, the target region 200 is divided into multiple sub-regions 300 through a multi-round segmentation process. Hereinafter, for ease of explanation, a two-round segmentation process will be used as an example for illustrative purposes.
[0049] First, in step S211, a plurality of interconnected first AABB bounding boxes 10 with the first size are generated according to the first size of the first AABB bounding box 10. Here, the size of the first AABB bounding box 10 can be a predetermined fixed value, or it can be a value determined based on attributes of the target game scene, etc. In the above example, the size of the first AABB bounding box 10 can be, for example, 100×100×100.
[0050] Then, in step S212, as Figure 3CAs shown, using the multiple first AABB bounding boxes 10 generated in step S211, the target region 200 is divided into multiple regions 250 for dividing the sub-regions 300 (described in detail later), wherein each region 250 is surrounded by a corresponding first AABB bounding box 10. For example, in the above example, for one of the target regions 200 with x-axis coordinates of (-5000, 0), y-axis coordinates of (-5000, 0), and z-axis coordinates of (0, 1000), the target region 200 is divided into 25,000 regions 250 using a first AABB bounding box 10 with a size of 100×100×100. Each of these 25,000 regions 250 is surrounded by a corresponding first AABB bounding box 10 (e.g., enclosed, contained, covered, etc.). Each first AABB bounding box 10 does not need to be completely filled by the corresponding region 250, as long as at least a portion of it includes a portion of the target region 200. For example, in the example above, in one of the first AABB bounding boxes 10 of 100×100×100, the coordinates of the region 250 it encloses can be (-50, 0) on the x-axis, (-20, 0) on the y-axis, and (0, 100) on the z-axis, with a size of 50×20×100, accounting for 10% of the total size of the first AABB bounding box 10.
[0051] Next, in step S213, for each of the plurality of first AABB bounding boxes 10 that included the corresponding region in step S212, the number of second AABB bounding boxes 20 is determined according to preset information and the first size of the first AABB bounding box 10, wherein the preset information includes, for example, the size of the object to be configured 400. In some embodiments, the minimum number of second AABB bounding boxes 20 is determined based on the maximum value of the first size of the first AABB bounding box 10 and the size of the object to be configured 400. The maximum number of second AABB bounding boxes 20 is determined based on the minimum value of the first size of the first AABB bounding box 10 and the size of the object to be configured 400. Then, the number of second AABB bounding boxes 20 is determined between the maximum value and the minimum value. For example, the region segmentation module 520 randomly selects a value between the maximum value and the minimum value as the number of second AABB bounding boxes 20. For example, in the above example, for one of the first AABB bounding boxes 10 of size 100×100×100, the maximum size of the object 400 to be configured in the object resource is 50×50×50, and the minimum size is 10×10×10. Therefore, the minimum number of second AABB bounding boxes 20 is determined to be 8, and the maximum number is 1000. The number of second AABB bounding boxes 20 is randomly determined to be 125. Here, the random selection method can be based on a random algorithm, which can be any algorithm capable of randomly determining values, including but not limited to numerical probability algorithms, Monte Carlo algorithms, Las Vegas algorithms, Sherwood algorithms, etc.
[0052] Then, in step S214, based on the number of second AABB bounding boxes 20 determined in step S213, the second size of the second AABB bounding boxes 20 is determined, and interconnected second AABB bounding boxes 20 with the second size are generated. In some embodiments, the second size of the second AABB bounding boxes 20 is determined by dividing the first size of the first AABB bounding box 10 by the number of second AABB bounding boxes 20. For example, in the example above, for one first AABB bounding box 10 of 100×100×100 and 125 second AABB bounding boxes 20, the second size of the second AABB bounding boxes 20 is determined to be 20×20×20.
[0053] Next, in step S215, as Figure 3DAs shown, using the second AABB bounding box 20 generated in step S214, each of the multiple regions 250 segmented in step S212 is further segmented into multiple sub-regions 300, such that each sub-region 300 is surrounded by the corresponding second AABB bounding box 20. For example, in the above example, for one of the target regions 200 with x-axis coordinates of (-5000, 0), y-axis coordinates of (-5000, 0), and z-axis coordinates of (0, 1000), by performing the segmentation process, using 3,125,000 interconnected second AABB bounding boxes 20 of 20×20×20, it is segmented into 3,125,000 sub-regions 300, where each of the 3,125,000 sub-regions 300 is surrounded by the corresponding second AABB bounding box 20 (e.g., wrapped, contained, covered, etc.). In this case, each second AABB bounding box 20 does not need to be completely filled by the sub-region 300, as long as at least a portion of it includes a part of the target region 200. For example, in the example above, in one of the second AABB bounding boxes 20 with a size of 5×5×1, the coordinates of its directed bounding sub-region 300 can be (-5, 0) on the x-axis, (-2, 0) on the y-axis, and (0, 1) on the z-axis, with a size of 5×2×1, occupying 40% of the total size of the bounding box.
[0054] By using the region partitioning process disclosed herein, and by employing multiple rounds of segmentation using the first AABB bounding box and the second AABB bounding box, the appropriate region of the object to be configured can be determined more accurately.
[0055] Then, for sub-region 300 obtained after the execution region segmentation process, object configuration processing is performed.
[0056] like Figure 1A and Figure 1B As shown, in step S300, a configuration object 400 that matches each of the multiple sub-regions 300 segmented in step S200 is determined, and the matching configuration object 400 is placed in each sub-region 300. For example, in the above example, a configuration object with a size of 4.95×2.05×0.95 that is close to the size of the sub-region 300 is placed in the sub-region 300 with a size of 5×2×1.
[0057] Figure 4A Further flowcharts regarding object configuration processing according to other embodiments of this disclosure are shown. Figure 4B The diagram illustrates an interface schematic related to object configuration processing according to some embodiments of the present disclosure. Figure 4C A schematic diagram of a directed bounding box with a directed bounding subregion is shown according to some embodiments of the present disclosure.
[0058] In some embodiments, such as Figure 4A As shown, step S300 may further include steps S310 and S320.
[0059] First, in step S310, for each sub-region 300 generated in step S200, a directed bounding box 30 is determined to enclose that sub-region 300. For example, for each sub-region 300, the directed bounding box 30 is determined in a manner that most compactly encloses (e.g., includes, encompasses, etc.) the sub-region 300, and the size and orientation of the directed bounding box 30 are determined by the size and orientation of the sub-region 300. For example, in the example above, in one of the bounding boxes of 5×5×1, the coordinates of the sub-region 300 it includes can be (-5, 0) on the x-axis, (-2, 0) on the y-axis, and (0, 1) on the z-axis, with a size of 5×2×1 and a normal direction of the first direction. Thus, the size of the directed bounding box 30 is determined to be 5×2×1, and the normal direction is determined to be the first direction.
[0060] Then, in step S320, the configuration object 400 that matches the directed bounding box 30 generated in step S310 is determined, and the configuration object 400 that matches the directed bounding box 30 is placed in the sub-region 300.
[0061] In some embodiments, for the directed bounding box 30 that encloses the corresponding sub-region 300 generated in step S310, the object to be configured 400 is placed at the center point of the directed bounding box 30, with the normal direction of the object to be configured 400 matching the normal direction of the center point of the directed bounding box 30. Here, the center point is the midpoint of the solid geometry of the directed bounding box 30. For example, in the above example, the normal direction of the directed bounding box 30 is a first direction, and correspondingly, the normal direction of the center point of the directed bounding box 30 is a first direction. Based on this, the normal direction of the object to be configured 400 is also set to the first direction. Furthermore, the normal direction of the directed bounding box 30 is determined based on the slope of the corresponding sub-region 300 it encloses. For example, if the slope of subregion 300 in the three-dimensional coordinate system (e.g., the angle between the upward plane of subregion 300 and the XY plane of the three-dimensional coordinate system) is 60°, the direction of the normal surrounding subregion 300 is perpendicular to the upward plane of subregion 300.
[0062] In some embodiments, the center point of the directed bounding box 30 can be determined based on its third dimension, such that the center point is associated with the third dimension of the directed bounding box 30 and its normal direction. Then, based on the third dimension of the directed bounding box 30 associated with the center point and the size of the object to be configured 400, the object to be configured 400 that matches the center point is determined. Next, the object to be configured 400 is placed at the center point, with the center point as its center. Here, the orientation of the directed bounding box 30 can be the direction of the upward plane of its oriented bounding sub-region 300, but is not limited to this, and can also be set to other orientations as needed.
[0063] In some embodiments, the center point can be oriented directly upwards, and the normal direction of the center point can be redefined so that the normal direction of the object to be configured 400 matches the redefined normal direction of the center point. The object to be configured 400 is then placed at the center point, which serves as its center. This allows the object to be configured 400 to be rotated and placed vertically within the target game scene, enhancing the richness and realism of the object.
[0064] In other embodiments, a lower threshold for the size of the object to be configured 400 can be determined based on a third size and a first coefficient of the directed bounding box 30, and an upper threshold for the size of the object to be configured 400 can be determined based on a third size and a second coefficient of the directed bounding box 30, wherein the second coefficient is greater than the first coefficient. Then, from the objects to be configured whose size falls between the lower and upper thresholds, one object to be configured 400 is randomly selected to be placed at the center point. For example, in the example above, the size of the directed bounding box 30 associated with the center point is 5×2×1, the first coefficient is 0.8, the second coefficient is 1.2, the lower threshold for the object to be configured 400 is determined to be 5×2×1×0.8, the upper threshold for the object to be configured 400 is determined to be 5×2×1×1.2, and the randomly determined size of the object to be configured 400 is 4.95×2.05×0.95.
[0065] In some embodiments, the first AABB bounding box and the second AABB bounding box are preferably AABB bounding boxes.
[0066] In other embodiments, the directed bounding box is preferably a directed bounding box. By using different types of bounding boxes for region partitioning and object configuration respectively, it is possible to further accurately determine matching objects.
[0067] In some embodiments, the configuration of the game scene is not limited to a three-dimensional coordinate system, but can also be configured using a coordinate system of any dimension and parameters, such as a one-dimensional coordinate system, a two-dimensional coordinate system, or a four-dimensional coordinate system. For example, in a game scene developed based on Augmented Reality technology, the relevant parameters of the coordinate system can be configured according to the requirements of calibration, tracking, and alignment.
[0068] In the example above, the size is represented by the form "value × value × value", but it is not limited to this. The size can be represented and processed by a single value or in various other forms such as "value × value".
[0069] According to an example embodiment of the present disclosure, a method for generating a game scene involves determining a target area for a target scene, dividing the target area into multiple sub-regions using multiple bounding boxes based on preset information related to the target area, such that each sub-region is surrounded by a corresponding bounding box, and determining a target area that matches each of the multiple sub-regions and placing the matching target area in each of the sub-regions.
[0070] Therefore, it can automatically determine the larger area in the game scene that needs to be configured with objects, and can divide the larger area into smaller areas with finer granularity by at least one segmentation process according to the size of the objects. Appropriate objects to be configured are then matched and configured in each smaller area. This automatically realizes the object configuration in complex game scenes, greatly improving the production efficiency of game scenes, and at the same time, it can produce game scenes with well-arranged object configurations and more refined, rich, and beautiful details.
[0071] Figure 5 A schematic block diagram of an apparatus 500 for game scene generation according to some embodiments of the present disclosure is shown. The apparatus 500 may be included in the description below. Figure 6 It is either in device 600 or implemented as device 600.
[0072] like Figure 5 As shown, the device 500 may include a region determination module 510, configured to perform region determination processing of step S100 and related sub-steps. For example, the region determination module 510 may determine the target region 200 of the object 400 to be configured for the target scene 100.
[0073] In some embodiments, the region determination module 510 acquires preset information related to the object to be configured 400, and determines one or more target regions 200 from the target scene 100 based on the preset information and the terrain parameters of the target scene 100. In some embodiments, the size of the object to be configured 400 is determined according to at least one of length, width, and height, and the object to be configured 400 includes at least one stone resource of different sizes for configuring the game scene. In some embodiments, the various parameters of the size of the object to be configured 400, including the center coordinates, length, width, height, and storage path of the object to be configured, can be stored using a semi-structured data structure (JSON format).
[0074] In some embodiments, the region determination module 510 determines one or more target regions 200 in the target scene 100 whose terrain parameter values are between the maximum and minimum values of the terrain parameters, based on preset information related to the object to be configured 400 and the maximum and minimum values of the terrain parameters, wherein the terrain parameters include at least one of slope, height and erosion.
[0075] The device 500 may also include a region segmentation module 520, configured to perform region segmentation processing of step S200 and related sub-steps. For example, the region segmentation module 520 divides the target region 200 into multiple sub-regions 300 using multiple bounding boxes based on preset information related to the object to be configured 400, such that each sub-region 300 is surrounded by a corresponding bounding box.
[0076] In some embodiments, the region segmentation module 520 generates a plurality of interconnected first AABB bounding boxes 10 having a first size, based on the first size of the first AABB bounding box 10. In some embodiments, the region segmentation module 520 uses the plurality of first AABB bounding boxes 10 to segment the target region 200 into a plurality of regions 250 for segmenting molecular regions 300, such that each region 250 is surrounded by a corresponding first AABB bounding box 10.
[0077] In some embodiments, the region segmentation module 520, for each of the plurality of first AABB bounding boxes 10, determines the number of second AABB bounding boxes 20 based on preset information and a first size of the first AABB bounding box 10, determines the second size of the second AABB bounding box 20 based on the number of second AABB bounding boxes 20, and generates a plurality of interconnected second AABB bounding boxes 20 having the second size based on the second size of the second AABB bounding boxes 20. In some embodiments, the region segmentation module 520 uses the plurality of second AABB bounding boxes 20 to segment each region 250 into a plurality of sub-regions 300, such that each sub-region 300 is surrounded by a corresponding second AABB bounding box 20.
[0078] In some embodiments, the first AABB bounding box 10 and the second AABB bounding box 20 are AABB bounding boxes.
[0079] In some embodiments, the region segmentation module 520 determines the minimum number of second AABB bounding boxes 20 based on the maximum value of the first size of the first AABB bounding box 10 and the size of the object to be configured 400, and determines the maximum number of second AABB bounding boxes 20 based on the minimum value of the first size of the first AABB bounding box 10 and the size of the object to be configured 400. In some embodiments, the region segmentation module 520 determines the number of second AABB bounding boxes 20 between the maximum and minimum values. For example, the region segmentation module 520 randomly selects a value between the maximum and minimum values as the number of second AABB bounding boxes 20.
[0080] The device 500 may also include an object configuration module 530, configured to perform object configuration processing of step S300 and related sub-steps. For example, the object configuration module 530 will match the objects 400 to be configured with each of the multiple sub-regions 300 and place the matched objects 400 to be configured in each sub-region 300.
[0081] In some embodiments, the object configuration module 530 determines a directed bounding box 30 that surrounds each sub-region 300, and places the object to be configured 400 that matches the directed bounding box 30 in the sub-region 300. In some embodiments, the directed bounding box 30 is a directed bounding box.
[0082] In some embodiments, the object configuration module 530, in order to match the normal direction of the object to be configured 400 with the normal direction of the directed bounding box 30, uses the center point of the directed bounding box 30 as the center of the object to be configured 400, and places the object to be configured 400 at the center point, wherein the center point is the solid geometric center of the directed bounding box 30, and the normal direction of the directed bounding box 30 is determined based on the slope of the sub-region 300.
[0083] In some embodiments, the object configuration module 530 determines the center point of the directed bounding box 30 based on its third dimension, associates the center point with the third dimension, normal direction, and orientation of the directed bounding box 30, and determines the object to be configured 400 that matches the center point based on the third dimension of the directed bounding box 30 and the size of the object to be configured 400. In some embodiments, the object configuration module 530 places the object to be configured 400 at the center point, using the center point as the center, in a manner that matches the normal direction of the object to be configured 400 with the normal direction associated with the center point.
[0084] In some embodiments, the object configuration module 530 redetermines the normal direction of the center point by adjusting the orientation of the center point to the upward direction, and places the object to be configured 400 at the center point in such a way that the normal direction of the object to be configured 400 matches the redetermined normal direction of the center point.
[0085] In some embodiments, the object configuration module 530 determines a lower threshold for the size of the object to be configured 400 based on a third size and a first coefficient of the directed bounding box 30, and determines an upper threshold for the size of the object to be configured 400 based on a third size and a second coefficient of the directed bounding box 30, wherein the second coefficient is greater than the first coefficient. In some embodiments, the object configuration module 530 determines one object to be configured 400 to be placed at the center point from among the objects to be configured 400 whose size is between the lower threshold and the upper threshold. For example, the object configuration module 530 randomly selects a value from among the objects to be configured 400 whose size is between the lower threshold and the upper threshold as the object to be configured 400 to be placed at the center point.
[0086] According to an example embodiment of the present disclosure, the apparatus for generating a game scene determines a target area of an object to be configured for a target scene, divides the target area into multiple sub-regions using multiple bounding boxes based on preset information related to the object to be configured, such that each sub-region is surrounded by a corresponding bounding box, and determines the object to be configured that matches each of the multiple sub-regions and places the matching object to be configured in each sub-region.
[0087] Therefore, it can automatically determine the larger areas in the game scene that need to be configured with objects, and can divide the larger area into smaller areas with finer granularity by at least one segmentation process according to the size of the objects. Appropriate objects are then configured in each smaller area to match the smaller areas. This automatically realizes the object configuration in complex game scenes, greatly improving the production efficiency of game scenes, and at the same time, it can produce game scenes with well-arranged object configurations and more refined, rich, and beautiful details.
[0088] Figure 6 A schematic block diagram of an example device 700 that can be used to implement embodiments of the present disclosure is shown. Device 700 can be used for the processing described above for game scene generation.
[0089] like Figure 6As shown, device 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to computer program instructions stored in read-only memory (ROM) 602 or loaded from storage unit 608 into random access memory (RAM) 603. RAM 603 may also store various programs and data required for the operation of device 600. CPU 601, ROM 602, and RAM 603 are interconnected via bus 604. Input / output (I / O) interface 605 is also connected to bus 604.
[0090] Multiple components in device 600 are connected to I / O interface 605, including: input unit 606, such as keyboard, mouse, etc.; output unit 607, such as various types of monitors, speakers, etc.; storage unit 608, such as disk, optical disk, etc.; and communication unit 609, such as network card, modem, wireless transceiver, etc. Communication unit 609 allows device 600 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0091] The various processes and handling described above, such as region determination, region segmentation, and object configuration for game scene generation, can be executed by processing unit 601. For example, in some embodiments, the region determination, region segmentation, and object configuration processes can be implemented as computer software programs tangibly contained in a machine-readable medium, such as storage unit 608. In some embodiments, part or all of the computer program can be loaded and / or installed on device 600 via ROM 602 and / or communication unit 609. When the computer program is loaded into RAM 603 and executed by CPU 601, one or more actions of the region determination, region segmentation, and object configuration processes described above can be performed.
[0092] This disclosure can be a method, apparatus, system, and / or computer program product. A computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for performing various aspects of this disclosure.
[0093] Computer-readable storage media can be tangible devices capable of holding and storing instructions for use by an instruction execution device. Computer-readable storage media can be, for example—but not limited to—electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination of the foregoing. The computer-readable storage media used herein are not to be construed as transient signals themselves, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses through fiber optic cables), or electrical signals transmitted through wires.
[0094] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to the computer-readable storage media in the respective computing / processing device.
[0095] Computer program instructions used to perform the operations of this disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, status setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as the "C" language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuitry, such as programmable logic circuitry, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), is personalized by utilizing the status information of the computer-readable program instructions to implement various aspects of this disclosure.
[0096] Various aspects of this disclosure are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.
[0097] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processing unit of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner. Thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.
[0098] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.
[0099] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0100] The various embodiments of this disclosure have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or improvement of the technology in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.
Claims
1. A method for generating a game scene, comprising: For the target scenario, determine the target area of the object to be configured; Based on preset information related to the object to be configured, the target region is divided into multiple sub-regions using multiple bounding boxes, such that each sub-region is surrounded by a corresponding bounding box. as well as Identify the configuration objects that match each of the multiple sub-regions and place the matching configuration objects in each of the sub-regions. Placing the matching objects to be configured in each of the sub-regions includes: The center of the object to be configured is taken as the center of the object to be configured, in a way that matches the normal direction of the object to be configured with the normal direction of the directed bounding box of the directed bounding box of the directed bounding sub-region. By adjusting the orientation of the center point to directly upward, the normal direction of the center point is redefined; and The object to be configured is placed at the center point in such a way that the normal direction of the object to be configured matches the normal direction of the newly determined center point.
2. The method according to claim 1, wherein dividing the target region into multiple sub-regions using multiple bounding boxes comprises: The target region is divided into multiple sub-regions through a multi-round segmentation process.
3. The method according to claim 2, wherein dividing the target region into multiple sub-regions through a multi-round segmentation process includes: Based on the first size of the first AABB bounding box, generate a plurality of interconnected first AABB bounding boxes having the first size; as well as Using multiple first AABB bounding boxes, the target region is divided into multiple regions for dividing the sub-regions, such that each region is surrounded by a corresponding first AABB bounding box.
4. The method according to claim 3, wherein dividing the target region into multiple sub-regions through a multi-round segmentation process further includes: For each of the multiple first AABB bounding boxes, the number of second AABB bounding boxes is determined based on the preset information and the first size of the first AABB bounding box; Determine the second size of the second AABB enclosure based on the number of the second AABB enclosures; Based on the second dimension of the second AABB bounding box, generate a plurality of interconnected second AABB bounding boxes having the second dimension; as well as Each region is divided into multiple sub-regions using multiple second AABB bounding boxes, where each sub-region is surrounded by a corresponding second AABB bounding box.
5. The method according to claim 4, wherein determining the number of second AABB enclosures based on the preset information and the first size of the first AABB enclosure includes: Based on the first size of the first AABB bounding box and the maximum value of the size of the object to be configured included in the preset information, determine the minimum number of second AABB bounding boxes; Based on the first size of the first AABB bounding box and the minimum size of the object to be configured included in the preset information, determine the maximum number of second AABB bounding boxes; and Determine the number of the second AABB bounding boxes, where the number of the second AABB bounding boxes is a value between the maximum value and the minimum value.
6. The method of claim 1, wherein determining a configuration object that matches a sub-region among the plurality of sub-regions and placing the matching configuration object in the sub-region comprises: For each sub-region of the said sub-region, the directed bounding box is determined; as well as Identify the object to be configured that matches the directed bounding box and place the object to be configured that matches the directed bounding box in the sub-region.
7. The method of claim 6, wherein the center point is the solid geometric center of the directed bounding box, and the normal direction of the directed bounding box is determined based on the slope of the sub-region.
8. The method of claim 7, wherein placing the object to be configured that matches the directed bounding box at the center point comprises: Based on the third dimension of the directed bounding box, determine the center point of the directed bounding box, and associate the center point with the third dimension, normal direction, and orientation of the directed bounding box; Based on the third dimension of the directed bounding box and the dimension of the object to be configured included in the preset information, determine the object to be configured that matches the center point; as well as The object to be configured is placed at the center point, with the center point serving as the center of the object, so that the normal direction of the object to be configured matches the normal direction associated with the center point.
9. The method of claim 8, wherein determining the object to be configured that matches the center point comprises: Based on the third dimension and the first coefficient of the directed bounding box, a lower threshold for the size of the object to be configured is determined; Based on the third size and the second coefficient of the directed bounding box, an upper threshold for the size of the object to be configured is determined, wherein the second coefficient is greater than the first coefficient; From the configurable objects whose size is between the lower threshold and the upper threshold, determine one configurable object to be placed at the center point.
10. The method according to claim 1, wherein, The preset information includes the size of the object to be configured, which is determined based on at least one of length, width, and height. The objects to be configured include at least one stone resource of different sizes used for configuring the game scene.
11. The method of claim 1, wherein determining the target region of the object to be configured comprises: Obtain the preset information; Based on the preset information and the terrain parameters of the target scene, one or more target areas in the target scene are determined.
12. The method of claim 11, wherein determining one or more target regions from the target scene comprises: Based on the maximum and minimum values of the terrain parameters, determine one or more target areas in the target scene where the values of the terrain parameters fall between the maximum and minimum values of the terrain parameters. The terrain parameters mentioned therein include at least one of slope, height, and erosion.
13. A game scene generation device, comprising: The region determination module is configured to determine the target region of the object to be configured for the target scene; The region segmentation module is configured to divide the target region into multiple sub-regions using multiple bounding boxes based on preset information related to the object to be configured, such that each sub-region is surrounded by a corresponding bounding box. as well as The object configuration module is configured to determine the objects to be configured that match each of the multiple sub-regions and place the matching objects to be configured in each of the sub-regions. The object configuration module is configured as follows: The center of the object to be configured is taken as the center of the object to be configured, in a way that matches the normal direction of the object to be configured with the normal direction of the directed bounding box of the directed bounding box of the directed bounding sub-region. By adjusting the orientation of the center point to directly upward, the normal direction of the center point is redefined; and The object to be configured is placed at the center point in such a way that the normal direction of the object to be configured matches the normal direction of the newly determined center point.
14. An electronic device comprising: At least one processor; as well as At least one memory storing computer-executable instructions, the at least one memory and the computer-executable instructions being configured, together with the at least one processor, to cause the electronic device to perform the method according to any one of claims 1 to 12.
15. A computer-readable storage medium comprising computer-executable instructions stored thereon, the computer-executable instructions, when executed, causing one or more devices to perform the method according to any one of claims 1 to 12.
Citation Information
Patent Citations
Resource generation method and device in game scene, medium and electronic equipment
CN111467806A
Three-dimensional scene data rendering method and device, storage medium and electronic device
CN114627219A