Interactive control method, device, computer equipment and storage medium
By acquiring interaction status and screening candidate interaction actions, a target game tree is constructed, which solves the problem of high complexity of interaction actions in traditional technology and achieves efficient interaction control.
Patent Information
- Application Number
- CN202010908420.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-02
- Publication Date
- 2024-09-27
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In traditional technology, the efficiency of determining interactive actions is low, resulting in high complexity of interactive actions, making it difficult to effectively complete interactive tasks.
By obtaining the interaction status, determining the selection scores of candidate interactive actions, screening simulated interactive actions, and simulating execution until the depth threshold is reached, a target game tree is constructed, and based on this, the target interactive action is determined to improve search efficiency and accuracy.
It improves the search efficiency and accuracy of interactive actions, reduces the complexity of interactive tasks, and enhances the effectiveness of interactive control.
Smart Images

Figure CN112076475B
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to an interactive control method, apparatus, computer device and storage medium. Background Art
[0002] With the continuous development of science and technology, games have gradually become a popular entertainment program. For example, users can play chess and card games, such as Landlord game, through relevant game applications.
[0003] In traditional technology, human-computer battles can be carried out, and computer equipment simulates the results of executing various actions to determine the final interactive action to be performed. However, there is often a high complexity in determining the final interactive action to be performed, that is, the efficiency of determining the interactive action is low. Summary of the invention
[0004] Based on this, it is necessary to provide an interactive control method, device, computer equipment and storage medium to address the above technical problems.
[0005] An interactive control method, the method comprising: obtaining the current actual interactive state of an interactive task; determining the interactive action selection score corresponding to each candidate interactive action according to the current interactive state, wherein the initial current interactive state is the actual interactive state; screening and obtaining simulated interactive actions according to the interactive action selection scores corresponding to each candidate interactive action; simulating and executing each simulated interactive action to obtain a simulated interactive state; taking the simulated interactive state as the current interactive state, returning to the step of determining the interactive action selection score corresponding to each candidate interactive action according to the current interactive state, until the interactive task is completed or the simulation depth reaches a depth threshold, and obtaining a target game tree, the target game tree comprising state nodes corresponding to each current interactive state, executing simulated interactive actions in the interactive state corresponding to the parent state node, and obtaining the interactive state corresponding to the child state node; determining a target interactive action from the simulated interactive actions according to the target game tree, and controlling a target virtual object to execute the target interactive action.
[0006] An interactive control device, the device comprising: an actual interaction state acquisition module, used to acquire the current actual interaction state of an interactive task; an interaction action selection score determination module, used to determine the interaction action selection score corresponding to each candidate interaction action according to the current interaction state, wherein the initial current interaction state is the actual interaction state; a simulated interaction action screening module, used to screen and obtain simulated interaction actions according to the interaction action selection scores corresponding to each candidate interaction action; a simulated interaction state acquisition module, used to simulate and execute each simulated interaction action to obtain a simulated interaction state; a return module, used to take the simulated interaction state as the current interaction state, return to the step of determining the interaction action selection score corresponding to each candidate interaction action according to the current interaction state, until the interactive task is completed or the simulation depth reaches a depth threshold, and a target game tree is obtained, the target game tree includes state nodes corresponding to each current interaction state, and simulated interaction actions are executed in the interaction state corresponding to the parent state node to obtain the interaction state corresponding to the child state node; a target interaction action determination module, used to determine a target interaction action from the simulated interaction actions according to the target game tree, and control a target virtual object to execute the target interaction action.
[0007] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above-mentioned interactive control method when executing the computer program.
[0008] A computer-readable storage medium stores a computer program, which implements the steps of the above-mentioned interactive control method when executed by a processor.
[0009] The above-mentioned interactive control method, device, computer equipment and storage medium can determine the simulated interactive action according to the actual interactive state, simulate according to the simulated interactive action to obtain the simulated interactive state, use the simulated interactive state as the current interactive state, and return to the step of determining the interactive action selection score corresponding to each candidate interactive action according to the current interactive state until the interactive task is completed or the simulation depth reaches the depth threshold to obtain the target game tree. Therefore, the target game tree is a game tree that has been width-pruned based on the interactive action selection scores corresponding to the candidate interactive actions, and the simulated interactive action is determined based on the interactive action selection scores corresponding to the candidate interactive actions. Therefore, determining the target interactive action based on the game tree can not only improve the efficiency of searching the game tree, but also improve the accuracy of the obtained target interactive action. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] Figure 1 is an application environment diagram of an interactive control method in an embodiment;
[0011] Figure 2is a flow chart of an interactive control method in one embodiment;
[0012] Figure 3 is a schematic diagram of a target game tree in one embodiment;
[0013] Figure 4 A schematic diagram of a process of determining an interaction action selection score corresponding to each candidate interaction action according to a current interaction state in another embodiment;
[0014] Figure 5 A schematic diagram of features input to an action selection model in one embodiment;
[0015] Figure 6 A schematic diagram of determining a simulated interaction action based on a rule in one embodiment;
[0016] Figure 7 is a schematic diagram of a target game tree in one embodiment;
[0017] Figure 8 is a schematic diagram of a target game tree in one embodiment;
[0018] Fig. 9 is a schematic diagram of a target game tree in one embodiment;
[0019] Fig.10 A schematic diagram of a game tree obtained by pruning using other pruning algorithms in one embodiment;
[0020] Fig.11 A schematic diagram of a game tree obtained by pruning based on an alpha-beta algorithm and an action selection model in one embodiment;
[0021] Fig.12 is a schematic diagram of a CNN model in one embodiment;
[0022] Fig.13 Schematic diagram of Resnet 34 layers in one embodiment;
[0023] Fig.14 A schematic diagram of Resnet plus a cbam module in one embodiment;
[0024] Fig.15 is a schematic diagram of a cbam attention module in one embodiment;
[0025] Fig.16 is a schematic diagram of a cbam attention module in one embodiment;
[0026] Fig.17 is a structural block diagram of an interactive control device in one embodiment;
[0027] Fig.18 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0028] In order to make the purpose, technical solution and advantages 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.
[0029] The interactive control method provided by this application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. An interactive application, such as a Doudizhu game application, can be installed on the terminal 102. The interactive screen can be displayed through the interactive application, and the user corresponding to the terminal 102 can control the virtual object to perform the corresponding interactive action by operation, thereby changing the interactive screen. The server 104 can execute the interactive control method provided in the embodiment of the present application, and control the target virtual object that the server needs to control to perform the interactive action, thereby realizing the interaction with the virtual object controlled by the terminal 102. It can be understood that the method provided in the embodiment of the present application can also be executed by the terminal 102. Among them, the target virtual object controlled by the server 104 can be a virtual object that needs to be hosted for the game. For example, assuming that users A, B and C play the Doudizhu game, the virtual object corresponding to user C enters the hosting state, and the game AI (Artificial Intelligence) needs to control the virtual object instead of user C, then the server 104 can execute the method provided in the embodiment of the present application. Among them, entering the hosting state can be set according to the operation of user C or it can be set automatically. For example, when the network environment of the terminal of user C is not good, the hosting state can be automatically entered. The target virtual object controlled by the server may also be a virtual object assigned to the game AI in the human-computer battle mode. For example, when a user's request to play a game against the game AI is received, a preset role, such as a farmer, may be assigned to the game AI.
[0030] The terminal 102 may be, but is not limited to, various personal computers, laptop computers, smart phones, tablet computers, and portable wearable devices, and the server 104 may be implemented as an independent server or a server cluster consisting of multiple servers.
[0031] In one embodiment, Figure 2 As shown, an interactive control method is provided, which is applied to Figure 1 The server in the example is used to illustrate the following steps:
[0032] Step S202: obtaining the current actual interaction state of the interactive task.
[0033] Among them, interactive tasks can refer to tasks that require interaction through virtual objects, such as multi-player games, such as chess and card games. Chess and card games can be, for example, landlord games, upgrade games, and run fast games, etc. The current actual interaction state refers to the actual interaction state at the current moment. The interaction state may include at least one of the resources currently held by each virtual object or the resources that have been used. For chess and card games, the interaction state may include the cards that have been played and the cards currently held.
[0034] Specifically, when it is necessary to determine the target interactive action that the target virtual object needs to perform, the current actual interactive state of the interactive task can be obtained. For example, when the managed object is the landlord, if it is the landlord's turn to play a card, the current actual interactive state of the interactive task is obtained to determine how the landlord is currently going to play a card.
[0035] In some embodiments, for the Doudizhu game, the current game state may include at least one of the currently held cards, the position of the virtual object, the cards that have not been played, and the cards that have been played. The position of the virtual object is, for example, "landlord", "upper house", or "lower house".
[0036] Step S204: determining an interaction action selection score corresponding to each candidate interaction action according to the current interaction state.
[0037] Among them, the initial current interaction state is the actual interaction state. That is, when the simulated interaction action is determined for the first time, the actual interaction state is used as the current interaction state. For chess and card games, candidate interaction actions can be determined according to the card type to be played and the corresponding cards. For example, the candidate interaction action can be "play a straight 3, 4, 5, 6, 7", which means that the card type is "straight" and the cards are "3, 4, 5, 6, 7". The interaction action selection score represents the possibility of the interaction action being selected. The higher the score, the higher the possibility of the interaction action being selected. For example, the interaction action selection score can be expressed as a probability, and the probability of the interaction action output by the artificial intelligence model being selected can be used as the interaction action selection score. The interaction action selection score can also be obtained by at least one of the output of the model or the scoring according to the preset action scoring rules. The current interaction state refers to the current interaction state. When performing interaction simulation, the current interaction state is continuously updated. Candidate interaction actions refer to candidate interaction actions, which are determined based on the resources held by the target virtual object, and can be multiple. For example, assuming that the cards held by the target virtual object include a 3 and three 2s, the candidate interaction actions include "play a single card 3", "play three with three 2s and one 3", "play a pair of 2s" and "play a single card 2".
[0038] Specifically, the server can obtain the current interaction state, determine the interaction state features according to the current interaction state, input the interaction state features into the trained interaction action determination model (action selection model), and obtain the interaction action selection scores corresponding to each candidate interaction action. The server can also score based on the current interaction state based on the preset action scoring rules to obtain the interaction action selection scores corresponding to the candidate interaction actions. The server can also perform weighted summation of the interaction action selection scores output by the interaction action determination model and the interaction action selection scores obtained by the action scoring rules to obtain the interaction action selection scores corresponding to each candidate interaction action. For example, assuming that the interaction action selection score output by the interaction action determination model is 0.8, the corresponding weight is 9, and the interaction action selection score obtained by the action scoring rule is 10, and the corresponding weight is 1, then the interaction action selection score corresponding to the candidate interaction action is 0.8*9+10*1=17.2.
[0039] Step S206: Screening to obtain simulated interactive actions according to the interactive action selection scores corresponding to the candidate interactive actions.
[0040] Specifically, a simulated interactive action refers to an action that requires simulated interaction. That is, the action is not actually performed in the interactive task, but is simulated by the server. Assuming that the interactive action is executed, what is the interactive state obtained. There can be multiple candidate interactive actions, and the simulated interactive action is selected from the candidate interactive actions, or there can be multiple. The server can sort the interactive action selection scores corresponding to each candidate interactive action in order from large to small, and use the candidate interactive actions corresponding to the interactive action selection scores before the first sort as simulated interactive actions. The first sort can be set as needed, for example, it can be the 3rd in the case of normal interaction and the 5th in the endgame. For example, assuming there are 8 candidate interactive actions, the candidate interactive actions with scores before the 3rd or 5th can be selected as the interactive actions that need to be simulated to prune the game tree.
[0041] Step S208, simulating and executing each simulated interaction action to obtain a simulated interaction state.
[0042] Specifically, the simulated interaction state refers to the interaction state obtained after simulating the execution of the simulated interaction action. After obtaining the simulated interaction action, the action can be simulated and executed to obtain the simulated interaction state.
[0043] Step S210, determining whether the interactive task is completed or the simulation depth reaches a depth threshold.
[0044] Specifically, the simulation depth can be represented by the number of rounds of simulation or by the number of simulations, and the simulation depth can also be called the search depth. Each virtual object simulates the execution of an interactive action once as a round. For example, in Doudizhu, two farmers and a landlord each play a card once as a round. Completing an interactive task means that the interactive task has ended, and the depth threshold can be set as needed, for example, to 5. By setting the number threshold, the efficiency of determining the target interactive action can be improved. If the interactive task or the simulation depth reaches the depth threshold, the final target game tree is obtained, and step S212 is entered. Otherwise, the simulated interaction state can be used as the current interaction state, and the step of determining the interactive action selection score corresponding to each candidate interactive action according to the current interaction state is returned until the interactive task is completed or the simulation depth reaches the depth threshold, and the target game tree is obtained.
[0045] The target game tree includes state nodes corresponding to each current interaction state. The simulated interaction action is performed in the interaction state corresponding to the parent state node to obtain the interaction state corresponding to the child state node. The parent state node and the child state node are relative. Among the state nodes connected by adjacent paths, the previous state node is the parent state node, and the subsequent state node is the child state node of the target state node.
[0046] Step S212, determining a target interactive action from multiple simulated interactive actions according to the target game tree, and controlling the target virtual object to execute the target interactive action.
[0047] Specifically, the target interactive action can be 1. After obtaining the target game tree, backtracking can be performed based on the game tree to obtain a simulated interactive action that maximizes the benefit of the target virtual object as the target interactive action, and the target virtual object is controlled to perform the target interactive action. For example, assuming that the target interactive action is "playing a 3", and the target virtual object is Peasant A in the Landlord game, Peasant A is controlled to play a 3.
[0048] In some embodiments, the game tree can also be pruned based on the Alpha-Beta pruning algorithm, which is a search algorithm that aims to reduce the number of nodes evaluated by the minimax algorithm in its search tree. Its basic idea is to decide whether to continue the current search based on the current optimal result obtained in the previous layer.
[0049] The above-mentioned interactive control method can determine the simulated interactive action according to the actual interactive state, simulate according to the simulated interactive action to obtain the simulated interactive state, use the simulated interactive state as the current interactive state, and return to the step of determining the interactive action selection score corresponding to each candidate interactive action according to the current interactive state until the interactive task is completed or the simulation depth reaches the depth threshold to obtain the target game tree. Therefore, the target game tree is a game tree that has been width-pruned based on the interactive action selection scores corresponding to the candidate interactive actions, and the simulated interactive action is determined based on the interactive action selection scores corresponding to the candidate interactive actions. Therefore, determining the target interactive action based on the game tree can not only improve the efficiency of searching the game tree, but also improve the accuracy of the obtained target interactive action.
[0050] like Figure 3 Shown is a schematic diagram of the target game tree in some embodiments. Assume that the target virtual object is the landlord in Landlord, so the root node is the node corresponding to the landlord, and the leaf node can be the node corresponding to the upper house, the lower house or the landlord. The number under the leaf node represents the final profit value (interaction incentive score). Among them, the upper house and the lower house are relative to the landlord. After the landlord plays a card, the virtual object that plays a card is called the lower house. The upper house means that the landlord plays a card after the virtual object plays a card. For example, in the Landlord game, there are three virtual objects, the landlord, farmer A and farmer B. Suppose farmer A plays a card after the landlord plays a card, and farmer B plays a card after farmer A plays a card. Then farmer A is the lower house and farmer B is the upper house. "α-β pruning" refers to pruning using the Alpha-Beta pruning algorithm. By Figure 3It can be seen that the virtual object to be played corresponding to the state node changes with the game, "α:100" means that the α value in α-β pruning is 100, and "β:100" means that the β value in α-β pruning is 20. The server can determine the simulated interactive action based on the card-playing strategy and the game state. The card-playing strategy can be a residual network (Resnet), a CNN (convolutional neural networks) network or a rule strategy. For example, the probability s(a') of the action output by the model being selected or the score p(a') obtained by scoring according to the preset rules can be output. Therefore, the server can select the first three actions as simulated interactive actions according to the probability of the action output by the model being selected or the score obtained by scoring according to the preset rules. The first three actions refer to the scores or probabilities sorted in order from large to small, and the actions sorted in the first three. It can be understood that the number of simulated interactive actions can also be determined according to the specific situation. For example, when it is a normal game, the first three actions can be selected, and in the case of a stale game, the first five can be selected. The process of determining the simulated interactive action can be repeated until the search depth reaches the preset depth threshold K. Then we can backtrack to get the benefits that can be achieved by executing actions a1, a2, and a3, and then choose the action with the largest benefit as the target interaction action.
[0051] In one embodiment, Figure 4 As shown, determining the interaction action selection score corresponding to each candidate interaction action according to the current interaction state includes:
[0052] Step S402: Obtain a first interaction feature according to the historical interaction resources corresponding to each historical interaction action and the historical interaction action types corresponding to the historical interaction resources.
[0053] Among them, the historical interaction action refers to the action that has been executed in the interactive task when it is in the current interactive state. The historical interaction resource refers to the resource used by the historical interaction action. The historical interaction action type refers to the type of the action. The historical interaction action type corresponding to the interaction resource can be obtained by combining the historical interaction resources, for example, it can be a straight, a pair, a rocket, or a bomb. For example, assuming that the cards played in the historical interaction action are "3, 4, 5, 6, 7", the historical interaction resources are "3, 4, 5, 6, 7", and the historical interaction action type is "straight". The interaction feature can be represented by a feature value. For example, the feature value corresponding to the historical interaction resource and the feature value corresponding to the historical interaction action type can be obtained to form a first interaction feature.
[0054] In some embodiments, obtaining the first interaction feature based on the historical interaction resources corresponding to each historical interaction action and the historical interaction action types corresponding to the historical interaction resources includes: determining a resource characteristic value based on the historical interaction resources corresponding to each historical interaction action; determining a historical action type characteristic value based on the historical interaction action types corresponding to the historical interaction resources; determining a first benefit impact characteristic value based on the impact of the historical interaction action types on the interaction benefit value; and obtaining the first interaction feature based on the resource characteristic value, the historical action type characteristic value, and the benefit impact characteristic value.
[0055] Specifically, the resource feature value is a feature value representing a resource. For example, if the resource exists, the corresponding feature value is a first preset value such as 1, and if it does not exist, the corresponding feature value is a second preset value such as 0. The historical action type feature value refers to a feature value representing an interactive action type. For example, if the feature value corresponding to the historical interactive action type is a first preset value such as 1, and if it is not a historical interactive action type, the corresponding feature value is a second preset value such as 0. The impact of the historical interactive action type on the interactive benefit value is determined according to the benefit determination rule of the interactive application. The benefit is brought by performing an interactive task, for example, the benefit can be obtained by obtaining happy beans or points. For example, in the Landlord game, "bombs" will increase the winning multiples. Assuming that the historical interactive action type is a bomb, the corresponding benefit impact feature value is 1. Assuming that the historical interactive action type is not a bomb and will not increase the winning multiples, the corresponding benefit impact feature value is 0. The resource feature value, the historical action type feature value, and the benefit impact feature value can be spliced to obtain the first interactive feature. By introducing the benefit impact feature value, the action selection model can be made more sensitive to the acquisition of benefits, and the action selected by the action selection model can be made more accurate.
[0056] In some embodiments, the revenue impact characteristic value can be determined according to the degree of influence of the historical action type on the revenue. For example, for the bomb action type, assuming that the multiple of winning increased by the bomb is 1, the revenue impact characteristic value is 1, and assuming that the multiple of winning increased by the bomb is 2, the revenue impact characteristic value is 2.
[0057] Step S404: determining a second interaction feature according to the interaction resource currently held by the target virtual object.
[0058] Specifically, the interactive resource currently held by the target object and the interactive action type corresponding to the interactive resource can be obtained to obtain the second interactive feature. For example, the feature value corresponding to the currently held interactive resource and the feature value corresponding to the corresponding interactive action type are obtained to form the second interactive feature. The interactive action type that the interactive resource can correspond to refers to the action type that can be obtained by combining the current interactive resource, which can also be called the card type in the Landlord game.
[0059] There may be multiple interaction action types obtained by combining the currently held interaction resources, and the feature value corresponding to each interaction action type may be obtained and combined to obtain the second interaction feature. For example, for "three 2s", the corresponding card types may be single cards, pairs, and three bands.
[0060] In some embodiments, the second benefit impact characteristic value may also be determined based on the interaction action type obtained by combining the interaction resources currently held by the target virtual object and the impact on the interaction benefit value. The specific method for obtaining the first benefit impact characteristic value may be referred to, and will not be repeated here.
[0061] Step S406: input the first interaction feature and the second interaction feature into the action selection model to obtain an interaction action selection score corresponding to each candidate interaction action.
[0062] Specifically, the action selection model may be a deep learning model, and the action selection model may be a residual network model or a convolutional network model. After obtaining the first interaction feature and the second interaction feature, the first interaction feature and the second interaction feature may be input into the trained action selection model to obtain an interaction action selection score corresponding to the candidate interaction action.
[0063] In the embodiment of the present application, the first interactive feature is obtained by the information corresponding to the historical interactive action, and the second interactive feature is obtained by the interactive resources held, so that the model can obtain an accurate action selection score in combination with history and the current situation. By obtaining the historical action type feature value according to the historical interactive action type, the model can learn the law of executing the action type, and improve the accuracy of the obtained action selection score. Taking Doudizhu as an example, adding the representation of action types such as 15 types of cards can make the action selection model more sensitive to the distribution of card types, which is conducive to capturing the approximate distribution of cards of opponents and teammates, and helps to choose a suitable card type to play cards when the player actively plays cards, because the choice of card type when actively playing cards is very important for the decision to play cards. If it is perceived from the playing record that the opponent often uses pairs and teammates often use single cards, then the model prediction will tend to the choice of single cards.
[0064] Table 1 Card type diagram
[0065] Card Type symbol example Single Card Solo 3,4,5,0,K Straight SoloC 34567,4567890J Pair Pair 33,44,55 Connect PairC 334455,77889900JJ Three Trio 333,777 airplane TrioC 333444,666777888 Three-band single TrioK 3334,888K Aircraft single TrioCK 33344456,6667778889JK Three-band pair TrioPK 33344,888KK Aircraft with pair TrioCPK 3334445566,66677788899JJKK Four-band single BombK 333344,88889K Four-band pair BombPK 33334455,888899KK bomb Bomb 3333,8888,2222 King bomb Rocket wxya Pass Pass PASS
[0066] For example, in the Landlord game, Figure 5As shown, it is a schematic diagram of the feature of inputting into the action selection model in some embodiments.15 rows and 20 columns can be used to represent the card information, and 22 layers of card information are used to represent the current cards, historical playing records, unknown cards, current hand and current player.Each row of 15 rows corresponds to 15 kinds of cards: 3, 4, 5, 6, 7, 8, 9, 0, J, Q, K, A, 2, w, W, wherein 0 represents 10, w represents Xiao Wang, and W represents Da Wang.In 20 columns, respectively correspond to the number of cards (1st-4th columns), whether it is a bomb (5th column), 15 kinds of card types (6th-20th columns), wherein 15 kinds of card types (interactive action types) are as shown in table 1, and card types represent all card types that can be combined, and are marked in the corresponding card type position.Because bombs can suppress any card type outside non-bombs, feature marking can be performed to make the model better utilize this feature to learn the playing rules.
[0067] For example, assuming that the current player's hand (the cards currently held) are "3, 3, 3, 4, 5, w, W" and he actively plays cards, then a 15-row and 20-column two-dimensional matrix is used as shown in Table 2, and the blank space represents the value of 0.
[0068] Table 2 Two-dimensional matrix representation of hand cards
[0069] 0 1 2 3 4 5 6 7 8 9 10 11 12 13 15 16 17 18 19 20 3 1 1 1 1 1 1 1 4 1 1 5 1 1 6 7 8 9 0 J Q K A 2 w 1 1 1 W 1 1 1 1
[0070] The "3-W" in the first column indicates that the cards increase from 3 to the King, the column "0-3" indicates the number of each card, the column "4" indicates whether the card can form a bomb, and the column "6-20" indicates the distribution of the cards that can be formed by the card. For example, "11100101010100000000" in row "3" indicates that there are 3 cards of size 3, which are not bombs, and can form single cards, pairs, three bands, and three bands. "10000100000000000000" in row "4" indicates that there is 1 card of size 4, which is not a bomb and can form a single card.
[0071] In a three-dimensional data structure with a shape of 15x20x22, the 1st, 20th and 22nd layers can be represented by Table 2 to record the types of cards that can be formed by the hand. For the card-playing records of the 2nd to 19th layers, it is only necessary to record the actual player's card-playing type. For example, if the last card played was 33, it only needs to be represented as 3: 110000010000000000000. That is, there are 2 cards of size 3, and the card type is a pair. For cards 4 to W, all are 0. The last layer represents the current player, and -1, 0, and 1 can be used to represent three players. If it is the landlord, then all 15 rows and 20 columns are 0, if it is the previous player, all are -1, and if it is the next player, all are 1, as shown in Table 3.
[0072] Table 3 Game player-download data representation
[0073] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
[0074] In some embodiments, the interaction action selection score can also be obtained according to a preset rule strategy. Determining the interaction action selection score corresponding to each candidate interaction action according to the current interaction state includes: obtaining the current interaction resource currently held by the target virtual object; splitting the current interaction resource according to multiple preset resource splitting strategies to obtain a candidate resource splitting set corresponding to each resource splitting strategy; obtaining a splitting set score corresponding to the candidate resource splitting set according to the action type score corresponding to each interaction action type in the candidate resource splitting set corresponding to the candidate resource splitting strategy; filtering the target resource splitting set according to the splitting set score corresponding to the candidate resource splitting set; and determining the interaction action selection score of the candidate interaction action corresponding to the target resource splitting set.
[0075] Specifically, the target virtual object refers to the virtual object for which the interactive action currently needs to be determined. The current interactive resources currently held are determined according to the actual situation. For chess and card games, splitting is to split the currently held cards into a set obtained by combining one or more card types, and the resource split set refers to the set obtained by splitting. A resource split set may include multiple interactive action types (card types) obtained by splitting. For example, assuming that the cards held are "3, 3, 3, 4, 5, w, W". Then one of the resource split sets may include three interactive action types, namely "3 3s with a 4", "single card 5" and "king bomb wW", that is, three card types.
[0076] The resource splitting strategy can be pre-set, for example Figure 6As shown, it can be preset to follow two basic orders: 1. Rocket> Straight> Bomb> Three-band> Pair> Single card. 2. Rocket> Bomb> Three-band> Straight> Pair> Single card, respectively split the resources currently held by the target virtual object into up to four hand combinations, and then split again according to the multi-straight splitting strategy, multi-three-card splitting strategy, multi-pair splitting strategy and multi-bomb splitting strategy to obtain the candidate resource splitting set corresponding to each strategy. Multi-straight splitting means that you tend to get more straights when splitting. Multi-three-card splitting strategy means that you tend to get more three cards when splitting. Multi-pair splitting strategy means that you tend to get more pairs when splitting. Multi-bomb splitting strategy means that you tend to get more bombs when splitting. The server can be pre-set with a score corresponding to each interactive action type, which can be set as needed, for example, as shown in Table 4. The scores of the interactive action types in each candidate resource splitting set are added to obtain the score of the candidate resource splitting set (split set score). The candidate resource splitting set with the highest splitting set score can be used as the target resource splitting set. The actions corresponding to the target resource split set are taken as candidate interaction actions, and the selection scores corresponding to the candidate interaction actions are obtained. The selection scores corresponding to the candidate interaction actions are obtained based on the number of card plays, such as Figure 6 As shown, the minimum number of card-playing times corresponding to each candidate interactive action as a card-playing action can be obtained. The smaller the corresponding number of card-playing times, the higher the corresponding interactive action selection score. For example, the corresponding relationship between the number of card-playing times and the score can be set. When the number of card-playing times is 10, the score is 0, and when the number of card-playing times is 5, the score is 60.
[0077] Table 4 Card Type Scoring Table
[0078] Card Type Fraction Single Card 1 Pair 2 Three belts 3 Shan Shun 4 Connect 5 airplane 6 bomb 7 Rocket 8
[0079] In some embodiments, determining a target interaction action from multiple simulated interaction actions according to a target game tree includes: determining the target character corresponding to the target virtual object, and determining the interaction incentive score corresponding to the leaf node of the target game tree according to the interaction state corresponding to the leaf node and the target character; tracing back from the leaf node according to the interaction incentive score corresponding to the leaf node to obtain the interaction incentive score corresponding to the root node of the target game tree; and using the simulated interaction action corresponding to the interaction incentive score corresponding to the root node as the target interaction action.
[0080] The target role corresponding to the target virtual object can be a "landlord" or a farmer, and the role can also be called a camp. A leaf node refers to a node without child nodes in the target game tree. The interaction incentive score corresponding to the leaf node is calculated from the perspective of the target role. For example, when the target role is a landlord, the income corresponding to the landlord is calculated. When the target role is a farmer, the overall income corresponding to the farmer is calculated. For example, when there are two farmers, the overall income of the two farmers is calculated.
[0081] When the leaf node is the final node of the interactive task, the interactive state corresponding to the leaf node can be loss or win. For example, for the node that finally determines the win or loss of the game, the incentive score can be determined according to the final result of the interactive task. For example, if the target character wins, the incentive score can be a first score, and when the target character loses, the incentive score can be a second score, and the first score is greater than the second score, for example, the first score is positive and the second score is negative.
[0082] During backtracking, when the target role is consistent with the role corresponding to the parent node of the target game tree, the maximum interaction incentive score corresponding to the child node of the parent node is obtained as the interaction incentive score corresponding to the parent node. When the target role is inconsistent with the role corresponding to the parent node of the target game tree, the minimum interaction incentive score corresponding to the child node of the parent node is obtained as the interaction incentive score corresponding to the parent node. That is, the interaction incentive score of the parent node is determined according to the interaction incentive score of its corresponding child node. If the role corresponding to the parent node is consistent with the target role, for example, both are farmers, and there are three child nodes under the parent node, then the largest interaction incentive score among the interaction incentive scores corresponding to the three child nodes is taken as the interaction incentive score of the parent node. If the role corresponding to the parent node is inconsistent with the target role, for example, one is a farmer and the other is a landlord, and there are three child nodes under the parent node, then the smallest interaction incentive score among the interaction incentive scores corresponding to the three child nodes is taken as the interaction incentive score of the parent node. By continuously backtracking, the interaction incentive score corresponding to the root node can be obtained, and the simulated interaction action corresponding to the interaction incentive score corresponding to the root node is obtained as the target interaction action.
[0083] In the embodiment of the present application, when the target role is inconsistent with the role corresponding to the parent node of the target game tree, the minimum interactive incentive score corresponding to the child node of the parent node is obtained as the interactive incentive score corresponding to the parent node. It is equivalent to assuming that the opponent (another role) will introduce us into the direction of the pattern with the lowest value in theory at present in every step, that is, the opponent has perfect decision-making ability. Therefore, our strategy should be to choose the best of the worst case that the opponent can achieve, that is, to minimize the loss caused to me by the opponent under perfect decision-making. And by obtaining the maximum interactive incentive score corresponding to the child node of the parent node as the interactive incentive score corresponding to the parent node when the target role is consistent with the role corresponding to the parent node of the target game tree, it can make the decision to make the greater the benefit we obtain when we make a decision. Therefore, it is possible to obtain a target interactive action with good benefits.
[0084] In the embodiment of the present application, by calculating the incentive corresponding to the role, that is, calculating the overall benefits corresponding to each role in the interactive task as a whole, the real result of the interactive task can be better reflected, and the accuracy of selecting the target interactive action can be improved. Take the landlord game as an example. In the landlord game, there is a relationship of cooperation and competition. Assuming that there are two farmers and one landlord in the landlord, and the cards are played according to the position, three intelligent bodies (game AI) can be constructed to determine the game tree, that is, the game AI corresponding to the upper house, the game AI corresponding to the lower house, and the game AI corresponding to the landlord. Each game AI is responsible for determining the card-playing action of the virtual object corresponding to it. Therefore, the role of the farmer chooses to be beneficial to the common interests of the two farmers during the game process, rather than just beneficial to himself. Sometimes, the farmer can even lose his own interests and maximize the common interests. For example, the upper house will top the landlord's card, which can help the lower house pass the small card and force the landlord to play a big card, so that the landlord's card power is getting weaker and weaker, and the lower house's card power is getting stronger and stronger. Therefore, the step of determining the interactive incentive score by the embodiment of the present application can achieve the effect of farmers cooperating against the landlord.
[0085] like Figure 7 The figure shows a target game tree in which the target virtual object corresponding to the root node is the landlord. It indicates that the virtual object for which the target interaction action is to be determined is the landlord. When calculating the interaction incentive score of the leaf node, the corresponding income of the landlord can be calculated. If the node in the game tree is the next or previous player, then when backtracking, the node will select the action with the smallest reward for the landlord. For example Figure 7For the parent nodes including the interaction incentive scores of "-150" and "50", since the parent node is the previous home, which is a farmer role, and is inconsistent with the landlord role, the corresponding interaction incentive score is "-150". In this way, after continuous backtracking, it is calculated that the interaction incentive score corresponding to executing the simulated interaction action a1 is 50, the interaction incentive score corresponding to executing the simulated interaction action a2 is -150, and the interaction incentive score corresponding to executing the simulated interaction action a3 is -1000. Therefore, the simulated interaction action a1 can be used as the target interaction action, and "the next home executes min" means that the next home executes the action that minimizes the incentive score, and "the landlord executes max" means that the landlord executes the action that maximizes the incentive score.
[0086] like Figure 8 As shown, it is a schematic diagram of the target game tree where the target virtual object corresponding to the root node is the next home. It indicates that the virtual object for which the target interactive action is currently to be determined is the next home. In the simulated battle, each node will calculate the overall reward of the peasant side for taking different card-playing actions. If the parent node is the next home or the previous home, then the action that maximizes the overall reward of the peasant side will be taken. If it is the landlord, the action that minimizes the overall reward of the peasant side will be chosen. Referring to the above method for determining the interactive incentive score corresponding to the root node, it can be obtained that the target interactive action to be executed is the simulated interactive action a2 or the simulated interactive action a3. When the scores of a2 and a3 are the same, any one of a2 or a3 can be selected as the target interactive action.
[0087] like Fig. 9 As shown, it is a schematic diagram of the target game tree where the target virtual object corresponding to the root node is the previous player. It indicates that the virtual object for the current target interactive action to be determined is the previous player. In the simulated battle, the node corresponding to the landlord minimizes the farmer's reward, and the node corresponding to the farmer maximizes the farmer's joint reward. Referring to the above method for determining the interactive incentive score corresponding to the root node, it can be obtained that the target interactive action to be executed is the simulated interactive action a2 or the simulated interactive action a1.
[0088] In some embodiments, the interaction incentive score corresponding to the leaf node can also be determined according to at least one of the simulated interaction actions or the depth of the simulation performed from the root node to the leaf node. Among them, the depth of the simulation is negatively correlated with the interaction incentive score. The interaction incentive score can be determined according to the role cooperation degree corresponding to the simulated interaction action and the influence on the income. The cooperation degree is positively correlated with the interaction incentive score, and the influence of the income and the interaction incentive score are determined according to the win-loss result. For example, assuming that the farmer uses a bomb to blow up his teammates, resulting in the loss of the farmer in the simulated battle, indicating that the cooperation degree is poor, then the interaction incentive score can be reduced. If the bomb is used, the bomb will double the win or loss. If the battle result is a win, the more bombs are used, the higher the interaction incentive score. If the battle result is a loss, the more bombs are used, the lower the interaction incentive score. When calculating the final interaction incentive score, it can be obtained by weighted summing according to each interaction incentive score and the corresponding weight. For example, the weight can be divided into 4 levels, represented by extremely high, high, medium, and low, respectively. The specific weight value can be set as needed, and the score corresponding to the influencing factor can be set as needed.
[0089] ·Win or lose the game (very high): The peasants win if either side wins, and winning or losing is the first goal.
[0090] ·Whether to bomb teammates (high): Whether the peasants use bombs to bomb teammates, causing the peasants to lose the simulated battle. In the stage where it is uncertain whether to win, bombs should be avoided as much as possible.
[0091] Number of bombs (high): Bombs will double your wins and losses, so you need to pay special attention to the number of bombs that may be generated in the simulated battle. The more bombs you have, the better when you win, and the fewer bombs you have, the better when you lose.
[0092] Is it spring (high): Spring can double the winnings and losses, so it can be equivalent to the effect of a bomb
[0093] Whether to actively drop bombs (high): If it is not a special situation to win, try to reduce this situation
[0094] ·Whether to suppress the enemy's cards (medium): Did the peasant side suppress the cards when it could have, allowing the landlord to play cards, or did the landlord allow the peasant to play cards.
[0095] ·Whether to suppress teammates to play cards (medium): Whether the peasant side suppresses teammates when it is unnecessary, thereby creating more advantages for the enemy side.
[0096] Simulated battle rounds (low): The number of rounds from the current game state to the end of the game or reaching the specified depth. The fewer the better.
[0097] like Fig.10, which is a schematic diagram of a game tree pruned using other pruning algorithms in some embodiments, where A, B, and C represent simulated interactive actions. Fig.11 This is a schematic diagram of a game tree obtained by pruning based on the alpha-beta algorithm and the action selection model provided by the embodiments of the present application in some embodiments. The numbers in the box represent the interaction incentive score, from Fig.10 as well as Fig.11 It can be seen that the game tree obtained by the ordinary pruning algorithm needs to search 18 leaf nodes, while after pruning by the alpha-beta algorithm and the action selection model, only 9 leaf nodes need to be searched to obtain the optimal path, and pruning with the alpha-beta algorithm does not affect the optimal solution.
[0098] In game tree pruning, deep learning models can be used for card-playing actions, i.e. pruning in the width direction, or rule strategies can be used for pruning. The deep learning model can use a CNN model, a Resnet residual network, or a Resnet+CBAM (Convolutional Block Attention Module Convolutional Block Attention Module) network structure.
[0099] The structure corresponding to the CNN model can be as follows Fig.12 As shown in the figure, it contains 3-5 convolutional modules (blocks), each convolutional block includes 2 convolutional layers (con), the size is 3*3, the dimension is 64, 2 normalization layers (Batch Norm) and an activation layer (Relu), which are stacked in the order shown in the figure. Finally, through an average pooling layer (Avg Pool) and a fully connected layer (FC), softmax is performed to predict the probability of each card-playing action. The formula for calculating the probability of the card-playing action is shown in formula (1), S(i) represents the probability corresponding to the i-th candidate interaction action, e i represents the probability of the action selection model output, and n is the number of candidate interaction actions. The convolution kernel size of the convolution layer can be a 3x3 window with 64 filters and a step size of 1.
[0100]
[0101] Fig.13 It is a Resnet 34-layer residual network model. Fig.14It is a residual network model of Resnet+cbam module. One feature of residual network that is different from ordinary CNN is that the output of each convolution block is added to the input of the convolution block and transmitted to the next convolution block. The formula is shown in formula (2). This can effectively avoid gradient vanishing in deep model training and accelerate model convergence. In Resnet, adding channel-based attention weights and spatial attention modules between convolution layers in each convolution block can effectively make the model focus on important information at each layer and obtain better feature representation.
[0102] y=f(x)+x (2)
[0103] The specific structure of the cbam attention module is as follows Fig.15 As shown in 16, the channel-based attention weight (channel attention Mc) uses a shared multi-layer perceptron (shared MLP) to calculate the attention vector, and the spatial attention (spatial attention Ms) uses a 7x7 convolutional layer to calculate the attention vector. The calculation formulas of Mc and Ms are shown in formulas (3) and (4), and "σ" represents the activation function. "AvgPool" represents average pooling and "MaxPool" represents maximum pooling. Conv 7x7 It means convolution using 7*7 convolution kernel, and F represents the input feature.
[0104] M c F=σ(MLP(AvgPool(F))+MLP(MaxPool(F))) (3)
[0105] M s F = σ(Conv 7x7 ([AvgPool(F));MLP(MaxPool(F)]) (4)
[0106] The above three models can be trained using 4 million valid sample data from 1 million games. In actual samples, the sample ratio of single cards and pairs is much higher than that of other types of cards. If no balancing is done, the robot will rarely play straights, pairs, airplanes, etc. Therefore, sample balancing is performed during sample selection.
[0107] The loss function of the model uses logarithmic cross entropy, as shown in formula (5), where yi is the one-hot representation of the category, xi is the feature value of the fully connected layer input, and w is the model parameter of the fully connected layer. Of course, you can also use loss functions such as HingeLoss, or add regularized loss terms such as L2 loss.
[0108]
[0109] The optimizer for model training compares three optimizers: adam, adadelta, and sgdm. Taking the resnet-based model as an example, sdgm performs best. In the early stage, adam and adadelta are faster than sgdm in training, but they cannot continue to optimize after reaching an accuracy of about 70%. Although sgdm is slower than the other two optimizers, it can reach an accuracy of about 80%, and with the addition of the cbam attention module, it can reach an accuracy of about 82%, of which the accuracy of the ordinary CNN model can reach 74.5%. The following is a comparison of the three models. The top3 (top 3) of the three models can basically reach 97%, and the top5 can reach 99%. Therefore, the model can be used to predict the simulated interaction actions of top3-top5 as the reason for the width pruning of the game tree. Using the search of the game tree to make up for the error rate of top120%+ can greatly improve the intelligence of the robot.
[0110] From CNN, Resnet to Resnet+cbam models, the number of model parameters gradually increases, and the training time also gradually increases. On a 1080P GPU, CPU 4 core 16G machine, the training time for CNN is about 12 hours, Resnet is 72 hours, and Resnet+cbam is 96 hours.
[0111] It should be understood that, although the various steps in the above flowchart are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the above flowchart may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0112] In one embodiment, Fig.17 As shown, an interactive control device is provided, comprising the following modules:
[0113] The actual interaction state acquisition module 1702 is used to acquire the current actual interaction state of the interactive task;
[0114] An interaction action selection score determination module 1704 is used to determine the interaction action selection score corresponding to each candidate interaction action according to the current interaction state, wherein the initial current interaction state is the actual interaction state;
[0115] A simulated interactive action screening module 1706 is used to screen simulated interactive actions according to the interactive action selection scores corresponding to each candidate interactive action;
[0116] A simulation interaction state obtaining module 1708 is used to simulate and execute each simulation interaction action to obtain a simulation interaction state;
[0117] Return module 1710, used to use the simulated interaction state as the current interaction state, return to the step of determining the interaction action selection score corresponding to each candidate interaction action according to the current interaction state, until the interactive task is completed or the simulation depth reaches the depth threshold, and obtain the target game tree, the target game tree includes state nodes corresponding to each current interaction state, and execute the simulated interaction action in the interaction state corresponding to the parent state node to obtain the interaction state corresponding to the child state node;
[0118] The target interactive action determination module 1712 is used to determine the target interactive action from the simulated interactive actions according to the target game tree, and control the target virtual object to perform the target interactive action.
[0119] In some embodiments, the simulated interaction action screening module is used to sort the interaction action selection scores corresponding to the candidate interaction actions in descending order, and use the candidate interaction actions corresponding to the interaction action selection scores ranked before the first sort as simulated interaction actions.
[0120] In some embodiments, the interaction action selection score determination module includes: a first interaction feature acquisition unit, used to obtain a first interaction feature based on historical interaction resources corresponding to each historical interaction action and the historical interaction action type corresponding to the historical interaction resource; a second interaction feature acquisition unit, used to determine a second interaction feature based on the interaction resources currently held by the target virtual object; an interaction action selection score determination unit, used to input the first interaction feature and the second interaction feature into the action selection model to obtain an interaction action selection score corresponding to each candidate interaction action.
[0121] In some embodiments, the first interaction feature obtaining unit is used to: determine the resource characteristic value according to the historical interaction resources corresponding to each historical interaction action; determine the historical action type characteristic value according to the historical interaction action type corresponding to the historical interaction resource; determine the first benefit impact characteristic value according to the impact of the historical interaction action type on the interaction benefit value; obtain the first interaction feature according to the resource characteristic value, the historical action type characteristic value and the benefit impact characteristic value.
[0122] In some embodiments, the interaction action selection score determination module is used to: obtain the current interaction resource currently held by the target virtual object; split the current interaction resource according to multiple preset resource splitting strategies to obtain a candidate resource splitting set corresponding to each resource splitting strategy; obtain a splitting set score corresponding to the candidate resource splitting set according to the action type score corresponding to each interaction action type in the candidate resource splitting set corresponding to the candidate resource splitting strategy; obtain a target resource splitting set according to the splitting set score corresponding to the candidate resource splitting set; and determine the interaction action selection score of the candidate interaction action corresponding to the target resource splitting set.
[0123] In some embodiments, the target interactive action determination module is used to: determine the target role corresponding to the target virtual object, and determine the interactive incentive score corresponding to the leaf node of the target game tree according to the interactive state corresponding to the leaf node and the target role; trace back from the leaf node according to the interactive incentive score corresponding to the leaf node to obtain the interactive incentive score corresponding to the root node of the target game tree; wherein, when the target role is consistent with the role corresponding to the parent node of the target game tree, obtain the maximum interactive incentive score corresponding to the child node of the parent node as the interactive incentive score corresponding to the parent node; when the target role is inconsistent with the role corresponding to the parent node of the target game tree, obtain the minimum interactive incentive score corresponding to the child node of the parent node as the interactive incentive score corresponding to the parent node; and use the simulated interactive action corresponding to the interactive incentive score corresponding to the root node as the target interactive action.
[0124] For the specific definition of the interactive control device, please refer to the definition of the interactive control method above, which will not be repeated here. Each module in the above-mentioned interactive control device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0125] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig.18 As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store interactive control data. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, an interactive control method is implemented.
[0126] Those skilled in the art will understand that Fig.18 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0127] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps of the above-mentioned interactive control method when executing the computer program.
[0128] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned interactive control method are implemented.
[0129] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0130] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0131] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. An interactive control method, characterized in that: The method comprises: Get the current actual interaction status of the interactive task; Determine an interaction action selection score corresponding to each candidate interaction action according to the current interaction state, wherein the initial current interaction state is the actual interaction state; Filtering to obtain simulated interactive actions according to the interactive action selection scores corresponding to the candidate interactive actions; Simulate and execute each of the simulated interaction actions to obtain a simulated interaction state; The simulated interaction state is used as the current interaction state, and the step of determining the interaction action selection score corresponding to each candidate interaction action according to the current interaction state is returned to until the interactive task is completed or the simulation depth reaches the depth threshold, and a target game tree is obtained, wherein the target game tree includes state nodes corresponding to each current interaction state, and simulated interaction actions are performed in the interaction state corresponding to the parent state node to obtain the interaction state corresponding to the child state node; the target game tree is a game tree that is width pruned based on the interaction action selection score corresponding to the candidate interaction action; Determining a target interactive action from the simulated interactive actions according to the target game tree, and controlling a target virtual object to perform the target interactive action; Wherein, determining the target interactive action from the simulated interactive actions according to the target game tree includes: Determine the target role corresponding to the target virtual object, and determine the interaction incentive score corresponding to the leaf node of the target game tree according to the interaction state corresponding to the leaf node and the target role; According to the interaction incentive score corresponding to the leaf node, backtracking is performed from the leaf node to obtain the interaction incentive score corresponding to the root node of the target game tree; wherein, when the target role is consistent with the role corresponding to the parent node of the target game tree, the maximum interaction incentive score corresponding to the child node of the parent node is obtained as the interaction incentive score corresponding to the parent node; when the target role is inconsistent with the role corresponding to the parent node of the target game tree, the minimum interaction incentive score corresponding to the child node of the parent node is obtained as the interaction incentive score corresponding to the parent node; The simulated interactive action corresponding to the interactive incentive score corresponding to the root node is used as the target interactive action.
2. The method according to claim 1, characterized in that The step of selecting and obtaining a simulated interactive action according to the interactive action selection scores corresponding to each of the candidate interactive actions includes: The interaction action selection scores corresponding to the candidate interaction actions are sorted in descending order, and the candidate interaction actions corresponding to the interaction action selection scores that are sorted before the first sorting order are taken as simulated interaction actions.
3. The method according to claim 1, characterized in that Determining the interaction action selection score corresponding to each candidate interaction action according to the current interaction state includes: Obtaining a first interaction feature according to historical interaction resources corresponding to each historical interaction action and historical interaction action types corresponding to the historical interaction resources; Determining a second interaction feature according to the interaction resource currently held by the target virtual object; The first interaction feature and the second interaction feature are input into an action selection model to obtain an interaction action selection score corresponding to each candidate interaction action.
4. The method according to claim 3, characterized in that The obtaining of the first interaction feature according to the historical interaction resources corresponding to each historical interaction action and the historical interaction action type corresponding to the historical interaction resources includes: Determine resource characteristic values according to historical interaction resources corresponding to each historical interaction action; Determine a historical action type characteristic value according to the historical interaction action type corresponding to the historical interaction resource; Determine a first benefit impact characteristic value according to the impact of the historical interaction action type on the interaction benefit value; A first interaction feature is obtained according to the resource feature value, the historical action type feature value, and the benefit impact feature value.
5. The method according to claim 1, characterized in that Determining the interaction action selection score corresponding to each candidate interaction action according to the current interaction state includes: Acquire the current interactive resource currently held by the target virtual object; Splitting the current interactive resources according to multiple preset resource splitting strategies to obtain a candidate resource splitting set corresponding to each resource splitting strategy; Obtaining a split set score corresponding to the candidate resource split set according to the action type score corresponding to each interactive action type in the candidate resource split set corresponding to the candidate resource split strategy; The target resource split set is obtained by screening according to the split set scores corresponding to the candidate resource split set; Determine an interaction action selection score of the candidate interaction action corresponding to the target resource split set.
6. The method according to claim 1, characterized in that The determining the interaction incentive score corresponding to the leaf node includes: The interaction incentive score is determined according to the role cooperation degree corresponding to the simulated interaction action and the influence on the profit; the role cooperation degree is positively correlated with the interaction incentive score, and the influence on the profit and the interaction incentive score are determined according to the win-loss result.
7. An interactive control device, characterized in that: The device comprises: The actual interaction state acquisition module is used to obtain the current actual interaction state of the interactive task; An interaction action selection score determination module, used to determine the interaction action selection score corresponding to each candidate interaction action according to the current interaction state, wherein the initial current interaction state is the actual interaction state; A simulated interactive action screening module, used for screening simulated interactive actions according to the interactive action selection scores corresponding to the candidate interactive actions; A simulated interaction state obtaining module is used to simulate and execute each of the simulated interaction actions to obtain a simulated interaction state; A return module is used to take the simulated interaction state as the current interaction state, return the step of determining the interaction action selection score corresponding to each candidate interaction action according to the current interaction state, until the interactive task is completed or the simulation depth reaches the depth threshold, and obtain a target game tree, wherein the target game tree includes state nodes corresponding to each current interaction state, and performs simulated interaction actions in the interaction state corresponding to the parent state node to obtain the interaction state corresponding to the child state node; the target game tree is a game tree that is width pruned based on the interaction action selection score corresponding to the candidate interaction action; A target interactive action determination module, used to determine a target interactive action from the simulated interactive actions according to the target game tree, and control a target virtual object to perform the target interactive action; Among them, the target interactive action determination module is also used to: confirm the target role corresponding to the target virtual object, and determine the interactive incentive score corresponding to the leaf node of the target game tree according to the interactive state corresponding to the leaf node and the target role; trace back from the leaf node according to the interactive incentive score corresponding to the leaf node to obtain the interactive incentive score corresponding to the root node of the target game tree; wherein, when the target role is consistent with the role corresponding to the parent node of the target game tree, the maximum interactive incentive score corresponding to the child node of the parent node is obtained as the interactive incentive score corresponding to the parent node; when the target role is inconsistent with the role corresponding to the parent node of the target game tree, the minimum interactive incentive score corresponding to the child node of the parent node is obtained as the interactive incentive score corresponding to the parent node; and the simulated interactive action corresponding to the interactive incentive score corresponding to the root node is used as the target interactive action.
8. The device according to claim 7, characterized in that The interactive action selection score determination module comprises: A first interaction feature obtaining unit, configured to obtain a first interaction feature according to historical interaction resources corresponding to each historical interaction action and historical interaction action types corresponding to the historical interaction resources; A second interaction feature obtaining unit, configured to determine a second interaction feature according to the interaction resource currently held by the target virtual object; The interactive action selection score determination unit is used to input the first interactive feature and the second interactive feature into an action selection model to obtain an interactive action selection score corresponding to each candidate interactive action.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
