Game behavior decision method and device and storage medium

By independently setting the execution conditions and scoring methods for game behaviors through decision tables, the problem of difficulty in modifying game behavior logic was solved, a modular decision model was realized, the efficiency of maintaining and expanding game behaviors was improved, and the user experience was enhanced.

CN117224974BActive Publication Date: 2026-04-28XIAMEN WEIWO TIME TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
XIAMEN WEIWO TIME TECH CO LTD
Filing Date
2023-09-28
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

In existing technologies, the logical connections between game behaviors make the modification process difficult and prone to decision-making logic errors. Furthermore, traditional state machines and behavior trees suffer from low reusability and maintenance difficulties.

Method used

By adopting the decision table method, game behavior decisions are made based on conditioners and scorers by obtaining game behaviors, judgment conditions and scoring methods from the decision table. Execution conditions and scoring methods are set independently, realizing a modular and tabular decision model.

Benefits of technology

It facilitates the separate maintenance of game behavior logic, reduces computational load, improves the efficiency of behavior expansion and maintenance, and enhances the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117224974B_ABST
    Figure CN117224974B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of electronic games, and provides a game behavior decision method, a device and a storage medium. The game behavior decision method comprises the following steps: in response to a decision demand corresponding to a game character, obtaining a decision table, the decision table comprising game behaviors, execution conditions of the game behaviors and scoring manners; obtaining decision information corresponding to the game character; judging the decision information based on a conditioner to obtain a judgment result; determining a candidate game behavior from the game behaviors based on a matching relationship between the execution conditions and the judgment result; determining a behavior score corresponding to the candidate behavior based on the decision information and the scoring manner corresponding to the candidate behavior, and determining a target behavior corresponding to the game character from the candidate behaviors based on the behavior score. In the technical solution, a decision model is realized through a decision table, and the execution conditions and the scoring manners corresponding to different game behaviors are separately set in the decision table, so that the decision model can be conveniently maintained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of video games, and in particular to methods, devices and storage media for game behavior decision-making. Background Technology

[0002] Game AI refers to the ability of machines to simulate human thought processes and perform actions within games, such as making behavioral decisions for in-game characters, non-player characters (NPCs), and enemies. Game AI technology can make games more interesting, challenging, and realistic, enhancing the player's gaming experience.

[0003] In related technologies, state machines or behavior trees are typically used to implement game behavior decisions. Specifically, intelligent decision-making for game behavior is achieved by setting up relationships between different game behaviors.

[0004] However, in related technologies, there are logical connections between different behaviors. This means that when designers want to add a new behavior or delete a behavior, it will affect other behaviors, making the modification process difficult and prone to decision-making errors. Therefore, improvements are needed. Summary of the Invention

[0005] To facilitate the maintenance of decision-making models, this application provides a game behavior decision-making method, device, and storage medium.

[0006] Firstly, this application provides a game behavior decision-making method, which adopts the following technical solution:

[0007] A game behavior decision-making method, the method comprising:

[0008] In response to the decision-making needs of the game character, a decision table is obtained. The decision table includes at least two game behaviors, the execution conditions of the game behaviors under preset judgment conditions, and the scoring methods under preset scoring dimensions.

[0009] Obtain the decision information corresponding to the game character;

[0010] The decision information is judged based on the condition corresponding to the judgment condition to obtain the judgment result;

[0011] Candidate game behaviors are determined from each of the game behaviors based on the matching relationship between the execution conditions and the judgment results;

[0012] The behavior score corresponding to the candidate behavior is determined based on the decision information and the scoring method;

[0013] Based on the behavior scores corresponding to the candidate behaviors, the target behavior corresponding to the game character is determined from each of the candidate behaviors, so as to control the game character to perform the target behavior.

[0014] By adopting the above technical solution, a decision-making model can be implemented through a decision table. The execution conditions and scoring methods corresponding to different game behaviors are set separately in the decision table. In this way, during the game decision-making process, the game behaviors can be screened and scored by combining the decision information corresponding to the game character and the execution conditions and scoring methods corresponding to each game behavior. Finally, the target behavior can be determined based on the behavior scores corresponding to each candidate behavior. The behavior decision-making process does not need to rely on the correlation between different behaviors. Therefore, it can help to maintain the logic corresponding to each game behavior in the decision table separately, which in turn facilitates the maintenance of the decision model.

[0015] Optionally, determining the behavior score corresponding to the candidate behavior based on the decision information and the scoring method includes:

[0016] The decision information is scored based on the scorer corresponding to the scoring dimension to obtain the base score corresponding to the scoring dimension, and the base score belongs to a preset score range.

[0017] The behavioral score corresponding to the candidate behavior is determined based on the scoring method and the base score.

[0018] By adopting the above technical solution, since the scoring method corresponding to game behavior does not require direct operation on decision information, but only evaluation of the basic score corresponding to the scoring dimension, it is convenient to set the scoring method corresponding to game behavior. At the same time, it can also help reduce the repeated calculation in the score calculation process of different game behaviors and reduce the amount of calculation in the scoring process.

[0019] Optionally, the scoring dimensions include two or more, and determining the behavior score corresponding to the candidate behavior based on the scoring method and the base score includes:

[0020] For each scoring dimension, the dimension score corresponding to the scoring dimension is determined based on the scoring method under the scoring dimension and the base score corresponding to the scoring dimension.

[0021] The behavior score is determined based on the dimensional score corresponding to each of the scoring dimensions.

[0022] By adopting the above technical solutions, it is possible to achieve modular settings for decision-making forms, thereby improving the reusability of the scoring system and helping to reduce the cost of building and maintaining decision-making forms.

[0023] Optionally, the judgment conditions include two or more, and the step of determining candidate game behaviors from each of the game behaviors based on the matching relationship between the execution conditions and the judgment results includes:

[0024] For each judgment condition, determine whether the execution condition under the judgment condition matches the judgment result corresponding to the judgment condition;

[0025] The candidate game behavior is determined from the game behaviors whose execution conditions under each judgment condition match the corresponding judgment result.

[0026] By adopting the above technical solutions, it is possible to achieve modular settings for decision tables, thereby improving the reusability of conditioners and helping to reduce the cost of decision table construction and dimensions.

[0027] Optionally, determining candidate game behaviors from among the various game behaviors based on the matching relationship between the execution conditions and the judgment results includes:

[0028] From each of the game behaviors, an executable behavior that meets the decision conditions is determined, wherein the executable behavior is not in a cooldown state;

[0029] The candidate game behavior is determined from each of the executable behaviors based on the matching relationship between the execution conditions and the judgment results.

[0030] By adopting the above technical solutions, the number of game behaviors involved in performing condition matching can be reduced, which in turn can help reduce the amount of computation in the condition matching process.

[0031] Optionally, controlling the game character to perform the target behavior includes:

[0032] Determine whether the target behavior is the same as the current behavior of the game character;

[0033] If the target behavior differs from the current behavior, the game character is controlled to interrupt the execution of the current behavior and execute the target behavior.

[0034] Determine whether the execution duration of the target behavior reaches the protection duration corresponding to the target behavior;

[0035] If the execution time reaches the protection duration corresponding to the target behavior, the decision requirement is generated at a preset time interval.

[0036] If the target behavior is the same as the current behavior, control the game character to continue executing the current behavior, and generate the decision requirement at preset time intervals.

[0037] By adopting the above technical solution, the continuity of game character actions can be guaranteed without changing the game behavior, which can help avoid game characters repeatedly performing the same initial steps of the game behavior, thereby helping to improve the user's game experience.

[0038] Optionally, obtaining the decision table includes:

[0039] Obtain the decision table corresponding to the character type of the game character.

[0040] By adopting the above technical solution, it is easy to set up decision models for different role types through decision tables, which can help meet the decision-making needs of different role types and thus improve the user experience.

[0041] Optionally, the decision information includes: the object information of the game character and / or the game scene information corresponding to the game character.

[0042] Secondly, this application provides an electronic device that adopts the following technical solution:

[0043] An electronic device, the electronic device comprising:

[0044] At least one processor;

[0045] Memory;

[0046] At least one application, wherein the at least one application is stored in memory and configured to be executed by at least one processor, the at least one application being configured to: execute any of the game behavior decision-making methods provided in the first aspect.

[0047] Thirdly, this application provides a computer-readable storage medium, which adopts the following technical solution:

[0048] A computer-readable storage medium storing a computer program that, when executed in a computer, causes the computer to perform any of the game behavior decision-making methods provided in the first aspect.

[0049] In summary, this application includes at least one of the following beneficial technical effects:

[0050] 1. Since the decision model is implemented through a decision table, and the execution conditions and scoring methods corresponding to different game behaviors are set separately in the decision table, it is helpful to maintain the logic corresponding to each game behavior in the decision table separately, which in turn makes it easier to maintain the decision model.

[0051] 2. By presenting the decision model in a tabular format, the complex, spiderweb-like structure and clutter associated with traditional state machines are effectively avoided. Furthermore, compared to the tree-like structure used in decision trees, the tabular presentation avoids low storage space utilization and makes decision relationships clear at a glance, easy to read and understand, and convenient for maintaining the decision model. Attached Figure Description

[0052] Figure 1 This is a flowchart illustrating a game behavior decision-making method provided in an embodiment of this application;

[0053] Figure 2 This is a flowchart illustrating a method for determining candidate behaviors provided in an embodiment of this application;

[0054] Figure 3 This is a flowchart illustrating another method for determining candidate behaviors provided in an embodiment of this application;

[0055] Figure 4 This is a flowchart illustrating a behavior score calculation method provided in an embodiment of this application;

[0056] Figure 5 This is a flowchart illustrating another method for calculating behavior scores provided in an embodiment of this application;

[0057] Figure 6 This is a flowchart illustrating a target behavior execution method provided in an embodiment of this application;

[0058] Figure 7 This is a flowchart illustrating an electronic device provided in an embodiment of this application. Detailed Implementation

[0059] To make the purpose, technical solution, and advantages of this application clearer, the following description is provided in conjunction with the appendix. Figure 1-7 The present application will be further described in detail below with reference to embodiments. It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the application.

[0060] First, several terms used in the embodiments of this application will be introduced.

[0061] Game actions: These describe the actions a game character can take, such as "escaping the player" or "firing bullets at the player." The game actions that different game characters can perform may vary.

[0062] Conditioners: Conditioners are used to evaluate the current situation and return true or false to indicate whether a specific condition is met. Conditioners can be logical conditions such as "the target is within a preset range" or "the distance from the spawn point is greater than a preset distance".

[0063] Scoring Tool: The scoring tool returns a base score based on the current context, representing the game character's fit with the current context on a specific scoring dimension. For example, a score for "time spent by the target within a preset range" might return 0.3, which represents the game character's fit with the current scene on that dimension. Optionally, the base score returned by the scoring tool can be within a preset score range, such as 0-1, to facilitate processing of the base score.

[0064] In related technologies, state machines or behavior trees are commonly used to implement game behavior decisions, but both have some drawbacks, specifically:

[0065] State machines allow game objects to transition between defined states. Each state needs to define which other states it can transition to, the conditions for transitioning, and how to transition (e.g., whether to transition after completing the current state or immediately). This is easy to learn and understand. However, once there are many states, it is very difficult to determine and debug the transitions between various states. At the same time, the entire state structure is a network, which is not conducive to intuitively showing the relationship between states and is not conducive to the dimensionality of the state structure.

[0066] In a behavior tree, the behavior of a game object is defined in a tree structure. Each node can succeed or fail, and its execution result, through the definition of its parent node, affects whether the next node executes. The pain point of this approach is low reusability. If the nodes are designed to be fine-grained, each node performs fewer tasks, leading to an increase in the number of nodes in the behavior tree and increased complexity. Conversely, if the nodes are designed to be heavy-duty, each node performs more tasks, but this node may not be reusable in another behavior tree.

[0067] However, in the above implementation, because there is a logical connection between different behaviors, when a designer wants to add a new behavior or delete a behavior, it will affect other behaviors, which will make the modification process difficult and may easily lead to logical errors in decision-making.

[0068] To help solve the above problems and facilitate the maintenance of the behavior decision model, embodiments of this application disclose a game behavior decision method, device, and storage medium.

[0069] This application discloses a method for game behavior decision-making. (Refer to...) Figure 1 The game behavior decision-making method includes the following steps:

[0070] Step 101: In response to the decision-making needs of the game character, obtain the decision table.

[0071] The decision table includes at least two game behaviors, the execution conditions of these behaviors under preset judgment conditions, and the scoring methods under preset scoring dimensions. Specifically, the judgment conditions and scoring dimensions are pre-set in the decision table, and the judgment conditions and scoring dimensions are the same for different game behaviors in the decision table.

[0072] Optionally, the execution conditions include whether the judgment condition is true, false, or arbitrary, i.e., true, false, and any. Different game behaviors may have the same or different execution conditions under the same judgment condition.

[0073] Optionally, different game behaviors may be scored differently under the same scoring dimension. This can help avoid the behavior scores calculated based on the scoring methods corresponding to different game behaviors being the same, and thus make it easier to select the target behavior from the candidate behaviors based on the behavior scores.

[0074] In this embodiment, the content of the decision table can be flexibly set according to the role design requirements.

[0075] In one instance, game behavior may include at least two of the following: teleporting back to the spawn point, sprinting to attack, maintaining distance, ranged attack, and idling; judgment conditions may include at least one of the following: whether the target is within a preset distance, whether the game character is more than a preset distance from the spawn point; scoring dimensions may include at least one of the following: the time the target stays within a preset range of game settlement, the game character's own health, and the game character's level.

[0076] In one example, the header of the decision table includes the behavior name, judgment conditions, and scoring dimensions. Correspondingly, each row of the decision table contains the game behavior, the execution conditions of the game behavior under the judgment conditions, and the scoring method under the scoring dimensions.

[0077] In one example, the decision table is shown in Table 1 below:

[0078] Table 1 Decision Table

[0079] Behavior Name Judgment conditions Scoring Dimensions Behavior 1 Execution condition 1 Scoring Method 1 Behavior 2 Execution condition 2 Scoring Method 2 Behavior n Execution condition n Scoring method n

[0080] In this embodiment, the decision table is pre-set and can be adjusted according to actual needs. The ways to adjust the decision table include: adding game behaviors (e.g., adding rows in the table), adding judgment conditions and / or scoring dimensions (e.g., adding columns in the table).

[0081] In the above technical solution, since the execution conditions and scoring methods corresponding to different game behaviors are set separately in the decision table, and the decision logic of different game behaviors is independent and unrelated, it is only necessary to operate on the data of the row corresponding to the game behavior in the table to realize the addition, deletion and modification of game behaviors, which can help maintain the game behaviors in the decision model.

[0082] In addition, since the execution conditions corresponding to game behaviors in the decision table are based on judgment conditions and the scoring method is based on scoring dimensions, the decision parameters can be adjusted simply by manipulating the column data corresponding to the judgment conditions or scoring dimensions in the table, which can help maintain the decision parameters in the decision information.

[0083] Furthermore, since the execution conditions and scoring methods for different game behaviors are independent in the decision table, game designers do not need to consider the complex transitions between different game states during the game character design process. They only need to list the game behaviors that the character can perform on the table and configure appropriate execution conditions and scoring methods for each game behavior. The game character can then automatically make decisions on game behaviors based on the decision table and the actual situation, reducing the complexity of character design.

[0084] Optionally, a decision table may be obtained, including: obtaining a decision table corresponding to the character type of the game character. The decision table corresponding to the character type is pre-set, and the decision tables for different character types differ in terms of game behavior, judgment conditions, and / or scoring dimensions.

[0085] Specifically, in the game design process, to improve the gaming experience, two or more game character types are usually set up. The game behaviors that different character types can perform and the corresponding decision-making logic for those behaviors may differ, which can help improve the user's gaming experience. In this implementation, by matching corresponding decision tables to different character types, it is convenient to set up decision models for different character types through these tables, thereby helping to meet the decision-making needs of different character types.

[0086] Optionally, the decision-making requirement can be triggered by the game character under specific conditions, such as when the game character completes its current action, or when it is generated at a preset time interval, or when the game character is attacked. This embodiment does not limit the way the decision-making requirement is generated.

[0087] Step 102: Obtain the decision information corresponding to the game character.

[0088] The type of decision information is predetermined based on the judgment conditions and scoring dimensions corresponding to the decision table. Specifically, the decision information includes the information required to execute the preset judgment conditions and the information required to score under the preset scoring dimensions. In actual implementation, the decision information can be determined based on the information required by the judgment conditions and scoring dimensions corresponding to the decision table.

[0089] Optionally, the decision-making information may include object information of the game character and / or game scene information corresponding to the game character. Specifically, object information includes information about the game character itself, such as health and level, while game scene information includes the combination of the game character and the scene, such as the distance between the game character and other locations and / or objects (e.g., the player), and the time the target stays within the game character's preset range. This can help meet the needs of different decision-making scenarios.

[0090] Step 103: Based on the conditional generator corresponding to the judgment condition, the decision information is judged to obtain the judgment result.

[0091] The conditioner is used to perform the judgment corresponding to the judgment condition, and different judgment conditions correspond to different conditioners.

[0092] Correspondingly, since the execution conditions are set based on the judgment results corresponding to the preset judgment conditions, the judgment results based on the conditioner can determine whether the decision information meets the execution conditions corresponding to the game behavior.

[0093] In one example, the conditioner evaluates whether the condition is true or false.

[0094] Step 104: Based on the matching relationship between execution conditions and judgment results, candidate game behaviors are determined from various game behaviors.

[0095] Since different game behaviors have corresponding execution conditions, the game behaviors can be screened based on the matching relationship between the execution conditions and the judgment results during the game decision-making process to obtain candidate game behaviors. This can help to filter out game behaviors that do not meet the execution conditions, thereby helping to reduce the amount of calculation in the scoring process.

[0096] Specifically, situations where the execution condition matches the judgment result include: the execution condition is any, i.e., any, or the execution condition is the same as the judgment result; situations where the execution condition does not match the judgment result include: the execution condition is not any and the execution condition is different from the judgment result.

[0097] In one example, candidate game behaviors are determined from various game behaviors based on the matching relationship between execution conditions and judgment results, including: identifying game behaviors whose execution conditions match the judgment results as candidate game behaviors.

[0098] Optionally, if there are two or more candidate behaviors, step 105 is executed; if there is only one candidate behavior, the candidate behavior is directly identified as the target behavior, and steps 105 and 106 are not executed. This can help improve the efficiency of target behavior identification.

[0099] Step 105: Determine the behavioral score corresponding to the candidate behavior based on the decision information and scoring method.

[0100] Since different game behaviors have corresponding scoring methods, the decision information can be scored using the scoring methods corresponding to different candidate game behaviors. This will give the behavior scores corresponding to different candidate behaviors, which will make it easier to select the target behavior from the candidate behaviors.

[0101] In one example, the scoring method includes how decision information is processed, thus determining the behavior score by combining the decision information processing method. In actual implementation, the scoring method for some game behaviors under the scoring dimension may also be independent of the decision information; for example, the scoring method may be to assign a preset value to the behavior score.

[0102] Step 106: Based on the behavior scores corresponding to the candidate behaviors, determine the target behavior corresponding to the game character from each candidate behavior, so as to control the game character to perform the target behavior.

[0103] In one example, the target behavior for a game character is determined from each candidate behavior based on the behavior score corresponding to the candidate behavior, including: determining the candidate behavior with the highest behavior score among all candidate behaviors as the target behavior.

[0104] In other examples, other factors can be combined to determine the target behavior for a game character from candidate behaviors. For instance, the target behavior can be determined by the number of times a candidate behavior is executed. In this case, a frequency score is calculated based on the number of times a candidate behavior is executed (the more times it is executed, the higher the frequency score). The behavior score is then subtracted from the frequency score to obtain the final score. Finally, the candidate behavior with the highest final score is determined as the target behavior. This can help to reasonably adjust the relationship between the number of times various game behaviors for a game character are executed, thereby improving the user's gaming experience.

[0105] The implementation principle of the game behavior decision-making method provided in this application embodiment is as follows: In response to the decision-making needs corresponding to the game character, a decision table is obtained. The decision table includes at least two game behaviors, the execution conditions of the game behaviors under preset judgment conditions, and the scoring methods under preset scoring dimensions; decision information corresponding to the game character is obtained; the decision information is judged based on the conditioner corresponding to the judgment conditions to obtain the judgment result; candidate game behaviors are determined from each game behavior based on the matching relationship between the execution conditions and the judgment result; the behavior score corresponding to the candidate behavior is determined based on the decision information and the scoring methods corresponding to the candidate behavior; the target behavior corresponding to the game character is determined from each candidate behavior based on the behavior score corresponding to the candidate behavior, so as to control the game character to execute the target behavior. In the above technical solution, since the decision model is implemented through a decision table, and the execution conditions and scoring methods corresponding to different game behaviors are set separately in the decision table, the game behaviors can be screened and scored by combining the decision information corresponding to the game character and the execution conditions and scoring methods corresponding to each game behavior during the game decision-making process. Finally, the target behavior can be determined based on the behavior scores corresponding to each candidate behavior. The behavior decision-making process does not need to rely on the correlation between different behaviors. Therefore, it can help to maintain the logic corresponding to each game behavior in the decision table separately, which in turn facilitates the maintenance of the decision model.

[0106] Furthermore, the use of a tabular decision-making model simplifies future behavior expansion. Specifically, when adding a new behavior, developers simply configure its description, execution conditions, and scoring criteria in the decision table, without modifying the logic of existing behaviors. Similarly, deleting a behavior only requires removing it from the decision table without affecting the logic of other behaviors. This allows game developers to quickly and flexibly adjust the model according to game needs, facilitating maintenance of the decision-making model.

[0107] Furthermore, presenting the decision model in a tabular format effectively avoids the spiderweb-like complexity and clutter associated with traditional state machines. At the same time, compared to the tree-like structure used in decision trees, the tabular presentation avoids the problem of low storage space utilization, makes decision relationships clear at a glance, easy to read and understand, and facilitates the maintenance of the decision model.

[0108] In some implementations, the judgment conditions include two or more. In this case, step 103, judging the decision information based on the conditioner corresponding to the judgment condition, and obtaining the judgment result, includes: for each judgment condition, judging the decision information based on the conditioner corresponding to the judgment condition, and obtaining the judgment result corresponding to the judgment condition.

[0109] Accordingly, refer to Figure 2Step 104 involves determining candidate game behaviors from various game behaviors based on the matching relationship between execution conditions and judgment results. This specifically includes the following steps:

[0110] Step 201: For each judgment condition, determine whether the execution condition under the judgment condition matches the judgment result corresponding to the judgment condition.

[0111] Step 202: Determine candidate game behaviors from game behaviors whose execution conditions under each judgment condition match the corresponding judgment results.

[0112] In one example, game behaviors whose execution conditions under each judgment condition match the corresponding judgment result are identified as candidate behaviors.

[0113] In actual game scenarios, there may be situations where there are no game behaviors where all execution conditions under each judgment condition match the corresponding judgment result. In such cases, the game behavior with the most execution conditions matching the judgment result (which can be one or more) can be identified as a candidate game behavior. Alternatively, the game behavior with the highest priority (the priority of the game behavior is preset in the decision table) can be identified as a candidate behavior. Or, the game behavior that the game character is currently executing can be identified as a candidate behavior. This can help ensure that candidate game behaviors can be identified, thereby avoiding program errors.

[0114] In the above embodiments, when there are two or more judgment conditions, candidate game behaviors can be determined from game behaviors based on the matching relationship between the execution conditions of the game under each judgment condition and the judgment results corresponding to the judgment conditions. This can help to achieve precise division of judgment conditions and construct a conditioner corresponding to each judgment condition. In the process of game design, the conditioner corresponding to the judgment condition can be flexibly selected to construct a decision table according to the decision-making needs of the game character, without having to design a separate conditioner for each game behavior. This can help to achieve modular setting of the decision table, thereby improving the reusability of the conditioner and helping to reduce the cost of decision table construction and dimensions.

[0115] In some implementations, reference Figure 3 Step 106: Based on the matching relationship between execution conditions and judgment results, candidate game behaviors are determined from various game behaviors, specifically including the following steps:

[0116] Step 301: Identify the executable behaviors that meet the decision execution conditions from among the candidate behaviors.

[0117] The decision conditions are used to determine whether a candidate action is executable, that is, whether the candidate action should be included in the decision-making process. Specifically, the decision conditions are set based on the state of the game character and are used to determine whether the state of the game character meets the execution requirements corresponding to the game action.

[0118] In this embodiment, the decision condition includes that the candidate behavior is not in a cooling-off state. In this case, determining the executable behavior that meets the execution conditions from among the candidate behaviors includes: selecting executable behaviors from those whose execution interval since the last execution time reaches a preset duration threshold. Specifically, candidate behaviors whose execution interval reaches the duration threshold can be directly determined as executable behaviors, or candidate behaviors that simultaneously meet other execution conditions can be further selected from those whose execution interval reaches the preset duration threshold.

[0119] In actual implementation, the cooldown time required for different game behaviors may vary. In this case, the preset time threshold is set to correspond with the game behavior. Accordingly, in the process of judging the cooldown status, the preset time threshold corresponding to the candidate behavior needs to be used for judgment. This can help to flexibly set the cooldown time corresponding to different game behaviors, thereby helping to improve the user's gaming experience.

[0120] Optionally, the decision conditions may also include other content, such as: the game character's level reaches a preset level. This embodiment does not limit the content of the execution conditions.

[0121] Step 302: Based on the matching relationship between execution conditions and judgment results, candidate game behaviors are determined from each executable behavior.

[0122] It should be noted that decision conditions and execution conditions are different. Decision conditions are used to determine whether the state of the game character matches the game behavior, that is, they are unrelated to the game scene, while execution conditions are used to determine whether the game behavior matches the game scene, that is, they are related to the game scene.

[0123] In the above implementation, since the game behavior can be screened by combining decision conditions and execution conditions to obtain candidate game behaviors, this can help improve the accuracy of the identified candidate game behaviors.

[0124] In addition, since the executable behaviors that meet the execution requirements are first determined from each game behavior based on the decision conditions, and then the candidate behaviors that can be executed in the current scene are determined based on the matching relationship between the execution conditions corresponding to the executable behaviors and the judgment results, this can help reduce the number of game behaviors involved in the execution condition matching, and thus help reduce the amount of computation in the execution condition matching process.

[0125] In some implementations, reference Figure 4 Step 105, determining the behavioral score corresponding to the candidate behavior based on decision information and scoring method, specifically includes the following steps:

[0126] Step 401: Score the decision information based on the scorer corresponding to the scoring dimension to obtain the basic score corresponding to the scoring dimension.

[0127] The base score falls within a preset score range. Specifically, the scoring range is determined during the scoring system setup process; for example, the scoring range is 0 to 1. This facilitates the configuration of scoring methods for different game behaviors.

[0128] The scorer is used to score according to the scoring dimensions, and different scorers are used for different scoring dimensions.

[0129] Since the data required for different scoring dimensions may differ, the decision information is scored based on the scorer corresponding to the scoring dimension to obtain the scoring result. This includes: obtaining the dimension information corresponding to the scoring dimension from the decision information; and scoring the dimension information corresponding to the scoring dimension based on the scorer corresponding to the scoring dimension to obtain the scoring result.

[0130] In one example, the scoring dimension includes the dwell time of the target within a range of 12. Accordingly, the scoring strategy of the scorer includes: when the target is not within a range of 12, the base score is 0; when the target dwells within a range of 12 for less than 5 seconds, the base score is dwell time / 5; when the target dwells within a range of 12 for more than 5 seconds, the base score is 1.

[0131] In another example, the scoring dimension includes the health of the game character. Accordingly, the scoring strategy of the scorer includes: the base score is the health of the game character. For example, if the health of the game character is 80%, then the base score is 0.8.

[0132] It should be noted that since different game behaviors of game characters have the same scoring dimension, and the base score is obtained by scoring using the scorer corresponding to the scoring dimension, it is not affected by the scoring method corresponding to the game behavior. Therefore, different game behaviors have the same base score under the same scoring dimension.

[0133] Step 402: Determine the behavior score corresponding to the candidate behavior based on the scoring method and the base score.

[0134] In one example, the scoring method includes a preset processing method corresponding to the base score. In this case, determining the behavior score corresponding to the candidate behavior based on the scoring method and the base score includes: processing the base score based on the preset processing method to obtain a processed score; and determining the behavior score corresponding to the candidate behavior based on the processed score. For example, the processed score can be directly determined as the behavior score.

[0135] In one instance, the base score is v, and the range of the base score is 0-1. The preset processing method can be 1-v, (1-v)×2 or v / 2+0.2, etc.

[0136] In another example, the scoring method uses a base score directly. In this case, the behavior score corresponding to the candidate behavior is determined based on the scoring method and the base score, including: directly determining the behavior score corresponding to the candidate behavior based on the base score. For example: directly determining the base score as the behavior score.

[0137] In the above implementation, since the basic score of the game character in the current scene can be determined first based on the scorer and decision information corresponding to the scoring dimension, and then the basic score is processed based on the scoring method corresponding to the candidate behavior to finally determine the behavior score corresponding to the candidate behavior, this can help reduce the amount of computation in the behavior score calculation process. At the same time, it is also convenient to set the scoring method corresponding to the game behavior, and thus it is convenient to maintain the scoring method corresponding to each game behavior in the decision table.

[0138] In some implementations, reference Figure 5 The scoring dimensions include two or more. Step 302 above determines the behavioral score corresponding to the candidate behavior based on the scoring method and the base score, including the following steps:

[0139] Step 501: For each scoring dimension, determine the dimension score corresponding to the scoring dimension based on the scoring method under the scoring dimension and the basic score corresponding to the scoring dimension.

[0140] In one example, the scoring method includes a preset processing method corresponding to the base score. In this case, the dimension score corresponding to the scoring dimension is determined based on the scoring method under the scoring dimension and the base score corresponding to the scoring dimension, including: processing the base score corresponding to the scoring dimension based on the preset processing method to obtain the dimension score corresponding to the scoring dimension.

[0141] In another example, the scoring method is to directly use the base score. In this case, the dimensional score corresponding to the scoring dimension is determined based on the scoring method under the scoring dimension and the base score corresponding to the scoring dimension, including: directly determining the base score corresponding to the scoring dimension as the dimensional score corresponding to the scoring dimension.

[0142] Step 502: Determine the behavior score based on the dimension scores corresponding to each scoring dimension.

[0143] In one example, the behavior score is determined based on the dimensional scores corresponding to each scoring dimension, including: determining the behavior score by summing the dimensional scores corresponding to each scoring dimension.

[0144] In another example, the importance of different scoring dimensions may differ. In this case, the behavior score is determined based on the dimension scores corresponding to each scoring dimension, including: determining the behavior score by weighted sum of the dimension scores corresponding to each scoring dimension.

[0145] The weights of the dimensional scores for different scoring dimensions are pre-set.

[0146] Furthermore, since the scoring methods for different game behaviors may differ, the weights corresponding to different scoring dimensions can also be set based on the needs of the game behavior. In this case, the weight distribution of different behaviors under each scoring dimension may differ. Accordingly, the behavior score is determined by the weighted sum of the dimension scores corresponding to each scoring dimension, including: calculating the weighted sum of the dimension scores corresponding to each scoring dimension based on the weight distribution of the candidate behavior under each scoring dimension, and obtaining the behavior score. This can help meet the behavior score calculation requirements for different game behaviors.

[0147] In the above implementation, since candidate behaviors can be scored from multiple scoring dimensions and the behavior score of the candidate behavior is determined by combining the dimensional scores of the candidate behavior under each scoring dimension, the behavior score can better reflect the matching degree between the candidate behavior and the current scene, thereby helping to improve the accuracy of the target behavior determined based on the behavior score.

[0148] Furthermore, since the number of scoring dimensions can be multiple, this helps to accurately divide the scoring dimensions and build a scorer corresponding to each dimension. In the process of game design, the scorer corresponding to the scoring dimension can be flexibly selected to build the decision table according to the decision needs of the game character, without having to design a separate scorer for each game behavior. This helps to achieve modular setting of the decision table, thereby improving the reusability of the scorer and reducing the cost of building and maintaining the decision table.

[0149] In some implementations, reference Figure 6 In step 106, controlling the game character to perform the target behavior specifically includes the following steps:

[0150] Step 601: Determine whether the target behavior is the same as the current behavior of the game character.

[0151] The current action refers to the action that the game character is currently performing.

[0152] Optionally, in order to ensure the continuity of the game character's actions, a decision-making requirement may arise during the game character's execution of game behavior, thereby determining the target behavior. At this time, it is necessary to control the game character to execute the target behavior by combining the relationship between the target behavior and the game character's current behavior.

[0153] Step 602: If the target behavior is different from the current behavior, control the game character to interrupt the execution of the current behavior and execute the target behavior.

[0154] Step 603: If the execution time of the target behavior reaches the protection duration corresponding to the target behavior, generate decision requirements.

[0155] The protection duration for game actions is preset. Specifically, the protection duration refers to the shortest execution time for a game action under normal execution conditions (e.g., before completion and without abnormal interruption).

[0156] Step 604: If the target behavior is the same as the current behavior, control the game character to continue executing the current behavior and generate decision requirements at preset time intervals.

[0157] Specifically, the execution of a game action may take a long time, while the protection duration is generally shorter than the time required for the game action to complete. Therefore, when the target action is the same as the current action, controlling the game character to continue the execution of the current action without interrupting it can help ensure the continuity of action execution without changing the game action. This can prevent the game character from repeatedly executing the starting steps of the same game action, thereby helping to improve the user's gaming experience.

[0158] In this embodiment, generating decision requirements at preset time intervals includes: generating decision requirements when the preset time interval has elapsed since the last generation of decision requirements.

[0159] In one example, preset time intervals are set to correspond to game behaviors. Different game behaviors have different preset time intervals. Accordingly, when the target behavior is the same as the current behavior, the decision requirement needs to be generated based on the preset time interval corresponding to the current game behavior. This can help to flexibly set the decision requirement generation method for different game behaviors, thereby helping to improve the user's game experience.

[0160] In other examples, the preset duration interval can also be set in other ways, such as: setting it according to the character type, setting it according to the game scene type, or it can be a general value.

[0161] In practical implementation, when the target behavior is the same as the current behavior, since the execution of the current behavior is not interrupted, it is possible that the current behavior will complete before the preset time interval for generating the last decision requirement has elapsed. In this case, a decision requirement can be generated directly, and the game character can be controlled to enter a preset state (e.g., standby state). This timely decision-making upon the completion of the current game behavior helps prevent the game character from remaining in a preset state for an extended period, thereby improving the user's gaming experience.

[0162] In the above embodiments, since the execution method corresponding to the target behavior can be determined by combining the current behavior of the game character, and the game character is controlled to continue the execution of the current behavior when the target behavior is the same as the current behavior, the continuity of the game character's actions can be guaranteed without changing the game behavior. This can help avoid the game character repeatedly executing the starting steps of the same game behavior, thereby helping to improve the user's gaming experience.

[0163] In addition, since the execution time of the target behavior is monitored when the target behavior is different from the current behavior, and decision requirements are generated when the execution time reaches the protection time corresponding to the target behavior, this can help ensure the shortest execution time of the newly determined target behavior.

[0164] Furthermore, since the game scene is constantly changing, when the target behavior is the same as the current behavior, decision requirements are generated at preset time intervals. This helps to monitor the matching between the current behavior and the game scene. If the decision result indicates that the current behavior is still the best behavior, the execution of the current behavior can continue. If the decision result indicates that there is a more suitable game behavior than the current behavior, the execution of the current behavior can be interrupted in time. This helps to ensure the adaptability of the current behavior to the game scene, thereby helping to improve the user's gaming experience.

[0165] To help understand the game behavior decision-making method provided in the embodiments of this application, a specific example will be used for illustration below:

[0166] In this example, the decision table is shown in Table 2 below:

[0167] Table 2 Example of a decision table

[0168]

[0169]

[0170] In Table 2, C (judgment condition) represents the conditioner corresponding to the judgment condition, S (scoring dimension) represents the scorer corresponding to the scoring dimension, and v is the base score output by the scorer.

[0171] As shown in Table 2, the game behaviors in the decision table include: teleporting back to the spawn point, sprinting attack, maintaining distance, maintaining distance, and waiting; the judgment conditions include: whether the target is within 12 and whether the distance from the spawn point is greater than 20; the scoring dimensions include: the time the target stays within 12 and its own health.

[0172] In this example, we will illustrate the scenario where the character stays within a range of 12 for 3 seconds with the decision information as the target, the character's health is 80%, and the distance from the spawn point is less than 20.

[0173] First, the "teleport back to the spawn point" action is excluded because the conditional statement for the condition "distance from the spawn point is greater than 20" returns false, while the execution condition for the "teleport back to the spawn point" action is true under the condition "distance from the spawn point is greater than 20".

[0174] In addition, the "dash attack" behavior was also excluded because the conditional result corresponding to the "distance from target greater than 12" condition is true, while the execution condition of the "dash attack" behavior under the "distance from target greater than 12" condition is false.

[0175] Next, only three behaviors—"maintaining distance," "remote attack," and "standby"—enter the scoring stage. The base score output by the scorer for the "time the target stays within 12" dimension is 3 / 5 = 0.6, and the base score output by the scorer for the "self-health" dimension is 0.8.

[0176] The scoring method for the "keeping distance" behavior in the "target dwell time" dimension is 1-v, so its dimension score in this dimension is 1-0.6=0.4; the scoring method for the "keeping distance" behavior in the "health" dimension is (1-v)×2, so its dimension score in this dimension is (1-0.8)×2=0.4; thus, the behavior score for "keeping distance" behavior is 0.4+0.4=0.8.

[0177] The scoring formula for the "remote attack" behavior in the "target dwell time" dimension is v, so its dimension score in this dimension is 0.6; the scoring method for the "remote attack" behavior in the "health" dimension is 1-v+0.2, so its dimension score in this dimension is 1-0.8+0.2=0.4; thus, the behavior score for "remote attack" behavior is 0.6+0.4=1.

[0178] The scoring method for both dimensions of the "standby" behavior is 0, therefore the total score for the "standby" behavior is always 0.

[0179] After scoring, it was determined that "remote attack" ranked 1 > "maintain distance" ranked 0.8 > "standby" ranked 0. Therefore, the "remote attack" behavior was identified as the target behavior and executed.

[0180] This application also provides an electronic device. For example... Figure 7 As shown, Figure 7 The illustrated electronic device 700 includes a processor 701 and a memory 703. The processor 701 and the memory 703 are connected, for example, via a bus 702. Optionally, the electronic device 700 may also include a transceiver 704. It should be noted that in practical applications, the transceiver 704 is not limited to one type, and the structure of this electronic device 700 does not constitute a limitation on the embodiments of this application.

[0181] Processor 701 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 701 may also be a combination that implements computational functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.

[0182] Bus 702 may include a pathway for transmitting information between the aforementioned components. Bus 702 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. Bus 702 can be divided into address bus, data bus, etc. For ease of representation, Figure 7 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0183] The memory 703 may be ROM (Read Only Memory) or other types of static storage devices capable of storing static information and instructions, RAM (Random Access Memory) or other types of dynamic storage devices capable of storing information and instructions, or EEPROM (Electrically Erasable Programmable Read Only Memory), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but is not limited thereto.

[0184] The memory 703 is used to store application code that executes the solution of this application, and its execution is controlled by the processor 701. The processor 701 is used to execute the application code stored in the memory 703 to implement the content shown in the foregoing method embodiments.

[0185] Electronic devices include, but are not limited to: mobile terminals such as mobile phones, laptops, PDAs (personal digital assistants), and PADs (tablet computers), as well as fixed terminals such as digital TVs and desktop computers. They can also serve as server-side components. Figure 7 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.

[0186] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed in a computer, causes the computer to execute the game behavior decision-making method provided in the above embodiments.

[0187] It should be understood that although the steps in the flowcharts in the accompanying drawings are shown sequentially as indicated by the arrows, these steps are not necessarily performed in the order indicated by the arrows. Unless otherwise expressly stated herein, there is no strict order in which these steps are performed, and they may be performed in other orders.

[0188] The above are only some embodiments of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A game behavior decision-making method, characterized in that, The method includes: In response to the decision-making needs of the game character, a decision table is obtained. Each row of the decision table corresponds to the execution conditions of a game behavior under preset judgment conditions and the scoring method under preset scoring dimensions. The decision table includes at least two game behaviors, and the scoring methods of different game behaviors under the same scoring dimension are different. Obtain decision information corresponding to the game character, the decision information including object information of the game character and / or game scene information corresponding to the game character; The decision information is judged based on the condition corresponding to the judgment condition to obtain the judgment result; Candidate game behaviors are determined from each of the game behaviors based on the matching relationship between the execution conditions and the judgment results; The decision information is scored based on the scorer corresponding to the scoring dimension to obtain the base score corresponding to the scoring dimension, and the base score belongs to a preset score range. The behavioral score corresponding to the candidate game behavior is determined based on the scoring method and the base score; the determination of the behavioral score corresponding to the candidate game behavior based on the scoring method and the base score includes: when there are two or more scoring dimensions, for each scoring dimension, determining the dimension score corresponding to the scoring dimension based on the scoring method under the scoring dimension and the base score corresponding to the scoring dimension; calculating the weighted sum of the dimension scores corresponding to each scoring dimension based on the weight distribution of the candidate game behavior in each scoring dimension to obtain the behavioral score; Based on the behavior scores corresponding to the candidate game behaviors, the target behavior corresponding to the game character is determined from each of the candidate game behaviors, so as to control the game character to perform the target behavior.

2. The method according to claim 1, characterized in that, The judgment conditions include two or more, and the step of determining candidate game behaviors from each of the game behaviors based on the matching relationship between the execution conditions and the judgment results includes: For each judgment condition, determine whether the execution condition under the judgment condition matches the judgment result corresponding to the judgment condition; The candidate game behavior is determined from the game behaviors whose execution conditions under each judgment condition match the corresponding judgment result.

3. The method according to claim 1, characterized in that, The step of determining candidate game behaviors from each of the game behaviors based on the matching relationship between the execution conditions and the judgment results includes: From each of the aforementioned game behaviors, an executable behavior that meets the decision conditions is identified, wherein the executable behavior is not in a cooldown state; The candidate game behavior is determined from each of the executable behaviors based on the matching relationship between the execution conditions and the judgment results.

4. The method according to claim 1, characterized in that, Controlling the game character to perform the target behavior includes: Determine whether the target behavior is the same as the current behavior of the game character; If the target behavior differs from the current behavior, the game character is controlled to interrupt the execution of the current behavior and execute the target behavior. If the execution time of the target behavior reaches the protection time corresponding to the target behavior, the decision requirement is generated at a preset time interval. If the target behavior is the same as the current behavior, control the game character to continue executing the current behavior, and generate the decision requirement at preset time intervals.

5. The method according to claim 1, characterized in that, The decision table to be obtained includes: Obtain the decision table corresponding to the character type of the game character.

6. The method according to claim 1, characterized in that, The decision information includes: the object information of the game character and / or the game scene information corresponding to the game character.

7. An electronic device, characterized in that, The electronic device includes: At least one processor; Memory; At least one application, wherein the at least one application is stored in memory and configured to be executed by at least one processor, said at least one application being configured to: perform the game behavior decision method according to any one of claims 1 to 6.

8. A computer-readable storage medium storing a computer program thereon, characterized in that, When the computer program is executed in the computer, the computer is instructed to perform the game behavior decision-making method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Decision configuration method and device for game AI

    CN111701246A