Method and device for controlling virtual object in game, electronic equipment and storage medium

By using a target task selection model and a hierarchical deep reinforcement learning algorithm, the shortcomings of traditional state machines and deep reinforcement learning in team-based competitive game AI are addressed, achieving flexible and varied behaviors and low-cost training results.

CN118718399APending Publication Date: 2024-10-01NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310375570.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-30
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

Traditional state machine solutions result in rigid behavior of AI companions, making it difficult to accurately grasp macro-strategies on the battlefield. Deep reinforcement learning algorithms, on the other hand, consume a lot of computing power and time, leading to poor performance of game AI in team-based competitive gameplay.

Method used

A target task selection model is adopted, which directly determines the task to be executed based on the current game state information through a pre-trained deep neural network, replacing the trigger conditions and priority design of the traditional state machine. The strategy decision is optimized by combining a hierarchical deep reinforcement learning algorithm.

Benefits of technology

It improves the behavioral flexibility and battlefield situational awareness of game AI, reduces the training and exploration process, saves computing power and time costs, and makes the behavior more diverse and less easily recognized by players.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118718399A_ABST
    Figure CN118718399A_ABST
Patent Text Reader

Abstract

The invention provides a control method and device for a virtual object in a game, electronic equipment and a storage medium. The control method comprises the steps that first current game state information of a first virtual object is obtained; determining a to-be-executed first target game identifier based on the first current game state information through a target task selection model obtained through pre-training; and controlling the first virtual object to execute a task corresponding to the first target game identifier according to an object control strategy corresponding to the first target game identifier. According to the method, the expression flexibility of the virtual object and the computing power cost and the time cost required by development of the virtual object can be well considered.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of game technology, and in particular to a control method, device, electronic device and storage medium for a virtual object in a game. Background Art

[0002] At present, in team competition games, relevant technologies propose to develop companion robots through state machines or deep reinforcement learning. However, traditional state machine solutions are difficult to set trigger conditions for different states, and there are problems such as obvious macro-strategy routines, rigid / rigid behaviors of companion robots, and poor anthropomorphism. There are also situations where multiple robots close to each other often perform the same tasks in unison, which can be easily recognized by real players, affecting the player's gaming experience. Although companion robots based on deep reinforcement learning are more flexible and changeable in performance, they require a lot of exploration in complex game environments to obtain stable strategies, resulting in high computing power and time costs for robot development. Summary of the invention

[0003] In view of this, an object of the present invention is to provide a control method, device, electronic device and storage medium for virtual objects in a game, which can better balance the performance flexibility of virtual objects and the computing power cost and time cost required for the development of virtual objects.

[0004] In a first aspect, an embodiment of the present invention provides a method for controlling a virtual object in a game, comprising: obtaining first current game state information of a first virtual object; determining a first target game identifier to be executed based on the first current game state information through a target task selection model obtained through pre-training; and controlling the first virtual object to execute the task corresponding to the first target game identifier according to an object control strategy corresponding to the first target game identifier.

[0005] In a second aspect, an embodiment of the present invention further provides a control device for a virtual object in a game, comprising: an information acquisition module, used to obtain first current game state information of a first virtual object; a game identifier determination module, used to determine a first target game identifier to be executed based on the first current game state information through a target task selection model obtained through pre-training; and an object control module, used to control the first virtual object to execute the task corresponding to the first target game identifier according to an object control strategy corresponding to the first target game identifier.

[0006] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising a processor and a memory, wherein the memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement any one of the methods provided in the first aspect.

[0007] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement any one of the methods provided in the first aspect.

[0008] An embodiment of the present invention provides a method, device, electronic device and storage medium for controlling a virtual object in a game. First, the first current game state information of a first virtual object is obtained. Then, a target task selection model obtained through pre-training is used to determine a first target game identifier to be executed based on the first current game state information. Finally, according to the object control strategy corresponding to the first target game identifier, the first virtual object is controlled to execute the task corresponding to the first target game identifier. The above method replaces the trigger conditions and priority design in the traditional state machine with a target task selection model, so that the first virtual object determines the object control strategy according to the first current game state information. Specifically, the target task selection model determines the first target game identifier according to the first current game state information, so as to control the first virtual object to perform the corresponding task according to the object control strategy corresponding to the first target game identifier. Compared with the traditional state machine solution, the behavior of the first virtual object in the embodiment of the present invention is more flexible and changeable, and the grasp of the battlefield situation is more accurate. The behaviors of different first virtual objects are more independent and the performance is more diverse, and it is not easy for players to recognize them as robots. In addition, compared with the traditional reinforcement learning algorithm, the embodiment of the present invention no longer uses the most basic parameters such as skills, directions, and targets as decision results, but directly decides to perform a specific task, thereby effectively reducing the exploration process in the training of the first virtual object, saving a lot of computing power and time costs, and thus achieving the purpose of better balancing the flexibility of the performance of the virtual object and the computing power cost and time cost required for the development of the virtual object.

[0009] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description, claims and drawings.

[0010] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0012] Figure 1 A schematic diagram of a flow chart of a method for controlling a virtual object in a game provided by an embodiment of the present invention;

[0013] Figure 2 A schematic diagram of a flow chart of another method for controlling a virtual object in a game provided by an embodiment of the present invention;

[0014] Figure 3 A flowchart of a method for training a target task selection model provided by an embodiment of the present invention;

[0015] Figure 4 A schematic diagram of the structure of a control device for a virtual object in a game provided by an embodiment of the present invention;

[0016] Figure 5 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0017] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described in combination with the embodiments below. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0018] In existing team competition games, the state machine method is usually used to design the behavior strategy of the accompanying robot. In this type of method, it is necessary to first implement the execution logic of the robot's subtasks such as fighting, searching for enemies, and collecting resources through rule codes. For example, during the battle, according to the rule code, the robot uses damage skills to attack the target with the lowest health when the opponent is small, uses escape skills to move in the opposite direction when the opponent is large, and uses healing skills when its own health is lower than a certain percentage. On the basis of these basic strategies, the state machine algorithm is used to define multiple states for the robot. When it is in a certain state, a specific basic strategy is executed, and the trigger conditions and priorities of each state are specified. When multiple states are triggered at the same time, the current state of the robot is determined according to the priority. By setting reasonable trigger conditions and priorities, the robot can switch back and forth between multiple subtasks to complete the entire game.

[0019] In recent years, with the development of deep reinforcement learning algorithms, competitive game AI (Artificial Intelligence) based on deep reinforcement learning has begun to be widely used in various well-known electronic games, such as OpenAI Five in Dota2 and Juewu AI in King of Glory. To develop game AI based on deep reinforcement learning, it is necessary to collect a series of environmental states related to game AI decisions in the game, perform normalization and other data processing, and then input them into the deep neural network. The actions output by the network, that is, parameter information such as skills, directions, and target numbers, are returned to the robot, allowing the robot to perform specific actions, such as moving forward and using general attacks on target 1. Then, the reward is calculated based on the impact of the action on the game environment. The reward is generally obtained by weighted calculation of a series of indicators specified by the developer. The specific indicators may be data directly related to the robot's performance, such as win or loss, damage, and treatment, which are selected according to the gameplay logic. In the training process of game AI, each time such a decision process is completed, the relevant state, action, and reward will be stored as an experience sample to train the deep neural network, so that the long-term reward that can be brought by its decision-making will gradually increase. This is manifested in the game as the probability of the robot winning gradually increases, and indicators such as the damage and treatment amount in the game gradually increase. Through reasonable state, action and reward design as well as huge computing power, the performance of game AI can gradually meet the developers' expectations during training.

[0020] However, the above robot development scheme has the following problems: (1) The traditional state machine method is easy to design detailed and complete subtask execution rules, and the robot can usually complete the task accurately. However, due to the large number of factors affecting the macro strategy in the battlefield environment and the high randomness, it is usually difficult for developers to consider the appropriate trigger conditions for each task, resulting in the robot's difficulty in accurately grasping what to do under what circumstances in terms of macro strategy. For example, in combat, factors such as the number of enemies, occupations, combat power, skills carried, and health will affect the outcome of the battle. It is very difficult to fully consider such complex influencing factors, determine whether the battle can be won, and formulate a combat trigger condition. In addition, the use of the state machine method is likely to lead to the robot's behavior being solidified. Multiple robots close to each other often perform the same task in unison, which is easy to be recognized by real players. (2) Game robots based on deep reinforcement learning are more flexible and changeable in performance, but usually require a lot of computing power and time costs. Tasks that can be easily implemented through rule codes in traditional methods (such as moving to a specified location to submit resources) require robots to repeatedly explore the game environment thousands of times to learn stable strategies when using reinforcement learning algorithms. In complex multiplayer and multi-task team competitive gameplay, robots need to explore a wider and more random space, and the demand for computing power and development time is also greater.

[0021] Based on this, the present invention provides a method, device, electronic device and storage medium for controlling virtual objects in a game, which can better balance the performance flexibility of virtual objects and the computing power cost and time cost required for virtual object development.

[0022] In one embodiment of the present disclosure, the control method of the virtual object in the game can be run on a local terminal device or a server. When the control method of the virtual object in the game is run on the server, the method can be implemented and executed based on a cloud interaction system, wherein the cloud interaction system includes a server and a client device.

[0023] In an optional implementation, various cloud applications, such as cloud games, can be run under the cloud interaction system. Taking cloud games as an example, cloud games refer to a game mode based on cloud computing. In the operation mode of cloud games, the operating body of the game program and the main body of the game screen presentation are separated. The storage and operation of the control method of the virtual object in the game are completed on the cloud game server. The role of the client device is used for receiving and sending data and presenting the game screen. For example, the client device can be a display device with data transmission function close to the user side, such as a mobile terminal, a TV, a computer, a handheld computer, etc.; but the cloud game server in the cloud is used for information processing. When playing the game, the player operates the client device to send an operation instruction to the cloud game server. The cloud game server runs the game according to the operation instruction, encodes and compresses the game screen and other data, and returns it to the client device through the network. Finally, the client device decodes and outputs the game screen.

[0024] In an optional embodiment, taking a game as an example, a local terminal device stores a game program and is used to present a game screen. The local terminal device is used to interact with the player through a graphical user interface, that is, the game program is downloaded and installed by an electronic device and run conventionally. The local terminal device may provide the graphical user interface to the player in a variety of ways, for example, it may be rendered and displayed on a display screen of the terminal, or provided to the player through a holographic projection. For example, the local terminal device may include a display screen and a processor, the display screen is used to present a graphical user interface, the graphical user interface includes a game screen, and the processor is used to run the game, generate a graphical user interface, and control the display of the graphical user interface on the display screen.

[0025] In a possible implementation, an embodiment of the present disclosure provides a method for controlling a virtual object in a game, providing a graphical user interface through a terminal device, wherein the terminal device may be the local terminal device mentioned above, or may be a client device in the cloud interaction system mentioned above.

[0026] The technical solution of the present application is described in detail with specific embodiments below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.

[0027] To facilitate understanding of this embodiment, a method for controlling a virtual object in a game disclosed in an embodiment of the present invention is first described in detail. Figure 1 The flowchart of a method for controlling a virtual object in a game is shown in FIG. 1 , and the method mainly includes the following steps S102 to S106:

[0028] Step S102, obtaining the first current game state information of the first virtual object. The first virtual object is also the game AI or the companion robot, and the first current game state information is also the current game state information obtained in the model application stage, and the first current game state information includes the state information corresponding to the first virtual object, the state information corresponding to each virtual object of the same camp as the first virtual object (that is, the same camp virtual object), the state information corresponding to each virtual object of a different camp from the first virtual object (that is, the enemy camp virtual object), and the game match state.

[0029] Step S104, through the pre-trained target task selection model, determine the first target game identifier to be executed based on the first current game state information. Among them, the input of the target task selection model is the first current game state information, preferably the pre-processed first current game state information, and the output is at least one first candidate game identifier and the selection probability corresponding to each first candidate game identifier. In one embodiment, the pre-processed first current game state information can be input into the target task selection model, and the target task selection model outputs at least one first candidate game identifier and the selection probability corresponding to each first candidate game identifier, and then selects the first target game identifier from the first candidate game identifiers according to each selection probability.

[0030] Step S106, according to the object control strategy corresponding to the first target game identifier, control the first virtual object to perform the task corresponding to the first target game identifier. The object control strategy is used to define the various steps that need to be performed when the first virtual object performs the task. In one embodiment, the mapping relationship between each first candidate game identifier and the object control strategy can be pre-configured, so that the object control strategy corresponding to the first target game identifier is determined based on the mapping relationship, and the first virtual object is controlled according to the various steps defined in the object control strategy, so that the first virtual object can perform the task corresponding to the first target game identifier.

[0031] The control method of a virtual object provided in an embodiment of the present invention replaces the trigger conditions and priority design in a traditional state machine by a target task selection model, so that the first virtual object determines the object control strategy according to the first current game state information. Specifically, the target task selection model determines the first target game identifier according to the first current game state information, so as to control the first virtual object to perform the corresponding task according to the object control strategy corresponding to the first target game identifier. Compared with the traditional state machine solution, the behavior of the first virtual object in the embodiment of the present invention is more flexible and changeable, and the grasp of the battlefield situation is more accurate. The behaviors of different first virtual objects are more independent and the performance is more diverse, and it is not easy for players to recognize them as robots. In addition, compared with the traditional reinforcement learning algorithm, the embodiment of the present invention no longer uses the most basic parameters such as skills, directions, and targets as decision results, but directly decides to perform a specific task, thereby effectively reducing the exploration process in the training of the first virtual object, saving a lot of computing power and time costs, and thus achieving the purpose of better balancing the flexibility of the performance of the virtual object and the computing power cost and time cost required for the development of the virtual object.

[0032] In order to facilitate the target task selection model to extract and output a more reasonable first candidate game identifier, the first current game state information can be preprocessed before the first game state information is input into the target task selection model, and then the preprocessed first current game state information is input into the target task selection model, and the target task selection model determines the first target game identifier to be executed based on the preprocessed first current game state information. The first current game state information includes state information corresponding to the first virtual object, state information corresponding to each virtual object of the same camp as the first virtual object, state information corresponding to each virtual object of a different camp from the first virtual object, and game match state. Exemplarily, the status information corresponding to the first virtual object, that is, the status of the first virtual object itself, may include position, health, and other information related to the gameplay; the status information corresponding to each virtual object of the same camp as the first virtual object, that is, the status of other player characters or robots in the same camp, may also include position, health, and other information related to the gameplay; the status information corresponding to each virtual object of a different camp from the first virtual object, that is, the status of other player characters or robots in the enemy camp, may also include position, health, and other information related to the gameplay; the game status may include information such as items / supplies / resources, environment, and neutral units on the battlefield.

[0033] In one embodiment, preprocessing includes one or more of numerical normalization processing, numerical range restriction processing, and position information conversion processing. Specifically: (1) Numerical normalization processing is to normalize values ​​such as blood volume. Taking blood volume as an example, the current blood volume of the first virtual character can be divided by the maximum blood volume of the first virtual character as the blood volume information finally input into the target task selection model. (2) Numerical range restriction processing is to limit the range of values ​​without clear upper / lower limits. For example, based on game data, when the values ​​exceed the common numerical range, the normalized upper and lower limits of the range are directly used as the input of the target task selection model. (3) Position information conversion processing is to convert the position information of virtual objects other than the first virtual object into relative distance information relative to the first virtual character itself that calls the target task selection model.

[0034] In one embodiment, the target task selection model includes a main neural network and at least one sub-neural network, and the sub-neural network corresponds to the first current game state information one by one. Exemplarily, the target task selection model includes four sub-neural networks, and the state of the first virtual object itself, the state of each virtual object in the same camp, the state of each virtual object in different camps, and the game state are respectively input into the four sub-neural networks, and the four sub-neural networks respectively extract the high-dimensional state features of each state information, and then splice the high-dimensional state features output by the four sub-neural networks, and input the obtained spliced ​​state features into the main neural network, and the main neural network performs task selection according to the spliced ​​state features, and outputs each first candidate game identifier and its selection probability.

[0035] Specifically, after preprocessing the first current game state information, the preprocessed first current game state information can be input into the target task selection model to determine the first target game identifier to be executed based on the target task selection model. In the specific implementation, refer to the following steps 1 to 2:

[0036] Step 1, through the target task selection model obtained by pre-training, based on the first current game state information, determine at least one first candidate game identifier and the selection probability corresponding to each first candidate game identifier. In one embodiment, each of the above-mentioned types of first current game state information is input into a corresponding sub-neural network, and the outputs of the sub-neural networks are spliced ​​and input into the main neural network, and finally the main neural network outputs each first candidate game identifier and its selection probability. Exemplarily, the above-mentioned first current game state information includes four types of state information (including self-state information, same-camp player or robot state information, enemy camp player or robot state information, game match state), so 4 sub-neural networks and 1 main neural network can be set.

[0037] Based on this, an embodiment of the present invention provides an implementation method of determining at least one first candidate game identifier and the selection probability corresponding to each first candidate game identifier based on the first current game state information through a target task selection model, specifically:

[0038] (i) Extracting the state features of each first current game state information through each sub-neural network. The input of the sub-neural network is a type of state information in the first current game state information, and the output is the state features corresponding to the type of state information. Exemplarily, it is assumed that the target task selection model includes a main neural network, a first sub-neural network, a second sub-neural network, a third sub-neural network and a fourth sub-neural network, wherein the first sub-neural network extracts the high-dimensional state features of the state of the first virtual object itself, the second sub-neural network extracts the high-dimensional state features of the state of each virtual object in the same camp, the third sub-neural network extracts the high-dimensional state features of the state of each virtual object in different camps, and the fourth sub-neural network extracts the high-dimensional state features of the game game state.

[0039] (ii) Perform feature splicing on each state feature to obtain the spliced ​​state feature.

[0040] (III) Determine at least one first candidate game identifier and the selection probability corresponding to each first candidate game identifier based on the post-splicing state feature through the main neural network, wherein the input of the main neural network is the post-splicing state feature, and the output is at least one first candidate game identifier and its selection probability.

[0041] Step 2, determine the first target game identifier from the first candidate game identifiers according to the selection probability. The first candidate game identifier includes a game identifier or an interrupt game identifier. The task corresponding to the game identifier is also a related task in the game, such as collecting resources, fighting, escaping, etc. The task corresponding to the interrupt game identifier is to interrupt the task currently being executed. In one embodiment, the first target game identifier can be selected from the first candidate game identifiers according to the maximum selection probability.

[0042] For ease of understanding, the embodiments of the present invention also provide an implementation method for controlling the first virtual object to perform the task corresponding to the first target game identifier according to the object control strategy corresponding to the first target game identifier, respectively for the game identifier or the interrupted game identifier, see the following methods 1 to 2:

[0043] Method 1: Game ID, see steps a1 to a2 below:

[0044] Step a1, if the first target game identifier is a game identifier, and the first virtual object is in an idle state, then determine the object control strategy corresponding to the first target game identifier from the pre-configured object control strategies. Among them, the idle state is the state in which the first virtual object is not currently executing a task. The object control strategy needs to pre-determine the execution strategy of the task based on various single tasks involved in the gameplay using methods such as behavior trees. For example: the gameplay requires the first virtual object to collect resources (minerals, materials, etc.) and submit them to a designated location. Based on the experience of human players, the first virtual object can be made to act according to the following steps: find the nearest resource -> move to the location of the resource -> collect resources -> find the submission point -> move to the submission point -> submit resources. Among the pre-configured multiple object control strategies, select the object control strategy that matches the first target game identifier based on the mapping relationship.

[0045] Step a2, control the first virtual object to execute the task corresponding to the first target game identifier until the pre-configured task deadline condition is met. Among them, the task deadline condition includes that the task corresponding to the first target game identifier is completed, or the game scene where the first virtual object is located does not meet the execution condition of the task corresponding to the first target game identifier. For example, assuming that the task is to collect resources, if the resources can no longer be found in the game scene, it is determined that the execution condition of the task corresponding to the first target game identifier is not met. In actual application, if the first virtual object selects a game task and there is no task currently being executed, the first virtual object will execute the task according to the corresponding object control strategy until the task is completed, or other factors appear in the game scene that make the task impossible to complete. Take the task of collecting resources as an example: the first virtual object needs to execute according to the strategy until the resource submission is successful, or the resource can no longer be found in the game scene. After the current task is completed, the first virtual object will immediately select the task to be executed next through the target task selection model again.

[0046] Method 2: Game interruption game identifier: If the first target game identifier is an interruption game identifier, the first virtual object is controlled to interrupt the currently executed task so that the first virtual object is in an idle state. In actual applications, if the first virtual object chooses to interrupt the task, the first virtual object will immediately stop executing the task and immediately select the next task to be executed through the target task selection model again. Interrupting tasks is usually to cope with changes in the battlefield, resulting in situations where it is not suitable to continue to execute the current task. For example, if you encounter a player or robot from the enemy camp during the process of collecting resources, you should stop the resource collection action at this time and choose to fight or escape according to your own and the opponent's status.

[0047] In one embodiment, the first current game state information can be updated in real time; the target task selection model is continued to be used to determine the next first target game identifier to be executed based on the updated first current game state information; and the first virtual object is controlled to execute the task corresponding to the next first target game identifier according to the object control strategy corresponding to the next first target game identifier. In practical applications, the first current game state information of the first virtual object can be collected and updated in real time, so as to respond to complex battlefield changes in a timely manner. Among them, the above-mentioned process of determining the next first target game identifier using the target task selection model, and controlling the first virtual object to execute the task according to the object control strategy corresponding to the next first target game identifier, can be referred to the aforementioned embodiment, and the embodiment of the present invention will not be repeated.

[0048] To facilitate understanding of the above embodiments, the present invention provides another method for controlling a virtual object in a game. Figure 2 The flowchart of another method for controlling a virtual object in a game is shown in FIG. 1 , and the method mainly includes the following steps S202 to S208:

[0049] Step S202, based on various single tasks involved in the gameplay, a task execution strategy is pre-set using a behavior tree or other method.

[0050] Step S204, pre-process the current game state information, input it into the target task selection model, and select a task according to the output result of the target task selection model, wherein the output result is at least one first candidate game identifier and its selection probability.

[0051] Step S206: If the first virtual object selects a game task and the first virtual object has no currently executing task, the first virtual object executes the task according to the execution strategy.

[0052] Step S208: If the first virtual object chooses to interrupt the task, the task being executed by the first virtual object is immediately stopped. Steps S204 to S208 are repeated until the game ends.

[0053] The embodiment of the present invention is improved on the basis of the layered deep reinforcement learning algorithm combined with the traditional state machine method. The trigger conditions and priority design in the state machine are replaced by the deep reinforcement learning algorithm, so that the first virtual object determines the underlying strategy according to the environmental state. Specifically, the embodiment of the present invention uses the proposed technical solution. The first virtual object needs to obtain the current environmental state at each decision, and input it into the deep neural network after normalization and other data processing. The network output is no longer a specific skill, direction, target and other action parameters, but a specific subtask instruction, such as fighting, escaping, collecting supplies, etc. According to the instructions output by the network, the robot executes the corresponding subtask according to the pre-implemented rule code until the task is completed, or the upper layer gives a new instruction to interrupt the current subtask and start executing a new subtask. The embodiment of the present invention can avoid the shortcomings of the state machine method and the reinforcement learning method, while improving the performance of the first virtual object and reducing the computing power and time cost in development as much as possible.

[0054] The target task selection model used in the embodiment of the present invention is a deep neural network trained based on a deep reinforcement learning algorithm. Specifically, the reinforcement learning algorithm is a machine learning algorithm that relies on environmental feedback to learn in a Markov decision environment, optimizes the behavior strategy of the agent, and improves the long-term cumulative reward of the decision. The agent may be a person, a robot, a decision module in a program, or any other entity that formulates a strategy based on the current state of the environment. The agent using reinforcement learning observes the current state of the environment, and after data processing such as discretization and normalization, inputs it into the decision model. According to the result output by the decision model, an execution is selected from the preset action set, and the reward of this decision is calculated by observing the changes in the environment after execution. The state, action, and reward of each decision are collected, and the decision model is optimized according to the reinforcement learning algorithm. The deep reinforcement learning algorithm is the product of the combination of deep learning and reinforcement learning. Its characteristics are that a deep neural network is used as a policy model, and the deep neural network is used to effectively extract the state characteristics of the input to cope with complex environments. Hierarchical deep reinforcement learning is a special type of deep reinforcement learning algorithm proposed based on human thinking habits. Faced with complex environments, the hierarchical deep reinforcement learning algorithm divides strategies into multiple levels. The upper level determines the macro-strategy direction, and then the lower level determines the detailed execution strategy. For example, in a real-time strategy game, the player first makes strategic decisions such as attack or retreat, and when choosing to attack, he further decides on the specific allocation of troops and attack location, etc.

[0055] For ease of understanding, the embodiment of the present invention further provides a method for training a target task selection model, which may be specifically referred to in steps a to e below:

[0056] Step a, obtaining the second current game state information of each second virtual object in the specified game scene. The second virtual object is also the robot in the model training stage, and the second current game state information is also the current game state information of the robot in the training stage. The second current game state information may also include the state information corresponding to the second virtual object, the state information corresponding to each virtual object in the same camp as the second virtual object (that is, virtual objects in the same camp), the state information corresponding to each virtual object in a different camp from the second virtual object (that is, virtual objects in the enemy camp), and the game match state. In one embodiment, each robot (regardless of the camp) in the specified game scene independently collects the corresponding second current game state information.

[0057] Step b, determining at least one second candidate game identifier and the selection probability corresponding to each second candidate game identifier based on the second current game state information through the initial task selection model. In one embodiment, the processed second current game state information can be input into the initial task selection model so that the initial task selection model outputs at least one second candidate game identifier and its selection probability.

[0058] Step c: randomly determine the second target game identifier from the second candidate game identifiers. In one embodiment, the second target game identifier can be randomly determined from the second candidate game identifiers output by the initial task selection model according to the selection probability.

[0059] Step d, according to the object control strategy corresponding to the second target game identifier, control the second virtual object to execute the task corresponding to the second target game identifier. In one embodiment, the task can be executed or the task can be interrupted and re-decided according to the above-mentioned method 1 or method 2, which will not be described in detail in the embodiment of the present invention.

[0060] Step e, when the task corresponding to the second target game identifier is completed, determine the task execution reward, and train the initial task selection model based on the task execution reward to obtain the target task selection model. In one embodiment, after each decision, the second virtual object calculates the reward based on indicators such as the score obtained after the task is executed, and inputs the reward into the loss function to obtain the loss value corresponding to this task, and updates the network parameters of the initial task selection model based on the loss value. Repeat the above process until the initial task selection model meets the preset requirements, and the required target task selection model can be obtained, wherein the preset requirements can be reaching a specified number of iterations or the loss value converges. Optionally, the status of this decision, the tasks executed, and the rewards obtained can be organized into an experience and stored on a storage device. Exemplarily, in the process of collecting resources, the status information of the virtual objects of the hostile camp is collected. If the initial task selection network outputs a resource collection game identifier and controls the second virtual object to perform the task corresponding to the resource collection game identifier, the reward value is low, resulting in a higher calculated loss value; if the initial task selection network outputs an escape game identifier and controls the second virtual object to perform the task corresponding to the escape game identifier, the reward value is high, resulting in a lower calculated loss value. The back propagation and gradient descent algorithms are used to train the initial task selection model according to the calculated loss value.

[0061] For ease of understanding, the present invention provides another training method for the target task selection model, see Figure 3 The flowchart of a training method for a target task selection model shown in FIG. 1 mainly includes the following steps S302 to S308:

[0062] Step S302, determine the network structure of each sub-neural network and the main neural network according to the dimensions of various types of current game status information input, and randomly initialize the network parameters.

[0063] Step S304, independently collect the second current game state information of each robot in the battlefield, input it into the initial task selection model after preprocessing, randomly determine the second target game identifier from each second candidate game identifier output by the initial task selection model, and execute the task or interrupt the task to make a new decision.

[0064] Step S306: After each decision, the robot calculates a reward based on indicators such as the score obtained after task execution, and stores the reward as experience on a storage device.

[0065] Step S308, after gaining experience, the robot updates the network parameters of the initial task selection model according to the deep reinforcement learning algorithm to obtain the target task selection model.

[0066] In summary, the embodiment of the present invention combines robots developed based on the traditional state machine method and the general deep reinforcement learning algorithm. The macro-upper-level strategy is determined by the reinforcement learning algorithm, and the specific tasks are completed by the rule code. Compared with the traditional state machine method, the proposed technical solution does not require the manual design of the trigger conditions and priorities of various subtasks. The embodiment of the present invention makes the robot development no longer require developers to have a very deep understanding of the game and be very familiar with the game values. Compared with the state machine method, the behavior of the robot is more flexible and changeable, the grasp of the battlefield situation is more accurate, the behavior between different robots is more independent, the performance is more diverse, and it is not easy for players to recognize it as a robot. On the other hand, compared with the general reinforcement learning algorithm, the proposed solution no longer uses the most basic parameters such as skills, directions, and goals as decision results, but directly decides to perform a specific task. This can effectively reduce the exploration process in robot training and save a lot of computing power and time costs.

[0067] Regarding the control method of the virtual object in the game provided by the above embodiment, the embodiment of the present invention provides a control device for the virtual object in the game, see Figure 4 The structure diagram of a control device for a virtual object in a game is shown, and the device mainly includes the following parts:

[0068] An information acquisition module 402 is used to acquire first current game state information of a first virtual object;

[0069] A game identifier determination module 404 is used to determine a first target game identifier to be executed based on the first current game state information by using a pre-trained target task selection model;

[0070] The object control module 406 is used to control the first virtual object to execute the task corresponding to the first target game identifier according to the object control strategy corresponding to the first target game identifier.

[0071] The control device for virtual objects in the game provided by the embodiment of the present invention replaces the trigger conditions and priority design in the traditional state machine through the target task selection model, so that the first virtual object determines the object control strategy according to the first current game state information. Specifically, the target task selection model determines the first target game identifier according to the first current game state information, so as to control the first virtual object to perform the corresponding task according to the object control strategy corresponding to the first target game identifier. Compared with the traditional state machine solution, the behavior of the first virtual object in the embodiment of the present invention is more flexible and changeable, and the grasp of the battlefield situation is more accurate. The behaviors of different first virtual objects are more independent and the performance is more diverse, and it is not easy for players to recognize them as robots. In addition, compared with the traditional reinforcement learning algorithm, the embodiment of the present invention no longer uses the most basic parameters such as skills, directions, and targets as decision results, but directly decides to perform a specific task, thereby effectively reducing the exploration process in the training of the first virtual object, saving a lot of computing power and time costs, and thus achieving the purpose of better balancing the flexibility of the performance of the virtual object and the computing power cost and time cost required for the development of the virtual object.

[0072] In one embodiment, the above-mentioned device also includes a preprocessing module, which is used to: preprocess the first current game state information; the game identifier determination module 404 is also used to: input the preprocessed first current game state information into the target task selection model, and determine the first target game identifier to be executed based on the preprocessed first current game state information through the target task selection model; the preprocessing includes one or more of numerical normalization processing, numerical range limitation processing, and position information conversion processing.

[0073] In one embodiment, the game identifier determination module 404 is also used to: determine at least one first candidate game identifier and the selection probability corresponding to each first candidate game identifier based on the first current game state information through a pre-trained target task selection model; and determine the first target game identifier from the first candidate game identifiers according to the selection probability.

[0074] In one embodiment, the target task selection model includes a main neural network and at least one sub-neural network, and the sub-neural network corresponds one-to-one to the first current game state information; the game identifier determination module 404 is also used to: extract the state features of each first current game state information respectively through each sub-neural network; perform feature splicing on each state feature to obtain a spliced ​​state feature; and determine at least one first candidate game identifier and the selection probability corresponding to each first candidate game identifier based on the spliced ​​state feature through the main neural network.

[0075] In one embodiment, the above-mentioned device also includes a training module, which is used to: obtain the second current game state information of each second virtual object in the specified game scene; determine at least one second candidate game identifier and the selection probability corresponding to each second candidate game identifier based on the second current game state information through the initial task selection model; randomly determine the second target game identifier from the second candidate game identifiers; control the second virtual object to perform the task corresponding to the second target game identifier according to the object control strategy corresponding to the second target game identifier; when the task corresponding to the second target game identifier is completed, determine the task execution reward, and train the initial task selection model based on the task execution reward to obtain the target task selection model.

[0076] In one embodiment, the object control module 406 is also used for: if the first target game identifier is a game identifier and the first virtual object is in an idle state, then determining the object control strategy corresponding to the first target game identifier from the pre-configured object control strategies; wherein the idle state is a state in which the first virtual object is not currently executing a task; controlling the first virtual object to execute the task corresponding to the first target game identifier until a pre-configured task deadline condition is met; wherein the task deadline condition includes that the task corresponding to the first target game identifier is completed, or that the game scene in which the first virtual object is located does not meet the execution condition of the task corresponding to the first target game identifier.

[0077] In one implementation, the object control module 406 is further configured to: if the first target game identifier is an interrupt game identifier, control the first virtual object to interrupt the currently executed task, so that the first virtual object is in an idle state.

[0078] In one embodiment, the above-mentioned device also includes an update module, which is used to: update the first current game state; continue to determine the next first target game identifier to be executed based on the updated first current game state through the target task selection model; and control the first virtual object to execute the task corresponding to the next first target game identifier according to the object control strategy corresponding to the next first target game identifier.

[0079] In one embodiment, the first current game status information includes status information corresponding to the first virtual object, status information corresponding to each virtual object of the same camp as the first virtual object, status information corresponding to each virtual object of a different camp from the first virtual object, and game status.

[0080] The device provided in the embodiment of the present invention has the same implementation principle and technical effects as those of the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference may be made to the corresponding contents in the aforementioned method embodiment.

[0081] An embodiment of the present invention provides an electronic device. Specifically, the electronic device includes a processor and a storage device. The storage device stores a computer program. When the computer program is run by the processor, it executes:

[0082] A method for controlling a virtual object in a game comprises: obtaining first current game state information of a first virtual object; determining a first target game identifier to be executed based on the first current game state information through a target task selection model obtained through pre-training; and controlling the first virtual object to execute a task corresponding to the first target game identifier according to an object control strategy corresponding to the first target game identifier.

[0083] In one embodiment, after obtaining the first current game state information of the first virtual object, the method also includes: preprocessing the first current game state information; the target task selection model obtained through pre-training determines the first target game identifier to be executed based on the first current game state information, including: inputting the preprocessed first current game state information into the target task selection model, and determining the first target game identifier to be executed based on the preprocessed first current game state information through the target task selection model; the preprocessing includes one or more of numerical normalization processing, numerical range limitation processing, and position information conversion processing.

[0084] In one embodiment, a target task selection model obtained through pre-training is used to determine a first target game identifier to be executed based on first current game state information, including: determining at least one first candidate game identifier and a selection probability corresponding to each first candidate game identifier based on first current game state information through a target task selection model obtained through pre-training; and determining a first target game identifier from the first candidate game identifiers according to the selection probability.

[0085] In one embodiment, the target task selection model includes a main neural network and at least one sub-neural network, and the sub-neural network corresponds one-to-one to the first current game state information; the target task selection model obtained by pre-training determines at least one first candidate game identifier and the selection probability corresponding to each first candidate game identifier based on the first current game state information, including: extracting the state features of each first current game state information respectively through each sub-neural network; performing feature splicing on each state feature to obtain a spliced ​​state feature; and determining at least one first candidate game identifier and the selection probability corresponding to each first candidate game identifier based on the spliced ​​state feature through the main neural network.

[0086] In one embodiment, the pre-training process includes: obtaining the second current game state information of each second virtual object in the specified game scene; determining at least one second candidate game identifier and the selection probability corresponding to each second candidate game identifier based on the second current game state information through the initial task selection model; randomly determining the second target game identifier from the second candidate game identifiers; controlling the second virtual object to perform the task corresponding to the second target game identifier according to the object control strategy corresponding to the second target game identifier; when the task corresponding to the second target game identifier is completed, determining the task execution reward, and training the initial task selection model based on the task execution reward to obtain the target task selection model.

[0087] In one embodiment, according to the object control strategy corresponding to the first target game identifier, the first virtual object is controlled to execute the task corresponding to the first target game identifier, including: if the first target game identifier is a game identifier and the first virtual object is in an idle state, then the object control strategy corresponding to the first target game identifier is determined from pre-configured object control strategies; wherein the idle state is a state in which the first virtual object is not currently executing a task; the first virtual object is controlled to execute the task corresponding to the first target game identifier until a pre-configured task deadline condition is met; wherein the task deadline condition includes that the task corresponding to the first target game identifier is completed, or the game scene in which the first virtual object is located does not meet the execution condition of the task corresponding to the first target game identifier.

[0088] In one embodiment, according to the object control strategy corresponding to the first target game identifier, controlling the first virtual object to execute the task corresponding to the first target game identifier also includes: if the first target game identifier is an interrupt game identifier, controlling the first virtual object to interrupt the currently executing task so that the first virtual object is in an idle state.

[0089] In one embodiment, after controlling the first virtual object to execute the task corresponding to the first target game identifier according to the object control strategy corresponding to the first target game identifier, the method also includes: updating the first current game state; continuing to determine the next first target game identifier to be executed based on the updated first current game state through the target task selection model; and controlling the first virtual object to execute the task corresponding to the next first target game identifier according to the object control strategy corresponding to the next first target game identifier.

[0090] In one embodiment, the first current game status information includes status information corresponding to the first virtual object, status information corresponding to each virtual object of the same camp as the first virtual object, status information corresponding to each virtual object of a different camp from the first virtual object, and game status.

[0091] The electronic device provided by the embodiment of the present invention replaces the trigger conditions and priority design in the traditional state machine with a target task selection model, so that the first virtual object determines the object control strategy according to the first current game state information. Specifically, the target task selection model determines the first target game identifier according to the first current game state information, so as to control the first virtual object to perform the corresponding task according to the object control strategy corresponding to the first target game identifier. Compared with the traditional state machine solution, the behavior of the first virtual object in the embodiment of the present invention is more flexible and changeable, and the grasp of the battlefield situation is more accurate. The behaviors of different first virtual objects are more independent and the performance is more diverse, and it is not easy for players to recognize them as robots. In addition, compared with the traditional reinforcement learning algorithm, the embodiment of the present invention no longer uses the most basic parameters such as skills, directions, and targets as decision results, but directly decides to perform a specific task, thereby effectively reducing the exploration process in the training of the first virtual object, saving a lot of computing power and time costs, and thus achieving the purpose of better balancing the flexibility of the performance of the virtual object and the computing power cost and time cost required for the development of the virtual object.

[0092] Figure 5 A structural diagram of an electronic device provided in an embodiment of the present invention, the electronic device 100 includes: a processor 50, a memory 51, a bus 52 and a communication interface 53, wherein the processor 50, the communication interface 53 and the memory 51 are connected via the bus 52; the processor 50 is used to execute an executable module stored in the memory 51, such as a computer program.

[0093] The memory 51 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk memory. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 53 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used.

[0094] The bus 52 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0095] Among them, the memory 51 is used to store programs, and the processor 50 executes the program after receiving the execution instruction. The method executed by the device for flow process definition disclosed in any embodiment of the above-mentioned embodiment of the present invention can be applied to the processor 50 or implemented by the processor 50.

[0096] The processor 50 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 50. The above processor 50 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in the embodiments of the present invention can be directly embodied as a hardware decoding processor to be executed, or can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 51, and the processor 50 reads the information in the memory 51 and completes the steps of the above method in combination with its hardware.

[0097] The computer program product of a readable storage medium provided in an embodiment of the present invention includes a computer readable storage medium storing program code, and the instructions included in the program code can be used to execute:

[0098] A method for controlling a virtual object in a game comprises: obtaining first current game state information of a first virtual object; determining a first target game identifier to be executed based on the first current game state information through a target task selection model obtained through pre-training; and controlling the first virtual object to execute a task corresponding to the first target game identifier according to an object control strategy corresponding to the first target game identifier.

[0099] In one embodiment, after obtaining the first current game state information of the first virtual object, the method also includes: preprocessing the first current game state information; the target task selection model obtained through pre-training determines the first target game identifier to be executed based on the first current game state information, including: inputting the preprocessed first current game state information into the target task selection model, and determining the first target game identifier to be executed based on the preprocessed first current game state information through the target task selection model; the preprocessing includes one or more of numerical normalization processing, numerical range limitation processing, and position information conversion processing.

[0100] In one embodiment, a target task selection model obtained through pre-training is used to determine a first target game identifier to be executed based on first current game state information, including: determining at least one first candidate game identifier and a selection probability corresponding to each first candidate game identifier based on first current game state information through a target task selection model obtained through pre-training; and determining a first target game identifier from the first candidate game identifiers according to the selection probability.

[0101] In one embodiment, the target task selection model includes a main neural network and at least one sub-neural network, and the sub-neural network corresponds one-to-one to the first current game state information; the target task selection model obtained by pre-training determines at least one first candidate game identifier and the selection probability corresponding to each first candidate game identifier based on the first current game state information, including: extracting the state features of each first current game state information respectively through each sub-neural network; performing feature splicing on each state feature to obtain a spliced ​​state feature; and determining at least one first candidate game identifier and the selection probability corresponding to each first candidate game identifier based on the spliced ​​state feature through the main neural network.

[0102] In one embodiment, the pre-training process includes: obtaining the second current game state information of each second virtual object in the specified game scene; determining at least one second candidate game identifier and the selection probability corresponding to each second candidate game identifier based on the second current game state information through the initial task selection model; randomly determining the second target game identifier from the second candidate game identifiers; controlling the second virtual object to perform the task corresponding to the second target game identifier according to the object control strategy corresponding to the second target game identifier; when the task corresponding to the second target game identifier is completed, determining the task execution reward, and training the initial task selection model based on the task execution reward to obtain the target task selection model.

[0103] In one embodiment, according to the object control strategy corresponding to the first target game identifier, the first virtual object is controlled to execute the task corresponding to the first target game identifier, including: if the first target game identifier is a game identifier and the first virtual object is in an idle state, then the object control strategy corresponding to the first target game identifier is determined from pre-configured object control strategies; wherein the idle state is a state in which the first virtual object is not currently executing a task; the first virtual object is controlled to execute the task corresponding to the first target game identifier until a pre-configured task deadline condition is met; wherein the task deadline condition includes that the task corresponding to the first target game identifier is completed, or the game scene in which the first virtual object is located does not meet the execution condition of the task corresponding to the first target game identifier.

[0104] In one embodiment, according to the object control strategy corresponding to the first target game identifier, controlling the first virtual object to execute the task corresponding to the first target game identifier also includes: if the first target game identifier is an interrupt game identifier, controlling the first virtual object to interrupt the currently executing task so that the first virtual object is in an idle state.

[0105] In one embodiment, after controlling the first virtual object to execute the task corresponding to the first target game identifier according to the object control strategy corresponding to the first target game identifier, the method also includes: updating the first current game state; continuing to determine the next first target game identifier to be executed based on the updated first current game state through the target task selection model; and controlling the first virtual object to execute the task corresponding to the next first target game identifier according to the object control strategy corresponding to the next first target game identifier.

[0106] In one embodiment, the first current game status information includes status information corresponding to the first virtual object, status information corresponding to each virtual object of the same camp as the first virtual object, status information corresponding to each virtual object of a different camp from the first virtual object, and game status.

[0107] The readable storage medium provided by the embodiment of the present invention replaces the trigger conditions and priority design in the traditional state machine through the target task selection model, so that the first virtual object determines the object control strategy according to the first current game state information. Specifically, the target task selection model determines the first target game identifier according to the first current game state information, so as to control the first virtual object to perform the corresponding task according to the object control strategy corresponding to the first target game identifier. Compared with the traditional state machine solution, the behavior of the first virtual object in the embodiment of the present invention is more flexible and changeable, and the grasp of the battlefield situation is more accurate. The behaviors of different first virtual objects are more independent and the performance is more diverse, and it is not easy for players to recognize them as robots. In addition, compared with the traditional reinforcement learning algorithm, the embodiment of the present invention no longer uses the most basic parameters such as skills, directions, and targets as decision results, but directly decides to perform a specific task, thereby effectively reducing the exploration process in the training of the first virtual object, saving a lot of computing power and time costs, and thus achieving the purpose of better balancing the flexibility of the performance of the virtual object and the computing power cost and time cost required for the development of the virtual object.

[0108] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.

[0109] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims

1. A method for controlling a virtual object in a game, characterized in that: include: Obtaining first current game state information of a first virtual object; Determine the first target game identifier to be executed based on the first current game state information by using the target task selection model obtained by pre-training; According to the object control strategy corresponding to the first target game identifier, the first virtual object is controlled to execute the task corresponding to the first target game identifier.

2. The method for controlling a virtual object in a game according to claim 1, characterized in that: After obtaining the first current game state information of the first virtual object, the method further includes: Preprocessing the first current game state information; The target task selection model obtained through pre-training determines the first target game identifier to be executed based on the first current game state information, including: Inputting the preprocessed first current game state information into the target task selection model, and determining the first target game identifier to be executed based on the preprocessed first current game state information through the target task selection model; The preprocessing includes one or more of a numerical normalization process, a numerical range restriction process, and a position information conversion process.

3. The method for controlling a virtual object in a game according to claim 1, characterized in that: The target task selection model obtained by pre-training determines the first target game identifier to be executed based on the first current game state information, and further includes: Determine, by means of a pre-trained target task selection model, at least one first candidate game identifier and a selection probability corresponding to each first candidate game identifier based on the first current game state information; A first target game identifier is determined from the first candidate game identifiers according to the selection probability.

4. The method for controlling a virtual object in a game according to claim 3, characterized in that: The target task selection model includes a main neural network and at least one sub-neural network, and the sub-neural network corresponds to the first current game state information one by one; Determining at least one first candidate game identifier and a selection probability corresponding to each first candidate game identifier based on the first current game state information through a pre-trained target task selection model, including: Extracting state features of each of the first current game state information respectively through each of the sub-neural networks; Performing feature splicing on each of the state features to obtain a spliced ​​state feature; At least one first candidate game identifier and a selection probability corresponding to each first candidate game identifier are determined based on the post-splicing state feature through the main neural network.

5. The method for controlling a virtual object in a game according to claim 3, characterized in that: The pre-training process includes: Obtaining second current game state information of each second virtual object in the specified game scene; Determine, by means of an initial task selection model, at least one second candidate game identifier and a selection probability corresponding to each second candidate game identifier based on the second current game state information; Randomly determine a second target game identifier from the second candidate game identifiers according to a selection probability; According to the object control strategy corresponding to the second target game identifier, control the second virtual object to execute the task corresponding to the second target game identifier; When the task corresponding to the second target game identifier is completed, a task execution reward is determined, and the initial task selection model is trained based on the task execution reward to obtain a target task selection model.

6. The method for controlling a virtual object in a game according to claim 1, characterized in that: According to the object control strategy corresponding to the first target game identifier, controlling the first virtual object to execute the task corresponding to the first target game identifier includes: If the first target game identifier is a game identifier, and the first virtual object is in an idle state, determining an object control strategy corresponding to the first target game identifier from pre-configured object control strategies; wherein the idle state is a state in which the first virtual object is currently not executing a task; Controlling the first virtual object to execute the task corresponding to the first target game identifier until a pre-configured task deadline condition is met; The task deadline condition includes that the task corresponding to the first target game identifier is completed, or the game scene where the first virtual object is located does not meet the execution condition of the task corresponding to the first target game identifier.

7. The method for controlling a virtual object in a game according to claim 1, characterized in that: According to the object control strategy corresponding to the first target game identifier, controlling the first virtual object to execute the task corresponding to the first target game identifier also includes: If the first target game identifier is an interrupt game identifier, the first virtual object is controlled to interrupt the currently executed task, so that the first virtual object is in an idle state.

8. The method for controlling a virtual object in a game according to claim 1, characterized in that: After controlling the first virtual object to execute the task corresponding to the first target game identifier according to the object control strategy corresponding to the first target game identifier, the method further includes: Updating the first current game state; Continue to determine the next first target game identifier to be executed based on the updated first current game state through the target task selection model; According to the object control strategy corresponding to the next first target game identifier, the first virtual object is controlled to execute the task corresponding to the next first target game identifier.

9. The method for controlling a virtual object in a game according to any one of claims 1 to 8, characterized in that: The first current game status information includes status information corresponding to the first virtual object, status information corresponding to each virtual object of the same camp as the first virtual object, status information corresponding to each virtual object of a different camp than the first virtual object, and game match status.

10. A control device for a virtual object in a game, characterized in that: include: An information acquisition module, used to acquire first current game state information of a first virtual object; A game identifier determination module, configured to determine a first target game identifier to be executed based on the first current game state information by using a pre-trained target task selection model; The object control module is used to control the first virtual object to execute the task corresponding to the first target game identifier according to the object control strategy corresponding to the first target game identifier.

11. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement the method according to any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the method according to any one of claims 1 to 9.