Motion control method, device and electronic equipment for virtual role

By selecting key positions for virtual character movement control based on historical game records and obstacle locations in asymmetric competitive online games, the problem of AI players' insufficient use of terrain and props is solved, thereby improving the gaming experience.

CN115120977BActive Publication Date: 2025-10-10NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210517832.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-12
Publication Date
2025-10-10
Estimated Expiration
2042-05-12

AI Technical Summary

Technical Problem

In asymmetric competitive online games, AI players' virtual characters find it difficult to fully utilize terrain and props, and their levels of anthropomorphism and intelligence are low, resulting in a poor player experience.

Method used

By obtaining the current position of the virtual character in the virtual scene, determining whether it is in the target area, and based on historical game records and obstacle locations, selecting key positions for movement control, the anthropomorphism and intelligence of the AI ​​player are improved.

Benefits of technology

The anthropomorphism and intelligence of the game AI have been improved, enhancing the player's gaming experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115120977B_ABST
    Figure CN115120977B_ABST
Patent Text Reader

Abstract

The application provides a virtual role motion control method and device and electronic equipment. A current position of a controlled virtual role in a virtual scene is obtained. Whether the controlled virtual role is located in a target region in the virtual scene is determined based on the current position. If the controlled virtual role is located in the target region, a target position is determined from preset key positions of the target region based on the current position of the controlled virtual role. The key positions are determined based on positions of obstacles in the target region and positions of a first virtual role in the virtual scene in a historical game record. The controlled virtual role is controlled to move from the current position to the target position. In the above manner, the key positions are determined based on positions of a virtual role with the same role attribute as the controlled virtual role in the virtual scene in the historical game record. The virtual role is controlled to move based on the target position determined from the key positions, which improves the humanization and intelligence of game AI and improves the game experience of players.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of game AI technology, and in particular to a method, device and electronic equipment for controlling the motion of a virtual character. Background Art

[0002] In asymmetric competitive online games, two groups of virtual characters are in a relationship of confrontation with each other. The skills of the group of virtual characters in an advantageous position are usually stronger than those of the group of virtual characters in a disadvantaged position. In order to avoid the disadvantaged virtual characters being quickly killed and eliminated, the disadvantaged virtual characters need to make full use of the terrain or props in the game scene to hide or escape during the game with their opponents, so as to gain the upper hand and increase the probability of winning.

[0003] In related art, when the number of real players participating in a game is insufficient, AI players, also known as virtual players, are often used to participate. The behavior of the AI ​​player's corresponding virtual character is typically controlled by a server. When the AI ​​player's virtual character is in a weak position, the virtual character relies on pre-set, relatively regular movement paths to move and escape. Furthermore, the AI ​​player struggles to fully utilize props and terrain like a real player to engage with a stronger virtual character, causing distress to the opponent. Furthermore, the control method for the AI ​​player's virtual character lacks anthropomorphism and intelligence, making it easy for real players to identify it as a virtual character controlled by the AI ​​player, resulting in a poor player experience. Summary of the Invention

[0004] In view of this, the object of the present invention is to provide a motion control method, device and electronic device for a virtual character, so as to improve the anthropomorphism and intelligence level of game AI, thereby enhancing the gaming experience of players.

[0005] In a first aspect, an embodiment of the present invention provides a method for controlling the motion of a virtual character, the method comprising: obtaining a current position of a controlled virtual character in a virtual scene; determining whether the controlled virtual character is located in a target area in the virtual scene based on the current position; wherein the target area is determined in advance based on a position of a first virtual character having the same character attributes as the controlled virtual character in the virtual scene in historical game records; if the controlled virtual character is located in the target area, determining the target position from key positions preset in the target area based on the current position of the controlled virtual character; wherein the key position is determined based on the position of obstacles in the target area and the position of the first virtual character in the virtual scene in historical game records; and controlling the controlled virtual character to move from the current position to the target position.

[0006] The above-mentioned target area is specifically determined in the following manner: obtaining the first position of the first virtual character that meets the preset conditions from the historical game records; wherein the preset conditions include: when the first virtual character is at the first position, the distance between the second virtual character and the first virtual character is less than a first distance threshold; the second virtual character and the first virtual character have an adversarial relationship; and determining the target area based on the first position.

[0007] The above-mentioned first positions include multiple ones; the step of determining the target area based on the first positions includes: clustering the first positions to obtain a first clustering result; wherein the first clustering result includes at least one group of initial position combinations; each group of initial position combinations includes a cluster center and at least one first position; and determining the target area based on the first clustering result.

[0008] The above-mentioned step of determining the target area based on the first clustering result includes: screening at least one group of initial position combinations, and / or screening the first position in the initial position combination to obtain at least one group of final position combinations; determining the target area based on the cluster center of each group of final position combinations and the first position in the final position combination.

[0009] The above-mentioned key position is specifically determined in the following manner: clustering the first position located in the target area to obtain a second clustering result; wherein the second clustering result includes at least one group of position groups; each group of position groups includes a cluster center and at least one first position; the first position in the target area is determined based on the position of the first virtual character in the historical game records; the key position is determined based on the position of the obstacle in the target area and the second clustering result.

[0010] The step of determining the key position based on the position of the obstacle in the target area and the second clustering result includes: determining the outline area of ​​the obstacle based on the position of the obstacle in the target area; wherein the outline area includes: the edge lines of the obstacle and / or an area within a preset distance range from the obstacle; performing position sampling in the obstacle outline area to obtain multiple sampling positions; and determining the key position from the multiple sampling positions based on the second clustering result.

[0011] The above-mentioned step of determining the key position from multiple sampling positions based on the second clustering result includes: determining the current sampling position from the multiple sampling positions; for the current sampling position, searching for a set number of adjacent positions from the second clustering result; the adjacent positions include: a first position whose distance from the current sampling position is less than a preset second distance threshold; if the set number of adjacent positions of the current sampling position are found, determining the key position based on the adjacent positions and the current sampling position.

[0012] The above-mentioned step of determining the key position based on the adjacent positions and the current sampling position includes: determining the position group to which the current sampling position belongs based on the position group to which the adjacent positions belong; eliminating the position group to which the current sampling position belongs from the second clustering result; continuing to perform the step of determining the current sampling position from multiple sampling positions until no position group exists in the second clustering result; and determining the sampling positions corresponding to each position group in the second clustering result as key positions.

[0013] After the above step of determining the key position based on the position of the obstacles in the target area and the second clustering result, the above method also includes: obtaining the movement sequence information between each first position of the first virtual character in the target area from the historical game records; determining the movement sequence information between the key positions in the target area based on the movement sequence information and the distance relationship between the first position and the key position; counting the number of times a movement relationship occurs between any two key positions based on the movement sequence information between the key positions; wherein, any two key positions include the first key position and the second key position; the movement relationship between any two key positions includes: the first virtual character moves directly from the first key position to the second key position, or, moves directly from the second key position to the first key position.

[0014] The above-mentioned key positions include multiple ones; the key positions are preset with movement relationship statistics results; the movement relationship statistics results include: the number of times a movement relationship occurs between any two key positions; based on the current position of the controlled virtual character, the step of determining the target position from the key positions preset in the target area includes: based on the current position of the controlled virtual character, determining the nearest key position closest to the controlled virtual character from multiple key positions; from the movement relationship statistics results, determining the probability that the controlled virtual character moves from the nearest key position to a key position other than the nearest key position; based on the probability, determining the target position from the key positions other than the nearest key position.

[0015] The step of controlling the controlled virtual character to move from the current position to the target position includes: controlling the controlled virtual character to move from the current position to the key position closest to the current position, and then moving from the key position closest to the current position to the target position.

[0016] In a second aspect, an embodiment of the present invention provides a motion control device for a virtual character, the device comprising: a current position acquisition module for acquiring the current position of a controlled virtual character in a virtual scene; a current position area determination module for determining whether the controlled virtual character is located in a target area in the virtual scene based on the current position; wherein the target area is determined in advance based on the position of a first virtual character having the same character attributes as the controlled virtual character in the virtual scene in historical game records; a target position determination module for determining the target position from key positions preset in the target area based on the current position of the controlled virtual character if the controlled virtual character is located in the target area; wherein the key position is determined based on the position of obstacles in the target area and the position of the first virtual character in the virtual scene in historical game records; and a movement control module for controlling the controlled virtual character to move from the current position to the target position.

[0017] In a third aspect, an embodiment of the present invention provides an electronic device including a processor and a memory, wherein the memory stores machine-executable instructions that can be executed by the processor, and the processor executes the machine-executable instructions to implement the above-mentioned virtual character motion control method.

[0018] In a fourth aspect, an embodiment of the present invention provides a machine-readable storage medium storing machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the above-mentioned virtual character motion control method.

[0019] The embodiments of the present invention bring the following beneficial effects:

[0020] The above-mentioned method, device and electronic device for controlling the movement of a virtual character obtain the current position of the controlled virtual character in the virtual scene; determine whether the controlled virtual character is located in the target area in the virtual scene based on the current position; if the controlled virtual character is located in the target area, determine the target position from the key positions preset in the target area based on the current position of the controlled virtual character; wherein the key position is determined based on the position of obstacles in the target area and the position of the first virtual character in the virtual scene in the historical game records; and control the controlled virtual character to move from the current position to the target position. In the above-mentioned method, the key position is determined based on the position of a virtual character in the virtual scene with the same character attributes as the controlled virtual character in the historical game records, and the movement of the virtual character is controlled based on the target position determined from the key position, thereby improving the anthropomorphism and intelligence of the game AI, thereby improving the player's gaming experience.

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

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

[0023] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the specific embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative work.

[0024] Figure 1 A flowchart of a method for controlling motion of a virtual character provided by an embodiment of the present invention;

[0025] Figure 2 A schematic diagram of a game map including the position of a first virtual character provided by an embodiment of the present invention;

[0026] Figure 3 A schematic diagram of a game map including location clustering results provided by an embodiment of the present invention;

[0027] Figure 4 A schematic diagram of a game map including clustering results of locations in a target area provided by an embodiment of the present invention;

[0028] Figure 5 A schematic structural diagram of a motion control device for a virtual character provided by an embodiment of the present invention;

[0029] Figure 6 A schematic structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0030] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work shall fall within the scope of protection of the present invention.

[0031] In asymmetric competitive online games, two groups of virtual characters can be set up, with the relationship between these two groups being one versus four (also known as "1v4") games, where one hunter competes against four survivors. The survivors' primary task is to repair the cipher machine as quickly as possible, open the gate, and escape from the manor to achieve ultimate victory. However, the time to repair the cipher machine is earned by the survivors who are in direct confrontation with the hunter. Due to the inherent imbalance of asymmetric competition, the hunter has powerful skills that can directly damage the survivors, while the survivors have weaker or no skills to damage the hunter. Survivors, who are the hunter's pursuit targets, need to use windows and terrain to delay the hunter's pursuit as much as possible.

[0032] Since it takes a long time for the Hunter to recover from being hit by a board and it takes a long time to step on the board, the survivors can make full use of the board windows and terrain to buy more time for the team. However, in each game, the number of boards is limited and cannot be regenerated and can only be consumed, so it is necessary to "save" each board and maximize the benefits of each board as much as possible. Circling the board is one of the important methods. Let's take a simple single long board scene as an example. The long board is generally composed of a longer side and a shorter side. Since the killer is afraid that the survivor will put down the board and get hit, the survivor can play a game with the killer by circling the longer side.

[0033] If the scene is more complicated, you can also "disappear" from the killer's sight during the game. During the game, the survivors usually walk around the board or terrain close to the model, which can make the circle faster and avoid being caught up by the killer too quickly.

[0034] In multiplayer online competitive games, when the number of real players is insufficient, AI (artificial intelligence) players (also known as "game AI" or "virtual players") are often used to participate. For symmetrical competitive online games, due to the inherent balance of the game, the game AI doesn't need to overly consider relying on terrain to stall and avoid being quickly eliminated by the opponent during a one-on-one (also known as "1v1") match. However, in related art, in asymmetrical competitive games, if the AI ​​player only follows preset rules during the chase and escape phase, their performance in fixed scenes is relatively monotonous, such as running to the next unused board after using one board. They fail to fully utilize various props and terrain to cause trouble to the dominant player, such as putting pressure on the butcher when the board is not used. The low degree of anthropomorphism makes it difficult for real players to feel the game experience. The lack of anthropomorphism makes it easy for players to identify the AI ​​player.

[0035] In the study of the movement process of game AI, reinforcement learning and transfer learning can be used to avoid the problem of not being able to fully utilize the terrain and props. However, due to the long construction period and huge consumption of computing resources after implementation, with the increasingly rapid update of games today, most of them remain in the experimental and theoretical stages and cannot meet the needs of rapid implementation.

[0036] Based on this, the embodiments of the present invention provide a method, device, and electronic device for controlling the motion of a virtual character. This technology can be applied to various motion control scenarios that require game AI players to act as virtual players.

[0037] To facilitate understanding of this embodiment, a motion control method for a virtual character disclosed in an embodiment of the present invention is first described in detail. Figure 1 As shown, the method includes the following steps:

[0038] Step S102: obtaining the current position of the controlled virtual character in the virtual scene.

[0039] The controlled virtual characters are typically AI players. If the number of actual players participating in a game is insufficient, the game system will need to add AI players to the game to meet the required number of players on both sides (or multiple sides). The virtual scene is typically a game scene provided by the game system, where all players move and interact. The current position is typically the position of the controlled virtual character within the virtual scene at the current moment, and can be expressed as positional coordinates within the virtual scene.

[0040] Step S104, determining whether the controlled virtual character is located in a target area in the virtual scene based on the current position; wherein the target area is pre-determined based on the position of a first virtual character having the same character attributes as the controlled virtual character in the virtual scene in historical game records.

[0041] The target area is typically surrounded by obstacles. Because virtual characters with different attributes or factions often face off in asymmetric competitive games, the disadvantaged virtual character may need to use obstacles in the game scene to hide or escape, increasing their chances of victory. These obstacles can be large buildings, shielding the controlled virtual character from detection. They can also be fixed mechanisms or weapons, which can act as a deterrent to opponents as the controlled virtual character maneuvers around them.

[0042] The above-mentioned historical game records usually include game records of multiple rounds of real players. When controlling a virtual character in a weak position to deal with a virtual character in an advantageous position, real players usually make full use of the obstacles in the game scene and stay around the obstacles for a long time, so that more positions around the obstacles are saved in the game records. Since the distance between the virtual character in a weak position and the virtual character in an advantageous position is usually less than a certain distance threshold during the process of dealing with each other, the historical game records can be parsed to obtain the position of the above-mentioned first virtual character in the virtual scene, and from these positions, positions with a distance less than the distance threshold to the position of the virtual character with different character attributes from the controlled virtual character can be screened. Based on the distribution of these positions, the target area with obstacles is determined. The distribution of the positions can be determined by a clustering algorithm.

[0043] The target area can be represented by a position coordinate range in the virtual scene. When determining whether the controlled virtual character is located in the target area in the virtual scene, it can be determined whether the current position of the controlled virtual character is within the target area, that is, whether the position coordinates of the current position are within the position coordinate range corresponding to the target area. If so, the controlled virtual character is located in the target area; if not, the controlled virtual character is not in the target area.

[0044] Step S106: If the controlled virtual character is located in the target area, the target position is determined from the key positions preset in the target area based on the current position of the controlled virtual character; wherein the key position is determined based on the position of the obstacles in the target area and the position of the first virtual character in the virtual scene in the historical game records.

[0045] If the controlled virtual character is in the target area, to increase the controlled virtual character's chances of winning, it needs to be controlled to move along the obstacles in the target area. The position of the first virtual character controlled by the real player in the target area and the movement relationship between each position in the historical game records can provide a reference for the controlled virtual character's movement process.

[0046] When a real player controls a virtual character to move around an obstacle in a target area, the virtual character's movement efficiency is higher when it moves close to the obstacle. A more efficient moving area can be pre-determined based on the position and contour parameters of the obstacle in the target area, and then some positions can be selected from the moving area; this selection process can be achieved through position sampling. Since the outline of an obstacle is usually irregular, such as having corners, the moving area can be divided into several area parts based on the obstacle outline, and a moving position needs to be selected in each area part. In addition, the moving area can be divided into several area parts based on the position distribution of the first virtual character controlled by the real player in the target area in historical game records. Specifically, the position of the first virtual character in the target area can be clustered, and the moving area can be divided into multiple area parts based on the areas where positions of different categories are located.

[0047] When selecting multiple positions in the moving area, sampling can be used. These positions are referred to as "sampling positions" below. During the sampling process, it is also necessary to control the distance between the various positions obtained by sampling to more comprehensively cover the various parts of the moving area. Since the sampling position may be quite different from the position where the first virtual character controlled by the real player will move during the movement, if in the subsequent process, the controlled virtual character with the same role as the first virtual character controlled by the game AI moves directly in the moving area based on the sampling position, the efficiency of hiding or maneuvering is low. Therefore, it is also necessary to refer to the position of the first virtual character in the target area and determine the key position from the multiple sampling positions in the moving area.

[0048] In a specific implementation, after determining the category corresponding to the position of the first virtual character controlled by the real player in the target area, the category to which the sampling position belongs can be determined based on the distance between the sampling position and the position of the first virtual character in the target area. Usually, one category corresponds to an area part in the moving area around the obstacle. Usually, a sampling position belonging to the corresponding category can be determined for each area part. The determined sampling position is used as the key position, and multiple sampling positions can be set according to needs.

[0049] When applying key positions determined through game records of a first virtual character controlled by a real player to the movement of a controlled virtual character controlled by the game's AI, if the controlled virtual character is located in a target area, the key position closest to the controlled virtual character among multiple key positions can be used as the next position to which the controlled virtual character needs to move, i.e., the target position. After the controlled virtual character moves to the target position, the next target position to which the controlled virtual character needs to move can be determined based on the target position, which is usually also one of the key positions.

[0050] Since the position of the first virtual character controlled by the real player in the target area and the movement relationship between each position are required to provide a reference for the movement process of the controlled virtual character, after determining the key position, it is also necessary to determine the movement relationship between the key positions based on the movement relationship between the first virtual character's positions in the target area in the historical game records. First, the position of the first virtual character in the target area in the historical game records can be matched with the key positions. Then, the movement relationship between the first virtual character's positions in the target area can be mapped to the movement relationship between the key positions. For example, if the first position is matched to the first key position and the second position is matched to the second key position; the movement relationship between the first position and the second position is the first position moving to the second position, then the movement relationship between the first key position and the second key position is the first key position moving to the second key position. Since the same key position may correspond to different movement relationships in different game records, for example, in ten game records, the first key position moves to the second key position 3 times, to the third key position 5 times, and to the seventh key position 2 times, then the probability of the controlled virtual character moving to other key positions when it is at the first key position can be determined based on the number of each movement relationship. When the determined key position is applied to the movement of a controlled virtual character controlled by the game AI, when the controlled virtual character is at the current target position, the current target position is a key position, and the next target position to be moved from the key position can be determined based on the probability of the target position moving to other key positions.

[0051] Step S108: Control the controlled virtual character to move from the current position to the target position.

[0052] When controlling a controlled virtual character to move from its current position to a target location, the controlled virtual character can be controlled to reach the corresponding target location based on a preset speed of the controlled virtual character, or based on the controlled virtual character's movement state, such as running or walking. There can be multiple target locations, and there is a predetermined movement relationship between two adjacent target locations. Controlling the controlled virtual character to move within a target area based on the target locations allows for more efficient hiding or maneuvering.

[0053] The above-mentioned method for controlling the movement of a virtual character obtains the current position of the controlled virtual character in the virtual scene; determines whether the controlled virtual character is located in the target area in the virtual scene based on the current position; if the controlled virtual character is located in the target area, determines the target position from the key positions preset in the target area based on the current position of the controlled virtual character; wherein the key position is determined based on the position of obstacles in the target area and the position of the first virtual character in the virtual scene in the historical game records; and controls the controlled virtual character to move from the current position to the target position. In the above-mentioned method, the key position is determined based on the position of a virtual character in the virtual scene with the same character attributes as the controlled virtual character in the historical game records, and the movement of the virtual character is controlled based on the target position determined from the key position, thereby improving the anthropomorphism and intelligence of the game AI, thereby improving the player's gaming experience.

[0054] The following embodiments provide specific implementation methods for determining the target area and the key positions of the target area.

[0055] The target area is usually the area where the virtual character with the same attributes as the controlled virtual character avoids the opponent's attack or engages the opponent, and usually has obstacles such as obstructions and traps. Specifically, the target area can be determined by:

[0056] (1) Obtaining a first position of a first virtual character that satisfies a preset condition from a historical game record; wherein the preset condition includes: when the first virtual character is at the first position, a distance between the second virtual character and the first virtual character is less than a first distance threshold; and the second virtual character and the first virtual character have an adversarial relationship.

[0057] The first virtual character mentioned above is usually the weaker party and needs to avoid the pursuit of the second virtual character, or deal with the second virtual character. The game record usually includes a variety of information, such as the position information of each virtual character, trajectory information, skill operation information of the virtual character, etc. The game record needs to be parsed to obtain the position information of each virtual character. Since the first virtual character only needs to avoid or deal with the second virtual character when the second virtual character is closer to the first virtual character, it is necessary to control the distance between the first virtual character and the second virtual character to be less than the first distance threshold when the first virtual character is in the first position, so as to obtain the first position in the target area. Figure 2 As shown, the first position of the first virtual character with relatively dense distribution can be obtained in the target area with obstacles.

[0058] (2) Determine a target area based on the first position.

[0059] Because multiple historical game records need to be analyzed to reduce the randomness of the target area determined, a more universal target area can be obtained. The first positions obtained in the above manner typically include multiple locations. The first locations can be clustered to obtain a first clustering result; the first clustering result includes at least one set of initial position combinations; each initial position combination includes a cluster center and at least one first location. The target area is then determined based on the first clustering result.

[0060] In the process of clustering the first positions, the K-Means algorithm can be used to cluster the first positions. First, k first positions are initialized as cluster centers. The Euclidean distance from each of the remaining first positions to the cluster center is calculated, and the cluster center with the smallest Euclidean distance is assigned to the cluster center. For each new category, the cluster center is recalculated and the above operation is repeated until the category of each first position no longer changes. Figure 3 As shown, after clustering processing, multiple cluster areas can be obtained, wherein the first positions in a circular area belong to the same initial position combination.

[0061] When determining the target area based on the first clustering result, if there is only one set of initial position combinations, no screening is required; if the first clustering result includes multiple initial position combinations, the initial position combinations are screened, such as initial position combinations containing first positions less than a preset number threshold that can be eliminated, and then the multiple first positions in the initial position combinations are screened to obtain at least one set of final position combinations. Usually, the first position in the screened initial position combinations that is farther away from the cluster center and the cluster center can be determined as the final position combination; based on the cluster center of each set of final position combinations and the first position in the final position combination, the target area is determined.

[0062] Specifically, according to the results of the K-Means algorithm, we get Figure 3 After the four initial position combinations shown, considering the influence of data noise, the initial position combination with fewer points in the category can be discarded ( Figure 3 The initial position combination in the circular area marked 3 in the figure) and the points that are too far from the cluster center ( Figure 3 Calculate the points outside each circular area. A circle is constructed with the cluster center as the center and the longest distance from the cluster center to the undiscarded position of that category (i.e., the first position in the final position combination) as the radius. Each circular area is the target area.

[0063] Once the target area is determined, key locations within the target area can be identified by:

[0064] (1) Clustering is performed on the first position in the target area to obtain a second clustering result; wherein the second clustering result includes at least one group of position groups; each group of position groups includes a cluster center and at least one first position; the first position in the target area is determined based on the position of the first virtual character in the historical game record.

[0065] Specifically, K-Means clustering can be performed again on the first position in the target area to obtain a clustering result. Different position groups in the clustering result can represent different hiding areas in the target area. Figure 4 Shown is the Figure 3 The result of clustering the first position in the circular area marked 1. Points with the same grayscale color represent the first position of the same position group.

[0066] (2) Determine the key location based on the location of obstacles in the target area and the second clustering result.

[0067] Specifically, based on the position of the obstacle in the target area, the outline area of ​​the obstacle is determined; since the obstacle cannot usually be regarded as a point, the position of the obstacle can include the center position and the edge position of the obstacle. The edge positions can be connected to form the outline of the obstacle, which is the junction of the obstacle and the road block. The area within a preset distance range from the obstacle can be used as the outline area, and the outline area can also include the edge lines of the obstacle; then, position sampling is performed in the obstacle outline area to obtain multiple sampling positions; further based on the second clustering result, the key position is determined from the multiple sampling positions.

[0068] When determining a key position from multiple sampling positions, a current sampling position can be determined from the multiple sampling positions; then, for the current sampling position, a set number of adjacent positions are searched from the second clustering results; the adjacent positions include a first position whose distance from the current sampling position is less than a preset second distance threshold; if a set number of adjacent positions of the current sampling position are found, the key position is determined based on the adjacent positions and the current sampling position.

[0069] This method primarily utilizes the supervised clustering algorithm (KNN, k-Nearest Neighbor). When determining the class of a point in a point set, the KNN algorithm assumes that if a majority of the k most similar (i.e., closest) samples in feature space belong to the same class, then the sample also belongs to that class. These neighboring locations are similar samples to the sampling location.

[0070] In order to improve the movement efficiency of the controlled virtual object, only one key position is usually determined for each cluster center. Therefore, the position group to which the current sampling position belongs can be determined based on the position groups to which the adjacent positions belong, that is, if the adjacent positions all belong to the same position group, the current sampling position also belongs to that position group; if the adjacent positions belong to different position groups, the group to which the largest number of adjacent positions belongs is determined as the group to which the sampling position belongs; then the position group to which the current sampling position belongs is eliminated from the second clustering result; the step of determining the current sampling position from multiple sampling positions is continued until no position group exists in the second clustering result, and finally the sampling positions corresponding to each position group in the second clustering result are determined as key positions. This method can make a cluster center correspond to only one key position.

[0071] The following embodiment provides a specific implementation method for determining the target position from the key positions preset in the target area.

[0072] Generally speaking, the target area includes multiple key positions, and the key positions are preset with movement relationship statistics; the movement relationship statistics include: the number of times a movement relationship occurs between any two key positions. When determining the target position from the key positions preset in the target area, first, based on the current position of the controlled virtual character, the closest key position closest to the controlled virtual character is determined from the multiple key positions; then, based on the movement relationship statistics, the probability of the controlled virtual character moving from the closest key position to a key position other than the closest key position is determined; then, based on the probability, the target position is determined from the key positions other than the closest key position; further, the next target position can be determined based on the probability of the determined target position moving to a key position other than the target position. After determining the target position of the controlled virtual character's movement, the controlled virtual character can be controlled to move from the current position to the key position closest to the current position, and then move from the key position closest to the current position to the target position.

[0073] The above-mentioned movement relationship statistics can be obtained in the following manner: from the historical game records, obtain the movement sequence information between each first position of the first virtual character in the target area; the movement sequence information is usually moving directly from a first position to another first position; then based on the movement sequence information, and the distance relationship between the first position and the key position, determine the movement sequence information between the key positions in the target area; based on the movement sequence information between the key positions, count the number of times a movement relationship occurs between any two key positions; wherein, any two key positions include a first key position and a second key position; the movement relationship between any two key positions includes: the first virtual character moves directly from the first key position to the second key position, or, moves directly from the second key position to the first key position.

[0074] Specifically, the position of the first virtual character in the historical game changes from a->b->c->d..., where a, b, c, and d are the positions of the first virtual character. The pairwise distances between each position change point of the first virtual character and the key position points are calculated (specifically, Euclidean distance can be used). The key position with the smallest distance to each position is then associated with that position.

[0075] When a->b->c->d... corresponds to a key position (when the obstacle is a board, the key position is also called a "board-circling key point"), Z->Y->X->W... In the movement relationship statistics, the number of movement relationships Z->Y, Y->X, X->W... is incremented by 1. When determining the probability of moving from the current key position to the next key position, the ratio of the movement relationships between the current key position and the other key positions to the total number of movement relationships for the current key position can be calculated. The calculated ratio is used as the probability of moving from the current key position to the corresponding key position. For example, if key position X has movement relationships with key positions W, L, and N, and the number of movement relationships is 3, 7, and 10, respectively, then the probability of moving from key position X to key position W is 0.15, the probability of moving to key position L is 0.35, and the probability of moving to key position N is 0.5.

[0076] The embodiment of the present invention also provides another method for controlling the motion of a virtual character. Figure 1 This is accomplished based on the method shown in the figure. This method provides a specific implementation method for determining a target area and key locations, and controlling the movement of a virtual character. In this method, the obstacles in the target area are specifically boards, so the target area is also called the board-circling area. Based on the character attributes of the controlled virtual character, the controlled virtual character can be called a civilian player or a survivor. A virtual character with different character attributes from the controlled virtual character can be called a butcher player or a supervisor. Historical game records are specifically recorded in the form of video.

[0077] This method is mainly implemented in the following ways:

[0078] (1) Determining the area for circling the board: Analyze the video recordings of real players and extract the coordinates of civilian players whose distance from the butcher player is within a certain range (equivalent to the above-mentioned "first position"), and use the unsupervised clustering algorithm K-Means to cluster the coordinates to obtain the area suitable for civilians to circling the board (equivalent to the above-mentioned "target area").

[0079] Specifically, we first analyze the player's video and extract the coordinates of civilian players within a certain range from the killer player. Since civilians will have heartbeats within the fear radius, they can feel the killer around them and enter a state of avoidance. Therefore, we can set a certain range as the fear radius, that is, 380 yards, and obtain the following: Figure 2 The player's coordinates are shown marked on the game map.

[0080] Then the K-Means algorithm is used to cluster the obtained plane player coordinates, and according to the results of the K-Means algorithm, the following can be obtained: Figure 3 The clustering results of the four circular areas (points in different circular areas belong to different categories), considering the influence of data noise, discard the areas with fewer points in the category ( Figure 3 The points that are too far from the cluster center (points outside the circular area in the figure) are collected. A circle is constructed with the cluster center as the center and the distance from the cluster center to the farthest point of the category that has not been discarded as the radius. The area inside each circle is the board area. The set of points in the board area can be recorded as {n1,n2,n3,…,n m}.

[0081] (2) Determination of key points around the board (equivalent to the above-mentioned "key positions"): K-Means clustering is performed again on the coordinates of civilian players in each area around the board. After obtaining the outline information of all obstacles in each map in advance, its outline information can be obtained based on the position of the obstacle in the area around the board. Points are selected on the outline of the obstacle in a certain way, and the KNN supervised clustering algorithm is used to determine the category of the points in the point set. Each time a category of a point in the point set is determined, the category is eliminated from the K-Means clustering. The above steps are repeated until all points in the point set are assigned or the categories are assigned.

[0082] Specifically, after determining the board-circling area, a series of key points need to be determined in the board-circling area as a series of points on the board-circling path in the area. Therefore, K-Means clustering is performed again for each board-circling area to Figure 2 Taking the circular area marked with number 1 as an example, we can get the following Figure 3 The clustering results shown are as follows, where points of different grayscale belong to different categories.

[0083] Each category has its own cluster center point c i Since the walking distance of the model is the shortest, the key point d is usually determined by sticking to the obstacle model. i Therefore, we can find the position points that can be used as key points in the mold area. From the data point of view, the key points d i Must be related to a cluster center c iThe distance is not very far. Among them, the area within a certain range of the junction between the obstacle and the road block can be used as the template area.

[0084] Points are taken on the obstacle contour in the bypass area in a certain way, but the closest interval between them must not be less than ε. The point set is {p1,p2,p3,…,p n The KNN supervised clustering algorithm is used to determine the category of the points in the point set. The idea of ​​the KNN algorithm is that if most of the k most similar samples (i.e., the closest ones in the feature space) of a sample in the feature space belong to a category, then the sample also belongs to this category.

[0085] Here, k=3. Considering p i with c i The distance is not far, click c i is the cluster center, then n is the i Distance p i It will not be far away, so find the point n closest to point p1 i Need to ensure:

[0086]

[0087] Where α is a constant. d(p1,n i ) is p1 and point n i If k=3 n cannot be found in the civilian player coordinates i , then the p i Click to discard.

[0088] Then, the category of the point is calculated according to the KNN algorithm. If two of the three points closest to point p1 belong to the first category and one belongs to the second category, then point p1 belongs to the first category.

[0089] In game scenes, the number of key points on the model's outline is limited. Generally, there is only one key point corresponding to each category. Therefore, once the category is determined, the category to which the sampling point belongs is removed when calculating the category. Repeat the above steps until all points in the point set have been assigned or all categories have been assigned.

[0090] (3) Determine the path around the board: Utilize the serialized information of the civilian coordinates when obtaining the board area, calculate the pairwise Euclidean distance between each civilian position change and the board key point according to the serialized information, and select the board key point with the smallest Euclidean distance corresponding to each position. Increment the number of key point paths corresponding to the serialized information in the database by 1. During the use of the model, based on whether the civilian AI position is within the board area, if it is within the board area, calculate the board key point closest to the current civilian AI position. After the civilian AI arrives at this key point, the probability of the next key point of the board path is proportional to the number of key points to the next key point in the database.

[0091] For a certain area around the board, select the civilian player coordinate point set {q1,q2,q3,…,q m The serialized information of this point set includes: in a certain video data, the position of a civilian changes from q1->q3->q5->..., and the pairwise Euclidean distance between each position change point of the civilian and the key point of the orbiting board is calculated. The key point of the orbiting board with the smallest Euclidean distance corresponding to each position is selected.

[0092] If it is determined that the key point of the board circling q1->q3->q5->… is p7->p3->p1->…, then in the database, the number of p7->p3, p3->p1, p1->… is increased by 1, where p7->p3, p3->p1, p1->… are each considered a movement relationship. The number of movement relationships is calculated based on the serialized information of the civilian player's coordinate point set.

[0093] When the civilian AI reaches the key point p closest to its current position i Then, move to the next key point of the board in the board path (p x , p y or p z ) and the probability of p in the database i To this position (ie p i With p x , p y or p z The number of moving relations is proportional to the number of moving relations. i Arrival p x The number of times pi reaches p is 3. y The number of times pi reaches p is 7. z The number of times is 10, then determine p x The probability of the next key point around the board is 0.15, and p is determined y The probability of the next key point around the board is 0.35, and p is determined zThe probability of being the next key point around the board is 0.5. Repeat the above steps until you are hit by the civilian AI butcher or all the boards in the board area are used.

[0094] This method uses a clustering algorithm to perform "non-explicit" training on player video data, eliminating the need for professional planners to write extensive manual rules and frequently modify behavior trees. This allows the game AI to be more anthropomorphic and similar to the player, while also allowing the supervisor player to experience the thrill of the game. Even in fixed scenarios, the performance can be varied, making it difficult for players to identify the AI. Compared to reinforcement learning and transfer learning, which require high computing power and long timescales, this method can be implemented more quickly and efficiently.

[0095] For the above method embodiments, see Figure 5 A motion control device for a virtual character is shown, the device comprising:

[0096] The current position acquisition module 502 is used to obtain the current position of the controlled virtual character in the virtual scene;

[0097] a current location region determination module 504 for determining, based on the current location, whether the controlled virtual character is located in a target region in the virtual scene; wherein the target region is pre-determined based on the location of a first virtual character having the same character attributes as the controlled virtual character in the virtual scene as recorded in historical game records;

[0098] a target position determination module 506 for determining, if the controlled virtual character is in the target area, a target position from predetermined key positions in the target area based on the current position of the controlled virtual character; wherein the key positions are determined based on the positions of obstacles in the target area and the position of the first virtual character in the virtual scene as recorded in the historical game;

[0099] The movement control module 508 is used to control the controlled virtual character to move from the current position to the target position.

[0100] The above-mentioned motion control device for a virtual character obtains the current position of the controlled virtual character in the virtual scene; determines whether the controlled virtual character is located in the target area in the virtual scene based on the current position; if the controlled virtual character is located in the target area, determines the target position from the key positions preset in the target area based on the current position of the controlled virtual character; wherein the key position is determined based on the position of obstacles in the target area and the position of the first virtual character in the virtual scene in the historical game records; and controls the controlled virtual character to move from the current position to the target position. In the above-mentioned method, the key position is determined based on the position of a virtual character in the virtual scene with the same character attributes as the controlled virtual character in the historical game records, and the movement of the virtual character is controlled based on the target position determined from the key position, thereby improving the anthropomorphism and intelligence of the game AI, thereby improving the player's gaming experience.

[0101] The above-mentioned device also includes a target area determination module, which includes: a first position determination unit, used to obtain a first position of the first virtual character that meets preset conditions from historical game records; wherein the preset conditions include: when the first virtual character is at the first position, the distance between the second virtual character and the first virtual character is less than a first distance threshold; the second virtual character and the first virtual character have an adversarial relationship; and a target area determination unit, used to determine the target area based on the first position.

[0102] The above-mentioned first positions include multiple ones; the above-mentioned target area determination unit is also used to: perform clustering processing on the first positions to obtain a first clustering result; wherein the first clustering result includes at least one group of initial position combinations; each group of initial position combinations includes a cluster center and at least one first position; and determine the target area based on the first clustering result.

[0103] The above-mentioned target area determination unit is also used to: screen at least one group of initial position combinations, and / or screen the first position in the initial position combination to obtain at least one group of final position combinations; determine the target area based on the cluster center of each group of final position combinations and the first position in the final position combination.

[0104] The above-mentioned device also includes a key position determination module, which includes: a clustering unit, which is used to cluster the first position located in the target area to obtain a second clustering result; wherein the second clustering result includes at least one group of position groups; each group of position groups includes a cluster center and at least one first position; the first position in the target area is determined based on the position of the first virtual character in the historical game records; the key position determination unit is used to determine the key position based on the position of the obstacle in the target area and the second clustering result.

[0105] The key position determination unit is further configured to determine a contour region of the obstacle based on a position of the obstacle in the target region, wherein the contour region comprises an edge line of the obstacle and / or a region within a preset distance range from the obstacle, sample positions in the contour region of the obstacle to obtain a plurality of sample positions, and determine a key position from the plurality of sample positions based on the second clustering result.

[0106] The key position determination unit is further configured to determine a current sample position from the plurality of sample positions, find a preset number of adjacent positions from the second clustering result for the current sample position, wherein the adjacent positions comprise first positions having a distance less than a preset second distance threshold from the current sample position, and determine the key position based on the adjacent positions and the current sample position if the preset number of adjacent positions for the current sample position are found.

[0107] The key position determination unit is further configured to determine a position group to which the current sample position belongs based on a position group to which the adjacent positions belong, remove the position group to which the current sample position belongs from the second clustering result by using a position group removal module, continue to determine the current sample position from the plurality of sample positions until there is no position group in the second clustering result, and determine the sample positions corresponding to each position group in the second clustering result as the key positions.

[0108] The device further comprises a sequence information acquisition module configured to acquire movement sequence information between each first position of the first virtual character in the target region from a historical game record, a movement sequence determination module configured to determine movement sequence information between the key positions in the target region based on the movement sequence information and a distance relationship between the first positions and the key positions, and a movement relationship statistics module configured to count a number of movement relationships between any two key positions based on the movement sequence information between the key positions, wherein the any two key positions comprise a first key position and a second key position, and the movement relationship between the any two key positions comprises that the first virtual character moves directly from the first key position to the second key position or moves directly from the second key position to the first key position.

[0109] The key positions comprise a plurality of key positions, the key positions are preset with a movement relationship statistics result, the movement relationship statistics result comprises the number of movement relationships between any two key positions, the target position determination module is further configured to determine a nearest key position closest to the controlled virtual character from the plurality of key positions based on a current position of the controlled virtual character, determine a probability of the controlled virtual character moving from the nearest key position to a key position other than the nearest key position from the movement relationship statistics result, and determine the target position from the key positions other than the nearest key position based on the probability.

[0110] The mobile control module is further configured to control the controlled virtual character to move from the current position to the key position closest to the current position, and then move from the key position closest to the current position to the target position.

[0111] The embodiment further provides an electronic device including a processor and a memory, the memory storing machine executable instructions capable of being executed by the processor, and the processor executes the machine executable instructions to implement the motion control method of the virtual character.

[0112] Referring to Figure 6 The electronic device includes a processor 100 and a memory 101, the memory 101 storing machine executable instructions capable of being executed by the processor 100, and the processor 100 executes the machine executable instructions to implement the motion control method of the virtual character.

[0113] Further, Figure 6 The electronic device further includes a bus 102 and a communication interface 103, and the processor 100, the communication interface 103 and the memory 101 are connected through the bus 102.

[0114] The memory 101 can include a high-speed random access memory (RAM) and can further include a non-volatile memory such as at least one disk memory. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 103 (which can be wired or wireless), and the Internet, a wide area network, a local area network, a metropolitan area network, etc. can be used. The bus 102 can be an ISA bus, a PCI bus or an EISA bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one bidirectional arrow is used in the figure to represent the bus, but it does not mean that there is only one bus or only one type of bus.

[0115] The processor 100 may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by hardware integrated logic circuits in the processor 100 or software instructions. The above processor 100 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 various methods, steps, and logic block diagrams disclosed in the embodiments of the present invention. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in conjunction with the embodiments of the present invention can be directly implemented and executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium well-known in the art, such as a random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or register. The storage medium is located in the memory 101. The processor 100 reads the information in the memory 101 and, in conjunction with its hardware, completes the steps of the method of the aforementioned embodiment.

[0116] This embodiment further provides a machine-readable storage medium storing machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the above-mentioned motion control method for a virtual character.

[0117] The embodiments of the present invention provide a method, device, and electronic device for controlling the motion of a virtual character, including a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the method in the previous method embodiment. For specific implementation, please refer to the method embodiment and will not be repeated here.

[0118] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described systems and devices can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0119] In addition, in the description of the embodiments of the present invention, unless otherwise expressly specified or limited, the terms "mounted," "connected," and "connected" should be understood in a broad sense. For example, they may refer to fixed connections, detachable connections, or integral connections; they may refer to mechanical connections or electrical connections; they may refer to direct connections or indirect connections through an intermediate medium; and they may refer to internal communication between two components. Those skilled in the art will understand the specific meanings of the above terms in the present invention based on the specific circumstances.

[0120] If the function is implemented in the form of 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 the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program code.

[0121] In the description of the present invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicating orientations or positional relationships, are based on the orientations or positional relationships shown in the accompanying drawings and are intended solely to facilitate and simplify the description of the present invention. They are not intended to indicate or imply that the devices or components referred to must have, be constructed, or operate in a specific orientation, and therefore should not be construed as limitations on the present invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0122] Finally, it should be noted that the above embodiments are only specific implementation methods of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that any person skilled in the art can modify or easily conceive of changes to the technical solutions described in the above embodiments within the technical scope disclosed by the present invention, or replace some of the technical features therein with equivalents. Such modifications, changes or replacements do not deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.

Claims

1. A motion control method for a virtual character, characterized in that: Methods include: Get the current position of the controlled virtual character in the virtual scene; Determining whether the controlled virtual character is located in a target area in the virtual scene based on the current position; wherein the target area is pre-determined based on a position in the virtual scene of a first virtual character having the same character attributes as the controlled virtual character in historical game records; If the controlled virtual character is located in the target area, determining a target position from preset key positions in the target area based on the current position of the controlled virtual character; wherein the key position is determined based on the position of obstacles in the target area and the position of the first virtual character in the virtual scene in historical game records; Controlling the controlled virtual character to move from the current position to the target position; The target area is specifically determined by the following method: Obtaining a first position of the first virtual character that satisfies a preset condition from the historical game record; wherein the preset condition includes: when the first virtual character is at the first position, a distance between a second virtual character and the first virtual character is less than a first distance threshold; and the second virtual character and the first virtual character have an adversarial relationship; The target area is determined based on the first location.

2. The method according to claim 1, characterized in that The first positions include a plurality of positions; and the step of determining the target area based on the first positions includes: Performing clustering processing on the first positions to obtain a first clustering result; wherein the first clustering result includes at least one group of initial position combinations; each group of the initial position combinations includes a cluster center and at least one first position; The target area is determined based on the first clustering result.

3. The method according to claim 2, characterized in that The step of determining the target area based on the first clustering result includes: Performing screening processing on the at least one set of initial position combinations, and / or performing screening processing on the first position in the initial position combinations, to obtain at least one set of final position combinations; The target area is determined based on the cluster center of each group of the final position combination and the first position in the final position combination.

4. The method according to claim 1, wherein The key position is specifically determined by the following method: performing clustering processing on the first position in the target area to obtain a second clustering result; wherein the second clustering result includes at least one group of position subgroups; each group of the position subgroups includes a cluster center and at least one first position; the first position in the target area is determined based on the position of the first virtual character in the historical game record; The key position is determined based on the position of the obstacle in the target area and the second clustering result.

5. The method according to claim 4, characterized in that The step of determining the key position based on the position of the obstacle in the target area and the second clustering result includes: Determine a contour area of ​​the obstacle based on the position of the obstacle in the target area; wherein the contour area includes: an edge line of the obstacle, and / or an area within a preset distance range from the obstacle; Performing position sampling in the obstacle contour area to obtain a plurality of sampling positions; Based on the second clustering result, a key position is determined from the plurality of sampling positions.

6. The method according to claim 5, characterized in that The step of determining a key position from the plurality of sampling positions based on the second clustering result includes: determining a current sampling position from the plurality of sampling positions; For the current sampling position, searching for a set number of adjacent positions from the second clustering result; the adjacent positions include: a first position whose distance from the current sampling position is less than a preset second distance threshold; If a set number of adjacent positions of the current sampling position are found, a key position is determined based on the adjacent positions and the current sampling position.

7. The method according to claim 6, characterized in that The step of determining a key position based on the adjacent positions and the current sampling position comprises: Determining the position group to which the current sampling position belongs based on the position groups to which the adjacent positions belong; Eliminating the position group to which the current sampling position belongs from the second clustering result; Continue to perform the step of determining a current sampling position from the plurality of sampling positions until no position group exists in the second clustering result; The sampling positions corresponding to the respective position groups in the second clustering result are determined as key positions.

8. The method according to claim 4, characterized in that After determining the key position based on the position of the obstacle in the target area and the second clustering result, the method further includes: Acquire, from the historical game records, movement sequence information of the first virtual character between each of the first positions in the target area; Determining movement sequence information between the key positions in the target area based on the movement sequence information and the distance relationship between the first position and the key position; Based on the movement sequence information between the key positions, the number of times a movement relationship occurs between any two of the key positions is counted; wherein, any two of the key positions include a first key position and a second key position; a movement relationship occurs between any two of the key positions, including: the first virtual character moves directly from the first key position to the second key position, or, moves directly from the second key position to the first key position.

9. The method according to claim 1, characterized in that The key positions include a plurality of key positions; the key positions are preset with movement relationship statistics; the movement relationship statistics include: the number of movement relationships between any two key positions; The step of determining the target position from the key positions preset in the target area based on the current position of the controlled virtual character comprises: Based on the current position of the controlled virtual character, determining a nearest key position closest to the controlled virtual character from the plurality of key positions; Determining, from the movement relationship statistics, a probability that the controlled virtual character moves from the nearest key position to a key position other than the nearest key position; Based on the probabilities, the target position is determined from key positions other than the nearest key position.

10. The method according to claim 1, characterized in that The step of controlling the controlled virtual character to move from the current position to the target position comprises: The controlled virtual character is controlled to move from the current position to a key position closest to the current position, and then move from the key position closest to the current position to the target position.

11. A motion control device for a virtual character, characterized in that: The device comprises: A current position acquisition module is used to obtain the current position of the controlled virtual character in the virtual scene; a current position area determination module, configured to determine, based on the current position, whether the controlled virtual character is located in a target area in the virtual scene; wherein the target area is pre-determined based on the position of a first virtual character having the same character attributes as the controlled virtual character in the virtual scene in historical game records; a target position determination module, configured to, if the controlled virtual character is located in the target area, determine a target position from preset key positions in the target area based on the current position of the controlled virtual character; wherein the key position is determined based on the position of obstacles in the target area and the position of the first virtual character in the virtual scene from historical game records; A movement control module, configured to control the controlled virtual character to move from the current position to the target position; The target area is specifically determined by the following method: Obtaining a first position of the first virtual character that satisfies a preset condition from the historical game record; wherein the preset condition includes: when the first virtual character is at the first position, a distance between a second virtual character and the first virtual character is less than a first distance threshold; and the second virtual character and the first virtual character have an adversarial relationship; The target area is determined based on the first location.

12. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the motion control method of the virtual character according to any one of claims 1 to 10.

13. A machine-readable storage medium, characterized in that The machine-readable storage medium stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the motion control method for a virtual character according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Moving control method and device for virtual objects, terminal and storage medium

    CN110538455A