Method, device, electronic device and storage medium for processing events in games
By obtaining the candidate function identifiers and conditional judgment rules when game events are triggered on the client, combined with random probability, the game function results are dynamically generated, which solves the problem of difficulty in maintaining Roguelike game events and heavy configuration workload, and realizes efficient randomization of game events. flexibility and simplified configuration.
Patent Information
- Application Number
- CN202111166253.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-30
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2041-09-30
AI Technical Summary
In the existing technology, Roguelike game events are difficult to maintain and the configuration workload is heavy. This causes developers to configure each game event one by one in the editor, which increases the production workload.
By obtaining the candidate function identification when the game event is triggered on the client, combined with conditional judgment rules and random probability, the game function results are dynamically generated, reducing repetitive work and simplifying the configuration of the event node graph.
It effectively meets the randomness requirements of game events, reduces repetitive work, simplifies the configuration operations of the event node graph, and improves the execution efficiency of game events.
Smart Images

Figure CN113856205B
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of network technology, and in particular to a method for processing events in a game, a device for processing events in a game, an electronic device, and a storage medium. Background Art
[0002] Roguelike (non-linear instant random game) is a general term for a type of game, which is a branch of role-playing games. It has the characteristics of random generation, one-way process, permanent death of characters and non-linear game. Among them, the biggest feature is the random generation. Every time a new game starts, different game events will be triggered according to the players in the game, and then the game functions pre-set by the game events will be executed, so as to realize the random generation of game scenes, enemies, treasures and other things.
[0003] In the related art, developers need to configure the corresponding game functions for each game event one by one in the editor in order to generate randomness in the game, which causes a lot of repetitive work and increases the workload of production. Summary of the invention
[0004] The embodiment of the present invention provides a method for processing events in a game, so as to solve the problems in the prior art that game events are difficult to maintain and have a large configuration workload.
[0005] Correspondingly, an embodiment of the present invention further provides an event processing device in a game to ensure the implementation and application of the above method.
[0006] In order to solve the above problem, an embodiment of the present invention discloses a method for processing an event in a game, which is applied to a client, wherein the client has a game function set, wherein the game function set includes at least one game function, wherein the game function includes at least one game function result, wherein the game function has a corresponding function identifier, and wherein the game function result has a corresponding condition identifier. The method includes:
[0007] When a game character controlled by a player triggers a game event in the game, a candidate function identifier corresponding to the game event is obtained;
[0008] Using the game function corresponding to the candidate function identifier as a candidate game function;
[0009] Acquire a condition identifier corresponding to the game function result in the candidate game functions as a candidate condition identifier;
[0010] Obtaining the condition judgment rule corresponding to the candidate condition identifier;
[0011] Acquire game information, and use the candidate condition identifier of the game information that meets the condition judgment rule as the target condition identifier; the game information is the corresponding information of the game character corresponding to the client;
[0012] Randomly obtain and execute a target game function result from the game function results corresponding to the target condition identifier.
[0013] Optionally, when a game event is triggered in the game, the step of obtaining a candidate function identifier corresponding to the game event includes:
[0014] Sending the event identifier of the game event to the server; the server is used to obtain the function identifier corresponding to the game event identifier according to the pre-configured event configuration table, and use the function identifier as a candidate function identifier corresponding to the game event;
[0015] Receive a candidate function identifier corresponding to the game event sent by the server.
[0016] Optionally, the event configuration table includes at least one event identifier, the event identifier has a corresponding event node graph, the event node graph includes a plurality of sequentially connected event nodes, the event nodes have corresponding logic codes and function identifiers, and the server is used to sequentially execute the logic codes of the event nodes and use the function identifiers corresponding to the event nodes as candidate function identifiers.
[0017] Optionally, the step of using the game function corresponding to the candidate function identifier as a candidate game function includes:
[0018] Traversing the game functions in the game function set;
[0019] The game function whose function identifier corresponding to the game function is consistent with the candidate function identifier is used as a candidate game function.
[0020] Optionally, obtaining game information includes:
[0021] Obtaining character information of the game character and / or scene information of the game scene in which the game character is located; the character information includes at least one of gender, age, level, and occupation; the scene information includes at least one of the weather, the position in the game scene, and the level in which the game character is located.
[0022] Optionally, the game function result has a corresponding random probability, and the step of randomly obtaining a target game function result from the game function result corresponding to the target condition identifier and executing the result comprises:
[0023] Obtaining the random probability corresponding to the game function result corresponding to the target condition identifier;
[0024] Acquire a game function result from the game function results corresponding to the target condition identifier according to random probability as the target game function result;
[0025] Execute the target game function result.
[0026] Optionally, the game function includes at least one of attribute verification, resource delivery and text display.
[0027] The embodiment of the present invention further discloses an event processing device in a game, which is applied to a client, wherein the client has a game function set, wherein the game function set includes at least one game function, wherein the game function includes at least one game function result, wherein the game function has a corresponding function identifier, and wherein the game function result has a corresponding condition identifier. The device includes:
[0028] A candidate function identifier acquisition module, used for acquiring a candidate function identifier corresponding to a game event when a game character controlled by a player triggers a game event in the game;
[0029] A candidate game function acquisition module, used to take the game function corresponding to the candidate function identifier as a candidate game function;
[0030] A candidate condition identifier acquisition module, used to acquire a condition identifier corresponding to the game function result in the candidate game function as a candidate condition identifier;
[0031] A condition judgment rule acquisition module, used to obtain the condition judgment rule corresponding to the candidate condition identifier;
[0032] A target condition identifier acquisition module is used to acquire game information, and use the candidate condition identifier of the game information that meets the condition judgment rule as the target condition identifier; the game information is the corresponding information of the game character corresponding to the client;
[0033] The target game function acquisition module is used to randomly acquire and execute the target game function result from the candidate game function results corresponding to the target condition identifier.
[0034] Optionally, the candidate function identifier acquisition module is used to send the event identifier of the game event to the server; the server is used to obtain the function identifier corresponding to the game event identifier according to a pre-configured event configuration table, and use the function identifier as the candidate function identifier corresponding to the game event; and receive the candidate function identifier corresponding to the game event sent by the server.
[0035] Optionally, the event configuration table includes at least one event identifier, the event identifier has a corresponding event node graph, the event node graph includes a plurality of sequentially connected event nodes, the event nodes have corresponding logic codes and function identifiers, and the server is used to sequentially execute the logic codes of the event nodes and use the function identifiers corresponding to the event nodes as candidate function identifiers.
[0036] Optionally, the candidate game function acquisition module is used to traverse the game functions in the game function set; and take the game function whose function identifier corresponding to the game function is consistent with the candidate function identifier as a candidate game function.
[0037] Optionally, the target condition identification acquisition module is used to obtain character information of the game character and / or scene information of the game scene in which the game character is located; the character information includes at least one of gender, age, level, and occupation; the scene information includes at least one of the weather, the position in the game scene, and the level in which the game character is located.
[0038] Optionally, the target game function acquisition module is used to obtain the random probability corresponding to the game function result corresponding to the target condition identifier; obtain a game function result from the game function results corresponding to the target condition identifier as the target game function result according to the random probability; and execute the target game function result.
[0039] Optionally, the game function includes at least one of attribute verification, resource delivery and text display.
[0040] An embodiment of the present invention discloses an electronic device, including a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, the steps of the event processing method in the game are implemented.
[0041] An embodiment of the present invention discloses a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for handling events in a game as described above are implemented.
[0042] The embodiments of the present invention include the following advantages:
[0043] In an embodiment of the present invention, by setting the game function of the event node as a function identifier, taking the game function corresponding to the function identifier as a candidate game function, obtaining the condition identifier corresponding to the game function result in the candidate game function as a candidate condition identifier, obtaining the condition judgment rule corresponding to the candidate condition identifier, obtaining game information, taking the candidate condition identifier whose game information meets the condition judgment rule as the target condition identifier, randomly obtaining and executing the target game function result from the game function result corresponding to the target condition identifier, the demand for event randomness can be effectively met.
[0044] In addition, the two parameters of random probability and condition identification are used as common data for generating random results, which reduces repetitive work and simplifies the configuration operation of the event node graph. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 It is a structural diagram of event nodes in a game;
[0046] Figure 2 is a flowchart of a method for handling events in a game according to an embodiment of the present invention;
[0047] Figure 3 It is a structural schematic diagram of a game event in an embodiment of a method for processing an event in a game of the present invention;
[0048] Figure 4 An event execution flow chart of an embodiment of a method for handling events in a game of the present invention;
[0049] Figure 5 is an event configuration flow chart of an embodiment of a method for handling events in a game according to the present invention;
[0050] Figure 6 It is a schematic diagram of a game function structure of an embodiment of a method for handling events in a game of the present invention;
[0051] Figure 7 It is a structural block diagram of an embodiment of an event processing device in a game according to the present invention. DETAILED DESCRIPTION
[0052] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0053] As a component of the game, game events are usually triggered by character behavior and game progress, and have functions such as promoting the development of the game plot and obtaining game props and resources. The common editing method of existing game events is to encapsulate each independent function in the game event into modular nodes, and then combine each node into the logic of a game event. For example, a game event for obtaining props has a node diagram like Figure 1 As shown, the node operation process includes: after the player triggers the game event, the basic interface is first displayed, and then the option interface appears to provide different options for the player to choose from. After the player selects an option, the corresponding attribute verification will be performed, and finally the result interface will be displayed and resources (such as props) will be obtained.
[0054] The above method can combine game events with different functions with nodes, which can meet the needs of general games. However, due to the random characteristics of the Roguelike type, a large number of random game events are required in the game. In order to make the game events more random, a node in the game event with the same structure also needs to present different effects due to different restrictions. Taking the basic interface display node as an example, the displayed dialogue content may need to display different texts according to the status of the character, and the background image should also be adjusted according to the gender of the character, and it may even be affected by the weather system. Therefore, when using ordinary modular function nodes, it is necessary to consider the impact of different situations in the node. If different situations are judged in each node, then each node needs to customize different conditions according to the needs, which is difficult to maintain. If a large number of event node graphs with the same structure but different sub-node parameters are required in the game, the developer needs to configure and generate independent game events one by one in the editor, resulting in a lot of duplication of work and increasing the workload of production.
[0055] In view of the above problems, an embodiment of the present invention provides a method for handling events in a game, so as to solve the problem that the above game events are difficult to maintain and require a large amount of configuration work.
[0056] The in-game event processing method in the embodiment of the present invention can be run on a local terminal device or a server. When the in-game event processing method is run on a server, it can be a cloud game.
[0057] In an optional implementation, cloud gaming refers to a gaming method based on cloud computing. In the operation mode of cloud gaming, the operating entity of the game program and the subject of presenting the game screen are separated. The storage and operation of the event processing method in the game are completed on the cloud gaming server. The role of the cloud gaming client is to receive and send data and present the game screen. For example, the cloud gaming client can be a display device with data transmission function close to the user side, such as a mobile terminal, a television, a computer, a handheld computer, etc.; but the cloud gaming server in the cloud is used to process the game data. When playing the game, the player operates the cloud gaming client to send an operation instruction to the cloud gaming server. The cloud gaming server runs the game according to the operation instruction, encodes and compresses the game screen and other data, and returns it to the cloud gaming client through the network. Finally, the cloud gaming client decodes and outputs the game screen.
[0058] In an optional embodiment, the local terminal device stores a game program and is used to present a game screen. The local terminal device is used to interact with the player through a graphical user interface, that is, the game program is downloaded and installed and run by an electronic device in a conventional manner. The local terminal device may provide the graphical user interface to the player in a variety of ways, for example, it may be rendered and displayed on a display screen of the terminal, or provided to the player through a holographic projection. For example, the local terminal device may include a display screen and a processor, the display screen is used to present a graphical user interface, the graphical user interface includes a game screen, and the processor is used to run the game, generate a graphical user interface, and control the display of the graphical user interface on the display screen.
[0059] Reference Figure 2 , shows a flowchart of a method for handling events in a game according to an embodiment of the present invention, which is applied to a client, wherein the client has a game function set, wherein the game function set includes at least one game function, wherein the game function includes at least one game function result, wherein the game function has a corresponding function identifier, and wherein the game function result has a corresponding condition identifier. The embodiment of the present invention may include the following steps:
[0060] Step 201: When a game event is triggered, a candidate function identifier corresponding to the game event is obtained;
[0061] In the game, there are usually different game events, and the game events have corresponding game functions, wherein the game functions include at least one of attribute verification, resource delivery, and text display. For example, attribute verification refers to the verification of player information, game character information, or the attributes of scenes and props in the game, resource delivery refers to the delivery of treasure chests and the distribution of reward items in the game, and text display refers to the display of help information, plot text, and description information of items and props in the game.
[0062] Among them, the function identifier refers to the identifier used to uniquely identify a game function in the game. It can be a number or a name, and can include numbers, letters, strings, etc. For example, the function identifier of event xx can be 001, event A, item drop event 1, etc.
[0063] In a specific implementation, a game event may be triggered when a player controls a game character to reach a specified position in a certain scene. For example, a player controls a game character to move to a specified position in a game teaching scene, triggering a game teaching event, and displaying a teaching prompt on the interactive interface. A game event may be triggered when a player controls a game character to complete a game task. For example, a player controls a game character to complete a novice task, triggering a plot event, and displaying a plot text on the interactive interface. A game event may also be triggered when a player controls a game character to kill a monster, triggering an event in which a treasure drops, and the treasure drops at the location where the monster dies.
[0064] In one example, the game function set is configured in a data configuration table or in game data, including multiple game functions, each of which can have multiple different game function results, that is, each game function can have multiple different actual function performances, such as a dialogue function can contain multiple different dialogue texts, wherein each game function result has a corresponding conditional identifier, and the conditional identifier corresponds to a conditional judgment rule (i.e., a conditional judgment function). In a specific implementation, when a game event is triggered, the client can determine the corresponding game function according to the function identifier, and then make a conditional judgment on the game function results contained in the game function to filter out the game function results that meet the conditions, and then randomly select a target game function result.
[0065] Step 202: taking the game function corresponding to the candidate function identifier as a candidate game function;
[0066] In the specific implementation, multiple game functions can be configured on the client as a game function set, and a corresponding function identifier can be configured for each game function. The client can obtain the corresponding game function according to the function identifier. For example, game functions A, B, and C are configured on the client, and the function identifiers corresponding to game functions A, B, and C are 001, 002, and 003, respectively. After receiving the function identifier, the client will compare the function identifier corresponding to the game function in the function set with the received function identifier in turn, and use the game function with the same function identifier as a candidate game function. Assuming that the function identifier received by the client is 001, game function A will be used as a candidate game function.
[0067] Step 203: Acquire the condition identifier corresponding to the game function result in the candidate game function as a candidate condition identifier;
[0068] The condition identifier refers to an identifier used to uniquely identify a condition judgment rule in the game, which can be a number or a name, and can include numbers, letters, strings, etc. The game function result is set with a corresponding condition identifier, and the corresponding condition identifier can be obtained according to the game function result.
[0069] In a specific implementation, assuming that a game function has game function results A, B, C, and D, and the corresponding condition identifiers are T1, T2, T3, and T4, respectively, and multiple condition identifiers can be preset in the game data, after the client determines the game function, all game function results included in the game function can be obtained, and then the condition identifiers T1, T2, T3, and T4 corresponding to the game function results can be obtained; one possible situation is that a condition identifier with a similar structure can correspond to multiple game function results, that is, the above-mentioned game function results A, B, C, and D can share the same condition identifier T1, so when obtaining, only one condition identifier T1 will be obtained.
[0070] Step 204: Obtain the condition judgment rule corresponding to the candidate condition identifier;
[0071] Among them, the conditional judgment rule can be a pre-set conditional judgment function, which can perform conditional judgment on game character information and scene information.
[0072] In a specific implementation, the conditional judgment rule can be a rule for judging the game character information, for example, it can judge whether the game character is a male character, whether the level of the game character is greater than level 50, and whether the occupation of the game character is a warrior; it can also be a rule for judging the state of the game character, for example, it can judge whether the health value of the game character is greater than 80, whether the game character is in a poisoned state; it can also be a rule for judging the scene information, for example, it can judge whether it is raining in the scene where the game character is currently located, which scene the game character is currently in, and where the game character is currently located in the scene, etc.
[0073] Different conditional judgment rules with similar structures can be configured with the same conditional identifier. For example, conditional judgment rules A and B are rules for judging the different attribute values of game characters, but the judgment methods of the two are the same or similar. In this case, conditional judgment rules A and B can be set to the same conditional identifier, which can reduce repeated configuration work.
[0074] Step 205, obtaining game information, and taking the candidate condition identifier of the game information that meets the condition judgment rule as the target condition identifier; the game information is the corresponding information of the game character corresponding to the client;
[0075] The character information includes at least one of gender, age, level, and occupation; and the scene information includes at least one of the weather, the position in the game scene, and the level where the game character is located.
[0076] In the specific implementation, after obtaining the game information, the client will traverse the candidate condition identifiers, determine whether the game information meets the condition judgment rules corresponding to the condition identifiers one by one, and use the condition identifiers that meet the conditions as the target condition identifiers. For example, the condition judgment rule corresponding to the candidate condition identifier T1 is to determine whether the character's health value is between 80-100, the condition judgment rule corresponding to the candidate condition identifier T2 is to determine whether the character's health value is between 50-80, and the condition judgment rule corresponding to the candidate condition identifier T3 is to determine whether the character's health value is between 10-50. The client will obtain the life value of the game character and make judgments in accordance with the candidate conditions T1, T2, and T3 in turn. Assuming that the client obtains that the current game character's health value is 30, the client will remove the candidate condition identifiers T1 and T2 after making the judgment, and use the candidate condition identifier T3 that meets the conditions as the target condition identifier.
[0077] In one possible scenario, there can be multiple target condition identifiers. For example, the condition judgment rule corresponding to candidate condition identifier T4 is to determine whether the game character is male, the condition judgment rule corresponding to candidate condition identifier T5 is to determine whether the level of the game character is greater than 30, and the condition judgment rule corresponding to candidate condition identifier T6 is to determine whether the occupation of the game character is a mage. Assuming that the client obtains that the gender of the current game character is male, the level is 50, and the occupation is a warrior, candidate condition identifiers T4 and T5 will be used as target condition identifiers.
[0078] Step 206: randomly obtain the target game function result from the game function results corresponding to the target condition identifier and execute it.
[0079] In a specific implementation, there may be multiple target condition identifiers corresponding to multiple candidate game functions, and one or more game functions may be randomly selected from the candidate game functions as target game functions and executed.
[0080] In the embodiment of the present invention, by setting the game function of the event node as a function identifier, taking the game function corresponding to the function identifier as a candidate game function, obtaining the condition identifier corresponding to the candidate game function as a candidate condition identifier, obtaining the condition judgment rule corresponding to the candidate condition identifier, obtaining the game information, taking the candidate condition identifier whose game information meets the condition judgment rule as the target condition identifier, and randomly obtaining the target game function from the candidate game functions corresponding to the target condition identifier and executing it, the demand for event randomness can be effectively met. In addition, the two parameters of random probability and condition identifier are used as common data for generating random results, which reduces repetitive work and simplifies the configuration operation of the event node graph.
[0081] In an exemplary embodiment, the step 201, the step of obtaining a candidate function identifier corresponding to the game event when the game event is triggered in the game, includes:
[0082] Sending the event identifier of the game event to the server; the server is used to obtain the function identifier corresponding to the game event identifier according to the pre-configured event configuration table, and use the function identifier as a candidate function identifier corresponding to the game event;
[0083] Receive a candidate function identifier corresponding to the game event sent by the server.
[0084] The event identifier refers to an identifier used to uniquely identify a game event in the game, which can be a number or a name, and can include numbers, letters, strings, etc.
[0085] In a specific implementation, the server can pre-configure multiple game events, each of which has a corresponding event identifier. After receiving the event identifier sent by the client, the server can search for the corresponding event in all configured events and return the function identifier in the event to the client. For example, the server is configured with game events A, B, and C, and the corresponding event identifiers are A1, B1, and C1. After the client triggers a game event, assuming that the event identifier of the game event is A1, after receiving the event identifier A1 sent by the client, the server will search in all configured game events, obtain the game event A with the same event identifier, and return the function identifier in the game event A to the client.
[0086] Among them, the event configuration table includes at least one event identifier, the event identifier has a corresponding event node graph, the event node graph includes a plurality of sequentially connected event nodes, the event nodes have corresponding logic codes and function identifiers, and the server is used to sequentially execute the logic codes of the event nodes and use the function identifiers corresponding to the event nodes as candidate function identifiers.
[0087] In one example, in a Rouguelike game, after an event is triggered, the server will execute the logic code in the event node in sequence, and send the corresponding function identifier in the event node to the client for execution. Among them, the event node only carries abstract functions, such as displaying text and dropping items. Since the game function can have multiple game function results, and the game function results can be obtained based on conditional identifiers and randomness, the type and content of the displayed text, the type and number of dropped items cannot be determined outside the game, which is more in line with the random characteristics of the Rouguelike game.
[0088] Reference Figure 3 , which shows a schematic diagram of the game event structure. In order to make the structure of the game event easier to understand, the following is a detailed description of this by taking the acquisition of props event as an example.
[0089] Game events can be configured in the event configuration table. Game events correspond to event identifiers, and event identifiers have corresponding event node graphs. The event node graph includes multiple sequentially connected event nodes, and each event node can contain specific functions, such as attribute verification, resource delivery, etc. Functional nodes can be connected into an event node graph in the event editor of the client through planning, and the parameters of each event node can be configured.
[0090] After the game event is triggered, the server executes to the basic interface display node. This event node can display the title and dialogue on the interactive interface. The server sends the title identifier and dialogue identifier of these two game functions to the client, and the client executes the corresponding function according to the function identifier. Similarly, the event node below will also return the corresponding function identifier to the client for processing, which will not be repeated here. After the basic interface display node is executed, the server will then execute the option interface display node, which includes options A, B and C. Assuming that the player selects option A, the attribute verification node corresponding to option A will be executed to verify the attributes of the game character. If successful, the result interface display node and resource acquisition node will be executed to display prompt information and obtain prop resources; if it fails, the corresponding failure node will be executed; the prop acquisition event is completed.
[0091] Reference Figure 4 , shows a game event execution flow chart. In order to make the execution process of game events easier to understand, the following detailed description is given using the reward distribution event as an example.
[0092] Step 401, the server runs to the corresponding event node;
[0093] When an event is triggered, the server executes the event nodes in sequence;
[0094] Step 402: If it is a client function, the function identifier is sent to the client;
[0095] If it is determined that the game function in the event node is implemented on the client, the corresponding function identifier is sent to the client;
[0096] Step 403: The client or server resolves the function identifier;
[0097] Step 404: Execute the game function corresponding to the function identifier;
[0098] Step 405 , determine whether the event node of the game event has been executed, if so, end, otherwise return to execute step 401 .
[0099] For example, a reward distribution event includes a reward item introduction node and a reward item distribution node. When the server executes the reward item introduction node, it determines that the reward item introduction function is a client function, and then sends the function identifier of the game function to the client for parsing and processing. After executing the reward item introduction node, the event has not ended, so the reward item distribution node is executed next, and it determines that the reward item distribution function is a server function, and then the game function is parsed and processed on the server. Since the reward item distribution node is the last event node of the event, the reward item distribution event is also completed after the event node is executed.
[0100] In the embodiment of the present invention, through the event configuration table, the event configuration table includes at least one event identifier, the event identifier has a corresponding event node diagram, the event node diagram includes a plurality of sequentially connected event nodes, the event nodes have corresponding logic codes and function identifiers, the server is used to sequentially execute the logic codes of the event nodes, and use the function identifiers corresponding to the event nodes as candidate function identifiers. The configuration work of the game events is simplified and the execution efficiency of the game events is improved.
[0101] In an exemplary embodiment, the step 202, the step of using the game function corresponding to the candidate function identifier as the candidate game function, includes:
[0102] Traversing the game functions in the game function set;
[0103] The game function whose function identifier corresponding to the game function is consistent with the candidate function identifier is used as a candidate game function.
[0104] Among them, different game functions can be configured with the same function identifier. After receiving the function identifier returned by the server, the client can obtain all game functions corresponding to the function identifier as candidate game functions according to the function identifier.
[0105] In the specific implementation, the client can configure multiple game functions. For example, game functions A, B, and C are configured on the client, and the corresponding function identifiers are 001, 001, and 002, respectively. Assuming that the function identifier returned by the server received by the client is 001, the client traverses game functions A, B, and C. Since the function identifiers of game functions A and B are consistent with the function identifiers returned by the server, game functions A and B will be selected as candidate game functions.
[0106] In the embodiment of the present invention, by configuring different game functions with the same function identifier, the game function corresponding to the function identifier is used as a candidate game function, so that the same function identifier can correspond to multiple game functions, thereby enhancing the diversity of game function configuration and reducing repetitive work.
[0107] In an exemplary embodiment, the step 206, the game function result has a corresponding random probability, and the step of randomly obtaining and executing the target game function result from the game function result corresponding to the target condition identifier includes:
[0108] Obtaining the random probability corresponding to the game function result corresponding to the target condition identifier;
[0109] Acquire a game function result from the game function results corresponding to the target condition identifier according to random probability as the target game function result;
[0110] Execute the target game function result.
[0111] Among them, the game functions have corresponding function identifiers, condition identifiers, random probabilities and actual function results, which can be configured in Excel, and then the Excel data can be converted into a data table through table import.
[0112] In a specific implementation, a process of configuring game events and game functions is as follows: Figure 5 As shown, the game function of the event node is set as the function identifier, and the function identifier, condition identifier, random probability and actual function result of the game function are configured in the Excel configuration table. Each event can include multiple event nodes, and each event node can obtain the corresponding game function according to the function identifier. After the candidate game functions are screened out according to the conditions, the target game function is randomly obtained from the candidate game functions, and the actual function result of the target game function is executed or displayed.
[0113] In one example, the function identifier, condition identifier, random probability and game function result can be configured in the game data by the planner. These data are common to all event nodes. When running an event, the client obtains the function identifier cached in the node, determines the specific game function through the function identifier, obtains the condition identifier of the game function result in the game function, and makes a judgment based on the condition judgment rule corresponding to the condition identifier, eliminates the game function results that do not meet the conditions, and finally obtains the final game function result based on the random probability allocation and executes it.
[0114] In order to make the structure and execution process of the game function easier to understand, the following examples 1 and 2 are used to explain it in detail.
[0115] Example 1: Figure 3Take the processing of the basic interface display event node in as an example. The basic interface display event node is used to display the basic information of the event, such as the title and dialogue will be displayed on the interface. After the client obtains the title identifier and dialogue identifier, it does not directly index the text by number. This identifier corresponds to the game function. The game function has a corresponding actual function result. Each game function contains a condition identifier, a random probability, and the final actual function result, which is the actual displayed text in this example. After the client obtains the dialogue identifier, it traverses all corresponding condition identifiers according to the data table, and then uses the condition identifier to index different condition judgment rules to determine whether the information related to the game character controlled by the current player meets the conditions, such as whether the controlled character is male, whether a certain attribute is greater than a certain value, etc. Those that do not meet the conditions are eliminated, and the remaining ones that meet the conditions are randomly obtained according to the random probability size. For example, the probability of text a is 30%, the probability of text b is 50%, and the probability of text c is 20%. After the final text is randomly obtained, it is displayed on the interface.
[0116] Example 2, refer to Figure 6 , is a schematic diagram of the game function structure of an embodiment of the present invention. As shown in the figure, the dialogue identifier corresponds to the game function, which can be a dialogue function. The dialogue function can include multiple function results. In the specific implementation, it is assumed that the dialogue function corresponding to the dialogue identifier has three specific function results A1, A2, and A3. The condition judgment rule corresponding to the condition identifiers of the dialogue function results A1 and A2 is that the game character is female, and the condition judgment rule corresponding to the condition identifier of A3 is that the game character is male; the random probability of A1 is 80%, the random probability of A2 is 50%, and the random probability of A3 is 30%; if the gender of the character obtained by the client is female, A3 is directly eliminated, and the target game function result is randomly obtained from it according to the random probabilities of A1 and A2. Assuming that A1 is randomly obtained, the actual function result corresponding to A1 is executed, that is, the dialogue text corresponding to A1 is displayed.
[0117] The functional implementation of other event nodes is similar to the above description. Different condition identifiers are indexed by numbers and then the conditions are judged, and the final game function results are obtained according to the weights. The use of such parameter design and processing methods is mainly to make each event node a carrier of various different situations of a certain function. The planner can match different conditions and game function results in this event node through numbers. Before the event is triggered at this node in the actual game, the planner can only predict possible situations. If you need to determine a certain game function result at a certain event node, you only need to set the number to correspond to a unique result.
[0118] In the embodiment of the present invention, by configuring the game events and game functions, the game functions of the event nodes are set as function identifiers, and the function identifiers, condition identifiers, random probabilities, and actual function results of the game functions are configured. Each event may include multiple event nodes, and each event node may obtain the corresponding game function according to the function identifier. After the candidate game functions are screened out according to the conditions, the target game function is randomly obtained from the candidate game functions, and the actual function results of the target game function are executed or displayed. The game events and game function configurations are highly flexible, repetitive work is reduced, and the randomness of the game events is improved.
[0119] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0120] Reference Figure 7 , shows a structural block diagram of an embodiment of an event processing device in a game of the present invention, which is applied to a client, and the client has a game function set, the game function set includes at least one game function, the game function includes at least one game function result, the game function has a corresponding function identifier, and the game function result has a corresponding condition identifier, including the following modules:
[0121] The candidate function identifier acquisition module 701 is used to acquire the candidate function identifier corresponding to the game event when the game character controlled by the player triggers the game event in the game;
[0122] A candidate game function acquisition module 702 is used to take the game function corresponding to the candidate function identifier as a candidate game function;
[0123] A candidate condition identifier acquisition module 703 is used to acquire a condition identifier corresponding to the game function result in the candidate game function as a candidate condition identifier;
[0124] The condition judgment rule acquisition module 704 is used to obtain the condition judgment rule corresponding to the candidate condition identifier;
[0125] The target condition identifier acquisition module 705 is used to acquire game information and use the candidate condition identifier of the game information that meets the condition judgment rule as the target condition identifier; the game information is the corresponding information of the game character corresponding to the client;
[0126] The target game function acquisition module 706 is used to randomly acquire and execute the target game function result from the game function result corresponding to the target condition identifier.
[0127] In an exemplary embodiment, the candidate function identifier acquisition module 701 is used to send the event identifier of the game event to the server; the server is used to obtain the function identifier corresponding to the game event identifier according to a pre-configured event configuration table, and use the function identifier as the candidate function identifier corresponding to the game event; and receive the candidate function identifier corresponding to the game event sent by the server.
[0128] In an exemplary embodiment, the event configuration table includes at least one event identifier, the event identifier has a corresponding event node graph, the event node graph includes a plurality of sequentially connected event nodes, the event nodes have corresponding logic codes and function identifiers, the server is used to sequentially execute the logic codes of the event nodes, and use the function identifiers corresponding to the event nodes as candidate function identifiers.
[0129] In an exemplary embodiment, the candidate game function acquisition module 702 is used to traverse the game functions in the game function set; and take the game function whose function identifier corresponding to the game function is consistent with the candidate function identifier as a candidate game function.
[0130] In an exemplary embodiment, the target condition identification acquisition module 705 is used to obtain the character information of the game character and / or the scene information of the game scene in which the game character is located; the character information includes at least one of gender, age, level, and occupation; the scene information includes at least one of the weather, the position in the game scene, and the level in which the game character is located.
[0131] In an exemplary embodiment, the target game function acquisition module 706 is used to obtain the random probability corresponding to the game function result corresponding to the target condition identifier; obtain a game function result from the game function results corresponding to the target condition identifier as the target game function result according to the random probability; and execute the target game function result.
[0132] In an exemplary embodiment, the game function includes at least one of attribute verification, resource delivery, and text display.
[0133] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0134] An embodiment of the present invention discloses an electronic device, including a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, the steps described in the above embodiment of the method for handling events in a game are implemented.
[0135] An embodiment of the present invention discloses a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps described in the above embodiment of the method for handling events in a game are implemented.
[0136] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0137] It will be appreciated by those skilled in the art that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0138] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0139] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0140] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0141] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.
[0142] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0143] The above is a detailed introduction to a method for handling events in a game, a device for handling events in a game, an electronic device and a storage medium provided by the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A method for handling events in a game, characterized in that: Applied to a client, the client has a game function set, the game function set includes at least one game function, the game function includes at least one game function result, the game function has a corresponding function identifier, the game function result has a corresponding condition identifier and a random probability, the method includes: When a game event is triggered, obtaining a candidate function identifier corresponding to the game event; Using the game function corresponding to the candidate function identifier as a candidate game function; Acquire a condition identifier corresponding to the game function result in the candidate game functions as a candidate condition identifier; Obtaining the condition judgment rule corresponding to the candidate condition identifier; Acquire game information, and use the candidate condition identifier of the game information that meets the condition judgment rule as the target condition identifier; the game information is the corresponding information of the game character corresponding to the client; According to the random probability corresponding to the game function result corresponding to the target condition identifier, the target game function result is randomly obtained from the game function results corresponding to the target condition identifier and executed.
2. The method according to claim 1, characterized in that The step of obtaining a candidate function identifier corresponding to the game event when the game event is triggered includes: Sending the event identifier of the game event to the server; the server is used to obtain the function identifier corresponding to the game event identifier according to the pre-configured event configuration table, and use the function identifier as a candidate function identifier corresponding to the game event; Receive a candidate function identifier corresponding to the game event sent by the server.
3. The method according to claim 2, characterized in that The event configuration table includes at least one event identifier, and the event identifier has a corresponding event node graph. The event node graph includes multiple sequentially connected event nodes, and the event nodes have corresponding logic codes and function identifiers. The server is used to sequentially execute the logic codes of the event nodes and use the function identifiers corresponding to the event nodes as candidate function identifiers.
4. The method according to claim 1, characterized in that: The step of using the game function corresponding to the candidate function identifier as a candidate game function includes: Traversing the game functions in the game function set; The game function whose function identifier corresponding to the game function is consistent with the candidate function identifier is used as a candidate game function.
5. The method according to claim 1, characterized in that The obtaining of game information includes: Obtaining character information of the game character and / or scene information of the game scene in which the game character is located; the character information includes at least one of gender, age, level, and occupation; the scene information includes at least one of weather, position in the game scene, and level in which the game character is located.
6. The method according to claim 1, characterized in that The game function includes at least one of attribute verification, resource delivery and text display.
7. An event processing device in a game, characterized in that: Applied to a client, the client has a game function set, the game function set includes at least one game function, the game function includes at least one game function result, the game function has a corresponding function identifier, the game function result has a corresponding condition identifier and a random probability, the device includes: A candidate function identifier acquisition module, used to acquire a candidate function identifier corresponding to a game event when a game event is triggered in the game; A candidate game function acquisition module, used to take the game function corresponding to the candidate function identifier as a candidate game function; A candidate condition identifier acquisition module, used to acquire a condition identifier corresponding to the game function result in the candidate game function as a candidate condition identifier; A condition judgment rule acquisition module, used to obtain the condition judgment rule corresponding to the candidate condition identifier; A target condition identifier acquisition module is used to acquire game information, and use the candidate condition identifier of the game information that meets the condition judgment rule as the target condition identifier; the game information is the corresponding information of the game character corresponding to the client; The target game function acquisition module is used to randomly acquire and execute the target game function result from the game function results corresponding to the target condition identifier according to the random probability corresponding to the game function result corresponding to the target condition identifier.
8. An electronic device, characterized in that: The invention comprises a processor, a memory and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the steps of the method for handling game events in any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for handling events in a game according to any one of claims 1 to 6 are implemented.
