Game data processing method and device, electronic equipment and storage medium
By combining game scenes and models with two-dimensional and three-dimensional image modes on mobile devices, obstacle maps are generated and movement paths are determined, solving the problems of low realism and interactivity in existing technologies and achieving an efficient gaming experience and device compatibility.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING 58 INFORMATION TTECH CO LTD
- Filing Date
- 2021-12-28
- Publication Date
- 2026-05-19
AI Technical Summary
In existing technologies, the realism and interactivity of two-dimensional image game scenes on mobile devices are low, and three-dimensional image modes result in high performance overhead, affecting the user experience.
By combining a two-dimensional game scene with a three-dimensional game model, an obstacle map is generated, and the target movement path is determined based on movement information. The game model is then controlled to move within the scene, thus achieving a combination of two-dimensional and three-dimensional elements.
It improves the realism and interactivity of the game, reduces device performance overhead, is compatible with devices of different performance levels, and enhances the game's versatility.
Smart Images

Figure CN114404993B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a method for processing game data, a device for processing game data, an electronic device, and a computer-readable storage medium. Background Technology
[0002] With the widespread adoption of mobile devices, various applications for these devices are becoming increasingly common. For aggregation platform applications, developers can embed mini-games to enhance user retention and enrich app functionality. However, most of these games use two-dimensional graphics to load game scenes, operate on a flat plane, and have relatively simple functions, resulting in a "paper-like" visual effect that lacks realism and interactivity, and offers little fun. Furthermore, using three-dimensional graphics to process game content increases the performance overhead on mobile devices, especially on devices with poor performance, which can easily lead to app crashes and lag, severely impacting the user's gaming experience. Summary of the Invention
[0003] This invention provides a method, apparatus, electronic device, and computer-readable storage medium for processing game data, in order to solve or partially solve the problems of low realism and interactivity of game content and incompatibility with devices of different performance in related technologies.
[0004] This invention discloses a method for processing game data, including:
[0005] Acquire game resources, which include at least scene resources, model resources, obstacle information for the scene resources, and model display parameters for the model resources;
[0006] The game scene corresponding to the scene resource is displayed in a two-dimensional image mode, and the game model corresponding to the model resource is displayed in the game scene in a three-dimensional image mode according to the model display parameters;
[0007] The game scene is processed based on the obstacle information to generate an obstacle map;
[0008] The movement information of the game model is obtained, and the target movement path of the game model is determined in the obstacle map based on the movement information.
[0009] Optionally, it also includes:
[0010] Control the game model to move according to the target movement path.
[0011] Optionally, displaying the game scene corresponding to the scene resource in a two-dimensional image mode includes:
[0012] Retrieve the game scene nodes corresponding to the game;
[0013] Extract scene images corresponding to each game scene node from the scene resources;
[0014] Render the scene image corresponding to each of the game scene nodes, and display the game scene corresponding to the scene resource in a two-dimensional image mode.
[0015] Optionally, the model display parameters include at least display level parameters and display outline parameters. The step of displaying the game model corresponding to the model resource in a 3D image mode in the game scene according to the model display parameters includes:
[0016] Retrieve the game model node corresponding to the game;
[0017] Extract the target game model corresponding to the game model node from the model resource, and determine the target display level parameters and target display outline parameters corresponding to the target game model;
[0018] The target display outline parameters are added to the game model node to obtain the display information of the target game model in the game scene;
[0019] Based on the display level parameters and the display information, the target game model is displayed in the game scene in a three-dimensional image mode.
[0020] Optionally, the display information includes model height and model width, and the step of displaying the target game model in a 3D image mode in the game scene according to the display level parameters and the display information includes:
[0021] The target game model is displayed on top of the game scene in a 3D image mode according to the display hierarchy parameters, and the target game model is displayed according to the model height and the model width.
[0022] Optionally, the step of processing the game scene based on the obstacle information to generate an obstacle map includes:
[0023] Image recognition is performed on the game scene to obtain virtual obstacles in the game scene and their location information in the game scene;
[0024] Obtain the occlusion object corresponding to the virtual obstacle from the obstacle information;
[0025] Based on the location information of each virtual obstacle, the occlusion objects corresponding to each virtual obstacle are added to the game scene to generate an obstacle map.
[0026] Optionally, the movement information includes a movement start point and a movement end point, and determining the target movement path of the game model in the obstacle map based on the movement information includes:
[0027] Using the starting point and the ending point of movement, at least one initial movement path is determined in the obstacle map;
[0028] The shortest initial movement path is taken as the target movement path of the game model.
[0029] This invention also discloses a game data processing apparatus, comprising:
[0030] The game resource acquisition module is used to acquire game resources, which include at least scene resources, model resources, obstacle information for the scene resources, and model display parameters for the model resources.
[0031] The game content display module is used to display the game scene corresponding to the scene resource in a two-dimensional image mode, and to display the game model corresponding to the model resource in the game scene in a three-dimensional image mode according to the model display parameters;
[0032] An obstacle map generation module is used to process the game scene based on the obstacle information and generate an obstacle map.
[0033] The movement path determination module is used to acquire the movement information of the game model and determine the target movement path of the game model in the obstacle map based on the movement information.
[0034] Optionally, it also includes:
[0035] The model movement control module is used to control the game model to move according to the target movement path.
[0036] Optionally, the game content display module includes:
[0037] The scene node acquisition submodule is used to acquire game scene nodes corresponding to the game;
[0038] The scene image extraction submodule is used to extract scene images corresponding to each of the game scene nodes from the scene resources;
[0039] The game scene display submodule is used to render the scene images corresponding to each game scene node and display the game scene corresponding to the scene resource in a two-dimensional image mode.
[0040] Optionally, the model display parameters include at least display hierarchy parameters and display outline parameters, and the game content display module includes:
[0041] The model node acquisition submodule is used to acquire game model nodes corresponding to the game;
[0042] The parameter determination submodule is used to extract the target game model corresponding to the game model node from the model resource, and determine the target display level parameters and target display outline parameters corresponding to the target game model;
[0043] The display information acquisition submodule is used to add the target display outline parameters to the game model node to obtain the display information of the target game model in the game scene;
[0044] The game model display submodule is used to display the target game model in the game scene in a three-dimensional image mode according to the display level parameters and the display information.
[0045] Optionally, the display information includes the model height and the model width, and the game model display submodule is specifically used for:
[0046] The target game model is displayed on top of the game scene in a 3D image mode according to the display hierarchy parameters, and the target game model is displayed according to the model height and the model width.
[0047] Optionally, the obstacle map generation module includes:
[0048] The location information determination submodule is used to perform image recognition on the game scene and obtain the virtual obstacles in the game scene and the location information of the virtual obstacles in the game scene.
[0049] The occlusion object acquisition submodule is used to acquire the occlusion object corresponding to the virtual obstacle from the obstacle information;
[0050] The obstacle map generation submodule is used to add the occlusion objects corresponding to each virtual obstacle to the game scene based on the position information of each virtual obstacle, thereby generating an obstacle map.
[0051] Optionally, the movement information includes a movement origin and a movement destination, and the movement path determination module includes:
[0052] The movement path determination submodule is used to determine at least one initial movement path in the obstacle map using the movement start point and the movement end point.
[0053] The movement path filtering submodule is used to select the shortest initial movement path as the target movement path for the game model.
[0054] This invention also discloses an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;
[0055] The memory is used to store computer programs;
[0056] When the processor executes a program stored in the memory, it implements the method described in the embodiments of the present invention.
[0057] This invention also discloses a computer-readable storage medium storing instructions that, when executed by one or more processors, cause the processors to perform the methods described in this invention.
[0058] The embodiments of the present invention have the following advantages:
[0059] In this embodiment of the invention, during gameplay, the terminal can acquire game resources, which may include scene resources, model resources, obstacle information for the scene resources, and model display parameters for the model resources. Then, the game scene corresponding to the scene resources can be displayed in a two-dimensional image mode, and the game model corresponding to the model resources can be displayed in a three-dimensional image mode within the game scene according to the model display parameters. The game scene can then be processed based on the obstacle information to generate a corresponding obstacle map, and the movement information of the game model can be acquired. The target movement path of the game model can then be determined in the obstacle map based on the movement information, so as to control the movement of the game model within the game scene. Thus, for the application's game, by rendering 2D game scenes and 3D game models, the two-dimensional game scene and the three-dimensional game model are combined. While providing users with the realism and interactivity of the game through 3D, the high device performance overhead of pure 3D is avoided, allowing compatibility with devices of different performance levels and resulting in high game versatility. Attached Figure Description
[0060] Figure 1 This is a flowchart of the steps of a game data processing method provided in an embodiment of the present invention;
[0061] Figure 2 This is a structural block diagram of a game data processing device provided in an embodiment of the present invention;
[0062] Figure 3 This is a block diagram of an electronic device provided in an embodiment of the present invention;
[0063] Figure 4 This is a schematic diagram of a computer-readable storage medium provided in an embodiment of the present invention. Detailed Implementation
[0064] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0065] As an example, with the widespread adoption of mobile devices, mobile-based applications are involved in various industries. To enhance user retention, more and more aggregation platform applications are incorporating mini-games. However, most mini-games in non-game applications currently use 2D scenes, resulting in largely flat operations. The user interface typically involves playing preset sequence frames of animation and executing corresponding animations. These games have limited functionality, offering only "paper-thin" graphics with low realism and a lack of interactivity, further reducing their appeal. Furthermore, purely 3D games involve large resource packages, and loading 3D game resources requires significant system resources from the mobile device, easily causing crashes or device lag, resulting in a poor gaming experience.
[0066] One of the core inventive points of this invention is the combination of 2D game scenes and 3D game models. Compared with pure 2D games, this improves the interactivity and fun of the game; compared with pure 3D games, it optimizes the processing of game resources, effectively reducing device performance overhead and ensuring compatibility with devices of different performance levels. Specifically, during gameplay, the terminal can acquire game resources, which may include scene resources, model resources, obstacle information for scene resources, and model display parameters for model resources. Then, the game scene corresponding to the scene resources can be displayed in a two-dimensional image mode, and a three-dimensional image can be displayed within the game scene based on the model display parameters. The mode displays the game model corresponding to the model resource. Then, it can process the game scene based on obstacle information to generate a corresponding obstacle map and obtain the movement information of the game model. Then, based on the movement information, it determines the target movement path of the game model in the obstacle map so as to control the movement of the game model in the game scene. Thus, for the game application, by rendering 2D game scenes and 3D game models, it combines two-dimensional game scenes with three-dimensional game models. While bringing the realism and interactivity of the game to users through 3D, it avoids the high device performance overhead caused by pure 3D. It can be compatible with devices with different performance and has high game versatility.
[0067] To enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, some technical terms involved in the embodiments of the present invention are explained and described below:
[0068] In the game framework SpriteKit, every screen element can become a node. A node can be a visible element or container of other nodes. By designing the hierarchical structure of nodes, the scene page of the entire game scene can be constructed.
[0069] SKSpriteNode: Refers to the node rendered from the image or the node rendered from the color value.
[0070] SKShapeNode: A node whose outline is drawn or defined.
[0071] SK3DNode: A node that loads 3D game models.
[0072] GKPolygonObstacle: An obstacle is a device used in a game scene to transform objects at certain nodes into fences. The area filled by the fence is considered a real object in the scene. When models (character models, etc.) move in the game scene, this object area cannot be obscured or passed through by the model, and the model will avoid this area when moving.
[0073] Specifically, refer to Figure 1 The diagram illustrates a flowchart of a game data processing method provided in an embodiment of the present invention, which may specifically include the following steps:
[0074] Step 101: Obtain game resources, which include at least scene resources, model resources, obstacle information for the scene resources, and model display parameters for the model resources;
[0075] Optionally, embodiments of the present invention can be applied to terminal devices, in which corresponding applications can run. The applications can provide corresponding game functions. When a user uses the game functions in the applications, the terminal can load the corresponding game resources and display the game scene and game model in the graphical user interface.
[0076] Game resources can include game scene resources, model resources, obstacle information for scene resources, and model display parameters for model resources. Specifically, scene resources can be resources needed to render the game scene, such as scene images and background music; model resources can be virtual objects in the game scene, such as user-controlled player characters and non-player characters in the game. For player and non-player characters, these can be 3D game models; obstacle information, since the game scene can be 2D, allows setting corresponding obstacles in the game scene to simulate the movement of 3D game models in a 3D scene, improving the realism of the game scene; model display parameters are parameters that adjust the display of game models in the game scene. For 2D game scenes, since they directly display flat images and do not have a spatial three-dimensional concept, their rendering method differs from that of 3D game models. Therefore, rendering 3D game models requires handling the layer occlusion problem between them and the 2D game scene. Model display parameters can effectively adjust the display layer relationship between the 2D game scene and the 3D game model, achieving a combination between the 2D game scene and the 3D game model.
[0077] In one example, for in-app games, a 2D game scene framework can be used. On iOS, the 2D game scene framework can be SpriteKit. For environment props and assets within the game scene, SKSpriteNode can be used to display 2D image resources, thus constructing the game scene. For player characters or non-player character models, SK3DNode classes can be used to load 3D game models into the 2D game scene. Furthermore, the loading of 3D game models requires processing; since the game scene is planar, loading a 3D game model requires combining its own node with the scene it is bound to for rendering. This combines the 2D game scene with 3D game models, creating new gameplay mechanics and enhancing user interactivity and enjoyment.
[0078] Step 102: Display the game scene corresponding to the scene resource in a two-dimensional image mode, and display the game model corresponding to the model resource in the game scene in a three-dimensional image mode according to the model display parameters;
[0079] In this embodiment of the invention, scene resources can be loaded and rendered to obtain a game scene displayed in a two-dimensional image mode, while model resources can be loaded and rendered and processed according to model display parameters to obtain a game model displayed in a three-dimensional image mode.
[0080] For game scenes, the terminal can obtain game scene nodes corresponding to the game, extract scene images corresponding to each game scene node from scene resources, and then render the scene images corresponding to each game scene node to display the game scene corresponding to the scene resources in a two-dimensional image mode. The game scene node can be SKSpriteNode from the game framework SpriteKit, used to render the scene images of the game scene.
[0081] In the specific implementation, for the terminal, each screen element can be a node, and each node can correspond to a corresponding scene image. When rendering the game scene, the terminal can first determine all the game scene nodes, then obtain the scene image corresponding to each game scene node from the scene resources, and then render the scene image of the game scene node to obtain the game scene corresponding to the scene resources, and display the game scene in the graphical user interface of the terminal.
[0082] For game models, display parameters can include display hierarchy parameters and display outline parameters. Display hierarchy parameters can be rendering priority parameters, such as the zPosition property. The larger the value of this property, the higher the display priority of the node. When node position information overlaps, the game content corresponding to the node with the larger value is displayed first, and the game content corresponding to the node with the smaller value will be covered. In the case of combining 2D game scenes and 3D game models, by default, 3D game model nodes have the highest rendering priority, that is, the 3D game model will be displayed in the 2D game scene after rendering. However, in practice, the 3D game model is not fully displayed in the game scene, but some of the model content is obscured by the game scene. Therefore, it is necessary to adjust the display hierarchy relationship between the 2D game scene and the 3D game model. Display outline parameters are parameters for drawing the display outline of the node. Through this display outline parameter, the display outline of the 3D game model can be defined. Combined with the display hierarchy parameters, the display hierarchy relationship between the 2D game scene and the 3D game model can be effectively resolved, realizing the combination of 2D game scene and 3D game model.
[0083] Specifically, the terminal can obtain the game model node corresponding to the game, extract the target game model corresponding to the game model node from the model resources, determine the target display layer parameters and target display outline parameters corresponding to the target game model, then add the target display outline parameters to the game model node to obtain the display information of the target game model in the game scene, and then display the target game model in a 3D image mode in the game scene according to the display layer parameters and display information. Optionally, the game model node can be SK3DNode in the game framework SpriteKit, used for loading 3D game models.
[0084] For game model nodes, since a node can be a visible element or container of other nodes, a game model node can be used as a container. Then, display outline parameters can be added to the game model node to define the display outline of the target game model corresponding to the game model node. By adding display outline parameters to the game model node, on the one hand, the depth rendering mechanism of the 3D game model can be turned off, eliminating the problem that the game model node has the highest rendering priority. On the other hand, the display size of the 3D game model can be set.
[0085] Furthermore, the display information can include the model height and model width. For the display of the target game model, it can be displayed on top of the game scene in a 3D image mode according to the display hierarchy parameters, and displayed according to the model height and model width. In this way, by rendering the 2D game scene and the 3D game model, the two-dimensional game scene and the three-dimensional game model are combined. While bringing the game to users with the realism and interactivity of 3D, the high device performance overhead caused by pure 3D is avoided. It can be compatible with devices with different performance and has high game versatility.
[0086] In one example, regarding the rendering of 3D game models, since the game model node (SK3DNode) has the highest rendering priority, modifying the zPosition property of the game model node cannot resolve the issue of 3D game models occluding the 2D game scene. To address this, an SKShapeNode class can be added to the game model node, filling a SpriteKitNode with a shape, and defining the width and height of the 3D game model on the screen to achieve the drawing of the 3D game model's outline. SKShapeNode has a special mechanism that can disable the depth rendering mechanism of the game model node, eliminating the issue of the game model node having the highest rendering priority. Therefore, by adding a transparent SKShapeNode to the game model node in the game scene to define the size of the 3D game model, and then modifying the zPosition property, the occlusion problem of the 3D game model on the 2D game scene can be resolved.
[0087] Step 103: Process the game scene based on the obstacle information to generate an obstacle map;
[0088] The above process solved the problem of loading and placing 3D game models in 2D game scenes. However, due to the "flatness" of 2D game scenes, in specific scenarios where 3D game models need to move, they cannot avoid environmental nodes (such as 2D tables, cabinets, and walls) within the game scene. Therefore, obstacles need to be set up for the 2D game scene to simulate the movement of 3D game models within the 3D scene.
[0089] In its implementation, the terminal can perform image recognition on the game scene to obtain virtual obstacles and their location information. Then, it retrieves the occlusion objects corresponding to the virtual obstacles from the obstacle information. Based on the location information of each virtual obstacle, it adds the corresponding occlusion objects to the game scene, generating an obstacle map. Virtual obstacles can be objects with "solidity" in the game scene, such as walls, tables, cabinets, etc., that can affect or obstruct the movement of 3D models. Since the game scene is 2D, the location information can be the display position of the virtual obstacles within the 2D game scene. Occlusion objects can be transparent fences dynamically created through a fill effect, blocking the movement of 3D game models within the game scene. The 3D game models must navigate around these transparent fences to continue moving forward.
[0090] Specifically, the terminal can obtain all virtual obstacles in the game scene that can block the movement of the 3D game model through image recognition, and determine the position information of each virtual obstacle in the game scene. Then, it extracts the occlusion objects corresponding to the virtual obstacles from the obstacle information, and adds the corresponding occlusion objects to the positions of the virtual obstacles in the game scene, thus constructing the game scene as an obstacle map for the game model. This obstacle map can include several occlusion objects to simulate the movement of the 3D game model in the 3D scene.
[0091] In one example, for game scene nodes in a 2D game scene, transparent fences can be dynamically created based on the visually filled area of an image to simulate the movement of 3D game models within the 3D scene. For instance, for an image with a height of 200*200px, where the image represents a table with an actual width and height of 100*100px, then a 100*100px fence needs to be created for the table. Thus, for all virtual obstacles in the game scene, developers can set corresponding transparent fences (i.e., occlusion objects) for the display width and height of each virtual obstacle at the beginning of game development. Then, when the user uses the application's game functions, the terminal, after recognizing the virtual obstacles in the game scene, can obtain the corresponding transparent fences and add them to the corresponding positions in the game scene, thereby constructing the 2D game scene as an obstacle map that can block the movement of 3D game models.
[0092] Step 104: Obtain the movement information of the game model, and determine the target movement path of the game model in the obstacle map based on the movement information.
[0093] In its implementation, when the game model moves on the obstacle map, its movement information can be obtained, including the starting point and the ending point. Then, using the starting point and the ending point, at least one initial movement path can be determined on the obstacle map. The shortest initial movement path is then used as the target movement path for the game model. The game model is then controlled to move according to the target movement path. Thus, for the application's game, by rendering 2D game scenes and 3D game models, the two-dimensional game scene and the three-dimensional game model are combined. While bringing the game's realism and interactivity to the user through 3D, the high device performance overhead caused by pure 3D is avoided. It can be compatible with devices with different performance levels, and the game has high versatility.
[0094] Determining the movement path essentially involves detecting collisions between the 3D game model and obstacles. The terminal can perform collision detection between the 3D game model and virtual obstacles in the game scene to obtain all paths from the starting point to the ending point of the movement. Then, the shortest path is taken as the target movement path so that the 3D game model can be controlled to move according to the target movement path.
[0095] It should be noted that the embodiments of the present invention include, but are not limited to, the examples described above. It is understood that, under the guidance of the ideas in the embodiments of the present invention, those skilled in the art can also make settings according to actual needs, and the present invention does not limit such settings.
[0096] In this embodiment of the invention, during gameplay, the terminal can acquire game resources, which may include scene resources, model resources, obstacle information for the scene resources, and model display parameters for the model resources. Then, the game scene corresponding to the scene resources can be displayed in a two-dimensional image mode, and the game model corresponding to the model resources can be displayed in a three-dimensional image mode within the game scene according to the model display parameters. The game scene can then be processed based on the obstacle information to generate a corresponding obstacle map, and the movement information of the game model can be acquired. The target movement path of the game model can then be determined in the obstacle map based on the movement information, so as to control the movement of the game model within the game scene. Thus, for the application's game, by rendering 2D game scenes and 3D game models, the two-dimensional game scene and the three-dimensional game model are combined. While providing users with the realism and interactivity of the game through 3D, the high device performance overhead of pure 3D is avoided, allowing compatibility with devices of different performance levels and resulting in high game versatility.
[0097] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.
[0098] Reference Figure 2 The diagram shows a structural block diagram of a game data processing device provided in an embodiment of the present invention, which may specifically include the following modules:
[0099] The game resource acquisition module 201 is used to acquire game resources, which include at least scene resources, model resources, obstacle information for the scene resources, and model display parameters for the model resources.
[0100] The game content display module 202 is used to display the game scene corresponding to the scene resource in a two-dimensional image mode, and to display the game model corresponding to the model resource in the game scene in a three-dimensional image mode according to the model display parameters;
[0101] The obstacle map generation module 203 is used to process the game scene based on the obstacle information and generate an obstacle map;
[0102] The movement path determination module 204 is used to acquire the movement information of the game model and determine the target movement path of the game model in the obstacle map based on the movement information.
[0103] In one alternative embodiment, it further includes:
[0104] The model movement control module is used to control the game model to move according to the target movement path.
[0105] In one optional embodiment, the game content display module 202 includes:
[0106] The scene node acquisition submodule is used to acquire game scene nodes corresponding to the game;
[0107] The scene image extraction submodule is used to extract scene images corresponding to each of the game scene nodes from the scene resources;
[0108] The game scene display submodule is used to render the scene images corresponding to each game scene node and display the game scene corresponding to the scene resource in a two-dimensional image mode.
[0109] In one optional embodiment, the model display parameters include at least display hierarchy parameters and display outline parameters, and the game content display module 202 includes:
[0110] The model node acquisition submodule is used to acquire game model nodes corresponding to the game;
[0111] The parameter determination submodule is used to extract the target game model corresponding to the game model node from the model resource, and determine the target display level parameters and target display outline parameters corresponding to the target game model;
[0112] The display information acquisition submodule is used to add the target display outline parameters to the game model node to obtain the display information of the target game model in the game scene;
[0113] The game model display submodule is used to display the target game model in the game scene in a three-dimensional image mode according to the display level parameters and the display information.
[0114] In one optional embodiment, the display information includes the model height and the model width, and the game model display submodule is specifically used for:
[0115] The target game model is displayed on top of the game scene in a 3D image mode according to the display hierarchy parameters, and the target game model is displayed according to the model height and the model width.
[0116] In one optional embodiment, the obstacle map generation module 203 includes:
[0117] The location information determination submodule is used to perform image recognition on the game scene and obtain the virtual obstacles in the game scene and the location information of the virtual obstacles in the game scene.
[0118] The occlusion object acquisition submodule is used to acquire the occlusion object corresponding to the virtual obstacle from the obstacle information;
[0119] The obstacle map generation submodule is used to add the occlusion objects corresponding to each virtual obstacle to the game scene based on the position information of each virtual obstacle, thereby generating an obstacle map.
[0120] In one optional embodiment, the movement information includes a movement start point and a movement end point, and the movement path determination module 204 includes:
[0121] The movement path determination submodule is used to determine at least one initial movement path in the obstacle map using the movement start point and the movement end point.
[0122] The movement path filtering submodule is used to select the shortest initial movement path as the target movement path for the game model.
[0123] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.
[0124] In addition, embodiments of the present invention also provide an electronic device, such as... Figure 3 As shown, it includes a processor 301, a communication interface 302, a memory 303, and a communication bus 304, wherein the processor 301, the communication interface 302, and the memory 303 communicate with each other through the communication bus 304.
[0125] Memory 303 is used to store computer programs;
[0126] When processor 301 executes a program stored in memory 303, it performs the following steps:
[0127] Acquire game resources, which include at least scene resources, model resources, obstacle information for the scene resources, and model display parameters for the model resources;
[0128] The game scene corresponding to the scene resource is displayed in a two-dimensional image mode, and the game model corresponding to the model resource is displayed in the game scene in a three-dimensional image mode according to the model display parameters;
[0129] The game scene is processed based on the obstacle information to generate an obstacle map;
[0130] The movement information of the game model is obtained, and the target movement path of the game model is determined in the obstacle map based on the movement information.
[0131] In one alternative embodiment, it further includes:
[0132] Control the game model to move according to the target movement path.
[0133] In one optional embodiment, displaying the game scene corresponding to the scene resource in a two-dimensional image mode includes:
[0134] Retrieve the game scene nodes corresponding to the game;
[0135] Extract scene images corresponding to each game scene node from the scene resources;
[0136] Render the scene image corresponding to each of the game scene nodes, and display the game scene corresponding to the scene resource in a two-dimensional image mode.
[0137] In one optional embodiment, the model display parameters include at least display level parameters and display outline parameters. The step of displaying the game model corresponding to the model resource in a 3D image mode in the game scene according to the model display parameters includes:
[0138] Retrieve the game model node corresponding to the game;
[0139] Extract the target game model corresponding to the game model node from the model resource, and determine the target display level parameters and target display outline parameters corresponding to the target game model;
[0140] The target display outline parameters are added to the game model node to obtain the display information of the target game model in the game scene;
[0141] Based on the display level parameters and the display information, the target game model is displayed in the game scene in a three-dimensional image mode.
[0142] In one optional embodiment, the display information includes model height and model width, and the step of displaying the target game model in a 3D image mode in the game scene according to the display level parameters and the display information includes:
[0143] The target game model is displayed on top of the game scene in a 3D image mode according to the display hierarchy parameters, and the target game model is displayed according to the model height and the model width.
[0144] In one optional embodiment, processing the game scene based on the obstacle information to generate an obstacle map includes:
[0145] Image recognition is performed on the game scene to obtain virtual obstacles in the game scene and their location information in the game scene;
[0146] Obtain the occlusion object corresponding to the virtual obstacle from the obstacle information;
[0147] Based on the location information of each virtual obstacle, the occlusion objects corresponding to each virtual obstacle are added to the game scene to generate an obstacle map.
[0148] In one optional embodiment, the movement information includes a movement start point and a movement end point, and determining the target movement path of the game model in the obstacle map based on the movement information includes:
[0149] Using the starting point and the ending point of movement, at least one initial movement path is determined in the obstacle map;
[0150] The shortest initial movement path is taken as the target movement path of the game model.
[0151] The communication bus mentioned above can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.
[0152] The communication interface is used for communication between the aforementioned terminal and other devices.
[0153] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0154] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0155] like Figure 4 As shown, in another embodiment of the present invention, a computer-readable storage medium 401 is also provided, which stores instructions that, when executed on a computer, cause the computer to perform the game data processing method described in the above embodiment.
[0156] In another embodiment of the present invention, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute the game data processing method described in the above embodiments.
[0157] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk (SSD)).
[0158] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0159] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0160] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention are included within the scope of protection of the present invention.
Claims
1. A method for processing game data, characterized in that, include: Acquire game resources, which include at least scene resources, model resources, obstacle information for the scene resources, and model display parameters for the model resources; the model display parameters include at least display level parameters and display outline parameters, where the display level parameters are rendering priority parameters, and the display outline parameters are used to define the display outline of the game model; The game scene corresponding to the scene resource is displayed in a two-dimensional image mode; Retrieve the game model node corresponding to the game; Extract the target game model corresponding to the game model node from the model resource, and determine the target display level parameters and target display outline parameters corresponding to the target game model; The target display outline parameter is added to the game model node to obtain the display information of the target game model in the game scene; the display information includes the model height and the model width; wherein, the game model node is used to load the 3D game model on the node, the node is a screen element in the game frame, and the node is a visible element or container of other nodes; the target display outline parameter is added to the game model node to disable the depth rendering mechanism of the 3D game model; According to the display hierarchy parameters, the target game model is displayed on top of the game scene in a 3D image mode, and the target game model is displayed according to the model height and the model width; The game scene is processed based on the obstacle information to generate an obstacle map; The movement information of the game model is obtained, and the target movement path of the game model is determined in the obstacle map based on the movement information.
2. The method according to claim 1, characterized in that, Also includes: Control the game model to move according to the target movement path.
3. The method according to claim 1, characterized in that, The method of displaying the game scene corresponding to the scene resource in a two-dimensional image mode includes: Retrieve the game scene nodes corresponding to the game; Extract scene images corresponding to each game scene node from the scene resources; Render the scene image corresponding to each of the game scene nodes, and display the game scene corresponding to the scene resource in a two-dimensional image mode.
4. The method according to claim 1, characterized in that, The step of processing the game scene based on the obstacle information to generate an obstacle map includes: Image recognition is performed on the game scene to obtain virtual obstacles in the game scene and their location information in the game scene; Obtain the occlusion object corresponding to the virtual obstacle from the obstacle information; Based on the location information of each virtual obstacle, the occlusion objects corresponding to each virtual obstacle are added to the game scene to generate an obstacle map.
5. The method according to claim 1, characterized in that, The movement information includes a starting point and a ending point. Determining the target movement path of the game model in the obstacle map based on the movement information includes: Using the starting point and the ending point of movement, at least one initial movement path is determined in the obstacle map; The shortest initial movement path is taken as the target movement path of the game model.
6. A device for processing game data, characterized in that, include: The game resource acquisition module is used to acquire game resources, which include at least scene resources, model resources, obstacle information for the scene resources, and model display parameters for the model resources. The game content display module is used to display the game scene corresponding to the scene resource in a two-dimensional image mode; An obstacle map generation module is used to process the game scene based on the obstacle information and generate an obstacle map. The movement path determination module is used to acquire the movement information of the game model and determine the target movement path of the game model in the obstacle map based on the movement information. The model display parameters include at least display level parameters and display outline parameters. The display level parameters are rendering priority parameters, and the display outline parameters define the display outline of the game model. The game content display module includes: The model node acquisition submodule is used to acquire game model nodes corresponding to the game; The parameter determination submodule is used to extract the target game model corresponding to the game model node from the model resource, and determine the target display level parameters and target display outline parameters corresponding to the target game model; The display information acquisition submodule is used to add the target display outline parameters to the game model node to obtain the display information of the target game model in the game scene; the display information includes the model height and the model width; wherein, the game model node is used to load the 3D game model on the node, the node is a screen element in the game frame, and the node is a visible element or container of other nodes; the target display outline parameters are added to the game model node to disable the depth rendering mechanism of the 3D game model; The game model display submodule is used to display the target game model on top in the game scene in a three-dimensional image mode according to the display level parameters, and to display the target game model according to the model height and the model width.
7. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; The memory is used to store computer programs; When the processor executes a program stored in the memory, it implements the method as described in any one of claims 1-5.
8. A computer-readable storage medium having instructions stored thereon that, when executed by one or more processors, cause the processors to perform the method as described in any one of claims 1-5.