CN112190923A - Game event processing method in game, server and readable storage medium - Google Patents

Game event processing method in game, server and readable storage medium Download PDF

Info

Publication number
CN112190923A
CN112190923A CN202011105820.9A CN202011105820A CN112190923A CN 112190923 A CN112190923 A CN 112190923A CN 202011105820 A CN202011105820 A CN 202011105820A CN 112190923 A CN112190923 A CN 112190923A
Authority
CN
China
Prior art keywords
node
event
game
preset
executed
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
CN202011105820.9A
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.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network 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 Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202011105820.9A priority Critical patent/CN112190923A/en
Publication of CN112190923A publication Critical patent/CN112190923A/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/30Interconnection arrangements between game servers and game devices; Interconnection arrangements between game devices; Interconnection arrangements between game servers
    • A63F13/35Details of game servers
    • 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/50Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by details of game servers
    • A63F2300/53Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by details of game servers details of basic data processing
    • 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/50Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by details of game servers
    • A63F2300/53Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by details of game servers details of basic data processing
    • A63F2300/531Server assignment

Abstract

The application provides a method for processing game events in a game, a server and a readable storage medium, wherein a preset node graph stored in a singleton form and a preset graph and/or a preset node stored in the singleton form are extracted from a node graph cache pool based on event information of the game events to be executed, and an event node graph of the game events to be executed is determined; based on the attribute information of the game event to be executed, calling data corresponding to each node in the event node graph; and controlling the virtual character in the game to execute the game event to be executed according to the event node diagram and the data. In this way, only one preset node map, preset map and/or preset node with the same function logic can be stored by storing the preset node map, preset map and/or preset node of the game event in a single-case mode in the server, and when the preset node map, preset map and/or preset node are stored, corresponding data and logic structures are stored separately and are called respectively during operation, so that the memory space of the server is saved, and the game data volume is reduced.

Description

Game event processing method in game, server and readable storage medium
Technical Field
The present application relates to the field of game process technologies, and in particular, to a method, a server, and a readable storage medium for processing a game event in a game.
Background
With the continuous development of game development technology, various game types are generated, a MMORPG (massively multiplayer simultaneous online game) is one of the game types, in the running process of the MMORPG game, the logic of a plurality of game events to be executed is stored in the background of a server, as the number of players increases, the number of game events to be executed increases, the logic of the game events to be stored by the server increases, the memory space of the server is greatly occupied, and when a plurality of virtual characters in the game execute game tasks simultaneously, the server needs to call the logic of the plurality of game events simultaneously, the game data volume is large, and the game running smoothness is low.
Disclosure of Invention
In view of the above, an object of the present invention is to provide a method for processing a game event in a game, a server and a readable storage medium, which are capable of storing preset node maps, preset maps and/or preset nodes of the game event in a single-instance manner in the server, storing only one preset node map, preset map and/or preset node with the same function logic, and separately storing corresponding data and logic structures during storage, and calling the corresponding data and logic structures during running respectively, thereby saving memory space of the server and reducing the amount of game data.
The embodiment of the application provides a method for processing game events in a game, which comprises the following steps:
extracting preset node graphs stored in a singleton form and preset graphs and/or preset nodes stored in the singleton form from a node graph cache pool based on event information of a game event to be executed so as to determine an event node graph of the game event to be executed;
based on the attribute information of the game event to be executed, calling data corresponding to each node in the event node graph;
and controlling the virtual character in the game to execute the game event to be executed according to the event node graph and the data.
Further, the node map cache pool stores a plurality of preset node maps and a plurality of nodes and/or a plurality of maps, and each preset node map and each map and/or each node are used to implement at least part of event logic in an event.
Further, the event node map is determined by:
extracting preset node graphs which are stored in a singleton form and matched with the event information from a node graph cache pool, and taking the matched preset node graphs as event node graphs of the game events to be executed;
or, extracting a preset node graph which is stored in a singleton form and is partially matched with the event information, and partially matched graphs and/or nodes from a node graph cache pool, and constructing the event node graph of the game event to be executed according to the extracted preset node graph and the extracted graphs and/or nodes.
Further, the processing method further comprises:
if at least part of preset node graphs, graphs and/or nodes matched with the event information of the game event to be executed are absent from the node graph cache pool, constructing the absent preset node graphs, graphs and/or nodes according to the event information of the game event to be executed;
and adding the constructed preset node graphs, graphs and/or nodes into a node graph cache pool.
Further, the nodes include one or more of the following:
event nodes, condition nodes, behavior nodes, and state nodes.
Further, when the event node graph includes a state node, the processing method further includes:
and generating dynamic data corresponding to the state node based on the attribute information of the game event to be executed, and caching the dynamic data.
Further, when the event node graph includes a state node, the processing method further includes:
when the virtual character executes the state node in the game event to be executed, hanging the dynamic data on a virtual object attached to the state node so as to enable the dynamic data to be dynamically called;
and after the state node is executed, hooking the dynamic data from the virtual object is removed, so that the dynamic data is dynamically released.
Further, the processing method further comprises:
determining an update target object, wherein the update target object comprises an update node map, an update map and an update node;
in the process of game running, adding the update target object into the node graph cache pool, and deleting the used target object to be updated corresponding to the update target object from the node graph cache pool to release the target object to be updated, wherein the target object to be updated comprises a preset graph and/or a preset node to be updated.
An embodiment of the present application further provides a server, where the server includes:
the node graph determining module is used for extracting preset node graphs stored in a singleton form and preset graphs and/or preset nodes stored in the singleton form from a node graph cache pool based on event information of the game event to be executed so as to determine the event node graph of the game event to be executed;
the data calling module is used for calling data corresponding to each node in the event node graph based on the attribute information of the game event to be executed;
and the event execution module is used for controlling the virtual character in the game to execute the game event to be executed according to the event node graph and the data.
Further, the node map cache pool stores a plurality of preset node maps and a plurality of nodes and/or a plurality of maps, and each preset node map and each map and/or each node are used to implement at least part of event logic in an event.
Further, the node map determination module is configured to determine the event node map by:
extracting preset node graphs which are stored in a singleton form and matched with the event information from a node graph cache pool, and taking the matched preset node graphs as event node graphs of the game events to be executed;
or, extracting a preset node graph which is stored in a singleton form and is partially matched with the event information, and partially matched graphs and/or nodes from a node graph cache pool, and constructing the event node graph of the game event to be executed according to the extracted preset node graph and the extracted graphs and/or nodes.
Further, the server further includes an adding module, and the adding module is configured to:
if at least part of preset node graphs, graphs and/or nodes matched with the event information of the game event to be executed are absent from the node graph cache pool, constructing the absent preset node graphs, graphs and/or nodes according to the event information of the game event to be executed;
and adding the constructed preset node graphs, graphs and/or nodes into a node graph cache pool.
Further, the nodes include one or more of the following:
event nodes, condition nodes, behavior nodes, and state nodes.
Further, when the event node graph includes a state node, the server further includes a data generation module, where the data generation module is configured to:
and generating dynamic data corresponding to the state node based on the attribute information of the game event to be executed, and caching the dynamic data.
Further, when the event node map includes a state node, the server further includes a data hooking module, where the data hooking module is configured to:
when the virtual character executes the state node in the game event to be executed, hanging the dynamic data on a virtual object attached to the state node so as to enable the dynamic data to be dynamically called;
and after the state node is executed, hooking the dynamic data from the virtual object is removed, so that the dynamic data is dynamically released.
Further, the server further includes an update module, and the update module is configured to:
determining an update target object, wherein the update target object comprises an update node map, an update map and an update node;
in the process of game running, adding the update target object into the node graph cache pool, and deleting the used target object to be updated corresponding to the update target object from the node graph cache pool to release the target object to be updated, wherein the target object to be updated comprises a preset graph and/or a preset node to be updated.
An embodiment of the present application further provides an electronic device, including: a processor, a memory and a bus, the memory storing machine-readable instructions executable by the processor, the processor and the memory communicating over the bus when the electronic device is operating, the machine-readable instructions when executed by the processor performing the steps of the method of processing in-game events as described above.
Embodiments of the present application further provide a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to perform the steps of the method for processing a game event in a game as described above.
According to the method for processing the game event in the game, the server and the readable storage medium provided by the embodiment of the application, the preset node graph stored in the singleton form and the preset graph and/or the preset node stored in the singleton form are extracted from the node graph cache pool based on the event information of the game event to be executed, so as to determine the event node graph of the game event to be executed; based on the attribute information of the game event to be executed, calling data corresponding to each node in the event node graph; and controlling the virtual character in the game to execute the game event to be executed according to the event node graph and the data.
In this way, according to the event information of the game event to be executed, the preset node map stored in the singleton form and the preset map and/or the preset node stored in the singleton form are extracted from the node map cache pool, the event node map is determined, the data associated with the event node map is determined according to the attribute information of the game event to be executed, the virtual character in the game is controlled to execute the game event to be executed according to the event node map and the data, so that the preset node map, the preset map and/or the preset node with the same function logic can be stored only by storing the preset node map, the preset map and/or the preset node of the game event in the singleton form in the server, and when the storage is performed, the corresponding data and the logic structure are stored separately and are called respectively during the operation, which is beneficial to saving the memory space of the server, the amount of game data is reduced.
In order to make the aforementioned objects, features and advantages of the present application more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
FIG. 1 is a flow chart of a method for processing an in-game event according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a cache of a conventional node map cache pool;
FIG. 3 is a schematic diagram of a single instance of a node map cache pool;
FIG. 4 is a flow chart of a method for processing in-game events according to another embodiment of the present application;
FIG. 5 is a schematic view of an update flow;
fig. 6 is a schematic structural diagram of a server according to an embodiment of the present application;
fig. 7 is a second schematic structural diagram of a server according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all the embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. Every other embodiment that can be obtained by a person skilled in the art without making creative efforts based on the embodiments of the present application falls within the protection scope of the present application.
First, an application scenario to which the present application is applicable will be described. The method and the device can be applied to the technical field of game process processing, along with the acceleration of game research and development rhythm, the production end puts higher requirements on expansibility, stability and easy maintainability during game research and development, and the game research and development has the tendency of modular, standardized and tool development. Particularly, if the modularized codes can be reused as much as possible, the goals of expansibility, stability and easy maintenance are better approached, in the design process of the game, more possible creation of game logic functions can be presented in a modularized form, if enough basic function modules exist, most of the function requirements can be combined through the basic function modules, and therefore modularized development of game execution logic is necessary.
Research shows that with the continuous development of game research and development technologies, various game types are generated, the MMORPG (massively multiplayer simultaneous online game) is one of the game types, in the running process of the MMORPG game, the logic of a plurality of game events to be executed is stored in the background of the server, as the number of players increases, the number of game events to be executed increases, the logic of the game events to be stored in the server increases, the memory space of the server is greatly occupied, and when a plurality of virtual characters in the game execute game tasks simultaneously, the server is required to call the logic of the plurality of game events simultaneously, the game data volume is large, and the game running fluency is low.
Based on this, an embodiment of the present application provides a method for processing a game event in a game, which can store a preset node map, a preset map and/or preset nodes of the game event in a single-case manner in a server, store only one preset node map, preset map and/or preset nodes with the same function logic, and separately store corresponding data and a logic structure during storage, thereby being beneficial to saving a memory space of the server.
Referring to fig. 1, fig. 1 is a flowchart illustrating a method for processing a game event in a game according to an embodiment of the present disclosure. As shown in fig. 1, a method for processing a game event in a game provided in an embodiment of the present application includes:
s101, extracting preset node graphs stored in a singleton form and preset graphs and/or preset nodes stored in the singleton form from a node graph cache pool based on event information of the game event to be executed so as to determine the event node graphs of the game event to be executed.
In this step, according to event information of a game event to be executed in a game, a preset node map and preset maps and/or preset nodes associated with the game event to be executed are extracted from a preset node map cache pool, and an event node map of the game event to be executed is generated based on the extracted preset node map and preset maps and/or preset nodes.
Here, the game event to be executed refers to a series of events that may occur during the game process, for example, in a large-fleeing game, a virtual character attacks according to the task requirement, and the attack can be regarded as a game event to be executed.
Here, the event information of the game event to be executed indicates an action to be executed, an effect to be achieved, and the like of the game event to be executed. For example, if the game event to be executed is an attack event, the corresponding event information may include a condition of an attack target object and a damage effect that needs to be caused to the attacked object, or the event information is a preset event Identifier (ID), and the event ID is used as a Key to find a preset node map matching the Key.
Here, the node map cache pool is set up according to the basic requirements of the game at the beginning of game setting, and is used for storing cache areas matched with game execution flows, execution events and the like so as to ensure the smooth progress of the game process.
The node graph cache pool stores preset node graphs corresponding to a complete game event; or a preset map that is likely to be used for each game event; or the basic nodes constituting the node graph, and the nodes can be one or more of event nodes, condition nodes, behavior nodes and state nodes.
The script language for storing the preset node graph can be FlowScript, the event node is the starting point of script execution, and the event node is used for responding a certain game event in the game, such as skill starting, triggering a pulse to output to the event node, and activating a subsequent node in the node graph; the conditional nodes can influence the script execution flow, and the nodes which are continuously executed subsequently are selected based on the result output of some expressions, such as yes or no; the behavior node basically executes the calling of the data so as to execute the corresponding function; the state nodes represent some game events in progress. After the input interface of the state node receives the activation pulse, the state node is in an activation state. The state node will then remain active until it decides to shut down itself or to end passively for external reasons.
Here, when the node map cache pool stores, preset node maps, preset maps and preset nodes are stored in a singleton form, that is, multiple preset node maps and multiple nodes and/or multiple maps are stored in the node map cache pool, each preset node map and each map and/or each node are used to implement at least part of game event logic in one game event, the game event executed by each preset node map is different, and the game event logic implemented by each preset map and/or each node is also different.
In this way, the preset node map, the preset map and the preset node are stored in the node map cache pool in a single-case manner, and particularly for the same game event of different players, only one logical node map of the game event may be stored in the node map cache pool to save the storage space of the node map cache pool, so that the server can simultaneously support the operations of multiple players at the same time point, please refer to fig. 2 and fig. 3 at the same time, fig. 2 is a cache schematic diagram of a conventional node map cache pool, fig. 3 is a cache schematic diagram of a node map cache pool in a single-case manner, as shown in fig. 2, there are three players in total: a player a, a player B, and a player C store a skill 1 node map 210 of the player a, a skill 1 node map 220 of the player B, a skill 1 node map 230 of the player C, and a skill 2 node map 240 of the player B in a conventional node map cache pool 200 according to requirements of the players, which requires that a logic node map corresponding to each skill event is stored, and an internal memory of the node map cache pool is consumed; as shown in fig. 3, the above three players are also used, but since the logic of skill 1 to be performed by player a, player B and player C is completely the same, in the singleton node map cache pool 300, skill 1 of player a, player B and player C is uniformly stored in the skill 1 node map 310, and unique skill 2 of player B different from player a and player C is stored in the skill 2 node map 320 of player B, so that the singleton storage mode is helpful to save storage space through comparison between fig. 2 and fig. 3.
S102, calling data corresponding to each node in the event node graph based on the attribute information of the game event to be executed.
In this step, data corresponding to each node in an event node map corresponding to a game event to be executed is called according to attribute information of the game event to be executed.
Here, the attribute information of the game event to be executed indicates an action to be executed, an effect to be achieved, and the like of the game event to be executed. For example, if the game event to be executed is an attack event, the event information corresponding to the attack event may include the condition of the target object of the attack, the injury effect that needs to be caused to the attacked object, and the like; in the initial script forming process of the game, each action has corresponding data, and each data completes the corresponding action through the logic setting and the data calling logic setting.
The data in the FlowScript may include two types, namely a variable and an attribute, where the attribute refers to a certain numerical value of a certain entity object, such as a target entity blood volume, a constructor attack force, and the like, which are both attributes; the variable is some data which is dynamically generated in the running process of the FlowScript and belongs to the current running context (FlowContext) of the FlowScript, and all nodes can modify or access the data; for example, one function is the action point of setVar, which can set a variable new _ var value to 1, and another condition node can determine the value of new _ var and output different results. More complicated, behavior nodes can search for enemy units in a target range according to a certain rule, if the enemy units are searched, the enemy units are stored in a variable named target _ list, and when the nodes of subsequent attack behaviors need the enemy unit variable, the obtained target _ list variable can be filled in to attack the unit in the target _ list; meanwhile, in the logic design of the game event, corresponding function functions are required to be called, and the functions can represent game actions which can be executed by corresponding virtual characters, achieved effects and the like.
Taking this game event as an example of three attack processes, after Hit1 hits the target, a conditional decision is made that if the enemy blood volume is less than 50%, the damage coefficient of Hit2 is doubled, and if the target has a petrochemical effect, Hit3 has a probability of 10%, resulting in a fatal Hit. Here, the data to be called includes a conditional judgment function, a damage coefficient doubling function, a petrochemical effect function, and the like.
Thus, after the relevant data is determined, the execution logic of the game event to be executed is determined by giving each node the corresponding function through function call.
S103, controlling the virtual character in the game to execute the game event to be executed according to the event node graph and the data.
In the step, the virtual roles in the game are controlled to execute the game event to be executed according to the determined execution sequence of each node in the node graph and the function logic corresponding to the function called by each node.
Here, for the above example, when the game event to be executed is a third attack event, a preset node map corresponding to the third attack event, an attack function, a condition judgment function, an injury coefficient doubling function, a petrochemical effect function, and the like corresponding to each node are determined first. The method comprises the steps that firstly, event nodes are triggered, the process of executing the attack for three times is started, the attack function is called through behavior nodes to execute the attack for the first time Hit1, after the execution is finished, the condition nodes call the condition judgment function to judge whether the blood volume of an enemy is less than 50%, if the blood volume of the enemy is determined to be less than 50%, the behavior nodes call the attack function and the injury coefficient doubling function to execute the attack for the second time Hit2, after the execution of the second time function is finished, the condition nodes judge whether the virtual character has a petrochemical effect, if the virtual character has the petrochemical effect, the behavior nodes call the attack function and the petrochemical effect function to execute the attack for the third time Hit3, and therefore the game event of the attack for three.
In the method for processing the game event in the game provided by the embodiment of the application, based on the event information of the game event to be executed, the preset node graph stored in the singleton form and the preset graph and/or the preset node stored in the singleton form are extracted from the node graph cache pool, so as to determine the event node graph of the game event to be executed; based on the attribute information of the game event to be executed, calling data corresponding to each node in the event node graph; and controlling the virtual character in the game to execute the game event to be executed according to the event node graph and the data.
In this way, according to the event information of the game event to be executed, the preset node map stored in a singleton form and the preset map and/or the preset node stored in the singleton form are extracted from the node map cache pool, the event node map is determined, the data associated with the event node map is determined according to the attribute information of the game event to be executed, the virtual character in the game is controlled to execute the game event to be executed according to the event node map and the data, so that the preset node map, the preset map and/or the preset node with the same function logic can be stored only by storing the preset node map, the preset map and/or the preset node of the game event in the singleton form in the server, and when the storage is performed, the corresponding data and the logic structure are stored separately and called respectively during the operation, which is beneficial to saving the memory space of the server, the amount of game data is reduced.
Referring to fig. 4, fig. 4 is a flowchart illustrating a method for processing a game event in a game according to another embodiment of the present application. As shown in fig. 4, the method for processing a game event in a game provided by the embodiment of the present application includes:
s401, extracting preset node graphs stored in a singleton form and preset graphs and/or preset nodes stored in the singleton form from a node graph cache pool based on event information of the game event to be executed, so as to determine the event node graphs of the game event to be executed.
S402, calling data corresponding to each node in the event node graph based on the attribute information of the game event to be executed.
And S403, controlling the virtual character in the game to execute the game event to be executed according to the event node graph and the data.
S404, determining an update target object, wherein the update target object comprises an update node graph, an update graph and an update node.
In this step, there may be a situation that updating is required during the game, and at this time, according to the requirement to be updated, the update node map, the update map and the update node that need to be updated are determined.
Here, the update in the embodiment of the present application is a hot update, and is only to update the cache pool of the graph and the node, and does not affect the logic call and the function implementation of the running node graph.
S405, in the process of game running, adding the update target object into the node map cache pool, and deleting the used target object to be updated corresponding to the update target object from the node map cache pool to release the target object to be updated, wherein the target object to be updated comprises a preset map and/or preset nodes to be updated.
In this step, in the normal progress of the game, the update target object is added to the node map cache pool, and after it is determined that the target object to be updated corresponding to the update target object is used up, the target object to be updated is deleted from the node map cache pool, and it is determined that the preset map and/or the preset node of the same function logic are/is stored in the node map cache pool in a single instance.
Referring to fig. 5, fig. 5 is a schematic diagram of an update flow, as shown in fig. 5, when a hot update occurs, a skill 510 of player a invokes a node map 520 to be updated at runtime, and a skill 530 of player B invokes the node map 520 to be updated at runtime, then the release of the skills of player a and player B is not affected at all until the skill running of the players is finished, and at the same time when player a and player B execute the skills, an updated node map 540 is generated and put into a node cache pool 550, and by using a reference count recycle mechanism of a dynamic language, an old node map is not called by any player skill any more, and then the old node map is released by a garbage collector of the dynamic language. The key of the mechanism is that the hot update of the node map cannot directly update the node map at the running time, and only the cache pool object can be updated.
The descriptions of S401 to S403 may refer to the descriptions of S101 to S103, and the same technical effects can be achieved, which is not described in detail herein.
Further, the event node map is determined by: extracting preset node graphs which are stored in a singleton form and matched with the event information from a node graph cache pool, and taking the matched preset node graphs as event node graphs of the game events to be executed; or, extracting a preset node graph which is stored in a singleton form and is partially matched with the event information, and partially matched graphs and/or nodes from a node graph cache pool, and constructing the event node graph of the game event to be executed according to the extracted preset node graph and the extracted graphs and/or nodes.
In the step, after a game event to be executed is determined, if a preset node map matched with the game event to be executed exists, extracting the preset node map from a node map cache pool, and using the preset node map as an event node map of the game event to be executed; if the preset node graph completely matched with the game event to be executed does not exist, but the preset node graph partially matched with the game event to be executed, and the partially matched graph and/or node exist in the node graph cache pool, extracting the partially matched preset node graph, graph and/or node, and constructing the event node graph of the game event to be executed according to the event information of the game event to be executed.
Here, some game events to be executed are commonly used in the game, and these game events to be executed are already set and completed when the game is initially set, and are stored in the node map cache pool, and when such game events are executed, the game events are directly called from the node map cache pool, and the constructed preset node map is used as an event node map of the game events to be executed, and the game events to be executed are executed; some game events to be executed may be unique in a game, or because a game event is newly added after the game is updated, a preset node map which is completely matched with the game events to be executed does not exist in the node map cache pool, but because the functions of the game are derived from the original game functions, a preset node map which is partially matched with the event information, and partially matched maps and/or nodes may exist in the node map cache pool, and the partially matched preset node maps, maps and/or nodes are extracted, and an event node map is constructed according to the event information of the game event to be executed.
For example, the game event to be executed is three consecutive attacks, a preset node map which is matched with the three consecutive attacks is not found in the node map cache pool, a preset node map of a single attack exists in the node map cache pool, and condition nodes between every two attacks indicated by event information of the game event to be executed are extracted, and the event node map which is matched with the three consecutive attacks is constructed according to the execution sequence.
Further, the processing method further comprises: if at least part of preset node graphs, graphs and/or nodes matched with the event information of the game event to be executed are absent from the node graph cache pool, constructing the absent preset node graphs, graphs and/or nodes according to the event information of the game event to be executed; and adding the constructed preset node graphs, graphs and/or nodes into a node graph cache pool.
In this step, after determining a game event to be executed, searching at least a part of preset node maps, graphs and/or nodes matched with the game event to be executed according to an event ID of the game event to be executed, and if it is found that at least a part of preset node maps, graphs and/or nodes matched with the game event to be executed does not exist, constructing preset node maps, graphs and/or nodes capable of executing an event logic of the game event according to a requirement; and adding the constructed preset node graph, graph and/or node into a node graph cache pool.
Here, when constructing the preset node map, the preset node, and/or the preset node, it is assumed that a requirement of a game event is used as a starting point, for example, in the game event, when an attack is initiated on a virtual character, a blood volume of the virtual character needs to be determined, and when the blood volume of the virtual character is greater than 80%, a flame effect is formed around the virtual character, then according to the requirement, a condition node that a user determines whether the blood volume is greater than 80% and an action node that executes the flame effect need to be constructed, a determination function that determines whether the blood volume is greater than 80% and a flame function that executes the flame effect need to be constructed, and in a node construction process, the constructed function needs to be associated with the node.
Here, when adding the constructed preset node map, graph and/or node to the node map cache pool, the storage area may be determined according to the node attribute, such as placing the condition node together with other condition nodes, or placing the constructed preset node map, graph and/or node in an area where a plurality of preset node maps, graphs and/or nodes that may together constitute a game event to be executed are located.
Here, when constructing preset node diagrams, diagrams and/or nodes, if event nodes, condition nodes and behavior nodes other than state nodes are constructed, a series of options can be enumerated at each node when FlowScript is constructed, and an editor can conveniently select objects to be compared and attributes of the objects as required; if the construction is a state node, dynamic data (variable) can be added to the state node when the FlowScript construction is carried out.
Further, when the event node graph includes a state node, the processing method further includes: and generating dynamic data corresponding to the state node based on the attribute information of the game event to be executed, and caching the dynamic data.
In this step, when the event node map includes the state nodes, dynamic data in each state is generated according to the attribute information of the game event to be executed, and the dynamic data and the node states are cached in association.
Here, the function of the state node is to design some maintenance of real-time state information, such as the position of a virtual character in a game, blood volume, the state of some algorithms, and the like, so that besides a singleton node, a piece of state information needs to be maintained. The exit of the state node is usually some events in the state, for example, the skill state node has hit, break, end, etc., and the button state node has press, lift, etc. The state node can exit the state node or continue the state node when the event is triggered, and the specific implementation can be determined by the requirement of game setting for realizing the state node.
The nodes corresponding to the dynamic nodes and the data adopt a storage mode of separating static data from runtime data, that is, an execution logic framework corresponding to the dynamic nodes is stored in a node graph cache pool in a single-example storage mode, while data used for describing the state of a game event during game runtime is dynamically created during game runtime, and the created dynamic data is deleted after the event is executed, so that the memory occupation of the graph and the nodes cannot be increased along with the increase of the logic calling times, and the technical effect of saving the memory is achieved.
Further, when the event node graph includes a state node, the processing method further includes: when the virtual character executes the state node in the game event to be executed, hanging the dynamic data on a virtual object attached to the state node so as to enable the dynamic data to be dynamically called; and after the state node is executed, hooking the dynamic data from the virtual object is removed, so that the dynamic data is dynamically released.
In this step, when the event node diagram includes a state node, and when the virtual character is to execute the state node in the game event to be executed, the state information matched with the state node and the created dynamic data are associated with the virtual character, so that the virtual character executes the logic information of the state node, thereby completing the game action that the virtual character needs to complete, and after the state node is executed, the binding between the dynamic data and the virtual character is released, and the created dynamic data is released.
The created dynamic data is released along with the dynamic release after the virtual character execution action is finished, so that additional management is not needed, the stability of the memory during operation is greatly enhanced, the memory leakage is not easy to cause, and the difficulty of game setting is reduced.
Thus, according to the event information of the game event to be executed, the preset node map stored in a single-case form and the preset map and/or the preset node stored in the single-case form are extracted from the node map cache pool, the event node map is determined, the data associated with the event node map is determined according to the attribute information of the game event to be executed, the virtual character in the game is controlled to execute the game event to be executed according to the event node map and the data, and when an updatable update target object exists, the updated update object is added to the node map cache pool after updating, so that only one preset node map, preset map and/or preset node with the same function logic can be stored by storing the preset node map, preset map and/or preset node of the game event in the single-case form in the server, and when the game data are stored, the corresponding data and the logic structure are stored separately and are called respectively during running, so that the memory space of the server is saved, and the game data volume is reduced.
Referring to fig. 6 and 7, fig. 6 is a first schematic structural diagram of a server according to an embodiment of the present application, and fig. 7 is a second schematic structural diagram of a server according to an embodiment of the present application. As shown in fig. 6, the server 600 includes:
the node map determining module 610 is configured to extract, based on event information of a game event to be executed, a preset node map stored in a singleton form and a preset map and/or a preset node stored in the singleton form from a node map cache pool, so as to determine an event node map of the game event to be executed.
And a data calling module 620, configured to call, based on the attribute information of the game event to be executed, data corresponding to each node in the event node map.
And an event executing module 630, configured to control a virtual character in the game to execute the game event to be executed according to the event node map and the data.
Further, as shown in fig. 7, the server 600 further includes an adding module 640, where the adding module 640 is configured to:
if at least part of preset node graphs, graphs and/or nodes matched with the event information of the game event to be executed are absent from the node graph cache pool, constructing the absent preset node graphs, graphs and/or nodes according to the event information of the game event to be executed;
and adding the constructed preset node graphs, graphs and/or nodes into a node graph cache pool.
Further, as shown in fig. 7, when the event node graph includes a state node, the server 600 further includes a data generation module 650, where the data generation module 650 is configured to:
and generating dynamic data corresponding to the state node based on the attribute information of the game event to be executed, and caching the dynamic data.
Further, as shown in fig. 7, when the event node map includes a state node, the server 600 further includes a data hooking module 660, where the data hooking module 660 is configured to:
when the virtual character executes the state node in the game event to be executed, hanging the dynamic data on a virtual object attached to the state node so as to enable the dynamic data to be dynamically called;
and after the state node is executed, hooking the dynamic data from the virtual object is removed, so that the dynamic data is dynamically released.
Further, as shown in fig. 7, the server 600 further includes an update module 670, where the update module 670 is configured to:
determining an update target object, wherein the update target object comprises an update node map, an update map and an update node;
in the process of game running, adding the update target object into the node graph cache pool, and deleting the used target object to be updated corresponding to the update target object from the node graph cache pool to release the target object to be updated, wherein the target object to be updated comprises a preset graph and/or a preset node to be updated.
Further, the node map cache pool stores a plurality of preset node maps and a plurality of nodes and/or a plurality of maps, and each preset node map and each map and/or each node are used to implement at least part of event logic in an event.
Further, the node map determination module 610 is configured to determine the event node map by:
extracting preset node graphs which are stored in a singleton form and matched with the event information from a node graph cache pool, and taking the matched preset node graphs as event node graphs of the game events to be executed;
or, extracting a preset node graph which is stored in a singleton form and is partially matched with the event information, and partially matched graphs and/or nodes from a node graph cache pool, and constructing the event node graph of the game event to be executed according to the extracted preset node graph and the extracted graphs and/or nodes.
Further, the nodes include one or more of the following:
event nodes, condition nodes, behavior nodes, and state nodes.
The server provided by the embodiment of the application extracts a preset node map stored in a singleton form and a preset map and/or preset nodes stored in the singleton form from a node map cache pool based on event information of a game event to be executed, so as to determine an event node map of the game event to be executed; based on the attribute information of the game event to be executed, calling data corresponding to each node in the event node graph; and controlling the virtual character in the game to execute the game event to be executed according to the event node graph and the data.
In this way, according to the event information of the game event to be executed, the preset node map stored in a singleton form and the preset map and/or the preset node stored in the singleton form are extracted from the node map cache pool, the event node map is determined, the data associated with the event node map is determined according to the attribute information of the game event to be executed, the virtual character in the game is controlled to execute the game event to be executed according to the event node map and the data, so that the preset node map, the preset map and/or the preset node with the same function logic can be stored only by storing the preset node map, the preset map and/or the preset node of the game event in the singleton form in the server, and when the storage is performed, the corresponding data and the logic structure are stored separately and called respectively during the operation, which is beneficial to saving the memory space of the server, the amount of game data is reduced.
Referring to fig. 8, fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. As shown in fig. 8, the electronic device 800 includes a processor 810, a memory 820, and a bus 830.
The memory 820 stores machine-readable instructions executable by the processor 810, when the electronic device 800 runs, the processor 810 communicates with the memory 820 through the bus 830, and when the machine-readable instructions are executed by the processor 810, the steps of the method for processing game events in a game in the method embodiments shown in fig. 1 and fig. 4 may be executed.
An embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method for processing a game event in a game in the method embodiments shown in fig. 1 and fig. 4 may be executed.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a non-volatile computer-readable storage medium executable by a processor. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
Finally, it should be noted that: the above-mentioned embodiments are only specific embodiments of the present application, and are used for illustrating the technical solutions of the present application, but not limiting the same, and the scope of the present application is not limited thereto, and although the present application is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope disclosed in the present application; such modifications, changes or substitutions do not depart from the spirit and scope of the exemplary embodiments of the present application, and are intended to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (11)

1. A method of processing an in-game event, the method comprising:
extracting preset node graphs stored in a singleton form and preset graphs and/or preset nodes stored in the singleton form from a node graph cache pool based on event information of a game event to be executed so as to determine an event node graph of the game event to be executed;
based on the attribute information of the game event to be executed, calling data corresponding to each node in the event node graph;
and controlling the virtual character in the game to execute the game event to be executed according to the event node graph and the data.
2. The processing method according to claim 1, wherein the node map cache pool stores therein a plurality of preset node maps and a plurality of nodes and/or a plurality of maps, and each preset node map and each map and/or each node is used to implement at least part of event logic in an event.
3. The processing method according to claim 1, wherein the event node map is determined by:
extracting preset node graphs which are stored in a singleton form and matched with the event information from a node graph cache pool, and taking the matched preset node graphs as event node graphs of the game events to be executed; or
And extracting preset node graphs which are stored in a singleton form and are partially matched with the event information and partially matched graphs and/or nodes from a node graph cache pool, and constructing the event node graph of the game event to be executed according to the extracted preset node graphs and the extracted graphs and/or nodes.
4. The processing method according to claim 1, characterized in that it further comprises:
if at least part of preset node graphs, graphs and/or nodes matched with the event information of the game event to be executed are absent from the node graph cache pool, constructing the absent preset node graphs, graphs and/or nodes according to the event information of the game event to be executed;
and adding the constructed preset node graphs, graphs and/or nodes into a node graph cache pool.
5. The processing method of claim 1, wherein the nodes comprise one or more of the following nodes:
event nodes, condition nodes, behavior nodes, and state nodes.
6. The processing method according to claim 1, wherein when a state node is included in the event node map, the processing method further comprises:
and generating dynamic data corresponding to the state node based on the attribute information of the game event to be executed, and caching the dynamic data.
7. The processing method according to claim 6, wherein when a state node is included in the event node map, the processing method further comprises:
when the virtual character executes the state node in the game event to be executed, hanging the dynamic data on a virtual object attached to the state node so as to enable the dynamic data to be dynamically called;
and after the state node is executed, hooking the dynamic data from the virtual object is removed, so that the dynamic data is dynamically released.
8. The processing method according to claim 1, characterized in that it further comprises:
determining an update target object, wherein the update target object comprises an update node map, an update map and an update node;
in the process of game running, adding the update target object into the node graph cache pool, and deleting the used target object to be updated corresponding to the update target object from the node graph cache pool to release the target object to be updated, wherein the target object to be updated comprises a preset graph and/or a preset node to be updated.
9. A server, characterized in that the server comprises:
the node graph determining module is used for extracting preset node graphs stored in a singleton form and preset graphs and/or preset nodes stored in the singleton form from a node graph cache pool based on event information of the game event to be executed so as to determine the event node graph of the game event to be executed;
the data calling module is used for calling data corresponding to each node in the event node graph based on the attribute information of the game event to be executed;
and the event execution module is used for controlling the virtual character in the game to execute the game event to be executed according to the event node graph and the data.
10. An electronic device, comprising: a processor, a memory and a bus, the memory storing machine-readable instructions executable by the processor, the processor and the memory communicating over the bus when the electronic device is operating, the processor executing the machine-readable instructions to perform the steps of the method of processing in-game events according to any of claims 1 to 8.
11. A computer-readable storage medium, having stored thereon a computer program for performing, when executed by a processor, the steps of a method of processing a game event in a game according to any one of claims 1 to 8.
CN202011105820.9A 2020-10-15 2020-10-15 Game event processing method in game, server and readable storage medium Pending CN112190923A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011105820.9A CN112190923A (en) 2020-10-15 2020-10-15 Game event processing method in game, server and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011105820.9A CN112190923A (en) 2020-10-15 2020-10-15 Game event processing method in game, server and readable storage medium

Publications (1)

Publication Number Publication Date
CN112190923A true CN112190923A (en) 2021-01-08

Family

ID=74010162

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011105820.9A Pending CN112190923A (en) 2020-10-15 2020-10-15 Game event processing method in game, server and readable storage medium

Country Status (1)

Country Link
CN (1) CN112190923A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101446973A (en) * 2008-12-19 2009-06-03 北京数码大方科技有限公司 Tree view node loading display method for information management system
CN103827957A (en) * 2011-09-22 2014-05-28 索尼电脑娱乐公司 Image processing device, image processing method, and image file data structure
CN108043029A (en) * 2017-12-22 2018-05-18 网易(杭州)网络有限公司 Logic control method and device
CN111001157A (en) * 2019-11-29 2020-04-14 腾讯科技(深圳)有限公司 Method and device for generating reference information, storage medium and electronic device
CN111359216A (en) * 2020-02-13 2020-07-03 网易(杭州)网络有限公司 Game information processing method and device, electronic equipment and storage medium
US10722798B1 (en) * 2014-06-09 2020-07-28 Amazon Technologies, Inc. Task-based content management
CN111581112A (en) * 2020-06-04 2020-08-25 网易(杭州)网络有限公司 File processing method and device, storage medium, processor and electronic device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101446973A (en) * 2008-12-19 2009-06-03 北京数码大方科技有限公司 Tree view node loading display method for information management system
CN103827957A (en) * 2011-09-22 2014-05-28 索尼电脑娱乐公司 Image processing device, image processing method, and image file data structure
US10722798B1 (en) * 2014-06-09 2020-07-28 Amazon Technologies, Inc. Task-based content management
CN108043029A (en) * 2017-12-22 2018-05-18 网易(杭州)网络有限公司 Logic control method and device
CN111001157A (en) * 2019-11-29 2020-04-14 腾讯科技(深圳)有限公司 Method and device for generating reference information, storage medium and electronic device
CN111359216A (en) * 2020-02-13 2020-07-03 网易(杭州)网络有限公司 Game information processing method and device, electronic equipment and storage medium
CN111581112A (en) * 2020-06-04 2020-08-25 网易(杭州)网络有限公司 File processing method and device, storage medium, processor and electronic device

Similar Documents

Publication Publication Date Title
EP3860043A2 (en) Method and apparatus for implementing smart contract based on blockchain
WO2023035793A1 (en) Level information display method and apparatus, and computer device and storage medium
US11245776B2 (en) Data model for uniform data platform
CN110941485B (en) Game task running method and device and electronic terminal
JP2014171538A (en) Game managing device and program for game managing device
CN109558159B (en) Method and device for updating user interface in game
CN114880189A (en) Application program monitoring method and device and computing equipment
US20240009571A1 (en) Game data processing method and apparatus, device, storage medium, and program product
CN112190923A (en) Game event processing method in game, server and readable storage medium
CN111359213B (en) Method and apparatus for controlling virtual players in game play
JP7009523B2 (en) Dynamic level of destruction details in electronic game display
CN111111212B (en) Storage method, device and equipment for player game data and storage medium
US10065104B2 (en) Method and apparatus for providing a computer implemented word game
CN109343913B (en) Game behavior tree control method
EP2677432A1 (en) Memory management program, memory management method, information processing device, and computer-readable recording medium upon which memory management program has been recorded
CN111737166B (en) Data object processing method, device and equipment
CN113694521A (en) Injury processing method, apparatus, electronic device and storage medium
JP6560807B2 (en) System, method, and program for providing game
CN109646959B (en) Method for managing NPC (non-player character) based on state machine and related equipment
CN109947561B (en) Virtual scene processing method and device and storage medium
CN107320963B (en) Role attribute storage method and device, storage medium, processor and server
US20230001299A1 (en) Program, server, method, and system for increasing predictability of enemy next action
JP7009671B1 (en) Server, game program, information processing method
JP7470515B2 (en) program
CN116340669A (en) Page function operation method, page function operation system 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