CN114404993A - Game data processing method and device, electronic equipment and storage medium - Google Patents

Game data processing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114404993A
CN114404993A CN202111633834.2A CN202111633834A CN114404993A CN 114404993 A CN114404993 A CN 114404993A CN 202111633834 A CN202111633834 A CN 202111633834A CN 114404993 A CN114404993 A CN 114404993A
Authority
CN
China
Prior art keywords
game
model
scene
display
resources
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111633834.2A
Other languages
Chinese (zh)
Inventor
赵志
彭飞
邓竹立
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing 58 Information Technology Co Ltd
Original Assignee
Beijing 58 Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing 58 Information Technology Co Ltd filed Critical Beijing 58 Information Technology Co Ltd
Priority to CN202111633834.2A priority Critical patent/CN114404993A/en
Publication of CN114404993A publication Critical patent/CN114404993A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/60Generating or modifying game content before or while executing the game program, e.g. authoring tools specially adapted for game development or game-integrated level editor
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/50Controlling the output signals based on the game progress
    • A63F13/52Controlling the output signals based on the game progress involving aspects of the displayed game scene
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/55Controlling game characters or game objects based on the game progress
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/60Methods for processing data by generating or executing the game program
    • A63F2300/6009Methods for processing data by generating or executing the game program for importing or creating game content, e.g. authoring tools during game development, adapting content to different platforms, use of a scripting language to create content
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/60Methods for processing data by generating or executing the game program
    • A63F2300/63Methods for processing data by generating or executing the game program for controlling the execution of the game in time
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/60Methods for processing data by generating or executing the game program
    • A63F2300/66Methods for processing data by generating or executing the game program for rendering three dimensional images

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Physics & Mathematics (AREA)
  • Computer Graphics (AREA)
  • Geometry (AREA)
  • Software Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The embodiment of the invention provides a game data processing method, a game data processing device, electronic equipment and a readable storage medium, wherein the method comprises the following steps: in the game process, the terminal may obtain game resources, where the game resources may include scene resources, model resources, obstacle information for the scene resources, and model display parameters for the model resources, may then display a game scene corresponding to the scene resources in a two-dimensional image mode, and display a game model corresponding to the model resources in a three-dimensional image mode in the game scene according to the model display parameters, and may then process the game scene according to the obstacle information to generate a corresponding obstacle map, and obtain movement information of the game model, and then determine a target movement path of the game model in the obstacle map according to the movement information, so as to control the game model to move in the game scene.

Description

Game data processing method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a method and an apparatus for processing game data, an electronic device, and a computer-readable storage medium.
Background
With the popularization of mobile devices, various application programs applied to the mobile devices are becoming more common. In order to enhance the retention of users for the application program with the property of the aggregated platform, developers can implant mini games into the application program, and the functions of the application program are enriched. For the games, most of the games load the game scenes in a two-dimensional image mode, belong to plane operation, have relatively single functions, bring a paper-like image effect to users, are not real enough, and have low interactivity and game interestingness. In addition, if the game content is processed in the three-dimensional image mode, the performance overhead of the mobile device is increased, and particularly if the performance of the mobile device is poor, application program flash back, stuttering and the like are easily caused, which seriously affects the game experience of the user.
Disclosure of Invention
Embodiments of the present invention provide a game data processing method, apparatus, electronic device, and computer-readable storage medium, so as to solve or partially solve the problems in the related art that the game content is not true, the interchangeability is low, and devices with different capabilities cannot be compatible.
The embodiment of the invention discloses a game data processing method, which comprises the following steps:
obtaining game resources, wherein the game resources at least comprise scene resources, model resources, obstacle information aiming at the scene resources and model display parameters aiming at the model resources;
displaying a game scene corresponding to the scene resource in a two-dimensional image mode, and displaying a game model corresponding to the model resource in a three-dimensional image mode in the game scene according to the model display parameter;
processing the game scene according to the obstacle information to generate an obstacle map;
and acquiring the movement information of the game model, and determining a target movement path of the game model in the obstacle map according to the movement information.
Optionally, the method further comprises:
and controlling the game model to move according to the target moving path.
Optionally, the displaying the game scene corresponding to the scene resource in a two-dimensional image mode includes:
obtaining a game scene node corresponding to a game;
extracting scene images corresponding to the game scene nodes from the scene resources;
rendering the scene image corresponding to each game scene node, and displaying the game scene corresponding to the scene resource in a two-dimensional image mode.
Optionally, the displaying parameters of the model at least include displaying level parameters and displaying outline parameters, and the displaying the game model corresponding to the model resource in the game scene in a three-dimensional image mode according to the displaying parameters of the model includes:
obtaining a game model node corresponding to a game;
extracting a target game model corresponding to the game model node from the model resource, and determining a target display level parameter and a target display contour parameter corresponding to the target game model;
adding the target display contour parameter to the game model node to obtain the display information of the target game model in the game scene;
and displaying the target game model in a three-dimensional image mode in the game scene according to the display level parameters and the display information.
Optionally, the displaying information includes a model height and a model width, and the displaying the target game model in the game scene in a three-dimensional image mode according to the display level parameter and the displaying information includes:
and carrying out top display on the target game model in a three-dimensional image mode in the game scene according to the display level parameters, and displaying the target game model according to the model height and the model width.
Optionally, the processing the game scene according to the obstacle information to generate an obstacle map includes:
performing image recognition on the game scene, and acquiring a virtual obstacle in the game scene and position information of the virtual obstacle in the game scene;
obtaining an occlusion object corresponding to the virtual obstacle from the obstacle information;
and adding the shielding objects corresponding to the virtual obstacles to the game scene according to the position information of the virtual obstacles to generate an obstacle map.
Optionally, the moving information includes a moving start point and a moving end point, and the determining a target moving path of the game model in the obstacle map according to the moving information includes:
determining at least one initial moving path in the obstacle map by using the moving starting point and the moving ending point;
and taking the initial moving path with the shortest path as the target moving path of the game model.
The embodiment of the invention also discloses a game data processing device, which comprises:
the game resource acquisition module is used for acquiring game resources, wherein the game resources at least comprise scene resources, model resources, obstacle information aiming at the scene resources and model display parameters aiming at the model resources;
the game content display module is used for displaying a game scene corresponding to the scene resource in a two-dimensional image mode and displaying a game model corresponding to the model resource in a three-dimensional image mode in the game scene according to the model display parameters;
the obstacle map generation module is used for processing the game scene according to the obstacle information to generate an obstacle map;
and the moving path determining module is used for acquiring the moving information of the game model and determining the target moving path of the game model in the obstacle map according to the moving information.
Optionally, the method further comprises:
and the model movement control module is used for controlling the game model to move according to the target movement path.
Optionally, the game content display module includes:
the scene node acquisition submodule is used for acquiring a game scene node corresponding to a game;
a scene image extraction submodule, configured to extract scene images corresponding to the game scene nodes from the scene resources;
and the game scene display submodule is used for rendering the scene image corresponding to each game scene node and displaying the game scene corresponding to the scene resource in a two-dimensional image mode.
Optionally, the model display parameters at least include a display level parameter and a display outline parameter, and the game content display module includes:
the model node acquisition submodule is used for acquiring a game model node corresponding to a game;
the parameter determination submodule is used for extracting a target game model corresponding to the game model node from the model resource and determining a target display level parameter and a target display outline parameter corresponding to the target game model;
the display information acquisition submodule is used for adding the target display contour parameter to the game model node to acquire the display information of the target game model in the game scene;
and the game model display submodule is used for displaying the target game model in a three-dimensional image mode in the game scene according to the display level parameters and the display information.
Optionally, the display information includes a model height and a model width, and the game model display submodule is specifically configured to:
and carrying out top display on the target game model in a three-dimensional image mode in the game scene according to the display level parameters, and displaying the target game model according to the model height and the model width.
Optionally, the obstacle map generation module includes:
the position information determining submodule is used for carrying out image recognition on the game scene and acquiring a virtual obstacle in the game scene and position information of the virtual obstacle in the game scene;
an occlusion object obtaining sub-module, configured to obtain an occlusion object corresponding to the virtual obstacle from the obstacle information;
and the obstacle map generation submodule is used for adding the shielding objects corresponding to the virtual obstacles to the game scene according to the position information of the virtual obstacles so as to generate an obstacle map.
Optionally, the movement information includes a movement starting point and a movement ending point, and the movement path determining module includes:
a moving path determining submodule for determining at least one initial moving path in the obstacle map by using the moving start point and the moving end point;
and the moving path screening submodule is used for taking the initial moving path with the shortest path as the target moving path of the game model.
The embodiment of the invention also discloses electronic equipment which comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory finish mutual communication through the communication bus;
the memory is used for storing a computer program;
the processor is configured to implement the method according to the embodiment of the present invention when executing the program stored in the memory.
Also disclosed is a computer-readable storage medium having instructions stored thereon, which, when executed by one or more processors, cause the processors to perform a method according to an embodiment of the invention.
The embodiment of the invention has the following advantages:
in the embodiment of the invention, during the game process, the terminal may acquire game resources, where the game resources may include scene resources, model resources, obstacle information for the scene resources, and model display parameters for the model resources, may then display a game scene corresponding to the scene resources in a two-dimensional image mode, and display a game model corresponding to the model resources in a three-dimensional image mode in the game scene according to the model display parameters, may then process the game scene according to the obstacle information to generate a corresponding obstacle map, and acquire movement information of the game model, and then determine a target movement path of the game model in the obstacle map according to the movement information, so as to control the game model to move in the game scene, so as to, for the game of the application program, by rendering the 2D game scene and the 3D game model, the two-dimensional game scene and the three-dimensional game model are combined, under the condition that reality and interchangeability of games are brought to users through 3D, the problem that equipment performance cost is high due to pure 3D is avoided, equipment with different performances can be compatible, and game universality is high.
Drawings
FIG. 1 is a flow chart illustrating the steps of a method for processing game data according to an embodiment of the present invention;
fig. 2 is a block diagram showing a configuration of a game data processing device according to an embodiment of the present invention;
FIG. 3 is a block diagram of an electronic device provided in an embodiment of the invention;
fig. 4 is a schematic diagram of a computer-readable storage medium provided in an embodiment of the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
As an example, with the popularity of mobile devices, mobile device-based applications are involved in various industries, and for applications in the nature of an aggregated platform, implanted mini-games are increasing to enhance user retention. However, most of the mini-games in the non-game application program are loaded by using a 2D scene, which is basically a plane operation, and the user operation interface generally plays a preset sequence frame animation and executes the corresponding animation. In the games, the functions are single, only the picture quality of paper scraps can be brought to users, the reality of game pictures is low, corresponding interactivity is lacked, and the interest of the games is further reduced. In addition, for pure 3D games, the size of the related game resource packet is large, and loading 3D game resources occupies large system performance of the mobile device, which is likely to cause problems of program flash or device stutter, and bring poor game experience to users.
In contrast, one of the core invention points of the embodiment of the present invention is to combine a 2D game scene with a 3D game model, which improves the interactivity and the interest of the game compared with a pure 2D game; compared with a pure 3D game, the method optimizes the processing process of game resources, can effectively reduce the performance overhead of equipment, can be compatible with equipment with different performances, and particularly, in the game process, the terminal can obtain the game resources, wherein the game resources can comprise scene resources, model resources, barrier information aiming at the scene resources and model display parameters aiming at the model resources, can display a game scene corresponding to the scene resources in a two-dimensional image mode, can display a game model corresponding to the model resources in a three-dimensional image mode in the game scene according to the model display parameters, can process the game scene according to the barrier information to generate a corresponding barrier map, can obtain the movement information of the game model, and can determine a target movement path of the game model in the barrier map according to the movement information, the game model is controlled to move in the game scene, so that the two-dimensional game scene and the three-dimensional game model are combined by rendering the 2D game scene and the 3D game model aiming at the game of the application program, under the condition that reality and interchangeability of the game are brought to a user through 3D, the problem that equipment performance cost is high due to pure 3D is avoided, equipment with different performances can be compatible, and game universality is high.
In order to make those skilled in the art better understand the technical solutions in the embodiments of the present invention, some technical terms related to the embodiments of the present invention are explained and illustrated below:
each screen element can become a Node in the game framework SpriteKit, and a certain Node can be a visual element or a container of other nodes.
Sksprite enode: the node is a node rendered by a picture or a node rendered by a color value.
SKShapeNode: a node that maps or defines the outline of the node.
SK3 DNode: and loading the nodes of the 3D game model at the nodes.
Gksolygon obstacle: the obstacle is used for converting objects on certain nodes in the game scene into fences in the game scene, and an area filled by the fences is regarded as a real object in the scene, when a model (a character model and the like) in the game scene moves, the object area cannot be blocked and penetrated by the model, and the model moves to avoid the area.
Specifically, referring to fig. 1, a flowchart illustrating steps of a game data processing method provided in an embodiment of the present invention is shown, which may specifically include the following steps:
step 101, obtaining game resources, wherein the game resources at least comprise scene resources, model resources, obstacle information aiming at the scene resources and model display parameters aiming at the model resources;
optionally, the embodiment of the present invention may be applied to a terminal device, where a corresponding application program may be run in the terminal device, and the application program may provide a corresponding game function, and when a user uses the game function in the application program, the terminal may load a corresponding game resource and display a game scene and a game model in a graphical user interface.
The game resources may include scene resources, model resources of the game, obstacle information for the scene resources, model display parameters for the model resources, and the like. Specifically, the scene resource may be a resource required for rendering a game scene, for example, a scene image of the game scene, scene music, and the like; the model resources may be virtual objects in the game scene, e.g., user-controlled player characters, non-player characters in the game, etc., which may be three-dimensional game models for player and non-player characters; the barrier information is used for setting corresponding barriers in the game scene through the barrier information because the game scene can be a two-dimensional scene, so that the moving scene of the 3D game model in the three-dimensional scene is simulated, and the reality of the game scene is improved; the model display parameters can be parameters for adjusting the display of the game model in the game scene, and for the 2D game scene, because the 2D game scene is in a mode of directly displaying a plane picture, a space stereoscopic concept does not exist, and the rendering mode of the 2D game scene is different from that of the 3D game model to a certain extent, so that the problem of hierarchical shielding between the 3D game model and the 2D game scene needs to be solved for the rendering of the 3D game model, and for the purpose, the display hierarchical relationship between the 2D game scene and the 3D game model can be effectively adjusted through the model display parameters, and the combination between the 2D game scene and the 3D game model is realized.
In an example, for a game in an application, a framework of a 2D game scene may be applied, a framework of a 2D game scene in an IOS may be a spritikit, and skspritene may be applied to display a 2D picture resource for environmental properties, materials, and the like in the game scene, so as to implement construction of the game scene. For models such as player characters or non-player characters in a game, a mode of loading a 3D game model in a 2D game scene can be realized through SK3DNode classes, and the loading of the 3D game model is processed, the game scene is a plane, and the loading of the 3D game model needs to combine a node with a scene bound with rendering of the 3D game model, so that the 2D game scene and the 3D game model are combined, a new game mode is constructed, and the game interactivity and interestingness of a user are improved.
102, displaying a game scene corresponding to the scene resource in a two-dimensional image mode, and displaying a game model corresponding to the model resource in a three-dimensional image mode in the game scene according to the model display parameter;
in the embodiment of the invention, the scene resources can be loaded and rendered to obtain the game scene displayed in the two-dimensional image mode, and the model resources are loaded and rendered at the same time and are processed according to the model display parameters to obtain the game model displayed in the three-dimensional image mode.
For a game scene, the terminal may obtain game scene nodes corresponding to a game, extract scene images corresponding to the game scene nodes from scene resources, render the scene images corresponding to the game scene nodes, and display the game scene corresponding to the scene resources in a two-dimensional image mode. The game scene node may be sksprite node in the game framework SpriteKit, and is used for rendering a scene image of the game scene.
In a specific implementation, for a terminal, each screen element may be used as a node, and each node may correspond to a corresponding scene image, and when rendering a game scene, the terminal may determine all game scene nodes, then obtain a scene image corresponding to each game scene node from a scene resource, then render the scene images of the game scene nodes, obtain a game scene corresponding to the scene resource, and display the game scene in a graphical user interface of the terminal.
For the game model, the display level parameter and the display outline parameter may be included in the model display parameter, and the display level parameter may be a rendering priority parameter, such as zPosition attribute, the larger the value of the attribute, the higher the priority of the display of the node, when the node position information is overlapped, preferentially displaying the game content corresponding to the node with larger numerical value, covering the game content corresponding to the node with smaller numerical value, and in case the 2D game scene is combined with the 3D game model, the rendering priority of the default 3D game model node is highest, i.e. the 3D game model is rendered and displayed in the 2D game scene, in practice, however, the 3D game model is not completely displayed in the game scene, but the content of part of the model is shielded by the game scene, so that the display hierarchical relationship between the 2D game scene and the 3D game model needs to be adjusted; the display outline parameters can be parameters for drawing the display outlines of the nodes, the display outlines of the 3D game models can be defined through the display outline parameters, and the display level parameters are combined, so that the display level relation between the 2D game scenes and the 3D game models can be effectively solved, and the combination between the 2D game scenes and the 3D game models is realized.
Specifically, the terminal may obtain a game model node corresponding to the game, extract a target game model corresponding to the game model node from the model resource, determine a target display level parameter and a target display contour parameter corresponding to the target game model, add the target display contour parameter to the game model node, obtain display information of the target game model in the game scene, and display the target game model in the game scene in a three-dimensional image mode according to the display level parameter and the display information. Alternatively, the game model node may be SK3DNode in the game framework SpriteKit for loading the 3D game model.
For the game model node, because the node may be a visual element or a container of another node, the game model node may be used as a container, and then a display outline parameter may be added to the game model node, and a display outline of a target game model corresponding to the game model node is defined.
In addition, the display information may include a model height and a model width, and for the display of the target game model, the target game model may be displayed on top in a three-dimensional image mode in the game scene according to the display level parameters, and the target game model may be displayed according to the model height and the model width, so that the two-dimensional game scene and the three-dimensional game model are combined by rendering the 2D game scene and the 3D game model, and in the case that reality and interchangeability of the game are brought to the user through 3D, the high performance overhead of the device brought by pure 3D is avoided, the device with different performances is compatible, and the game universality is high.
In an example, for rendering of a 3D game model, since the rendering priority of a game model node (SK3DNode) is highest, no matter how to modify the zPosition attribute of the game model node, the problem of shielding of the 3D game model from a 2D game scene cannot be solved, for this reason, sksharenode classes may be added to the game model node, a shape is filled in the SpriteKitNode, and the display outline drawing of the 3D game model is realized by defining the width and height of the 3D game model presented on the screen. The SKShapeNode has a corresponding special mechanism, the deep rendering mechanism of the game model node can be closed, and the problem that the rendering priority level of the game model node is the highest is solved, so that the size of a 3D game model is defined by adding a transparent SKShapeNode to the game model node in a game scene, and then the problem that the 3D game model shields the 2D game scene is solved by modifying the zPosition attribute.
103, processing the game scene according to the obstacle information to generate an obstacle map;
in the above process, the problem of loading and placing the 3D game model in the 2D game scene is solved, but due to the problem of "planarization" of the 2D game scene, in a specific scene where the 3D game model needs to move, the 3D game model cannot avoid an environmental node (such as a 2D table, a 2D cabinet, a 2D wall, etc. in the game scene) in the game scene. Therefore, obstacle setting needs to be performed for a 2D game scene to simulate a scene in which a 3D game model moves in a 3D scene.
In a specific implementation, the terminal may perform image recognition on a game scene, acquire a virtual obstacle in the game scene and position information of the virtual obstacle in the game scene, then acquire a blocking object corresponding to the virtual obstacle from the obstacle information, and then add the blocking object corresponding to each virtual obstacle to the game scene according to the position information of each virtual obstacle, so as to generate an obstacle map. The virtual barrier can be an object with an "entity" in the game scene, such as a wall, a table, a cabinet, and the like located in the game scene, which can affect the movement of the 3D model; because the game scene is a 2D plane, the position information can be the display position of the virtual barrier in the 2D game scene; the shielding object can be a transparent fence which is dynamically created through a filling effect and aims at a virtual obstacle, the transparent fence can block the movement of the 3D game model in the game scene, and the 3D game model can move forwards continuously only by bypassing the transparent fence.
Specifically, the terminal may obtain all virtual obstacles which are present in the game scene and can block the 3D game model from moving in an image recognition manner, determine position information of each virtual obstacle in the game scene, extract a blocking object corresponding to the virtual obstacle from the obstacle information, add a corresponding blocking object at the position of the virtual obstacle in the game scene, construct the game scene as an obstacle map for the game model, where the obstacle map may include a plurality of blocking objects for simulating the movement of the 3D game model in the 3D scene.
In one example, for a game scene node in a 2D game scene, a transparent barrier may be dynamically created from a fill area of the picture view to simulate movement of a 3D game model in the 3D scene. For example, for a picture, assuming that the picture height is 200 × 200px, where the information of the picture expresses a table, and the actual width and height of the table in the picture is 100 × 100px, for the table in the picture, the fence that needs to be created is 100 × 100px, so that, for all virtual obstacles in the game scene, a developer can set a corresponding transparent fence (i.e., a shielding object) for the display width and height of each virtual obstacle at the beginning of game development, and when a user uses the game function of the application program, after recognizing the virtual obstacles included in the game scene, the terminal can obtain the transparent fence corresponding to the virtual obstacle and add the transparent fence to the corresponding position of the game scene, thereby implementing that the 2D game scene is constructed as an obstacle map that can block the 3D game model from moving.
And 104, acquiring the movement information of the game model, and determining a target movement path of the game model in the obstacle map according to the movement information.
In a specific implementation, when a game model moves in an obstacle map, the movement information of the game model can be acquired, the movement information can include a movement starting point and a movement destination, then the movement starting point and the movement destination can be adopted, at least one initial movement path is determined in the obstacle map, then the initial movement path with the shortest path is used as a target movement path of the game model, and then the game model is controlled to move according to the target movement path, so that aiming at a game of an application program, a two-dimensional game scene and a three-dimensional game model are combined by rendering a 2D game scene and a 3D game model, under the condition that reality and interactivity of the game are brought to a user through 3D, the high performance cost of the device brought by pure 3D is avoided, the device with different performances can be compatible, and the game universality is high.
For the determination of the moving path, which is essentially a process of detecting a collision between the 3D game model and an obstacle, the terminal may acquire all paths of the 3D game model from the moving starting point to the moving ending point by detecting the collision between the 3D game model and the virtual obstacle in the game scene, and then take the path with the shortest path as the target moving path so as to control the 3D game model to move according to the target moving path.
It should be noted that, the embodiment of the present invention includes but is not limited to the above examples, and it is understood that, under the guidance of the idea of the embodiment of the present invention, a person skilled in the art may also set the method according to practical requirements, and the present invention is not limited to this.
In the embodiment of the invention, during the game process, the terminal may acquire game resources, where the game resources may include scene resources, model resources, obstacle information for the scene resources, and model display parameters for the model resources, may then display a game scene corresponding to the scene resources in a two-dimensional image mode, and display a game model corresponding to the model resources in a three-dimensional image mode in the game scene according to the model display parameters, may then process the game scene according to the obstacle information to generate a corresponding obstacle map, and acquire movement information of the game model, and then determine a target movement path of the game model in the obstacle map according to the movement information, so as to control the game model to move in the game scene, so as to, for the game of the application program, by rendering the 2D game scene and the 3D game model, the two-dimensional game scene and the three-dimensional game model are combined, under the condition that reality and interchangeability of games are brought to users through 3D, the problem that equipment performance cost is high due to pure 3D is avoided, equipment with different performances can be compatible, and game universality is high.
It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the illustrated order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments of the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
Referring to fig. 2, a block diagram of a game data processing apparatus provided in the embodiment of the present invention is shown, and specifically includes the following modules:
a game resource obtaining module 201, configured to obtain game resources, where the game resources at least include scene resources, model resources, obstacle information for the scene resources, and model display parameters for the model resources;
a game content display module 202, configured to display a game scene corresponding to the scene resource in a two-dimensional image mode, and display a game model corresponding to the model resource in the game scene in a three-dimensional image mode according to the model display parameter;
the obstacle map generation module 203 is configured to process the game scene according to the obstacle information to generate an obstacle map;
and the moving path determining module 204 is configured to obtain the moving information of the game model, and determine a target moving path of the game model in the obstacle map according to the moving information.
In an alternative embodiment, further comprising:
and the model movement control module is used for controlling the game model to move according to the target movement path.
In an alternative embodiment, the game content display module 202 includes:
the scene node acquisition submodule is used for acquiring a game scene node corresponding to a game;
a scene image extraction submodule, configured to extract scene images corresponding to the game scene nodes from the scene resources;
and the game scene display submodule is used for rendering the scene image corresponding to each game scene node and displaying the game scene corresponding to the scene resource in a two-dimensional image mode.
In an alternative embodiment, the model display parameters at least include a display level parameter and a display outline parameter, and the game content display module 202 includes:
the model node acquisition submodule is used for acquiring a game model node corresponding to a game;
the parameter determination submodule is used for extracting a target game model corresponding to the game model node from the model resource and determining a target display level parameter and a target display outline parameter corresponding to the target game model;
the display information acquisition submodule is used for adding the target display contour parameter to the game model node to acquire the display information of the target game model in the game scene;
and the game model display submodule is used for displaying the target game model in a three-dimensional image mode in the game scene according to the display level parameters and the display information.
In an optional embodiment, the display information includes a model height and a model width, and the game model display submodule is specifically configured to:
and carrying out top display on the target game model in a three-dimensional image mode in the game scene according to the display level parameters, and displaying the target game model according to the model height and the model width.
In an optional embodiment, the obstacle map generation module 203 comprises:
the position information determining submodule is used for carrying out image recognition on the game scene and acquiring a virtual obstacle in the game scene and position information of the virtual obstacle in the game scene;
an occlusion object obtaining sub-module, configured to obtain an occlusion object corresponding to the virtual obstacle from the obstacle information;
and the obstacle map generation submodule is used for adding the shielding objects corresponding to the virtual obstacles to the game scene according to the position information of the virtual obstacles so as to generate an obstacle map.
In an optional embodiment, the movement information includes a movement starting point and a movement ending point, and the movement path determining module 204 includes:
a moving path determining submodule for determining at least one initial moving path in the obstacle map by using the moving start point and the moving end point;
and the moving path screening submodule is used for taking the initial moving path with the shortest path as the target moving path of the game model.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
In addition, an electronic device is further provided in the embodiments of the present invention, as shown in fig. 3, and includes a processor 301, a communication interface 302, a memory 303, and a communication bus 304, where the processor 301, the communication interface 302, and the memory 303 complete mutual communication through the communication bus 304,
a memory 303 for storing a computer program;
the processor 301, when executing the program stored in the memory 303, implements the following steps:
obtaining game resources, wherein the game resources at least comprise scene resources, model resources, obstacle information aiming at the scene resources and model display parameters aiming at the model resources;
displaying a game scene corresponding to the scene resource in a two-dimensional image mode, and displaying a game model corresponding to the model resource in a three-dimensional image mode in the game scene according to the model display parameter;
processing the game scene according to the obstacle information to generate an obstacle map;
and acquiring the movement information of the game model, and determining a target movement path of the game model in the obstacle map according to the movement information.
In an alternative embodiment, further comprising:
and controlling the game model to move according to the target moving path.
In an optional embodiment, the displaying the game scene corresponding to the scene resource in the two-dimensional image mode includes:
obtaining a game scene node corresponding to a game;
extracting scene images corresponding to the game scene nodes from the scene resources;
rendering the scene image corresponding to each game scene node, and displaying the game scene corresponding to the scene resource in a two-dimensional image mode.
In an optional embodiment, the model display parameters at least include a display level parameter and a display outline parameter, and the displaying the game model corresponding to the model resource in the game scene in a three-dimensional image mode according to the model display parameters includes:
obtaining a game model node corresponding to a game;
extracting a target game model corresponding to the game model node from the model resource, and determining a target display level parameter and a target display contour parameter corresponding to the target game model;
adding the target display contour parameter to the game model node to obtain the display information of the target game model in the game scene;
and displaying the target game model in a three-dimensional image mode in the game scene according to the display level parameters and the display information.
In an optional embodiment, the displaying information includes a model height and a model width, and the displaying the target game model in the game scene in a three-dimensional image mode according to the display level parameters and the displaying information includes:
and carrying out top display on the target game model in a three-dimensional image mode in the game scene according to the display level parameters, and displaying the target game model according to the model height and the model width.
In an optional embodiment, the processing the game scene according to the obstacle information to generate an obstacle map includes:
performing image recognition on the game scene, and acquiring a virtual obstacle in the game scene and position information of the virtual obstacle in the game scene;
obtaining an occlusion object corresponding to the virtual obstacle from the obstacle information;
and adding the shielding objects corresponding to the virtual obstacles to the game scene according to the position information of the virtual obstacles to generate an obstacle map.
In an optional embodiment, the movement information includes a movement starting point and a movement ending point, and the determining the target movement path of the game model in the obstacle map according to the movement information includes:
determining at least one initial moving path in the obstacle map by using the moving starting point and the moving ending point;
and taking the initial moving path with the shortest path as the target moving path of the game model.
The communication bus mentioned in the above terminal may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the terminal and other equipment.
The memory may include a Random Access Memory (RAM), or may also include a non-volatile memory (non-volatile memory), such as at least one disk memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The processor may be a general-purpose processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the integrated circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device, or discrete hardware components.
As shown in fig. 4, in another embodiment provided by the present invention, a computer-readable storage medium 401 is further provided, which stores instructions that, when executed on a computer, cause the computer to execute the processing method of game data described in the above embodiment.
In yet another embodiment, the present invention further provides a computer program product containing instructions, which when run on a computer, causes the computer to execute the processing method of game data described in the above embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, 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.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may 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)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (10)

1. A method for processing game data, comprising:
obtaining game resources, wherein the game resources at least comprise scene resources, model resources, obstacle information aiming at the scene resources and model display parameters aiming at the model resources;
displaying a game scene corresponding to the scene resource in a two-dimensional image mode, and displaying a game model corresponding to the model resource in a three-dimensional image mode in the game scene according to the model display parameter;
processing the game scene according to the obstacle information to generate an obstacle map;
and acquiring the movement information of the game model, and determining a target movement path of the game model in the obstacle map according to the movement information.
2. The method of claim 1, further comprising:
and controlling the game model to move according to the target moving path.
3. The method according to claim 1, wherein the displaying the game scene corresponding to the scene resource in the two-dimensional image mode comprises:
obtaining a game scene node corresponding to a game;
extracting scene images corresponding to the game scene nodes from the scene resources;
rendering the scene image corresponding to each game scene node, and displaying the game scene corresponding to the scene resource in a two-dimensional image mode.
4. The method according to claim 1, wherein the model display parameters at least include a display level parameter and a display outline parameter, and the displaying the game model corresponding to the model resource in the game scene in a three-dimensional image mode according to the model display parameters comprises:
obtaining a game model node corresponding to a game;
extracting a target game model corresponding to the game model node from the model resource, and determining a target display level parameter and a target display contour parameter corresponding to the target game model;
adding the target display contour parameter to the game model node to obtain the display information of the target game model in the game scene;
and displaying the target game model in a three-dimensional image mode in the game scene according to the display level parameters and the display information.
5. The method of claim 4, wherein the display information comprises a model height and a model width, and wherein displaying the target game model in a three-dimensional image mode in the game scene according to the display level parameters and the display information comprises:
and carrying out top display on the target game model in a three-dimensional image mode in the game scene according to the display level parameters, and displaying the target game model according to the model height and the model width.
6. The method of claim 1, wherein the processing the game scene according to the obstacle information to generate an obstacle map comprises:
performing image recognition on the game scene, and acquiring a virtual obstacle in the game scene and position information of the virtual obstacle in the game scene;
obtaining an occlusion object corresponding to the virtual obstacle from the obstacle information;
and adding the shielding objects corresponding to the virtual obstacles to the game scene according to the position information of the virtual obstacles to generate an obstacle map.
7. The method of claim 1, wherein the movement information includes a movement start point and a movement end point, and wherein determining the target movement path of the game model in the obstacle map based on the movement information includes:
determining at least one initial moving path in the obstacle map by using the moving starting point and the moving ending point;
and taking the initial moving path with the shortest path as the target moving path of the game model.
8. A game data processing apparatus, comprising:
the game resource acquisition module is used for acquiring game resources, wherein the game resources at least comprise scene resources, model resources, obstacle information aiming at the scene resources and model display parameters aiming at the model resources;
the game content display module is used for displaying a game scene corresponding to the scene resource in a two-dimensional image mode and displaying a game model corresponding to the model resource in a three-dimensional image mode in the game scene according to the model display parameters;
the obstacle map generation module is used for processing the game scene according to the obstacle information to generate an obstacle map;
and the moving path determining module is used for acquiring the moving information of the game model and determining the target moving path of the game model in the obstacle map according to the moving information.
9. An electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
the memory is used for storing a computer program;
the processor, when executing a program stored on the memory, implementing the method of any of claims 1-7.
10. A computer-readable storage medium having stored thereon instructions, which when executed by one or more processors, cause the processors to perform the method of any one of claims 1-7.
CN202111633834.2A 2021-12-28 2021-12-28 Game data processing method and device, electronic equipment and storage medium Pending CN114404993A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111633834.2A CN114404993A (en) 2021-12-28 2021-12-28 Game data processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111633834.2A CN114404993A (en) 2021-12-28 2021-12-28 Game data processing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114404993A true CN114404993A (en) 2022-04-29

Family

ID=81268654

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111633834.2A Pending CN114404993A (en) 2021-12-28 2021-12-28 Game data processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114404993A (en)

Similar Documents

Publication Publication Date Title
CN112933606B (en) Game scene conversion method and device, storage medium and computer equipment
CN111311756B (en) Augmented reality AR display method and related device
CN103157281B (en) Display method and display equipment of two-dimension game scene
CN111127611B (en) Three-dimensional scene rendering method and device and electronic equipment
CN107670279A (en) The development approach and system of 3D web games based on WebGL
CN112691381B (en) Rendering method, device and equipment of virtual scene and computer readable storage medium
CN114531553B (en) Method, device, electronic equipment and storage medium for generating special effect video
US20170185567A1 (en) User interface control layout method and electronic device
CN112926083B (en) Interactive processing method based on building information model and related device
CN112307403A (en) Page rendering method, device, storage medium and terminal
CN113989442B (en) Building information model construction method and related device
CN106774852B (en) Message processing method and device based on virtual reality
CN111857878A (en) Skeleton screen page generation method and device, electronic equipment and storage medium
CN111580808A (en) Page generation method and device, computer equipment and storage medium
US20120100912A1 (en) Method of reusing physics simulation results and game service apparatus using the same
CN112150602A (en) Model image rendering method and device, storage medium and electronic equipment
CN114404993A (en) Game data processing method and device, electronic equipment and storage medium
CN110719415A (en) Video image processing method and device, electronic equipment and computer readable medium
CN116212368A (en) Method and device for controlling scene establishment in game and electronic equipment
CN115671735A (en) Object selection method and device in game and electronic equipment
US20220279234A1 (en) Live stream display method and apparatus, electronic device, and readable storage medium
CN114417452A (en) Method for processing building information model and related device
CN112891940A (en) Image data processing method and device, storage medium and computer equipment
CN112037341A (en) Method and device for processing VR panorama interaction function based on Web front end
CN113318444B (en) Role rendering method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination