Animation playing method and animation playing device
By acquiring the current behavior data and state switching instructions of the virtual character, and combining them with the animation state machine, feature vectors are directly stored in the animation assets for pose querying. This solves the problem of relying on high-quality animation databases in traditional motion matching technology, achieves fast response and flexible animation stylization, and reduces performance overhead and debugging complexity.
Patent Information
- Application Number
- CN202511663054.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-13
- Publication Date
- 2026-02-10
AI Technical Summary
Traditional motion matching techniques have high requirements for the quality and size of the animation database, lack stylization of animation, are not timely enough in animation response, and have high performance overhead and high debugging complexity.
By acquiring the current behavior data of the virtual character, responding to state switching commands, controlling the virtual character to switch to the target state, and determining the target animation frame that matches the current behavior data from the target animation resources for playback, combined with the state switching of the animation state machine, the dependence on high-quality animation database is reduced, and the feature vectors in the animation assets are directly stored for pose query.
It improves animation response speed, reduces the requirements for animation data volume and quality, enhances animation transition effects and stylization, and reduces performance overhead and debugging complexity.
Smart Images

Figure CN121509726A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present specification relate to the technical field of animation system, and particularly relate to an animation playing method and an animation playing device. BACKGROUND
[0002] Motion Matching is a data-driven animation technology that searches a pre-recorded high-quality animation data (Motion Clip) library in real time to find the most matching next frame of animation for the current character state (position, speed, orientation, action, etc.), thereby achieving extremely smooth, realistic and rapid response animation performance.
[0003] However, the traditional Motion Matching technology has high requirements for the quality and size of the animation database, and the animation style is not prominent enough, and the animation response is not timely enough. SUMMARY
[0004] Therefore, the embodiments of the present specification provide an animation playing method. One or more embodiments of the present specification also provide an animation playing device, a computing device, a computer-readable storage medium, and a computer program product to solve the technical defects in the prior art.
[0005] According to a first aspect of the embodiments of the present specification, an animation playing method is provided, including: obtaining current behavior data of a virtual character in a current state; in response to a state switching instruction, controlling the virtual character to switch from the current state to a target state; determining a target animation frame matching the current behavior data from target animation resources of the target state, and playing the target animation frame.
[0006] According to a second aspect of the embodiments of the present specification, an animation playing device is provided, including: an obtaining module configured to obtain current behavior data of a virtual character in a current state; a switching module configured to, in response to a state switching instruction, control the virtual character to switch from the current state to a target state; a playing module configured to determine a target animation frame matching the current behavior data from target animation resources of the target state, and play the target animation frame.
[0007] According to a third aspect of the embodiments of the present specification, a computing device is provided, including: a memory and a processor; the memory is configured to store computer programs / instructions, and the processor is configured to execute the computer programs / instructions, and the computer programs / instructions, when executed by the processor, implement the steps of the method provided in the first aspect.
[0008] According to a fourth aspect of the embodiments of this specification, a computer-readable storage medium is provided that stores a computer program / instructions that, when executed by a processor, implement the steps of the method provided in the first aspect described above.
[0009] According to a fifth aspect of the embodiments of this specification, a computer program product is provided, including a computer program / instructions that, when executed by a processor, implement the steps of the method provided in the first aspect described above.
[0010] This specification provides an embodiment of an animation playback method that acquires the current behavior data of a virtual character in its current state; responds to a state switching command, controls the virtual character to switch from the current state to a target state; determines a target animation frame that matches the current behavior data from the target animation resources of the target state, and plays the target animation frame. By responding promptly to changes in the virtual character's behavior through the state switching process, the animation response speed can be improved, and the requirements for the amount and quality of animation data are more flexible; determining the target animation frame from the target animation resources through data matching can enhance the animation transition effect; determining the target animation frame based on the current behavior data, without considering predicted future trajectories, can make the animation style more prominent. The combination of state switching and target animation frame matching ensures both the quality of animation playback and improves its responsiveness. Attached Figure Description
[0011] Figure 1 This is a flowchart illustrating an animation playback method provided in one embodiment of this specification; Figure 2 This is a flowchart illustrating a game animation playback method according to one embodiment of this specification; Figure 3 This is an architecture diagram of an animation playback system provided in one embodiment of this specification; Figure 4 This is a schematic diagram of the structure of an animation playback device provided in one embodiment of this specification; Figure 5 This is a structural block diagram of a computing device provided in one embodiment of this specification. Detailed Implementation
[0012] Many specific details are set forth in the following description to provide a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar extensions without departing from the spirit of this specification. Therefore, this specification is not limited to the specific implementations disclosed below.
[0013] The terminology used in one or more embodiments of this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of one or more embodiments of this specification. The singular forms “a,” “described,” and “the” as used in one or more embodiments of this specification and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items. The term “at least one” as used in one or more embodiments of this specification means “one or more,” and “a plurality of” means “two or more.” The term “comprising” is an open-ended description and should be understood as “including but not limiting,” and may include other content in addition to what has been described.
[0014] It should be understood that although the terms first, second, etc., may be used to describe various information in one or more embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first may also be referred to as second without departing from the scope of one or more embodiments of this specification, and similarly, second may also be referred to as first. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to a determination."
[0015] Furthermore, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties. Moreover, the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.
[0016] First, the terms and concepts used in one or more embodiments of this specification will be explained.
[0017] Animation state machine: A programming model or visualization tool used to manage and control the playback of animations for game characters. It determines which animation to play under what circumstances by defining a series of "states" and "transition rules".
[0018] Motion matching: a data-driven animation technique. Its core idea is not to predefine the playback order of animation sequences, but to search in real time within a large, pre-recorded database of animations to find the most suitable pose for the character's next frame.
[0019] Trajectory prediction: In motion matching systems, the expected movement path of a character over a future period is pre-calculated based on the character's current movement state and the player's input. This predicted path is the most crucial basis for the motion matching algorithm to search the animation database.
[0020] Pose search: refers to the process by which a motion matching system searches in real time within its vast animation database for the animation frame that best matches a character's current state and future intentions.
[0021] Animation Database: A pre-built collection containing massive amounts of character animation data, including raw animation data and feature vectors.
[0022] Animation assets: refer to all data resources that can be referenced and manipulated by animation blueprints, state machines, or motion matching systems, and ultimately drive the movement of the character's skeletal mesh.
[0023] Principal Component Analysis (PCA) is a statistical method used to simplify datasets. It transforms the original data into a new coordinate system through an orthogonal linear transformation, such that the largest variance (i.e., the most informative element) is concentrated on the first coordinate (called the first principal component), the second largest variance on the second coordinate (the second principal component), and so on. Simply put, PCA "compresses" complex, high-dimensional data into low-dimensional data without losing too much important information, making it easier to see the main structure and patterns of the data.
[0024] KD-Tree: A binary tree data structure used to organize point data in K-dimensional space. Each node represents a K-dimensional point, and by recursively partitioning the K-dimensional space, the tree structure can efficiently support range search and nearest neighbor search. Simply put, it is a "binary search tree in multidimensional space".
[0025] Traditional animation state machines require animators to create numerous transition animations and programmers to configure complex transition logic when managing complex character movements (such as movement at different speeds and directions, sudden stops, turns, and jump transitions). To achieve seamless, natural, and responsive animation transitions, it is necessary to mark them in the animation assets in advance, which is a huge workload and often requires manual intervention and debugging.
[0026] Motion matching is a data-driven animation technique that searches a pre-recorded database of high-quality animations in real time to find the next frame of animation that best matches the current character's state (position, speed, orientation, movement, etc.), thereby achieving extremely smooth, realistic, and responsive animation.
[0027] The core of motion matching lies in utilizing the pose search function. Each frame, the system predicts the character's future movement trajectory in real time based on the player's input, and uses this as a key basis to quickly find the best-matching pose for the next frame in a pre-built, high-quality animation database. This approach frees animators from creating numerous transition animations, but its final effect is highly dependent on the quality and size of the animation database, and requires meticulous debugging to optimize the accuracy and performance of the search and matching.
[0028] In the practical application of motion matching technology, the risks, challenges, and actual needs it brings are issues that need to be addressed.
[0029] Data quantity and quality: The quality and scale of the animation database directly determine the final effect, and its production cost is relatively high.
[0030] Feel and Stylization: For a 2D action game, the responsiveness of the controls needs to be very fast, and the animation needs to be very dynamic. However, the traditional motion matching scheme tends to be more realistic, but the response of the controls is not timely enough.
[0031] Performance overhead: Searching in large-scale databases is the main performance bottleneck and needs to be optimized through strategies such as partitioning and Level of Detail (LOD).
[0032] Database: Unreal Engine 5 (UE5) native motion matching solution uses a database to store the baking data required for Pose Search. However, even if there is only one animation baking data in the database, a separate database asset is required. It is only suitable for scenarios that require a large number of motion matching applications. Otherwise, there is a problem that the data elements are not refined enough and the asset reference dependency is increased.
[0033] Debugging complexity: It is more of a "black box" than a state machine, requiring the powerful debugging tools provided by UE5 to troubleshoot matching issues.
[0034] This specification provides a method for playing animation, and also relates to an animation playback device, a computing device, a computer-readable storage medium, and a computer program product, which will be described in detail in the following embodiments.
[0035] See Figure 1 , Figure 1 This specification shows a flowchart of an animation playback method according to an embodiment, which specifically includes the following steps: Step 102: Obtain the current behavior data of the virtual character in the current state.
[0036] It should be noted that virtual characters refer to fictional entities with visual appearances and behavioral logic, created through digital technologies (such as computer graphics and artificial intelligence) and existing in virtual spaces (such as games, movies, and the metaverse). Virtual characters can be characters in different scenarios, such as characters in game scenarios, characters in film and animation, and characters in virtual reality. Virtual characters can also be different types of characters in the same scenario, such as player characters and non-player characters in a game scenario.
[0037] A state refers to a specific behavioral pattern that a virtual character is in at a particular moment, such as walking, running, jumping, or attacking. The current state refers to the state that the virtual character is in at the current moment.
[0038] Current behavior data refers to a collection of real-time variables and information used to describe the current state, action intentions, and motion performance of a virtual character at a specific moment. Current behavior data is a structured collection of information that is updated in real time, accurately describing the instantaneous posture, motion intentions, and physical state of the virtual character in the virtual world. Current behavior data can be data from the current animation frame or data from several adjacent historical frames. It can include the virtual character's position, orientation, velocity, skeletal information, and environmental data.
[0039] In practical applications, there are multiple ways to obtain the current behavior data of a virtual character in its current state. The specific method chosen depends on the actual situation, and this specification does not impose any limitations on this method. In one possible implementation of this specification, it is clearly defined which component or system manages the required data, and the data is read through the access interface provided by that component. This integrates the scattered data into a unified structure and transmits it to other modules that depend on this data in real time.
[0040] In another possible implementation of this specification, one or more animation frames of the virtual character in its current state are obtained, and the data extraction module extracts data from the obtained animation frames to obtain the current behavior data.
[0041] Step 104: In response to the state switching command, control the virtual character to switch from the current state to the target state.
[0042] It's important to note that an instruction is a specific, executable command or request, which can be understood as a signal that triggers a specific action. State switching refers to the process by which a system (such as a game character, application, or machine) changes from one specific behavior mode or configuration to another. For example, a virtual character switching from walking to running. A state switching instruction is a command that triggers a state switch in a virtual character. State switching instructions include the target state that the virtual character is switching to.
[0043] The target state refers to the new, stable state that the system will eventually enter after a state transition. The target state can refer to the state of a virtual character after a transition. For example, if a virtual character switches from walking to running, the current state could be walking, and the target state could be running.
[0044] While motion matching is a publicly available technology, its extremely high requirements for the quality and scale of the animation database often hinder its application. This is especially true for long-running games that primarily sell character designs, where data volume becomes a crucial factor in considering any given solution.
[0045] Traditional animation state machines offer greater flexibility in terms of asset size, and we aim to retain this advantage in animation systems. Therefore, the state transitions of the animation state machine are preserved in the animation playback method.
[0046] In motion matching, a database containing cached data (corresponding feature vectors) of all animation assets in the animation asset set is indeed needed for trajectory matching and pose querying. However, this embodiment selects animation assets for playback more like a traditional animation state machine, relying on player input (corresponding to behavior control information) and the character's current state (corresponding to current behavior data). Therefore, an animation database is not required. Instead, the cached data needed for animation resources that need to be played via pose querying is directly stored on the animation asset itself. If an animation asset does not have the cached data required for pose querying, it is played in the traditional way.
[0047] An animation asset selector is configured for each state. Designers configure the animation asset selector with information such as the animation asset indexes to be returned for each conditional path branch, and the playback mode. At runtime, the animation state machine updates the animation asset selector, obtaining the animation asset indexes and playback modes that match the character's current state. Different characters can attach different animation asset configuration tables, retrieving the required animation assets for the current state based on the animation asset indexes. In addition to the pose for each frame, each animation asset contains the feature vectors needed for pose lookup.
[0048] In one optional embodiment of this specification, before controlling the virtual character to switch from the current state to the target state in response to a state switching command, the following steps may be included: Obtain behavioral control information for virtual characters; Based on behavior control information and current behavior data, determine whether to generate a state switching instruction.
[0049] It should be noted that behavioral control information refers to any instructions or information that a user sends to the scene in which the virtual character is located through a physical input device. The scene engine receives and parses this information, and then controls the characters, objects, or interfaces in the scene to react accordingly. Behavioral control information can be player input information in the game scene. For example, behavioral control information could be a player pressing the space bar on the keyboard to indicate that they want to control the character to jump.
[0050] In practical applications, there are various ways to obtain behavior control information for virtual characters, and the specific method chosen depends on the actual situation. This specification does not limit the specific methods used in this embodiment. In one possible implementation, the system uses a polling method to actively query the input device in each frame whether a certain button has been pressed, and receives the result returned by the input device to obtain the behavior control information.
[0051] In another possible implementation of this specification, an event-driven approach is used. Instead of checking every frame, a function (callback function) is pre-subscribed. When an input event occurs (such as a key being pressed), the system automatically notifies and calls the subscribed function to obtain behavior control information.
[0052] In another possible implementation of this specification, a series of input actions are predefined in the settings, and each action is bound to one or more physical buttons. The focus is only on whether the action is triggered and its intensity, not on which specific button was pressed. This method is used to obtain behavior control information.
[0053] There are multiple ways to determine whether to generate a state transition command based on behavior control information and current behavior data. The specific method chosen depends on the actual situation, and this specification does not limit the specific method used in the embodiments. In one possible implementation, the behavior control information is transformed to obtain transformed control parameters. The current behavior data is then updated based on the control parameters to obtain updated target behavior data. The generation of a state transition command is then determined based on the target behavior data. A state transition command is generated when the target behavior data meets the state transition conditions; otherwise, no state transition command is generated.
[0054] For example, the player's movement input (corresponding to behavior control information) is first converted into parameters needed for character motion simulation each frame (e.g., acceleration, target orientation, etc.). The character's physics movement component simulates the character's movement, calculating the movement speed, the current frame's position, the character's orientation, environmental collision, and other information. The character's skill system updates the character's current state based on the player's skill input, passive effects, and other information. The animation state machine designer enumerates the combinations of character movement information and states through a pre-built hierarchical animation state tree; these combinations become the activation or switching conditions for each animation state. During runtime, the animation state machine updates the current state and the target state each frame by collecting and calculating the condition variables for each state activation or switching.
[0055] In another possible implementation of this specification, a state transition graph is pre-constructed. This graph includes all states and the transition conditions (switching rules) between any two states. Based on behavior control information and current behavior data, the graph searches for matching transition conditions. The search results determine whether to generate a state transition command. If a matching condition is found, a state transition command is generated; otherwise, no matching condition is found.
[0056] It's important to note that after building the animation state machine, each state configuration is data-driven. Some states can have missing configurations; for example, if no data is configured for the starting state, it will skip the starting state and directly enter the movement state. The state configuration data determines all the information needed for the animation pose of the current state (animation assets, playback mode, blending mode, distortion mode, pose query). This information is stored hierarchically in different data sets. By combining different data sets, new effects can be created, ranging from simple to elaborate.
[0057] By applying the solutions in the embodiments of this specification, considering behavioral control information and current behavioral data, it is determined whether to generate a state switching instruction. This enables timely response to control input from the user, accurate grasp of the timing of state switching, and improved accuracy of switching control.
[0058] Step 106: Determine the target animation frame that matches the current behavior data from the target animation resources of the target state, and play the target animation frame.
[0059] It's important to note that animation assets are digital files stored in the project folder. They contain crucial data describing how the character mesh changes over time (such as movement, rotation, and deformation). These assets are not visible on their own; they need to be accessed by the engine's animation system and applied to the character model to create visual motion. Animation assets can be animation clips containing consecutive animation frames or discrete animation frames.
[0060] A target animation resource refers to the animation resource corresponding to the target state. A target animation resource can be a single animation resource or multiple animation resources.
[0061] The target animation frame refers to the animation frame that needs to be played at the next moment, determined from the target animation resource; that is, the next animation frame corresponding to the current animation frame.
[0062] In practical applications, there are various ways to determine the target animation frame that matches the current behavior data from the target animation resources of the target state. The specific method is selected according to the actual situation, and the embodiments in this specification do not limit this. In one possible implementation of this specification, the predicted future trajectory is determined based on the current behavior data and behavior control information, and the target animation frame that matches the current behavior data and the predicted future trajectory is determined from the target animation resources.
[0063] In another possible implementation of this specification, determining the target animation frame that matches the current behavior data from the target animation resources of the target state may include the following steps: Based on the current behavioral data, determine the features to be matched; Find target features that match the feature to be matched from the candidate feature set of the target animation resource; The animation frames corresponding to the target features in the target animation resource are identified as the target animation frames.
[0064] It should be noted that the features to be matched refer to a set of representative key data indicators or attributes extracted from the object that needs to be identified or queried. The features to be matched are constructed based on the current behavioral data and serve as a reference for finding the target animation frame. The features to be matched can be represented in the form of feature vectors.
[0065] A candidate feature set refers to the collection of candidate features corresponding to each animation frame in the target animation resource. The candidate feature set includes multiple candidate features, constructed based on the animation frames in the target animation resource. Each animation frame corresponds to one candidate feature. Candidate features can be represented in the form of feature vectors.
[0066] Target features refer to the features found from the candidate feature set that match the feature to be matched. Target features correspond to target animation frames.
[0067] In most situations (ground movement, jumping) and during combat, the predicted future trajectory is not considered, but the method of predicting and matching the future trajectory is retained and will be activated only when needed.
[0068] In one optional embodiment of this specification, the target animation resource and the candidate feature set are located in the same storage space.
[0069] It should be noted that traditional motion matching schemes require an additional database to store candidate feature sets, while the customized motion matching data flow in the embodiments of this specification allows data to be stored directly in the animation assets when more refined database resources are needed, eliminating the need for additional separate assets.
[0070] Unlike native motion matching schemes that require creating additional animation database assets for specific states, the embodiments in this specification directly store the "feature vector" (PoseSearchData) extracted from the animation asset within the animation asset itself.
[0071] The storage space can be animation assets, and the target animation resources and candidate feature sets can be stored together in the animation assets.
[0072] In practical applications, there are multiple ways to determine the features to be matched based on the current behavior data. The specific method should be selected according to the actual situation, and the embodiments in this specification do not impose any limitations on this. In one possible implementation of this specification, core features are extracted from the current behavior data, the extracted core features are normalized / standardized, and then the processed data are concatenated into a one-dimensional array according to a predefined and fixed order to obtain the features to be matched.
[0073] In another possible implementation of this specification, the current behavior data is processed by a feature extraction model to obtain the features to be matched. The feature extraction model is trained on the initial extraction model based on the sample behavior data and sample features.
[0074] There are multiple ways to find target features that match the features to be matched from the candidate feature set of the target animation resource. The specific method should be selected according to the actual situation, and the embodiments in this specification do not limit this. In one possible implementation of this specification, principal component analysis is used to reduce the dimensionality of the candidate feature set and the features to be matched, resulting in a dimensionality-reduced candidate feature set and a dimensionality-reduced features to be matched. The dimensionality-reduced features to be matched are then matched with the dimensionality-reduced candidate feature set to obtain the target features.
[0075] In another possible implementation of this specification, the candidate features in the candidate feature set are organized into a tree data structure in a multi-dimensional space, and the tree data structure is used to quickly find the target feature with the closest Euclidean distance to the feature to be matched.
[0076] In practical applications, the implementation of gesture search can be broken down into three main stages: database construction (offline), real-time search (runtime), and result application (runtime).
[0077] Phase 1: Database Construction (Offline / During Development) This is the most basic step; all searches take place within this pre-built database.
[0078] 1. Feature Extraction For each frame pose in the animation asset, a set of feature vectors (PoseSearchData) is calculated and stored within the animation asset. These features serve as the basis for subsequent similarity comparisons. They mainly include: Bone Positions: These typically refer to the current position of the character's lower body (such as hips, knees, and ankles) and root bones, as well as their predicted positions at future time points (e.g., 0.1 seconds, 0.2 seconds, 0.3 seconds later). This is crucial for ensuring future trajectory matching, allowing the system to select frames that match not only the current pose but also the future direction and speed of movement.
[0079] Bone Velocities: The current velocity of key bones used to ensure the continuity of motion.
[0080] 2. Indexing and Compression Directly comparing all feature values of all frames pairwise (brute force search) is absolutely infeasible at runtime.
[0081] The pose search library uses PCA and KD-Tree for optimization.
[0082] PCA reduces the dimensionality of high-dimensional feature vectors (e.g., hundreds of floating-point numbers) to the core, most discriminative principal components, significantly reducing the amount of data while retaining most of the information.
[0083] The KD-Tree organizes the dimensionality-reduced data points (each frame is a point) into a tree-like data structure in a multi-dimensional space. This allows for efficient nearest neighbor search at runtime, with a time complexity close to O(log n), rather than the O(n) of brute-force search.
[0084] Phase Two: Real-time Search (Runtime / Per Frame or On Demand) This is a process that can happen in every frame.
[0085] 1. Constructing a query pose The system uses the character's current frame as a basis and combines the player's input (joystick direction, button press) to construct a feature vector of the "ideal" pose for the next frame, called the query vector.
[0086] This query vector contains: Current pose characteristics: current bone position, velocity, etc.
[0087] Desired future trajectory (only when trajectory matching is required): The path the player hopes the character will take in the next 0.5-1 seconds, calculated based on player input. For example, if the player pushes the joystick forward, the desired trajectory is a straight line forward.
[0088] 2. Perform a search in KD-Tree The query vector constructed in the previous step is also reduced to a low-dimensional space, the same as that of the database, using PCA.
[0089] In this low-dimensional space, KD-Tree is used to quickly find the point (i.e., a frame in the database) that is closest to the Euclidean distance of the query vector.
[0090] This "nearest" point is the next frame in all the animation data that best matches the "current pose + desired motion".
[0091] Phase 3: Application and Blending of Results 1. Extraction Results The search returns the animation asset containing the best-matching frame, the time point, and all data for that frame.
[0092] 2. Time synchronization and hybridization The system will not directly "jump" to the target frame, as that would cause a drastic change.
[0093] Instead, it calculates the optimal path needed for a smooth blend from the current frame to the target frame. The pose search module has powerful built-in blending logic that can calculate this automatically. Blending duration: The blending time is determined by the similarity between two frames (very similar poses blend quickly, while poses with large differences blend slightly slower).
[0094] Inertial blending: If the searched frame comes from an animation with a completely different rhythm from the current animation (such as matching running from walking), the system will calculate the velocity and angular velocity of the bones in the previous pose and let these velocities decay naturally to zero in the following short period of time, thus producing a very natural motion continuation and buffering effect.
[0095] By applying the scheme of the embodiments in this specification, the target feature is determined by matching the feature to be matched with the candidate feature set, and the target animation frame is determined based on the target feature. This enables the search for target animation frames that match the current behavior data from the target animation resources, improving the efficiency and accuracy of target animation frame search. Determining the feature to be matched based on the current behavior data, without considering the predicted future trajectory, can make the stylization of the animation more prominent.
[0096] In another possible implementation of this specification, determining the target animation frame that matches the current behavior data from the target animation resources of the target state may include the following steps: Based on the target animation resources, determine the animation playback method; When the animation playback mode is set to match playback, the target animation frame that matches the current behavior data is determined from the target animation resource.
[0097] It's important to note that animation playback method refers to the specific approach by which the engine controls, schedules, and presents animation resources to create a continuous visual effect of motion on the screen. Typically, animation playback is frame-based, with the animation consisting of a series of consecutive static images (keyframes). During playback, the system displays these images sequentially frame by frame, utilizing the persistence of vision to create a sense of motion.
[0098] In the embodiments of this specification, the animation playback methods are divided into two types: matching playback and sequential playback.
[0099] Matched playback refers to selecting the most suitable target animation frame from the target animation resource for playback at each frame. The target animation frame is usually an animation frame that matches a certain reference factor, which can be determined based on the actual situation. For example, the reference factor is the current behavior data.
[0100] Sequential playback refers to playing the target animation resource according to the order of its animation frames.
[0101] For anime-style action games, sometimes the goal is to create greater tension and a more exaggerated style, but the trajectory cannot always be "predicted," and "smoothness" is not always the objective. Therefore, a system framework is needed to combine "animation state machines" and "motion matching." Through a data-driven implementation, designers can adjust the animation system to lean more towards either "animation state machines" or "motion matching" at any time.
[0102] In practical applications, there are multiple ways to determine the animation playback method based on the target animation resource. The specific method is selected according to the actual situation, and the embodiments in this specification do not impose any limitations on this. In one possible implementation of this specification, the number of animation resources contained in the target animation resource is determined. If the target animation resource contains one animation resource, the animation playback method is determined to be sequential playback. If the target animation resource contains at least two animation resources, the animation playback method is determined to be matched playback.
[0103] In another possible implementation of this specification, the target animation resource is subjected to content analysis to determine whether the target animation resource has a clear start frame and end frame. If the target animation resource has a clear start frame and end frame, the animation playback method is determined to be sequential playback. If the target animation resource does not have a clear start frame and end frame, the animation playback method is determined to be matched playback.
[0104] In another possible implementation of this specification, determining the animation playback method based on the target animation resource may include the following steps: If the target animation resource has a candidate feature set, the animation playback method is determined to be matching playback, where the candidate feature set is used to search for the target animation resource; If the target animation resource does not have a candidate feature set, the animation playback method is determined to be sequential playback.
[0105] It should be noted that different states correspond to different animation resources. Some animation resources have candidate feature sets, while others do not. Target animation frames can be determined from the target animation resource based on the candidate feature set. Therefore, if the target animation resource has a candidate feature set, the animation playback method is determined to be matching playback; if the target animation resource does not have a candidate feature set, the animation playback method is determined to be sequential playback.
[0106] For example, when transitioning to the target state, it is checked whether there is cached data for pose matching (PoseSearch) on the target animation asset. If there is, the cached data is used to select the animation frame that best matches the current character's pose and start playing. If not, it is played in the traditional animation state machine manner.
[0107] The solution implemented in this specification determines the playback mode of a target animation resource based on whether it possesses a candidate feature set. This enables flexible configuration of different animation resources through a data-driven approach. When it is necessary to adjust the playback mode of an animation resource, only the candidate feature set needs to be adjusted, reducing the complexity of the adjustment and improving the flexibility of animation playback.
[0108] The solution implemented in this specification will only match and play target animation frames from the target animation resource when the target animation resource's animation playback mode is matched. This avoids unnecessary computational overhead, achieves a balance between control granularity and flexibility, and enhances the system's scalability and robustness.
[0109] In one optional embodiment of this specification, the following steps may also be included: When the animation playback mode is sequential, the target animation frame is determined based on the animation frame order of the target animation resource and the already played animation frames.
[0110] It's important to note that animation frame order refers to the sequential order of each animation frame in the target animation resource. When playing the target animation resource, it must be played in frame order. For example, animation frames are played one after another, from the first frame to the last frame, according to their index in the target animation resource, with the frame order being 1→2→3→...→N.
[0111] Played animation frames refer to the animation frames in the target animation resource that have been played in the current playback cycle. During the loop playback of the target animation resource, the animation frames that have been played in the target animation resource in the current playback cycle are marked as played animation frames.
[0112] In practical applications, there are multiple ways to determine the target animation frame based on the animation frame order and already played animation frames of the target animation resource. The specific method is selected according to the actual situation, and the embodiments in this specification do not limit this in any way. In one possible implementation of this specification, each animation frame in the target animation resource is sorted according to the animation frame order to obtain an animation frame sequence with a sequential order. Based on the already played animation frames, the first unplayed animation frame is selected from the animation frame sequence as the target animation frame.
[0113] In another possible implementation of this specification, the latest index of the played animation frame is determined based on the already played animation frame, the next index adjacent to the latest index is determined based on the order of the animation frames, and the unplayed animation frame corresponding to the next index is determined as the target animation frame.
[0114] By applying the solutions in the embodiments of this specification, when playing target animation resources sequentially, the target animation frames can be accurately obtained based on the animation frame order and the already played animation frames, thus achieving sequential playback of the target animation resources.
[0115] In practical applications, there are various ways to play the target animation frame, and the specific method should be selected according to the actual situation. This specification does not limit the specific methods used in this embodiment. In one possible implementation, after determining the target animation frame, the current animation frame and the target animation frame are blended to allow the virtual character to smoothly transition to the target pose. Specifically, the source pose and the target pose are determined, the blending duration is set, the blending weights are calculated, per-bone pose blending (bone position blending, bone rotation blending) is performed, root bone motion is processed, the blending is terminated, and the playback of the target animation frame is completed.
[0116] In another possible implementation of this specification, playing the target animation frame may include the following steps: Based on the target state, an animation warping strategy is determined, wherein the animation warping strategy includes at least one of root bone rotation warping, orientation adaptation, and motion warping; Based on the animation distortion strategy, the target animation frame is processed to obtain the processed distorted animation frame, and then the processed distorted animation frame is played.
[0117] It's important to note that animation distortion strategy refers to a technique that dynamically modifies already played animations at runtime. It allows developers to partially adjust, deform, or reorient existing animation clips to adapt them to different game scenarios without creating entirely new animations.
[0118] Root bone rotation distortion is an animation distortion technique that dynamically modifies the rotation values of a character's root bones at runtime, thereby changing the orientation of the character's entire body to more naturally adapt to the needs of the game without the need to create a large amount of specific animation.
[0119] Root Rotation Warping: In the game, the orientation of the root bones determines the character's orientation, so the character's turning process is the rotation of the root bones.
[0120] There are three sources for the orientation of the root bones: 1. The root bone in the pose of each frame of the animation, but the rotation value of the root bone in each frame of the animation is fixed. Generally, the rotation value provided by the animation is adapted to the target orientation by scaling.
[0121] 2. Curves: Curve assets pre-built by game designers. The principle is similar to the root skeleton rotation in animation, but they can be used independently of specific animation assets.
[0122] 3. Player input: Calculate the target orientation based on the player's input, and use methods such as rotation rate or rotation interpolation to turn the character from the current orientation to the target orientation.
[0123] Each animation state can be configured with the root bone's rotation source and twist method (clockwise, counterclockwise, shortest path).
[0124] Orientation adaptation is an animation technique that dynamically adjusts the character's root skeleton rotation (i.e., the rotation of the pelvis or waist) to make the character's movement direction consistent with the player's input direction or the game's logical target direction, while preserving the original posture and footwork of the currently playing animation to the greatest extent possible.
[0125] Orientation Warping: Dynamically modifies the rotation direction of the character's upper and lower body based on the character's movement input (input vector) without creating a large number of independent animations. For example, in a walking animation facing straight ahead, first rotate the lower body 45° to the right, and then rotate the upper body in the opposite direction layer by layer according to preset weights, ultimately resulting in a pose where the upper body faces straight ahead and the lower body walks to the right front.
[0126] Motion warp is an animation technique that dynamically modifies the motion trajectory of a character's root skeleton at runtime. It allows developers to override or adjust the displacements originally included in animation clips, enabling characters to adapt to changing environments at runtime without requiring extensive custom animation.
[0127] Motion Warping: Modifies the root motion trajectory of an animation sequence in real time using one or more warp points defined in the game. Root motion is the movement data embedded in the animation sequence that drives the character's actual displacement in the game world. The workflow of Motion Warping is as follows: 1. Define the target (Warp Target): In the game, determine a position and / or rotation that you want your character to reach. For example, the edge of a cliff (position), or a lever that needs to be grabbed (position and rotation).
[0128] 2. Setting Warp Points: In an animation sequence, select one or more keyframes as "anchor points." The two most common anchor points are: Start Point: The reference point from which the animation begins to warp (e.g., the frame where the feet leave the ground in a jumping animation).
[0129] End Point: The reference point where the animation ends and the distortion occurs (e.g., the frame where the feet land in a jump animation). The engine calculates the difference in displacement and rotation between the original start and end points in the animation.
[0130] 3. Real-time computation and distortion: When the animation is playing, the motion distortion system calculates the difference between the target point in the game and the original anchor point in the animation in real time.
[0131] Then, by dynamically adjusting the bone's displacement (and rotation), the entire root motion trajectory is distorted so that: The original animation's "starting point" is aligned with the defined "starting target position".
[0132] The original animation's "end point" precisely reaches the defined "end target position".
[0133] Essentially, it applies a real-time transformation matrix to the root motion data of the animation, matching its starting and ending points with the desired points, while the intermediate trajectory is automatically and smoothly interpolated by the system.
[0134] Animation warped frames refer to the animation frames obtained after performing animation warping on a target animation frame.
[0135] In practical applications, there is a correspondence between the target state and the animation distortion strategy. Once the target state is determined, the corresponding animation distortion strategy can be determined.
[0136] After determining the target animation frame, a preliminary pose is generated based on the target animation frame. The preliminary pose is then adjusted using an animation warping strategy to obtain the final pose. The animation warping frame is then determined based on the final pose.
[0137] By applying the solutions in the embodiments of this specification and adjusting the target animation frames through animation distortion strategies, the final posture and position of the virtual character can be kept in frame synchronization with the user input and the game environment, thereby improving local flexibility, adaptability, and intelligent response, and enhancing visual quality.
[0138] In another possible implementation of this specification, playing the target animation frame may include the following steps: Based on the control binding strategy, the target animation frame is processed to obtain the processed animation adjustment frame, and the processed animation adjustment frame is played. The control binding strategy is used to adjust the skeletal information of the target animation frame.
[0139] It should be noted that the control binding strategy is a set of control systems created for 3D character models. It includes a series of easy-to-operate controllers (usually simple graphics such as squares, circles, and arrows) and the complex logic behind them that drives the deformation of the character's skeleton.
[0140] Control binding is a visual scripting system that runs within the engine to drive the deformation of the Skeleton Mesh. It achieves procedural, dynamic, and real-time control of animation by creating a set of virtual "controllers" to manipulate the bones.
[0141] 1. Advanced Inverse Kinematics (IK) Used to build more complex and controllable IK systems than native IK nodes in animation blueprints.
[0142] Foot IK: Not only corrects foot position, but also dynamically adjusts ankle rotation according to the ground normal, and even adjusts toe flexion according to terrain undulations.
[0143] Look IK: Achieve smooth gaze along the head and spinal chain, and can add constraints and weights for a more natural effect.
[0144] Arm IK: Used for precise hand positioning, such as keeping the hand always on a wall or weapon.
[0145] 2. Animation Modifiers Control binding can be used as an "animation modifier" to batch process animation sequences during import or in the resource pipeline.
[0146] Batch fix bone rotation: Quickly fix incorrect rotation of a specific bone in all animations.
[0147] Add procedural jitters: Add procedural breathing or pain jitters to all idle or injured animations.
[0148] Automated equipment: Automatically adds certain controls or effects to a large number of animations.
[0149] 3. Dynamic animation and physical interaction Ragdoll Restoration: When a character switches from ragdoll state back to animated state, control binding is used to calculate how to most smoothly blend the distorted limb posture back to the animated posture, avoiding abrupt "teleportation".
[0150] Dynamic grasping: Based on the size, shape and position of the object, the placement of the hand and fingers is calculated in real time to achieve "one animation to adapt to multiple objects".
[0151] Rope / Tail Simulation: Adds physics-based secondary animations to whips, tails, long hair, etc., running entirely within the engine.
[0152] 4. Integration with other powerful functions Combine with motion distortion: Use control bindings to fine-tune the effects of motion distortion, such as ensuring a perfect foot landing after a distorted jump.
[0153] Combined with Deformers: Control rigging can drive bones, and bone-based deformers (such as muscle deformers) can then deform the mesh on top of that, creating extremely realistic effects.
[0154] Runtime use: Dynamically invoke control binding logic via C++ or Blueprints during game runtime to achieve fully dynamic animation generation.
[0155] In some procedural animation processing, such as footstep IK terrain adaptation, hand IK correction of grip posture, aiming deviation, hit animation, etc., control binding is used to improve the iteration efficiency of the final performance effect.
[0156] Animation adjustment frames refer to the animation frames obtained after controlling and binding the target animation frame.
[0157] In practical applications, after determining the target animation frame, a preliminary pose is generated based on the target animation frame. The preliminary pose is then adjusted by controlling the binding strategy to obtain the final pose. The animation adjustment frame is then determined based on the final pose.
[0158] By applying the solutions in the embodiments of this specification, the target animation frames are adjusted through a control binding strategy, achieving accurate local control, improving the fit between the adjusted animation frames and the environment in which the virtual character is located, automatically maintaining physical and biomechanical correctness, and improving animation quality.
[0159] The scheme described in this specification involves acquiring the current behavior data of a virtual character in its current state; responding to a state switching command, controlling the virtual character to switch from the current state to a target state; determining a target animation frame matching the current behavior data from the target animation resources of the target state, and playing the target animation frame. By responding promptly to changes in the virtual character's behavior through the state switching process, the animation response speed can be improved, and the requirements for the amount and quality of animation data are more flexible; determining the target animation frame from the target animation resources through data matching can enhance the animation transition effect; determining the target animation frame based on the current behavior data, without considering the predicted future trajectory, can make the animation style more prominent. The combination of state switching and target animation frame matching ensures both the quality of animation playback and improves the responsiveness of animation playback.
[0160] See Figure 2 , Figure 2 This specification illustrates a flowchart of a game animation playback method according to an embodiment, which specifically includes the following steps: Step 202: In each frame, based on the character's current behavior data and behavior control information, determine whether to perform a state switch.
[0161] Step 204: When a state switch is required, control the character to switch from the current state to the target state.
[0162] Step 206: If the target animation resource in the target state has a candidate feature set, determine the animation playback method as matching playback.
[0163] Step 208: If the target animation resource in the target state does not have a candidate feature set, determine that the animation playback method is sequential playback.
[0164] Step 210: When the animation playback mode is match playback, determine the feature to be matched based on the current behavior data, search for the target feature that matches the feature to be matched from the candidate feature set of the target animation resource, and determine the animation frame corresponding to the target feature in the target animation resource as the target animation frame.
[0165] Step 212: When the animation playback mode is sequential playback, determine the target animation frame based on the animation frame order of the target animation resource and the already played animation frames.
[0166] Step 214: Based on the animation distortion strategy, process the target animation frame to obtain the processed animation distortion frame, and play the processed animation distortion frame.
[0167] Step 216: Based on the control binding strategy, process the target animation frame to obtain the processed animation adjustment frame, and play the processed animation adjustment frame.
[0168] It should be noted that a customized motion matching framework was implemented on top of the UE5 native animation system to build a high-performance next-generation character animation system. This system will completely revolutionize the traditional animation state machine architecture, providing seamless, realistic, and extremely responsive AAA-level animation performance for the core movement logic through a data-driven approach.
[0169] By combining the two approaches of animation state machine and motion matching, the animation state machine is used to match player input (corresponding to behavior control information) and character movement state (corresponding to current behavior data), while trajectory prediction in motion matching is turned off and pose search in motion matching is retained, thereby improving the animation transition effect.
[0170] It offers a variety of customized animation distortion schemes, allowing designers to choose the appropriate distortion effect for different states, resulting in richer stylistic options.
[0171] To achieve precise interaction between animation and environment, deep integration of control binding technology is used to provide post-processing capabilities such as inverse kinematics ground adaptation and motion distortion.
[0172] The scheme implemented in this specification improves animation response speed by responding promptly to character behavior changes through state switching processes, and offers greater flexibility in terms of data volume and quality requirements. Determining the target animation frame from target animation resources through data matching enhances animation transition effects. Based on current behavior data, without considering predicted future trajectories, the target animation frame is determined, making the animation's stylistic features more prominent. The combination of state switching and target animation frame matching ensures both high-quality animation playback and improved responsiveness.
[0173] The above is an illustrative scheme of a game animation playback method according to this embodiment. It should be noted that the technical solution of this game animation playback method belongs to the same concept as the technical solution of the animation playback method described above. For details not described in detail in the technical solution of the game animation playback method, please refer to the description of the technical solution of the animation playback method described above.
[0174] The animation playback method proposed in the embodiments of this specification can be applied to, for example... Figure 3 The animation playback system shown is not limited to this. See also: Figure 3 , Figure 3 This specification illustrates an architecture diagram of an animation playback system according to one embodiment of the specification. The animation playback system may include a client 302 and a server 304. Client 302 is used to send the current behavior data of the virtual character in the current state to server 304; Server-side 304 is used to respond to state switching instructions, control the virtual character to switch from the current state to the target state; determine the target animation frame that matches the current behavior data from the target animation resources of the target state; and send the target animation frame to client 302. Client 302 is also used to receive the target animation frame sent by server 304 and play the target animation frame.
[0175] like Figure 3As shown, server 304 can connect to one or more clients 302 via a local area network (LAN), wide area network (WAN), internet connection, or other types of data network. Data transmitted by client 302 may require encoding, transcoding, compression, or other processing before being published to server 304. Client 302 can also interact with the user through a graphical user interface to invoke the server, thereby implementing the animation playback method provided in this embodiment. Multiple clients 302 can establish communication connections through server 304. In the animation playback scenario, server 304 provides animation playback services between multiple clients 302. Multiple clients 302 can act as senders or receivers, communicating through server 304. Users can interact with server 304 through client 302 to receive data sent by other clients 302, or send data to other clients 302, etc. In an animation playback scenario, a user can send an animation playback request to the server 304 via client 302. The server 304 determines the target animation frame based on the animation playback request and pushes the target animation frame to other clients that have established communication.
[0176] Client 302 can be a browser, application (APP), or web application such as HyperText Markup Language 5 (H5) application, or a lightweight application (also known as a mini-program), or cloud application, etc. Client 302 can be developed based on the software development kit (SDK) of the corresponding service provided by server 304, such as based on the Real-Time Communication (RTC) SDK. Client 302 can be deployed in electronic devices and depends on the device to run or on certain APPs on the device. Electronic devices may have a display screen and support information browsing, such as personal mobile terminals such as mobile phones, tablets, and personal computers (PCs). Various other types of applications can also be configured in electronic devices, such as human-computer interaction applications, model training applications, text processing applications, web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.
[0177] Server-side 304 can include servers providing various services, such as servers providing communication services to multiple clients, servers supporting backend training of models used on clients, and servers processing data sent by clients. It should be noted that server-side 304 can be implemented as a distributed server cluster composed of multiple servers, or as a single server. The server can also be a server in a distributed system, or a server integrated with blockchain. The server can also be 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, content delivery networks (CDNs), and big data and artificial intelligence platforms, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology.
[0178] It is worth noting that the animation playback method provided in the embodiments of this specification is generally executed by the server. However, in other embodiments of this specification, if the client's runtime resources are sufficient for animation playback, the client can also have similar functionality to the server, thereby executing the animation playback method provided in the embodiments of this specification. In other embodiments, the animation playback method provided in the embodiments of this specification can also be executed jointly by the client and the server.
[0179] Corresponding to the above embodiments of the animation playback method, this specification also provides embodiments of the animation playback device. Figure 4 A schematic diagram of an animation playback device according to one embodiment of this specification is shown. Figure 4 As shown, the device includes: The acquisition module 402 is configured to acquire the current behavior data of the virtual character in the current state; Switching module 404 is configured to control the virtual character to switch from the current state to the target state in response to a state switching command; The playback module 406 is configured to determine the target animation frame that matches the current behavior data from the target animation resources of the target state, and play the target animation frame.
[0180] Optionally, the playback module 406 is also configured to determine the animation playback method based on the target animation resource; and when the animation playback method is matching playback, to determine the target animation frame that matches the current behavior data from the target animation resource.
[0181] Optionally, the playback module 406 is also configured to determine the target animation frame based on the animation frame order of the target animation resource and the already played animation frames when the animation playback mode is sequential playback.
[0182] Optionally, the playback module 406 is further configured to determine the animation playback mode as matching playback when the target animation resource has a candidate feature set, wherein the candidate feature set is used to search for the target animation resource; and to determine the animation playback mode as sequential playback when the target animation resource does not have a candidate feature set.
[0183] Optionally, the playback module 406 is also configured to determine the feature to be matched based on the current behavior data; search for the target feature that matches the feature to be matched from the candidate feature set of the target animation resource; and determine the animation frame corresponding to the target feature in the target animation resource as the target animation frame.
[0184] Optionally, the switching module 404 is also configured to acquire behavior control information for the virtual character; and based on the behavior control information and current behavior data, determine whether to generate a state switching instruction.
[0185] Optionally, the playback module 406 is further configured to determine an animation distortion strategy based on the target state, wherein the animation distortion strategy includes at least one of root bone rotation distortion, orientation adaptation, and motion distortion; based on the animation distortion strategy, the target animation frame is processed to obtain a processed animation distortion frame, and the processed animation distortion frame is played.
[0186] Optionally, the playback module 406 is also configured to process the target animation frame based on a control binding strategy to obtain a processed animation adjustment frame and play the processed animation adjustment frame, wherein the control binding strategy is used to adjust the skeletal information of the target animation frame.
[0187] The scheme implemented in this specification improves animation response speed by responding promptly to changes in the virtual character's behavior through state switching, and offers greater flexibility in terms of data volume and quality requirements. Determining the target animation frame from target animation resources through data matching enhances animation transition effects. Based on current behavior data, without considering predicted future trajectories, the target animation frame is determined, making the animation's stylistic features more prominent. The combination of state switching and target animation frame matching ensures both high-quality animation playback and improved responsiveness.
[0188] The above is an illustrative scheme of an animation playback device according to this embodiment. It should be noted that the technical solution of this animation playback device and the technical solution of the above-described animation playback method belong to the same concept. For details not described in detail in the technical solution of the animation playback device, please refer to the description of the technical solution of the above-described animation playback method.
[0189] Figure 5A structural block diagram of a computing device according to one embodiment of this specification is shown. The components of the computing device 500 include, but are not limited to, a memory 510 and a processor 520. The processor 520 is connected to the memory 510 via a bus 530, and a database 550 is used to store data.
[0190] The computing device 500 also includes an access device 540, which enables the computing device 500 to communicate via one or more networks 560. Examples of these networks include Public Switched Telephone Network (PSTN), Local Area Network (LAN), Wide Area Network (WAN), Personal Area Network (PAN), or combinations of communication networks such as the Internet. The access device 540 may include one or more of any type of wired or wireless network interface (e.g., Network Interface Card (NIC)), such as an IEEE 802.11 Wireless Local Area Networks (WLAN) interface, a Wi-MAX (World Interoperability for Microwave Access) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, a Near Field Communication (NFC) interface, and so on.
[0191] In one embodiment of this specification, the above-described components of the computing device 500 and Figure 5 Other components, not shown, can also be connected to each other, for example, via a bus. It should be understood that... Figure 5 The block diagram of the computing device shown is for illustrative purposes only and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.
[0192] The computing device 500 can be any type of stationary or mobile computing device, including mobile computers or mobile computing devices (e.g., tablet computers, personal digital assistants, laptop computers, notebook computers, netbooks, etc.), mobile phones (e.g., smartphones), wearable computing devices (e.g., smartwatches, smart glasses, etc.) or other types of mobile devices, or stationary computing devices such as desktop computers or personal computers. The computing device 500 can also be a mobile or stationary server.
[0193] The processor 520 is used to execute computer programs / instructions, which, when executed by the processor, implement the steps of the above-described animation playback method.
[0194] The above is an illustrative scheme of a computing device according to this embodiment. It should be noted that the technical solution of this computing device and the technical solution of the above-described animation playback method belong to the same concept. For details not described in detail in the technical solution of the computing device, please refer to the description of the technical solution of the above-described animation playback method.
[0195] An embodiment of this specification also provides a computer-readable storage medium storing a computer program / instructions that, when executed by a processor, implement the steps of the above-described animation playback method.
[0196] The above is an illustrative embodiment of a computer-readable storage medium. It should be noted that the technical solution of this storage medium and the technical solution of the above-described animation playback method belong to the same concept. Details not described in detail in the technical solution of the storage medium can be found in the description of the technical solution of the above-described animation playback method.
[0197] An embodiment of this specification also provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the steps of the above-described animation playback method.
[0198] The above is an illustrative scheme of a computer program product according to this embodiment. It should be noted that the technical solution of this computer program product and the technical solution of the above-described animation playback method belong to the same concept. For details not described in detail in the technical solution of the computer program product, please refer to the description of the technical solution of the above-described animation playback method.
[0199] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0200] Computer instructions include computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. Computer-readable media can include: any entity or device capable of carrying computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in computer-readable media can be appropriately added or removed according to the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media do not include electrical carrier signals and telecommunication signals.
[0201] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments in this specification are not limited to the described order of actions, because according to the embodiments in this specification, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the embodiments in this specification.
[0202] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0203] The preferred embodiments disclosed above are merely illustrative of this specification. The optional embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the embodiments described herein. These embodiments are selected and specifically described in this specification to better explain the principles and practical applications of the embodiments, thereby enabling those skilled in the art to better understand and utilize this specification. This specification is limited only by the claims and their full scope and equivalents.
Claims
1. An animation playback method, characterized in that, include: Obtain the current behavior data of the virtual character in its current state; In response to a state switching command, the virtual character is controlled to switch from the current state to the target state; Determine the target animation frame that matches the current behavior data from the target animation resources of the target state, and play the target animation frame.
2. The method according to claim 1, characterized in that, Determining the target animation frame that matches the current behavior data from the target animation resources of the target state includes: Based on the target animation resource, determine the animation playback method; When the animation playback mode is set to match playback, a target animation frame that matches the current behavior data is determined from the target animation resource.
3. The method according to claim 2, characterized in that, Also includes: When the animation playback mode is sequential playback, the target animation frame is determined based on the animation frame order of the target animation resource and the already played animation frames.
4. The method according to claim 2 or 3, characterized in that, The step of determining the animation playback method based on the target animation resource includes: If the target animation resource has a candidate feature set, the animation playback method is determined to be matching playback, wherein the candidate feature set is used to search for the target animation resource; If the target animation resource does not have the candidate feature set, the animation playback mode is determined to be sequential playback.
5. The method according to any one of claims 1 to 3, characterized in that, Determining the target animation frame that matches the current behavior data from the target animation resources of the target state includes: Based on the current behavior data, determine the features to be matched; Search for target features that match the feature to be matched from the candidate feature set of the target animation resource; The animation frame corresponding to the target feature in the target animation resource is determined as the target animation frame.
6. The method according to any one of claims 1 to 3, characterized in that, Before controlling the virtual character to switch from the current state to the target state in response to the state switching command, the method further includes: Obtain behavioral control information for the virtual character; Based on the behavior control information and the current behavior data, determine whether to generate a state switching instruction.
7. The method according to any one of claims 1 to 3, characterized in that, Playing the target animation frame includes: Based on the target state, an animation warping strategy is determined, wherein the animation warping strategy includes at least one of root bone rotation warping, orientation adaptation, and motion warping; Based on the animation distortion strategy, the target animation frame is processed to obtain a processed animation distortion frame, and the processed animation distortion frame is played.
8. The method according to any one of claims 1 to 3, characterized in that, Playing the target animation frame includes: Based on the control binding strategy, the target animation frame is processed to obtain the processed animation adjustment frame, and the processed animation adjustment frame is played. The control binding strategy is used to adjust the skeletal information of the target animation frame.
9. An animation playback device, characterized in that, include: The acquisition module is configured to acquire the current behavior data of the virtual character in the current state; The switching module is configured to control the virtual character to switch from the current state to the target state in response to a state switching command; The playback module is configured to determine a target animation frame that matches the current behavior data from the target animation resources of the target state, and play the target animation frame.
10. A computing device, characterized in that, include: Memory and processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions, which, when executed by the processor, implement the steps of the method according to any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that, It stores a computer program / instructions that, when executed by a processor, implement the steps of the method described in any one of claims 1 to 8.
12. A computer program product, characterized in that, Includes a computer program / instructions that, when executed by a processor, implement the steps of the method according to any one of claims 1 to 8.