Virtual character trajectory matching method and device, electronic equipment and storage medium

CN116832449BActive Publication Date: 2026-08-21SHENZHEN TENCENT INFORMATION TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210302155.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-24
Publication Date
2026-08-21
Estimated Expiration
2042-03-24

AI Technical Summary

Technical Problem

相关技术中,每次在确定虚拟角色的待匹配轨迹在运动轨迹库中匹配的运动轨迹时,都需要遍历运动轨迹库,从中找出与虚拟角色的待匹配轨迹匹配的运动轨迹,这种轨迹匹配方式计算复杂度高、计算时间长,导致进行虚拟角色的轨迹匹配的效率很低

Benefits of technology

由于根据当前待匹配轨迹的上一条已匹配轨迹匹配到的运动轨迹对应的检测结果,确定虚拟角色的当前待匹配轨迹的轨迹匹配方式,从而可以基于确定出的轨迹匹配方式快速、准确地确定出与当前待匹配轨迹匹配的目标运动轨迹,不需要每次遍历运动轨迹库以确定当前待匹配轨迹对应的目标运动轨迹,降低了进行虚拟角色的轨迹匹配的计算复杂度、缩短了计算时间,从而提高了进行虚拟角色的轨迹匹配的效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116832449B_ABST
    Figure CN116832449B_ABST
Patent Text Reader

Abstract

The application provides a virtual role track matching method and device, electronic equipment and storage medium, relates to game technology in the field of artificial intelligence, and the method comprises the following steps: obtaining a current to-be-matched track from a track sequence of a virtual role; determining a matched track of a previous track of the current to-be-matched track in the track sequence, obtaining a detection result corresponding to a matched motion track of the matched track in a motion track library; the detection result represents whether the matched motion track is a last track of motion capture data where the motion track is located; determining a track matching mode of the current to-be-matched track based on the detection result; determining a target motion track matched with the current to-be-matched track from the motion track library based on the track matching mode; replacing the current to-be-matched track in the track sequence with the target motion track; and the target motion track is used to generate an animation of the virtual role. Through the application, the complexity of track matching of the virtual role can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to artificial intelligence technology, and more particularly to a method, apparatus, electronic device, and storage medium for trajectory matching of virtual characters. Background Technology

[0002] Artificial Intelligence (AI) is a comprehensive technology within computer science that studies the design principles and implementation methods of various intelligent machines, enabling them to possess perception, reasoning, and decision-making capabilities. AI technology is a multidisciplinary field, encompassing a wide range of areas, including natural language processing and machine learning / deep learning. With technological advancements, AI will be applied in more fields and play an increasingly important role.

[0003] With the rapid development of artificial intelligence, its application in the trajectory matching process of virtual characters in virtual scenes is also increasing. In related technologies, each time the motion trajectory to be matched with the virtual character is determined in the motion trajectory library, it is necessary to traverse the motion trajectory library to find the motion trajectory that matches the virtual character's trajectory. This trajectory matching method has high computational complexity and long computation time, resulting in very low efficiency in trajectory matching of virtual characters. Summary of the Invention

[0004] This application provides a method, apparatus, electronic device, computer-readable storage medium, and computer program product for matching the trajectory of virtual characters, which can reduce the computational complexity of matching the trajectory of virtual characters, shorten the computation time, and improve the efficiency of matching the trajectory of virtual characters.

[0005] The technical solution of this application embodiment is implemented as follows: This application provides a method for trajectory matching of virtual characters, including: Obtain the current trajectory to be matched from the trajectory sequence of the virtual character; wherein, the trajectory sequence includes multiple virtual character trajectories with consecutive poses of the virtual character; Determine the matched trajectory of the current trajectory to be matched in the trajectory sequence, and obtain the detection result corresponding to the motion trajectory matched by the matched trajectory in the motion trajectory library; wherein, the detection result indicates whether the matched motion trajectory is the last trajectory of the motion capture data in which the motion trajectory is located, and the motion capture data includes multiple motion trajectories with continuous pose obtained from the motion trajectory library; Based on the detection results, the trajectory matching method for the current trajectory to be matched is determined; Based on the trajectory matching method, a target motion trajectory that matches the current trajectory to be matched is determined from the motion trajectory database; The current trajectory to be matched in the trajectory sequence is replaced with the target motion trajectory; wherein the target motion trajectory is used to generate the animation of the virtual character.

[0006] This application provides a virtual character trajectory matching device, including: The first acquisition module is used to acquire the current trajectory to be matched from the trajectory sequence of the virtual character; wherein, the trajectory sequence includes multiple virtual character trajectories with continuous poses of the virtual character; The second acquisition module is used to determine the matched trajectory of the current trajectory to be matched in the trajectory sequence, and to acquire the detection result corresponding to the motion trajectory matched by the matched trajectory in the motion trajectory library; wherein, the detection result indicates whether the matched motion trajectory is the last trajectory of the motion capture data in which the motion trajectory is located, and the motion capture data includes multiple motion trajectories with continuous poses obtained from the motion trajectory library; The first determining module is used to determine the trajectory matching method of the current trajectory to be matched based on the detection result; The second determining module is used to determine a target motion trajectory that matches the current trajectory to be matched from the motion trajectory library based on the trajectory matching method; A replacement module is used to replace the current trajectory to be matched in the trajectory sequence with the target motion trajectory; wherein the target motion trajectory is used to generate the animation of the virtual character.

[0007] This application provides an electronic device, including: Memory, used to store executable instructions; The processor, when executing executable instructions stored in memory, implements the trajectory matching method for virtual characters provided in the embodiments of this application.

[0008] This application provides a computer-readable storage medium storing executable instructions, which, when executed by a processor, implement the trajectory matching method for virtual characters provided in this application.

[0009] This application provides a computer program product including computer instructions stored in a computer-readable storage medium. An electronic device's processor reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the electronic device to perform the virtual character trajectory matching method described above in this application.

[0010] The embodiments of this application have the following beneficial effects: Since the trajectory matching method of the virtual character's current trajectory is determined based on the detection results of the motion trajectory matched by the previous matched trajectory, the target motion trajectory that matches the current trajectory can be quickly and accurately determined based on the determined trajectory matching method. This eliminates the need to traverse the motion trajectory library every time to determine the target motion trajectory corresponding to the current trajectory, reducing the computational complexity and shortening the computation time for trajectory matching of virtual characters, thereby improving the efficiency of trajectory matching of virtual characters. Attached Figure Description

[0011] Figure 1 This is a schematic diagram of the architecture of the virtual character trajectory matching system 100 provided in this application embodiment; Figure 2 This is a schematic diagram of the structure of the server 200 provided in the embodiments of this application; Figures 3A-3E This is a flowchart illustrating the trajectory matching method for virtual characters provided in an embodiment of this application; Figure 4 This is a flowchart illustrating the trajectory matching method for virtual characters provided in an embodiment of this application; Figure 5 A schematic diagram illustrating the trajectory matching process of a virtual character provided in an embodiment of this application; Figure 6 A schematic diagram illustrating the trajectory matching process of a game character provided in an embodiment of this application; Figure 7 This is a schematic diagram of the neural network structure provided in an embodiment of this application; Figure 8A A schematic diagram of the first pose provided in an embodiment of this application; Figure 8B This is a schematic diagram of the second pose provided in an embodiment of this application. Detailed Implementation

[0012] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0013] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0014] In the following description, the terms "first, second, third" are used merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first, second, third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.

[0015] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.

[0016] It is understood that in the embodiments of this application, data such as user information are involved. When the embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0017] Before providing a further detailed description of the embodiments of this application, the nouns and terms involved in the embodiments of this application will be explained, and the nouns and terms involved in the embodiments of this application shall be interpreted as follows.

[0018] 1) Motion capture: abbreviated as motion capture, is the technology of measuring and recording the movement trajectory and posture of motion capture operators in the motion capture field.

[0019] 2) Motion capture trajectory: This refers to the movement trajectory of the motion capture operator obtained through motion capture. During motion capture, sensors record the skeletal information of the motion capture operator for each frame, including position and rotation angle. This information is then converted into the motion trajectory of the motion capture operator, thereby determining the motion trajectory of the virtual character based on the motion trajectory of the motion capture operator.

[0020] 3) Motion capture data: This consists of a series of motion frames corresponding to consecutive motion trajectories in time. For example, if there are three consecutive motion trajectories, each consisting of three frames (frames from different trajectories may overlap), and these three trajectories are represented by frame numbers 123 / 234 / 345, then the motion frames from these three trajectories can form one motion capture data set, denoted as 12345. The motion trajectory 345 is the last trajectory in the motion capture data set.

[0021] 4) Virtual Scene: This refers to the scene displayed (or provided) by the game program when it runs on a terminal device. This scene can be a simulation of the real world, a semi-simulated / semi-fictional environment, or a purely fictional virtual environment. The virtual scene can be any of a two-dimensional, 2.5-dimensional, or three-dimensional virtual scene; this application does not limit the dimension of the virtual scene. For example, a virtual scene may include the sky, land, ocean, etc., and the land may include environmental elements such as deserts and cities. Users can control virtual objects to move within this virtual scene.

[0022] 5) Virtual Characters: These are the images of various people and objects that can interact with a virtual scene, or movable objects within the virtual scene. These movable objects can be virtual characters, virtual animals, anime characters, etc., such as people or animals displayed in the virtual scene. A virtual character can be a virtual avatar representing the user within the virtual scene. A virtual scene can include multiple virtual characters, each with its own shape and volume, occupying a portion of the space within the virtual scene.

[0023] The applicant discovered that in the process of determining the matching motion trajectory for a virtual character from the motion trajectory library, each time a matching motion trajectory for the virtual character is determined, it is necessary to traverse the motion trajectory library, calculate the least square distance (i.e., L2 distance) between each traversed motion trajectory and the virtual character's matching trajectory, and then select the motion trajectory with the smallest L2 distance as the matching trajectory for the virtual character's matching trajectory. However, calculating the L2 distance between each traversed motion trajectory and the matching trajectory one by one is computationally complex and time-consuming; furthermore, for each matching trajectory of the virtual character, it is necessary to re-traverse the motion trajectory library to find a matching motion trajectory each time, which will result in the matching motion trajectories not being smooth enough, thus affecting the animation output of the virtual character.

[0024] This application provides a method, apparatus, electronic device, storage medium, and program product for matching the trajectory of virtual characters, which can improve the efficiency of matching the trajectory of virtual characters. The following describes an exemplary application of the electronic device for matching the trajectory of virtual characters provided in this application. The electronic device for matching the trajectory of virtual characters provided in this application can be implemented as a laptop computer, tablet computer, desktop computer, set-top box, mobile device (e.g., mobile phone, portable music player, personal digital assistant, dedicated messaging device), game console, in-vehicle terminal, in-vehicle game console, and other various types of user terminals, or it can be implemented as a server. The following describes an exemplary application when the electronic device is implemented as a server.

[0025] The virtual character trajectory matching method provided in this application embodiment can be completed collaboratively by the terminal and the server. See [link to relevant documentation]. Figure 1 , Figure 1 This is a schematic diagram of the architecture of the virtual character trajectory matching system 100 provided in this application embodiment, including a server 200 and a terminal 400. The terminal 400 is connected to the server 200 through a network 300, which can be a wide area network, a local area network, or a combination of both.

[0026] In some embodiments, developers generate a trajectory sequence including multiple trajectories of a virtual character's pose by operating the virtual scene interface of terminal 400. Terminal 400 sends the trajectory sequence to server 200. Server 200 obtains the current trajectory to be matched of the virtual character based on the trajectory sequence, and determines the trajectory matching method of the current trajectory based on the detection result of the motion trajectory matched by the previous matched trajectory. Based on the determined trajectory matching method, server 200 determines the target motion trajectory that matches the current trajectory and replaces the current trajectory to be matched in the trajectory sequence with the target motion trajectory. Then, server 200 generates an animation of the virtual character based on the target motion trajectory. Finally, server 200 transmits the generated animation of the virtual character to terminal 400 through network 300. Terminal 400 renders the animation of the virtual character in the virtual scene.

[0027] In some embodiments, server 200 may be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. Terminal 400 may be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, game console, in-vehicle terminal, in-vehicle game console, etc., but is not limited thereto. Terminals and servers can be directly or indirectly connected via wired or wireless communication, which is not limited in this embodiment.

[0028] See below Figure 2 , Figure 2 This is a schematic diagram of the structure of the server 200 provided in the embodiments of this application. Figure 2 The server 200 shown includes at least one processor 210, memory 230, and at least one network interface 220. The various components of server 200 are coupled together via a bus system 240. It is understood that the bus system 240 is used to implement communication between these components. In addition to a data bus, the bus system 240 also includes a power bus, a control bus, and a status signal bus. However, for clarity, ... Figure 2The general labeled all buses as Bus System 240.

[0029] Processor 210 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor can be a microprocessor or any conventional processor, etc.

[0030] The memory 230 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state storage, hard disk drives, optical disk drives, etc. The memory 230 may optionally include one or more storage devices physically located away from the processor 210.

[0031] The memory 230 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), and the volatile memory may be random access memory (RAM). The memory 230 described in this application embodiment is intended to include any suitable type of memory.

[0032] In some embodiments, memory 230 is capable of storing data to support various operations, examples of which include programs, modules, and data structures or subsets or supersets thereof, as illustrated below.

[0033] The operating system 231 includes system programs for handling various basic system services and performing hardware-related tasks, such as the framework layer, core library layer, and driver layer, for implementing various basic business functions and handling hardware-based tasks.

[0034] The network communication module 232 is used to reach other computing devices via one or more (wired or wireless) network interfaces 220, such as Bluetooth, WiFi, and Universal Serial Bus (USB).

[0035] In some embodiments, the virtual character trajectory matching device provided in this application can be implemented in software. Figure 2A trajectory matching device 233 for a virtual character stored in memory 230 is shown. It can be software in the form of programs and plug-ins, including the following software modules: a first acquisition module 2331, a second acquisition module 2332, a first determination module 2333, a second determination module 2334, and a replacement module 2335. These modules are logically related and can therefore be arbitrarily combined or further split according to the functions they implement.

[0036] The trajectory matching method for virtual characters provided in this application will be described below with reference to exemplary applications and implementations of the electronic devices provided in the embodiments of this application. It can be understood that the following method can be executed individually or collaboratively by the server 200 and terminal 400 mentioned above.

[0037] See Figure 3A , Figure 3A This is a flowchart illustrating the trajectory matching method for virtual characters provided in this application embodiment, which will be combined with... Figure 3A The steps shown are explained.

[0038] In step 101, the current trajectory to be matched is obtained from the trajectory sequence of the virtual character.

[0039] As an example, the trajectory sequence includes multiple virtual character trajectories with consecutive poses of the virtual character.

[0040] As an example, the virtual scene engine has a specific data structure for storing the trajectory information of virtual characters. Therefore, by accessing the specific data structure of the virtual scene engine, the trajectory information of the virtual characters can be obtained. Then, based on the obtained trajectory information of the virtual characters, multiple pose-continuous trajectories of the virtual characters can be determined, and the determined trajectories of the virtual characters can be stored in the trajectory sequence of the virtual characters.

[0041] When it is necessary to determine the motion trajectory of a virtual character that matches the motion trajectory library, the current trajectory to be matched of the virtual character is obtained from the trajectory sequence.

[0042] In step 102, the matched trajectory of the current trajectory to be matched in the trajectory sequence is determined, and the detection result corresponding to the motion trajectory matched by the matched trajectory in the motion trajectory library is obtained.

[0043] As an example, once a trajectory in the trajectory sequence is matched with a corresponding motion trajectory in the motion trajectory library, the trajectory will be marked as a matched trajectory in the trajectory sequence, and the matched trajectory will be replaced with the matched motion trajectory. At the same time, the correspondence between the matched trajectory and the motion trajectory matched by the matched trajectory in the motion trajectory library will be stored.

[0044] After obtaining the current trajectory to be matched from the trajectory sequence, it is determined whether there is a previously matched trajectory in the trajectory sequence. If it is determined that there is a previously matched trajectory, the motion trajectory matched by the matched trajectory in the motion trajectory library is obtained, and the matched motion trajectory is detected to obtain the detection result. The detection result indicates whether the matched motion trajectory is the last trajectory of the motion capture data. The motion capture data includes multiple motion trajectories with continuous poses obtained from the motion trajectory library.

[0045] In some embodiments, when there is no previously matched trajectory in the trajectory sequence, the current trajectory to be matched is determined to be the first trajectory in the trajectory sequence, and the target motion trajectory that matches the current trajectory to be matched is determined from the motion trajectory library based on the phase hash matching method.

[0046] As an example, if it is determined that there is no previously matched trajectory in the trajectory sequence for the current trajectory to be matched, then the current trajectory to be matched is identified as the first trajectory in the trajectory sequence. In this case, based on the phase hash matching method, the target motion trajectory that matches the current trajectory to be matched is determined from the motion trajectory library. The phase hash matching method is used for trajectory matching based on the phase of the virtual character.

[0047] By determining the target motion trajectory using phase hashing when the current trajectory to be matched is the first trajectory in the trajectory sequence, the target motion trajectory can be obtained from the motion trajectory library by flexibly using an appropriate trajectory matching method based on the position of the current trajectory to be matched in the trajectory sequence, which can improve the efficiency of trajectory matching for virtual characters.

[0048] In step 103, the trajectory matching method for the current trajectory to be matched is determined based on the detection results.

[0049] As an example, the trajectory matching method of the current trajectory to be matched corresponds to the detection result of the matched motion trajectory.

[0050] See Figure 3B , Figure 3B This is a flowchart illustrating a virtual character trajectory matching method provided in an embodiment of this application. Based on Figure 3A , Figure 3B Step 103 shown can be implemented through step 1031A. The following will combine... Figure 3B Step 1031A is illustrated below.

[0051] In step 1031A, when the detection result indicates that the matched motion trajectory is not the end trajectory of the motion capture data, the trajectory matching method is determined to be fuzzy matching method.

[0052] As an example, when the detection result indicates that the matched motion trajectory is not the end trajectory of the motion capture data, the trajectory matching method for the current trajectory to be matched is determined to be fuzzy matching. Fuzzy matching is used to match trajectories based on the speed and direction of the virtual character.

[0053] For example, a motion capture data set includes motion frames 1-5, i.e., motion frames 12345. Assuming that three motion frames that are sequential in time constitute a motion trajectory, then this motion capture data set includes three motion trajectories: 123 / 234 / 345. In the case where the matched motion trajectory is 234, since motion trajectory 345 follows 234, the matched motion trajectory 234 is not the last trajectory in the motion capture data set 12345. In this case, the trajectory matching method for the current trajectory to be matched is determined to be fuzzy matching.

[0054] See Figure 3E , Figure 3E This is a flowchart illustrating a virtual character trajectory matching method provided in an embodiment of this application. Based on Figure 3A , Figure 3E Step 103 shown can also be implemented via step 1031B. The following will combine... Figure 3B Step 1031B is illustrated below.

[0055] In step 1031B, when the detection result indicates that the matched motion trajectory is the end trajectory of the motion capture data, the trajectory matching method is determined to be the phase hash matching method.

[0056] As an example, when the detection result indicates that the matched motion trajectory is the end trajectory of the motion capture data, the trajectory matching method for the current trajectory to be matched is determined to be phase hash matching. Phase hash matching is used for trajectory matching based on the phase of the virtual character.

[0057] Continuing with the example above, when the matched motion trajectory is 345, since there are no other motion trajectories after motion trajectory 345, the matched motion trajectory 345 is the last trajectory of the motion capture data 12345. At this time, the trajectory matching method of the current trajectory to be matched is determined to be the phase hash matching method.

[0058] By determining different trajectory matching methods based on different detection results, the appropriate trajectory matching method can be flexibly selected based on the detection results of already matched motion trajectories, thereby improving the efficiency of trajectory matching for virtual characters.

[0059] In step 104, a target motion trajectory that matches the current trajectory to be matched is determined from the motion trajectory library based on the trajectory matching method.

[0060] As an example, after determining the corresponding trajectory matching method based on the detection results, the target motion trajectory that matches the current trajectory to be matched is determined from the motion trajectory library based on the determined trajectory matching method.

[0061] See Figure 3B ,exist Figure 3A When step 103 is implemented via step 1031A, Figure 3A Step 104 shown can be implemented through steps 1041A-1043A. The following will combine... Figure 3B Steps 1041A-1043A are described below.

[0062] In step 1041A, candidate motion trajectories are determined from the motion trajectory library based on the matched motion trajectory.

[0063] As an example, if the trajectory matching method of the current trajectory to be matched is determined to be fuzzy matching, the candidate motion trajectory of the current trajectory to be matched is determined from the motion trajectory library based on the motion trajectory matched by the previous matched trajectory.

[0064] See Figure 3B Step 1041A can be achieved through steps 1041A1 and 1041A2, which will be discussed below. Figure 3B Steps 1041A1 and 1041A2 are described below.

[0065] In step 1041A1, an intermediate motion frame is determined from the multiple motion frames included in the matched motion trajectory.

[0066] As an example, the motion trajectory matched by the previous matched trajectory includes multiple motion frames. The middle motion frame is determined from the multiple motion frames.

[0067] In step 1041A2, the motion trajectory in the motion trajectory library that takes the next motion frame of the intermediate motion frame as the intermediate motion frame is determined as the candidate motion trajectory.

[0068] As an example, the motion trajectory in the motion trajectory library that takes the next motion frame of the intermediate motion frame as the intermediate motion frame is determined as the candidate motion trajectory.

[0069] For example, each motion trajectory in the motion trajectory library includes 12 motion frames. The motion trajectory matched by the previous matched trajectory includes 12 motion frames from 1 to 12. If the 7th frame is taken as the middle motion frame of the matched motion trajectory, then the motion trajectory with the next motion frame of the 7th frame as the middle motion frame is determined as the candidate motion trajectory. That is, the motion trajectory with the 8th frame as the middle motion frame is determined as the candidate motion trajectory. The candidate motion trajectory includes 12 motion frames from 2 to 13.

[0070] Since the motion trajectory includes multiple motion frames that are sequential in time, the candidate motion trajectory determined by the above method is very close to the matched motion trajectory in time series. Therefore, the candidate motion trajectory and the matched motion trajectory are also very close, thus enabling a smooth transition between the determined candidate motion trajectory and the matched motion trajectory.

[0071] In step 1042A, fuzzy matching is performed between the candidate motion trajectory and the current trajectory to be matched.

[0072] As an example, after obtaining candidate motion trajectories from the motion trajectory library, fuzzy matching is performed between the candidate motion trajectories and the current trajectory to be matched.

[0073] When the trajectory matching method is fuzzy matching, candidate motion trajectories are determined by the motion trajectory matched based on the previous matched trajectory, and fuzzy matching processing is performed between the candidate motion trajectory and the current trajectory to be matched. Since the pose of the virtual character is continuous between the current trajectory to be matched and the previous matched trajectory, the candidate motion trajectory determined by the motion trajectory matched based on the previous matched trajectory can be used for matching. This allows the candidate motion trajectory with the highest probability of successful matching to be used for matching processing, thereby shortening the time required for successful matching as much as possible and improving the accuracy and efficiency of fuzzy matching processing.

[0074] See Figure 3B Step 1042A can be achieved through steps 1042A1-1042A3, which will be discussed below. Figure 3B Steps 1042A1-1042A3 are described below.

[0075] In step 1042A1, the average speed of the virtual character in the candidate motion trajectory is matched with the average speed of the virtual character in the current trajectory to be matched.

[0076] As an example, after determining the candidate motion trajectory, the average speed of the virtual character in the candidate motion trajectory is compared with the average speed of the virtual character in the current trajectory to be matched. For example, the average speed of the virtual character in the candidate motion trajectory is the average speed assumed to be present when the virtual character moves along the candidate motion trajectory.

[0077] See Figure 3C , Figure 3C This is a flowchart illustrating a virtual character trajectory matching method provided in an embodiment of this application. Based on Figure 3B , Figure 3C The step 1042A1 shown can be implemented through steps 1042A11-1042A13. The following will combine... Figure 3C Steps 1042A11-1042A13 are described below.

[0078] In step 1042A11, the direction of the first average velocity of the virtual character in the candidate motion trajectory is matched with the target direction to obtain the first matching result.

[0079] As an example, when performing average velocity matching, the first average velocity of the virtual character in the candidate motion trajectory is determined. This first average velocity is the average velocity of the virtual character across the following motion interval: from the next motion frame after the middle motion frame of the candidate motion trajectory to the last motion frame.

[0080] For example, if the candidate motion trajectory includes motion frames 2-13, and the intermediate motion frame is frame 8, the first average velocity is the average velocity of the virtual character from frame 9 to frame 13.

[0081] As an example, the formula for calculating the first average velocity is as follows: Formula 1 in, Indicates the first average speed. The next motion frame after the intermediate frame of the candidate motion trajectory. The last motion frame representing the candidate motion trajectory. This indicates the virtual character's position in the next motion frame from the middle frame to the last motion frame of the candidate motion trajectory. The speed of each motion frame.

[0082] Since the first average velocity is a vector, the first average velocity determined by Formula 1 has a direction.

[0083] As an example, the target direction is determined based on the operation information corresponding to the actions taken by the developers on the virtual characters in the virtual scene.

[0084] After determining the direction of the first average velocity and the target direction, the direction of the first average velocity of the virtual character in the candidate motion trajectory is matched with the target direction to obtain the first matching result.

[0085] In step 1042A12, the direction of the second average velocity of the virtual character in the candidate motion trajectory and the direction of the third average velocity of the virtual character in the current trajectory to be matched are subjected to a second matching process to obtain the second matching result.

[0086] As an example, firstly, the second average speed of the virtual character in the candidate motion trajectory and the third average speed of the virtual character in the current trajectory to be matched are determined. The second average speed is the average speed of the virtual character in the following motion interval: from the starting motion frame of the candidate motion trajectory to the previous motion frame of the middle motion frame; the third average speed is the average speed of the virtual character in the following motion interval: from the starting motion frame of the current trajectory to the previous motion frame of the middle motion frame.

[0087] As an example, the formula for calculating the second average velocity is as follows: Formula 2 in, Indicates the second average speed. The starting motion frame represents the candidate motion trajectory. The preceding motion frame represents the intermediate frame of the candidate motion trajectory. This indicates the virtual character's position in the candidate motion trajectory, from the starting frame to the previous frame in the middle frame. The speed of each motion frame.

[0088] As an example, the calculation process for the third average speed is the same as that for the second average speed.

[0089] Since both the second and third average velocities are vectors, the determined second and third average velocities have directions.

[0090] After determining the directions of the second and third average velocities, a second matching process is performed on the direction of the second average velocity of the virtual character in the candidate motion trajectory and the direction of the third average velocity of the virtual character in the current trajectory to be matched, to obtain the second matching result.

[0091] In step 1042A13, when the first angle between the direction of the first average velocity and the target direction, as represented by the first matching processing result, is greater than the first angle threshold, and the second angle between the direction of the second average velocity and the direction of the third average velocity, as represented by the second matching processing result, is greater than the second angle threshold, the average velocity matching processing is determined to be successful.

[0092] As an example, the first matching process is represented as follows: Formula 3 in, Indicates the direction of the first average velocity. Indicates the direction of the target. This indicates the calculation of the vector inner product (i.e., the calculation of cosines). Indicates the first included angle. This represents the first included angle threshold; the specific value is set by the developers.

[0093] If the first included angle is greater than the first included angle threshold, the direction of the first average velocity is determined to meet the matching condition with the target direction.

[0094] As an example, the second matching process is represented as follows: Formula 4 in, Indicates the direction of the second average velocity. Indicates the direction of the third average velocity. Indicates the second included angle. This represents the second included angle threshold; the specific value is set by the developers.

[0095] If the second included angle is greater than the second included angle threshold, the direction of the second average velocity is determined to satisfy the matching condition with the direction of the third average velocity.

[0096] As an example, when the first angle between the direction of the first average velocity and the target direction is greater than the first angle threshold, and the second angle between the direction of the second average velocity and the direction of the third average velocity is greater than the second angle threshold, the average velocity matching process is determined to be successful.

[0097] By implementing the average speed matching process in the above manner, the accuracy and efficiency of the average speed matching process can be improved.

[0098] In step 1042A2, the speed of the virtual character in the current trajectory to be matched and the speed of the virtual character in the matched trajectory are matched.

[0099] As an example, after determining the candidate motion trajectory, the speed of the virtual character in the middle motion frame of the candidate motion trajectory is determined as the speed of the virtual character in the current trajectory to be matched.

[0100] As an example, the speed of the virtual character in the current trajectory to be matched can be considered as the speed of the root bone of the virtual character in the current trajectory to be matched. It should be noted that the entire skeleton of the virtual character is a tree structure, where the root node represents the root bone. Each bone in the skeleton corresponds to a unique parent bone; therefore, based on the correspondence between each bone and its corresponding parent bone, the entire skeleton structure of the virtual character can be determined. When the virtual character moves along the current trajectory to be matched, the bones of the virtual character also have corresponding movement speeds; therefore, the speed of the root bone of the virtual character in the current trajectory to be matched can be determined as the speed of the virtual character in the current trajectory to be matched.

[0101] As an example, the speed of a virtual character in a matched trajectory can be the root bone speed of the virtual character in the intermediate motion frames included in the matched trajectory.

[0102] After determining the speed of the virtual character in the current trajectory to be matched, speed matching processing is performed between the speed of the virtual character in the current trajectory to be matched and the speed of the virtual character in the already matched trajectory.

[0103] See Figure 3D , Figure 3D This is a flowchart illustrating a virtual character trajectory matching method provided in an embodiment of this application. Based on Figure 3B , Figure 3D Step 1042A2 shown can be implemented through steps 1042A21-1042A23. The following will combine... Figure 3D Steps 1042A21-1042A23 are described below.

[0104] In step 1042A21, a third matching process is performed on the direction of the virtual character's velocity in the current trajectory to be matched and the direction of the virtual character's velocity in the matched trajectory to obtain the third matching result.

[0105] As an example, during speed matching, the direction of the virtual character's speed in the current trajectory to be matched is compared with the direction of the virtual character's speed in the already matched trajectory to obtain the third matching result.

[0106] In step 1042A22, the magnitude of the virtual character's speed in the current trajectory to be matched and the magnitude of the virtual character's speed in the matched trajectory are subjected to a fourth matching process to obtain the fourth matching result.

[0107] As an example, a fourth matching process is performed on the speed of the virtual character in the current trajectory to be matched and the speed of the virtual character in the already matched trajectory to obtain the fourth matching result.

[0108] In step 1042A23, when the third matching result represents the direction of the virtual character's speed in the current trajectory to be matched, and the third angle between the direction of the virtual character's speed in the matched trajectory is greater than the third angle threshold, and the fourth matching result represents the magnitude of the virtual character's speed in the current trajectory to be matched, and the magnitude of the virtual character's speed in the matched trajectory is within the speed threshold range, the speed matching process is determined to be successful.

[0109] As an example, the third matching process is represented as follows: Formula 5 in, This indicates the direction of the virtual character's velocity within the current trajectory to be matched. Indicates the direction of the virtual character's velocity within the matched trajectory. Indicates the third included angle. This represents the threshold value for the third included angle; the specific value is set by the developers.

[0110] If the third included angle is greater than the third included angle threshold, determine the direction of the virtual character's velocity in the current trajectory to be matched, and whether the direction of the virtual character's velocity in the already matched trajectory meets the matching condition.

[0111] As an example, the fourth matching process is represented as follows: Formula 6 in, This indicates the speed of the virtual character within the matched trajectory. This indicates the speed of the virtual character within the current trajectory to be matched. The upper bound of the velocity. This represents the lower bound of the velocity. and The specific values ​​are set by the developers.

[0112] When the speed of the virtual character in the current trajectory to be matched and the speed of the virtual character in the matched trajectory satisfy the conditions of Formula 6, it is determined that the magnitude of the speed of the virtual character in the current trajectory to be matched and the magnitude of the speed of the virtual character in the matched trajectory are within the speed threshold range.

[0113] The speed matching process is considered successful when the third angle between the direction of the virtual character's speed in the current trajectory to be matched and the direction of the virtual character's speed in the matched trajectory is greater than the third angle threshold, and the magnitude of the virtual character's speed in the current trajectory to be matched and the magnitude of the virtual character's speed in the matched trajectory are within the speed threshold range.

[0114] By implementing speed matching processing in the above manner, the accuracy and efficiency of speed matching processing can be improved.

[0115] In step 1042A3, if at least one of the average speed matching process and the speed matching process is successful, the fuzzy matching process is determined to be successful.

[0116] As an example, if at least one of the average speed matching process and the speed matching process is successful, the fuzzy matching process is determined to be successful.

[0117] By performing average speed matching and speed matching processing to achieve fuzzy matching, the efficiency and accuracy of fuzzy matching can be improved.

[0118] In step 1043A, when the fuzzy matching processing result indicates a successful match, the candidate motion trajectory is determined as the target motion trajectory that matches the current trajectory to be matched.

[0119] As an example, if fuzzy matching is successful, the candidate motion trajectory is determined as the target motion trajectory that matches the current trajectory to be matched. Since the candidate motion trajectory uses the next motion frame of the intermediate frame of the matched motion trajectory as its intermediate frame, it's equivalent to the candidate motion trajectory being the next motion trajectory in the motion trajectory library. Therefore, the trajectory index of the candidate motion trajectory in the motion trajectory library is incremented by 1 by the trajectory index of the matched motion trajectory. After determining the candidate motion trajectory as the target motion trajectory, the trajectory index of the target motion trajectory in the motion trajectory library is also incremented by 1 by the trajectory index of the matched motion trajectory. In the motion trajectory library, each trajectory index uniquely corresponds to one motion trajectory.

[0120] By determining the target motion trajectory in the above manner, the determined target motion trajectory can be the most matching motion trajectory in the motion trajectory library, thereby improving the accuracy of trajectory matching for virtual characters.

[0121] In some embodiments, when the fuzzy matching result indicates that the matching is unsuccessful, a target motion trajectory that matches the current trajectory to be matched is determined from the motion trajectory library based on the phase hash matching method.

[0122] As an example, if fuzzy matching fails, then a target motion trajectory that matches the current trajectory to be matched is determined from the motion trajectory library based on phase hash matching.

[0123] By using phase hash matching when fuzzy matching fails, the target motion trajectory that matches the current trajectory to be matched can be flexibly determined based on the fuzzy matching result, thus improving the efficiency of trajectory matching for virtual characters.

[0124] See Figure 3E ,based on Figure 3A ,exist Figure 3A When step 103 is implemented via step 1031B, Figure 3E Step 104 shown can be implemented through steps 1041B-1043B. The following will combine... Figure 3E Steps 1041B-1043B are described below.

[0125] In step 1041B, a set of candidate phases is determined based on the phase of the virtual character in the current trajectory to be matched.

[0126] As an example, if the trajectory matching method for the current trajectory to be matched is determined to be phase hash matching, a candidate phase set is first determined based on the phase of the virtual character on the current trajectory to be matched. The candidate phase set includes the phase of the virtual character on the current trajectory to be matched.

[0127] As an example, the phase of the virtual character in the current matching trajectory can be used as the central phase, and a phase range of 15 degrees above and below can be divided. A set of candidate phases can be determined based on all phases within this phase range.

[0128] For example, if the phase of the virtual character in the current trajectory to be matched is 100 degrees, then the phase range is divided into 15 degrees above and below 100 degrees, and the candidate phase set is determined based on all phases between 85 and 115 degrees.

[0129] In step 1042B, a candidate motion trajectory corresponding to each candidate phase is determined based on multiple candidate phases in the candidate phase set and a hash table in the motion trajectory library.

[0130] As an example, a hash table is pre-generated in the motion trajectory library. The hash table is built based on the phase and the corresponding trajectory index, and each trajectory index corresponds to a motion trajectory.

[0131] As an example, the data format in the hash table is key-value pair format, where each key and value has a one-to-one mapping relationship. In the hash table, the key represents the phase, and the value represents the trajectory index of the corresponding motion trajectory. It should be noted that each motion trajectory in the motion trajectory library uniquely corresponds to a trajectory index, and each motion trajectory stores the phase of the virtual character on that trajectory. Therefore, a mapping relationship can be established between the phase of each motion trajectory and the corresponding trajectory index.

[0132] As an example, the key in the hash table takes values ​​from 0 to 359 because the phase period is 2. π That is, 360 degrees. Therefore, the key can take the values ​​0, 1, 2, ..., 359.

[0133] As an example, the key value corresponding to each motion trajectory in the motion trajectory library is calculated based on the following formula: Formula 7 in, This represents the phase of the virtual character in each motion trajectory. This indicates the modulo operation. This indicates the floor function.

[0134] After calculating the key value corresponding to each motion trajectory in the motion trajectory library using Formula 7 above, the trajectory index corresponding to the motion trajectory is stored in the value corresponding to the key value.

[0135] For example, if the trajectory index of a motion trajectory is 16, and the key value of this motion trajectory is 8, then 16 is used as the value corresponding to the key value 8, forming a mapping relationship of 8-16.

[0136] After obtaining the candidate phase set, for each candidate phase in the candidate phase set, the phase that matches each candidate phase is searched in the hash table of the motion trajectory library. Based on the phase found in the hash table, the trajectory index corresponding to the found phase is obtained according to the correspondence between the phase and the trajectory index in the hash table. Furthermore, the motion trajectory corresponding to the trajectory index corresponding to the found phase is obtained. In this way, the motion trajectory corresponding to each candidate phase can be determined, and the motion trajectory corresponding to each candidate phase can be identified as a candidate motion trajectory.

[0137] In step 1043B, the target motion trajectory that matches the current trajectory to be matched is determined from multiple candidate motion trajectories.

[0138] After determining multiple candidate motion trajectories based on the candidate phase set, the target motion trajectory that matches the current trajectory to be matched is determined from the multiple candidate motion trajectories.

[0139] By determining candidate motion trajectories based on candidate phase sets and then determining the target motion trajectory based on the candidate motion trajectories, the target motion trajectory can be determined quickly and accurately. Compared with the full phase traversal of 360 degrees, the above method significantly reduces the number of traversals used to obtain trajectory indexes using phases, thereby speeding up the trajectory matching of virtual characters and improving the efficiency of trajectory matching of virtual characters.

[0140] See Figure 3E Step 1043B can be achieved through steps 1043B1-1043B2, which will be discussed below. Figure 3E Steps 1043B1-1043B2 are described below.

[0141] In step 1043B1, the positional error between each candidate motion trajectory and the current trajectory to be matched is determined.

[0142] As an example, after identifying multiple candidate motion trajectories, the positional error between each candidate motion trajectory and the current trajectory to be matched is determined. This positional error is determined by summing the distances between the virtual character's position in each motion frame within the candidate motion trajectory and the corresponding position of the virtual character in the current trajectory to be matched.

[0143] As an example, the formula for calculating the positional error between each candidate trajectory and the current trajectory to be matched is as follows: Formula 8 in, Indicates positional error. This indicates the position of the virtual character in the nth frame of each candidate motion trajectory. This indicates the position of the virtual character in the nth frame of the current trajectory to be matched, where n ranges from 1 to N, and N is the number of motion frames included in the candidate motion trajectory and the current trajectory to be matched.

[0144] It should be noted that the number of motion frames included in the candidate motion trajectory is the same as the number of motion frames included in the current trajectory to be matched.

[0145] In step 1043B2, the candidate motion trajectory corresponding to the smallest position error is determined as the target motion trajectory that matches the current trajectory to be matched.

[0146] As an example, after determining the positional error between each candidate motion trajectory and the current trajectory to be matched, the smallest positional error is determined from the multiple calculated positional errors, and the candidate motion trajectory corresponding to the smallest positional error is determined as the target motion trajectory that matches the current trajectory to be matched.

[0147] By determining the candidate motion trajectory with the smallest positional error as the target motion trajectory, the positional error between the determined target motion trajectory and the current trajectory to be matched can be minimized, thus improving the accuracy of trajectory matching for virtual characters.

[0148] In step 105, the current trajectory to be matched in the trajectory sequence is replaced with the target motion trajectory.

[0149] As an example, after identifying the target motion trajectory that matches the current trajectory to be matched, the current trajectory to be matched in the trajectory sequence is replaced with the target motion trajectory. The target motion trajectory is used to generate the animation of the virtual character.

[0150] See Figure 3B , Figure 3A The illustrated step 105 is followed by steps 106 and 107. These will be discussed below. Figure 3B Steps 106 and 107 are illustrated below. In step 106, based on the target motion trajectory and the first pose of the virtual character corresponding to the current trajectory to be matched, the neural network is invoked to perform pose generation processing to obtain the second pose of the virtual character.

[0151] As an example, after replacing the current trajectory to be matched in the trajectory sequence with the target motion trajectory, based on the target motion trajectory and the first pose of the virtual character corresponding to the current trajectory to be matched, the neural network is called to perform pose generation processing to obtain the second pose of the virtual character.

[0152] In step 107, an animation of the virtual character is generated based on the first and second poses of the virtual character.

[0153] As an example, after obtaining the second pose of the virtual character, an animation frame of the virtual character is generated based on the first and second poses.

[0154] By generating animations of virtual characters based on the target's motion trajectory, the virtual characters in the generated animations can have more accurate movement changes.

[0155] In this embodiment, since the trajectory matching method of the current trajectory to be matched of the virtual character is determined based on the detection result of the motion trajectory matched by the previous matched trajectory, the target motion trajectory that matches the current trajectory to be matched can be quickly and accurately determined based on the determined trajectory matching method. It is not necessary to traverse the motion trajectory library every time to determine the target motion trajectory corresponding to the current trajectory to be matched, which reduces the computational complexity of trajectory matching of virtual characters, shortens the computation time, and thus improves the efficiency of trajectory matching of virtual characters.

[0156] The following will use a virtual scene as the game scene and a virtual character as the game character in the game scene as an example to illustrate an exemplary application of the embodiments of this application in a real virtual character trajectory matching application scenario.

[0157] This application embodiment can have the following application scenarios. For example, a game server obtains a trajectory sequence from a game engine, including multiple trajectories of a game character's pose. From the trajectory sequence, it obtains the current trajectory to be matched for the game character, determines the matched trajectory of the previous trajectory in the trajectory sequence, and obtains the detection result corresponding to the motion trajectory matched in the motion trajectory library. The detection result indicates whether the matched motion trajectory is the last trajectory of the motion capture data, which includes multiple motion trajectories of pose continuity obtained from the motion trajectory library. Based on the detection result, it determines the trajectory matching method for the current trajectory to be matched, and then, based on the trajectory matching method, it obtains the motion trajectory from the motion trajectory library. The system identifies a target motion trajectory that matches the current trajectory to be matched in the trajectory database; it then replaces the current trajectory to be matched in the trajectory sequence with the target motion trajectory, which is used to generate the animation of the game character. In some embodiments, the game server sends the target motion trajectory to the game terminal, which generates the animation of the game character based on the target motion trajectory sent by the server and renders the animation of the game character in the game scene. In other embodiments, the game server generates the animation of the game character based on the target motion trajectory, and then sends the animation of the game character to the game terminal, which renders the animation of the game character in the game scene based on the animation of the game character sent by the game server.

[0158] As an example, see Figure 4 , Figure 4 This is a flowchart illustrating the trajectory matching method for virtual characters provided in this application. The following will combine... Figure 4 Steps 401-405 will be explained.

[0159] In step 401, the motion trajectory library is loaded.

[0160] As an example, the motion trajectory library is first loaded, containing multiple generated motion trajectories. Each motion trajectory includes a phase of the game character and its position, direction, and velocity for 12 frames. A motion trajectory can be represented as: Formula 9 in, Indicates the trajectory of motion. This represents the phase of the game character's movement in the middle frame of its trajectory. This indicates the position of the first motion frame in the game character's movement trajectory. This indicates the direction of the first motion frame of the game character's movement trajectory. This indicates the speed of the game character in the first frame of its motion trajectory; This indicates the position of the game character in the 12th motion frame of its trajectory. This indicates the direction of the 12th motion frame in the game character's trajectory. This indicates the speed of the game character in the 12th frame of its motion trajectory.

[0161] It should be noted that all positions, directions, and speeds of the game character in the movement trajectory are determined based on the coordinate system corresponding to the middle movement frame of the game character in the movement trajectory, and only include horizontal position information.

[0162] As an example, motion trajectories are generated in the following way: First, the motion capture operator performs a response action in the motion capture scene according to the guidance of the artist, and the motion capture equipment in the motion capture scene records the motion data of the motion capture operator.

[0163] Secondly, the motion data recorded by the motion capture equipment is obtained. The format of the motion data obtained from the motion capture equipment is usually Feedback eXterminator (FBX) format. FBX data includes the following information: ① Skeletal information This includes information from bone number 0 (root bone) to bone number n; ② Parent bone information. , indicating that -1 is the parent bone of bone number 0 (i.e., , indicating that bone number 0 has no parent bone), bone number 0 is the parent bone of bone number 1, and so on. The number of bones is the first ③ The parent bone of the first bone; ③ Translation information of each bone in each motion frame, for example... Indicates the first In the nth motion frame Translation information (X, Y, Z) of bone number 1, where... Representing three-dimensional space; ④ Rotation information of each bone in each motion frame. Indicates the first In the nth motion frame ⑤ The rotation information (Rx, Ry, Rz) of the first bone; ⑥ The transformation matrix composed of the translation and rotation information of each bone in each motion frame, for example... Indicates the first In the nth motion frame The transformation matrix of bone number (all of which are transformation matrices relative to the corresponding parent bone).

[0164] Next, after obtaining the motion data, forward kinematics (FK) calculations are performed. The FK calculation consists of two parts: FK over time and FK over the skeletal sequence. As an example, the formula for calculating FK over time is as follows: Formula 10 in, Indicates the first The transformation matrix of bone number 0 in one motion frame relative to bone number 0 in the first motion frame, i.e., the global transformation matrix. Indicates the first In the nth motion frame Transformation matrix of skeleton number 1, Indicates the first motion frame. The transformation matrix of the root bone. The global transformation matrix of the root bone in each motion frame can be calculated using Equation 10 above.

[0165] As an example, the formula for calculating FK on a skeletal sequence is as follows: Formula 11 in, Indicates the first In the nth motion frame Global transformation matrix of skeleton number 1 This indicates a chained multiplication of the parent skeleton sequence.

[0166] After FK calculations on the time series and skeleton sequences, all skeleton information of all motion frames is converted into information in the global coordinate system.

[0167] Furthermore, after obtaining the information of all skeletons in the global coordinate system for all motion frames, the body orientation and rotation are calculated. As an example, in this embodiment, the cross product of the body's rightward direction and the Z-direction of the world coordinates is used as the body orientation. The rightward direction is defined by the left and right shoulder bones and the left and right hip bones, and can be expressed as: Formula 12 in, Indicates the direction to the right of the body. This indicates the global position information of the left shoulder bones. This indicates the global position information of the right shoulder bones. This indicates the global position information of the left hip bone. This represents the global position information of the right hip bone (the global position information can be extracted from the global transformation matrix).

[0168] After determining the right direction of the body, the body orientation is calculated based on the right direction of the body and the Z-axis coordinate of the world coordinate system.

[0169] As an example, the formula for calculating body orientation is as follows: Formula 13 in, Indicates the body's orientation. Indicates the direction to the right of the body. This represents the Z-axis coordinate in the world coordinate system.

[0170] After calculating the body orientation, the X-axis of the body orientation relative to the world coordinate system is calculated using quaternions (i.e., rotation information determined based on Euler angles). Rotation information ( Indicates the first One motion frame, (Represents four-dimensional space).

[0171] Finally, after obtaining the rotation information, the motion trajectory information is extracted. The motion trajectory is defined as consisting of the motion information of the root skeleton within a certain time sequence. As an example, in this embodiment, 120 motion frames are used as a time window, and 12 motion frames are taken every 10 motion frames as the time sequence corresponding to the motion trajectory. Then, using the coordinate system of the middle motion frame among the 12 motion frames as a reference coordinate system, the position, velocity, and direction of the motion capture operator in these 12 motion frames are transformed to the coordinate system of the middle motion frame, forming a single motion trajectory information.

[0172] As an example, the formula for calculating the position of the motion capture operator in the motion trajectory is as follows: Formula 14 in, This indicates the position information of the motion capture operator in the movement trajectory (only horizontal position information is included). This represents the rotation quaternion of the motion capture operator in the middle frame of the motion trajectory. This represents the global position information of the motion capture operator across 12 motion frames of the motion trajectory. For half a time window (e.g., 60 seconds). The interval number (e.g., 10), for example, when i is 70... Take 60, When the value is 10, It is 10. It is 130. This means that a motion frame is taken every 10 motion frames between motion frames 10 and 130, and the global position information of the motion capture operator in the taken motion frame is calculated. This represents the global position information of the motion capture operator in the middle frame of the motion trajectory.

[0173] As an example, the formula for calculating the direction of the motion capture operator in the motion trajectory is as follows: Formula 15 in, This indicates the directional information of the motion capture operator in the movement trajectory (only horizontal direction information is included). This represents the rotation quaternion of the motion capture operator in the middle frame of the motion trajectory. This represents the directional position information of the motion capture operator across 12 motion frames of the motion trajectory, where... The meaning is the same as that in Formula 14 above.

[0174] As an example, the formula for calculating the speed of a motion capture operator in the motion trajectory is as follows: Formula 16 in, Speed ​​information of the motion capture operator in the motion trajectory (including only horizontal speed information). This represents the rotation quaternion of the motion capture operator in the middle frame of the motion trajectory. This represents the global position information of the motion capture operator for 12 motion frames in the next motion trajectory after the current motion trajectory. This represents the global position information of the motion capture operator across 12 motion frames of the motion trajectory. This indicates the motion capture frame rate.

[0175] The motion trajectory is generated in the manner described above, and the generated multiple motion trajectories are stored in the motion trajectory library. After storage is completed, the motion trajectory library is loaded.

[0176] After loading the motion trajectory library, the library is initialized, which involves establishing a mapping relationship between motion trajectories and trajectory indices, and creating a hash table between phases and trajectory indices. The method for creating the hash table is described in step 1042B above.

[0177] In step 402, the trajectory sequence of the game character is obtained from the game engine.

[0178] As an example, after loading the motion trajectory library, the trajectory of the game character is obtained from the game engine according to the motion trajectory in the motion trajectory library, and the pose of the game character corresponding to the multiple trajectories of the obtained game character is continuous.

[0179] As an example, game engines have specific data structures for storing the trajectory information of game characters. Therefore, by accessing the specific data structures of the game engine, the trajectory information of the game characters can be obtained. Then, based on the obtained trajectory information of the game characters, multiple trajectories of the game characters can be determined, and the determined trajectories of the game characters can be stored in the trajectory sequence of the game characters.

[0180] In some embodiments, each trajectory of a game character includes multiple motion frames. The data of the game character from the starting motion frame to the intermediate motion frame can be directly obtained from the game engine, while the data of the game character from the next motion frame after the intermediate motion frame to the ending motion frame needs to be calculated based on the data of the game character in the intermediate motion frame.

[0181] As an example, suppose the speed of the game character's movement in the middle frame is... The direction of the game character's movement in the middle frame is The position of the game character in the middle motion frame is The target speed is The target direction is (The target speed and target direction are determined based on the operation information corresponding to the actions of the game character by the developers in the game scene.) Assuming there are a total of 5 motion frames from the next motion frame after the middle motion frame to the last motion frame, for each motion frame i (with a value of 1-5) in these 5 motion frames, the formulas for calculating the speed, direction, and position of the game character in motion frame i are as follows:

[0182]

[0183]

[0184] Formula 17 in, Represents the weight parameters. Indicates the game character in The position of each motion frame, when i is 1. That is, the position of the game character in the middle of the motion frames (i.e., ); Indicates the game character in The velocity of each motion frame, when i is 1. This refers to the speed of the game character's movement in the middle of the frames (i.e., the speed of movement in the middle of the frame). ); This represents the time interval between two motion frames. The calculation principle of Formula 17 above is to perform linear interpolation calculation on velocity and direction, and to calculate position using the average velocity of the two consecutive motion frames.

[0185] After determining the data of the game character from the next motion frame to the end motion frame of the middle motion frame in each trajectory, based on the acquired data of the game character from the start motion frame to the middle motion frame in each trajectory, and the data of the game character from the next motion frame to the end motion frame of the middle motion frame in each trajectory, multiple trajectories of the game character are determined and stored in the trajectory sequence.

[0186] In step 403, the current trajectory to be matched of the game character is obtained from the trajectory sequence, and the current trajectory to be matched is matched with the motion trajectory in the motion trajectory library to determine the target motion trajectory.

[0187] As an example, after obtaining the trajectory sequence of the game character, the current trajectory to be matched of the game character is obtained from the trajectory sequence, and the current trajectory to be matched is matched with the motion trajectory in the motion trajectory library to determine the target motion trajectory.

[0188] The process of determining the trajectory of a target can be achieved through... Figure 5 The method implementation is shown. See also Figure 5 , Figure 5 This is a schematic diagram illustrating the trajectory matching process for virtual characters provided in an embodiment of this application. The following will be combined with... Figure 5 Steps 501-506 in the document will be explained.

[0189] In step 501, it is determined whether the current trajectory to be matched has a previously matched trajectory.

[0190] As an example, first determine whether the current trajectory to be matched has a previous matched trajectory. If it is determined that the current trajectory to be matched has a previous matched trajectory, then proceed to step 502; if it is determined that the current trajectory to be matched does not have a previous matched trajectory, then proceed to step 503.

[0191] In step 502, it is determined whether the motion trajectory matched by the matched trajectory is the end trajectory of the motion capture data.

[0192] As an example, after determining that the current trajectory to be matched has a previous matched trajectory, it is determined whether the motion trajectory matched by the matched trajectory is the end trajectory of the motion capture data. If it is determined that the motion trajectory matched by the matched trajectory is not the end trajectory of the motion capture data, then step 504 is executed; if it is determined that the motion trajectory matched by the matched trajectory is the end trajectory of the motion capture data, then step 503 is executed.

[0193] In step 503, phase hash matching is performed to determine the target's trajectory.

[0194] As an example, if the condition of step 501 is not met or the condition of step 502 is met, then based on the phase of the game character on the current trajectory to be matched, the target motion trajectory that matches the current trajectory to be matched is determined from the motion trajectory library.

[0195] It should be noted that the process of determining the target trajectory based on the phase of the game character on the current trajectory to be matched is the same as steps 1041B-1043B above, and will not be repeated here.

[0196] In step 504, fuzzy matching is performed.

[0197] As an example, if it is determined in step 502 that the motion trajectory matched by the matched trajectory is not the end trajectory of the motion capture data where the motion trajectory is located, then the trajectory matching method of the current trajectory to be matched is determined to be fuzzy matching processing method.

[0198] In step 505, it is determined whether the fuzzy matching process was successful.

[0199] As an example, after performing fuzzy matching, it is determined whether the fuzzy matching process is successful. Fuzzy matching includes average speed matching and speed matching. If at least one of these two is successful, the fuzzy matching process is determined to be successful, and step 506 is executed; otherwise, the fuzzy matching process is determined to be unsuccessful, and step 503 is executed.

[0200] In step 506, the target motion trajectory is determined using fuzzy matching.

[0201] As an example, if the fuzzy matching is successful, the target motion trajectory that matches the current trajectory to be matched is determined according to the fuzzy matching method.

[0202] It should be noted that steps 504-506 above are the same as steps 1041A-1043A above, and will not be repeated here.

[0203] See Figure 6 , Figure 6This is a schematic diagram illustrating the trajectory matching process for a game character provided in this application embodiment. During fuzzy matching, the candidate motion trajectory is determined based on the motion trajectory matched by the already matched trajectory. Since the multiple motion frames included in the motion trajectory are sequential in time, the candidate motion trajectory determined in this way is very close to the matched motion trajectory in terms of time sequence. Therefore, the candidate motion trajectory and the matched motion trajectory are also very close. After successful fuzzy matching and the candidate motion trajectory is determined as the target motion trajectory, the transition between the target motion trajectory and the motion trajectory matched by the previous matched trajectory is very smooth. Thus, the animation of the virtual character generated based on the smoothly transitioned trajectory is also very smooth. Figure 6 As shown, both trajectory 2 and trajectory 29 are motion trajectories determined by fuzzy matching. It can be seen that the trajectory of the game character obtained after fuzzy matching is very smooth overall.

[0204] In step 404, the current trajectory to be matched in the trajectory sequence is replaced with the target motion trajectory.

[0205] As an example, after determining the target motion trajectory, the current trajectory to be matched in the trajectory sequence is replaced with the target motion trajectory.

[0206] In step 405, a neural network is invoked to perform pose generation processing based on the target motion trajectory, and the animation of the game character is generated based on the generated pose.

[0207] As an example, the game server can use a neural network to generate a pose based on the target motion trajectory and the first pose of the game character on the current trajectory to be matched, so as to obtain the second pose of the game character; then, based on the first pose of the game character (i.e. the skeletal information of the game character, including the position, velocity and rotation information of the bones) and the second pose, the animation of the game character can be generated.

[0208] In other examples, the game server can send the target motion trajectory to the game terminal, and then the game terminal can generate animations of the game character based on the target motion trajectory.

[0209] See Figure 7 , Figure 7 This is a schematic diagram of the neural network structure provided in an embodiment of this application. As an example, Figure 7The neural network shown comprises four layers, where x0-xn generally refer to the target motion trajectory of the game character and the first pose of the game character corresponding to the current trajectory to be matched. In some embodiments, x0-xn may also include the action information of the game character, which is manually labeled information indicating that the game character is in different action states such as walking, running, and standing. Taking the one-hot encoding method as an example, assuming that three bits are used to represent the motion state of the game character, where the first bit represents standing, the second bit represents walking, and the third bit represents running, then the code corresponding to standing is 100, the code corresponding to walking is 010, and the code corresponding to running is 001. y0-yn generally refer to the processing result of the neural network. In the embodiments of this application, y0-yn generally refer to the second pose of the game character.

[0210] See Figure 8A , Figure 8A This is a schematic diagram of the first pose provided in an embodiment of this application. Figure 8A This indicates the first pose of the game character corresponding to the current trajectory to be matched.

[0211] See Figure 8B , Figure 8B This is a schematic diagram of the second pose provided in an embodiment of this application. Figure 8B This indicates that the target's motion trajectory, and such as Figure 8A The second pose is obtained after the first pose is processed by a neural network.

[0212] Since the first pose and the second pose respectively represent the action posture of the game character at different times, a single frame of animation of the game character can be generated based on the first pose and the second pose.

[0213] In this embodiment, since the trajectory matching method of the current trajectory to be matched of the virtual character is determined based on the detection result of the motion trajectory matched by the previous matched trajectory, the target motion trajectory that matches the current trajectory to be matched can be quickly and accurately determined based on the determined trajectory matching method. It is not necessary to traverse the motion trajectory library every time to determine the target motion trajectory corresponding to the current trajectory to be matched, which reduces the computational complexity of trajectory matching of virtual characters, shortens the computation time, and thus improves the efficiency of trajectory matching of virtual characters.

[0214] The following description continues to illustrate the exemplary structure of the virtual character trajectory matching device 233 provided in the embodiments of this application as a software module. In some embodiments, such as... Figure 2As shown, the software modules in the virtual character trajectory matching device 233 stored in the memory 230 may include: a first acquisition module 2331, used to acquire the current trajectory to be matched from the trajectory sequence of the virtual character; wherein, the trajectory sequence includes multiple virtual character trajectories with continuous poses; a second acquisition module 2332, used to determine the matched trajectory of the previous trajectory in the trajectory sequence, and acquire the detection result corresponding to the motion trajectory matched by the matched trajectory in the motion trajectory library; wherein, the detection result indicates whether the matched motion trajectory is the last trajectory of the motion capture data in which the motion trajectory is located, and the motion capture data includes multiple motion trajectories with continuous poses acquired from the motion trajectory library; a first determination module 2333, used to determine the trajectory matching method of the current trajectory to be matched based on the detection result; a second determination module 2334, used to determine the target motion trajectory that matches the current trajectory to be matched from the motion trajectory library based on the trajectory matching method; and a replacement module 2335, used to replace the current trajectory to be matched in the trajectory sequence with the target motion trajectory; wherein, the target motion trajectory is used to generate the animation of the virtual character.

[0215] In the above scheme, the first determining module 2333 is used to determine the trajectory matching method as fuzzy matching when the detection result indicates that the matched motion trajectory is not the end trajectory of the motion capture data; wherein, the fuzzy matching method is used to perform trajectory matching based on the speed and speed direction of the virtual character; when the detection result indicates that the matched motion trajectory is the end trajectory of the motion capture data, the trajectory matching method is determined as phase hash matching; wherein, the phase hash matching method is used to perform trajectory matching based on the phase of the virtual character.

[0216] In the above scheme, when the trajectory matching method is fuzzy matching, the second determining module 2334 is used to determine candidate motion trajectories from the motion trajectory library based on the matched motion trajectory; perform fuzzy matching processing on the candidate motion trajectory and the current trajectory to be matched; when the fuzzy matching processing result indicates that the matching is successful, the candidate motion trajectory is determined as the target motion trajectory that matches the current trajectory to be matched; wherein, the trajectory index corresponding to the target motion trajectory in the motion trajectory library is the trajectory index corresponding to the matched motion trajectory plus 1.

[0217] In the above scheme, the above device further includes: a third determining module, used to determine an intermediate motion frame from multiple motion frames included in the matched motion trajectory; and to determine the motion trajectory in the motion trajectory library, with the next motion frame of the intermediate motion frame as the intermediate motion frame, as a candidate motion trajectory.

[0218] In the above scheme, the above device further includes: a fuzzy matching processing module, used to perform at least one of the following processes: performing average speed matching processing on the average speed of the virtual character in the candidate motion trajectory and the average speed of the virtual character in the current trajectory to be matched; performing speed matching processing on the speed of the virtual character in the current trajectory to be matched and the speed of the virtual character in the matched trajectory; wherein, the speed of the virtual character in the current trajectory to be matched is the speed of the virtual character in the middle motion frame of the candidate motion trajectory; when at least one of the average speed matching processing and speed matching processing is successful, it is determined that the fuzzy matching processing is successful.

[0219] In the above scheme, the fuzzy matching processing module is used to perform a first matching process on the direction of the first average velocity of the virtual character in the candidate motion trajectory and the target direction to obtain a first matching processing result; wherein, the first average velocity is the average velocity of the virtual character in the following motion interval: from the next motion frame after the middle motion frame of the candidate motion trajectory to the last motion frame; and to perform a second matching process on the direction of the second average velocity of the virtual character in the candidate motion trajectory and the direction of the third average velocity of the virtual character in the current trajectory to be matched to obtain a second matching processing result; wherein, the second average velocity is the average velocity of the virtual character in the following motion interval: from the starting motion frame of the candidate motion trajectory to the motion frame before the middle motion frame; and the third average velocity is the average velocity of the virtual character in the following motion interval: from the starting motion frame and the motion frame before the middle motion frame of the current trajectory to be matched; when the first matching processing result indicates that the first angle between the direction of the first average velocity and the target direction is greater than a first angle threshold, and the second matching processing result indicates that the second angle between the direction of the second average velocity and the direction of the third average velocity is greater than a second angle threshold, the average velocity matching process is determined to be successful.

[0220] In the above scheme, the aforementioned fuzzy matching processing module is used to perform a third matching process on the direction of the virtual character's velocity in the current trajectory to be matched and the direction of the virtual character's velocity in the already matched trajectory, to obtain a third matching processing result; and to perform a fourth matching process on the magnitude of the virtual character's velocity in the current trajectory to be matched and the magnitude of the virtual character's velocity in the already matched trajectory, to obtain a fourth matching processing result; when the third matching processing result indicates that the third angle between the direction of the virtual character's velocity in the current trajectory to be matched and the direction of the virtual character's velocity in the already matched trajectory is greater than a third angle threshold, and the fourth matching processing result indicates that the magnitude of the virtual character's velocity in the current trajectory to be matched and the magnitude of the virtual character's velocity in the already matched trajectory are within the velocity threshold range, the velocity matching process is determined to be successful.

[0221] In the above scheme, when the fuzzy matching result indicates that the matching is unsuccessful, the second determining module 2334 is used to determine the target motion trajectory that matches the current trajectory to be matched from the motion trajectory library based on the phase hash matching method.

[0222] In the above scheme, when the trajectory matching method is phase hash matching, the second determining module 2334 is used to determine a candidate phase set based on the phase of the virtual character in the current trajectory to be matched; wherein, the candidate phase set includes the phase of the virtual character in the current trajectory to be matched; based on multiple candidate phases in the candidate phase set and the hash table in the motion trajectory library, a candidate motion trajectory corresponding to each candidate phase is determined; wherein, the hash table is established based on the phase and the corresponding trajectory index, and each trajectory index corresponds to a motion trajectory; and the target motion trajectory that matches the current trajectory to be matched is determined from multiple candidate motion trajectories.

[0223] In the above scheme, the second determining module 2334 is used to determine the position error between each candidate motion trajectory and the current trajectory to be matched; wherein, the position error is determined based on the sum of the distance between the position of the virtual character in each motion frame of the multiple motion frames included in the candidate motion trajectory and the position of the virtual character in the corresponding motion frame included in the current trajectory to be matched; the candidate motion trajectory corresponding to the smallest position error is determined as the target motion trajectory that matches the current trajectory to be matched.

[0224] In the above scheme, the above device further includes: a generation module, used to call a neural network to perform pose generation processing based on the target motion trajectory and the first pose of the virtual character corresponding to the current trajectory to be matched, to obtain the second pose of the virtual character; and to generate an animation of the virtual character based on the first pose and the second pose of the virtual character.

[0225] In the above scheme, the second determining module 2334 is used to determine that the current trajectory to be matched is the first trajectory in the trajectory sequence, and to determine the target motion trajectory that matches the current trajectory to be matched from the motion trajectory library based on the phase hash matching method.

[0226] This application provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the virtual character trajectory matching method described above in this application.

[0227] This application provides a computer-readable storage medium storing executable instructions, wherein the executable instructions are stored and when executed by a processor, they will cause the processor to execute the trajectory matching method for virtual characters provided in this application.

[0228] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or it may be a variety of devices including one or any combination of the above-mentioned memories.

[0229] In some embodiments, executable instructions may take the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a standalone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.

[0230] As an example, executable instructions may, but do not necessarily, correspond to files in a file system. They may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a Hyper Text Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple collaborating files (e.g., a file that stores one or more modules, subroutines, or code sections).

[0231] As an example, executable instructions can be deployed to execute on a single computing device, or on multiple computing devices located in one location, or on multiple computing devices distributed across multiple locations and interconnected via a communication network.

[0232] In summary, the embodiments of this application determine the trajectory matching method of the current trajectory to be matched for the virtual character based on the detection results of the motion trajectory matched by the previous matched trajectory. This allows for the rapid and accurate determination of the target motion trajectory that matches the current trajectory to be matched, without having to traverse the motion trajectory library every time to determine the target motion trajectory corresponding to the current trajectory to be matched. This reduces the computational complexity and shortens the computation time for trajectory matching of virtual characters, thereby improving the efficiency of trajectory matching for virtual characters.

[0233] The above are merely embodiments of this application and are not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, and improvements made within the spirit and scope of this application are included within the scope of protection of this application.

Claims

1. A method for trajectory matching of a virtual character, characterized in that, The method includes: Obtain the current trajectory to be matched from the trajectory sequence of the virtual character; wherein, the trajectory sequence includes multiple virtual character trajectories with consecutive poses of the virtual character; Determine the matched trajectory of the current trajectory to be matched in the trajectory sequence, and obtain the detection result corresponding to the motion trajectory matched by the matched trajectory in the motion trajectory library; wherein, the detection result indicates whether the matched motion trajectory is the last trajectory of the motion capture data in which the motion trajectory is located, and the motion capture data includes multiple motion trajectories with continuous pose obtained from the motion trajectory library; When the detection result indicates that the matched motion trajectory is not the end trajectory of the motion capture data, the trajectory matching method is determined to be fuzzy matching; wherein, the fuzzy matching method is used to perform trajectory matching based on the speed and speed direction of the virtual character; When the detection result indicates that the matched motion trajectory is the end trajectory of the motion capture data, the trajectory matching method is determined to be the phase hash matching method; wherein, the phase hash matching method is used to perform trajectory matching based on the phase of the virtual character; Based on the trajectory matching method, a target motion trajectory that matches the current trajectory to be matched is determined from the motion trajectory database; The current trajectory to be matched in the trajectory sequence is replaced with the target motion trajectory; wherein the target motion trajectory is used to generate the animation of the virtual character.

2. The method according to claim 1, characterized in that, When the trajectory matching method is the fuzzy matching method, determining the target motion trajectory that matches the current trajectory to be matched from the motion trajectory library based on the trajectory matching method includes: Candidate motion trajectories are determined from the motion trajectory database based on the matched motion trajectories; Perform fuzzy matching processing on the candidate motion trajectory and the current trajectory to be matched; When the fuzzy matching result indicates a successful match, the candidate motion trajectory is determined as the target motion trajectory that matches the current trajectory to be matched; wherein, the trajectory index of the target motion trajectory in the motion trajectory library is the trajectory index of the matched motion trajectory plus 1.

3. The method according to claim 2, characterized in that, The step of determining candidate motion trajectories from the motion trajectory database based on the matched motion trajectory includes: The intermediate motion frame is determined from the multiple motion frames included in the matched motion trajectory; The motion trajectory in the motion trajectory library that takes the next motion frame of the intermediate motion frame as the intermediate motion frame is determined as the candidate motion trajectory.

4. The method according to claim 2, characterized in that, The step of performing fuzzy matching processing on the candidate motion trajectory and the current trajectory to be matched includes: Perform at least one of the following processes: The average speed of the virtual character in the candidate motion trajectory is compared with the average speed of the virtual character in the current trajectory to be matched. The speed of the virtual character in the current trajectory to be matched is compared with the speed of the virtual character in the matched trajectory; wherein, the speed of the virtual character in the current trajectory to be matched is the speed of the virtual character in the middle motion frame of the candidate motion trajectory; The fuzzy matching process is determined to be successful if at least one of the average speed matching process and the speed matching process is successful.

5. The method according to claim 4, characterized in that, The average speed matching process, which compares the average speed of the virtual character in the candidate motion trajectory with the average speed of the virtual character in the current trajectory to be matched, includes: A first matching process is performed on the direction of the first average velocity of the virtual character in the candidate motion trajectory and the target direction to obtain a first matching process result; wherein, the first average velocity is the average velocity of the virtual character in the following motion interval: from the next motion frame after the middle motion frame of the candidate motion trajectory to the last motion frame; A second matching process is performed between the direction of the second average velocity of the virtual character in the candidate motion trajectory and the direction of the third average velocity of the virtual character in the current trajectory to be matched, to obtain the second matching result. Wherein, the second average speed is the average speed of the virtual character in the following motion interval: from the starting motion frame of the candidate motion trajectory to the previous motion frame of the intermediate motion frame; the third average speed is the average speed of the virtual character in the following motion interval: from the starting motion frame of the current trajectory to be matched to the previous motion frame of the intermediate motion frame; When the first matching result indicates that the first angle between the direction of the first average velocity and the target direction is greater than the first angle threshold, and the second matching result indicates that the second angle between the direction of the second average velocity and the direction of the third average velocity is greater than the second angle threshold, the average velocity matching process is determined to be successful.

6. The method according to claim 4, characterized in that, The speed matching process, which compares the speed of the virtual character in the current trajectory to be matched with the speed of the virtual character in the matched trajectory, includes: A third matching process is performed on the direction of the virtual character's velocity in the current trajectory to be matched and the direction of the virtual character's velocity in the matched trajectory to obtain the third matching result; A fourth matching process is performed on the magnitude of the virtual character's speed in the current trajectory to be matched and the magnitude of the virtual character's speed in the matched trajectory to obtain the fourth matching result; When the third matching result indicates that the third angle between the direction of the virtual character's speed in the current trajectory to be matched and the direction of the virtual character's speed in the matched trajectory is greater than the third angle threshold, and the fourth matching result indicates that the magnitude of the virtual character's speed in the current trajectory to be matched and the magnitude of the virtual character's speed in the matched trajectory are within the speed threshold range, the speed matching process is determined to be successful.

7. The method according to claim 2, characterized in that, When the fuzzy matching result indicates that the match is unsuccessful, the method further includes: Based on the phase hash matching method, a target motion trajectory that matches the current trajectory to be matched is determined from the motion trajectory library.

8. The method according to claim 1, characterized in that, When the trajectory matching method is the phase hash matching method, determining the target motion trajectory that matches the current trajectory to be matched from the motion trajectory library based on the trajectory matching method includes: Based on the phase of the virtual character on the current trajectory to be matched, a candidate phase set is determined; wherein, the candidate phase set includes the phase of the virtual character on the current trajectory to be matched; Based on multiple candidate phases in the candidate phase set and a hash table in the motion trajectory library, a candidate motion trajectory corresponding to each candidate phase is determined; wherein, the hash table is established based on the phase and the corresponding trajectory index, and each trajectory index corresponds to one motion trajectory; The target motion trajectory that matches the current trajectory to be matched is determined from multiple candidate motion trajectories.

9. The method according to claim 8, characterized in that, The step of determining the target motion trajectory that matches the current trajectory to be matched from the multiple candidate motion trajectories includes: Determine the positional error between each candidate motion trajectory and the current trajectory to be matched; wherein the positional error is determined based on the sum of the distances between the position of the virtual character in each of the multiple motion frames included in the candidate motion trajectory and the position of the virtual character in the corresponding motion frame included in the current trajectory to be matched; The candidate motion trajectory corresponding to the smallest position error is determined as the target motion trajectory that matches the current trajectory to be matched.

10. The method according to claim 1, characterized in that, After replacing the current trajectory to be matched in the trajectory sequence with the target motion trajectory, the method further includes: Based on the target motion trajectory and the first pose of the virtual character corresponding to the current trajectory to be matched, a neural network is invoked to perform pose generation processing to obtain the second pose of the virtual character. Animation of the virtual character is generated based on the first pose and the second pose of the virtual character.

11. The method according to claim 1, characterized in that, When the current trajectory to be matched in the trajectory sequence does not have a previously matched trajectory, the method further includes: The current trajectory to be matched is determined to be the first trajectory in the trajectory sequence, and based on the phase hash matching method, a target motion trajectory that matches the current trajectory to be matched is determined from the motion trajectory library.

12. A trajectory matching device for a virtual character, characterized in that, The device includes: The first acquisition module is used to acquire the current trajectory to be matched from the trajectory sequence of the virtual character; wherein, the trajectory sequence includes multiple virtual character trajectories with continuous poses of the virtual character; The second acquisition module is used to determine the matched trajectory of the current trajectory to be matched in the trajectory sequence, and to acquire the detection result corresponding to the motion trajectory matched by the matched trajectory in the motion trajectory library; wherein, the detection result indicates whether the matched motion trajectory is the last trajectory of the motion capture data in which the motion trajectory is located, and the motion capture data includes multiple motion trajectories with continuous poses obtained from the motion trajectory library; The first determining module is configured to determine the trajectory matching method as fuzzy matching when the detection result indicates that the matched motion trajectory is not the end trajectory of the motion capture data in which the motion trajectory is located; wherein, the fuzzy matching method is used to perform trajectory matching based on the speed and speed direction of the virtual character; and to determine the trajectory matching method as phase hash matching when the detection result indicates that the matched motion trajectory is the end trajectory of the motion capture data in which the motion trajectory is located; wherein, the phase hash matching method is used to perform trajectory matching based on the phase of the virtual character. The second determining module is used to determine a target motion trajectory that matches the current trajectory to be matched from the motion trajectory library based on the trajectory matching method; A replacement module is used to replace the current trajectory to be matched in the trajectory sequence with the target motion trajectory; wherein the target motion trajectory is used to generate the animation of the virtual character.

13. The apparatus according to claim 12, characterized in that, When the trajectory matching method is the fuzzy matching method, the second determining module is further configured to determine candidate motion trajectories from the motion trajectory library based on the matched motion trajectory; Perform fuzzy matching processing on the candidate motion trajectory and the current trajectory to be matched; When the fuzzy matching result indicates a successful match, the candidate motion trajectory is determined as the target motion trajectory that matches the current trajectory to be matched; wherein, the trajectory index of the target motion trajectory in the motion trajectory library is the trajectory index of the matched motion trajectory plus 1.

14. The apparatus according to claim 13, characterized in that, The device further includes: The third determining module is used to determine the intermediate motion frame from the multiple motion frames included in the matched motion trajectory; The motion trajectory in the motion trajectory library that takes the next motion frame of the intermediate motion frame as the intermediate motion frame is determined as the candidate motion trajectory.

15. The apparatus according to claim 13, characterized in that, The device further includes: A fuzzy matching processing module is configured to perform at least one of the following processes: performing average speed matching processing on the average speed of the virtual character in the candidate motion trajectory and the average speed of the virtual character in the current trajectory to be matched; performing speed matching processing on the speed of the virtual character in the current trajectory to be matched and the speed of the virtual character in the matched trajectory; wherein the speed of the virtual character in the current trajectory to be matched is the speed of the virtual character in the middle motion frame of the candidate motion trajectory; and determining that the fuzzy matching process is successful when at least one of the average speed matching processing and speed matching processing is successful.

16. The apparatus according to claim 15, characterized in that, The fuzzy matching processing module is further configured to perform a first matching process on the direction of the first average speed of the virtual character in the candidate motion trajectory and the target direction to obtain a first matching processing result; wherein, the first average speed is the average speed of the virtual character in the following motion interval: from the next motion frame of the middle motion frame of the candidate motion trajectory to the last motion frame. The fuzzy matching processing module is further configured to perform a second matching process on the direction of the second average velocity of the virtual character in the candidate motion trajectory and the direction of the third average velocity of the virtual character in the current trajectory to be matched, so as to obtain a second matching processing result; Wherein, the second average speed is the average speed of the virtual character in the following motion interval: from the starting motion frame of the candidate motion trajectory to the previous motion frame of the intermediate motion frame; the third average speed is the average speed of the virtual character in the following motion interval: from the starting motion frame of the current trajectory to be matched to the previous motion frame of the intermediate motion frame; The fuzzy matching processing module is further configured to determine that the average speed matching process is successful when the first angle between the direction of the first average speed and the target direction, as indicated by the first matching processing result, is greater than a first angle threshold, and the second angle between the direction of the second average speed and the direction of the third average speed, as indicated by the second matching processing result, is greater than a second angle threshold.

17. The apparatus according to claim 15, characterized in that, The fuzzy matching processing module is further configured to perform a third matching process on the direction of the speed of the virtual character in the current trajectory to be matched and the direction of the speed of the virtual character in the matched trajectory, so as to obtain a third matching processing result; A fourth matching process is performed on the magnitude of the virtual character's speed in the current trajectory to be matched and the magnitude of the virtual character's speed in the matched trajectory to obtain the fourth matching result; The fuzzy matching processing module is further configured to determine that the speed matching process is successful when the third matching processing result, which characterizes the direction of the speed of the virtual character in the current trajectory to be matched, and the third angle between the direction of the speed of the virtual character in the matched trajectory is greater than the third angle threshold, and the fourth matching processing result, which characterizes the magnitude of the speed of the virtual character in the current trajectory to be matched, and the magnitude of the speed of the virtual character in the matched trajectory are within the speed threshold range.

18. An electronic device, characterized in that, The electronic device includes: Memory, used to store executable instructions; A processor, when executing executable instructions stored in the memory, implements the trajectory matching method for virtual characters as described in any one of claims 1 to 11.

19. A computer-readable storage medium, characterized in that, It stores executable instructions for implementing the trajectory matching method for virtual characters as described in any one of claims 1 to 11 when executed by a processor.

20. A computer program product comprising computer instructions, characterized in that, When the computer instructions are executed by the processor, they implement the trajectory matching method for virtual characters as described in any one of claims 1 to 11.

Citation Information

Patent Citations

  • Animation generation method and device of virtual article, equipment and storage medium

    CN112200893A