Virtual object behavior determination method and apparatus, and electronic device

By dynamically adjusting the probability of using the behavioral data of virtual objects, the problem of AI characters being unable to adjust their combat methods according to the actual scenario was solved, thereby improving the anthropomorphism and combat power of AI characters and enhancing the player's gaming experience.

WO2025232399A1PCT designated stage Publication Date: 2025-11-13NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/086667
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-05-09
Filing Date
2025-04-01
Publication Date
2025-11-13

AI Technical Summary

Technical Problem

In existing technologies, AI characters cannot adjust their combat methods according to the actual scenario in games, resulting in a poor gaming experience for players. Furthermore, existing learning methods consume a lot of resources, have weak generalization capabilities, and cannot be quickly implemented.

Method used

By acquiring behavioral data of virtual objects from a pre-set database and dynamically adjusting the usage probability in the behavioral data based on game results, the behavior prediction and adjustment of virtual objects can be achieved.

Benefits of technology

It improves the anthropomorphism and combat power of AI characters in the game, enhances the player's gaming experience, and solves the problems of high resource consumption and difficulty in deployment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025086667_13112025_PF_FP_ABST
    Figure CN2025086667_13112025_PF_FP_ABST
Patent Text Reader

Abstract

A virtual object behavior determination method and apparatus, and an electronic device. The method comprises: if the position of a target virtual object and a first virtual item satisfy a preset condition, acquiring, from a preset database, behavior data corresponding to the first virtual item, wherein the behavior data comprises a plurality of game behaviors and the use probability corresponding to each game behavior; determining a target game behavior from the behavior data corresponding to the first virtual item, and controlling the target virtual object to execute the target game behavior in a game scene to obtain a target game result; and on the basis of the target game result, adjusting the use probability corresponding to each game behavior in the behavior data corresponding to the first virtual item in the preset database. In the method, on the basis of the game result generated when the target virtual object executes the target game behavior, the use probability corresponding to a game behavior in the preset database is adjusted in real time, so that a game behavior of the target virtual object determined on the basis of the preset database is more adapted to a game scene, thereby improving the combat power and the degree of personification of the target virtual object.
Need to check novelty before this filing date? Find Prior Art

Description

Methods, apparatus and electronic devices for determining the behavior of virtual objects

[0001] Cross-reference to related applications

[0002] This application claims priority to Chinese patent application filed on May 9, 2024, application number 202410575959.1, entitled “Method, Apparatus and Electronic Device for Determining the Behavior of a Virtual Object”, the entire contents of which are incorporated herein by reference. Technical Field

[0003] This disclosure relates to the field of game character control technology, and in particular to a method, apparatus and electronic device for determining the behavior of a virtual object. Background Technology

[0004] In both symmetrical and asymmetrical competitive games, AI characters are needed to avoid long matchmaking wait times for players. Related technologies typically employ expert rule systems such as finite state machines and behavior trees for gameplay. Each game update requires extensive maintenance from the developers, and these AI characters can only play according to preset rules, unable to adjust their strategies based on actual game scenarios. This makes them easily detectable by players, resulting in a poor gaming experience. Summary of the Invention

[0005] The purpose of this disclosure is to provide a method, apparatus, and electronic device for determining the behavior of virtual objects, so as to dynamically adjust the combat behavior of virtual objects according to the actual scene and the actual game combat results of AI characters, thereby improving the anthropomorphism of AI characters and enhancing the player's gaming experience.

[0006] In a first aspect, this disclosure provides a method for determining the behavior of a virtual object. The method includes: in response to a preset condition being met between the position of a target virtual object and a first virtual object in a game scene, obtaining first behavior data corresponding to the first virtual object from a preset database; wherein the target virtual object is controlled by a game system, and the preset database contains behavior data corresponding to multiple preset virtual objects, the behavior data including multiple game behaviors and the usage probability of each game behavior; wherein the game behaviors include preset game behaviors that the target virtual object can execute when the position of the target virtual object and the preset virtual object meet the preset condition; determining a target game behavior from the game behaviors contained in the first behavior data corresponding to the first virtual object, and controlling the target virtual object to execute the target game behavior in the game scene; obtaining a target game result generated when the target virtual object executes the target game behavior in the game scene; and adjusting the usage probabilities of each game behavior in the first behavior data corresponding to the first virtual object in the preset database based on the target game result, to obtain adjusted first behavior data corresponding to the first virtual object.

[0007] Secondly, this disclosure provides a device for determining the behavior of a virtual object. The device includes: a data acquisition module configured to acquire first behavior data corresponding to the first virtual object from a preset database in response to a preset condition being met between the position of a target virtual object and a first virtual object in a game scene; wherein the target virtual object is controlled by a game system, and the preset database contains behavior data corresponding to multiple preset virtual objects, including multiple game behaviors and the probability of use for each game behavior; wherein the game behaviors include preset game behaviors that the target virtual object can execute when the position of the target virtual object and the preset virtual object meet the preset condition; a behavior determination module configured to determine a target game behavior from the game behaviors contained in the first behavior data corresponding to the first virtual object, and control the target virtual object to execute the target game behavior in the game scene; a result acquisition module configured to acquire a target game result generated when the target virtual object executes the target game behavior in the game scene; and a data adjustment module configured to adjust the probability of use for each game behavior in the first behavior data corresponding to the first virtual object in the preset database based on the target game result, to obtain adjusted first behavior data corresponding to the first virtual object.

[0008] Thirdly, this disclosure provides an electronic device including a processor and a memory, the memory storing machine-executable instructions that can be executed by the processor, the processor executing the machine-executable instructions to implement the above-described method for determining the behavior of a virtual object.

[0009] Fourthly, this disclosure provides a computer-readable storage medium storing computer-executable instructions that, when invoked and executed by a processor, cause the processor to implement the aforementioned method for determining the behavior of a virtual object.

[0010] The embodiments disclosed herein bring the following beneficial effects:

[0011] This disclosure provides a method, apparatus, and electronic device for determining the behavior of a virtual object. First, in response to a target virtual object's position and a first virtual object in a game scene satisfying preset conditions, first behavior data corresponding to the first virtual object is obtained from a preset database. The target virtual object is controlled by a game system. The preset database contains behavior data corresponding to multiple preset virtual objects, including multiple game behaviors and their respective usage probabilities. The game behaviors include preset game behaviors that the target virtual object can execute when its position and the preset virtual object satisfy the preset conditions. Then, a target game behavior is determined from the game behaviors contained in the first behavior data corresponding to the first virtual object, and the target virtual object is controlled to execute the target game behavior in the game scene. Next, a target game result is obtained when the target virtual object executes the target game behavior in the game scene. Finally, based on the target game result, the usage probabilities of each game behavior in the first behavior data corresponding to the first virtual object in the preset database are adjusted to obtain the adjusted first behavior data corresponding to the first virtual object. In this method, the target virtual object can determine the target game behavior to be executed based on a preset database, and adjust the usage probability of the game behavior in the preset database in real time according to the game results generated by the execution of the target game behavior. This makes the game behavior determined by the preset database of the target virtual object more in line with the game scene, and also improves the combat power and anthropomorphism of the target virtual object, while helping to improve the game experience of real players.

[0012] Other features and advantages of this disclosure will be set forth in the following description, or some features and advantages may be inferred from the description or determined without doubt, or may be learned by practicing the techniques described above.

[0013] To make the above-mentioned objects, features and advantages of this disclosure more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0014] To more clearly illustrate the technical solutions in the specific embodiments or related technologies of this disclosure, the accompanying drawings used in the description of the specific embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0015] Figure 1 is a flowchart of a method for determining the behavior of a virtual object according to one embodiment of the present disclosure;

[0016] Figure 2 is a schematic diagram of the probability adjustment of game behavior using reinforcement learning provided in one embodiment of the present disclosure;

[0017] Figure 3 is a schematic diagram of the structure of a virtual object behavior determination device provided in one embodiment of the present disclosure;

[0018] Figure 4 is a schematic diagram of the structure of an electronic device provided in one embodiment of this disclosure. Detailed Implementation

[0019] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. The components of the embodiments of this disclosure described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.

[0020] Therefore, the following detailed description of the embodiments of this disclosure provided in the accompanying drawings is not intended to limit the scope of the claimed disclosure, but merely to illustrate selected embodiments of the disclosure. All other embodiments obtained by those skilled in the art based on the embodiments of this disclosure without inventive effort are within the scope of protection of this disclosure.

[0021] Currently, games that feature high difficulty as a key element have garnered a lot of positive reviews from players. These games are challenging because players have personally experienced their difficulty, and they have a good reputation. In fact, it can be said that it is precisely because of their high difficulty that they have gained a large following among players.

[0022] In both symmetrical and asymmetrical competitive games, players need to team up to fight. To avoid long matchmaking wait times, AI (Artificial Intelligence) characters are added to the battle. This allows team players to experience the sense of accomplishment and satisfaction of overcoming difficulties and achieving victory, increasing player interest. However, defeating clumsy and vulnerable AI characters only provides a brief initial novelty and excitement. Repeatedly challenging and completing levels is what truly leaves a lasting impression on players.

[0023] In related technologies, AI characters typically use expert rule systems such as finite state machines and behavior trees for game battles. Each game update requires extensive maintenance by the game designers. Due to the limitations of expert rule systems, AI characters cannot exhibit diversity or achieve the expected high strength. Furthermore, they cannot dynamically adjust their gameplay based on the actual scenario and opponent, unlike high-level players who can create unique strategies for each player. This makes AI characters easily detectable by players, resulting in a poor gaming experience.

[0024] In controlling AI characters, both full-scene reinforcement learning and supervised learning methods can be used. However, full-scene reinforcement learning is too performance-intensive, while supervised learning lacks a large number of high-quality player board game samples, and even after implementation, it consumes huge amounts of computing resources. In today's rapidly evolving game content landscape, methods using pure reinforcement learning and transfer learning are largely confined to the theoretical and experimental stages. Furthermore, pure reinforcement learning and transfer learning have long development cycles, weak generalization capabilities, and cannot meet the demands for rapid deployment.

[0025] To address the aforementioned issues, this disclosure provides a method, apparatus, and electronic device for determining the behavior of virtual objects. This technology can be applied to scenarios involving the prediction and adjustment of the behavior of virtual objects during game matches.

[0026] To facilitate understanding of the embodiments of this disclosure, a method for determining the behavior of a virtual object disclosed in this disclosure will first be described in detail, as shown in Figure 1. The method includes the following specific steps:

[0027] Step S102: In response to the target virtual object's position and the first virtual object in the game scene satisfying preset conditions, first behavior data corresponding to the first virtual object is obtained from a preset database; wherein, the target virtual object is controlled by the game system, and the preset database contains behavior data corresponding to multiple preset virtual objects, the behavior data corresponding to the preset virtual objects includes: multiple game behaviors, and the usage probability corresponding to each game behavior; wherein, the game behaviors include preset game behaviors that the target virtual object can execute when the target virtual object's position and the preset virtual object satisfy preset conditions.

[0028] In practical implementation, the aforementioned target virtual object is typically an AI character controlled by the game system within the target game. This target game can be a symmetrical or asymmetrical competitive game, depending on development needs or player input. The first virtual object can be any preset virtual object from a pre-defined database. This preset virtual object is a virtual object with a specific function within the game scene. It can assist virtual objects from one side of the game in attacking virtual objects from the other side. This virtual object can also be virtual cover, a pallet, or an offensive defensive tower, etc.

[0029] The aforementioned preset database is pre-set based on game data from historical game matches. This database contains behavioral data corresponding to multiple preset virtual objects. Each preset virtual object's behavioral data includes: multiple game behaviors that the target virtual object can or has previously performed, and the probability of using each behavior. The multiple game behaviors included in the behavioral data can be determined according to the game rules and the object type of the target virtual object. For example, if the first virtual object is a pallet and the target virtual object is the hunter, then the game behaviors may include, but are not limited to, normal attack, retreating attack, and trading blows. If the target virtual object is a survivor, the game behaviors may include, but are not limited to, turning back to drop the pallet, playing around in the pallet area, dropping the pallet directly, and playing around after dropping the pallet. If the first virtual object is a tower, the target virtual object's game behaviors include, but are not limited to, defending under the tower, playing around inside and outside the tower, and attacking outside the tower.

[0030] The aforementioned preset conditions can be determined based on game rules or development needs. For example, the preset conditions could be that the distance between the target virtual object and the first virtual object is less than a preset distance threshold; the target virtual object could be within the attack range of the first virtual object; or the distance between the target virtual object and the first virtual object could be less than a preset distance threshold, and the distance between the first virtual object and the first virtual object in the game scene could also be less than a preset distance threshold. The target virtual object and the first virtual object belong to different game factions. The preset distance threshold can be determined based on development needs and is not specifically limited here. The target virtual object's position refers to its current location in the game scene. In practical implementation, during gameplay, when the target virtual object's position and the first virtual object meet the preset conditions, the system retrieves the corresponding behavior data of the first virtual object from a preset database to determine the target behavior that the target virtual object is about to perform.

[0031] Step S104: Determine the target game behavior from the game behaviors contained in the first behavior data corresponding to the first virtual object, and control the target virtual object to execute the target game behavior in the game scene.

[0032] In practical implementation, a target game behavior can be determined from the multiple game behaviors contained in the first behavior data corresponding to the first virtual object, based on the usage probabilities of multiple game behaviors. After determining the target game behavior, the target virtual object is controlled to execute the target game behavior in the game scene.

[0033] In one optional embodiment, when determining the target game behavior, the game behavior with the highest usage probability in the first behavior data corresponding to the first virtual object can be identified as the target game behavior. In another optional embodiment, the target game behavior can be randomly determined from the game behaviors included in the first behavior data based on the usage probability of each game behavior in the first behavior data corresponding to the first virtual object; that is, a game behavior is randomly selected as the target game behavior from the game behaviors included in the first behavior data. Specifically, when randomly determining the target game behavior, the higher the usage probability of the game behavior in the first behavior data corresponding to the first virtual object, the higher the probability that game behavior will be selected as the target game behavior.

[0034] Step S106: Obtain the target game result generated when the target virtual object performs the target game behavior in the game scene.

[0035] In practical implementation, when a target virtual object performs a target game action in the game scene, a target game result is generated. This target game result is determined based on the game rules and the actual game scene. Specifically, the target game result could be that the target virtual object hits another virtual object, the target virtual object is stunned, or the fear value of another virtual object is increased, etc.

[0036] In one specific embodiment, if the distance between the target virtual object and the first virtual object is less than a preset distance threshold, and the distance between the first virtual object (which is not part of the same game faction as the target virtual object) and the first virtual object in the game scene is also less than the preset distance threshold, the target virtual object performs a target game action in the game scene to attack the first virtual object, thereby causing the first virtual object to be harmed or to experience fear, etc. Since the first virtual object may dodge or attack when the target virtual object performs the target game action, the target game result may be that the target virtual object fails to hit the first virtual object, or that the target virtual object is stunned, etc.

[0037] Step S108: Based on the target game result, adjust the usage probability of each game behavior in the first behavior data corresponding to the first virtual object in the preset database to obtain the adjusted first behavior data corresponding to the first virtual object.

[0038] In practical implementation, the game effect of a target virtual object performing a target game action can be known based on the target game result. The usage probability of each game action in the first action data corresponding to the first virtual object in the preset database is adjusted based on the quality of the game effect. Specifically, when a target virtual object performs a target game action and produces a good game effect (e.g., the target virtual object hits a virtual object from another game faction or increases the fear value of a virtual object from another game faction), the usage probability of the target game action in the first action data corresponding to the first virtual object is increased, while the usage probability of other game actions in the first action data corresponding to the first virtual object is decreased. When a target virtual object performs a target game action and produces a poor game effect (e.g., the target virtual object is knocked down or stunned), the usage probability of the target game action in the first action data corresponding to the first virtual object is decreased, while the usage probability of other game actions in the first action data corresponding to the first virtual object is increased.

[0039] This method dynamically adjusts the first behavior data corresponding to the first virtual object in the preset database based on the game effect of the target virtual object's game behavior. This allows the target virtual object to select the game behavior with better game effect when determining the game behavior to be executed based on the adjusted preset database, thereby improving the target virtual object's game win rate and making the target virtual object's game combat more human-like and in line with the actual game scenario.

[0040] This disclosure provides a method for determining the behavior of a virtual object. The target virtual object can determine the target game behavior to be executed based on a preset database, and adjust the usage probability of the game behavior in the preset database in real time according to the game result generated by executing the target game behavior. This makes the game behavior determined by the target virtual object based on the preset database more in line with the game scene, and also improves the combat power and anthropomorphism of the target virtual object, while helping to improve the game experience of real players.

[0041] The following embodiments describe a method for pre-determining behavioral data corresponding to preset virtual objects in preset data.

[0042] Specifically, the behavioral data corresponding to the preset virtual objects in the preset database can be predetermined through the following steps 10-14:

[0043] Step 10: Obtain historical game data, which includes the target virtual object's position and the sequence of the target virtual object's behavior from the time the preset virtual object meets the preset conditions until the end of the game.

[0044] In practical implementation, the aforementioned historical game data may contain game data corresponding to at least one historical game. The specific manifestation of the end of the aforementioned game state can be determined according to development needs. For example, the end of the game state may be due to the target virtual object's position not meeting preset conditions, the target virtual object being knocked down, or the game ending. In practical implementation, the target virtual object in the historical game data and the target virtual object in the real-time game have the same object type. For example, both may be hunters, or both may be survivors. However, the target virtual object in the historical game data can be an AI character controlled by the system, or a controlled virtual object controlled by the player in the historical game.

[0045] In practical applications, the behavior sequence of the aforementioned target virtual object is determined in the following way: In historical game data, when the position of the target virtual object and the first virtual object meet the preset conditions, the behavior sequence of the target virtual object is recorded; when the target virtual object and the first virtual object do not meet the preset conditions or the target virtual object is knocked down, the recording of the behavior sequence of the target virtual object is stopped, thus obtaining one behavior sequence of the target virtual object; the historical game data is played again, and if the position of the target virtual object and the first virtual object meet the preset conditions, the behavior sequence of the target virtual object is recorded again, thereby obtaining at least one behavior sequence of the target virtual object included in the historical game data.

[0046] For example, suppose the preset condition is that the distance between the target virtual object's location and the location of a first virtual object (not belonging to the same game faction as the target virtual object) and the first virtual object is less than a preset distance threshold. Then, during the playback of historical game data, when the distances between the target virtual object's location and the first virtual object's location and the first virtual object are both less than the preset distance threshold, the recording of the target virtual object's behavior sequence begins. When either the target virtual object or the first virtual object leaves the first virtual object, or the first virtual object falls down (i.e., when the preset condition is not met), the recording of the target virtual object's behavior sequence stops. At this point, the currently recorded behavior sequence of the target virtual object is considered as one behavior sequence. Then, as historical game data is played, the behavior sequence of the target virtual object is continuously recorded in the above manner to obtain multiple behavior sequences corresponding to the target virtual object.

[0047] In practical implementation, the data types to be recorded in each behavior sequence are pre-defined. Specifically, the behavior sequence of the target virtual object includes multiple data types, such as: the target virtual object's movement direction, whether the target virtual object attacks, the type of attack when the target virtual object attacks, and the positional relationship between the target virtual object and the first virtual object. Each type of data can appear once or multiple times in the behavior sequence. The movement direction of the target virtual object can be approximated as one of multiple directions, and the specific directions can be determined according to development needs. For example, the multiple directions can be forward, backward, left, right, upper left, lower left, upper right, and lower right (eight directions in total). The attack type when the target virtual object attacks can be determined according to the target virtual object's object type. For example, if the target virtual object is a hunter, the attack type can include normal attacks and charged attacks; if the target virtual object is a survivor, the attack type can include dropping pallets, vaulting pallets, and skill releases; if the target virtual object is a specific game character, the attack type can include releasing skills and normal attacks. The positional relationship between the target virtual object and the first virtual object includes, but is not limited to: whether the target virtual object is inside the first virtual object, whether the target virtual object is below the specified virtual object, and whether the target virtual object is within the attack range of the first virtual object.

[0048] Step 11: Obtain the behavior sequence corresponding to the preset virtual object based on the behavior sequence of the target virtual object.

[0049] In practical implementation, the behavior sequence of the target virtual object can be directly determined as the behavior sequence corresponding to the preset virtual object; alternatively, the behavior sequence of the target virtual object can be transformed according to the preset transformation rules to obtain the behavior data corresponding to the preset virtual object. The preset transformation rules can be determined according to the game rules.

[0050] Step 12: Encode the behavior sequence corresponding to the preset virtual object according to the preset rules to obtain the encoding result corresponding to the preset virtual object; wherein, one encoding result corresponds to one behavior sequence corresponding to the preset virtual object.

[0051] In practical implementation, since the encoding rules and encoding identifiers for each type of data in the behavior sequence are pre-set, for each behavior sequence in the multiple behavior sequences corresponding to the preset virtual object, the encoding results corresponding to the preset virtual object can be obtained by encoding each type of data according to the encoding identifiers corresponding to each type of data.

[0052] In practical applications, since data is recorded at fixed intervals within the behavioral sequence, each behavioral sequence contains data corresponding to at least one time point. Encoding the data within the behavioral sequence yields the encoding results, as shown in Table 1, which lists encoding results 1, 2, and 3 for three behavioral sequences.

[0053] Table 1

[0054] In Table 1, the behavior sequence corresponding to encoding result 1 records data for three time points. Each time point corresponds to three coded bits. The first bit indicates the movement direction of the target virtual object, the second bit indicates whether the target virtual object attacks and the type of attack when it attacks, and the third bit indicates the positional relationship between the target virtual object and the first virtual object. That is, it indicates whether the target virtual object is below the first virtual object when it is a monitoring object; whether the target virtual object is within the controllable range of the first virtual object when it is a survival object; and whether the target virtual object is within the attack range of the first virtual object when it is a designated game character. Similarly, the behavior sequence corresponding to encoding result 2 records data for three time points, but the behavior sequence corresponding to encoding result 3 records data for two time points.

[0055] Step 13: Determine the game behavior corresponding to the preset virtual object and the usage probability corresponding to the game behavior based on the encoding result of the preset virtual object.

[0056] Step 14: Determine the behavioral data corresponding to the preset virtual object based on the game behavior corresponding to the preset virtual object and the usage probability corresponding to the game behavior.

[0057] Specifically, the game behaviors corresponding to preset virtual objects and the usage probability of each game behavior can be determined as the behavior data corresponding to preset virtual objects.

[0058] In practical implementation, the preset game behaviors and virtual objects differ depending on the target virtual object's object type. For example, if the preset virtual object is a pallet and the target virtual object is the hunter, the preset game behaviors may include, but are not limited to, normal attack, retreating attack, and trading blows. If the target virtual object is the survivor, the preset game behaviors may include, but are not limited to, turning back to drop the pallet, playing around in the pallet area, dropping the pallet directly, and playing around after dropping the pallet. If the first virtual object is a tower, the target virtual object's game behaviors include, but are not limited to, defending under the tower, playing around inside and outside the tower, and attacking outside the tower.

[0059] In practical implementation, multiple encoding results corresponding to preset virtual objects can be classified, and the game behavior corresponding to the encoding results belonging to the same category can be determined as one. Then, by using at least some of the encoding results contained in the same category, the game behavior corresponding to each category and the usage probability corresponding to that game behavior can be determined.

[0060] In an optional embodiment, the aforementioned preset virtual object corresponds to multiple encoding results; step 13 can be implemented through the following steps 20-23:

[0061] Step 20: Calculate the similarity between any two encoding results among the multiple encoding results corresponding to the preset virtual object, and classify the multiple encoding results based on the similarity between any two encoding results to obtain multiple classification results.

[0062] In practice, the similarity between any two encoding results can be determined by calculating Euclidean distance, cosine similarity, and edit distance. Then, encoding results with high similarity are grouped into the same classification result, resulting in multiple classification results corresponding to multiple encoding results. Each classification result can contain one or more encoding results.

[0063] In one specific embodiment, the Lewinstein distance between every two encoded results can be calculated, and this Lewinstein distance can be determined as the similarity between each pair of encoded results. Since the Lewinstein distance is defined as the minimum number of edit operations required to convert one string to another, the smaller the Lewinstein distance between two encoded results, the higher their similarity. The similarity between each pair is calculated using the Lewinstein definition formula:

[0064] Here, a and b are two different strings, corresponding to two different encoding results. lev a,b (i,j) represents the Levenstein distance between the first i characters of encoded result a and the first j characters of encoded result b, where the indices of i and j both start from 1.

[0065] When calculating the Levenstein distance between the two encoded results, the two encoded results are first placed at the top and left of the table, as shown in Table 2.

[0066] Table 2

[0067] The Levenstein distance calculation essentially involves taking the value of the cell to the left and above the current cell and adding 1. The value of the cell to the left and above the current cell is determined by 'a'. i With b j Whether the values ​​are equal determines whether to add 1. Based on the above three cases, the minimum value is selected as the value of the current cell, resulting in Table 3.

[0068] Table 3

[0069] The Levinstein distance between these two encoding results is the number 4 in the bottom right cell of the table. The Levinstein distance value for every two encoding results can be obtained using the method described above.

[0070] In practical applications, multiple encoding results with high similarity can be clustered into a single classification result, thus obtaining multiple classification results. Specifically, when clustering multiple encoding results, the following operations need to be performed for each encoding result: determine the target encoding results among the multiple encoding results whose similarity to the current encoding result is less than a preset similarity threshold, and the number of target encoding results; if the number of target encoding results is greater than a preset number threshold, determine that the current encoding result and the target encoding result belong to the same classification result.

[0071] The aforementioned preset similarity threshold and preset quantity threshold are set in advance according to R&D needs. In addition, if the number of classification results or the number of game behaviors obtained based on the preset similarity threshold and preset quantity threshold do not meet a certain requirement, the preset quantity threshold or preset similarity threshold can be adjusted appropriately to ensure that a certain number of game behaviors are obtained.

[0072] In practical implementation, due to terrain influences, the game behavior exhibited by the target virtual object varies depending on the proximity of different preset virtual objects. The game behavior of the target virtual object near these preset virtual objects is associated with multiple encoding results corresponding to the target virtual object. Table 4 shows the Levenstein distances between these multiple encoding results corresponding to the target virtual object.

[0073] Table 4

[0074] Starting with code 1, query the Levenstein distance with other codes row by row. Assuming a preset similarity threshold θ = 25, if there are more than n codes in the row (equivalent to the preset number threshold) with a Levenstein distance less than θ, then the code in that row and the code with a Levenstein distance less than θ are considered to be a game behavior, and these codes are classified into one category.

[0075] Step 21: Based on the preset game behaviors, determine the game behavior corresponding to each classification result; where different classification results correspond to different game behaviors.

[0076] In practical implementation, the game behavior corresponding to each encoded result can be determined by the game behavior or game rules in the behavior sequence corresponding to each encoded result; alternatively, the game behavior corresponding to each classification result can be obtained by manually identifying the game behavior corresponding to each encoded result. Since the game behavior corresponding to the encoded results in the same classification result can be considered the same, several encoded results can be selected from the classification results, and the game behavior corresponding to the encoded result can be manually identified, thereby determining the game behavior corresponding to the classification result.

[0077] Step 22: Based on the number of encoded results contained in each classification result and the total number of multiple encoded results, determine the probability of using the game behavior corresponding to each classification result.

[0078] After obtaining the game behavior corresponding to each classification result, perform the following operation for each classification result to obtain the usage probability of the game behavior corresponding to each classification result: determine the number of encoded results contained in the current classification result, divide the number by the total number of encoded results of multiple behavior sequences corresponding to the target virtual object, and obtain the usage probability of the game behavior corresponding to the current classification result.

[0079] Step 23: Determine the game behavior corresponding to each classification result as the game behavior corresponding to the preset virtual object, and determine the usage probability of the game behavior corresponding to each classification result as the usage probability of the game behavior corresponding to the preset virtual object.

[0080] In practical implementation, the behavior data corresponding to the preset virtual objects can be obtained through the above method. Similarly, based on a similar method, the behavior data corresponding to each preset virtual object in the preset database can be obtained. Table 5 shows the behavior data corresponding to three types of virtual objects provided in this embodiment of the disclosure.

[0081] Table 5

[0082] The normal draw, retreat draw, and health-exchange draw in Table 5 above are preset game behaviors. For example, the game behaviors corresponding to preset virtual objects A, B, and C in the preset database include normal draw, retreat draw, and health-exchange draw. The probability of using each game behavior corresponding to each preset virtual object is different. For example, the probability of using normal draw is 0.2, the probability of using retreat draw is 0.45, and the probability of using health-exchange draw is 0.35 for preset virtual object A.

[0083] In the above method, the game behavior that the target virtual object will perform in the vicinity of the preset virtual object in the actual game can be predicted by the preset database, thereby helping to improve the anthropomorphism of the target virtual object.

[0084] The following examples describe how to adjust behavioral data in a preset database.

[0085] Specifically, the process of adjusting the usage probability of each game behavior in the first behavior data corresponding to the first virtual object in the preset database based on the target game result to obtain the adjusted first behavior data corresponding to the first virtual object can be achieved through the following steps 30-31:

[0086] Step 30: Determine the feedback value corresponding to the target game result; different game results are pre-configured with corresponding feedback values.

[0087] In practice, the feedback value corresponding to the target game result can be either positive or negative. When the feedback value corresponding to the target game result is positive, it indicates that the target game result is good and a reward will be given, thereby increasing the probability of using the target game behavior in the first row of data; when the feedback value corresponding to the target game result is negative, it indicates that the target game result is poor and a penalty will be given, thereby reducing the probability of using the target game behavior in the first row of data.

[0088] Step 31: Based on the feedback value corresponding to the target game result, adjust the usage probability of each game behavior in the first behavior data corresponding to the first virtual object in the preset database to obtain the adjusted first behavior data corresponding to the first virtual object.

[0089] In practical implementation, when the target virtual object is located near the first virtual object (that is, when the position of the target virtual object and the first virtual object meet the preset conditions), the usage probability of the game behavior contained in the behavior data corresponding to the first virtual object is used to determine the target game behavior that the target virtual object will use; then, based on the target game result produced by the target virtual object using the target game behavior, the usage probability of the game behavior contained in the first behavior data corresponding to the first virtual object is dynamically adjusted so that the target virtual object can execute game behaviors that are more in line with the player, or execute game behaviors that achieve better game results.

[0090] In an optional embodiment, the usage probability of each game behavior in the first behavior data corresponding to the first virtual object in the preset database can be adjusted in the following way: The usage probability of the target game behavior in the first behavior data corresponding to the first virtual object in the preset database is added to the feedback value corresponding to the target game result to obtain a first summation result, which is then determined as the adjusted usage probability of the target game behavior; an adjustment mean is determined based on the feedback value corresponding to the target game result; for each game behavior in the first behavior data corresponding to the first virtual object other than the target game behavior, the adjustment mean is subtracted to obtain the adjusted usage probability of the game behavior in the first behavior data corresponding to the first virtual object other than the target game behavior; based on the adjusted usage probability of the target game behavior and the adjusted usage probability of the game behavior in the first behavior data corresponding to the first virtual object other than the target game behavior, the adjusted first behavior data corresponding to the first virtual object is determined.

[0091] In practice, the total number of game behaviors in the first behavior data corresponding to the first virtual object is subtracted by one to obtain the subtraction result; the feedback value corresponding to the target game result is divided by the subtraction result to obtain the adjustment mean. This method ensures that the sum of the usage probabilities of the game behaviors in the first behavior data corresponding to the first virtual object is 1, and also adjusts the usage probabilities of game behaviors other than the target game behavior in the first behavior data on an average basis.

[0092] Because the feedback value corresponding to the target game result can be positive or negative, although the adjusted usage probability corresponding to the target game behavior is the sum of the usage probability of the target game behavior in the first behavior data corresponding to the first virtual object and the feedback value corresponding to the target game result, the adjusted usage probability may be less than or greater than the original usage probability. Similarly, the adjusted usage probability corresponding to game behaviors other than the target game behavior in the first behavior data corresponding to the first virtual object may also be greater than or less than the original usage probability. It should be noted that if the feedback value corresponding to the target game result is 0, then no adjustment is needed to the first behavior data.

[0093] Figure 2 illustrates the probability adjustment of game behavior using reinforcement learning according to an embodiment of this disclosure. Figure 2 uses a target virtual object as the monitoring object, meaning the target virtual object's game behavior includes normal attack, attacking through a pallet, and retreating attack. Reinforcement learning views learning as an exploration process. The agent selects an action 'a' (equivalent to Action in Figure 2), such as the target game behavior. After the environment (equivalent to the game scene) receives action 'a', its state (equivalent to the game result mentioned above) changes, and a reinforcement signal (equivalent to the feedback value mentioned above) is generated and fed back to the agent. The agent then selects the next action based on the new state of the environment.

[0094] For example, if the target virtual object performs a normal knife-drawing action in the game scene, and the environment accepts this action, the next state is that it hits the survivor. That is, the target game result is that the survivor is hit, and the survivor's fear value increases by 500. Here, the environment rewards the agent with 0.05 (i.e., the feedback value is 0.05). For example, the rewards are shown in Table 6.

[0095] Table 6

[0096] To minimize the computational load of the Agent network, the reward is directly added to or subtracted from the base probability to form the Agent network. As mentioned above, if the target virtual object uses a normal knife attack to cause damage to the survivor, the reward is 0.05. Therefore, the probability of the target virtual object using the normal knife attack is increased by 0.05, while the probability of other game behaviors is decreased to ensure that the sum of the probabilities is 1.

[0097] This disclosure addresses the problem of not being able to dynamically adjust game strategies based on actual scenarios and opponents, thus failing to achieve personalized gameplay, through a dynamic reinforcement learning method based on in-game behavior. This approach not only significantly enhances the strength and human-likeness of AI characters (equivalent to the aforementioned virtual targets) but also provides players with a more exhilarating combat experience. Furthermore, this method overcomes the issues of excessive resource consumption, high implementation difficulty, and uncontrollable limitations associated with directly employing pure supervised learning and reinforcement learning.

[0098] Corresponding to the above method embodiments, this disclosure also provides a device for determining the behavior of a virtual object, as shown in FIG3. The device includes:

[0099] The data acquisition module 30 is configured to execute a response to the target virtual object's position and the first virtual object in the game scene meeting preset conditions, and to acquire the first behavior data corresponding to the first virtual object from a preset database. The target virtual object is controlled by the game system, and the preset database contains behavior data corresponding to multiple preset virtual objects. The behavior data corresponding to the preset virtual objects includes multiple game behaviors and the usage probability of each game behavior. The game behaviors include preset game behaviors that the target virtual object can execute when the target virtual object's position and the preset virtual object meet preset conditions.

[0100] The behavior determination module 31 is configured to determine the target game behavior from the game behaviors contained in the first behavior data corresponding to the first virtual object, and control the target virtual object to perform the target game behavior in the game scene.

[0101] The result acquisition module 32 is configured to acquire the target game result generated when the target virtual object performs the target game behavior in the game scene.

[0102] The data adjustment module 33 is configured to perform an adjustment based on the target game result, adjusting the usage probability of each game behavior in the first behavior data corresponding to the first virtual object in the preset database, so as to obtain the adjusted first behavior data corresponding to the first virtual object.

[0103] The aforementioned virtual object behavior determination device allows the target virtual object to determine the target game behavior to be executed based on a preset database. Based on the game results generated by executing the target game behavior, the device adjusts the usage probability of the game behavior corresponding to the game behavior in the preset database in real time. This makes the game behavior determined by the target virtual object based on the preset database more in line with the game scene, and also improves the combat power and anthropomorphism of the target virtual object. At the same time, it helps to improve the game experience of real players.

[0104] Specifically, the aforementioned device further includes a database determination module, comprising: a data acquisition module configured to acquire historical game data, the historical game data including the behavior sequence of the target virtual object from the point when the position of the target virtual object and the preset virtual object meet preset conditions until the end of the game state; a sequence determination module configured to obtain the behavior sequence corresponding to the preset virtual object based on the behavior sequence of the target virtual object; an encoding module configured to encode the behavior sequence corresponding to the preset virtual object according to preset rules to obtain the encoding result corresponding to the preset virtual object; wherein, one encoding result corresponds to one behavior sequence corresponding to the preset virtual object; a probability determination module configured to determine the game behavior corresponding to the preset virtual object and the usage probability corresponding to the game behavior based on the encoding result corresponding to the preset virtual object; and a data determination module configured to determine the behavior data corresponding to the preset virtual object based on the game behavior corresponding to the preset virtual object and the usage probability corresponding to the game behavior.

[0105] In a specific implementation, the sequence determination module is configured to perform the following: determine the behavior sequence of the target virtual object as the behavior sequence corresponding to the preset virtual object.

[0106] Furthermore, the behavior sequence of the aforementioned target virtual object includes multiple types of data, including: the movement direction of the target virtual object, whether the target virtual object attacks, the attack type when the target virtual object attacks, and the positional relationship between the target virtual object and the first virtual object; each type of data is pre-configured with a corresponding encoding identifier; each type of data can appear once or multiple times in the behavior sequence; the aforementioned encoding module is configured to: encode each data contained in the behavior sequence corresponding to the preset virtual object according to the encoding identifier corresponding to each type of data, to obtain the encoding result corresponding to the preset virtual object.

[0107] Furthermore, the aforementioned preset virtual object corresponds to multiple encoding results; the aforementioned probability determination module is also configured to perform: calculating the similarity between every two encoding results among the multiple encoding results corresponding to the preset virtual object, and classifying the multiple encoding results based on the similarity between every two encoding results to obtain multiple classification results; determining the game behavior corresponding to each classification result based on preset game behaviors; wherein, different classification results correspond to different game behaviors; determining the usage probability of the game behavior corresponding to each classification result based on the number of encoding results contained in each classification result and the total number of multiple encoding results; determining the game behavior corresponding to each classification result as the game behavior corresponding to the preset virtual object, and determining the usage probability of the game behavior corresponding to each classification result as the usage probability of the game behavior corresponding to the preset virtual object.

[0108] In an optional embodiment, the probability determination module described above is further configured to perform: calculating the Lewinstein distance between every two encoding results in a plurality of encoding results, and determining the Lewinstein distance as the similarity between every two encoding results.

[0109] In a specific implementation, the aforementioned probability determination module is further configured to perform the following operations for each of the multiple encoding results: determine the target encoding results among the multiple encoding results whose similarity to the current encoding result is less than a preset similarity threshold, and the number of target encoding results; if the number of target encoding results is greater than a preset number threshold, determine that the current encoding result and the target encoding result belong to the same classification result.

[0110] In an optional embodiment, the aforementioned preset conditions include: the distance between the target virtual object and the first virtual object is less than a preset distance threshold, and the distance between the first virtual object and the first virtual object in the game scene is less than the preset distance threshold; wherein, the target virtual object and the first virtual object belong to different game factions, and the target virtual object performs target game behavior in the game scene to attack the first virtual object.

[0111] Furthermore, the aforementioned behavior determination module 31 is configured to perform: determining the game behavior with the highest usage probability in the first behavior data corresponding to the first virtual object as the target game behavior; or, randomly determining the target game behavior from the game behaviors contained in the first behavior data based on the usage probability of each game behavior in the first behavior data corresponding to the first virtual object.

[0112] Furthermore, the aforementioned data adjustment module 33 is configured to perform: determining the feedback value corresponding to the target game result; wherein, different game results are pre-configured with corresponding feedback values; and adjusting the usage probability of each game behavior in the first behavior data corresponding to the first virtual object in the preset database according to the feedback value corresponding to the target game result, so as to obtain the adjusted first behavior data corresponding to the first virtual object.

[0113] In specific implementation, the aforementioned data adjustment module 33 is further configured to perform the following: adding the probability of use of the target game behavior in the first behavior data corresponding to the first virtual object in the preset database to the feedback value corresponding to the target game result, obtaining a first summation result, and determining the first summation result as the adjusted probability of use corresponding to the target game behavior; determining the adjustment mean based on the feedback value corresponding to the target game result; subtracting the adjustment mean from the game behaviors other than the target game behavior in the first behavior data corresponding to the first virtual object, respectively, to obtain the adjusted probability of use corresponding to the game behaviors other than the target game behavior in the first behavior data corresponding to the first virtual object; and determining the adjusted first behavior data corresponding to the first virtual object based on the adjusted probability of use corresponding to the target game behavior and the adjusted probability of use corresponding to the game behaviors other than the target game behavior in the first behavior data corresponding to the first virtual object.

[0114] Furthermore, the aforementioned data adjustment module 33 is also configured to perform the following: subtract one from the total number of game behaviors contained in the first behavior data corresponding to the first virtual object to obtain a subtraction result; divide the feedback value corresponding to the target game result by the subtraction result to obtain the adjustment mean.

[0115] The virtual object behavior determination device provided in this disclosure has the same implementation principle and technical effect as the aforementioned method embodiment. For the sake of brevity, any parts not mentioned in the device embodiment can be referred to the corresponding content in the aforementioned method embodiment.

[0116] This disclosure also provides an electronic device, as shown in FIG4, which includes a processor and a memory. The memory stores machine-executable instructions that can be executed by the processor. The processor executes the machine-executable instructions to implement the above-described method for determining the behavior of virtual objects.

[0117] Specifically, the method for determining the behavior of the aforementioned virtual object includes: in response to the target virtual object's position and a first virtual object in the game scene satisfying preset conditions, obtaining first behavior data corresponding to the first virtual object from a preset database; wherein the target virtual object is controlled by a game system, and the preset database contains behavior data corresponding to multiple preset virtual objects, the behavior data corresponding to the preset virtual objects including: multiple game behaviors, and the usage probability corresponding to each game behavior; wherein the game behaviors include preset game behaviors that the target virtual object can execute when the target virtual object's position and the preset virtual object satisfy preset conditions; determining the target game behavior from the game behaviors contained in the first behavior data corresponding to the first virtual object, and controlling the target virtual object to execute the target game behavior in the game scene; obtaining the target game result generated when the target virtual object executes the target game behavior in the game scene; and adjusting the usage probability corresponding to each game behavior in the first behavior data corresponding to the first virtual object in the preset database based on the target game result, to obtain the adjusted first behavior data corresponding to the first virtual object.

[0118] In the above-mentioned method for determining the behavior of virtual objects, the target virtual object can determine the target game behavior to be executed based on a preset database, and adjust the usage probability of the game behavior in the preset database in real time according to the game result generated by executing the target game behavior. This makes the game behavior determined by the target virtual object based on the preset database more in line with the game scene, and also improves the combat power and anthropomorphism of the target virtual object, while helping to improve the game experience of real players.

[0119] In an optional embodiment, the behavior data corresponding to the preset virtual objects in the aforementioned preset database is predetermined through the following method: acquiring historical game data, which includes the behavior sequence of the target virtual object from the point when the position of the target virtual object and the preset virtual object meet preset conditions until the end of the game; obtaining the behavior sequence corresponding to the preset virtual object based on the behavior sequence of the target virtual object; encoding the behavior sequence corresponding to the preset virtual object according to preset rules to obtain the encoding result corresponding to the preset virtual object; wherein, one encoding result corresponds to one behavior sequence corresponding to the preset virtual object; determining the game behavior corresponding to the preset virtual object and the usage probability corresponding to the game behavior based on the encoding result corresponding to the preset virtual object; and determining the behavior data corresponding to the preset virtual object based on the game behavior corresponding to the preset virtual object and the usage probability corresponding to the game behavior.

[0120] In an optional embodiment, the step of obtaining the behavior sequence corresponding to the preset virtual object based on the behavior sequence of the target virtual object includes: determining the behavior sequence of the target virtual object as the behavior sequence corresponding to the preset virtual object.

[0121] In an optional embodiment, the behavior sequence of the target virtual object includes multiple types of data, including: the movement direction of the target virtual object, whether the target virtual object attacks, the attack type when the target virtual object attacks, and the positional relationship between the target virtual object and the first virtual object; each type of data is pre-configured with a corresponding encoding identifier; each type of data can appear once or multiple times in the behavior sequence; the step of encoding the behavior sequence corresponding to the preset virtual object according to preset rules to obtain the encoding result corresponding to the preset virtual object includes: encoding each data contained in the behavior sequence corresponding to the preset virtual object according to the encoding identifier corresponding to each type of data to obtain the encoding result corresponding to the preset virtual object.

[0122] In an optional embodiment, the aforementioned preset virtual object corresponds to multiple encoding results; the step of determining the game behavior corresponding to the preset virtual object and the usage probability corresponding to the game behavior based on the encoding results of the preset virtual object includes: calculating the similarity between every two encoding results among the multiple encoding results corresponding to the preset virtual object, and classifying the multiple encoding results based on the similarity between every two encoding results to obtain multiple classification results; determining the game behavior corresponding to each classification result based on the preset game behavior; wherein, different classification results correspond to different game behaviors; determining the usage probability of the game behavior corresponding to each classification result based on the number of encoding results contained in each classification result and the total number of multiple encoding results; determining the game behavior corresponding to each classification result as the game behavior corresponding to the preset virtual object, and determining the usage probability of the game behavior corresponding to each classification result as the usage probability of the game behavior corresponding to the preset virtual object.

[0123] In an optional embodiment, the step of calculating the similarity between every two encoding results among multiple encoding results corresponding to a preset virtual object includes: calculating the Lewinstein distance between every two encoding results among multiple encoding results, and determining the Lewinstein distance as the similarity between every two encoding results.

[0124] In an optional embodiment, the step of classifying multiple encoding results based on the similarity between every two encoding results to obtain multiple classification results includes: for each encoding result among the multiple encoding results, performing the following operations: determining the target encoding result among the multiple encoding results whose similarity to the current encoding result is less than a preset similarity threshold, and the number of target encoding results; if the number of target encoding results is greater than a preset number threshold, determining that the current encoding result and the target encoding result belong to the same classification result.

[0125] In an optional embodiment, the aforementioned preset conditions include: the distance between the target virtual object and the first virtual object is less than a preset distance threshold, and the distance between the first virtual object and the first virtual object in the game scene is less than the preset distance threshold; wherein, the target virtual object and the first virtual object belong to different game factions, and the target virtual object performs target game behavior in the game scene to attack the first virtual object.

[0126] In an optional embodiment, the step of determining the target game behavior from the game behaviors contained in the first behavior data corresponding to the first virtual object includes: determining the game behavior with the highest usage probability in the first behavior data corresponding to the first virtual object as the target game behavior; or, randomly determining the target game behavior from the game behaviors contained in the first behavior data based on the usage probability of each game behavior in the first behavior data corresponding to the first virtual object.

[0127] In an optional embodiment, the step of adjusting the usage probability of each game behavior in the first behavior data corresponding to the first virtual object in the preset database based on the target game result to obtain the adjusted first behavior data corresponding to the first virtual object includes: determining the feedback value corresponding to the target game result; wherein, different game results are pre-configured with corresponding feedback values; adjusting the usage probability of each game behavior in the first behavior data corresponding to the first virtual object in the preset database according to the feedback value corresponding to the target game result to obtain the adjusted first behavior data corresponding to the first virtual object.

[0128] In an optional embodiment, the step of adjusting the usage probability of each game behavior in the first behavior data corresponding to the first virtual object in the preset database according to the feedback value corresponding to the target game result to obtain the adjusted first behavior data corresponding to the first virtual object includes: adding the usage probability of the target game behavior in the first behavior data corresponding to the first virtual object in the preset database to the feedback value corresponding to the target game result to obtain a first summing result, and determining the first summing result as the adjusted usage probability corresponding to the target game behavior; determining the adjustment mean based on the feedback value corresponding to the target game result; subtracting the adjustment mean from the game behavior other than the target game behavior in the first behavior data corresponding to the first virtual object to obtain the adjusted usage probability corresponding to the game behavior other than the target game behavior in the first behavior data corresponding to the first virtual object; and determining the adjusted first behavior data corresponding to the first virtual object based on the adjusted usage probability corresponding to the target game behavior and the adjusted usage probability corresponding to the game behavior other than the target game behavior in the first behavior data corresponding to the first virtual object.

[0129] In an optional embodiment, the step of determining the adjusted mean based on the feedback value corresponding to the target game result includes: subtracting one from the total number of game behaviors contained in the first behavior data corresponding to the first virtual object to obtain a subtraction result; and dividing the feedback value corresponding to the target game result by the subtraction result to obtain the adjusted mean.

[0130] Furthermore, the electronic device shown in Figure 4 also includes a bus 102 and a communication interface 103, with the processor 101, the communication interface 103, and the memory 100 connected via the bus 102.

[0131] The memory 100 may include high-speed random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 103 (which can be wired or wireless), such as the Internet, wide area network, local area network, or metropolitan area network. The bus 102 may be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only a single bidirectional arrow is used in Figure 4, but this does not indicate that there is only one bus or one type of bus.

[0132] Processor 101 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of processor 101 or by instructions in software form. The processor 101 may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this disclosure. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this disclosure can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a readily available storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 100, and processor 101 reads information from memory 100 and, in conjunction with its hardware, completes the steps of the method described in the foregoing embodiments.

[0133] This disclosure also provides a computer-readable storage medium storing computer-executable instructions. When these computer-executable instructions are invoked and executed by a processor, they cause the processor to implement the aforementioned method for determining the behavior of a virtual object. For specific implementation details, please refer to the method embodiments, which will not be repeated here.

[0134] Specifically, the method for determining the behavior of the aforementioned virtual object includes: in response to the target virtual object's position and a first virtual object in the game scene satisfying preset conditions, obtaining first behavior data corresponding to the first virtual object from a preset database; wherein the target virtual object is controlled by a game system, and the preset database contains behavior data corresponding to multiple preset virtual objects, the behavior data corresponding to the preset virtual objects including: multiple game behaviors, and the usage probability corresponding to each game behavior; wherein the game behaviors include preset game behaviors that the target virtual object can execute when the target virtual object's position and the preset virtual object satisfy preset conditions; determining the target game behavior from the game behaviors contained in the first behavior data corresponding to the first virtual object, and controlling the target virtual object to execute the target game behavior in the game scene; obtaining the target game result generated when the target virtual object executes the target game behavior in the game scene; and adjusting the usage probability corresponding to each game behavior in the first behavior data corresponding to the first virtual object in the preset database based on the target game result, to obtain the adjusted first behavior data corresponding to the first virtual object.

[0135] In the above-mentioned method for determining the behavior of virtual objects, the target virtual object can determine the target game behavior to be executed based on a preset database, and adjust the usage probability of the game behavior in the preset database in real time according to the game result generated by executing the target game behavior. This makes the game behavior determined by the target virtual object based on the preset database more in line with the game scene, and also improves the combat power and anthropomorphism of the target virtual object, while helping to improve the game experience of real players.

[0136] In an optional embodiment, the behavior data corresponding to the preset virtual objects in the aforementioned preset database is predetermined through the following method: acquiring historical game data, which includes the behavior sequence of the target virtual object from the point when the position of the target virtual object and the preset virtual object meet preset conditions until the end of the game; obtaining the behavior sequence corresponding to the preset virtual object based on the behavior sequence of the target virtual object; encoding the behavior sequence corresponding to the preset virtual object according to preset rules to obtain the encoding result corresponding to the preset virtual object; wherein, one encoding result corresponds to one behavior sequence corresponding to the preset virtual object; determining the game behavior corresponding to the preset virtual object and the usage probability corresponding to the game behavior based on the encoding result corresponding to the preset virtual object; and determining the behavior data corresponding to the preset virtual object based on the game behavior corresponding to the preset virtual object and the usage probability corresponding to the game behavior.

[0137] In an optional embodiment, the step of obtaining the behavior sequence corresponding to the preset virtual object based on the behavior sequence of the target virtual object includes: determining the behavior sequence of the target virtual object as the behavior sequence corresponding to the preset virtual object.

[0138] In an optional embodiment, the behavior sequence of the target virtual object includes multiple types of data, including: the movement direction of the target virtual object, whether the target virtual object attacks, the attack type when the target virtual object attacks, and the positional relationship between the target virtual object and the first virtual object; each type of data is pre-configured with a corresponding encoding identifier; each type of data can appear once or multiple times in the behavior sequence; the step of encoding the behavior sequence corresponding to the preset virtual object according to preset rules to obtain the encoding result corresponding to the preset virtual object includes: encoding each data contained in the behavior sequence corresponding to the preset virtual object according to the encoding identifier corresponding to each type of data to obtain the encoding result corresponding to the preset virtual object.

[0139] In an optional embodiment, the aforementioned preset virtual object corresponds to multiple encoding results; the step of determining the game behavior corresponding to the preset virtual object and the usage probability corresponding to the game behavior based on the encoding results of the preset virtual object includes: calculating the similarity between every two encoding results among the multiple encoding results corresponding to the preset virtual object, and classifying the multiple encoding results based on the similarity between every two encoding results to obtain multiple classification results; determining the game behavior corresponding to each classification result based on the preset game behavior; wherein, different classification results correspond to different game behaviors; determining the usage probability of the game behavior corresponding to each classification result based on the number of encoding results contained in each classification result and the total number of multiple encoding results; determining the game behavior corresponding to each classification result as the game behavior corresponding to the preset virtual object, and determining the usage probability of the game behavior corresponding to each classification result as the usage probability of the game behavior corresponding to the preset virtual object.

[0140] In an optional embodiment, the step of calculating the similarity between every two encoding results among multiple encoding results corresponding to a preset virtual object includes: calculating the Lewinstein distance between every two encoding results among multiple encoding results, and determining the Lewinstein distance as the similarity between every two encoding results.

[0141] In an optional embodiment, the step of classifying multiple encoding results based on the similarity between every two encoding results to obtain multiple classification results includes: for each encoding result among the multiple encoding results, performing the following operations: determining the target encoding result among the multiple encoding results whose similarity to the current encoding result is less than a preset similarity threshold, and the number of target encoding results; if the number of target encoding results is greater than a preset number threshold, determining that the current encoding result and the target encoding result belong to the same classification result.

[0142] In an optional embodiment, the aforementioned preset conditions include: the distance between the target virtual object and the first virtual object is less than a preset distance threshold, and the distance between the first virtual object and the first virtual object in the game scene is less than the preset distance threshold; wherein, the target virtual object and the first virtual object belong to different game factions, and the target virtual object performs target game behavior in the game scene to attack the first virtual object.

[0143] In an optional embodiment, the step of determining the target game behavior from the game behaviors contained in the first behavior data corresponding to the first virtual object includes: determining the game behavior with the highest usage probability in the first behavior data corresponding to the first virtual object as the target game behavior; or, randomly determining the target game behavior from the game behaviors contained in the first behavior data based on the usage probability of each game behavior in the first behavior data corresponding to the first virtual object.

[0144] In an optional embodiment, the step of adjusting the usage probability of each game behavior in the first behavior data corresponding to the first virtual object in the preset database based on the target game result to obtain the adjusted first behavior data corresponding to the first virtual object includes: determining the feedback value corresponding to the target game result; wherein, different game results are pre-configured with corresponding feedback values; adjusting the usage probability of each game behavior in the first behavior data corresponding to the first virtual object in the preset database according to the feedback value corresponding to the target game result to obtain the adjusted first behavior data corresponding to the first virtual object.

[0145] In an optional embodiment, the step of adjusting the usage probability of each game behavior in the first behavior data corresponding to the first virtual object in the preset database according to the feedback value corresponding to the target game result to obtain the adjusted first behavior data corresponding to the first virtual object includes: adding the usage probability of the target game behavior in the first behavior data corresponding to the first virtual object in the preset database to the feedback value corresponding to the target game result to obtain a first summing result, and determining the first summing result as the adjusted usage probability corresponding to the target game behavior; determining the adjustment mean based on the feedback value corresponding to the target game result; subtracting the adjustment mean from the game behavior other than the target game behavior in the first behavior data corresponding to the first virtual object to obtain the adjusted usage probability corresponding to the game behavior other than the target game behavior in the first behavior data corresponding to the first virtual object; and determining the adjusted first behavior data corresponding to the first virtual object based on the adjusted usage probability corresponding to the target game behavior and the adjusted usage probability corresponding to the game behavior other than the target game behavior in the first behavior data corresponding to the first virtual object.

[0146] In an optional embodiment, the step of determining the adjusted mean based on the feedback value corresponding to the target game result includes: subtracting one from the total number of game behaviors contained in the first behavior data corresponding to the first virtual object to obtain a subtraction result; and dividing the feedback value corresponding to the target game result by the subtraction result to obtain the adjusted mean.

[0147] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to related technologies, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a terminal device, or a network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0148] In the description of this disclosure, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, and are only for the convenience of describing this disclosure and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this disclosure. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0149] Finally, it should be noted that the above embodiments are merely specific implementations of this disclosure, used to illustrate the technical solutions of this disclosure, and not to limit it. The protection scope of this disclosure is not limited thereto. Although this disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this disclosure. Such modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this disclosure, and should all be covered within the protection scope of this disclosure. Therefore, the protection scope of this disclosure should be determined by the protection scope of the claims.

Claims

1. A method for determining the behavior of a virtual object, the method comprising: In response to the target virtual object's position and a first virtual object in the game scene satisfying preset conditions, first behavior data corresponding to the first virtual object is obtained from a preset database; wherein, the target virtual object is controlled by the game system, and the preset database contains behavior data corresponding to multiple preset virtual objects, the behavior data corresponding to the preset virtual objects including: multiple game behaviors, and the usage probability corresponding to each game behavior; wherein, the game behaviors include preset game behaviors that the target virtual object can execute when the target virtual object's position and the preset virtual object satisfy preset conditions; The target game behavior is determined from the game behavior contained in the first behavior data corresponding to the first virtual object, and the target virtual object is controlled to execute the target game behavior in the game scene; Obtain the target game result generated when the target virtual object performs the target game behavior in the game scene; Based on the target game result, the usage probability of each game behavior in the first behavior data corresponding to the first virtual object in the preset database is adjusted to obtain the adjusted first behavior data corresponding to the first virtual object.

2. The method according to claim 1, wherein, The behavioral data corresponding to the preset virtual object in the preset database is predetermined in the following manner: Acquire historical game data, which includes the target virtual object's position and the sequence of the target virtual object's behavior from when the preset virtual object meets the preset condition until the end of the game state; The behavior sequence corresponding to the preset virtual object is obtained based on the behavior sequence of the target virtual object; The behavior sequence corresponding to the preset virtual object is encoded according to preset rules to obtain the encoding result corresponding to the preset virtual object; wherein, one encoding result corresponds to one behavior sequence corresponding to the preset virtual object; Based on the encoding result corresponding to the preset virtual object, determine the game behavior corresponding to the preset virtual object and the usage probability corresponding to the game behavior; The behavioral data corresponding to the preset virtual object is determined based on the game behavior corresponding to the game behavior and the usage probability corresponding to the game behavior.

3. The method according to claim 2, wherein, The step of obtaining the behavior sequence corresponding to the preset virtual object based on the behavior sequence of the target virtual object includes: The behavior sequence of the target virtual object is determined as the behavior sequence corresponding to the preset virtual object.

4. The method according to claim 3, wherein, The behavior sequence of the target virtual object includes multiple data, including: the movement direction of the target virtual object, whether the target virtual object attacks, the attack type when the target virtual object attacks, and the positional relationship between the target virtual object and the first virtual object; each data is pre-configured with a corresponding encoding identifier; each data can appear once or multiple times in the behavior sequence; The step of encoding the behavior sequence corresponding to the preset virtual object according to preset rules to obtain the encoding result corresponding to the preset virtual object includes: Based on the encoding identifier corresponding to each type of data, the data contained in the behavior sequence corresponding to the preset virtual object are encoded to obtain the encoding result corresponding to the preset virtual object.

5. The method according to claim 2, wherein, The preset virtual object corresponds to multiple encoding results; The step of determining the game behavior corresponding to the preset virtual object and the usage probability corresponding to the game behavior based on the encoding result corresponding to the preset virtual object includes: Calculate the similarity between any two encoding results among the multiple encoding results corresponding to the preset virtual object, and classify the multiple encoding results based on the similarity between any two encoding results to obtain multiple classification results; Based on preset game behaviors, the game behavior corresponding to each classification result is determined; wherein, different classification results correspond to different game behaviors. Based on the number of encoded results contained in each of the classification results, and the total number of the multiple encoded results, the probability of using the game behavior corresponding to each of the classification results is determined; The game behavior corresponding to each of the classification results is determined as the game behavior corresponding to the preset virtual object, and the usage probability of the game behavior corresponding to each of the classification results is determined as the usage probability of the game behavior corresponding to the preset virtual object.

6. The method according to claim 5, wherein, The step of calculating the similarity between any two encoding results among multiple encoding results corresponding to the preset virtual object includes: Calculate the Levenstein distance between every two encoding results among the plurality of encoding results, and determine the Levenstein distance as the similarity between every two encoding results.

7. The method according to claim 5, wherein, The step of classifying the multiple encoding results based on the similarity between every two encoding results to obtain multiple classification results includes: For each of the plurality of encoding results, the following operation is performed: Determine the target encoding result among the multiple encoding results whose similarity to the current encoding result is less than a preset similarity threshold, and the number of the target encoding results; If the number of target encoding results is greater than a preset number threshold, it is determined that the current encoding result and the target encoding result belong to the same classification result.

8. The method according to claim 1, wherein, The preset conditions include: the distance between the target virtual object and the first virtual object is less than a preset distance threshold, and the distance between the first virtual object in the game scene and the first virtual object is less than the preset distance threshold; wherein, the target virtual object and the first virtual object belong to different game factions, and the target virtual object performs the target game behavior in the game scene to attack the first virtual object.

9. The method according to claim 1, wherein, The step of determining the target game behavior from the game behaviors contained in the first behavior data corresponding to the first virtual object includes: The game behavior with the highest probability of use in the first behavior data corresponding to the first virtual object is determined as the target game behavior; Alternatively, based on the usage probability of each game behavior in the first behavior data corresponding to the first virtual object, the target game behavior can be randomly determined from the game behaviors included in the first behavior data.

10. The method according to claim 1, wherein, The step of adjusting the usage probability of each game behavior in the first behavior data corresponding to the first virtual object in the preset database based on the target game result, to obtain the adjusted first behavior data corresponding to the first virtual object, includes: Determine the feedback value corresponding to the target game result; wherein, different game results are pre-configured with corresponding feedback values; Based on the feedback value corresponding to the target game result, the usage probability of each game behavior in the first behavior data corresponding to the first virtual object in the preset database is adjusted to obtain the adjusted first behavior data corresponding to the first virtual object.

11. The method according to claim 10, wherein, The step of adjusting the usage probability of each game behavior in the first behavior data corresponding to the first virtual object in the preset database according to the feedback value corresponding to the target game result, to obtain the adjusted first behavior data corresponding to the first virtual object, includes: The probability of using the target game behavior in the first behavior data corresponding to the first virtual object in the preset database is added to the feedback value corresponding to the target game result to obtain a first summation result. The first summation result is determined as the adjusted probability of using the target game behavior. The adjustment mean is determined based on the feedback value corresponding to the target game result; For each game behavior other than the target game behavior in the first behavior data corresponding to the first virtual object, the adjusted mean is subtracted to obtain the adjusted usage probability corresponding to the game behavior other than the target game behavior in the first behavior data corresponding to the first virtual object. Based on the adjusted usage probability corresponding to the target game behavior and the adjusted usage probability corresponding to game behaviors other than the target game behavior in the first behavior data corresponding to the first virtual object, the adjusted first behavior data corresponding to the first virtual object is determined.

12. The method according to claim 11, wherein, The step of determining the adjusted mean based on the feedback value corresponding to the target game result includes: Subtract one from the total number of game behaviors contained in the first behavior data corresponding to the first virtual object to obtain the subtraction result; The adjusted mean is obtained by dividing the feedback value corresponding to the target game result by the subtraction result.

13. A device for determining the behavior of a virtual object, the device comprising: The data acquisition module is configured to retrieve first behavior data corresponding to the first virtual object from a preset database in response to a preset condition being met between the target virtual object's position and a first virtual object in the game scene. The target virtual object is controlled by the game system, and the preset database contains behavior data corresponding to multiple preset virtual objects. This behavior data includes multiple game behaviors and their respective usage probabilities. The game behaviors include preset game behaviors that the target virtual object can execute when the target virtual object's position and the preset virtual object meet the preset condition. The behavior determination module is configured to determine a target game behavior from the game behaviors contained in the first behavior data corresponding to the first virtual object, and control the target virtual object to perform the target game behavior in the game scene; The result acquisition module is configured to acquire the target game result generated when the target virtual object performs the target game behavior in the game scene; The data adjustment module is configured to adjust the usage probability of each game behavior in the first behavior data corresponding to the first virtual object in the preset database based on the target game result, so as to obtain the adjusted first behavior data corresponding to the first virtual object.

14. An electronic device comprising a processor and a memory, the memory storing machine-executable instructions executable by the processor, the processor executing the machine-executable instructions to implement the behavior determination method for a virtual object according to any one of claims 1 to 12.

15. A computer-readable storage medium storing computer-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the behavior determination method for a virtual object according to any one of claims 1 to 12.

Citation Information

Patent Citations

  • Multi-agent technology-based NPC control method

    CN107145948A

  • AI behavior achieving method and device

    CN107890675A

  • Virtual game object behavior control method and device, equipment and a storage medium

    CN113952726A

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

    CN116459520A

  • Virtual character control method and device and electronic equipment

    CN117883773A