Agent role control method and device in game, electronic equipment and readable storage medium

By combining a three-layer strategy structure with a pre-trained model/planner matching table, the behavior of intelligent agents is dynamically adjusted, solving the problem of inflexible control of intelligent agents in games and improving performance and computational efficiency in rapidly changing environments.

CN119770970BActive Publication Date: 2025-11-07NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411642581.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-15
Publication Date
2025-11-07
Estimated Expiration
2044-11-15

AI Technical Summary

Technical Problem

In existing technologies, intelligent agents lack the ability to dynamically adjust when facing rapidly changing game environments, resulting in insufficient flexibility and precision in control, and significant waste of computing resources.

Method used

A three-layer strategy structure is adopted to control the agent role: the first strategy layer determines the macro behavior and additional conditions, the second strategy layer determines the behavior tree, and the third strategy layer determines the control operation. Combined with the pre-trained model and planning table, the behavior of the agent role is dynamically adjusted.

Benefits of technology

It enables more flexible and precise control of intelligent agents in rapidly changing game environments, reduces the waste of computing resources, and improves dynamic adjustment capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119770970B_ABST
    Figure CN119770970B_ABST
Patent Text Reader

Abstract

The present disclosure discloses an agent role control method and device in a game, electronic equipment and a readable storage medium, and relates to the technical field of computers. The method comprises the following steps: in a first strategy level, determining a first macroscopic behavior to be implemented by an agent role and a first additional condition to be met in the process of implementing the first macroscopic behavior based on game data through a model or a planning table; in a second strategy level, determining a first behavior tree to be executed by the agent role based on the first macroscopic behavior and the first additional condition; in a third strategy level, determining a control operation pre-configured for a node of the first behavior tree; and controlling the agent role based on the control operation, so that the agent role executes the node of the first behavior tree, to implement the first macroscopic behavior and meet the first additional condition in the process of implementing the first macroscopic behavior. The method can make the dynamic adjustment capability of the agent role better and the control more flexible and accurate.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of computer, in particular to an agent role control method in a game, an agent role control device in a game, an electronic device and a computer readable storage medium. BACKGROUND

[0002] In a game, the presence of an agent role (also commonly referred to as a robot role or an AI role) can often improve user experience, for example, an agent role can be added for a man-machine battle, and for example, when the number of users participating in a game is insufficient, an agent role can be used to fill in the position to ensure that the game starts normally.

[0003] However, the current control method for the agent role is not flexible and accurate enough, so that the agent role lacks the ability to dynamically adjust when facing a rapidly changing game environment. SUMMARY

[0004] The present disclosure provides an agent role control method in a game, an agent role control device in a game, an electronic device and a computer readable storage medium to solve or at least partially solve the above problems, as follows.

[0005] In a first aspect, the present disclosure provides an agent role control method in a game, the method comprising:

[0006] controlling an agent role to play against a virtual role controlled by a user;

[0007] in a preconfigured first strategy level, determining a first macro behavior to be implemented by the agent role and a first additional condition to be met in the process of implementing the first macro behavior based on game data through a pre-trained model or a preconfigured planning table; the first macro behavior is one of the preconfigured macro behavior types in the first strategy level, and the first additional condition is one of the preconfigured additional conditions in the first strategy level;

[0008] in a preconfigured second strategy level, determining a first behavior tree to be executed by the agent role based on the first macro behavior and the first additional condition; the second strategy level is a sub-level of the first strategy level, and the first behavior tree is one of the preconfigured behavior trees in the second strategy level;

[0009] in a preconfigured third strategy level, determining a control operation preconfigured for a node of the first behavior tree; the third strategy level is a sub-level of the second strategy level;

[0010] control the agent character based on the control operation, so that the agent character executes a node of the first behavior tree to achieve the first macro behavior and meet the first additional condition in the process of achieving the first macro behavior.

[0011] In a second aspect, the present disclosure further provides an agent character control device in a game, the device comprising:

[0012] a first control module configured to control the agent character to play a game with a user-controlled virtual character;

[0013] a first determination module configured to determine, in a preconfigured first strategy level, a first macro behavior to be achieved by the agent character and a first additional condition to be met by the agent character in the process of achieving the first macro behavior based on game data by a pre-trained model or a preconfigured planning table; the first macro behavior is one of preconfigured macro behavior types in the first strategy level, and the first additional condition is one of preconfigured additional conditions in the first strategy level;

[0014] a second determination module configured to determine, in a preconfigured second strategy level, a first behavior tree to be executed by the agent character based on the first macro behavior and the first additional condition; the second strategy level is a sub-level of the first strategy level, and the first behavior tree is one of preconfigured behavior trees in the second strategy level;

[0015] a third determination module configured to determine, in a preconfigured third strategy level, a control operation preconfigured for a node of the first behavior tree; the third strategy level is a sub-level of the second strategy level;

[0016] a second control module configured to control the agent character based on the control operation, so that the agent character executes a node of the first behavior tree to achieve the first macro behavior and meet the first additional condition in the process of achieving the first macro behavior.

[0017] In a third aspect, the present disclosure further provides an electronic device, comprising a processor, a memory, and computer program instructions stored on the memory and executable on the processor;

[0018] The processor executes the computer program instructions to implement the agent character control method in the game as described in the first aspect.

[0019] In a fourth aspect, the present disclosure further provides a computer-readable storage medium, the computer-readable storage medium storing computer program instructions, the computer program instructions being executed by a processor to implement the agent character control method in the game as described in the first aspect.

[0020] The exemplary embodiments of the present disclosure have the following beneficial effects:

[0021] The method for controlling an agent role in a game provided by the present disclosure first controls the agent role to play against a virtual role controlled by a user; then in a preconfigured first strategy level, determines a first macro behavior to be implemented by the agent role and a first additional condition to be met in the process of implementing the first macro behavior based on game data through a pre-trained model or a preconfigured planning table; in a preconfigured second strategy level, determines a first behavior tree to be executed by the agent role based on the first macro behavior, the first additional condition and the win rate of the agent role, wherein the second strategy level is a sub-level of the first strategy level; then in a preconfigured third strategy level, determines a control operation preconfigured for a node of the first behavior tree, wherein the third strategy level is a sub-level of the second strategy level; and then controls the agent role based on the control operation, so that the agent role executes the node of the first behavior tree to implement the first macro behavior and meet the first additional condition in the process of implementing the first macro behavior. In the present disclosure, the control of the agent role can be implemented through the three-level strategy structure of the macro first strategy level, the specific second strategy level and the bottom-level implemented third strategy level, wherein the macro first strategy level can be divided into a macro behavior and an additional condition to be met in the process of implementing the macro behavior, so that the high-level strategy of the agent role is flexibly adjusted from the two aspects of the macro behavior and the additional condition, so that the dynamic adjustment capability of the agent role when facing the rapidly changing game environment is better, and the control of the agent role is more flexible and accurate. BRIEF DESCRIPTION OF DRAWINGS

[0022] Figure 1 is a flowchart of a method for controlling an agent role in a game provided by one of the embodiments of the present disclosure;

[0023] Figure 2 is a schematic diagram of a control strategy of an agent role provided by one of the embodiments of the present disclosure;

[0024] Figure 3 is a schematic diagram of a first strategy level in a control strategy of an agent role provided by one of the embodiments of the present disclosure;

[0025] Figure 4 is a schematic diagram of a model structure of a first supervised learning model provided by one of the embodiments of the present disclosure;

[0026] Figure 5 is a schematic diagram of a second strategy level provided by one of the embodiments of the present disclosure;

[0027] Figure 6is a schematic diagram of a model structure of a second supervised learning model provided by one of the embodiments of the present disclosure;

[0028] Figure 7 is a block diagram of an agent role control apparatus in a game provided by one of the embodiments of the present disclosure;

[0029] Figure 8 is a schematic diagram of a logic structure of an electronic device for implementing agent role control in a game provided by one of the embodiments of the present disclosure. DETAILED DESCRIPTION

[0030] For the purpose, technical solutions and advantages of the embodiments of the present disclosure to be clearer, the technical solutions in the embodiments of the present disclosure will be described clearly and completely below with reference to the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all the embodiments. The components of the embodiments of the present disclosure described and shown in the drawings herein can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present disclosure provided in the drawings is not intended to limit the scope of the claimed present disclosure, but only represents selected embodiments of the present disclosure. Based on the embodiments of the present disclosure, every other embodiment obtained by a person skilled in the art without creative work belongs to the scope of protection of the present disclosure.

[0031] The terms "one", "an", "the", and "said" are used in the present specification to denote the presence of one or more than one element / component / etc.; the terms "include" and "have" are used in the present specification to denote an open-ended inclusion in such a way that additional elements / components / etc. can be present in addition to those listed; the terms "first" and "second" are used only as labels, not as a numerical limitation.

[0032] It should be understood that, in the embodiments of the present disclosure, "at least one" means one or more, and "multiple" means two or more than two. "And / or" is only a description of the relationship between the associated objects, which means that there can be three relationships, for example, A and / or B can mean that A exists alone, A and B exist together, and B exists alone. The character " / " generally represents an "or" relationship between the associated objects. "Including A, B and / or C" means including any one or any two or three of A, B and C.

[0033] It should be understood that, in the embodiments of the present disclosure, "B corresponding to A", "B corresponding to A", "A corresponding to B" or "B corresponding to A" means that B is associated with A, and B can be determined according to A. Determining B according to A does not mean that B is determined only according to A, but also can be determined according to A and / or other information.

[0034] The method for controlling an agent role in a game in an embodiment of the present disclosure can run on a terminal device or a server. The terminal device can be a desktop computer, a notebook computer, a tablet computer, a mobile phone, or the like, or other electronic devices, which are not specifically limited in the present disclosure. The server is configured to provide background services for a client of an application in the terminal device. For example, the server can be a background server of the application. The server can be a standalone physical server, a server cluster composed of multiple physical servers, or a distributed system. The server can also be a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms, which are not specifically limited in the present disclosure.

[0035] Before the embodiments of the present disclosure are described in detail, the related art is further introduced.

[0036] In one prior art, the control method of an agent role in a game can adopt a multi-condition behavior tree method, i.e., XX condition is met to execute A behavior, YY condition is met to execute B behavior.

[0037] In one prior art, an agent role is trained by a model, so that the behavior that the agent role needs to take can be determined according to the current game situation, and the agent role is controlled to execute the behavior.

[0038] In one prior art, a two-layer or three-layer control strategy can be adopted to control the agent role in layers, such as a high-layer strategy + a bottom-layer strategy, a high-layer strategy + a middle-layer strategy + a bottom-layer strategy.

[0039] However, the above prior arts have the following problems:

[0040] 1. For the first prior art, first, for a designer, in the case of adding new functions, conflicts often occur, which leads to the need to reconstruct the entire behavior tree system; second, different functions cannot be separated into independent modules, the system robustness is poor, and the stable operation of the agent role under various conditions cannot be guaranteed; third, because the control structure of the behavior tree is relatively fixed, i.e., a behavior can only be executed when a certain condition is met, the control of the agent role is not flexible, the control precision is not high, and the agent role lacks the ability to dynamically adjust when facing a rapidly changing game environment.

[0041] 2. For the second prior art, due to the limitation of training data and generalization ability, the control of the agent role is not flexible and accurate enough, which also makes the agent role unable to face a rapidly changing game environment.

[0042] 3. Regarding the third type of existing technology mentioned above, the high-level strategy (i.e., macroscopic behavior) to be adopted is usually adjusted according to the win rate of the intelligent agent. The high-level strategy layer bears a large amount of computation, and repeated adjustments to the high-level strategy will cause significant changes in the macroscopic behavior of the intelligent agent, resulting in the early computation being basically ineffective and wasting computational resources.

[0043] Figure 1 This disclosure illustrates a method for controlling an agent character in a game, as shown in one embodiment. Figure 1 As shown, the method includes the following steps S101 to S105.

[0044] Step S101: Control the intelligent agent character to play against the virtual character controlled by the user.

[0045] In one embodiment of this disclosure, an intelligent agent character can be controlled to fight against a virtual character during a game, wherein the virtual character is controlled by the user and the intelligent agent character is controlled by the game system.

[0046] Step S102: In the pre-configured first strategy level, based on game data, the first macro-behavior to be implemented by the intelligent agent and the first additional condition to be met in the process of implementing the first macro-behavior are determined through a pre-trained model or a pre-configured planning table; the first macro-behavior is one of the macro-behavior types pre-configured in the first strategy level, and the first additional condition is one of the additional conditions pre-configured in the first strategy level.

[0047] In this disclosure, reference is made to Figure 2 The control strategies for intelligent agents can be hierarchically divided into three levels: the first, second, and third strategy levels. The second and third strategy levels are sub-levels of the first and second strategy levels, respectively. The first strategy level pre-configures various macro-level behavior types and additional conditions. Macro-level behavior types represent the most general actions the intelligent agent will perform, such as repairing machines, rescuing, and treating. Additional conditions are the extra requirements the intelligent agent must meet to perform a specific macro-level behavior, such as bypassing a specific area in the virtual scene when repairing a machine. The second strategy level matches the first strategy level, and optionally, additional content can be added during the matching process. The third strategy level focuses more on the action execution itself, i.e., calling interface methods, such as moving from point A to point B or vaulting a window.

[0048] The first strategy level, also known as the high-level strategy of the agent role, refers to... Figure 3The high-level strategy can be further divided into a basic strategy and an overlay strategy. The basic strategy refers to a macro behavior type that the agent role needs to implement, which is the most macro behavior itself. The overlay strategy refers to additional conditions that need to be met in the process of implementing a macro behavior type by the agent role, i.e., how to execute the macro behavior. For example, when the agent role goes to repair a machine, it can go directly or use an RVO method (in an optional example, the RVO method can refer to avoiding passing through an area near a specific NPC during movement). For another example, when the agent role goes to rescue, it can go directly or send a corresponding shortcut message while going.

[0049] In the first strategy level, the first macro behavior to be implemented by the agent role and the first additional condition to be met in the process of implementing the first macro behavior can be determined based on game data by using a pre-trained model or a pre-configured planning table, i.e., the basic strategy and the overlay strategy that need to be used by the agent role are determined.

[0050] In one embodiment of the present disclosure, the game data can include in-game data and out-of-game data.

[0051] I. The in-game data refers to data generated during the game, which can include the following aspects:

[0052] 1. User game data: including user progress (such as game progress, task status, etc.), user attributes (such as health points, magic points, etc.), user items (such as equipment, props, gold coins, currencies, resources obtained or assembled in the game, etc.), and the like.

[0053] 2. Scene game data: including current distribution of props in a virtual scene, current distribution of NPCs, current distribution of items, current state of buildings, and the like.

[0054] II. The out-of-game data refers to game data unrelated to the game situation, which includes the following aspects:

[0055] 1. User data: user level information (such as user segment, user level, etc.), user-defined information (appearance settings, key mapping, etc.), user account, user avatar, user nickname, and the like.

[0056] 2. Scene data: including level structure (map, item layout, building layout, etc.), level conditions (level target, passing condition, failure condition, etc.), level configuration (dynamic element configuration, obstacle position, trigger, etc.), and the like.

[0057] 3. Item and equipment data: including item attributes (name, description, rarity, icon, use effect, etc.), equipment attributes (attack power, defense power, durability, additional effect, etc.), drop rules (item drop probability, drop condition, drop source, etc.), etc.

[0058] In one embodiment of the present disclosure, the step can be implemented by the following steps S1021-S1022.

[0059] Step S1021: According to the level information of the virtual role in the game data, select the target strategy for the agent role from the pre-configured first target strategy and the pre-configured second target strategy; the first target strategy is used to determine the macro behavior to be implemented by the agent role and the additional conditions to be met in the process of implementing the macro behavior through the pre-trained model, and the second target strategy is used to determine the macro behavior to be implemented by the agent role and the additional conditions to be met in the process of implementing the macro behavior through the pre-configured planning table.

[0060] Step S1022: According to the selected target strategy, determine the first macro behavior to be implemented by the agent role and the first additional conditions to be met in the process of implementing the first macro behavior through the pre-trained model or the pre-configured planning table.

[0061] In this embodiment, the corresponding target strategy for the agent role participating in the game can be selected between the first target strategy and the second target strategy based on the level of the virtual role participating in the game, so as to determine whether the pre-trained model or the pre-configured planning table is used to determine the first macro behavior to be implemented and the first additional conditions to be met in the implementation process for the agent role.

[0062] In one implementation manner of the embodiment, when the level information of the virtual role in the game data represents that the level of the virtual role is in a first level range, the target strategy for the virtual role is selected as the first target strategy; when the level information of the virtual role in the game data represents that the level of the virtual role is in a second level range, the target strategy for the virtual role is selected as the second target strategy.

[0063] Wherein, the minimum value of the first level range is greater than the maximum value of the second level range, that is, in the case that the level of the virtual role participating in the game is in the first level range, it is indicated that the user participating in the game is a high-level user, and then the target strategy for the virtual role can be selected as the first target strategy, and in the case that the level of the virtual role participating in the game is in the second level range, it is indicated that the user participating in the game is a low-level user, and then the target strategy for the virtual role can be selected as the second target strategy.

[0064] In an optional example, the pre-trained model can be a first supervised learning model.

[0065] Optionally, the training method of the first supervised learning model can include the following steps S01-S02:

[0066] Step S01: Obtain a first game data training sample, and a macro behavior sample label and an additional condition sample label corresponding to the first game data training sample.

[0067] In this embodiment, the first game data training sample, and the macro behavior sample label and the additional condition sample label corresponding to the first game data training sample can be obtained based on the game video of the virtual role in the first level range.

[0068] Optionally, the first game data training sample, and the macro behavior sample label and the additional condition sample label corresponding to the first game data training sample can be obtained in the following manner:

[0069] Step S01-1: If the virtual role in the game video performs a first macro behavior type in the preconfigured macro behavior type in the time period from the first time to the second time in the game video, determine the game data corresponding to the first time in the game video as the first game data training sample;

[0070] Step S01-2: Determine the first macro behavior type (i.e., the basic strategy adopted by the virtual role in the game video) as the macro behavior sample label corresponding to the first game data training sample;

[0071] Step S01-3: According to the confirmation strategy configured for each preconfigured additional condition, determine the second additional condition that the virtual role in the game video satisfies in the process of implementing the first macro behavior type, wherein the second additional condition is one of the preconfigured additional conditions;

[0072] Step S01-4: Determine the second additional condition (i.e., the superimposed strategy adopted by the virtual role in the game video) as the additional condition sample label corresponding to the first game data training sample.

[0073] In this embodiment, the behavior of the role in the game video of the high-level user can be periodically detected. If the role has a machine repair behavior in the time period from t to t+T, it is considered that the basic strategy (macro behavior) adopted by the user at time t is machine repair. If the role has a rescue behavior, it is considered that the basic strategy (macro behavior) adopted by the user at time t is rescue.

[0074] For example, the superimposed strategy adopted by the user in the game video of the high-level user can be determined by the confirmation strategy in the following confirmation strategy table.

[0075] Table 1 Confirmation strategy table

[0076]

[0077]

[0078] According to the above method, the basic strategy and the superimposed strategy adopted by the high-level user to the user in the game recording can be determined, and then the first supervised learning model can be trained according to the game data of the high-level user at time t in the game recording as the feature, and the corresponding basic strategy and superimposed strategy as the label.

[0079] Step S02: training the first supervised learning model based on the first game data training sample, and the macro behavior sample label and the additional condition sample label corresponding to the first game data training sample, until the first supervised learning model converges.

[0080] Referring to Figure 4 , an exemplary model structure of the first supervised learning model is shown, which can first map each game data of the high-level user at time t in the game recording to the latent space through the hidden layer, to obtain the feature vector of each game data at time t in the latent space, then connect the feature vectors through the feature connection layer to obtain the connection feature vector, and then analyze the information in the connection feature vector through at least two hidden layers, and finally output the basic strategy and the superimposed strategy adopted by the user at time t through two classifiers (such as softmax classifier). Then, the first supervised learning model can be adjusted through the loss function between the model output result and the label until the first supervised learning model converges, that is, the training is completed. The functions of the hidden layer include but are not limited to mapping, pooling, feature extraction, etc.

[0081] During inference, only the game data of the current time needs to be input into the trained first supervised learning model, and the basic strategy and the superimposed strategy required by the agent character at the current time can be obtained, that is, the macro behavior currently required to be implemented by the agent character, and the additional conditions required to be met by the agent character in the process of implementing the macro behavior.

[0082] Supervised learning of the basic strategy and the superimposed strategy can more flexibly and accurately control the agent character.

[0083] The behavior of the high-level user is more complex, and the strategy combination mode is more diverse, while the behavior of the low-level user is relatively fixed. Therefore, in the game participated by the high-level user, a pre-trained model can be used to determine the high-level strategy that the agent needs to adopt in the game, and in the game participated by the low-level user, a pre-configured planning table can be used to determine the high-level strategy that the agent needs to adopt in the game. The flexibility of the model mode is high, and the application in the game participated by the high-level user can make the agent have the game level of the high-level user. The controllability of the planning table mode is high, but the degree of personification is low, and the application in the game participated by the low-level user is not easy to be detected, and the calculation resources are saved.

[0084] Optionally, when the selected target strategy is the second target strategy, the first macro behavior (i.e., the basic strategy) to be implemented by the agent can be determined according to the game data and the priority set for the macro behavior type; and then, the first additional condition (i.e., the superimposed strategy) that needs to be met by the agent in the process of implementing the first macro behavior is determined through the pre-configured planning table.

[0085] In this example, the basic strategy can be determined according to the current game situation and the priority of the basic strategy in the planning table. The current game situation can be determined based on the current game data, for example, if a specific type of character on the field is injured, the character can be treated. The priority of the basic strategy, that is, the priority set for the pre-configured macro behavior type.

[0086] For example, the priority of the basic strategy can be set as treatment>rescue>repair>…, indicating that if a specific type of character on the field is injured, the character will be treated first, and the macro behavior of low priority will be abandoned, and if there is no specific type of character on the field, but there is a specific type of character that needs to be rescued, the character will be rescued first.

[0087] In an optional embodiment, the planning table can be a fixed planning table, that is, what macro behavior type needs to be matched with what additional condition is fixed, that is, the mapping relationship between the macro behavior type and the additional condition is fixed. The fixed planning table can include the additional condition corresponding to the macro behavior type.

[0088] For example, a fixed planning table is provided, as shown in Table 2.

[0089] Table 2 Fixed planning table

[0090] Macro behavior type Additional condition Rescue Tinnitus Fixing machine RVO goes to … … Treatment Directly goes to

[0091] In this embodiment, for the fixed planning table, the additional condition corresponding to the first macro behavior in the planning table is determined as the first additional condition.

[0092] In an alternative embodiment, the planning and matching table can be a conditional planning and matching table, i.e., what macro-behavior type needs to be matched with what additional condition needs to be determined based on the current game situation, i.e., the mapping relationship between the macro-behavior type and the additional condition is not fixed, and the conditional planning and matching table can include a matching condition set corresponding to different additional conditions corresponding to the macro-behavior type.

[0093] For example, a conditional planning and matching table is provided, as shown in Table 3.

[0094] Table 3 Conditional planning and matching table

[0095]

[0096] In this embodiment, when the current game situation represented by the game data satisfies a first matching condition in the matching condition set corresponding to different additional conditions corresponding to the first macro-behavior, the additional condition corresponding to the first macro-behavior corresponding to the first matching condition is determined as the first additional condition.

[0097] For example, based on the current game data, the current game situation is that there is a character A on the field that needs to be rescued, it can be determined that the first macro-behavior to be implemented by the agent character is a rescue behavior, referring to the conditional planning and matching table shown in Table 3, the matching condition set corresponding to different additional conditions corresponding to the rescue behavior includes a first matching condition "user matching waiting time greater than 20s" and a second matching condition "user matching waiting time less than 20s", wherein the first matching condition is the matching condition of the rescue behavior corresponding to the "directly go" additional condition, and the second matching condition is the matching condition of the rescue behavior corresponding to the "RVO go" additional condition. Based on the current game data, it can be determined that the user matching waiting time is greater than 20s, and it can be determined that the additional condition to be satisfied by the agent character in the process of implementing the rescue behavior in this game is "directly go", i.e., the agent character needs to directly go to the character A to rescue the character A.

[0098] Step S103: In the preconfigured second strategy level, based on the first macro-behavior and the first additional condition, determining a first behavior tree to be executed by the agent character; the second strategy level is a sub-level of the first strategy level, and the first behavior tree is one of the preconfigured behavior trees in the second strategy level.

[0099] In this step, based on the first macro-behavior and the first additional condition, the first behavior tree to be executed by the agent character can be determined from the preconfigured behavior trees in the second strategy level.

[0100] In one embodiment of the present disclosure, any macro behavior type and any additional condition can be combined, and a behavior tree can be configured for each combination in the second strategy level, so that the behavior tree to be performed by the agent role can be determined in the behavior tree preconfigured for each combination of different macro behavior types and different additional conditions as the first behavior tree preconfigured for the combination of the first macro behavior and the first additional condition.

[0101] In the present disclosure, the first macro behavior satisfying the first additional condition can be split into a series of specific behaviors, and the specific behaviors can be constructed as nodes in the first behavior tree according to the relationship between the specific behaviors.

[0102] In an optional embodiment, a behavior tree matching identifier can be generated according to the first macro behavior and the first additional condition, the behavior tree matching identifier being used to determine the first behavior tree preconfigured for the combination of the first macro behavior and the first additional condition, and then the first behavior tree preconfigured for the combination of the first macro behavior and the first additional condition can be determined in the behavior tree preconfigured for each combination of different macro behavior types and different additional conditions according to the behavior tree matching identifier.

[0103] In an optional embodiment, referring to Table 4 below, the Chinese name of the macro behavior type can be mapped to English as the identifier of the macro behavior type, the Chinese name of the additional condition can be mapped to English as the identifier of the additional condition, and the identifier of the macro behavior type and the identifier of the additional condition can be combined, for example, by combining symbols such as underscore (_), plus sign (+), asterisk (*) and the like, so as to obtain the behavior tree matching identifier. Then, according to the behavior tree matching identifier, the first behavior tree can be matched in the behavior tree preconfigured for each combination of different macro behavior types and different additional conditions.

[0104] Table 4

[0105] Macro behavior type English mapping Rescue SAVE Fixing machine FIX … … Treatment RESCUE Additional condition English mapping Directly goes to DIRECTMOVE RVO goes to RVOMOVE … … Quick message QUICKSPEECH

[0106] For example, the first macro behavior to be implemented by the agent role is repairing a machine, and the first additional condition to be satisfied in the process of implementing the first macro behavior is direct movement, that is, the high-level strategy to be adopted by the agent role is “repairing a machine + direct movement”. Then, according to Table 4 above, the English mapping corresponding to “repairing a machine” and “direct movement” is determined as “FIX” and “DIRECTMOVE” respectively, and the behavior tree matching identifier obtained by combination is “DIRECTMOVE_FIX”, that is, the high-level strategy to be adopted by the agent role can be represented as “DIRECTMOVE_FIX”.

[0107] Afterwards, according to the behavior tree matching identifier obtained by combining the first macro behavior and the first additional condition, the corresponding behavior tree can be matched in the second strategy level. For example, according to Table 5, the behavior tree matching identifier "DIRECTMOVE_FIX" corresponds to the matched behavior tree "DIRECTMOVE_FIX" in the second strategy level.

[0108] Table 5

[0109] Behavior tree matching identification Behavior tree DIRECTMOVE_FIX Match "DIRECTMOVE_FIX" behavior tree QUICKSPEECH_FIX Match "QUICKSPEECH_FIX" behavior tree … … RVOMOVE_RESCUE Match "RVOMOVE_RESCUE" behavior tree

[0110] Referring to Figure 5 , for example, the preconfigured "DIRECTMOVE_FIX", "QUICKSPEECH_FIX", and other behavior trees in the second strategy level are shown, Figure 5 , which shows the tree structure of the "DIRECTMOVE_FIX" behavior tree in more detail.

[0111] In one embodiment of the present disclosure, the first behavior tree can include preconfigured branches corresponding to different win rate ranges, for example, as shown in Figure 5 , which shows three branches of the "DIRECTMOVE_FIX" behavior tree in more detail. Branch 1 is the branch corresponding to the win rate range of win rate < a, branch 2 is the branch corresponding to the win rate range of a < win rate < b, and branch 3 is the branch corresponding to the win rate range of win rate > b.

[0112] Optionally, the method provided by the present disclosure can further include the following steps: determining the win rate of the agent role; and if the win rate of the agent role is in a first win rate range in the different win rate ranges, determining that the branch to be executed by the agent role in the first behavior tree is a first branch corresponding to the first win rate range in the first behavior tree.

[0113] In this embodiment, executing the branches corresponding to different win rate ranges in the first behavior tree for the agent role can all enable the agent role to implement the first macro behavior that meets the first additional condition, but the nodes under each branch will differ in behavior type and / or behavior parameter. This difference can enable the agent role to implement the first macro behavior that meets the first additional condition while regulating the win rate of the agent role, so as to guide the win rate of the agent role and the win rate of the virtual role to be close to five-fifty (i.e., the win rate of the agent role is gradually adjusted to about 50%) as much as possible through different branches of the first behavior tree, so as to enable the agent role to adapt to the current game environment (i.e., the agent role completes the first macro behavior that meets the first additional condition) while also ensuring that the win rate of the agent role is comparable to that of the virtual role controlled by the user.

[0114] In an optional embodiment, the node structures of different branches of the same behavior tree are the same, the behavior types of the behaviors represented by the nodes at the same positions in different branches of the same behavior tree are the same, and the preconfigured behavior parameters are different. For example, as shown in FIG. 29, the node structures of the three branches of the first behavior tree “DIRECTMOVE_FIX” are the same, and the behavior types of the behaviors represented by the nodes at the same positions in the three branches are the same, for example, the behavior types of the behaviors represented by the first nodes in the three branches are all “set repair success rate”, but the preconfigured behavior parameters corresponding to the behaviors represented by the nodes at the same positions in the three branches are different, the first node in branch 1 needs to set the repair success rate to a1, the first node in branch 2 needs to set the repair success rate to a2, and the first node in branch 3 needs to set the repair success rate to a3. Figure 5

[0115] In an optional embodiment, the node structures of different branches of the same behavior tree can be the same, but the behavior types of the behaviors represented by the nodes at the same positions in different branches of the same behavior tree can be different.

[0116] In an optional embodiment, the node structures of different branches of the same behavior tree can be different.

[0117] In one of the embodiments of the present disclosure, the win rate of the agent role, i.e., the winning probability of the agent role, can be determined by the pre-trained second supervised learning model.

[0118] Optionally, the training method of the second supervised learning model can include the following steps S03-S04:

[0119] Step S03: Obtain a second game data training sample and a game result sample label corresponding to the second game data training sample.

[0120] In the present embodiment, the second game data training sample and the game result sample label corresponding to the second game data training sample can be obtained based on the virtual role game video.

[0121] Optionally, the second game data training sample and the game result sample label corresponding to the second game data training sample can be obtained in the following manner:

[0122] Step S03-1: Determine the game data of the game in the virtual role game video as the second game data training sample;

[0123] Step S03-2: Determine the win or lose result of the target virtual role in the game in the virtual role game video as the game result sample label corresponding to the second game data training sample; the target virtual role is one of the virtual roles participating in the game in the virtual role game video.​

[0124] For example, if the target virtual character wins, the corresponding game result sample label can be 1, if the target virtual character draws with the opponent, the corresponding game result sample label can be 0.5, and if the target virtual character loses, the corresponding game result sample label can be 0.

[0125] Step S04: training the second supervised learning model based on the second game data training sample and the game result sample label corresponding to the second game data training sample until the second supervised learning model converges.

[0126] Referring to Figure 6 , an exemplary model structure of the second supervised learning model is shown. First, the game data of the game can be mapped to the latent space through the hidden layer to obtain the feature vectors of the game data of the game in the latent space, and then the feature vectors are connected through the feature connection layer to obtain the connection feature vectors, and then the information in the connection feature vectors is analyzed through at least two hidden layers, and finally the output result is mapped to the interval [0, 1] through the normalization layer (such as sigmoid layer), so as to obtain the win rate of the output user at time t. Then, the second supervised learning model can be adjusted through the loss function between the model output result and the label until the second supervised learning model converges, that is, the training is completed. The functions of the hidden layer include but are not limited to mapping, pooling, feature extraction, etc.

[0127] During inference, only the game data of the game needs to be input into the trained second supervised learning model, and the win rate of the agent character at the current time can be predicted.

[0128] The training data of the first supervised learning model and the training data of the second supervised learning model can be the same type of game data or different types of game data, and the present disclosure does not intend to limit this.

[0129] In one embodiment of the present disclosure, the win rate of the agent character can be determined periodically, for example, once every 15s, 20s, 30s.

[0130] Since the events in the game will all affect the win rate of the agent character, during the execution of the first branch, the win rate of the agent character will change, so as to be in different win rate ranges.

[0131] Correspondingly, in the embodiment, when the first branch is executed, if the win rate of the agent role changes from a first win rate range in different win rate ranges under the first behavior tree to a second win rate range in the different win rate ranges under the first behavior tree, the branch to be executed by the agent role in the first behavior tree can be changed from the first branch to a second branch corresponding to the second win rate range in the first behavior tree, and the second branch is executed.

[0132] For example, referring to Figure 5 When the branch 1 of the first behavior tree "DIRECTMOVE_FIX" is executed, if the win rate of the agent role changes from the range of a and <b, the branch 1 corresponding to the win rate <a in the first behavior tree "DIRECTMOVE_FIX" can be switched to the branch 2 corresponding to the win rate a < win rate < b.

[0133] In the exemplary embodiments of the present disclosure, the win rate of the agent role can be adjusted in the second strategy level according to the win rate of the agent role, the win rate balance between the agent role and the user is realized, and in the case that the macro behavior to be realized by the agent and the additional conditions to be met in the realization process do not change, the win rate balance is realized through different branches of the behavior tree to be executed in the second strategy level, so that the calculation amount of the first strategy level can be reduced, the high-level strategy does not need to be repeatedly adjusted, and the calculation resources are saved.

[0134] Step S104: determining a control operation pre-configured for a node of the first behavior tree in a pre-configured third strategy level; the third strategy level is a sub-level of the second strategy level.

[0135] In the present disclosure, the behavior represented by each node in the first behavior tree can be realized through one or more control operations, and in the present step, the control operation pre-configured for the node of the first behavior tree can be determined in the third strategy level. The control operation is, for example, a movement control operation from point A to point B, a window flipping control operation, a hemostasis control operation, a repair control operation, etc.

[0136] In one embodiment of the present disclosure, if the branch to be executed by the agent role in the first behavior tree is the first branch corresponding to the first win rate range in the first behavior tree, the control operation pre-configured for the node of the first branch in the first behavior tree can be determined in the pre-configured third strategy level in the present step.

[0137] Step S105: controlling the agent role based on the control operation, so that the agent role executes the node of the first behavior tree to realize the first macro behavior and meet the first additional condition in the process of realizing the first macro behavior.

[0138] In this step, the function interface corresponding to the control operation can be called for the agent role, and the function interface corresponding to the control operation is used to control the agent role to execute the virtual behavior corresponding to the control operation. Each time the function interface corresponding to the control operation preconfigured for a node of the first behavior tree is called, the execution of the node is completed from the bottom, that is, the agent role is controlled to execute the virtual behavior defined by the node. After the node of the first behavior tree is executed, the agent role is controlled to execute the first macro behavior that meets the first additional condition.

[0139] In an embodiment, when the node of the first branch in the first behavior tree is executed, the flag bit of the control operation corresponding to the executed node can be set. In the third policy level, only the flag bit needs to be compared to determine which control operation corresponding function interface needs to be called.

[0140] As shown in the following Table 6, an exemplary control operation and function interface correspondence is shown.

[0141] Table 6

[0142]

[0143] For example, when the node "move to point A" is executed in the second policy level, the flag bit of the movement control operation from point A to point B can be set. In the third policy level, the flag bit of the movement control operation from point A to point B can be set. In the third policy level, the flag bit of the movement control operation from point A to point B is True, so that the move_interface interface is called, and the position of point A is input to the move_interface interface. In this way, the agent role can be controlled to move to point A through the move_interface interface.

[0144] In the exemplary embodiments of the present disclosure, the control of the agent role can be realized through the three-layer policy structure of the macro first policy level, the specific second policy level and the bottom implemented third policy level. Different control functions for the agent role are extracted as independent modules to improve the robustness of the control system and ensure the stable operation of the agent role in various situations. When a new control function is added, the main trunk or branch can be independently added at each level without the need to reconstruct the entire control system. The macro first policy level can be divided into a basic strategy representing a macro behavior and an additional condition representing a condition that needs to be met during the implementation of the macro behavior. Thus, the high-level policy of the agent role is flexibly adjusted from the aspects of the macro behavior and the additional condition, so that the dynamic adjustment capability of the agent role in the face of rapidly changing game environment is better, and the control of the agent role is more flexible and accurate.

[0145] The method for controlling an agent role in a game provided by the present disclosure first controls the agent role to play against a virtual role controlled by a user, then determines, in a preconfigured first strategy level, a first macro behavior to be implemented by the agent role and a first additional condition to be met in the process of implementing the first macro behavior based on game data through a pre-trained model or a preconfigured planning table, determines, in a preconfigured second strategy level, a first behavior tree to be executed by the agent role based on the first macro behavior, the first additional condition and a win rate of the agent role, wherein the second strategy level is a sub-level of the first strategy level, determines, in a preconfigured third strategy level, a control operation preconfigured for a node of the first behavior tree, wherein the third strategy level is a sub-level of the second strategy level, and controls the agent role based on the control operation to make the agent role execute the node of the first behavior tree to implement the first macro behavior and meet the first additional condition in the process of implementing the first macro behavior. In the present disclosure, the control of the agent role can be implemented through a three-level strategy structure of the macro first strategy level, the specific second strategy level and the bottom-level implemented third strategy level, wherein the macro first strategy level can be divided into a macro behavior and an additional condition to be met in the process of implementing the macro behavior, so that the high-level strategy of the agent role is flexibly adjusted from the two aspects of the macro behavior and the additional condition, and the dynamic adjustment capability of the agent role in the face of a rapidly changing game environment is better, and the control of the agent role is more flexible and accurate.

[0146] Corresponding to the method for controlling an agent role in a game provided by the embodiments of the present disclosure, the embodiments of the present disclosure also provide a device for controlling an agent role in a game. As shown in Figure 7 The device 700 comprises:

[0147] A first control module 701 is configured to control an agent role to play against a virtual role controlled by a user.

[0148] A first determination module 702 is configured to determine, in a preconfigured first strategy level, a first macro behavior to be implemented by the agent role and a first additional condition to be met in the process of implementing the first macro behavior based on game data through a pre-trained model or a preconfigured planning table. The first macro behavior is one of macro behavior types preconfigured in the first strategy level, and the first additional condition is one of additional conditions preconfigured in the first strategy level.

[0149] A second determination module 703 is configured to determine, in a preconfigured second strategy level, a first behavior tree to be executed by the agent role based on the first macro behavior and the first additional condition. The second strategy level is a sub-level of the first strategy level, and the first behavior tree is one of behavior trees preconfigured in the second strategy level.

[0150] The third determination module 704 is configured to determine, in a preconfigured third policy level, a control operation preconfigured for a node of the first behavior tree; the third policy level is a sub-level of the second policy level.

[0151] The second control module 705 is configured to control the agent character based on the control operation, so that the agent character executes the node of the first behavior tree to implement the first macro behavior and meet the first additional condition in the process of implementing the first macro behavior.

[0152] In an optional embodiment, the determining, based on the game data, of the first macro behavior to be implemented by the agent character and the first additional condition to be met in the process of implementing the first macro behavior includes:

[0153] According to the level information of the virtual character in the game data, a target policy for the agent character is selected from a preconfigured first target policy and a preconfigured second target policy; the first target policy is used to determine, by a pre-trained model, a macro behavior to be implemented by the agent character and an additional condition to be met in the process of implementing the macro behavior, and the second target policy is used to determine, by a preconfigured design table, the macro behavior to be implemented by the agent character and the additional condition to be met in the process of implementing the macro behavior.

[0154] According to the selected target policy, the first macro behavior to be implemented by the agent character and the first additional condition to be met in the process of implementing the first macro behavior are determined by the pre-trained model or the preconfigured design table.

[0155] In an optional embodiment, the selecting, according to the level information of the virtual character in the game data, of a target policy for the agent character from a preconfigured first target policy and a preconfigured second target policy includes:

[0156] When the level information of the virtual character in the game data indicates that the level of the virtual character is in a first level range, the target policy for the agent character is selected as the first target policy.

[0157] When the level information of the virtual character in the game data indicates that the level of the virtual character is in a second level range, the target policy for the agent character is selected as the second target policy; the minimum value of the first level range is greater than the maximum value of the second level range.

[0158] In an optional embodiment, the pre-trained model is a first supervised learning model.

[0159] In an optional embodiment, the training method of the first supervised learning model comprises:

[0160] obtaining a first game data training sample, and a macro behavior sample label and an additional condition sample label corresponding to the first game data training sample;

[0161] training the first supervised learning model based on the first game data training sample, and the macro behavior sample label and the additional condition sample label corresponding to the first game data training sample, until the first supervised learning model converges.

[0162] In an optional embodiment, when the selected target strategy is the second target strategy, determining, according to the second target strategy, a first macro behavior to be implemented by the agent role and a first additional condition to be met in a process of implementing the first macro behavior, comprises:

[0163] determining, according to the game data and a priority set for the macro behavior type, the first macro behavior to be implemented by the agent role;

[0164] determining, through a preconfigured design table, the first additional condition to be met in the process of implementing the first macro behavior by the agent role.

[0165] In an optional embodiment, the design table comprises a matching condition set corresponding to different additional conditions corresponding to a macro behavior type;

[0166] The determining, through the preconfigured design table, the first additional condition to be met in the process of implementing the first macro behavior by the agent role, comprises:

[0167] when a first matching condition in the matching condition set corresponding to different additional conditions corresponding to the first macro behavior meets a current game situation represented by the game data, determining that the additional condition corresponding to the first macro behavior corresponding to the first matching condition is the first additional condition.

[0168] In an optional embodiment, the design table comprises an additional condition corresponding to a macro behavior type;

[0169] The determining, through the preconfigured design table, the first additional condition to be met in the process of implementing the first macro behavior by the agent role, comprises:

[0170] determining that the additional condition corresponding to the first macro behavior in the design table is the first additional condition.

[0171] In an optional embodiment, the determining the first behavior tree to be executed by the agent character based on the first macro behavior and the first additional condition comprises:

[0172] In the behavior trees preconfigured for each combination of the different macro behavior types and the different additional conditions, the behavior tree to be executed by the agent character is determined as a first behavior tree preconfigured for the combination of the first macro behavior and the first additional condition.

[0173] In an optional embodiment, the first behavior tree comprises branches preconfigured for different win rate ranges, and the method further comprises:

[0174] Determining the win rate of the agent character;

[0175] If the win rate of the agent character is in a first win rate range among the different win rate ranges, determining the branch to be executed by the agent character in the first behavior tree as a first branch in the first behavior tree corresponding to the first win rate range;

[0176] The determining the control operation preconfigured for the node of the first behavior tree in the preconfigured third policy level comprises:

[0177] The determining the control operation preconfigured for the node of the first branch in the first behavior tree in the preconfigured third policy level.

[0178] In an optional embodiment, the nodes of different branches of the same behavior tree are of the same structure, the behaviors represented by the nodes of the same behavior tree at the same position in different branches are of the same behavior type and are preconfigured with different behavior parameters.

[0179] In an optional embodiment, the nodes of different branches of the same behavior tree are of the same structure, the behaviors represented by the nodes of the same behavior tree at the same position in different branches are of different behavior types.

[0180] In an optional embodiment, the nodes of different branches of the same behavior tree are of different structures.

[0181] In an optional embodiment, the determining the win rate of the agent character comprises:

[0182] Periodically determining the win rate of the agent character;

[0183] The method further comprises:

[0184] When the first branch is executed, if the win rate of the agent role changes from the first win rate range to a second win rate range in the different win rate range, the branch to be executed by the agent role in the first behavior tree is changed from the first branch to a second branch corresponding to the second win rate range in the first behavior tree, and the second branch is executed.

[0185] In an optional embodiment, the determining the win rate of the agent role comprises:

[0186] The win rate of the agent role is determined by a pre-trained second supervised learning model.

[0187] In an optional embodiment, the training method of the second supervised learning model comprises:

[0188] A second game data training sample and a game result sample label corresponding to the second game data training sample are obtained.

[0189] The second supervised learning model is trained based on the second game data training sample and the game result sample label corresponding to the second game data training sample until the second supervised learning model converges.

[0190] In an optional embodiment, the controlling the agent role based on the control operation comprises:

[0191] A function interface corresponding to the control operation is called for the agent role, and the function interface corresponding to the control operation is used to control the agent role to execute a virtual behavior corresponding to the control operation.

[0192] In an optional embodiment, the game data comprises in-game data and out-of-game data.

[0193] The intelligent agent character control device in the game disclosed herein first controls an intelligent agent character to play against a user-controlled virtual character; then, in a pre-configured first strategy level, based on game data and through a pre-trained model or a pre-configured planning table, it determines the first macro-behavior to be implemented by the intelligent agent character and the first additional condition to be satisfied in the process of implementing the first macro-behavior; in a pre-configured second strategy level, based on the first macro-behavior, the first additional condition, and the intelligent agent character's win rate, it determines the first behavior tree to be executed by the intelligent agent character, wherein the second strategy level is a sub-level of the first strategy level; then, in a pre-configured third strategy level, it determines the pre-configured control operations for the nodes of the first behavior tree, wherein the third strategy level is a sub-level of the second strategy level; then, based on the control operations, it controls the intelligent agent character to execute the nodes of the first behavior tree to implement the first macro-behavior and satisfy the first additional condition in the process of implementing the first macro-behavior. In this disclosure, the control of the intelligent agent role can be achieved through a three-layer strategy structure: a macro-level first strategy layer, a specific second strategy layer, and a bottom-level implementation third strategy layer. The macro-level first strategy layer can be divided into macro-behaviors and additional conditions that need to be met during the implementation of macro-behaviors. By flexibly adjusting the high-level strategy of the intelligent agent role through macro-behaviors and additional conditions, the intelligent agent role has better dynamic adjustment capabilities when facing rapidly changing game environments, and the control of the intelligent agent role is more flexible and precise.

[0194] The following describes an electronic device provided by an embodiment of this disclosure. Please refer to [link / reference]. Figure 8 , Figure 8 This is a schematic diagram of an electronic device provided in an embodiment of the present disclosure. The electronic device 800 may be equipped with a smart agent character control device from a game as described in this embodiment, used to implement the functions of this embodiment. Specifically, the electronic device 800 includes: a receiver 801, a transmitter 802, a processor 803, and a memory 804 (wherein the electronic device 800 may have one or more processors 803). Figure 8 (Taking a processor as an example), the processor 803 may include an application processor 8031 ​​and a communication processor 8032. In some embodiments of this disclosure, the receiver 801, transmitter 802, processor 803, and memory 804 may be connected via a bus or other means.

[0195] The memory 804 can include read-only memory and random access memory, and provide instructions and data to the processor 803. A portion of the memory 804 can also include non-volatile random access memory (NVRAM). The memory 804 stores processor and operating instructions, executable modules, or data structures, or a subset thereof, or an extended set thereof, wherein the operating instructions can include various operating instructions for implementing various operations.

[0196] The processor 803 controls the operation of the execution device. In a specific application, various components of the execution device are coupled together through a bus system, which can include a data bus, a power bus, a control bus, and a state signal bus, etc. However, for the sake of clarity, all the buses are referred to as a bus system in the figure.

[0197] The method disclosed in the above embodiments of the present disclosure can be applied in the processor 803 or implemented by the processor 803. The processor 803 can be an integrated circuit chip with a signal processing capability. In the implementation process, each step of the above method can be completed by the integrated logic circuit of the hardware in the processor 803 or the instruction in the form of software. The processor 803 mentioned above can be a general processor, a digital signal processor (DSP), a microprocessor or a microcontroller, and can further include an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component. The processor 803 can implement or execute the disclosed methods, steps and logic block diagrams in the embodiments of the present disclosure. The general processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in combination with the embodiments of the present disclosure can be directly embodied as a hardware code processor for execution, or a combination of hardware and software modules in the code processor for execution. The software module can be located in a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, or other mature storage media in the art. The storage medium is located in the memory 804, and the processor 803 reads the information in the memory 804 and combines the hardware to complete the steps of the above method.

[0198] The receiver 801 can be configured to receive inputted digital or character information, and generate signal input related to relevant settings and function control of the execution device. The transmitter 802 can be configured to output digital or character information through the first interface; the transmitter 802 can also be configured to send instructions to the disk group through the first interface to modify data in the disk group; and the transmitter 802 can further include a display device such as a display screen.

[0199] In the embodiments of the present disclosure, the application processor 8031 in the processor 803 is configured to execute the method for controlling an agent role in a game in the embodiments of the present disclosure. It should be noted that the application processor 8031 executes the specific manners of various steps is based on the same concept as the various method embodiments in the present disclosure, and the technical effects brought by the same are the same as the various method embodiments in the present disclosure, and the specific content can be referred to the description of the method embodiments in the present disclosure, which will not be repeated here.

[0200] The embodiments of the present disclosure further provide a chip for running instructions, which is configured to execute the technical solutions of the method for controlling an agent role in a game in the above embodiments.

[0201] The embodiments of the present disclosure further provide a computer readable storage medium, which stores computer instructions, and when the computer instructions are executed on a processor, the processor executes the technical solutions of the method for controlling an agent role in a game in the above embodiments.

[0202] The embodiments of the present disclosure further provide a computer program product, which includes a computer program, and when the computer program is executed on a processor, the computer program is configured to execute the technical solutions of the method for controlling an agent role in a game in the above embodiments.

[0203] The computer readable storage medium described above can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general-purpose or special-purpose server.

[0204] It should be understood that the present disclosure is not limited to the precise construction which has been described above and illustrated in the accompanying drawings, and that various modifications and changes can be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

[0205] The present disclosure is disclosed with the preferred embodiments, but it is not intended to limit the present disclosure, any person skilled in the art can make possible changes and modifications without departing from the spirit and scope of the present disclosure, therefore the protection scope of the present disclosure should be subject to the scope defined by the claims of the present disclosure.

Claims

1. A method for controlling an agent character in a game, the method comprising: The method comprises: controlling an agent role to play against a user-controlled virtual role; in a preconfigured first strategy level, determining, based on game data, a first macro behavior to be implemented by the agent role and a first additional condition to be met in a process of implementing the first macro behavior by a pre-trained model or a preconfigured planning table; the first macro behavior is one of preconfigured macro behavior types in the first strategy level, and the first additional condition is one of preconfigured additional conditions in the first strategy level; in a preconfigured second strategy level, determining, based on the first macro behavior and the first additional condition, a first behavior tree to be executed by the agent role; the second strategy level is a sub-level of the first strategy level, and the first behavior tree is one of preconfigured behavior trees in the second strategy level; in a preconfigured third strategy level, determining a control operation preconfigured for a node of the first behavior tree; the third strategy level is a sub-level of the second strategy level; controlling the agent role based on the control operation, so that the agent role executes the node of the first behavior tree to implement the first macro behavior and meet the first additional condition in the process of implementing the first macro behavior; The first behavior tree includes preconfigured branches corresponding to different win rate ranges, and the method further comprises: determining the win rate of the agent role; if the win rate of the agent role is in a first win rate range in the different win rate ranges, determining that the branch to be executed by the agent role in the first behavior tree is a first branch corresponding to the first win rate range in the first behavior tree.

2. The method of claim 1, wherein, The method comprises: According to the level information of the virtual role in the game data, a target strategy for the agent role is selected from a preconfigured first target strategy and a preconfigured second target strategy; the first target strategy is used to determine, by a pre-trained model, a macro behavior to be implemented by the agent role and an additional condition to be met in a process of implementing the macro behavior, and the second target strategy is used to determine, by a preconfigured planning table, a macro behavior to be implemented by the agent role and an additional condition to be met in a process of implementing the macro behavior; According to the selected target strategy, a first macro behavior to be implemented by the agent role and a first additional condition to be met in a process of implementing the first macro behavior are determined by a pre-trained model or a preconfigured planning table.

3. The method of claim 2, wherein, The method comprises: According to the level information of the virtual role in the game data, a target strategy for the agent role is selected from a preconfigured first target strategy and a preconfigured second target strategy; the first target strategy is used to determine, by a pretrained model, a macro behavior to be implemented by the agent role and an additional condition to be met in a process of implementing the macro behavior, and the second target strategy is used to determine, by a preconfigured planning table, a macro behavior to be implemented by the agent role and an additional condition to be met in a process of implementing the macro behavior; When the level information of the virtual role in the game data represents that the level of the virtual role is in a first level range, a target strategy selected for the agent role is the first target strategy; When the level information of the virtual role in the game data represents that the level of the virtual role is in a second level range, a target strategy selected for the agent role is the second target strategy; the minimum value of the first level range is greater than the maximum value of the second level range.

4. The method of claim 1, wherein, The pre-trained model is a first supervised learning model.

5. The method of claim 4, wherein, The training method of the first supervised learning model comprises: obtaining a first game data training sample, and a macro behavior sample label and an additional condition sample label corresponding to the first game data training sample; training the first supervised learning model based on the first game data training sample, and the macro behavior sample label and the additional condition sample label corresponding to the first game data training sample, until the first supervised learning model converges.

6. The method of claim 2, wherein, When the selected target strategy is the second target strategy, according to the second target strategy, a first macro behavior to be implemented by the agent role and a first additional condition to be met in a process of implementing the first macro behavior are determined, comprising: determining the first macro behavior to be implemented by the agent role according to the game data and a priority set for the macro behavior type; determining the first additional condition to be met by the agent role in the process of implementing the first macro behavior through a preconfigured planning table.

7. The method of claim 6, wherein, The planning table comprises a matching condition set corresponding to different additional conditions corresponding to a macro behavior type; The determination of the first additional condition to be met by the agent role in the process of implementing the first macro behavior through the preconfigured planning table comprises: when a current game situation represented by the game data meets a first matching condition in the matching condition set corresponding to different additional conditions corresponding to the first macro behavior, determining that the additional condition corresponding to the first macro behavior corresponding to the first matching condition is the first additional condition.

8. The method of claim 6, wherein, The planning table comprises an additional condition corresponding to a macro behavior type; The determination of the first additional condition to be met by the agent role in the process of implementing the first macro behavior through the preconfigured planning table comprises: determining that the additional condition corresponding to the first macro behavior in the planning table is the first additional condition.

9. The method of claim 1, wherein, The determination of the first behavior tree to be executed by the agent role based on the first macro behavior and the first additional condition comprises: in a behavior tree preconfigured for each combination of different macro behavior types and different additional conditions, determining that the behavior tree to be executed by the agent role is a first behavior tree preconfigured for the combination of the first macro behavior and the first additional condition.

10. The method of claim 9, wherein: the determination of the control operation preconfigured for the node of the first behavior tree in the preconfigured third strategy level comprises: In the preconfigured third policy level, a control operation preconfigured for a node of the first branch in the first behavior tree is determined.

11. The method of claim 10, wherein, The nodes of different branches of the same behavior tree are of the same structure, the behaviors represented by the nodes of the same position in different branches of the same behavior tree are of the same behavior type, and the preconfigured behavior parameters are different.

12. The method of claim 10, wherein, The nodes of different branches of the same behavior tree are of the same structure, the behaviors represented by the nodes of the same position in different branches of the same behavior tree are of different behavior types.

13. The method of claim 10, wherein, The nodes of different branches of the same behavior tree are of different structures.

14. The method of claim 10, wherein, The determining of the win rate of the agent role includes: Periodically determining the win rate of the agent role; The method further includes: When the agent role executes the first branch, if the win rate of the agent role changes from the first win rate range to a second win rate range in the different win rate range, the branch to be executed by the agent role in the first behavior tree is changed from the first branch to a second branch corresponding to the second win rate range in the first behavior tree, and the second branch is executed.

15. The method of claim 10, wherein, The determining of the win rate of the agent role includes: Determining the win rate of the agent role by a pre-trained second supervised learning model.

16. The method of claim 15, wherein, The training method of the second supervised learning model includes: Obtaining a second game data training sample and a game result sample label corresponding to the second game data training sample; Based on the second game data training sample and the game result sample label corresponding to the second game data training sample, the second supervised learning model is trained until the second supervised learning model converges.

17. The method of claim 1, wherein, The control of the agent role based on the control operation includes: For the agent role, a function interface corresponding to the control operation is called, and the function interface corresponding to the control operation is used to control the agent role to execute a virtual behavior corresponding to the control operation.

18. The method of claim 1, wherein, The game data includes in-game data and out-of-game data.

19. A device for controlling an intelligent agent character in a game, characterized in that, The device includes: A first control module for controlling an agent role to play a game with a user-controlled virtual role; A first determination module for determining, in a preconfigured first policy level, a first macro behavior to be implemented by the agent role and a first additional condition to be met in a process of implementing the first macro behavior based on game data by a pre-trained model or a preconfigured planning configuration table; the first macro behavior is one of the preconfigured macro behavior types in the first policy level, and the first additional condition is one of the preconfigured additional conditions in the first policy level. The second determining module is configured to determine, in a preconfigured second policy level, a first behavior tree to be executed by the agent role based on the first macro behavior and the first additional condition; the second policy level is a sub-level of the first policy level, and the first behavior tree is one of preconfigured behavior trees in the second policy level; the first behavior tree includes preconfigured branches corresponding to different win rate ranges; the second determining module further includes a win rate determining module configured to determine a win rate of the agent role; if the win rate of the agent role is in a first win rate range of the different win rate ranges, it is determined that a branch to be executed by the agent role in the first behavior tree is a first branch corresponding to the first win rate range in the first behavior tree; The third determining module is configured to determine, in a preconfigured third policy level, a control operation preconfigured for a node of the first behavior tree; the third policy level is a sub-level of the second policy level; The second control module is configured to control the agent role based on the control operation, so that the agent role executes the node of the first behavior tree, to implement the first macro behavior and meet the first additional condition in the process of implementing the first macro behavior.

20. An electronic device, comprising: The computer readable storage medium stores computer program instructions, and the computer program instructions are executed by the processor to implement the method for controlling an agent role in a game according to any one of claims 1 to 18. The computer readable storage medium stores computer program instructions, and the computer program instructions are executed by the processor to implement the method for controlling an agent role in a game according to any one of claims 1 to 18. The computer readable storage medium stores computer program instructions, and the computer program instructions are executed by the processor to implement the method for controlling an agent role in a game according to any one of claims 1 to 18.

21. A computer-readable storage medium, characterized in that, ​

Citation Information

Patent Citations

  • Method and device for generating battle fight type AI game model, equipment and medium

    CN112870722A

  • Intelligent virtual character control method and device, equipment and storage medium

    CN116459520A