A method and device for controlling a target object
By obtaining the application scene image frame sequence and deep reinforcement learning predicted action sequence, the problem of poor flexibility in virtual object operation in the existing technology is solved, efficient control in a variety of scenarios is achieved, and costs are reduced.
Patent Information
- Application Number
- CN201910476961.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-06-03
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2039-06-03
AI Technical Summary
The method of determining specific operations of virtual objects in the existing technology has poor flexibility, is difficult to adapt to multiple application scenarios, and has high development and maintenance costs in complex scenarios.
By obtaining the application scene image frame sequence, the feature sequence of the target object is extracted, and deep reinforcement learning is used to predict the target action sequence and control the target object to perform actions in subsequent scenes.
It realizes the flexible and adaptive determination of virtual object operations in different application scenarios, reduces action space and prediction time, and reduces development and maintenance costs.
Smart Images

Figure CN110170171B
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method and device for controlling a target object. Background Art
[0002] In the application, the user needs to manipulate the virtual object and control the virtual object to perform specific operations in order to recommend the application. At present, the method of determining the specific operation of the virtual object is usually to use the traditional non-machine learning method, such as the method of using a finite state machine to perform hard coding to determine the specific operation of the virtual object or the method based on the behavior tree to determine the specific operation of the virtual object. The advantages of these methods are that they can quickly determine the specific operations that the virtual object needs to perform, and the computational overhead is small. However, the method of determining the specific operation of the virtual object in the prior art is to use a fixed program to implement the specific operation, so it has poor flexibility and cannot be applied to a variety of different application scenarios. When the complexity of the application scenario increases, it will lead to an increase in the development cost and maintenance cost of the program.
[0003] In summary, the prior art cannot provide a method for determining a specific operation of a virtual object that is highly flexible and applicable to different application scenarios.
[0004] Application Contents
[0005] Based on the problems existing in the prior art, the embodiments of the present application provide a method and device for controlling a target object, which at least solve the problems existing in the prior art.
[0006] On the one hand, an embodiment of the present application provides a method for controlling a target object, including:
[0007] Acquire an application scene image frame sequence of the target object;
[0008] Obtaining a feature sequence of the target object from the application scene image frame sequence;
[0009] predicting a target action sequence of the target object according to the feature sequence;
[0010] Control the target object to execute the target action sequence in a subsequent application scenario.
[0011] In one aspect, an embodiment of the present application provides a control device for a target object, comprising:
[0012] An acquisition unit, used for acquiring an application scene image frame sequence of a target object;
[0013] A feature sequence determination unit, used to obtain a feature sequence of the target object from the application scene image frame sequence;
[0014] a target action sequence determination unit, configured to predict a target action sequence of the target object according to the feature sequence;
[0015] A control unit is used to control the target object to execute the target action sequence in a subsequent application scenario.
[0016] Optionally, the acquiring unit is specifically used for:
[0017] taking a plurality of continuous application scene image frames including the current application scene image frame as the application scene image frame sequence;
[0018] The feature sequence determination unit is specifically used for:
[0019] For each frame in the application scene image frame sequence, determining a first feature according to a local operation area of the target object in the application in the application scene image frame;
[0020] A first feature sequence is formed according to the sorting of the first features, and the first feature sequence is used as the feature sequence of the target object.
[0021] Optionally, the feature sequence determination unit is further used to:
[0022] For each frame in the application scene image frame sequence, determining a second feature according to a global operation area of the target object in the application in the application scene image frame;
[0023] A second feature sequence is formed according to the sorting of the second features, and the first feature sequence and the second feature sequence are used as the feature sequence of the target object.
[0024] Optionally, the feature sequence determination unit is further used to:
[0025] For the current application scene image frame, determining a third feature according to the state information of the target object in the application;
[0026] The first feature sequence, the second feature sequence and the third feature are used as the feature sequence of the target object.
[0027] Optionally, the target action sequence determination unit is specifically used to:
[0028] The feature sequence is input into an action sequence decider to obtain a target action sequence selected by the action sequence decider for the target object from a set type of action sequence according to the feature sequence, wherein the action sequence decider is obtained by performing deep reinforcement learning training on the target object, and the type of the target action sequence is determined according to the attribute information of the application.
[0029] Optionally, the target action sequence determination unit is specifically used to:
[0030] Inputting the feature sequence into the convolution unit of the neural network model of the action sequence decider to obtain a first target feature;
[0031] Determine a second target feature according to a state value function of the first target feature and an action advantage function of the first target feature;
[0032] A target action sequence of the target object is determined according to the second target feature.
[0033] Optionally, the target action sequence is any one of the following action sequences:
[0034] Target object movement action sequence;
[0035] Target object attack action sequence;
[0036] The target object upgrades the application level action sequence;
[0037] Target object skill upgrade action sequence;
[0038] The target object obtains the electronic product action sequence.
[0039] Optionally, the target action sequence is an attack action sequence of the target object;
[0040] The control unit is specifically used for:
[0041] If it is determined that the target object is not in a retreat state, determining whether the attack target is a set target;
[0042] If it is determined that the attack target is the set target, the priority of the attack skills is determined, and the attack skill with the highest priority is executed.
[0043] Optionally, the acquisition unit is further used for:
[0044] The application scene image frame sequence of the target object is determined according to the application scene image frames after executing the target action sequence.
[0045] Optionally, the device further includes a training unit, and the training unit is specifically used for:
[0046] Acquire a training sample, wherein the training sample is determined according to an application scene image frame sequence of the target object in a training phase and an initial action sequence decider, the output result of the action sequence decider is a training action sequence, and the training sample at least includes an incentive value for the target object to execute the training action sequence;
[0047] The action sequence output by the initial action decision controller is adjusted according to the incentive value of the training sample to obtain the action sequence decider.
[0048] On the one hand, an embodiment of the present application provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the steps of the control method of the target object.
[0049] On the one hand, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program executable by a computer device. When the program is run on the computer device, the computer device executes the steps of the control method of the target object.
[0050] By acquiring an application scene image frame sequence where the target object is located, and obtaining a feature sequence of the target object through the application scene image frame sequence, and predicting a target action sequence to be executed by the target object through the feature sequence of the target object, finally controlling the target object to complete the predicted target action sequence; in the embodiment of the present application, the target action sequence to be executed by the target object is determined by the application scene of the target object. Compared with the prior art, it can adapt to different application scenes, that is, the embodiment of the present application determines different feature sequences for different application scenes, and obtains target action sequences predicted for different application scenes according to the feature sequences, thereby achieving flexibility and adaptability in the decision of the target action sequence; and, the embodiment of the present application predicts one of the set action sequences, rather than a certain action from a large number of actions in the prior art. Through a single prediction result, the target object can execute a series of actions, which greatly compresses the action space, shortens the calculation time for predicting the target action sequence according to the feature sequence, and reduces the number of predictions for the target object in completing an application process. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0052] Figure 1 A schematic diagram of an application scenario provided for an embodiment of the present application;
[0053] Figure 2 A schematic diagram of a flow chart of a method for controlling a target object provided in an embodiment of the present application;
[0054] Figure 3A schematic diagram of an image frame sequence of an application scenario provided in an embodiment of the present application;
[0055] FIG4( a ) is a schematic diagram of a complete operation interface for a game player to operate a game application provided by an embodiment of the present application;
[0056] FIG4( b ) is a schematic diagram of a local operation area provided in an embodiment of the present application;
[0057] FIG5( a ) is a schematic diagram of a complete operation interface for a game player to operate a game application provided by an embodiment of the present application;
[0058] FIG5( b ) is an enlarged schematic diagram of a global operation area provided in an embodiment of the present application;
[0059] Figure 6 A schematic diagram of state information of a target object provided in an embodiment of the present application;
[0060] Figure 7 A flowchart of a deep reinforcement learning method provided in an embodiment of the present application;
[0061] Figure 8 A flowchart of a deep reinforcement learning method provided in an embodiment of the present application;
[0062] Fig. 9 A schematic diagram of a target object moving action sequence provided in an embodiment of the present application;
[0063] FIG10( a ) is a schematic diagram of a character b and any character a in a team A in the same local operation interface provided by an embodiment of the present application;
[0064] FIG10( b ) is a schematic diagram of a process of controlling character b to go to the bottom lane provided by an embodiment of the present application;
[0065] FIG10( c ) is a schematic diagram of controlling character b to attack character a provided by an embodiment of the present application;
[0066] FIG11( a ) is a schematic diagram of a role b attacking a role a after entering a trusteeship mode according to an embodiment of the present application;
[0067] FIG11( b ) is a schematic diagram of a process of character b retreating provided in an embodiment of the present application;
[0068] Fig.12 A schematic diagram of the structure of a control device for a target object provided in an embodiment of the present application;
[0069] Fig.13 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0070] In order to make the purpose, technical solution and beneficial effects of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0071] For ease of understanding, the terms involved in the embodiments of the present application are explained below.
[0072] Application: An executable program that can drive the execution of the executable program by controlling a virtual object in the application. The application can be a MOBA (multiplayer online battle arena) game, an RTS (Real-Time Strategy Game), or a virtual reality application, such as a navigation application.
[0073] Virtual object: A controllable object in an application. The behavior of the controllable object drives the progress of the application. If the application is a MOBA game or an RTS game, the virtual object is a controllable game character in the game. If the application is a virtual reality application, the virtual object is a virtual reality character in the virtual reality application. The target object in this application refers to the virtual object in the application.
[0074] AI: Artificial Intelligence, also known as machine intelligence, refers to the intelligence displayed by machines made by humans. Usually artificial intelligence refers to the intelligence realized by ordinary computers, and AI is also a kind of virtual object.
[0075] Action sequence: The operations that a virtual object can perform are independent actions. Different from independent actions, the independent actions performed by the virtual object in the application to achieve a certain goal are sorted in time series to obtain an action sequence.
[0076] In the specific practice process, the applicant of the present application found that in the prior art, for virtual objects in applications, such as AI, non-machine learning methods are usually used to determine the operation content of virtual objects in applications, that is, the actions of virtual objects in applications. Non-machine learning methods mainly include finite state machine methods and behavior tree methods. The finite state machine method represents the mathematical model of "set number" states and transitions (Transation) and actions (Action) between these states. For simple states, the actions of virtual objects can be determined by the current state of the virtual object. However, for complex state machines, such as the behavior of characters in games, there will be more and more complex states, such as Idle (idle state), Attack (attack state), Run (running state), Injured (injured state), etc., and the switching between states is conditional. In the Idle state, you can switch to Run and Attack, but when the game character is in the Injured attack state, it cannot be directly switched to idle. Certain conditions must be met, such as after the attack animation ends, the idle state can be switched. Similarly, although the behavior tree method is more flexible than the finite state machine method, it still cannot predict the actions of virtual objects based on complex states.
[0077] Since machine learning has the function of self-learning and the ability to find optimized solutions at high speed, the applicant of this application has conceived a method of using machine learning methods to predict the target action of a virtual object, and uses machine learning to solve the problem that the above complex state cannot well predict the action of the virtual object. The applicant of this application determines the characteristics of the virtual object according to the application scenario corresponding to the virtual object, and uses it as the input of the machine learning. The output of the machine learning is a predicted action of the virtual object.
[0078] However, the applicant of this application has also discovered that in complex applications, such as MOBA games or RTS games, due to the gorgeous game graphics, numerous application scene elements, and rich operable actions, the state space and action space brought about are very large, and it is difficult to directly use this solution to determine the predicted action of the virtual object.
[0079] The applicant of the present application has further improved the method of using machine learning to determine the predicted action of a virtual object. After obtaining the application scene image frame sequence of the virtual object, the feature sequence of the virtual object is determined, that is, the feature data characterizing the current state of the virtual object. According to the feature sequence of the virtual object, the target action sequence of the virtual object can be determined. That is to say, in the application, the independent actions performed to achieve a certain goal are sorted according to the time series to obtain the action sequence as the output result, which can greatly compress the action type space, reduce the difficulty of machine learning, and further shorten the training time of machine learning.
[0080] The target object control method in the embodiment of the present application can be applied to Figure 1 The application scenario shown includes a terminal 101 and an application server 102 .
[0081] The terminal 101 is an electronic device with network communication capability, which may be a smart phone, a tablet computer, or a portable personal computer. Applications are installed on the client 101, such as game applications, navigation applications, etc. When a user uses an application on the terminal 101, such as starting a game application to play a game, the terminal 101 sends a data packet to the application server 102, and the application server 102 returns a response data packet to the terminal 101. The terminal 101 is connected to the application server 102 via a wireless network, and the application server 102 is a server cluster or a cloud computing center composed of one server or several servers.
[0082] When the user executes an application installed on the terminal 101, he uses any virtual object in the application as the target object. The terminal 101 sends the application scene image frame sequence exclusive to the target to the application server 102. The application server 102 extracts the feature sequence of the target object from the application scene image frame sequence, determines the target action sequence of the target object based on the feature sequence of the target object, sends the target action sequence of the target object to the terminal 101, and executes the target action sequence in the terminal 101.
[0083] based on Figure 1 As shown in the application scenario diagram, the embodiment of the present application provides a process of a control method for a target object, and the process of the method can be executed by a control device of the target object, such as Figure 2 As shown, the following steps are included:
[0084] Step S201, obtaining an application scene image frame sequence of a target object.
[0085] Specifically, the target object is any controllable object in the application. For example, if the application is a game application, the target object is any controllable game character, including a player character in the game or an enemy character in the game. In other words, the target object can be a player character in the game, or an artificial intelligence character in the game, such as a character that competes with the player character.
[0086] In the embodiment of the present application, acquiring an application scene image frame sequence of a target object is to acquire at least one image frame of an application scene including the target object, and these scene frames are arranged in sequence to form an application scene image frame sequence.
[0087] An optional embodiment, such as Figure 3 As shown, if the application is a game application and the target object is a player character, then it can be considered Figure 3 At least one of the game application scenes includes a player character as an application scene image frame sequence.
[0088] An optional embodiment takes multiple consecutive application image frames including the current application scene image frame as an application scene image frame sequence. For example, if the current application scene image frame is the 10th frame in the application, the 10th frame and a set number of consecutive application image frames before the 10th frame are taken as the application scene image frame sequence.
[0089] In an optional embodiment, the current application scene image frame, a set number of application image frames before the current application scene image frame, and a plurality of application image frames after the current application scene image frame are taken as the application scene image frame sequence.
[0090] An optional embodiment, according to empirical values, takes the current application scene image frame and the three consecutive application scene image frames before the current application scene image frame as the application scene image frame sequence, that is, for example, if the current application scene image frame is the 10th frame in the application, then the 7th frame, 8th frame, 9th frame and 10th frame in the application are taken as the application scene image frame sequence.
[0091] Step S202: obtaining a feature sequence of the target object from the application scene image frame sequence.
[0092] Specifically, after acquiring the application scene image frame sequence, a feature sequence of the target object is determined from the application scene image frame sequence. The sequence is used to characterize the features of the target object in the application scene. The features may be color features, texture features, spatial features, etc., or may be other features of the target object in the application scene, such as the state of the target object in the application scene.
[0093] An optional embodiment, due to the complexity and diversity of application scenarios, the application scenario image frames include more feature information, and the feature sequence of the target object can be obtained by extracting some features in the application scenario image frames respectively and sorting them in order.
[0094] Optionally, a first feature may be extracted from each frame in the application scene frame sequence, and the first feature is used to characterize the characteristics of the local operation area of the target object in the application. The local operation area of the target object in the application can be understood as the operation area including the target object that the user can see when the user uses the application on the terminal, and the area included in the operation area is a partial area in all applications.
[0095] For example, when the application is a game application, the target object is a game character controlled by a game player, and the local operation area is a maximized area for the game player to control the game character, and the maximized area is a part of the game interface. As shown in Figure 4(a) and Figure 4(b), Figure 4(a) shows the complete operation interface of the game player operating the game application, and Figure 4(b) shows the local operation area.
[0096] After the first features are determined, the first features are sorted according to the order of the application scene frames to form a first feature sequence, which is a feature sequence of the target object.
[0097] In an optional embodiment, in addition to determining the first feature for each frame in the application scene image frame sequence, a second feature for each frame in the application scene image frame sequence can also be determined based on the global operation area of the target object in the application, and the second feature is used to characterize the feature of the global operation area of the target object in the application. The local operation area of the target object in the application can be understood as the entire operation area including the target object that the user can see when using the application on the terminal, and the area included in the operation area is all areas in the application.
[0098] For example, when the application is a game application, the target object is the game character controlled by the game player, the local operation area is the maximized area for the game player to control the game character, and the global operation area refers to the small area for the game player to operate the game character. The small area represents the area range of all areas of the game application. It can be considered that the local operation area is a part of the global operation area that is enlarged and displayed to the game player. As shown in Figure 5(a) and Figure 5(b), Figure 5(a) shows the complete operation interface of the game player operating the game application, the upper left part of Figure 5(a) shows the global operation area, and Figure 5(b) shows an enlarged schematic diagram of the global operation area.
[0099] After the second features are determined, the second features are sorted according to the order of the application scene frames to form a second feature sequence, and the second feature sequence can be used as a feature sequence of the target object.
[0100] In an optional embodiment, in addition to determining the first feature for each frame in the application scene image frame sequence, and determining the second feature for each frame in the application scene image frame sequence according to the global operation area of the target object in the application, the third feature can also be determined by the state information of the target object in the current application scene image frame. The state information of the target object in the application can characterize the level, skill status, and survival status of the target object in the application. For example, if the application is a game application, the state information can be the game level of the game character, which can be represented by LV-N, where N is greater than or equal to 1, that is, the current game level of the game character is LV1, etc.; the state information can also include the survival status of the game character, which can be represented by blood volume; the state information can also include the game skill status, such as whether game skill 1 is available, whether game skill 2 is possible, etc.
[0101] like Figure 6 As shown, Figure 6 The health of the game character in represents the survival status of the target object, which is determined by Figure 6 It can be seen that the current game level of the target object is level 1. Figure 6 The three icons in the lower right corner represent the skill level of the target object.
[0102] Optionally, in an embodiment of the present invention, the first feature sequence determined according to the application scene image frame sequence is used as the feature sequence of the target object, or the first feature sequence and the second feature sequence determined according to the application scene image frame sequence are used as the feature sequence of the target object, or the first feature sequence and the second feature sequence determined according to the application scene image frame sequence and the third feature determined according to the current application scene image frame are used as the feature sequence of the target object, that is, the first features of the four frames of images are sorted and combined, the second features of the four frames of images are sorted and combined, and the third feature determined according to the current application scene image frame is used together as the feature sequence of the target object.
[0103] Step S203: predicting a target action sequence of the target object according to the feature sequence.
[0104] Specifically, the next target action sequence of the target object is predicted based on the determined feature sequence of the target object.
[0105] In an optional embodiment, the present application adopts a machine learning method to determine the target action sequence of the target object, that is, the feature sequence of the target object is used as the input of the machine learning, and the target action sequence of the target object is used as the output of the machine learning. The core of machine learning is "using algorithms to parse data, learn from it, and then make decisions or predictions about something in the world." This means that instead of explicitly writing programs to perform certain tasks, it is better to teach the computer how to develop an algorithm to complete the task. Exemplarily, machine learning methods include supervised learning methods, unsupervised learning methods, and reinforcement learning methods.
[0106] In an optional embodiment, the feature sequence is input into an action sequence decider, which is determined by a machine learning method. Specifically, the action sequence decider is determined by a machine learning method called deep reinforcement learning. The type of target action sequence that can be output by the action sequence decider is determined based on the attribute information of the application. That is to say, the attributes of the application are different, and the action sequence composed of multiple independent actions performed in the application to complete a task and advance the application process is different. For example, if the application is a MOBA game, in order to win the game, it is usually necessary to perform operations such as moving, attacking, and upgrading skills, so multiple independent movement actions are composed of an action sequence, or multiple independent attack actions are composed of an action sequence, or multiple independent skill upgrading actions are composed of an action sequence; if the application is a navigation application, then in navigation, in order to smoothly navigate, it is generally necessary to perform operations such as moving, accelerating, and decelerating, so multiple independent movement actions are composed of an action sequence, multiple independent acceleration actions are composed of an action sequence, and multiple independent deceleration actions are composed of an action sequence; if the application is a video application, in order to play a video, it is generally necessary to select a category to play, fast forward, rewind, launch barrage, and other operations, so multiple independent category selection actions are composed of an action sequence, multiple independent fast forward actions are composed of an action sequence, multiple independent rewind actions are composed of an action sequence, and multiple independent barrage launching actions are composed of an action sequence.
[0107] In this application, deep reinforcement learning combines the perception ability of deep learning with the decision-making ability of reinforcement learning, and is an artificial intelligence method that is closer to the human way of thinking. Specifically, in this application, the action sequence decider includes a neural network model, and the neural network model includes a convolution unit. In order to obtain the target action sequence of the target object, the feature sequence is input into the convolution unit of the neural network model of the action sequence decider. The convolution unit can extract the target features, and the target action sequence is determined from the set type of action sequence according to the target features extracted by the convolution unit.
[0108] In an optional embodiment, in order to better extract features, the first feature sequence, the second feature sequence and the third feature in the feature sequence are respectively input into the convolution unit, and the target feature is obtained through processing by different convolution units. For example, the deep reinforcement learning method DQN is used as an example to illustrate. Figure 7 As shown, in the present application, the first feature sequence is input into the convolution unit, and passes through the first convolution layer, the second convolution layer, the first pooling layer, the third convolution layer, the second pooling layer and the fourth convolution layer in sequence to obtain the target feature of the first part; the second feature sequence is input into the convolution unit, and passes through the fifth convolution layer and the sixth convolution layer in sequence to obtain the target feature of the second part, and the target feature of the third part is the third feature. The target feature of the first part, the target of the second part and the target feature of the third part are input into the fully connected layer, and the target action sequence can be obtained. In the convolution unit, the convolution layer is used to generate more feature vectors, the pooling layer is used for normalization, and the fully connected layer is used to output the target action sequence corresponding to the feature vector.
[0109] In an optional embodiment, a machine learning method based on a competitive Q network, the Dueling DQN algorithm, can also be used to determine the target action sequence. The Dueling DQN algorithm diverts the abstract features extracted by the convolutional layer into two branches: the upper branch represents the state value function, which represents the value of the static state environment itself; the lower branch represents the state-dependent action advantage function, which represents the additional value of selecting a certain action sequence. Finally, these two branches are aggregated together to obtain the target action sequence. Specifically, the feature sequence is input into the convolution unit of the neural network model of the action sequence decider to obtain a first target feature; the second target feature is determined based on the state value function of the first target feature and the action advantage function of the first target feature; the target action sequence of the target object is determined based on the second target feature. Exemplary, such as Figure 8 As shown, in the present application, the first feature sequence is input into the convolution unit, and passes through the first convolution layer, the second convolution layer, the first pooling layer, the third convolution layer, the second pooling layer and the fourth convolution layer in sequence to obtain the target feature of the first part; the second feature sequence is input into the convolution unit, and passes through the fifth convolution layer and the sixth convolution layer in sequence to obtain the target feature of the second part, and the target feature of the third part is the third feature. After the target feature of the first part, the target of the second part and the target feature of the third part are input into the fully connected layer, they are respectively diverted to two branches, one is the upper branch and the other is the lower branch, and the target action sequence is determined by the two results of the upper branch and the lower branch.
[0110] That is, in the embodiment of the present invention, the feature sequence is input into the action sequence decider to obtain the target action sequence selected by the action sequence decider for the target object from the set type of action sequences according to the feature sequence.
[0111] Step S204: controlling the target object to execute the target action sequence in a subsequent application scenario.
[0112] Specifically, after the target action sequence to be executed is determined, the target object is controlled to execute the target action sequence in a subsequent application scenario.
[0113] An optional embodiment, after determining the target action sequence, can determine to decompose the target action sequence into executable actions in each application scene image frame, load the application scene image frame corresponding to the executable actions, and execute the executable actions in each application scene image frame, thereby controlling the target object to complete the target action sequence.
[0114] In order to better illustrate the specific action content of the target action sequence executed by the target object, in the embodiment of the present invention, the application of a MOBA game is taken as an example for explanation. It can be considered that in the MOBA game, the type of the target action sequence output by the action sequence decider is any one of the following action sequences:
[0115] Target object moving action sequence, target object attacking action sequence, target object application level upgrading action sequence, target object skill upgrading action sequence, target object obtaining electronic product action sequence.
[0116] In MOBA games, the target object can win by breaking through the opponent's core building, and the attack route can be selected from the top lane, middle lane and bottom lane. Our high ground refers to the core building area of the target object. The target object movement action sequence can include continuous actions to the top lane, middle lane, bottom lane and our high ground in the MOBA game, that is, the action sequence of the target object to the top lane is to move from the current position to the top lane, and similarly, the action sequence of the target object to the middle lane is to move from the current position to the middle lane, the action sequence of the target object to the bottom lane is to move from the current position to the bottom lane, and the action sequence of the target object to our high ground is to move from the current position to our high ground. Specifically, if Fig. 9 As shown, in Fig. 9In the example, our high ground is represented by a tower, and the target object's moving sequence action is to move toward the upper road, toward the middle road, or toward the lower road. The target object attack action sequence may include a sequence of attacking and running while hitting, an attack action sequence that always keeps oneself at the farthest position, an active attack action sequence when the number of our game characters on the same screen is greater than or equal to the number of enemy game characters, an attack action sequence that follows the center of our game characters, and a retreat, and a return to the city action sequence after retreating away from the enemy unit. It can be seen from the above that this application has attack behaviors outside the retreat action sequence, and the attack behavior can also attack by releasing the skills of the game character in addition to the ordinary attack behavior. Optionally, when the target object is controlled to execute the target object attack action sequence, if it is determined that the target object is not in a retreat state, it is determined whether the attack target is a set target, such as the enemy's main game character; if the attack target is determined to be a set target, the priority of the attack skill is determined, and the highest priority attack skill is executed. For example, the target object has attack skills 1, attack skills 2, and attack skills 3, and attack skill 3 has the highest priority, so attack skill 3 is released first.
[0117] The action sequence for improving the application level of the target object refers to continuous actions for improving the level of the target object, such as attacking wild monsters, etc. Specifically, it can be divided into an action sequence for attacking wild monsters that is beneficial to improving the application level, such as an action sequence for attacking wild monsters that can add a slowing effect and a burning effect of true damage to the character's normal attack, such as a red BUFF monster; or an action sequence for attacking wild monsters that can provide the character with cooldown reduction and a huge increase in mana recovery speed, such as a blue BUFF monster; or an action sequence for attacking objects that can obtain electronic product gains and status gains for the entire team, such as a Dominant or a Tyrant; an action sequence that only attacks wild monsters in our area, etc.
[0118] The target object skill upgrade action sequence refers to the action sequence of the target object skill upgrade. For example, the target object has skill 1, skill 2, and skill 3, which can be attack skills or other skills. The upgrade of skill 1 can be from the first level of skill 1 to the second level until the full level, the upgrade of skill 2 can be from the first level of skill 2 to the second level until the full level, and the upgrade of skill 3 can be from the first level of skill 3 to the second level until the full level.
[0119] The target object obtains the electronic product action sequence refers to the target object obtaining the electronic product action sequence when it is in an advantageous position in the MOBA game, such as a steady development equipment action sequence; and the target object obtaining the electronic product action sequence when it is in a disadvantageous position in the MOBA game, such as a disadvantageous position equipment action sequence. The electronic product can be equipment in the MOBA game or other virtual goods.
[0120] From the above content, it can be determined that an optional embodiment of the present application includes 5 major categories of target action sequences, wherein the 5 major categories of target action sequences include 17 specific target action sequences, and the MOBA game can be completed through the above target action sequences.
[0121] After the target object is controlled to execute the target action sequence in the subsequent application scene, the application scene image frame sequence of the target object is determined according to the application scene image frame after the target action sequence. That is to say, after the target object is controlled to execute the target action sequence, the application scene image frame sequence of the target object is determined according to the application scene image frame when the target action sequence is completed, and then the target action sequence of the target object is predicted according to the application scene image frame sequence of the target object. Exemplarily, after the action sequence to the middle road is executed, the application scene image frame when the middle road is reached and the three consecutive application scene image frames before the application scene image frame constitute the feature sequence of the target object, and the next target action sequence of the target object is determined according to the feature sequence of the target object.
[0122] In an embodiment of the invention, the action sequence decider is obtained by performing deep reinforcement learning training on the target object, specifically including:
[0123] Acquire training samples. The training samples are determined based on the application scene image frame sequence of the target object in the training phase and the initial action sequence decider. The output result of the action sequence decider is the training action sequence. The training samples at least include the incentive value of the target object executing the training action sequence. Adjust the action sequence output by the initial action decision controller according to the incentive value of the training sample to obtain the action sequence decider.
[0124] In the present application, the initial action sequence decider is configured with different target action sequences, and the output result of the initial action sequence decider is a training action sequence. The type of the target action sequence configured by the initial action sequence decider is determined according to the attributes of the application; the application scene image frame sequence of the target object in the training phase is input into the initial action sequence decider to obtain a training action sequence; the incentive value obtained by executing the training action sequence, that is, the application process is well promoted, the incentive value is a positive value, if the application cannot be promoted, the incentive value is a negative value, the action sequence output by the initial action decision controller is adjusted by the incentive value, and the action sequence decider is obtained.
[0125] Specifically, in order to better explain the training process, some concepts of deep reinforcement learning are explained here. Deep reinforcement learning combines Q-learning and convolutional neural network (CNN). When deep reinforcement learning is introduced into applications, the output of the deep neural network is a certain action with the highest probability in a certain application state. The large amount of data generated during the training process is often the process of the computer executing the application, such as the experience tuple formed by the action, state and reward information brought by the action. The result of model learning is a nonlinear representation of the final application state and strategy.
[0126] Specifically, the steps of deep reinforcement learning are:
[0127] Step 1: Use a neural network model as the Q value network with a parameter of ω, where Q is Q(s,a), which refers to the expectation of the target object taking action sequence a at a certain moment in state s. During the training process, the action sequence is configured in advance, that is, the set type of action sequence can be determined according to the attributes of the application. Action sequence a is one of the set type of action sequences:
[0128] Q(s,a,w)≈Q π (s,a) Formula 1
[0129] Step 2: Use the mean square error in the Q value to define the objective function and loss function, where the objective function is determined by another neural network model:
[0130] L(w)=E[(r+γ·max a' Q(s',a',w)-Q(s,a,w) 2 )] Formula 2
[0131] In Formula 2, s', a' represent the next state and action sequence.
[0132] Step 3: Calculate the gradient of the parameter ω with respect to the loss function:
[0133]
[0134] Step 4: Use the stochastic gradient descent algorithm SGD to achieve the optimization goal.
[0135] With the above gradient, It can be calculated from the deep neural network model, so SGD stochastic gradient descent can be used to update the parameters to obtain the optimal Q value. The above training data is randomly extracted from the memory bank, which records the action sequence, reward, and result of the next state in each state. The size of the memory bank is limited. When the data is full, the next data will overwrite the first data in the memory bank.
[0136] The deep reinforcement learning method in the above embodiment is only an exemplary description. Other deep reinforcement learning methods, such as A3C (Actor-Critic Algorithm), UNREAL (UNsupervised REinforcement and Auxiliary Learning), and PPO (Proximal Policy Optimization) are also applicable to the above method for determining the target action sequence.
[0137] In order to better explain the embodiments of the present application, a method for controlling a target object provided by an embodiment of the present application is described below in conjunction with a specific implementation scenario. The method is executed by a control device for the target object. In the present application, the target object is an opposing character of a game character used by a user in a MOBA game. It can be understood that, in a MOBA game, if a game character used by any user is a character in team A, then the target object is any character in team B.
[0138] In the embodiment of the present application, the purpose of confronting the game characters in team A is achieved by determining the target action sequence of the target object. The specific process is as follows: Figure 10(a) to Figure 10(c) As shown:
[0139] When playing a MOBA game, after the user selects any character a in team A, the target object is selected as character b in team B; after the MOBA game starts, the current application scene image frame of character b and the three consecutive application scene image frames before the current application scene image frame are input into the action sequence decider, and the target action sequence of character b is to go to the bottom lane, then character b is controlled to move to the bottom lane, and after reaching the bottom lane, the current application scene image frame of character b and the three consecutive application scene image frames before the current application scene image frame are continuously input into the action sequence decider, and the target action sequence after reaching the bottom lane is an attack action sequence, then character b is controlled to attack any character in team A, and after the attack, the current application scene image frame of character b and the three consecutive application scene image frames before the current application scene image frame are continuously input into the action sequence decider, and the next target action sequence after the attack action sequence is obtained, until the game ends.
[0140] In Figure 10(a), the target object, i.e., character b, and any character a in team A are in the same local operation interface. The target action sequence of character b is to go to the bottom lane. Figure 10(b) shows the process of controlling character b to go to the bottom lane. After reaching the bottom lane, the target action sequence of character b is determined to be the attack action sequence. As shown in Figure 10(c), character b attacks any character a in team A.
[0141] In another optional embodiment, when the user selects the hosting mode during the game, in order to better play the game on behalf of the user and try to win, the method of the present application is used to determine the target action sequence of the game character used by the user.
[0142] Specifically, when the user selects the hosting mode, the current game scene image frame is determined, and the three consecutive frames before the hosting mode are input into the action sequence decider as the game scene image frame sequence, and the target action sequence of the game character b is attack, so the game character b is controlled to attack the character a; the current application scene image frame after the attack of the game character b and the three consecutive application scene image frames before the current application scene image frame are continuously input into the action sequence decider, and the next target action sequence is retreat, and then the current application scene image frame of the character b and the three consecutive application scene image frames before the current application scene image frame are continuously input into the action sequence decider, and the next target action sequence after the attack action sequence is obtained, until the game ends. The specific process is shown in Figures 11(a) and 11(b).
[0143] In Figure 11(a), after entering the hosting mode, character b attacks character a, and in Figure 11(b), character b begins to retreat.
[0144] The above two embodiments are only illustrated by taking the target object as an antagonistic character of a game character used by a user and the target object as a game character used by a user in a hosting mode as examples. To process the scenarios in the above embodiments, the scenarios used in this application can also be when the target object is a test object in an automated test of an application, or when performing a balance test in auxiliary application development, by performing a confrontation with the target object to verify whether the newly designed application character meets the balance requirements; and the control method of the target object in this application can solve the cold start problem when the application is initially launched.
[0145] Based on the same technical concept, the embodiment of the present application provides a control device for a target object, such as Fig.12 As shown, the device 1200 includes:
[0146] An acquisition unit 1201 is used to acquire an application scene image frame sequence of a target object;
[0147] A feature sequence determining unit 1202 is used to obtain a feature sequence of the target object from the application scene image frame sequence;
[0148] A target action sequence determining unit 1203 is used to predict the target action sequence of the target object according to the feature sequence;
[0149] The control unit 1204 is used to control the target object to execute the target action sequence in a subsequent application scenario.
[0150] Optionally, the acquiring unit 1201 is specifically configured to:
[0151] taking a plurality of continuous application scene image frames including the current application scene image frame as the application scene image frame sequence;
[0152] The feature sequence determination unit 1202 is specifically used for:
[0153] For each frame in the application scene image frame sequence, determining a first feature according to a local operation area of the target object in the application in the application scene image frame;
[0154] A first feature sequence is formed according to the sorting of the first features, and the first feature sequence is used as the feature sequence of the target object.
[0155] Optionally, the feature sequence determining unit 1202 is further configured to:
[0156] For each frame in the application scene image frame sequence, determining a second feature according to a global operation area of the target object in the application in the application scene image frame;
[0157] A second feature sequence is formed according to the sorting of the second features, and the first feature sequence and the second feature sequence are used as the feature sequence of the target object. Optionally, the feature sequence determination unit 1202 is further used to:
[0158] For the current application scene image frame, determining a third feature according to the state information of the target object in the application;
[0159] The first feature sequence, the second feature sequence and the third feature are used as the feature sequence of the target object.
[0160] Optionally, the target action sequence determining unit 1203 is specifically configured to:
[0161] The feature sequence is input into an action sequence decider to obtain a target action sequence selected by the action sequence decider for the target object from a set type of action sequence according to the feature sequence, wherein the action sequence decider is obtained by performing deep reinforcement learning training on the target object, and the type of the target action sequence is determined according to the attribute information of the application.
[0162] Optionally, the target action sequence determining unit 1203 is specifically configured to:
[0163] Inputting the feature sequence into the convolution unit of the neural network model of the action sequence decider to obtain a first target feature;
[0164] Determine a second target feature according to a state value function of the first target feature and an action advantage function of the first target feature;
[0165] A target action sequence of the target object is determined according to the second target feature.
[0166] Optionally, the target action sequence is any one of the following action sequences:
[0167] Target object movement action sequence;
[0168] Target object attack action sequence;
[0169] The target object upgrades the application level action sequence;
[0170] Target object skill upgrade action sequence;
[0171] The target object obtains the electronic product action sequence.
[0172] Optionally, the target action sequence is an attack action sequence of the target object;
[0173] The control unit 1204 is specifically used for:
[0174] If it is determined that the target object is not in a retreat state, determining whether the attack target is a set target;
[0175] If it is determined that the attack target is the set target, the priority of the attack skills is determined, and the attack skill with the highest priority is executed.
[0176] Optionally, the acquiring unit 1201 is further configured to:
[0177] The application scene image frame sequence of the target object is determined according to the application scene image frames after executing the target action sequence.
[0178] Optionally, the device further includes a training unit 1205, and the training unit 1205 is specifically configured to:
[0179] Acquire a training sample, wherein the training sample is determined according to an application scene image frame sequence of the target object in a training phase and an initial action sequence decider, the output result of the action sequence decider is a training action sequence, and the training sample at least includes an incentive value for the target object to execute the training action sequence;
[0180] The action sequence output by the initial action decision controller is adjusted according to the incentive value of the training sample to obtain the action sequence decider.
[0181] Based on the same technical concept, the embodiment of the present application provides a computer device, such as Fig.13 As shown, it includes at least one processor 1301 and a memory 1302 connected to the at least one processor. The specific connection medium between the processor 1301 and the memory 1302 is not limited in the embodiment of the present application. Fig.13 For example, the processor 1301 and the memory 1302 are connected via a bus. The bus can be divided into an address bus, a data bus, a control bus, etc.
[0182] In the embodiment of the present application, the memory 1302 stores instructions that can be executed by at least one processor 1301. The at least one processor 1301 can execute the steps included in the aforementioned target object control method by executing the instructions stored in the memory 1302.
[0183] Among them, the processor 1301 is the control center of the computer device, which can use various interfaces and lines to connect various parts of the terminal device, and obtain the client address by running or executing instructions stored in the memory 1302 and calling data stored in the memory 1302. Optionally, the processor 1301 may include one or more processing units, and the processor 1301 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 1301. In some embodiments, the processor 1301 and the memory 1302 may be implemented on the same chip, and in some embodiments, they may also be implemented separately on independent chips.
[0184] Processor 1301 can be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application-specific integrated circuit (ASIC), a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, and can implement or execute the methods, steps and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware processor to be executed, or can be executed by a combination of hardware and software modules in the processor.
[0185] Memory 1302, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs and modules. Memory 1302 may include at least one type of storage medium, such as flash memory, hard disk, multimedia card, card-type memory, random access memory (Random Access Memory, RAM), static random access memory (Static Random Access Memory, SRAM), programmable read-only memory (Programmable Read Only Memory, PROM), read-only memory (Read Only Memory, ROM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), magnetic memory, disk, optical disk, etc. Memory 1202 is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 1202 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.
[0186] Based on the same technical concept, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program executable by a computer device. When the program runs on the computer device, the computer device executes the steps of the control method of the target object.
[0187] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0188] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0189] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0190] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0191] Although the preferred embodiments of the present application have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.
[0192] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A method for controlling a target object, characterized in that: include: Acquire an application scene image frame sequence of the target object; Obtaining a feature sequence of the target object from the application scene image frame sequence; Inputting the feature sequence into an action sequence decider to obtain a target action sequence selected by the action sequence decider for the target object from a set type of action sequence according to the feature sequence, wherein the type of the target action sequence is determined according to the attribute information of the application, wherein the action sequence is obtained by chronologically sorting independent actions that the virtual object will perform in the application to achieve a certain goal; Control the target object to execute the target action sequence in a subsequent application scenario.
2. The method according to claim 1, characterized in that The step of obtaining a target object application scene image frame sequence comprises: taking a plurality of continuous application scene image frames including the current application scene image frame as the application scene image frame sequence; Obtaining a feature sequence of the target object from the application scene image frame sequence includes: For each frame in the application scene image frame sequence, determining a first feature according to a local operation area of the target object in the application in the application scene image frame; A first feature sequence is formed according to the sorting of the first features, and the first feature sequence is used as the feature sequence of the target object.
3. The method according to claim 2, characterized in that The step of obtaining the feature sequence of the target object from the application scene image frame sequence further includes: For each frame in the application scene image frame sequence, determining a second feature according to a global operation area of the target object in the application in the application scene image frame; A second feature sequence is formed according to the sorting of the second features, and the first feature sequence and the second feature sequence are used as the feature sequence of the target object.
4. The method according to claim 3, characterized in that The step of obtaining the feature sequence of the target object from the application scene image frame sequence further includes: For the current application scene image frame, determining a third feature according to the state information of the target object in the application; The first feature sequence, the second feature sequence and the third feature are used as the feature sequence of the target object.
5. The method according to claim 4, characterized in that The action sequence decider is obtained by performing deep reinforcement learning training on the target object.
6. The method according to claim 5, characterized in that The step of inputting the feature sequence into an action sequence decider to obtain a target action sequence of the target object comprises: Inputting the feature sequence into the convolution unit of the neural network model of the action sequence decider to obtain a first target feature; Determine a second target feature according to a state value function of the first target feature and an action advantage function of the first target feature; A target action sequence of the target object is determined according to the second target feature.
7. The method according to claim 6, characterized in that The type of the target action sequence includes any one of the following action sequences: Target object movement action sequence; Target object attack action sequence; The target object upgrades the application level action sequence; Target object skill upgrade action sequence; The target object obtains the electronic product action sequence.
8. The method according to claim 7, characterized in that The target action sequence is the target object attack action sequence; The controlling the target object to execute the target action sequence in a subsequent application scenario includes: If it is determined that the target object is not in a retreat state, determining whether the attack target is a set target; If it is determined that the attack target is the set target, the priority of the attack skills is determined, and the attack skill with the highest priority is executed.
9. The method according to claim 1, characterized in that After controlling the target object to execute the target action sequence in a subsequent application scenario, the method further includes: The application scene image frame sequence of the target object is determined according to the application scene image frames after executing the target action sequence.
10. The method according to claim 5, characterized in that The action sequence decider is obtained by performing deep reinforcement learning training on the target object, and includes: Acquire a training sample, wherein the training sample is determined according to an application scene image frame sequence of the target object in a training phase and an initial action sequence decider, the output result of the action sequence decider is a training action sequence, and the training sample at least includes an incentive value for the target object to execute the training action sequence; The action sequence output by the initial action decision controller is adjusted according to the incentive value of the training sample to obtain the action sequence decider.
11. A control device for a target object, characterized in that: The device comprises: An acquisition unit, used for acquiring an application scene image frame sequence of a target object; A feature sequence determination unit, used to obtain a feature sequence of the target object from the application scene image frame sequence; a target action sequence determination unit, configured to input the feature sequence into an action sequence decision device, and obtain a target action sequence selected by the action sequence decision device for the target object from action sequences of a set type according to the feature sequence, wherein the type of the target action sequence is determined according to the attribute information of the application, wherein the action sequence is obtained by chronologically sorting independent actions that a virtual object will perform in an application to achieve a certain goal; A control unit is used to control the target object to execute the target action sequence in a subsequent application scenario.
12. The device according to claim 11, characterized in that The action sequence decider is obtained by performing deep reinforcement learning training on the target object.
13. The device according to claim 12, characterized in that The training unit is specifically used for: Inputting the feature sequence into the convolution unit of the neural network model of the action sequence decider to obtain a first target feature; Determine a second target feature according to a state value function of the first target feature and an action advantage function of the first target feature; A target action sequence of the target object is determined according to the second target feature.
14. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the method according to any one of claims 1 to 10 are implemented.
15. A computer-readable storage medium, characterized in that: It stores a computer program executable by a computer device. When the program is run on the computer device, the computer device executes the steps of any method described in claims 1 to 10.
