Animation generation method and device, storage medium and computer equipment

By receiving motion data from the game client and generating animations using state machines and spatial blending techniques, the problem of stiff movement in quadrupedal animals was solved, improving the coherence and realism of the animations.

CN115546367BActive Publication Date: 2026-05-05BEIJING PERFECT WORLD SOFTWARE TECH DEV CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING PERFECT WORLD SOFTWARE TECH DEV CO LTD
Filing Date
2021-06-29
Publication Date
2026-05-05

AI Technical Summary

Technical Problem

In existing technology, the movement of quadrupedal animals in games is stiff and the action transitions are not smooth, resulting in unrealistic animation effects. In particular, the body posture is stiff and the feet slide significantly when moving in curves and turning.

Method used

By receiving motion data of the target virtual object from the game client, simulating motion trajectory and speed using a state machine, mixing motion parameters and rotational angular velocity, generating animations that conform to motion characteristics, and using spatial blending technology to create motion animations that simulate the spinal movement morphology of soft-vertebrae tetrapods.

Benefits of technology

It improves the expressiveness, fluidity, and realism of quadrupedal movements, solves the problem of stiff movements, and ensures natural and smooth animation effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115546367B_ABST
    Figure CN115546367B_ABST
Patent Text Reader

Abstract

The application discloses an animation generation method and device, a storage medium and a computer device. The method comprises the following steps: receiving motion data of a target virtual object, and simulating a motion trajectory and a motion speed of the target virtual object according to the motion data, wherein the target virtual object comprises a soft-spine quadruped; in a first state machine of the target virtual object, determining a to-be-mixed motion state matched with the motion speed and a corresponding first to-be-mixed action; determining a mixing parameter of the first to-be-mixed action and a rotation angular speed of the target virtual object according to the motion speed, mixing the first to-be-mixed action based on the mixing parameter, and generating a first motion action; and generating a target motion animation of the target virtual object on the motion trajectory according to the motion trajectory, the motion speed, the rotation angular speed and the first motion action.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of animation production technology, and in particular to an animation generation method and apparatus, storage medium, and computer equipment. Background Technology

[0002] In typical online games, the method for implementing the turning and movement of quadrupedal animals, such as horses, involves rotating the model on the client side at a reference point and aligning the motion coordinates with the orientation and position of that reference point. However, the movement of quadrupedal vertebrates, especially during curved movements and turns, is consistently stiff. This results in unsmooth animations, frame skipping, and the horse's forward-facing posture causing slippage and unrealistic visual glitches. Summary of the Invention

[0003] In view of this, this application provides an animation generation method and apparatus, storage medium, and computer equipment, which helps to improve the movement performance of soft-vertebrate quadrupedal animals in games.

[0004] According to one aspect of this application, an animation generation method is provided, applied to a game client, comprising:

[0005] The motion data of a target virtual object is received, and the motion trajectory and speed of the target virtual object are simulated based on the motion data, wherein the target virtual object includes a soft-vertebrate tetrapod.

[0006] In the first state machine of the target virtual object, a motion state to be mixed and its corresponding first action to be mixed are determined to match the motion speed. The first state machine includes the action of the target virtual object in multiple states, a preset motion speed and a preset tilt angle. The action includes a spinal action for displaying the spinal movement morphology of the soft-vertebrate tetrapod.

[0007] Based on the movement speed, the mixing parameters of the first action to be mixed and the rotational angular velocity of the target virtual object are determined, and the first action to be mixed is mixed based on the mixing parameters to generate a first motion action. The first motion action includes a spinal motion action for displaying the spinal movement morphology of the soft-vertebrate tetrapod.

[0008] Based on the motion trajectory, the motion speed, the rotational angular velocity, and the first motion action, generate a target motion animation of the target virtual object on the motion trajectory.

[0009] Optionally, the target virtual object includes a non-player character; the step of simulating the movement trajectory and speed of the target virtual object based on the motion data specifically includes:

[0010] If the motion data indicates that the target virtual object is to move continuously, then the first motion trajectory of the target virtual object is fitted according to the start and end positions corresponding to the motion data, and the uniform motion speed corresponding to the first motion trajectory is calculated as the first motion speed according to the length of the first motion trajectory and the motion duration.

[0011] If the motion data indicates that the target virtual object is performing intermittent motion, the motion data is divided into multiple groups according to the stopping position of the target virtual object. Multiple segments of the second motion trajectory of the target virtual object are fitted according to the start and end positions of the multiple groups of motion data to determine the actual travel time of the second motion trajectory. Based on the length of the second motion trajectory and the actual travel time, the second motion speed of the second motion trajectory is calculated.

[0012] Optionally, if the motion data indicates that the target virtual object is performing a continuous and directional motion, then the first motion trajectory includes a Bézier curve.

[0013] Optionally, generating the target motion animation of the target virtual object on the motion trajectory according to the motion trajectory, the motion speed, the rotational angular velocity, and the first motion action specifically includes:

[0014] After rotating the target virtual object model according to the rotation angular velocity, the first motion action is added, and the target virtual object model is controlled to move on the motion trajectory at the motion speed to generate the target motion animation.

[0015] Optionally, when the target virtual object is an interpenetrable object, before generating the target motion animation of the target virtual object on the motion trajectory according to the motion trajectory, the motion speed, the rotational angular velocity, and the first motion action, the method further includes:

[0016] Determine the target interleaving object corresponding to the target virtual object, wherein the target virtual object includes a mount, and the target interleaving object includes a game character riding a mount;

[0017] In the second state machine of the target interpenetrating object, the second action to be mixed corresponding to the first action to be mixed is obtained, and the second action to be mixed is mixed according to the mixing parameters to obtain the second motion action corresponding to the motion trajectory. The second state machine includes the action and motion speed of the target interpenetrating object in the multiple states, including standing state, starting state, moving state and stopping state. The second state machine matches the first state machine.

[0018] Accordingly, generating the target motion animation of the target virtual object on the motion trajectory according to the motion trajectory, the motion speed, the rotational angular velocity, and the first motion action specifically includes:

[0019] After synchronously rotating the target virtual object model and the target interpenetrating object model according to the rotation angular velocity, the first motion action is added to the target virtual object model and the second motion action is added to the target interpenetrating object model. The target virtual object model and the target interpenetrating object model are controlled to move synchronously on the motion trajectory at the motion speed, and the target motion animation of the target virtual object and the target interpenetrating object on the motion trajectory is generated frame by frame.

[0020] Optionally, the method further includes:

[0021] In response to motion control data of the first player character, a first motion animation of the first player character is generated, and the first real-time motion synchronization data corresponding to the first player character is determined;

[0022] The first real-time motion synchronization data is sent to the game server so that the game server updates the motion data of the first player character based on the first real-time motion synchronization data and forwards the first real-time motion synchronization data to the associated client.

[0023] Optionally, the method further includes:

[0024] Receive second real-time motion synchronization data of the second player character sent by the game server, wherein the second real-time motion synchronization data is determined based on the motion control data of the second player character in the associated client;

[0025] Based on the second real-time motion synchronization data, the displacement data of the second player character is determined, and based on the displacement data, the third action to be mixed and the corresponding synchronization mixing parameters are determined in the third state machine of the second player character;

[0026] The third motion is obtained by mixing the third motion according to the synchronous mixing parameters, and the second motion animation of the second player character is generated based on the displacement data and the third motion.

[0027] According to another aspect of this application, an animation generation apparatus is provided for use in a game client, comprising:

[0028] A motion simulation module is used to receive motion data of a target virtual object and simulate the motion trajectory and speed of the target virtual object based on the motion data, wherein the target virtual object includes a soft-vertebrate tetrapod.

[0029] The motion extraction module is used to determine, in the first state machine of the target virtual object, a motion state to be mixed and its corresponding first motion to be mixed that matches the motion speed. The first state machine includes the motion of the target virtual object in multiple states, a preset motion speed and a preset tilt angle. The motion includes spinal motion for displaying the spinal movement morphology of the soft-vertebrate tetrapod.

[0030] The motion mixing module is used to determine the mixing parameters of the first motion to be mixed and the rotational angular velocity of the target virtual object based on the motion speed, and to mix the first motion to be mixed based on the mixing parameters to generate a first motion action. The first motion action includes a spinal motion action for displaying the spinal movement morphology of the soft-vertebrate tetrapod.

[0031] An animation generation module is used to generate a target motion animation of the target virtual object on the motion trajectory according to the motion trajectory, the motion speed, the rotational angular velocity, and the first motion action.

[0032] Optionally, the target virtual object includes a non-player character; the motion simulation module is specifically used for:

[0033] If the motion data indicates that the target virtual object is to move continuously, then the first motion trajectory of the target virtual object is fitted according to the start and end positions corresponding to the motion data, and the uniform motion speed corresponding to the first motion trajectory is calculated as the first motion speed according to the length of the first motion trajectory and the motion duration.

[0034] If the motion data indicates that the target virtual object is performing intermittent motion, the motion data is divided into multiple groups according to the stopping position of the target virtual object. Multiple segments of the second motion trajectory of the target virtual object are fitted according to the start and end positions of the multiple groups of motion data to determine the actual travel time of the second motion trajectory. Based on the length of the second motion trajectory and the actual travel time, the second motion speed of the second motion trajectory is calculated.

[0035] Optionally, if the motion data indicates that the target virtual object is performing a continuous and directional motion, then the first motion trajectory includes a Bézier curve.

[0036] Optionally, the animation generation module is specifically used for:

[0037] After rotating the target virtual object model according to the rotation angular velocity, the first motion action is added, and the target virtual object model is controlled to move on the motion trajectory at the motion speed to generate the target motion animation.

[0038] Optionally, when the target virtual object is an interleaved object, the motion mixing module is further configured to: before generating the target motion animation of the target virtual object on the motion trajectory according to the motion trajectory, the motion speed, the rotational angular velocity, and the first motion action, determine the target interleaved object corresponding to the target virtual object, wherein the target virtual object includes a mount, and the target interleaved object includes a game character riding a mount; in the second state machine of the target interleaved object, obtain the second action to be mixed corresponding to the first action to be mixed, and mix the second action to be mixed according to the mixing parameters to obtain the second motion action corresponding to the motion trajectory, wherein the second state machine includes the action and motion speed of the target interleaved object in multiple states, the multiple states including standing state, starting state, moving state, and stopping state, and the second state machine matches the first state machine;

[0039] Accordingly, the animation generation module is specifically used to: synchronously rotate the target virtual object model and the target interpenetrating object model according to the rotation angular velocity, add the first motion action to the target virtual object model and add the second motion action to the target interpenetrating object model, and control the target virtual object model and the target interpenetrating object model to move synchronously on the motion trajectory according to the motion speed, and generate the target motion animation of the target virtual object and the target interpenetrating object on the motion trajectory frame by frame.

[0040] Optionally, the device further includes:

[0041] The data generation module is used to generate a first motion animation of the first player character in response to motion control data of the first player character, and to determine the first real-time motion synchronization data corresponding to the first player character.

[0042] The data sending module is used to send the first real-time motion synchronization data to the game server, so that the game server updates the motion data of the first player character based on the first real-time motion synchronization data, and forwards the first real-time motion synchronization data to the associated client.

[0043] Optionally, the data receiving module is further configured to receive second real-time motion synchronization data of the second player character sent by the game server, wherein the second real-time motion synchronization data is determined based on the motion control data of the second player character in the associated client;

[0044] The animation generation module is further configured to determine the displacement data of the second player character based on the second real-time motion synchronization data, and determine the third action to be mixed and the corresponding synchronization mixing parameters in the third state machine of the second player character based on the displacement data; mix the third action to be mixed according to the synchronization mixing parameters to obtain the third motion action, and generate the second motion animation of the second player character based on the displacement data and the third motion action.

[0045] According to another aspect of this application, a storage medium is provided that stores a computer program thereon, which, when executed by a processor, implements the above-described animation generation method.

[0046] According to another aspect of this application, a computer device is provided, including a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein the processor executes the program to implement the above-described animation generation method.

[0047] By employing the above technical solutions, this application provides an animation generation method, apparatus, storage medium, and computer device. When the server controls the movement of a target virtual object in a game, it sends motion data to the game client. The client simulates the movement trajectory and speed of the target virtual character based on the motion data. Then, according to the movement speed, it obtains the action to be mixed in the pre-constructed first state machine of the target virtual object, and determines the mixing parameters and rotational angular velocity based on the movement speed and trajectory. The action is mixed according to the mixing parameters to obtain the first motion action. Thus, the target virtual object is displaced according to the rotational angular velocity, movement trajectory, and movement speed, and the target virtual object is motion-controlled according to the first motion action to generate the target motion animation corresponding to the target virtual object. The embodiments of this application utilize the actions in each state of the state machine to create the motion animation of the target virtual object through spatial mixing, thereby simulating the spinal movement of a soft-vertebrate quadruped in different movement states. This solves the problem of stiff and unrealistic movement performance of soft-vertebrate quadrupeds in the prior art, ensuring the motion animation effect of the target virtual object.

[0048] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description

[0049] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0050] Figure 1 A flowchart illustrating an animation generation method provided in an embodiment of this application is shown;

[0051] Figure 2 A flowchart illustrating another animation generation method provided in an embodiment of this application is shown;

[0052] Figure 3 A schematic diagram of the structure of an animation generation device provided in an embodiment of this application is shown. Detailed Implementation

[0053] The present application will be described in detail below with reference to the accompanying drawings and embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in the embodiments of the present application can be combined with each other.

[0054] This embodiment provides an animation generation method, such as Figure 1 As shown, the method includes:

[0055] Step 101: Receive motion data of the target virtual object, and simulate the motion trajectory and speed of the target virtual object based on the motion data, wherein the target virtual object includes a soft-vertebrate tetrapod.

[0056] Step 102: In the first state machine of the target virtual object, determine the motion state to be mixed and its corresponding first motion to be mixed that matches the motion speed. The first state machine includes the motion of the target virtual object in multiple states, a preset motion speed and a preset tilt angle. The motion includes spinal motion for displaying the spinal movement morphology of the soft-vertebrate tetrapod.

[0057] Step 103: Based on the movement speed, determine the mixing parameters of the first action to be mixed and the rotational angular velocity of the target virtual object, and mix the first action to be mixed based on the mixing parameters to generate a first motion action. The first motion action includes a spinal motion action for displaying the spinal movement morphology of the soft-vertebrate tetrapod.

[0058] Step 104: Generate a target motion animation of the target virtual object on the motion trajectory according to the motion trajectory, the motion speed, the rotational angular velocity and the first motion action.

[0059] This application embodiment is mainly applied to a game client running a game program. The game client can receive motion data of a target virtual object from the game server. The target virtual object can be a non-player character NPC in the game world, specifically a quadrupedal animal with a soft spine, such as a horse or sheep. The motion data can specifically include the target virtual object's starting position, ending position, direction of movement, stationary position, total duration of movement, etc.

[0060] After receiving the motion data, the client first simulates the motion trajectory of the target virtual object based on the motion data. For example, if the NPC moves in a straight line without stopping or with a turn, the NPC's motion trajectory can be divided into one segment. Or, if the NPC pauses during its movement, the NPC's motion trajectory can be divided into multiple segments, including the motion trajectory of the NPC standing still without displacement. After simulating the motion trajectory, the client can also calculate the motion speed of the target virtual character based on the total motion time, trajectory length, and dwell time. Since the game server simulates the target virtual character as uniform linear motion, the game client can simulate the target virtual character's motion as uniform motion to achieve higher synchronization between the target virtual character's position on the client and server.

[0061] Next, to improve the animation expressiveness of the target virtual character and make its movements more coherent and vivid, this application adopts a mixed space approach. It utilizes the movements of the target virtual character in multiple states within an existing state machine to mix them, resulting in motion animations of the target virtual character at different states and speeds. In a specific application scenario, taking a horse or other soft-vertebrated quadrupedal animal as an example, a first state machine is pre-constructed for the horse. This first state machine includes four stages of movement: standing still, starting and turning, moving, and stopping and braking. Each stage of movement can demonstrate the movement pattern of the horse's spine in each state. For example, when starting, the horse exhibits a left-right turning motion; when moving, it exhibits a directional and tilting angle motion based on its speed and direction. After calculating the movement speed, a first action to be mixed that matches the movement speed can be obtained from the first state machine. For example, if the movement speed is within the normal walking speed range of the horse, the movement state action can be obtained as the first action to be mixed. Then, the first action to be mixed is spatially mixed according to the movement speed. Additionally, the rotational angular velocity of the target virtual object can be determined based on the movement speed and trajectory. Therefore, when generating the animation, the model's movements are superimposed while rotating, creating a turning effect. For example, in the starting state of a horse, a one-dimensional blended space is used to represent the effect of the horse turning left and right when starting. In the moving state and braking state of the horse, a two-dimensional blended space is used to create the corresponding actions under different moving speeds and directions, so as to obtain a more realistic movement effect and avoid stiff movement performance.

[0062] Finally, based on the aforementioned motion trajectory, speed, rotational angular velocity, and the pre-created first motion action, the motion animation of the target virtual object is generated. Specifically, the animation and displacement can be controlled separately. The displacement and orientation of the target virtual object are controlled based on the rotational angular velocity, motion trajectory, and speed, while the animation performance of the target virtual object is controlled based on the first motion action. Simulating the motion trajectory and speed of the target virtual object helps improve the synchronization of the real-time displacement of the target virtual object between the client and server. Creating the motion animation of the target virtual object through spatial blending helps enhance its expressiveness.

[0063] By applying the technical solution of this embodiment, when the server controls the movement of a target virtual object in the game, it sends motion data to the game client. The client simulates the movement trajectory and speed of the target virtual character based on the motion data. Then, according to the movement speed, it obtains the action to be mixed in the pre-constructed first state machine of the target virtual object, and determines the mixing parameters and rotational angular velocity based on the movement speed and trajectory. The action is mixed according to the mixing parameters to obtain the first motion action. Thus, the target virtual object is displaced according to the rotational angular velocity, movement trajectory, and movement speed, and the target virtual object is motion controlled according to the first motion action, generating the target motion animation corresponding to the target virtual object. This embodiment of the application utilizes the actions in each state of the state machine to create the motion animation of the target virtual object through spatial mixing, simulating the spinal movement of a soft-vertebrate quadruped in different movement states. This solves the problem of stiff and unrealistic movement performance of soft-vertebrate quadrupeds in the prior art, ensuring the motion animation effect of the target virtual object.

[0064] Furthermore, as a refinement and extension of the specific implementation of the above embodiments, and to fully illustrate the specific implementation process of this embodiment, another animation generation method is provided, such as... Figure 2 As shown, the method includes:

[0065] Step 201: Receive motion data of the target virtual object, and simulate the motion trajectory and speed of the target virtual object based on the motion data, wherein the target virtual object includes a soft-vertebrate tetrapod.

[0066] Optionally, step 201, "simulating the motion trajectory and speed of the target virtual object based on the motion data," may specifically include:

[0067] Step 201-1: If the motion data indicates that the target virtual object is moving continuously, then fit the first motion trajectory of the target virtual object according to the start and end positions corresponding to the motion data, and calculate the uniform motion speed corresponding to the first motion trajectory as the first motion speed according to the length of the first motion trajectory and the motion duration.

[0068] Step 201-2: If the motion data indicates that the target virtual object is performing intermittent motion, the motion data is divided into multiple groups according to the stopping position of the target virtual object. Multiple segments of the second motion trajectory of the target virtual object are fitted according to the start and end positions of the multiple groups of motion data to determine the actual travel time of the second motion trajectory. Based on the length of the second motion trajectory and the actual travel time, the second motion speed of the second motion trajectory is calculated.

[0069] In the above embodiment, taking the target virtual character as an NPC as an example, the NPC's movement is a point-to-point uniform linear motion initiated by the server. However, according to the design requirements, the NPC's movement on the client can exhibit pauses and turns. Since the server moves in a point-to-point uniform linear motion and abruptly turns without turning time, the client needs to generate speed changes when turning to achieve a natural and realistic effect. This leads to a strict mismatch between the server and client positions. Therefore, the client fits the walking path to achieve an acceptable error. Since the game server controls the NPC's displacement by simulating the NPC's movement as a point-to-point uniform linear motion, when simulating the NPC's movement on the client, for continuous, uninterrupted movement, the NPC can be simulated as uniform motion to keep the real-time positions of the NPC on the client and server as close as possible. For movements with pauses, the NPC can move at a uniform speed, or accelerate and then return to a uniform speed after a pause. For turns, a smooth turning effect can be simulated. In addition, the movement trajectory should be simulated before calculating the movement speed.

[0070] In specific application scenarios, if the motion data does not contain data indicating pauses or stop times, meaning the motion data instructs the target virtual object to move continuously without stopping, then the trajectory of the NPC's movement can be simulated using the start and end positions (start and end positions) in the motion data to obtain the first motion trajectory. Optionally, if the motion data instructs the target virtual object to move continuously with turns, meaning the NPC moves forward without stopping and with turns, then the NPC's movement trajectory is fitted with a Bézier curve, and the NPC is simulated as moving at a constant speed. Based on the total motion time and the total distance of the first motion trajectory, the average speed is calculated as the first motion speed. Conversely, if the motion data instructs the target virtual object to move continuously without turns, meaning the NPC moves forward in a straight line without stopping, then the first motion trajectory is directly fitted as a straight line, and the average speed is calculated as the first motion speed.

[0071] If the motion data includes pauses (turning positions), dwell times, and other data indicating pauses in the NPC's movement—meaning the motion data instructs the target virtual object to perform paused movements—then the motion data can be divided into multiple groups. For example, if the NPC moves a distance S1, pauses at a resting position M for a period of time, and then moves another distance S2, the motion data can be divided into three groups: data for moving S1, data for pausing at point M, and data for moving S2. Then, based on multiple groups of motion data, trajectory fitting is performed to obtain multiple segments of sequentially connected second motion trajectories. The second motion speed of the target virtual character on each segment of the second motion trajectory is calculated. Specifically, the actual travel time corresponding to each segment of the second motion trajectory is calculated based on the total motion time and dwell time (turning time). Then, the NPC is simulated to move at a constant speed or accelerate first and then move at a constant speed on each segment of the second motion trajectory to obtain the second motion speed.

[0072] In addition, for certain essential precision points (such as points that trigger game quests), after fitting the motion trajectory, it should be determined whether the distance between these essential precision points and the fitted motion trajectory is within a reasonable range. If there are essential precision points that deviate significantly from the fitted motion trajectory, the motion trajectory can be adjusted based on the relationship between the motion trajectory and the corresponding point. This allows the NPC to stop and adjust its angle after reaching the corresponding point and recalculate its movement speed, ensuring that the game character can reach an orientation and angle approximately similar to the essential precision point. This guarantees a high degree of consistency between the NPC's real-time position on the client and server, while also making the motion trajectory smoother and more coherent. Furthermore, for the animation portion, the NPC's pauses and turns at essential precision points can be generated naturally and seamlessly by interpolating and fusing the actions corresponding to the motion trajectory before and after the point.

[0073] Step 202: In the first state machine of the target virtual object, determine the motion state to be mixed and its corresponding first action to be mixed that matches the motion speed. The first state machine includes the action of the target virtual object in multiple states, a preset motion speed and a preset tilt angle.

[0074] Step 203: Based on the motion speed, determine the mixing parameters of the first motion to be mixed and the rotational angular velocity of the target virtual object, and mix the first motion to be mixed based on the mixing parameters to generate the first motion.

[0075] In the above embodiments, a first action to be mixed that matches the movement speed is obtained in the first state machine. For example, if the movement speed is within the normal walking speed range of a horse, the movement state action can be obtained as the first action to be mixed. Then, the first action to be mixed is spatially mixed according to the movement speed. For example, in the starting state of the horse, a one-dimensional mixing space is used to represent the effect of the horse turning left and right when starting. In the moving state and braking state of the horse, actions corresponding to different movement speeds and directions are created through a two-dimensional mixing space.

[0076] Step 204: If the target virtual object is an interpenetrable object, determine the target interpenetrating object corresponding to the target virtual object, wherein the target virtual object includes a mount, and the target interpenetrating object includes a game character riding a mount; in the second state machine of the target interpenetrating object, obtain the second action to be mixed corresponding to the first action to be mixed, and mix the second action to be mixed according to the mixing parameters to obtain the second motion action corresponding to the motion trajectory, wherein the second state machine includes the action and motion speed of the target interpenetrating object in the various states, the various states include standing state, starting state, moving state and stopping state, and the second state machine matches the first state machine;

[0077] In the above embodiments, the target virtual object can be a mount in a game, carrying passengers (intercalable objects) to move together. When the target virtual object corresponds to a target intercalable object, such as a person riding a horse, it is necessary to create not only the horse's motion animation but also the person's motion animation. In specific application scenarios, animation can be created using the actions in the second state machine of the pre-built target intercalable object. A state machine matching the mount's structure is pre-built. When configuring the person's state machine, all animations and blending spaces use the Sync node, specifying the corresponding mount animation, and there is no need to enter the animation condition, ensuring complete synchronization between the person's and horse's animations. Even after the person performs various other custom actions on horseback, the data is synchronized when returning to the normal state machine. Specifically, in the second state machine, the second action to be blended, corresponding to the first action to be blended, is obtained, and the second action to be blended is blended according to the same blending parameters as the first action to be blended, resulting in the second motion action of the target intercalable object. In order to produce the riding animation of the human at the same time, the number of animation frames and the duration must correspond one-to-one (strictly correspond). Simply put, the animation of the human and the horse are produced together, but during the animation export process, they are sent to the engine as two independent entities, and then the corresponding actions are played at the same time to achieve the effect of matching the movements of the human and the horse.

[0078] Step 205: After synchronously rotating the target virtual object model and the target interpenetrating object model according to the rotation angular velocity, add the first motion action to the target virtual object model and add the second motion action to the target interpenetrating object model, and control the target virtual object model and the target interpenetrating object model to move synchronously on the motion trajectory according to the motion speed, and generate the target motion animation of the target virtual object and the target interpenetrating object on the motion trajectory frame by frame.

[0079] In the above embodiments, the movement of the target virtual object and the target interleaved object is controlled simultaneously according to the motion trajectory and speed. The motion animation of the target virtual object is controlled according to the first motion action, and the motion animation of the target interleaved object is controlled according to the second motion action. The movement system and the animation system are controlled respectively to generate the target motion animation frame by frame to show the movement effect of a horse carrying a person. The first state machine may also include the tilt angle of the target virtual object in different states. For example, multiple preset tilt angles are set in the movement state, and actions corresponding to different tilt angles are constructed. When performing motion mixing, for example, when the target virtual object turns forward, the speed mixing parameters and tilt angle mixing parameters of the first motion to be mixed are determined according to the magnitude and direction of the movement speed. The motion mixing is then performed according to the parameters. The motion form of the target virtual character is determined by the speed and tilt angle, and the rotational angular velocity of the target virtual object is determined according to the magnitude and direction of the movement speed. Thus, when generating the animation, the motion of the model is superimposed while the model is rotating to create the turning effect. In addition, different virtual objects have their own state machines. Different objects can construct different states and corresponding motion performances to show the motion characteristics of different virtual objects and improve the realism of the animation.

[0080] In this embodiment, for user-initiated movement control operations on specific objects in the game, the client can also create and display the motion animation of the specific object and synchronize the motion data of the specific object to the server, so that the server can update the position of the specific object in real time and maintain data consistency between the client and the server. Optionally, this embodiment may also include:

[0081] In response to motion control data of the first player character, a first motion animation of the first player character is generated, and first real-time motion synchronization data corresponding to the first player character is determined; the first real-time motion synchronization data is sent to the game server so that the game server updates the motion data of the first player character according to the first real-time motion synchronization data, and forwards the first real-time motion synchronization data to the associated client.

[0082] In the above embodiments, for movement initiated by the local client, in response to the motion control data of the first player character, a first motion animation corresponding to the first player character is generated so that the first player character can display motion effects in the game. Simultaneously, the coordinates and actions of the first player character are synchronized with the game server, i.e., first real-time motion synchronization data is sent to the game server. Upon receiving the first real-time motion synchronization data, the game server sends this data to other associated clients, so that the associated clients can generate motion animations for the first player character based on this data. In specific application scenarios, the game client can simulate the initial movement phase of the first player character using Root Motion, and create the first motion animation in other phases by mixing actions in the state machine.

[0083] Additionally, since Root Motion controls movement through animation, inaccurate positioning may occur when controlling precise points. The solution is as follows: Based on the game design requirements, players or NPCs may need to move to specific points and turn at fixed angles (for plot or other reasons). For non-essentially precise points, a tolerance range is provided along with the point location. That is, if the programmatic calculations using Root Motion cannot precisely control the game character to reach the point, the character can stop and adjust its angle within the tolerance area near the point. For essential precise points and orientations (such as those requiring CG camera angles), after reaching the approximate orientation and angle of the precise point, interpolation is performed using linear blending of subsequent montage actions to achieve seamless animation and a natural performance.

[0084] Optionally, in this embodiment, the method may further include: receiving second real-time motion synchronization data of a second player character sent by a game server, wherein the second real-time motion synchronization data is determined based on motion control data of the second player character in an associated client; determining displacement data of the second player character based on the second real-time motion synchronization data, and determining a third action to be mixed and corresponding synchronization mixing parameters in a third state machine of the second player character based on the displacement data; mixing the third action to be mixed according to the synchronization mixing parameters to obtain a third motion action, and generating a second motion animation of the second player character based on the displacement data and the third motion action.

[0085] In the above embodiments, the game client can also forward the second real-time motion synchronization data generated by the associated client to the game server. The second real-time motion synchronization data is the motion control data of the second player character initiated by the associated client. After receiving the second real-time motion synchronization data, specifically, the second motion animation corresponding to the second player character can be created locally based on the state machine of the second player character through spatial mixing, so as to realize data synchronization between multiple clients and the server.

[0086] By applying the technical solution of this embodiment, firstly, through hybrid space, root motion technology, and blending-in / blending-out technology, the action effects of virtual objects in the game are guaranteed, and the realism of the actions is improved. Especially for soft vertebrates such as horses, the stiff animation performance of animals is improved. Secondly, the rigid and monotonous visual performance of NPCs in the game is greatly improved. Seamless animations of turning around in place, curve trajectory fitting, and trajectory speed calculation make NPCs look more vivid. Even if the server AI just walks and stops, there is a vivid visual experience on the client side. Thirdly, when the action trajectories of the server and the client are inconsistent, the client simulates the movement trajectory and achieves a seamless and coherent performance effect through hybrid space. Fourthly, by constructing state machines for different virtual objects, different movement effects are achieved according to the different types of objects, achieving the effect of distinguishing types and making the game more expressive.

[0087] Furthermore, as Figure 1 To specifically implement the method, this application provides an animation generation apparatus, such as... Figure 3 As shown, the device includes:

[0088] A motion simulation module is used to receive motion data of a target virtual object and simulate the motion trajectory and speed of the target virtual object based on the motion data, wherein the target virtual object includes a soft-vertebrate tetrapod.

[0089] The motion extraction module is used to determine, in the first state machine of the target virtual object, a motion state to be mixed and its corresponding first motion to be mixed that matches the motion speed. The first state machine includes the motion of the target virtual object in multiple states, a preset motion speed and a preset tilt angle. The motion includes spinal motion for displaying the spinal movement morphology of the soft-vertebrate tetrapod.

[0090] The motion mixing module is used to determine the mixing parameters of the first motion to be mixed and the rotational angular velocity of the target virtual object based on the motion speed, and to mix the first motion to be mixed based on the mixing parameters to generate a first motion action. The first motion action includes a spinal motion action for displaying the spinal movement morphology of the soft-vertebrate tetrapod.

[0091] An animation generation module is used to generate a target motion animation of the target virtual object on the motion trajectory according to the motion trajectory, the motion speed, the rotational angular velocity, and the first motion action.

[0092] Optionally, the target virtual object includes a non-player character; the motion simulation module is specifically used for:

[0093] If the motion data indicates that the target virtual object is to move continuously, then the first motion trajectory of the target virtual object is fitted according to the start and end positions corresponding to the motion data, and the uniform motion speed corresponding to the first motion trajectory is calculated as the first motion speed according to the length of the first motion trajectory and the motion duration.

[0094] If the motion data indicates that the target virtual object is performing intermittent motion, the motion data is divided into multiple groups according to the stopping position of the target virtual object. Multiple segments of the second motion trajectory of the target virtual object are fitted according to the start and end positions of the multiple groups of motion data to determine the actual travel time of the second motion trajectory. Based on the length of the second motion trajectory and the actual travel time, the second motion speed of the second motion trajectory is calculated.

[0095] Optionally, if the motion data indicates that the target virtual object is performing a continuous and directional motion, then the first motion trajectory includes a Bézier curve.

[0096] Optionally, the animation generation module is specifically used for:

[0097] After rotating the target virtual object model according to the rotation angular velocity, the first motion action is added, and the target virtual object model is controlled to move on the motion trajectory at the motion speed to generate the target motion animation.

[0098] Optionally, when the target virtual object is an interleaved object, the motion mixing module is further configured to: before generating the target motion animation of the target virtual object on the motion trajectory according to the motion trajectory, the motion speed, the rotational angular velocity, and the first motion action, determine the target interleaved object corresponding to the target virtual object, wherein the target virtual object includes a mount, and the target interleaved object includes a game character riding a mount; in the second state machine of the target interleaved object, obtain the second action to be mixed corresponding to the first action to be mixed, and mix the second action to be mixed according to the mixing parameters to obtain the second motion action corresponding to the motion trajectory, wherein the second state machine includes the action and motion speed of the target interleaved object in multiple states, the multiple states including standing state, starting state, moving state, and stopping state, and the second state machine matches the first state machine;

[0099] Accordingly, the animation generation module is specifically used to: synchronously rotate the target virtual object model and the target interpenetrating object model according to the rotation angular velocity, add the first motion action to the target virtual object model and add the second motion action to the target interpenetrating object model, and control the target virtual object model and the target interpenetrating object model to move synchronously on the motion trajectory according to the motion speed, and generate the target motion animation of the target virtual object and the target interpenetrating object on the motion trajectory frame by frame.

[0100] Optionally, the device further includes:

[0101] The data generation module is used to generate a first motion animation of the first player character in response to motion control data of the first player character, and to determine the first real-time motion synchronization data corresponding to the first player character.

[0102] The data sending module is used to send the first real-time motion synchronization data to the game server, so that the game server updates the motion data of the first player character based on the first real-time motion synchronization data, and forwards the first real-time motion synchronization data to the associated client.

[0103] Optionally, the data receiving module is further configured to receive second real-time motion synchronization data of the second player character sent by the game server, wherein the second real-time motion synchronization data is determined based on the motion control data of the second player character in the associated client;

[0104] The animation generation module is further configured to determine the displacement data of the second player character based on the second real-time motion synchronization data, and determine the third action to be mixed and the corresponding synchronization mixing parameters in the third state machine of the second player character based on the displacement data; mix the third action to be mixed according to the synchronization mixing parameters to obtain the third motion action, and generate the second motion animation of the second player character based on the displacement data and the third motion action.

[0105] It should be noted that other corresponding descriptions of the functional units involved in the animation generation apparatus provided in this application embodiment can be found by referring to... Figures 1 to 2 The corresponding descriptions in the method will not be repeated here.

[0106] Based on the above, Figures 1 to 2 Accordingly, this application also provides a storage medium storing a computer program, which, when executed by a processor, implements the above-described method. Figures 1 to 2 The animation generation method shown.

[0107] Based on this understanding, the technical solution of this application can be embodied in the form of a software product. This software product can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, or portable hard drive), and includes several instructions to cause a computer device (such as a personal computer, server, or network device) to execute the methods described in the various implementation scenarios of this application.

[0108] Based on the above, Figures 1 to 2 The method shown, and Figure 3 To achieve the above objectives, the present application also provides a computer device, specifically a personal computer, server, network device, etc., as shown in the virtual device embodiment. This computer device includes a storage medium and a processor; the storage medium stores a computer program; the processor executes the computer program to achieve the above-described objectives. Figures 1 to 2 The animation generation method shown.

[0109] Optionally, the computer device may also include a user interface, a network interface, a camera, radio frequency (RF) circuitry, sensors, audio circuitry, a Wi-Fi module, etc. The user interface may include a display screen, input units such as a keyboard, etc., and optional user interfaces may also include USB interfaces, card reader interfaces, etc. The network interface may optionally include standard wired interfaces, wireless interfaces (such as Bluetooth interfaces, Wi-Fi interfaces), etc.

[0110] Those skilled in the art will understand that the computer device structure provided in this embodiment does not constitute a limitation on the computer device, and may include more or fewer components, or combine certain components, or have different component arrangements.

[0111] The storage medium may also include an operating system and a network communication module. The operating system is a program that manages and stores the hardware and software resources of a computer device, supporting the operation of information processing programs and other software and / or programs. The network communication module is used to enable communication between the various components within the storage medium, as well as communication with other hardware and software within the physical device.

[0112] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware platforms, or by hardware implementation. When the server controls the movement of the target virtual object in the game, it sends motion data to the game client. The client simulates the movement trajectory and speed of the target virtual character based on the motion data. Then, according to the movement speed, it obtains the action to be mixed in the first state machine of the pre-constructed target virtual object, and determines the mixing parameters and rotational angular velocity based on the movement speed and movement trajectory. According to the mixing parameters, the action is mixed to obtain the first motion action. Thus, the target virtual object is displacement controlled according to the rotational angular velocity, movement trajectory, and movement speed, and the target virtual object is motion controlled according to the first motion action to generate the target motion animation corresponding to the target virtual object. The embodiments of this application utilize the actions in each state of the state machine to create the motion animation of the target virtual object through spatial mixing, so as to simulate the movement of a soft-vertebrate quadruped in different movement states, ensuring the motion animation effect of the target virtual object.

[0113] Those skilled in the art will understand that the accompanying drawings are merely schematic diagrams of a preferred embodiment, and the modules or processes shown in the drawings are not necessarily essential for implementing this application. Those skilled in the art will understand that the modules in the apparatus of the embodiment can be distributed within the apparatus of the embodiment as described, or can be modified to be located in one or more apparatuses different from this embodiment. The modules of the above-described embodiment can be combined into one module, or further divided into multiple sub-modules.

[0114] The serial numbers in this application are for descriptive purposes only and do not represent the superiority or inferiority of any particular implementation scenario. The above disclosures are merely a few specific implementation scenarios of this application; however, this application is not limited thereto, and any variations conceived by those skilled in the art should fall within the protection scope of this application.

Claims

1. An animation generation method, characterized in that, Applied to game clients, including: The motion data of a target virtual object is received, and the motion trajectory and speed of the target virtual object are simulated based on the motion data, wherein the target virtual object includes a soft-vertebrate tetrapod. In the first state machine of the target virtual object, a motion state to be mixed and its corresponding first action to be mixed are determined to match the motion speed. The first state machine includes the action of the target virtual object in multiple states, a preset motion speed and a preset tilt angle. The action includes a spinal action for displaying the spinal movement morphology of the soft-vertebrate tetrapod. Based on the movement speed, the mixing parameters of the first action to be mixed and the rotational angular velocity of the target virtual object are determined, and the first action to be mixed is mixed based on the mixing parameters to generate a first motion action. The first motion action includes a spinal motion action for displaying the spinal movement morphology of the soft-vertebrate tetrapod. Based on the motion trajectory, the motion speed, the rotational angular velocity, and the first motion action, generate a target motion animation of the target virtual object on the motion trajectory.

2. The method according to claim 1, characterized in that, The target virtual object includes a non-player character; the step of simulating the movement trajectory and speed of the target virtual object based on the motion data specifically includes: If the motion data indicates that the target virtual object is to move continuously, then the first motion trajectory of the target virtual object is fitted according to the start and end positions corresponding to the motion data, and the uniform motion speed corresponding to the first motion trajectory is calculated as the first motion speed according to the length of the first motion trajectory and the motion duration. If the motion data indicates that the target virtual object is performing intermittent motion, the motion data is divided into multiple groups according to the stopping position of the target virtual object. Multiple segments of the second motion trajectory of the target virtual object are fitted according to the start and end positions of the multiple groups of motion data to determine the actual travel time of the second motion trajectory. Based on the length of the second motion trajectory and the actual travel time, the second motion speed of the second motion trajectory is calculated.

3. The method according to claim 2, characterized in that, If the motion data indicates that the target virtual object is moving continuously and with a direction, then the first motion trajectory includes a Bézier curve.

4. The method according to claim 1, characterized in that, The step of generating a target motion animation of the target virtual object on the motion trajectory according to the motion trajectory, the motion speed, the rotational angular velocity, and the first motion action specifically includes: After rotating the target virtual object model according to the rotation angular velocity, the first motion action is added, and the target virtual object model is controlled to move on the motion trajectory at the motion speed to generate the target motion animation.

5. The method according to claim 1, characterized in that, When the target virtual object is an interpenetrable object, before generating the target motion animation of the target virtual object on the motion trajectory according to the motion trajectory, the motion speed, the rotational angular velocity, and the first motion action, the method further includes: Determine the target interleaving object corresponding to the target virtual object, wherein the target virtual object includes a mount, and the target interleaving object includes a game character riding a mount; In the second state machine of the target interpenetrating object, the second action to be mixed corresponding to the first action to be mixed is obtained, and the second action to be mixed is mixed according to the mixing parameters to obtain the second motion action corresponding to the motion trajectory. The second state machine includes the action and motion speed of the target interpenetrating object in the multiple states, including standing state, starting state, moving state and stopping state. The second state machine matches the first state machine. Accordingly, generating the target motion animation of the target virtual object on the motion trajectory according to the motion trajectory, the motion speed, the rotational angular velocity, and the first motion action specifically includes: After synchronously rotating the target virtual object model and the target interpenetrating object model according to the rotation angular velocity, the first motion action is added to the target virtual object model and the second motion action is added to the target interpenetrating object model. The target virtual object model and the target interpenetrating object model are controlled to move synchronously on the motion trajectory at the motion speed, and the target motion animation of the target virtual object and the target interpenetrating object on the motion trajectory is generated frame by frame.

6. The method according to claim 1, characterized in that, The method further includes: In response to motion control data of the first player character, a first motion animation of the first player character is generated, and the first real-time motion synchronization data corresponding to the first player character is determined; The first real-time motion synchronization data is sent to the game server so that the game server updates the motion data of the first player character based on the first real-time motion synchronization data and forwards the first real-time motion synchronization data to the associated client.

7. The method according to claim 1, characterized in that, The method further includes: Receive second real-time motion synchronization data of the second player character sent by the game server, wherein the second real-time motion synchronization data is determined based on the motion control data of the second player character in the associated client; Based on the second real-time motion synchronization data, the displacement data of the second player character is determined, and based on the displacement data, the third action to be mixed and the corresponding synchronization mixing parameters are determined in the third state machine of the second player character; The third motion is obtained by mixing the third motion according to the synchronous mixing parameters, and the second motion animation of the second player character is generated based on the displacement data and the third motion.

8. An animation generation device, characterized in that, Applied to game clients, including: A motion simulation module is used to receive motion data of a target virtual object and simulate the motion trajectory and speed of the target virtual object based on the motion data, wherein the target virtual object includes a soft-vertebrate tetrapod. The motion extraction module is used to determine, in the first state machine of the target virtual object, a motion state to be mixed and its corresponding first motion to be mixed that matches the motion speed. The first state machine includes the motion of the target virtual object in multiple states, a preset motion speed and a preset tilt angle. The motion includes spinal motion for displaying the spinal movement morphology of the soft-vertebrate tetrapod. The motion mixing module is used to determine the mixing parameters of the first motion to be mixed and the rotational angular velocity of the target virtual object based on the motion speed, and to mix the first motion to be mixed based on the mixing parameters to generate a first motion action. The first motion action includes a spinal motion action for displaying the spinal movement morphology of the soft-vertebrate tetrapod. An animation generation module is used to generate a target motion animation of the target virtual object on the motion trajectory according to the motion trajectory, the motion speed, the rotational angular velocity, and the first motion action.

9. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 7.

10. A computer device, comprising a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method of any one of claims 1 to 7.

Citation Information

Patent Citations

  • Sports interactive animation producing method

    CN101515373A

  • Action state synchronizing method and device, storage medium as well as electronic device

    CN108650217A