Search

CN-115546367-B - Animation generation method and device, storage medium and computer equipment

CN115546367BCN 115546367 BCN115546367 BCN 115546367BCN-115546367-B

Abstract

The application discloses an animation generation method, a device, a storage medium and computer equipment, wherein the method comprises the steps of receiving motion data of a target virtual object, simulating a motion track and a motion speed of the target virtual object according to the motion data, determining a motion state to be mixed matched with the motion speed and a first motion to be mixed corresponding to the motion state in a first state machine of the target virtual object, determining a mixing parameter of the first motion to be mixed and a rotation angle speed of the target virtual object according to the motion speed, mixing the first motion to be mixed according to the mixing parameter, generating a first motion, and generating a target motion animation of the target virtual object on the motion track according to the motion track, the motion speed, the rotation angle speed and the first motion.

Inventors

  • DING WEICONG
  • SONG YUYANG
  • GUO PEI
  • ZHU WENYUAN

Assignees

  • 完美世界(北京)软件科技发展有限公司

Dates

Publication Date
20260505
Application Date
20210629

Claims (10)

  1. 1. An animation generation method, applied to a game client, comprising: Receiving motion data of a target virtual object, and simulating a motion track and a motion speed of the target virtual object according to the motion data, wherein the target virtual object comprises a soft spine quadruped; Determining a motion state to be mixed matched with the motion speed and a first motion to be mixed corresponding to the motion state to be mixed in a first state machine of the target virtual object, wherein the first state machine comprises motions, preset motion speeds and preset inclination angles of the target virtual object in various states, and the motions comprise vertebral motions for showing the vertebral motion forms of the soft-spine quadruped; Determining a mixing parameter of the first motion to be mixed and a rotation angular velocity of the target virtual object according to the motion velocity, and mixing the first motion to be mixed based on the mixing parameter to generate a first motion, wherein the first motion comprises a vertebra motion for showing a vertebra motion form of the soft-spine quadruped; And generating a target motion animation of the target virtual object on the motion track according to the motion track, the motion speed, the rotation angular speed and the first motion action.
  2. 2. The method of claim 1, wherein the target virtual object comprises a non-player character, and wherein simulating the motion trajectory and the motion velocity of the target virtual object based on the motion data comprises: if the motion data indicate that the target virtual object does not stop motion, fitting a first motion track of the target virtual object according to a start-stop position corresponding to the motion data, and calculating a uniform motion speed corresponding to the first motion track as a first motion speed according to a first motion track length and a motion duration; If the motion data indicate that the target virtual object performs the intermittent motion, dividing the motion data into a plurality of groups according to the intermittent position of the target virtual object, fitting a plurality of sections of second motion tracks of the target virtual object according to the start-stop positions of the plurality of groups of motion data, determining the actual traveling duration of the second motion tracks, and calculating the second motion speed of the second motion tracks according to the second motion track length and the actual traveling duration.
  3. 3. The method of claim 2, wherein the first motion profile comprises a bezier curve if the motion data indicates that the target virtual object is performing a non-stop, steered motion.
  4. 4. The method according to claim 1, wherein generating the 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 specifically comprises: And after the target virtual object model is rotated according to the rotation angular velocity, adding the first motion action, and controlling the target virtual object model to move on the motion track according to the motion velocity to generate the target motion animation.
  5. 5. The method according to claim 1, wherein, in the case where the target virtual object is a interpenetrated object, the method further comprises, before 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: Determining a target penetration object corresponding to the target virtual object, wherein the target virtual object comprises a riding, and the target penetration object comprises a game role of riding; Acquiring a second motion to be mixed corresponding to the first motion to be mixed in a second state machine of the target penetration object, and mixing the second motion to be mixed according to the mixing parameters to obtain a second motion corresponding to the motion track, wherein the second state machine comprises motions and motion speeds of the target penetration object in various states, the various states comprise a standing state, a starting state, a moving state and a stop state, and the second state machine is matched with the first state machine; Correspondingly, the generating the target motion animation of the target virtual object on the motion track according to the motion track, the motion speed, the rotation angular speed and the first motion action specifically comprises the following steps: And after synchronously rotating the target virtual object model and the target interpenetration object model according to the rotation angular velocity, adding the first motion action to the target virtual object model and the second motion action to the target interpenetration object model, controlling the target virtual object model and the target interpenetration object model to synchronously move on the motion track according to the motion velocity, and generating target motion animations of the target virtual object and the target interpenetration object on the motion track frame by frame.
  6. 6. The method according to claim 1, wherein the method further comprises: Generating a first motion animation of a first player character in response to motion control data of the first player character, and determining first real-time motion synchronous data corresponding to the first player character; and sending the first real-time motion synchronous data to a game server, so that the game server updates the motion data of the first player character according to the first real-time motion synchronous data, and forwards the first real-time motion synchronous data to an associated client.
  7. 7. The method according to claim 1, wherein the method further comprises: 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 according to the second real-time motion synchronous data, and determining a third action to be mixed and corresponding synchronous mixing parameters in a third state machine of the second player character according to the displacement data; and mixing the third motion to be mixed according to the synchronous mixing parameters to obtain a third motion, and generating a second motion animation of the second player character according to the displacement data and the third motion.
  8. 8. An animation generation device, applied to a game client, comprising: the motion simulation module is used for receiving motion data of a target virtual object and simulating a motion track and a motion speed of the target virtual object according to the motion data, wherein the target virtual object comprises a soft spine quadruped; The motion extraction module is used for determining a motion state to be mixed and a first motion to be mixed corresponding to the motion state to be mixed, which are matched with the motion speed, in a first state machine of the target virtual object, wherein the first state machine comprises motions, preset motion speeds and preset inclination angles of the target virtual object in various states, and the motions comprise vertebral motions for showing the vertebral motion forms of the soft-spine quadruped; The motion mixing module is used for determining a mixing parameter of the first motion to be mixed and a rotation angular velocity of the target virtual object according to the motion velocity, mixing the first motion to be mixed based on the mixing parameter, and generating a first motion, wherein the first motion comprises a vertebra motion for showing a vertebra motion form of the soft-spine quadruped; and the animation generation module is used for generating a target motion animation of the target virtual object on the motion track according to the motion track, the motion speed, the rotation angular speed and the first motion action.
  9. 9. A storage medium having stored thereon a computer program, which when executed by a processor, implements the method of any of claims 1 to 7.
  10. 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 the processor implements the method of any one of claims 1 to 7 when executing the computer program.

Description

Animation generation method and device, storage medium and computer equipment Technical Field The present application relates to the field of animation technologies, and in particular, to an animation generating method and apparatus, a storage medium, and a computer device. Background In the conventional net tour, the turning and moving of quadruped, for example, a horse, is realized by making client rotation on a datum point of a model and using the orientation and position of the datum point to align motion coordinates. The movements of quadruped vertebrates, especially when moving in curves and turning around, are always stiff in body posture. The action connection is not smooth, the frame is jumped, and meanwhile, the horse gesture is always in the forward direction, so that the sole sliding step has the effect of unrealistic lasting. Disclosure of Invention In view of the above, the present application provides an animation generation method and apparatus, a storage medium, and a computer device, which are helpful for improving the motion expression of soft-spine quadruped in a game. According to one aspect of the present application, there is provided an animation generation method applied to a game client, including: Receiving motion data of a target virtual object, and simulating a motion track and a motion speed of the target virtual object according to the motion data, wherein the target virtual object comprises a soft spine quadruped; Determining a motion state to be mixed matched with the motion speed and a first motion to be mixed corresponding to the motion state to be mixed in a first state machine of the target virtual object, wherein the first state machine comprises motions, preset motion speeds and preset inclination angles of the target virtual object in various states, and the motions comprise vertebral motions for showing the vertebral motion forms of the soft-spine quadruped; Determining a mixing parameter of the first motion to be mixed and a rotation angular velocity of the target virtual object according to the motion velocity, and mixing the first motion to be mixed based on the mixing parameter to generate a first motion, wherein the first motion comprises a vertebra motion for showing a vertebra motion form of the soft-spine quadruped; And generating a target motion animation of the target virtual object on the motion track according to the motion track, the motion speed, the rotation angular speed and the first motion action. Optionally, the target virtual object comprises a non-player character, and the simulating the motion trail and the motion speed of the target virtual object according to the motion data comprises the following steps: If the motion data indicate that the target virtual object does not stop motion, fitting a first motion track of the target virtual object according to a start-stop position corresponding to the motion data, and calculating a uniform motion speed corresponding to the first motion track as a first motion speed according to a first motion track length and the motion duration; If the motion data indicate that the target virtual object performs the intermittent motion, dividing the motion data into a plurality of groups according to the intermittent position of the target virtual object, fitting a plurality of sections of second motion tracks of the target virtual object according to the start-stop positions of the plurality of groups of motion data, determining the actual traveling duration of the second motion tracks, and calculating the second motion speed of the second motion tracks according to the second motion track length and the actual traveling duration. Optionally, if the motion data indicates that the target virtual object does not stop and is in steering motion, the first motion trajectory includes a bezier curve. Optionally, the generating a target motion animation of the target virtual object on the motion track according to the motion track, the motion speed, the rotation angular speed and the first motion action specifically includes: And after the target virtual object model is rotated according to the rotation angular velocity, adding the first motion action, and controlling the target virtual object model to move on the motion track according to the motion velocity to generate the target motion animation. Optionally, before the generating the target motion animation of the target virtual object on the motion track according to the motion track, the motion speed, the rotation angular speed and the first motion action, the method further includes: Determining a target penetration object corresponding to the target virtual object, wherein the target virtual object comprises a riding, and the target penetration object comprises a game role of riding; Acquiring a second motion to be mixed corresponding to the first motion to be mixed in a second state machine of the target penetration object, and mixing the second motion to be mixe