Game sand table map generation method and device, electronic equipment and storage medium
By obtaining the landform and resource distribution information in the game space model, automatically generate sand table background pictures and set icons, the problems of low efficiency and poor accuracy of game sand table map production in the existing technology are solved, and efficient and accurate sand table map generation is achieved. .
Patent Information
- Application Number
- CN202411132600.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-16
- Publication Date
- 2024-12-27
AI Technical Summary
The existing game sandbox maps are inefficient and have poor accuracy, so they need to manually match the landform demarcation and place icons, which is time-consuming and labor-intensive.
By obtaining the landform information and resource distribution information in the game space model, we will automatically generate sand table background pictures and set icons, including splicing, texture mapping and clustering of land and ocean backgrounds, improving generation efficiency and accuracy.
It effectively reduces the duration of sand table background pictures and icon settings, improves the generation efficiency and accuracy of game sand table maps, and can accurately present the landform and resource distribution in the game space model.
Smart Images

Figure CN119185947A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of game map technology, and in particular to a game sandbox map generation method, device, electronic device and storage medium. Background Art
[0002] Sandbox maps are usually used to display the terrain, buildings and other important elements of a certain area, and are widely used in games and other fields. For example, in SLG (Strategy Game) type games, sandbox maps are abstractions of the game space model, which are used to provide players with a variety of information such as regional ownership, terrain and landforms. In related technologies, game sandbox map production is generally done by artists manually drawing sandbox background images based on the landforms of the game space model and placing icons on the sandbox background images. This requires precise matching of actual landform boundaries, which places relatively high demands on production and requires a process of repeated corrections; and manually placing a large number of icons is time-consuming and labor-intensive, resulting in low production efficiency and poor accuracy of the game sandbox. Summary of the invention
[0003] The present disclosure provides a game sandbox map generation method, device, electronic device and storage medium to at least solve the problem of how to improve the production efficiency and accuracy of game sandbox maps in the related art. The technical solution of the present disclosure is as follows:
[0004] According to a first aspect of an embodiment of the present disclosure, a method for generating a game sandbox map is provided, comprising:
[0005] Acquire landform information in a game space model and resource distribution information corresponding to a plurality of resources in the game space model;
[0006] Perform sandbox background generation processing according to the landform information in the game space model to obtain a sandbox background image;
[0007] Setting a plurality of corresponding icons based on resource types of the plurality of resources;
[0008] The multiple icons are set on the sandbox background image based on the resource distribution information to obtain a game sandbox map.
[0009] In a possible implementation, the landform information includes land landform information and sea and land landform height maps; the sand table background generation process is performed according to the landform information in the game space model to obtain a sand table background image, including:
[0010] Generate a land background picture according to the landform information;
[0011] Generate an ocean background picture according to the sea and land height map;
[0012] Based on the positional relationship between the land and the ocean, the land background image and the ocean background image are spliced to obtain the sand table background image.
[0013] In a possible implementation, generating a land background image according to the landform information includes:
[0014] According to the landform information, a landform representative map is obtained;
[0015] Determining a landform representative color based on the landform representative map;
[0016] Binarizing the representative color of the landform to obtain a land mask map;
[0017] The land mask map is texture mapped to obtain the land background image.
[0018] In a possible implementation, the performing texture mapping processing on the land mask map to obtain the land background image includes:
[0019] Splitting the land mask map according to a preset size to obtain split land mask sub-maps;
[0020] The land mask sub-image is texture mapped and spliced to obtain the land background image.
[0021] In a possible implementation, the sea and land height map is a sea and land mask map; and generating an ocean background image according to the sea and land height map includes:
[0022] Lifting and eroding the sea and land mask map to obtain random terrain;
[0023] Using a preset plane group, slicing the random terrain to obtain layered contour points;
[0024] Based on the contour points corresponding to each layer, generate a surface patch corresponding to each layer;
[0025] Triangulate the facets corresponding to each layer to generate mesh data corresponding to each layer;
[0026] Gradient color rendering is performed on each layer according to the mesh volume data to obtain the ocean background image.
[0027] In a possible implementation, after the step of obtaining layered contour points, the method further includes:
[0028] Sharpening the corners of the contour points to obtain stylized contour points;
[0029] The step of generating a patch corresponding to each layer based on the contour points corresponding to each layer includes:
[0030] Based on the stylized contour points corresponding to each layer, a patch corresponding to each layer is generated.
[0031] In a possible implementation, the resource distribution information includes multiple resource distribution points of the multiple resources; and the setting of the multiple icons on the sandbox background image based on the resource distribution information to obtain a game sandbox map includes:
[0032] Clustering the multiple resource distribution points to obtain multiple distribution point clusters;
[0033] Determine the center point of the clustering area corresponding to each distribution point cluster;
[0034] Based on the resource types corresponding to the distribution point clusters, bind the corresponding icons to the distribution point clusters to obtain binding information;
[0035] According to the binding information, a corresponding icon is set at the position of the center point on the sandbox background image to obtain the game sandbox map.
[0036] In a possible implementation manner, clustering the multiple resource distribution points to obtain multiple distribution point clusters includes:
[0037] Based on a preset radius and a preset number of distribution points, determining a core distribution point among the multiple resource distribution points that meets a density reachability condition;
[0038] The density-reachable distribution points corresponding to each core distribution point are screened to form a distribution point cluster for each core distribution point.
[0039] According to a second aspect of an embodiment of the present disclosure, a game sandbox map generating device is provided, comprising:
[0040] A landform and resource distribution acquisition module is configured to acquire landform information in a game space model and resource distribution information corresponding to a plurality of resources in the game space model;
[0041] A sandbox background image acquisition module is configured to perform sandbox background generation processing according to the landform information in the game space model to obtain a sandbox background image;
[0042] An icon setting module, configured to set a plurality of icons corresponding to the resource types of the plurality of resources;
[0043] The game sandbox map acquisition module is configured to set the multiple icons on the sandbox background image based on the resource distribution information to obtain the game sandbox map.
[0044] In a possible implementation, in a possible implementation, the landform information includes land landform information and sea and land landform height map; the sand table background image acquisition module includes:
[0045] A land background image generating unit is configured to generate a land background image according to the land topography information;
[0046] An ocean background image generating unit is configured to generate an ocean background image according to the sea and land height map;
[0047] The splicing unit is configured to execute splicing of the land background image and the ocean background image based on the positional relationship between the land and the ocean to obtain the sand table background image.
[0048] In a possible implementation, the land background image generating unit includes:
[0049] A landform representative map acquisition subunit is configured to obtain a landform representative map according to the landform information;
[0050] A landform representative color determination subunit is configured to determine a landform representative color based on the landform representative map;
[0051] The land mask map acquisition subunit is configured to perform binarization processing on the landform representative color to obtain a land mask map;
[0052] The land background image generation subunit is configured to perform texture mapping processing on the land mask map to obtain the land background image.
[0053] In a possible implementation, the land background image generation subunit is further configured to perform splitting processing on the land mask map according to a preset size to obtain split land mask sub-images; and perform texture mapping processing and splicing processing on the land mask sub-images to obtain the land background image.
[0054] In a possible implementation, the sea and land height map is a sea and land mask map; and the ocean background image generating unit includes:
[0055] A random terrain acquisition subunit is configured to perform lifting and erosion on the sea and land mask map to obtain a random terrain;
[0056] A contour point acquisition subunit is configured to perform slicing processing on the random terrain using a preset plane group to obtain layered contour points;
[0057] A patch generation subunit is configured to generate a patch corresponding to each layer based on the contour points corresponding to each layer;
[0058] A mesh volume data generation subunit is configured to perform triangulation processing on the facets corresponding to each layer to generate mesh volume data corresponding to each layer;
[0059] The ocean background image acquisition subunit is configured to perform gradient color rendering of each layer according to the grid volume data to obtain the ocean background image.
[0060] In a possible implementation manner, the device further includes:
[0061] A stylization unit, configured to perform corner sharpening on the contour points to obtain stylized contour points;
[0062] The patch generation subunit is further configured to generate patches corresponding to each layer based on the stylized contour points corresponding to each layer.
[0063] In a possible implementation, the resource distribution information includes multiple resource distribution points of the multiple resources; and the game sandbox map acquisition module includes:
[0064] A clustering unit, configured to perform clustering on the plurality of resource distribution points to obtain a plurality of distribution point clusters;
[0065] A cluster center point determination unit is configured to determine the center point of the cluster area corresponding to each distribution point cluster;
[0066] The icon binding unit is configured to bind the corresponding icon to each distribution point cluster based on the resource type corresponding to each distribution point cluster, and obtain binding information;
[0067] The game sandbox map acquisition unit is configured to set a corresponding icon at the position of the center point on the sandbox background image according to the binding information to obtain the game sandbox map.
[0068] In a possible implementation, the clustering unit includes:
[0069] A core distribution point determination subunit is configured to determine a core distribution point that meets a density reachability condition among the plurality of resource distribution points based on a preset radius and a preset number of distribution points;
[0070] The cluster acquisition subunit is configured to perform screening of density-reachable distribution points corresponding to each core distribution point to form a distribution point cluster for each core distribution point.
[0071] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement a method as described in any one of the above-mentioned first aspects.
[0072] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute any method described in the first aspect of the embodiment of the present disclosure.
[0073] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, comprising computer instructions, which, when executed by a processor, enable a computer to execute any one of the methods described in the first aspect of an embodiment of the present disclosure.
[0074] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:
[0075] By obtaining the topographic information in the game space model and the resource distribution information corresponding to multiple resources in the game space model; performing sandbox background generation processing according to the topographic information in the game space model to obtain a sandbox background image; setting corresponding multiple icons based on the resource types of the multiple resources; and setting the multiple icons on the sandbox background image based on the resource distribution information, a game sandbox map is obtained. The time for setting multiple icons on the sandbox background image and the sandbox background image can be effectively reduced, thereby improving the generation efficiency of the game sandbox map; and the game sandbox map is based on the resource distribution information and topographic information in the game space model, and can more accurately present the topography and resource distribution in the game space model, and the game sandbox map is more accurate.
[0076] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0077] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.
[0078] Figure 1 It is a schematic diagram of an application environment according to an exemplary embodiment.
[0079] Figure 2 The present invention is a flowchart of a method for generating a game sandbox map according to an exemplary embodiment.
[0080] Figure 3is a schematic diagram of a terrain map according to an exemplary embodiment.
[0081] Figure 4 It is a schematic diagram of a land mask map according to an exemplary embodiment.
[0082] Figure 5 The figure is a schematic diagram of a land background picture according to an exemplary embodiment.
[0083] Figure 6 It is a schematic diagram showing a method of splitting a land mask map according to a preset size according to an exemplary embodiment.
[0084] Figure 7 The diagram is a schematic diagram of generating a node graph for an ocean background according to an exemplary embodiment.
[0085] Figure 8 It is a schematic diagram of a sea and land mask map according to an exemplary embodiment.
[0086] Fig. 9 is a schematic diagram of a random terrain according to an exemplary embodiment.
[0087] Fig.10 is a schematic diagram showing a preset plane group according to an exemplary embodiment.
[0088] Fig.11 is a schematic diagram showing a layered contour point according to an exemplary embodiment.
[0089] Fig.12 The figure is a schematic diagram showing a patch corresponding to each layer according to an exemplary embodiment.
[0090] Fig.13 The figure is a schematic diagram showing mesh volume data corresponding to each layer according to an exemplary embodiment.
[0091] Fig.14 The figure is a schematic diagram of an ocean background picture according to an exemplary embodiment.
[0092] Fig.15 The diagram is a schematic diagram of an icon setting node diagram according to an exemplary embodiment.
[0093] Fig.16 The diagram is a schematic diagram showing multiple resource distribution points according to an exemplary embodiment.
[0094] Fig.17 The diagram is a distribution diagram of mountains according to an exemplary embodiment.
[0095] Fig.18The diagram is a schematic diagram showing a plurality of distribution point clusters according to an exemplary embodiment.
[0096] Fig.19 is a schematic diagram showing a clustering area according to an exemplary embodiment.
[0097] Fig. 20 The diagram is a schematic diagram showing the sorting of clustering regions according to size and the center points of the clustering regions according to an exemplary embodiment.
[0098] Fig.21 The figure is a rendering showing a main peak surrounding a secondary peak according to an exemplary embodiment.
[0099] Fig. 22 is a schematic diagram showing distribution points used as a main peak according to an exemplary embodiment.
[0100] Fig.23 The diagram is a schematic diagram showing distribution points of a main peak and distribution points of a secondary peak according to an exemplary embodiment.
[0101] Fig.24 It is a schematic diagram of a game sandbox map according to an exemplary embodiment.
[0102] Fig.25 The present invention is a block diagram of a game sandbox map generating device according to an exemplary embodiment.
[0103] Fig.26 The present invention is a block diagram of an electronic device for generating a game sandbox map according to an exemplary embodiment.
[0104] Fig. 27 The present invention is a block diagram of an electronic device for generating a game sandbox map based on an exemplary embodiment. DETAILED DESCRIPTION
[0105] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.
[0106] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0107] See also Figure 1 , Figure 1 is a schematic diagram of an application environment according to an exemplary embodiment. Figure 1 As shown, the application environment may include a server 01 and a terminal 02 .
[0108] In an optional embodiment, server 01 can be used for processing game sandbox map generation. Specifically, server 01 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.
[0109] In an optional embodiment, the terminal 02 can be used in conjunction with the server 01 to display the sandbox background image, game sandbox map and other visual content in the game sandbox map generation process. Specifically, the terminal 02 can include but is not limited to smart phones, desktop computers, tablet computers, laptops, smart speakers, digital assistants, augmented reality (AR) / virtual reality (VR) devices, smart wearable devices and other types of electronic devices. Optionally, the operating system running on the electronic device can include but is not limited to Android system, IOS system, Linux, Windows, etc.
[0110] In addition, it should be noted that Figure 1 What is shown is merely one application environment of the game sandbox map generation method provided by the present invention.
[0111] In the embodiments of this specification, the server 01 and the terminal 02 may be directly or indirectly connected via wired or wireless communication, and this application does not impose any limitation thereto.
[0112] It should be noted that the following figure shows a possible order of steps, which is not actually limited to this order. Some steps can be executed in parallel without relying on each other. The user information (including but not limited to user device information, user personal information, user behavior information, etc.) and data (including but not limited to data for display, training data, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties.
[0113] Before introducing the method embodiments provided in the present application, a brief introduction is first given to the application scenarios, relevant terms or nouns that may be involved in the method embodiments of the present application to facilitate understanding by technicians in the field of the present application.
[0114] SLG: Strategy Game, strategy game, strategy game is a type of game that requires players to think deeply and make decisions. Players usually need to manage resources, develop tactics and strategies to achieve preset goals.
[0115] PCG: Procedural Content Generation. It is a method of automatically generating game content using algorithms and computer programs without the need for manual production.
[0116] Tiling: Tiling technology is a texture mapping method in computer graphics, which is a technique for repeatedly using smaller texture image blocks (called "tiles") to cover larger surfaces. This process helps save memory, improve rendering efficiency, and enhance visual effects.
[0117] Houdini: Movie Special Effects Magician is a 3D computer graphics software that is an effective tool for creating advanced visual effects.
[0118] UV: In graphics, UV refers to texture coordinates, which are used to map a two-dimensional image (texture) onto the surface of a three-dimensional model. Specifically, UV coordinates are used to define how to apply a texture map to each vertex of the model.
[0119] Ramp Texture: Ramp map is a special type of texture widely used in computer graphics and 3D rendering. It is often used to create gradient effects and control changes in color, transparency or other material properties.
[0120] DBSCAN: Density-Based Spatial Clustering of Applications with Noise, is a density-based clustering algorithm used to discover clusters of arbitrary shapes in a noisy database.
[0121] Figure 2 FIG. 1 is a flow chart of a method for generating a game sandbox map according to an exemplary embodiment. Figure 2 As shown, the following steps may be included.
[0122] In step S201, landform information in the game space model and resource distribution information corresponding to a plurality of resources in the game space model are obtained.
[0123] In the embodiments of this specification, the game space model may refer to a model used to represent the landforms and multiple resources in the game space, and the multiple resources may include but are not limited to buildings, trees, mountains, etc. The landform information may include but is not limited to landform information, ocean landform information, etc., and this disclosure does not limit this.
[0124] The resource distribution information corresponding to the multiple resources can be used to represent the distribution positions of the multiple resources in the game space model. For example, the resource distribution information corresponding to the multiple resources can be the distribution points of the multiple resources in the game space model. For example, the distribution points can be represented by coordinates, which is not limited in the present disclosure.
[0125] In a possible implementation, the topographic description information of the game space model can be obtained, so that the topographic information in the game space model can be extracted from the topographic description information. And the resource distribution information corresponding to multiple resources in the game space model can be obtained, for example, the location information of multiple resources in the game space model, such as coordinate information, can be obtained.
[0126] In step S203, a sandbox background generation process is performed according to the landform information in the game space model to obtain a sandbox background image.
[0127] In the embodiment of the present specification, a sand table background image can be generated according to the landform information in the game space model. For example, a background image corresponding to a landform can be generated according to different landform information, and then the background images corresponding to different landforms can be spliced into a sand table background image according to the boundaries or relative positions of different landforms.
[0128] In a possible implementation, the landform information may include land landform information and sea and land landform height maps. Based on this, the sand table background generation process based on the landform information in the game space model to obtain the sand table background image may include: generating a land background image based on the land landform information; and generating an ocean background image based on the sea and land landform height map; thereby, the land background image and the ocean background image may be spliced based on the positional relationship between the land and the ocean to obtain the sand table background image. By automatically generating the land background image and the ocean background image, and splicing the land background image and the ocean background image based on the positional relationship between the land and the ocean to obtain the sand table background image, the generation efficiency of the sand table background image may be improved.
[0129] In one example, the above-mentioned generation of a land background image based on landform information may include: obtaining a landform representative map based on the landform information; and determining a landform representative color based on the landform representative map; further, binarizing the landform representative color to obtain a land mask map; and performing texture mapping on the land mask map to obtain a land background image. Specifically, different landform representative maps may be used to represent different landforms, for example, Figure 3 , four types of landform representative maps can be used to represent different landforms. Based on the corresponding relationship of this representation, the corresponding landform representative map can be obtained according to the landform information. Among them, the landform information can refer to the information of the landform in the game space model, for example, it can include information such as the outline of the landform. For the outline of the landform, the binary value of 0 and 1 can be written into the material by comparing the ocean height and the land height, 1 represents land, and 0 represents ocean. The Alpha channel of the map is written to distinguish between landforms and ocean landforms. Therefore, the outline of the landform can be obtained based on the area marked 1.
[0130] Furthermore, the landform representative color can be determined based on the landform representative map. For example, the color in the landform representative map can be determined as the landform representative color. Exemplarily, the average color value of all pixels in the landform representative map can be calculated, and the average color value can be used as the landform representative color of the landform representative map. Optionally, the landform representative color of the landform representative map can be used as the representative color of the landform (the landform information corresponds to the landform) and output in the material.
[0131] Next, the representative color of the landform can be binarized to obtain the land mask map, for example Figure 4 As shown. Thus, the land mask map can be texture mapped to obtain a land background image, for example Figure 5 The texture mapping process can be implemented using Tiling technology, which is not limited in the present disclosure.
[0132] By obtaining a landform representative map based on landform information, and determining the landform representative color based on the landform representative map, further, binarizing the landform representative color to obtain a land mask map, and performing texture mapping on the land mask map to obtain a land background image, the generation efficiency of the land background image and the accuracy of the land background image can be improved, and the generalization of the generation method of the land background image can be improved, and it can be effectively applied to the rapid generation of land background images in the sandbox backgrounds of different games.
[0133] Optionally, considering that the size of the land mask map obtained above is still relatively large, the embodiment of this specification chooses to further split the land mask map into small blocks of a fixed size, so as to further reduce the required size of the land mask map, for example, from 3840x3840 to 1024x2048, so as to further improve the efficiency of generating subsequent game sandbox maps. Based on this, the above-mentioned texture mapping processing of the land mask map to obtain the land background image may include: splitting the land mask map according to a preset size to obtain split land mask sub-images; and texture mapping and splicing the land mask sub-images to obtain the land background image. Exemplarily, the preset size may be as follows: Figure 6 The size of the small blocks shown in the figure is not limited to the preset size in the present disclosure.
[0134] In another example, the sea and land height map can be a sea and land mask map, which is used to generate an ocean background image. Based on this, the above generation of an ocean background image based on the sea and land height map can include: lifting and eroding the sea and land mask map to obtain random terrain; using a preset plane group to slice the random terrain to obtain layered contour points; based on the contour points corresponding to each layer, generating the corresponding facets of each layer; triangulating the corresponding facets of each layer to generate the corresponding mesh data of each layer; and performing gradient color rendering of each layer according to the mesh data to obtain the ocean background image.
[0135] Among them, the sea and land landform height map can be used to mark the altitude of marine landforms and the altitude of landforms, and can distinguish marine landforms from landforms. For example, the sea-land boundary altitude can be preset, and the landforms with an altitude higher than the preset sea-land boundary altitude can be regarded as landforms, and the landforms with an altitude lower than the preset sea-land boundary altitude can be regarded as marine landforms. Random terrain can be three-dimensional terrain. Triangulating the facets corresponding to each layer can refer to characterizing the facets by multiple triangles, and the mesh data corresponding to each layer can refer to the data of multiple triangles. For example, the mesh data may include UV data for marking the information of the layer in which the mesh (i.e., the triangle) is located, the position information in the corresponding facet, the information of the triangle in which it is located, etc. Gradient color rendering of each layer according to the mesh data may include filling the gradient color according to the height of each layer.
[0136] In an optional implementation, after the step of obtaining the layered contour points, the method may further include: sharpening the corners of the contour points to obtain stylized contour points. Accordingly, the above-mentioned generation of the corresponding facets of each layer based on the contour points corresponding to each layer may include: generating the corresponding facets of each layer based on the stylized contour points corresponding to each layer.
[0137] In an application example, Unity and Houdini can be combined to configure PCG parameters on the Unity side and develop actual PCG functions on the Houdini side to generate an in-game sandbox map, i.e., a game sandbox map. Figure 7 , a visual ocean background generation node graph can be built on the Houdini side. The ocean background generation node graph can refer to a flowchart of unit functions for generating ocean background images. Each node can represent a unit function, that is, a program code that implements a function. The unit function can be preset on the Houdini side. In this way, the input is processed according to the process sequence of the nodes in the node graph to obtain the output. Based on this, the sea and land mask graph (for example Figure 8 As shown in Figure 2, the sea and land mask map is lifted and eroded by the unit function of each node to obtain a random terrain, such as Fig. 9 As shown. And you can use the preset plane group (such as Fig.10 As shown in Figure 2), the random terrain is sliced, that is, the random terrain is discretized to obtain layered contour points, such as Fig.11 As shown. The layered contour points may refer to the points on the contour of the edge where each plane in the preset plane group intersects with the random terrain. And based on the contour points corresponding to each layer, the corresponding facets of each layer may be generated, for example Fig.12 As shown. And the facets corresponding to each layer can be triangulated to generate the mesh data corresponding to each layer, for example Fig.13 As shown. Thus, the gradient color rendering of each layer can be performed according to the mesh data, for example, Ramp mapping processing can be performed to obtain an ocean background image for output. The ocean background image can be as shown Fig.14 shown.
[0138] By lifting and eroding the sea and land mask map, random terrain is obtained; using a preset plane group, the random terrain is sliced to obtain layered contour points; based on the contour points corresponding to each layer, the corresponding facets of each layer are generated; the facets corresponding to each layer are triangulated to generate the mesh data corresponding to each layer; and the gradient color rendering of each layer is performed according to the mesh data to obtain the ocean background picture, which can improve the generation efficiency and accuracy of the ocean background picture, and can improve the generalization of the generation method of the ocean background picture, and can effectively apply to the rapid generation of ocean background pictures in the sandbox background of different games. And by sharpening the corners of the contour points, stylized contour points are obtained, and based on the stylized contour points corresponding to each layer, the corresponding facets of each layer are generated, so that the contour of the generated ocean background picture is more natural.
[0139] In step S205, a plurality of corresponding icons are set based on resource types of the plurality of resources.
[0140] In the embodiments of the present specification, a plurality of corresponding icons may be set based on resource types of a plurality of resources. The icon may refer to an image that can represent the resource. For example, if the resource is a tree, the corresponding icon may be a picture of a tree.
[0141] In step S207, various icons are set on the sandbox background image based on the resource distribution information to obtain a game sandbox map.
[0142] In the embodiments of this specification, the resource distribution information may be the distribution position of each resource. Based on the resource distribution information, a plurality of icons may be set on the sandbox background image. For example, a plurality of icons may be set at corresponding distribution positions of the sandbox background image to obtain a game sandbox map.
[0143] By obtaining the topographic information in the game space model and the resource distribution information corresponding to multiple resources in the game space model; performing sandbox background generation processing according to the topographic information in the game space model to obtain a sandbox background image; setting corresponding multiple icons based on the resource types of the multiple resources; and setting the multiple icons on the sandbox background image based on the resource distribution information, a game sandbox map is obtained. The time for setting multiple icons on the sandbox background image and the sandbox background image can be effectively reduced, thereby improving the generation efficiency of the game sandbox map; and the game sandbox map is based on the resource distribution information and topographic information in the game space model, and can more accurately present the topography and resource distribution in the game space model, and the game sandbox map is more accurate.
[0144] In a possible implementation, the resource distribution information may include multiple resource distribution points of multiple resources. Accordingly, the setting of multiple icons on the sandbox background image based on the resource distribution information to obtain the game sandbox map may include: clustering multiple resource distribution points to obtain multiple distribution point clusters; determining the center point of the cluster area corresponding to each distribution point cluster; and binding corresponding icons to each distribution point cluster based on the resource type corresponding to each distribution point cluster to obtain binding information; and setting the corresponding icon at the position of the center point on the sandbox background image according to the binding information to obtain the game sandbox map.
[0145] Among them, the above-mentioned clustering of multiple resource distribution points to obtain multiple distribution point clusters may include: determining the core distribution points that meet the density reachability conditions among the multiple resource distribution points based on a preset radius and a preset number of distribution points; screening the density reachable distribution points corresponding to each core distribution point to form a distribution point cluster for each core distribution point.
[0146] As an example, you can build a visual icon setting node graph on the Houdini side, for example Fig.15As shown, it is used to set multiple icons on the sandbox background image based on the resource distribution information to obtain the processing of the game sandbox map. For example, taking the mountain icon setting as an example, the mountain point set can be clustered by the DBSCAN algorithm. The DBSCAN algorithm can identify clusters and noise points by evaluating the density of data points. Its basic idea is as follows:
[0147] Density accessibility (density accessibility condition): Given a radius ∈ (epsilon, i.e. the preset radius) and a minimum number of points MinPts (i.e. the preset number of distribution points), if there are at least MinPts points in the ∈-neighborhood of a point, then the point is a core distribution point (Core Point).
[0148] Density connectivity: If point p is a core distribution point and point q is in the ∈-neighborhood of p, then point q is a direct density-reachable point of point p. If point q is also a core distribution point, then the points in its ∈-neighborhood are also considered density-reachable, that is, non-direct density-reachable points, thus forming a density-reachable chain.
[0149] Cluster: The largest set of core distribution points and their density-reachable distribution points. The density-reachable distribution points can include directly density-reachable points and indirect density-reachable points.
[0150] Noise point: Any point that does not belong to any cluster.
[0151] The algorithm steps of DBSCAN can be as follows:
[0152] Initial state: All multiple resource distribution points are unvisited.
[0153] Select an unvisited resource distribution point and mark it as visited.
[0154] Check the ∈-neighborhood of the point:
[0155] If the number of resource distribution points in the neighborhood is not less than MinPts, it is taken as the core distribution point and a new cluster is started.
[0156] If the number of resource distribution points in the neighborhood is less than MinPts, the point is marked as a noise point (it may be re-marked later).
[0157] Expand the cluster: Repeat the above steps for each density-reachable distribution point of the core distribution point, add it to the same cluster, and mark it as visited.
[0158] Repeat: Continue to select unvisited resource distribution points and repeat the above process until all resource distribution points are visited.
[0159] Among them, ∈: determines the neighborhood range of a resource distribution point and affects the shape and size of the cluster. Too small will lead to more noise points, and too large will lead to the merger of different clusters.
[0160] MinPts: The minimum number of neighboring points that determines whether a resource distribution point is a core distribution point. Generally, MinPts is set to at least twice the data dimension.
[0161] By clustering resource distribution points, clusters of arbitrary shapes can be discovered without pre-specifying the number of clusters, and the method is highly robust to noisy data.
[0162] Reference Fig.16 , which can be multiple resource distribution points, refer to Fig.17 , where darker points can be mountains and lighter points can be trees. Based on this, multiple resource distribution points are clustered to obtain multiple distribution point clusters, such as Fig.18 As shown. Further, the center point of the clustering area corresponding to each distribution point cluster can be determined, and the clustering area can be as follows Fig.19 As shown, the cluster regions are sorted by size and the center points of the cluster regions can be Fig. 20 Next, according to the art principle of subject first and attachment second, we need to have the effect of the main peak surrounding the secondary peaks. By analyzing the area with the largest area as the main peak, the remaining points are close to the main peak. Fig.21 The main peak surrounds the secondary peak. Thus, the distribution points used as the main peak can be obtained, such as Fig. 22 Based on this, combined with the distribution points of the secondary peaks, the following can be seen: Fig.23 These distribution points can be bound to corresponding icons, and after output, the effect can be restored in Unity to obtain the final effect, that is, the game sandbox map, as shown in Fig.24 shown.
[0163] By clustering the resource distribution points, multiple distribution point clusters are obtained; the center point of the cluster area corresponding to each distribution point cluster is determined; and based on the resource type corresponding to each distribution point cluster, a corresponding icon can be bound to each distribution point cluster to obtain binding information; according to the binding information, a corresponding icon is set at the position of the center point on the sand table background image to obtain a game sand table map. One icon can be used to represent one cluster area, which reduces the number of icon settings and ensures the accuracy of the game sand table map.
[0164] Fig.25 is a block diagram of a game sandbox map generation device according to an exemplary embodiment. Fig.25 , the device may include:
[0165] A landform and resource distribution acquisition module 2501 is configured to execute acquisition of landform information in a game space model and resource distribution information corresponding to a plurality of resources in the game space model;
[0166] The sandbox background image acquisition module 2503 is configured to perform sandbox background generation processing according to the landform information in the game space model to obtain a sandbox background image;
[0167] An icon setting module 2505 is configured to set a plurality of icons corresponding to resource types of the plurality of resources;
[0168] The game sandbox map acquisition module 2507 is configured to set the multiple icons on the sandbox background image based on the resource distribution information to obtain a game sandbox map.
[0169] By obtaining the topographic information in the game space model and the resource distribution information corresponding to multiple resources in the game space model; performing sandbox background generation processing according to the topographic information in the game space model to obtain a sandbox background image; setting corresponding multiple icons based on the resource types of the multiple resources; and setting the multiple icons on the sandbox background image based on the resource distribution information, a game sandbox map is obtained. The time for setting multiple icons on the sandbox background image and the sandbox background image can be effectively reduced, thereby improving the generation efficiency of the game sandbox map; and the game sandbox map is based on the resource distribution information and topographic information in the game space model, and can more accurately present the topography and resource distribution in the game space model, and the game sandbox map is more accurate.
[0170] In a possible implementation, in a possible implementation, the landform information includes land landform information and sea and land landform height map; the sand table background image acquisition module 2503 may include:
[0171] A land background image generating unit is configured to generate a land background image according to the land topography information;
[0172] An ocean background image generating unit is configured to generate an ocean background image according to the sea and land height map;
[0173] The splicing unit is configured to execute splicing of the land background image and the ocean background image based on the positional relationship between the land and the ocean to obtain the sand table background image.
[0174] In a possible implementation, the land background image generating unit includes:
[0175] A landform representative map acquisition subunit is configured to obtain a landform representative map according to the landform information;
[0176] A landform representative color determination subunit is configured to determine a landform representative color based on the landform representative map;
[0177] The land mask map acquisition subunit is configured to perform binarization processing on the landform representative color to obtain a land mask map;
[0178] The land background image generation subunit is configured to perform texture mapping processing on the land mask map to obtain the land background image.
[0179] In a possible implementation, the land background image generation subunit is further configured to perform splitting processing on the land mask map according to a preset size to obtain split land mask sub-images; and perform texture mapping processing and splicing processing on the land mask sub-images to obtain the land background image.
[0180] In a possible implementation, the sea and land height map is a sea and land mask map; and the ocean background image generating unit includes:
[0181] A random terrain acquisition subunit is configured to perform lifting and erosion on the sea and land mask map to obtain a random terrain;
[0182] A contour point acquisition subunit is configured to perform slicing processing on the random terrain using a preset plane group to obtain layered contour points;
[0183] A patch generation subunit is configured to generate a patch corresponding to each layer based on the contour points corresponding to each layer;
[0184] A mesh volume data generation subunit is configured to perform triangulation processing on the facets corresponding to each layer to generate mesh volume data corresponding to each layer;
[0185] The ocean background image acquisition subunit is configured to perform gradient color rendering of each layer according to the grid volume data to obtain the ocean background image.
[0186] In a possible implementation manner, the device further includes:
[0187] A stylization unit, configured to perform corner sharpening on the contour points to obtain stylized contour points;
[0188] The patch generation subunit is further configured to generate patches corresponding to each layer based on the stylized contour points corresponding to each layer.
[0189] In a possible implementation, the resource distribution information includes multiple resource distribution points of the multiple resources; the game sandbox map acquisition module 2507 may include:
[0190] A clustering unit, configured to perform clustering on the plurality of resource distribution points to obtain a plurality of distribution point clusters;
[0191] A cluster center point determination unit is configured to determine the center point of the cluster area corresponding to each distribution point cluster;
[0192] The icon binding unit is configured to bind the corresponding icon to each distribution point cluster based on the resource type corresponding to each distribution point cluster, and obtain binding information;
[0193] The game sandbox map acquisition unit is configured to set a corresponding icon at the position of the center point on the sandbox background image according to the binding information to obtain the game sandbox map.
[0194] In a possible implementation, the clustering unit includes:
[0195] A core distribution point determination subunit is configured to determine a core distribution point that meets a density reachability condition among the plurality of resource distribution points based on a preset radius and a preset number of distribution points;
[0196] The cluster acquisition subunit is configured to perform screening of density-reachable distribution points corresponding to each core distribution point to form a distribution point cluster for each core distribution point.
[0197] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0198] Fig.26 is a block diagram of an electronic device for generating a game sandbox map according to an exemplary embodiment. The electronic device may be a terminal, and its internal structure diagram may be as shown in FIG. Fig.26As shown. The electronic device includes a processor, a memory, a network interface, a display screen and an input device connected via a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the electronic device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a method for generating a game sandbox map is implemented. The display screen of the electronic device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the housing of the electronic device, or an external keyboard, touchpad or mouse, etc.
[0199] Those skilled in the art will understand that Fig.26 The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present disclosure, and does not constitute a limitation on the electronic device to which the scheme of the present disclosure is applied. The specific electronic device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0200] Fig. 27 The block diagram of an electronic device for generating a game sandbox map is shown based on an exemplary embodiment. The electronic device may be a server, and its internal structure diagram may be as shown in FIG. Fig. 27 As shown. The electronic device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the electronic device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for generating a game sandbox map is implemented.
[0201] Those skilled in the art will understand that Fig. 27 The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present disclosure, and does not constitute a limitation on the electronic device to which the scheme of the present disclosure is applied. The specific electronic device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0202] In an exemplary embodiment, an electronic device is also provided, including: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement a game sandbox map generation method as in an embodiment of the present disclosure.
[0203] In an exemplary embodiment, a computer-readable storage medium is also provided, and when the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the game sandbox map generation method in the embodiment of the present disclosure. The computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0204] In an exemplary embodiment, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute the method for generating a game sandbox map in the embodiment of the present disclosure.
[0205] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0206] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0207] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A method for generating a game sandbox map, characterized in that: include: Acquire landform information in a game space model and resource distribution information corresponding to a plurality of resources in the game space model; Perform sandbox background generation processing according to the landform information in the game space model to obtain a sandbox background image; Setting a plurality of corresponding icons based on resource types of the plurality of resources; The multiple icons are set on the sandbox background image based on the resource distribution information to obtain a game sandbox map.
2. The method according to claim 1, characterized in that: The landform information includes land landform information and sea and land landform height map; the sand table background generation process is performed according to the landform information in the game space model to obtain a sand table background picture, including: Generate a land background picture according to the landform information; Generate an ocean background picture according to the sea and land height map; Based on the positional relationship between the land and the ocean, the land background image and the ocean background image are spliced to obtain the sand table background image.
3. The method according to claim 2, characterized in that The step of generating a land background image according to the landform information includes: According to the landform information, a landform representative map is obtained; Determining a landform representative color based on the landform representative map; Binarizing the representative color of the landform to obtain a land mask map; The land mask map is texture mapped to obtain the land background image.
4. The method according to claim 3, characterized in that The step of performing texture mapping on the land mask map to obtain the land background image includes: Splitting the land mask map according to a preset size to obtain split land mask sub-maps; The land mask sub-image is texture mapped and spliced to obtain the land background image.
5. The method according to claim 1, characterized in that The sea and land height map is a sea and land mask map; generating an ocean background image according to the sea and land height map includes: Lifting and eroding the sea and land mask map to obtain random terrain; Using a preset plane group, slicing the random terrain to obtain layered contour points; Based on the contour points corresponding to each layer, generate a surface patch corresponding to each layer; Triangulate the facets corresponding to each layer to generate mesh data corresponding to each layer; Gradient color rendering is performed on each layer according to the mesh volume data to obtain the ocean background image.
6. The method according to claim 5, characterized in that After the step of obtaining the layered contour points, the method further comprises: Sharpening the corners of the contour points to obtain stylized contour points; The step of generating a patch corresponding to each layer based on the contour points corresponding to each layer includes: Based on the stylized contour points corresponding to each layer, a patch corresponding to each layer is generated.
7. The method according to claim 1, characterized in that The resource distribution information includes multiple resource distribution points of the multiple resources; the multiple icons are set on the sandbox background picture based on the resource distribution information to obtain a game sandbox map, including: Clustering the multiple resource distribution points to obtain multiple distribution point clusters; Determine the center point of the clustering area corresponding to each distribution point cluster; Based on the resource types corresponding to the distribution point clusters, bind the corresponding icons to the distribution point clusters to obtain binding information; According to the binding information, a corresponding icon is set at the position of the center point on the sandbox background image to obtain the game sandbox map.
8. The method according to claim 7, characterized in that The clustering of the plurality of resource distribution points to obtain a plurality of distribution point clusters includes: Based on a preset radius and a preset number of distribution points, determining a core distribution point among the multiple resource distribution points that meets a density reachability condition; The density-reachable distribution points corresponding to each core distribution point are screened to form a distribution point cluster for each core distribution point.
9. A game sandbox map generating device, characterized in that: include: A landform and resource distribution acquisition module is configured to acquire landform information in a game space model and resource distribution information corresponding to a plurality of resources in the game space model; A sandbox background image acquisition module is configured to perform sandbox background generation processing according to the landform information in the game space model to obtain a sandbox background image; An icon setting module, configured to set a plurality of icons corresponding to the resource types of the plurality of resources; The game sandbox map acquisition module is configured to set the multiple icons on the sandbox background image based on the resource distribution information to obtain the game sandbox map.
10. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; Wherein, the processor is configured to execute the instructions to implement the game sandbox map generation method as described in any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the game sandbox map generation method as described in any one of claims 1 to 8.
12. A computer program product, characterized in that It comprises computer instructions, which, when executed by a processor, enable the computer to execute the game sandbox map generation method as described in any one of claims 1 to 8.
