Virtual character animation generation method and device, electronic equipment and storage medium

By detecting the virtual bearing surface type where the virtual character is located and adjusting the control direction, the problem of poor animation effect of virtual characters on the wall in the existing technology is solved, and more realistic and accurate animation performance is achieved.

CN119850796APending Publication Date: 2025-04-18SHANGHAI MIHOYO TIANMING TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411962763.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-04-18

AI Technical Summary

Technical Problem

The prior art is difficult to generate virtual character animations suitable for wall type virtual bearing surfaces, resulting in poor animation effects.

Method used

By detecting whether the virtual bearer surface corresponding to the virtual character is a wall type, adjusting the user's control direction to match the wall surface direction, and then obtaining the matching target animation model from the pre-configured animation model to generate the corresponding character animation.

Benefits of technology

The animation effect of virtual characters on the wall is more adapted to the virtual bearing surface of the wall type, improving the authenticity and accuracy of the animation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119850796A_ABST
    Figure CN119850796A_ABST
Patent Text Reader

Abstract

The invention relates to the field of animation processing, and particularly discloses a virtual character animation generation method and device, electronic equipment and a storage medium. The method comprises the steps of determining a user control direction of a virtual character in response to a user control instruction triggered for the virtual character under the condition that a virtual bearing surface corresponding to the virtual character is of a wall surface type; according to the surface direction of a virtual bearing surface corresponding to the virtual character, the user control direction is adjusted, and the character moving direction of the virtual character is obtained; and obtaining a target animation model of which the orientation angle is matched with the character moving direction from pre-configured animation models of a plurality of orientation angles corresponding to the virtual character, and generating a character animation corresponding to the target animation model, so that the authenticity and accuracy of the character animation can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to the technical field of animation data processing, and in particular to a method, device, electronic device and storage medium for generating animation of a virtual character. Background Art

[0002] A virtual character refers to an active object in a virtual environment. A virtual environment is a three-dimensional environment created by computer technology and existing in the digital world. It can simulate the real world or be a purely imaginary space. A virtual environment usually contains one or more virtual characters. A virtual character can be a three-dimensional object or entity simulated by computer technology. It does not exist in the physical world, but in a virtual environment.

[0003] In the related art, the animation generation method of virtual characters is usually adapted to the ground-type virtual bearing surface, and cannot be applied to special types of virtual bearing surfaces such as wall types, resulting in poor animation effects of virtual characters on special types of virtual bearing surfaces such as walls. Summary of the invention

[0004] In view of the above problems, the present disclosure is proposed to provide a method, device, electronic device and storage medium for generating animation of a virtual character that overcomes the above problems or at least partially solves the above problems.

[0005] According to one aspect of an embodiment of the present disclosure, a method for generating an animation of a virtual character is provided, the method comprising:

[0006] In a case where the virtual bearing surface corresponding to the virtual character is a wall type, in response to a user manipulation instruction triggered for the virtual character, determining a user manipulation direction of the virtual character;

[0007] According to the surface direction of the virtual bearing surface corresponding to the virtual character, the user control direction is adjusted to obtain the character movement direction of the virtual character;

[0008] From the pre-configured animation models with multiple orientation angles corresponding to the virtual character, a target animation model with an orientation angle matching the moving direction of the character is obtained, and a character animation corresponding to the target animation model is generated.

[0009] In an optional implementation, the method further comprises: pre-configuring an animation state library for storing the animation models of the plurality of orientation angles; wherein the animation models of the plurality of orientation angles comprise: animation models corresponding to a plurality of different preset orientation angles respectively;

[0010] Then, obtaining a target animation model whose orientation angle matches the moving direction of the character from animation models of multiple orientation angles pre-configured and corresponding to the virtual character comprises:

[0011] Matching the preset orientation angles of the plurality of animation models in the animation state library with the character movement direction of the virtual character to obtain orientation matching results of the plurality of animation models;

[0012] The target animation model is acquired according to the orientation matching results of the multiple animation models.

[0013] In an optional implementation, the animation model corresponding to any preset orientation angle includes: animation models of multiple different action postures;

[0014] Then, obtaining the target animation model according to the orientation matching results of the multiple animation models includes:

[0015] Acquiring the action posture of the virtual character, matching the action postures of multiple animation models in the animation state library with the action posture of the virtual character, and obtaining posture matching results of the multiple animation models;

[0016] According to the orientation matching results of the multiple animation models and the posture matching results, the target animation model is obtained. In an optional implementation, the method further includes: pre-configuring an animation state library for storing the animation models of the multiple orientation angles; wherein the animation models of the multiple orientation angles include: animation models corresponding to multiple different preset orientation angles, respectively, and the animation model corresponding to any preset orientation angle includes: animation models of multiple different action postures;

[0017] Then, obtaining a target animation model whose orientation angle matches the moving direction of the character from animation models of multiple orientation angles pre-configured and corresponding to the virtual character comprises:

[0018] Acquiring the action posture of the virtual character, matching the action postures of multiple animation models in the animation state library with the action posture of the virtual character to obtain a first matching result;

[0019] Matching the preset orientation angles of the plurality of animation models in the animation state library with the character movement direction of the virtual character to obtain a second matching result;

[0020] The target animation model is acquired according to the first matching result and the second matching result.

[0021] In an optional implementation, the user control instruction triggered for the virtual character includes: the user control instruction triggered for the virtual character in the i-th animation frame; the action posture of the virtual character includes: the action posture of the virtual character in the i-th animation frame;

[0022] The generating the character animation corresponding to the target animation model comprises: generating the character animation corresponding to the target animation model in the i+mth animation frame; wherein i and m are natural numbers;

[0023] The surface direction of the virtual bearing surface corresponding to the virtual character includes: the surface direction of the virtual bearing surface corresponding to the virtual character in the i-th animation frame, and / or the surface direction of the virtual bearing surface corresponding to the virtual character in the i+m-th animation frame;

[0024] Furthermore, the virtual bearing surface corresponding to the virtual character is of a wall type, including: the virtual bearing surface corresponding to the virtual character in the i-th animation frame is of a wall type, and / or the virtual bearing surface corresponding to the virtual character in the i+m-th animation frame is of a wall type.

[0025] In an optional implementation, the animation state library includes: a plurality of stage animation libraries corresponding to a plurality of different animation switching stages respectively;

[0026] The method of obtaining a target animation model whose orientation angle matches the moving direction of the character from animation models of multiple orientation angles preconfigured to correspond to the virtual character comprises: selecting a stage animation library corresponding to the animation switching stage from the multiple stage animation libraries according to the animation switching stage corresponding to the virtual character, and obtaining a target animation model whose orientation angle matches the moving direction of the character from the multiple animation models in the selected stage animation library.

[0027] In an optional implementation, the multiple stage animation libraries include at least two of the following: a first stage animation database for simulating a virtual character switching from a non-wall type virtual bearing surface to a wall type virtual bearing surface, a second stage animation database for simulating a virtual character switching actions inside a wall type virtual bearing surface, and a third stage animation database for simulating a virtual character switching from a wall type virtual bearing surface to a non-wall type virtual bearing surface;

[0028] Furthermore, the animation switching phase corresponding to the virtual character is determined in the following manner:

[0029] Obtaining a first judgment result of whether the virtual bearing surface corresponding to the virtual character in the i-th animation frame is a wall type, and a second judgment result of whether the virtual bearing surface corresponding to the virtual character in the i+m-th animation frame is a wall type;

[0030] Determining the animation switching stage corresponding to the virtual character according to the first judgment result and the second judgment result;

[0031] Among them, if the first judgment result is no and the second judgment result is yes, then the animation switching stage corresponding to the virtual character is determined to be the first animation switching stage corresponding to the first-stage animation database; if the first judgment result is yes and the second judgment result is yes, then the animation switching stage corresponding to the virtual character is determined to be the second animation switching stage corresponding to the second-stage animation database; if the first judgment result is yes and the second judgment result is no, then the animation switching stage corresponding to the virtual character is determined to be the third animation switching stage corresponding to the third-stage animation database.

[0032] In an optional implementation, adjusting the user control direction according to the surface direction of the virtual bearing surface corresponding to the virtual character to obtain the character movement direction of the virtual character includes:

[0033] According to the surface direction of the virtual bearing surface, the user control direction is initially adjusted to obtain an initial moving direction of the virtual character;

[0034] The camera orientation of the virtual camera is obtained, and the initial moving direction is adjusted secondary according to the camera orientation to obtain the character moving direction of the virtual character.

[0035] In an optional implementation, before generating the character animation corresponding to the target animation model, the method further includes:

[0036] According to the moving direction of the virtual character, the jib distance and / or the field of view of the virtual camera are adjusted; and / or, according to the angle between the moving direction of the character and the camera direction of the virtual camera, the camera direction of the virtual camera is adjusted.

[0037] In an optional implementation, acquiring a target animation model whose orientation angle matches the moving direction of the character from animation models of multiple orientation angles pre-configured to correspond to the virtual character, and generating a character animation corresponding to the target animation model includes:

[0038] Inputting the character movement direction of the virtual character and / or the action posture of the virtual character into a pre-trained animation generation model;

[0039] Generate a character animation corresponding to the target animation model through the animation generation model;

[0040] Wherein, when there are multiple target animation models, the multiple target animation models are interpolated and / or fused in a hybrid space to obtain the character animation.

[0041] In an optional implementation, the method further includes:

[0042] When it is detected that the virtual bearing surface corresponding to the virtual character is of a wall type, the user control direction corresponding to the user control instruction is converted according to the surface direction of the virtual bearing surface of the wall type, so that the user control direction of the user control instruction after the conversion matches the surface direction of the virtual bearing surface.

[0043] In an optional implementation, the virtual character is a controlled character in a virtual scene of a game; and the virtual bearing surface corresponding to the virtual character includes: an object surface of a virtual bearing object corresponding to the virtual character; wherein the virtual bearing object includes at least one of the following: a mountain object, a wall object, and a building object;

[0044] Furthermore, the surface direction of the virtual bearing surface includes the normal direction of the virtual bearing surface; the wall-type virtual bearing surface satisfies the following conditions: the angle between the virtual bearing surface and the horizontal plane is greater than a preset angle threshold, and the surface attribute of the virtual bearing surface is a non-slip attribute.

[0045] In an optional implementation, the method also includes: determining whether the virtual bearing surface corresponding to the virtual character meets a preset wall detection condition, and if so, determining that the virtual bearing surface corresponding to the virtual character is a wall type; wherein the wall detection condition includes: the angle between the virtual bearing surface and the horizontal plane is greater than a preset angle threshold, and the surface attribute of the virtual bearing surface is a non-slip attribute.

[0046] According to another aspect of the present disclosure, a device for generating animation of a virtual character is provided, the device comprising:

[0047] A response module, adapted to determine a user manipulation direction of the virtual character in response to a user manipulation instruction triggered for the virtual character when the virtual bearing surface corresponding to the virtual character is a wall type;

[0048] An adjustment module, adapted to adjust the user control direction according to the surface direction of the virtual bearing surface corresponding to the virtual character, so as to obtain the character movement direction of the virtual character;

[0049] The generation module is adapted to obtain a target animation model whose orientation angle matches the moving direction of the character from animation models of multiple orientation angles pre-configured corresponding to the virtual character, and generate a character animation corresponding to the target animation model.

[0050] According to another aspect of the present disclosure, there is provided an electronic device, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus;

[0051] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute the above-mentioned method for generating animation of a virtual character.

[0052] According to another aspect of the present disclosure, a computer storage medium is provided, wherein at least one executable instruction is stored in the storage medium, and the executable instruction enables a processor to execute the above-mentioned method for generating animation of a virtual character.

[0053] According to another aspect of the present disclosure, a computer program product is provided, characterized in that it includes a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code, and when the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the virtual character animation generation method as described above.

[0054] In an embodiment of the present disclosure, when it is detected that the virtual bearing surface corresponding to the virtual character is a wall type, the user control direction of the virtual character can be determined according to the user control instruction, and the user control direction can be adjusted according to the surface direction of the virtual bearing surface to obtain the character movement direction of the virtual character, and then the target animation model whose orientation angle matches the character movement direction is obtained from the pre-configured animation models of multiple orientation angles, thereby generating the character animation. It can be seen that this method can adjust the user control direction according to the surface direction of the virtual bearing surface of the wall type for the special case where the virtual character moves on the wall, thereby obtaining the character movement direction of the virtual character, so as to select a suitable target animation model from multiple animation models with different orientation angles to generate the character animation. Because this method takes into account the surface direction of the virtual bearing surface of the wall type, the adjusted character movement direction is more in line with the characteristics of the wall type, so that the character animation is more adapted to the virtual bearing surface of the wall type, and then the virtual character presents movement characteristics different from the virtual bearing surface of the ground type, thereby improving the authenticity and accuracy of the character animation.

[0055] The above description is only an overview of the technical solution of the present disclosure. In order to more clearly understand the technical means of the present disclosure, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present disclosure more obvious and easy to understand, the specific implementation methods of the present disclosure are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present disclosure. Also, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0057] Figure 1 A flowchart of a method for generating animation of a virtual character provided by an embodiment of the present disclosure is shown;

[0058] Figure 2 A flowchart of a method for generating animation of a virtual character in an example of the present disclosure is shown;

[0059] Figure 3 A schematic diagram showing the direction of character movement of a virtual character;

[0060] Figure 4 A schematic diagram of the structure of the animation state library is shown;

[0061] Figure 5 A schematic structural diagram of a virtual character animation generation device provided by an embodiment of the present disclosure is shown;

[0062] Figure 6 A schematic structural diagram of an electronic device provided by yet another embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0063] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0064] Figure 1 FIG. 1 is a flow chart of a method for generating an animation of a virtual character provided by an embodiment of the present disclosure. Figure 1 As shown, the method specifically comprises the following steps:

[0065] Step S110: when the virtual bearing surface corresponding to the virtual character is a wall type, in response to a user manipulation instruction triggered for the virtual character, determining a user manipulation direction of the virtual character.

[0066] Among them, the virtual character generally refers to a human character, an animation character, etc. in a virtual scene of a game. For example, the virtual character can be a controlled character in a virtual scene of a game, and the controlled character can achieve different action performances according to the interactive operation of the player user. The virtual bearing surface can be the object surface of a virtual bearing object corresponding to the virtual character. Among them, the virtual bearing object is used to provide a foothold for the virtual character. Among them, in the case where the virtual bearing surface corresponding to the virtual character is a wall type, the virtual bearing object generally includes at least one of the following: a mountain object (such as a hillside, a mountain top, etc.), a wall object, and a building object.

[0067] In the present application, it is possible to continuously determine whether the virtual bearing surface corresponding to the virtual character is of a wall type, and if the determination result is yes, trigger this step and subsequent steps. Specifically, determine whether the virtual bearing surface corresponding to the virtual character meets the preset wall detection condition. If so, determine that the virtual bearing surface corresponding to the virtual character is of a wall type; wherein the wall detection condition may include: the angle between the virtual bearing surface and the horizontal plane is greater than a preset angle threshold, and the surface attribute of the virtual bearing surface is a non-slip attribute. The condition that the surface attribute of the virtual bearing surface is a non-slip attribute is optional. In some embodiments, this condition may also be omitted, and the judgment is made only based on the preset angle threshold.

[0068] It can be seen that the virtual bearing surface of the wall type usually meets the following two conditions:

[0069] (1) The angle between the virtual bearing surface and the horizontal plane is greater than a preset angle threshold: For example, only when the angle between the virtual bearing surface and the horizontal plane is greater than a preset angle threshold, the virtual bearing surface is considered to be a wall type; otherwise, the virtual bearing surface is considered to be a non-wall type (such as a ground type).

[0070] For example, the preset angle threshold can be 45 degrees, 30 degrees, 60 degrees, and other values, and can be set according to the topographical features in the game (such as the terrain distribution in the game). For example, different preset angle thresholds can be configured for different types of games, and different preset angle thresholds can be configured for different regions in the same type of game. Accordingly, the current region of the player user is dynamically detected, and the preset angle threshold corresponding to the current region is dynamically selected for judgment.

[0071] (2) The surface property of the virtual bearing surface is a non-slip property: The surface property of the virtual bearing surface includes a slip property and a non-slip property. If the surface property of the virtual bearing surface is a slip property, it means that the virtual bearing surface is relatively smooth and cannot provide a foothold for the virtual character. The character will slide directly to a lower place, so there is no need to perform wall animation processing; if the surface property of the virtual bearing surface is a non-slip property, it means that the virtual bearing surface is relatively rough and has a certain friction force. It can provide a foothold for the virtual character, so wall animation processing is required. In actual situations, the above two conditions can be used separately or in combination.

[0072] In addition, the user control instructions triggered for the virtual character are usually triggered by the player user and are used to control the movement mode of the virtual character. For example, they may include: control instructions for moving in a specified direction, control instructions for jumping to a high place, etc. Correspondingly, the user control direction can be determined according to the instruction parameters contained in the user control instruction. For example, when the instruction parameters contained in the user control instruction are used to make the virtual character move in a specified direction, the user control direction is a direction that matches the specified direction; when the instruction parameters contained in the user control instruction are used to make the virtual character jump to a high place, the user control direction is a direction that matches the jumping direction.

[0073] In an optional implementation, considering that the bearing directions of the virtual bearing surface of the wall type are different from those of the virtual bearing surface of the ground type, in order to accurately simulate the movement characteristics of the virtual character on the wall, when it is detected that the virtual bearing surface corresponding to the virtual character is of the wall type, the user control direction corresponding to the user control instruction can be further converted according to the surface direction of the virtual bearing surface of the wall type, so that the control direction of the converted user control instruction matches the surface direction of the virtual bearing surface. Among them, the surface direction of the virtual bearing surface can be represented by the normal direction of the virtual bearing surface. In addition, when the control direction corresponding to the user control instruction is converted, the conversion angle can be determined according to the angle between the normal direction of the virtual bearing surface of the wall type and the horizontal plane: if the angle between the normal direction of the virtual bearing surface of the wall type and the horizontal plane is greater than the preset value, it means that the wall is steeper and approximately vertical. Therefore, the control direction corresponding to the user control instruction can be rotated 90 degrees, so that the instruction originally used to move the character left and right is converted into an instruction for moving the character up and down. If the angle between the normal direction of the virtual bearing surface of the wall type and the horizontal plane is not greater than the preset value, it means that the wall has a certain slope. Therefore, the control direction corresponding to the user control instruction can be rotated by a preset angle. The preset angle can be determined based on the above angle to make the user control instruction more adapted to the steepness of the wall.

[0074] Step S120: adjusting the user control direction according to the surface direction of the virtual bearing surface corresponding to the virtual character to obtain the character movement direction of the virtual character.

[0075] For example, when the surface direction of the virtual bearing surface is the normal direction, the user control direction and the normal direction can be pre-set and the character movement direction can be obtained according to the result of the operation. The pre-set operation can include various operations such as cross multiplication operation (also called vector product operation). By adjusting the user control direction by the surface direction of the virtual bearing surface, it can be ensured that the obtained character movement direction is more matched with the surface angle of the virtual bearing surface, so that the generated character animation has a more realistic visual effect and is more in line with the physical characteristics of the real world.

[0076] Step S130: acquiring a target animation model whose orientation angle matches the moving direction of the character from animation models of multiple orientation angles pre-configured to correspond to the virtual character, and generating a character animation corresponding to the target animation model.

[0077] In order to quickly and realistically simulate the character animation of each moving direction, multiple animation models with different orientation angles corresponding to the virtual character are pre-configured. Accordingly, the character animation is generated according to the animation model whose orientation angle matches the character's moving direction, thereby ensuring that the character's orientation matches the moving direction of the character animation, thereby improving the authenticity and accuracy of the animation.

[0078] It can be seen that this method can adjust the user control direction according to the surface direction of the virtual bearing surface of the wall type for the special situation of the virtual character moving on the wall, so as to obtain the character movement direction of the virtual character, so as to select a suitable target animation model from multiple animation models with different orientation angles to generate the character animation. Because this method takes into account the surface direction of the virtual bearing surface of the wall type, the adjusted character movement direction is more in line with the characteristics of the wall type, making the character animation more compatible with the virtual bearing surface of the wall type, and thus making the virtual character present different movement characteristics from the virtual bearing surface of the ground type, thereby improving the authenticity and accuracy of the character animation.

[0079] In addition, in order to achieve better technical effects, those skilled in the art may also make various changes and modifications to the above embodiments:

[0080] In an optional implementation, an animation state library for storing animation models of multiple orientation angles is pre-configured, and multiple animation models of each virtual character are uniformly stored through the animation state library. The animation models of multiple orientation angles include: animation models corresponding to multiple different preset orientation angles. The specific values ​​of the multiple different preset orientation angles can be flexibly set. For example, multiple preset orientation angles such as 30 degrees, 60 degrees, 90 degrees, and 120 degrees can be set. The angle between each two adjacent preset orientation angles can be equal so that the multiple preset orientation angles are evenly distributed in the entire angle space; or, the angle between each two adjacent preset orientation angles can also be unequal, so that the angle division granularity in the commonly used angle interval is smaller than the angle division granularity in the uncommon angle interval. The commonly used angle interval is determined according to the angle range that is used more when the character turns.

[0081] In addition, the animation model corresponding to any preset orientation angle in the animation state library may also include: animation models of multiple different action postures. Among them, the action posture is used to characterize the action, orientation, posture, etc. of the virtual character. For example, the action may include: jumping, running, sliding, etc.; the posture may include: the distribution state of the limbs, such as the left hand in front, the right hand in the back, etc. The animation models of multiple different action postures can accurately simulate virtual characters in various states. Correspondingly, based on the above animation state library, the target animation model can be obtained in the following manner: on the one hand, the action posture of the virtual character is obtained (such as the virtual character is standing or squatting, the left hand is facing forward or the right hand is facing forward, etc.), and the action postures of the multiple animation models in the animation state library are matched with the action postures of the virtual character to obtain a first matching result (i.e., the posture matching result), and the first matching result is used to characterize the matching degree of the action standing posture. On the other hand, the preset orientation angles of the multiple animation models in the animation state library are matched with the character moving direction of the virtual character to obtain a second matching result (i.e., the orientation matching result), and the second matching result is used to characterize the matching degree of the orientation and angle. Accordingly, the target animation model is screened out according to the first matching result and the second matching result. Preferably, the animation model with a high matching degree of the first matching result and the second matching result is screened out as the target animation model.

[0082] In addition, different weights can be set for the first matching result and the second matching result, so as to filter the target animation model according to the weight adjustment results corresponding to the first matching result and the second matching result. The weight can be flexibly set according to the motion state and / or motion stage of the virtual character. For example, in the motion state and / or motion stage where the orientation adjustment is more frequent, the weight of the second matching result is greater than the weight of the first matching result; in the motion state and / or motion stage where the posture adjustment is more frequent, the weight of the second matching result is less than the weight of the first matching result. In short, the accuracy of the animation model can be ensured by screening in terms of orientation angle and action posture.

[0083] In addition, the inventors found in the process of implementing the present invention that in some related technologies, when the virtual character is on the wall, the virtual character is fixedly rotated by a preset angle so that the orientation of the rotated virtual character matches the wall. However, since the state of the virtual character in each frame is dynamically changed, and the display position and display angle of the virtual bearing surface in each frame may also change, the method of fixedly rotating the preset angle is relatively rigid and cannot achieve accurate matching of the virtual character with the wall in each frame. In order to solve the above problem, in an optional implementation method, animation processing can be performed in a loop iteration manner. Specifically, for any frame of animation, the state information of the virtual character in the any frame of animation is determined according to the state information of the virtual character in at least one frame of animation before the any frame of animation, so that the state of the virtual character in each frame of animation can be updated in time, and the adjustment of the relevant scenery in the picture can be adapted in time. Among them, the state information mainly includes: the user control direction determined according to the user control instruction of the virtual character, and the action posture of the virtual character. Accordingly, the user control instructions triggered for the virtual character mentioned above may include: user control instructions triggered for the virtual character in the i-th animation frame; the action posture of the virtual character may include: the action posture of the virtual character in the i-th animation frame. In addition, the character animation corresponding to the target animation model may be generated in the following manner: generating a character animation corresponding to the target animation model in the i+m-th animation frame; wherein i and m are natural numbers. wherein m is equal to 1 or greater than 1. When m is greater than 1, the user control instructions triggered for the virtual character mentioned above may include: user control instructions triggered for the virtual character in the i-th animation frame, the i+1-th animation frame...until the i+m-1-th animation frame; the action posture of the virtual character may include: the action posture of the virtual character in the i-th animation frame, the i+1-th animation frame...until the i+m-1-th animation frame.

[0084] Among them, the surface direction of the virtual bearing surface corresponding to the virtual character may include: the surface direction of the virtual bearing surface corresponding to the virtual character in the i-th animation frame, and / or the surface direction of the virtual bearing surface corresponding to the virtual character in the i+m-th animation frame; and the virtual bearing surface corresponding to the virtual character is a wall type may include: the virtual bearing surface corresponding to the virtual character in the i-th animation frame is a wall type, and / or, the virtual bearing surface corresponding to the virtual character in the i+m-th animation frame is a wall type. In addition, when m is greater than 1, the surface direction of the virtual bearing surface corresponding to the virtual character may also include: the surface direction of the virtual bearing surface corresponding to the virtual character in the i+1-th animation frame... until the i+m-1-th animation frame.

[0085] In addition, the inventors found in the process of implementing the present invention that when the virtual character is in different animation switching stages, the corresponding animation models usually have great differences in posture, form, etc. Therefore, in order to facilitate fast and accurate animation simulation, in an optional implementation method, the animation state library may further include: multiple stage animation libraries corresponding to multiple different animation switching stages. Among them, each stage animation library is used to store various types of animation models required in the corresponding animation switching stage. Correspondingly, the target animation model whose orientation angle matches the character's moving direction is obtained in the following manner: according to the animation switching stage corresponding to the virtual character, the stage animation library corresponding to the animation switching stage is selected from the multiple stage animation libraries, and the target animation model whose orientation angle matches the character's moving direction is obtained from the multiple animation models in the stage animation library. By dividing the entire animation process associated with the wall animation into multiple different animation switching stages, it is convenient to flexibly configure animation models with different characteristics for different animation switching stages, thereby meeting the characteristics and requirements of each animation switching stage.

[0086] Among them, the animation switching stage can be divided according to the association between the animation and the wall, and can be divided into: the stage of switching from the ground to the wall, the stage of various switching within the wall, and the stage of switching from the wall to the ground. In addition, the animation switching stage can also be divided according to the action type and / or scene type of the animation, and can be divided into: the stage corresponding to jumping actions, the stage corresponding to sliding actions, and the stage corresponding to running actions; or, it can be divided into: the wall action stage in the underwater scene (such as moving on the wall of the underwater castle), the wall action stage in the ground scene, etc.

[0087] In an optional implementation, the multiple stage animation libraries include at least two of the following: a first stage animation database for simulating a virtual character switching from a non-wall type virtual bearing surface to a wall type virtual bearing surface, a second stage animation database for simulating a virtual character switching actions inside a wall type virtual bearing surface, and a third stage animation database for simulating a virtual character switching from a wall type virtual bearing surface to a non-wall type virtual bearing surface. In addition, the animation switching stage corresponding to the virtual character is determined by obtaining a first judgment result of whether the virtual bearing surface corresponding to the virtual character in the i-th animation frame is of a wall type (used to indicate whether the character is located on the wall at the start stage of the animation), and a second judgment result of whether the virtual bearing surface corresponding to the virtual character in the i+m-th animation frame is of a wall type (used to indicate whether the character is located on the wall at the end stage of the animation). Accordingly, the animation switching stage corresponding to the virtual character is determined according to the first judgment result and the second judgment result. For example, if the first judgment result is no and the second judgment result is yes, then it is determined that the animation switching stage corresponding to the virtual character is the first animation switching stage corresponding to the first-stage animation database (i.e., switching from the ground to the wall), and therefore, the target animation model is obtained from the first-stage animation database; if the first judgment result is yes and the second judgment result is yes, then it is determined that the animation switching stage corresponding to the virtual character is the second animation switching stage corresponding to the second-stage animation database (i.e., switching between walls), and therefore, the target animation model is obtained from the second-stage animation database; if the first judgment result is yes and the second judgment result is no, then it is determined that the animation switching stage corresponding to the virtual character is the third animation switching stage corresponding to the third-stage animation database (i.e., switching from the wall to the ground), and therefore, the target animation model is obtained from the third-stage animation database. In specific implementation, the first-stage animation database is usually used to store various action models with high jumping intensity, such as big strides, strong jumps, etc.; the second-stage animation database is usually used to store fine return action models with smaller action spans, such as return and turn during running or jumping; the third-stage animation database is usually used to store related actions from jumping from a wall to the ground, such as sliding, jumping, flying, etc.

[0088] In an optional implementation, when adjusting the user control direction according to the surface direction of the virtual bearing surface corresponding to the virtual character, factors such as the orientation of the virtual camera may be further considered to achieve more accurate adjustment. Specifically, the user control direction is initially adjusted according to the surface direction of the virtual bearing surface (such as the normal direction) to obtain the initial movement direction of the virtual character; the camera orientation of the virtual camera is obtained, and the initial movement direction is secondary adjusted according to the camera orientation to obtain the character movement direction of the virtual character. Since the camera orientation can indirectly reflect the relative movement of the character, the secondary adjustment method using the camera orientation can help improve the accuracy of the character's movement direction.

[0089] In an optional implementation, in order to make the camera's field of view more matched, before generating the character animation corresponding to the target animation model, the following operations may be further performed: according to the character movement direction of the virtual character, the virtual camera's rocker distance and / or field of view may be adjusted. For example, according to the character movement direction of the virtual character, the virtual camera's rocker distance and / or field of view may be increased to enhance the visual effect of the virtual camera. Optionally, the virtual camera's camera direction may be adjusted according to the angle between the character's movement direction and the virtual camera's camera direction, thereby matching the virtual camera's camera direction with the character's movement direction.

[0090] In an optional implementation, in order to improve the efficiency of character animation generation, an animation generation model can be pre-trained, and the animation generation model can be obtained by training multiple training animation sets. Accordingly, the operations of screening the target animation model and generating the character animation can be implemented by the animation generation model: the character movement direction and / or the action posture of the virtual character are input into the pre-trained animation generation model; according to the output result of the animation generation model, the character animation corresponding to the target animation model is obtained. It can be seen that the animation generation model can automatically predict the character movement direction and / or action posture of the virtual character in the current frame of animation based on the character movement direction and / or action posture of the virtual character in the previous frame of animation, and improve the action coherence of the virtual character through a loop iteration.

[0091] In addition, the animation generation model is also used to select target animation models from the animation state library, and when the number of target animation models is multiple, multiple target animation models can be interpolated and / or fused in the hybrid space to obtain character animation. Among them, the hybrid space is used to combine multiple animation clips (i.e., animation models) in proportion to the animation performance of different parameters (such as angles). For example, the hybrid space can be used to generate more complex and natural animation effects by combining multiple animation clips, which usually involves interpolating or fusion of different animation clips according to certain parameters (such as angles, speeds, directions, etc.) to create a continuous and smooth transition animation. It can be seen that the hybrid space is usually a multidimensional space, and each dimension can correspond to at least one control parameter (such as the direction of character movement or action posture, etc.). In the hybrid space, different animation clips can be combined and interpolated according to the parameter values ​​of the control parameters. In specific implementation, multiple animation clips can be defined in the animation state library, and each animation clip contains a series of key frames to describe the different orientations, actions or states of the character. Then, the parameter value of the control parameter is dynamically determined. For example, the parameter value can be determined according to the character movement direction determined by the user control instruction in the i-th animation frame and the action posture of the virtual character in the i-th animation frame. Finally, a target animation clip that matches the parameter value of the control parameter is selected from multiple animation clips.

[0092] For ease of understanding, the implementation of the above embodiment is described below using an example. This example is described using a controlled character in a game scene as an example. The following first explains some of the related concepts that may be involved in this example:

[0093] Animation State Machine: (Animation State Machine) is a system that controls the animation transition of a character or object. It determines when and how to switch animations through different states (such as walking, running, jumping, attacking, etc.) and transitions between states to achieve a more natural and smooth animation effect.

[0094] Crossfade: An animation jump script in the game engine that supports one-to-one animation transitions, and jumps to the target animation when the batch animation status meets the conditions.

[0095] FOV: (Field of View) refers to the viewing angle range that a camera or visual system can cover.

[0096] The game scene may have large areas of complex landforms such as large canyons and plains. Therefore, traditional character design and game movement methods cannot meet the needs of complex landforms. On the one hand, it is necessary to improve the convenience of players in map movement, such as facilitating the efficient and free movement of characters on cliffs; on the other hand, it is necessary to enhance the novelty of players in the map running experience and bring a different sense of immersion in the new world to the audience, such as special visual experiences such as jungle climbing. In addition, it is also necessary to conform to a certain proportion of physical laws and movement logic in the real world.

[0097] In some related technologies for realizing open world games, virtual characters usually cannot climb on walls and can only walk on the ground. In some other related technologies, although the wall climbing ability is provided, this ability must be achieved with the help of props such as directional hooks to achieve directional displacement, and the effect of flexible climbing cannot be achieved.

[0098] It can be seen that, as the terrain of open world games is becoming more and more diverse, and there are a lot of gameplays designed based on the Z axis and walls, the wall climbing method in the relevant technology is far from meeting user needs. In order to solve the above problems, this example provides a set of realistic and rich wall movement systems that can dynamically adapt to the camera and quickly feedback animation performance related to user operations, thereby ensuring that players can move freely in multiple directions and angles on terrains such as walls and cliffs.

[0099] Figure 2 A flowchart of the method for generating animation of a virtual character in this example is shown. Figure 2 As shown, the method comprises the following steps:

[0100] Step S201: determining whether the virtual bearing surface corresponding to the virtual character is a wall type.

[0101] Among them, no matter the virtual bearing surface currently corresponding to the virtual character is a wall type, or it is predicted that the virtual bearing surface corresponding to the virtual character will be a wall type after the virtual character moves, it can be determined that the virtual bearing surface corresponding to the virtual character is a wall type. The specific reason is that no matter the virtual character is currently on the wall, or the virtual character is about to cross the wall, it means that the subsequent character animation involves wall-related processing, so the wall movement system in this example needs to be enabled.

[0102] Step S202: when the judgment result is yes, in response to the user manipulation instruction triggered for the virtual character, determining the user manipulation direction of the virtual character.

[0103] The user control direction of the virtual character can be determined according to the operation direction of the player user (i.e., the instruction type of the user control instruction). For example, the user control direction can be upward, downward, left, right, diagonally upward or diagonally downward, etc., depending on the instruction parameters contained in the user control instruction.

[0104] Step S203: adjusting the user control direction according to the normal direction of the virtual bearing surface corresponding to the virtual character to obtain the character movement direction of the virtual character.

[0105] Specifically, the character movement direction of the virtual character can be calculated in combination with the normal angle of the wall to which the virtual character is currently attached, and then the action matching degree between the multiple animation models in the animation state library and the current virtual character is calculated. Among them, the normal direction of the virtual bearing surface corresponding to the virtual character can be the normal direction of the virtual bearing surface where the virtual character is located in the animation frame that triggers the user control instruction, so as to reasonably determine the character movement direction of the virtual character according to the tilt state of the virtual bearing surface when the user control instruction is triggered. Alternatively, the normal direction of the virtual bearing surface corresponding to the virtual character can be further determined in combination with the tilt state of the virtual bearing surface in the subsequent animation frame corresponding to the user control instruction, so as to determine the change of the virtual bearing surface in the display state according to the subsequent animation frame, so as to obtain a more accurate character movement direction in combination with the change. For example, assuming that the user triggers the user operation instruction in the i-th animation frame and obtains the user control direction accordingly, the normal direction of the virtual bearing surface corresponding to the virtual character can be determined according to the normal direction of the virtual bearing surface in the i-th animation frame, and can also be further determined in combination with the normal direction of the virtual bearing surface in the i+1-th animation frame.

[0106] Figure 3 A schematic diagram showing the direction of movement of a virtual character is shown. Figure 3 As shown in the figure, assuming that the user control direction determined according to the user control instruction is the vertical upward direction, if the character movement direction is determined directly according to the user control direction, the virtual character will stand on the virtual bearing surface (such as a hillside) in a direction perpendicular to the horizontal plane, which is contrary to the actual physical force situation. By performing a preset operation on the normal direction and the user control direction, the final character movement direction can be made consistent with the slope angle, so that the virtual character stands and moves along the character movement direction, ensuring that it is consistent with the actual physical force situation.

[0107] Step S204: According to the action posture of the virtual character and the moving direction of the character, a target animation model is obtained from the animation state library, and a character animation corresponding to the target animation model is generated.

[0108] Among them, the algorithm can select the animation with the highest score, that is, the most matching animation (that is, the target animation model) from the mixed space of multiple wall movement animations stored in the animation state library for playback. In addition, through the loop iteration method, the corresponding wall movement connection relationship (such as starting, stopping, jumping, turning, and cutting in from outside the game) can be quickly switched when the player's operation changes frequently.

[0109] In the matching process, it is necessary to match the action posture of the virtual character and the direction of the character's movement, so as to use one or more animation models with the highest matching degree as the target animation model. It can be seen that the animation state library stores multiple action postures and animation models facing the character.

[0110] Figure 4 A schematic diagram of the structure of the animation state library is shown in FIG. Figure 4 As shown, the animation state library may include: an animation library for the upper wall stage (i.e., the first stage animation database), an animation library for the inner wall stage (i.e., the second stage animation database), and an animation library for the lower wall stage (i.e., the third stage animation database). Accordingly, the animation state machine mainly includes three parts, which correspond to the state switching processing in the above three animation libraries. For example, the animation library for the upper wall stage includes: an animation jump relationship logic composed of CrossFade, which includes a jump animation from other moving states (i.e., non-wall moving states) to wall movement. The animation library for the lower wall stage includes: a jump relationship from wall movement to another basic moving logic. The animation library for the inner wall stage includes: a jump of the internal relationship of the entire wall movement, such as jumping from continuous movement to the upper left wall to a turning animation, and then transitioning to continuous movement in the right direction, etc. It can be seen that by further subdividing the animation state library into animation libraries corresponding to multiple moving stages, the animation effects of each stage can be accurately simulated, and the accuracy of the animation performance can be improved.

[0111] Among them, the animation library of any stage contains multiple animation models of corresponding stages. In specific implementation, the transition duration can also be configured in advance for the animation models in the animation library of each stage, that is, the switching duration required for switching from the previous animation model to the next animation model. The transition duration can be determined according to the stage in which the animation model is located and / or the action type corresponding to the animation model. For example, the transition duration of the animation model in the animation library of the upper wall stage and / or the animation library of the lower wall stage is greater than the transition duration of the animation model in the animation library of the inner wall stage. The reason is that in the upper wall stage or the lower wall stage, the character often needs to realize the conversion between different actions, such as jumping, diving, etc. Therefore, a longer transition duration can be set to fully reflect the difference between different stages. However, in the inner wall stage, the switching between a series of related actions is mainly completed, such as fast return, etc. Therefore, in order to improve the coherence of the inner wall action switching stage, a shorter transition duration can be set to ensure that the various fine actions such as turning and returning made by the character on the wall can respond quickly. Similarly, the corresponding transition duration may be configured according to the action type corresponding to the animation model. For example, the transition duration of a running type animation model is shorter than the transition duration of a walking type animation model.

[0112] In addition, in the process of generating character animation, the animation generation model can be used to achieve dynamic loop iteration. For example, the action posture and orientation angle of the character animation in the i+1th animation frame are dynamically determined according to the action posture of the character animation in the i-th animation frame and the operation direction corresponding to the user control instruction received in the i-th animation frame. In other words, in the process of generating the current animation frame, it is necessary to input the state information corresponding to the previous animation frame into the animation generation model, so as to obtain the processing result of the current animation frame according to the state information corresponding to the previous animation frame. Among them, the state information corresponding to the previous animation frame includes: the action posture of the virtual character in the previous animation frame, and the user control instruction received in the previous animation frame. It can be seen that the input of the animation generation model is the state information corresponding to the previous animation frame, and the output is the state information corresponding to the current animation frame. Through loop iteration, accurate animation content can be generated frame by frame.

[0113] In the related art, since a large number of reversal animations (i.e., animation models in the animation library of the wall stage) are not configured, the current rotation direction of the character is directly modified when the character turns. For example, when the character needs to switch from running left to running right, the character's direction is directly changed from left to upward, and then to right. However, in this way of directly modifying the character's rotation direction, the character's rotation process will be: first run to the left, then run upward, and finally turn to run to the right, thereby running out a "U"-shaped curved trajectory, which is obviously inconsistent with the real physical motion trajectory, resulting in the animation not being realistic enough. In order to solve the above problems, this example pre-configures multi-angle, multi-position reversal animations in the wall stage animation library, and for each animation frame, it is not a simple rotation of the character's direction, but the state information corresponding to one or more previous animation frames is obtained through the animation generation model, thereby automatically generating the state information corresponding to the current animation frame. In addition, the animation generation model can automatically merge multiple animations of different angles according to the rotation angle through a mixed space or other methods, so as to adapt to obtain a better character animation. Therefore, the character animation generated by this example is always in line with the wall, and there will be no "U"-shaped trajectory that deviates from the wall.

[0114] It can be seen that in this example, for fine movements such as turning back, first, determine the direction angle of the character before turning back, as well as the interaction parameters of the interactive operations triggered by the player on the character, and then calculate the new state information such as the new direction of the character after turning back. Then, obtain one or more animations that match the new state information such as the new direction from the animation state library, and use the hybrid space technology to perform angle rotation, fusion and other processing on the obtained one or more animations, so as to adapt the character animation after turning back. Since the turning back action does not occur instantly, but needs to last for a period of time, and the turning back actions corresponding to multiple animation frames within this period of time are usually slightly different, the method of simply rotating the character at an angle in the related technology cannot accurately adapt the turning back process. This example performs calculations in a frame-by-frame iterative manner through the animation generation model, which can ensure that the turning back action of each frame of animation is more refined and accurate.

[0115] In addition, a variety of action types can be configured in the animation state library, such as running, sliding, etc., so that flexible switching between multiple actions can be achieved.

[0116] In addition, when the Crossfade jump logic is the process of the entire wall moving, it is also necessary to dynamically detect whether the player's input is continuous. For example, when the player's input tends to stop (that is, the user releases the joystick and other control components and no longer triggers new user control instructions), it can be preliminarily determined that it is necessary to use the lower wall stage animation library to exit the wall movement system, or it is necessary to play the preset standby animation or jump animation. In addition, it can also assist in determining the inclination angle of the wall (if the inclination angle is not steep enough, it may cause the character to slide and enter the ground movement system). Moreover, it can also assist in determining whether the attribute of the wall is a sliding attribute, thereby assisting in determining whether sliding is required. For example, the attribute of a wall marked with a sliding tag is a sliding attribute, otherwise it is a non-sliding attribute.

[0117] For example, suppose the client program detects that the player releases the directional joystick 0.2s later, and there is no next input intervention. At this time, if the terrain angle to which the player is attached is less than the wall angle threshold of 40° (indicating that the wall to which the player is attached is not steep enough and will be identified as the ground), and does not meet the sliding condition (that is, the wall scene collision body is not marked with a sliding tag), then it can jump to the idle standby animation accordingly. The idle standby animation can be an animation of the character standing up and preparing to walk in the ground system. In addition, if the wall meets the sliding condition (that is, the wall scene collision body is marked with a sliding tag), the preset sliding animation will be played.

[0118] In addition, during the cyclic movement of the wall itself, by determining the vertical and horizontal parameters of the character's current movement direction, the animation blending space can simulate the wall movement in multiple angles. For example, assuming that the player's horizontal axis movement parameter is at positive 0.72 and the vertical axis movement parameter is at -0.37, the player's direction (i.e. the direction of movement of the virtual character controlled by the player) can be determined to be the upper right movement, and the upper right 30° cyclic movement slide that is a fusion of the upper right 45° and the right right movement animation is played.

[0119] Specifically, the player's horizontal (X-axis) and vertical (Y-axis) movement parameters can be obtained from the game controller or input device. The parameter value range is usually in the range of -1 to 1, and the specific value is used to represent the player's movement strength or direction on the corresponding axis. Among them, the horizontal axis movement parameter is positive 0.72, which means that the character has a tendency to move to the right in the horizontal direction, and the movement strength is relatively large (because 0.72 is close to 1, and 1 usually represents the maximum strength). A positive number indicates movement to the right, and a negative number indicates movement to the left. A vertical axis movement parameter of -0.37 means that the character has a downward movement trend in the vertical direction, but the movement strength is relatively small (because the absolute value of -0.37 is less than 1 and is a negative value). A negative number indicates downward movement, and a positive number indicates upward movement. Therefore, it can be determined that the character is moving in a direction tilted to the lower right at this time. This direction is not purely horizontal or vertical, but a combination of the two. The specific tilt angle can be calculated by the ratio of the above two parameters (or the inverse tangent function). Of course, if the angle does not need to be calculated accurately, the appropriate animation or movement direction can be selected according to the relative size of the parameters. In the above example, an animation between 45° to the upper right and right can be selected from the animation state library to simulate the character moving to 30° to the upper right (or close to this angle).

[0120] In addition, in order to further improve the realism of the character's movement, in this example, the components or parameters related to the virtual camera can be further optimized. Specifically, in terms of the lens, it is possible to look at the reference movement direction of the subject and perform corresponding rotation offsets. In addition, the rocker distance and FOV can be dynamically adjusted according to the current mobile environment to intelligently cooperate with the player's movement, and use a more comfortable field of view direction to assist in improving the wall movement experience.

[0121] For example, the lens can be directed to the subject and rotated to match the direction of movement according to the angle between the player's camera direction and the character's movement direction: when the player's lens is behind the character's left, the system will determine that the user's right field of view needs to be expanded, so the lens's focus center will be slightly moved to the right, and a small angle rotation will be added to give more right space. Through the above adjustment method, the lens's focus direction can always be directed toward the virtual character, ensuring that the virtual character is located in the center of the lens.

[0122] For example, when using the wall movement system to process animations, the virtual camera's arm distance and FOV can also be dynamically adjusted according to the current environment. Because the player's attention will be more focused on the direction of the target that is difficult to see, a larger arm distance is required (for example, the distance between the camera and the character can be adjusted from 4m to 5.5m), and a wider FOV field of view (for example, it can be adjusted from 45° Field of View to 55°), and the camera's initial value is returned when it is stationary. In this way, the player's field of view smoothness during wall-like movement can be optimized.

[0123] In summary, this example can automatically match the wall movement animations in multiple mixed spaces and the corresponding wall movement connection relationships by moving the orientation. In addition, due to the auxiliary role of the lens in the vertical movement of the wall-like surface, the player's wall movement experience in the open world is improved and optimized, providing new impetus for the design packaging and commercial operation of the character. Through this example, players can run and slide smoothly on the wall, jump to the corresponding direction quickly and agilely, and maintain a certain proportion of inertia inheritance in the physical world.

[0124] Figure 5 A schematic diagram of a virtual character animation generation device 40 provided by another embodiment of the present disclosure is shown, the device comprising:

[0125] A response module 41, adapted to determine a user manipulation direction of the virtual character in response to a user manipulation instruction triggered for the virtual character when the virtual bearing surface corresponding to the virtual character is a wall type;

[0126] An adjustment module 42, adapted to adjust the user control direction according to the surface direction of the virtual bearing surface corresponding to the virtual character, so as to obtain the character movement direction of the virtual character;

[0127] The generation module 43 is adapted to obtain a target animation model whose orientation angle matches the moving direction of the character from animation models of multiple orientation angles pre-configured corresponding to the virtual character, and generate a character animation corresponding to the target animation model.

[0128] In an optional implementation, the method further includes: pre-configuring an animation state library for storing the animation models of the multiple orientation angles; wherein the animation models of the multiple orientation angles include: animation models corresponding to multiple different preset orientation angles, respectively, and the animation model corresponding to any preset orientation angle includes: animation models of multiple different action postures;

[0129] Then the generation module is specifically suitable for:

[0130] Acquiring the action posture of the virtual character, matching the action postures of multiple animation models in the animation state library with the action posture of the virtual character to obtain a first matching result;

[0131] Matching the preset orientation angles of the plurality of animation models in the animation state library with the character movement direction of the virtual character to obtain a second matching result;

[0132] The target animation model is acquired according to the first matching result and the second matching result.

[0133] In an optional implementation, the user control instruction triggered for the virtual character includes: the user control instruction triggered for the virtual character in the i-th animation frame; the action posture of the virtual character includes: the action posture of the virtual character in the i-th animation frame;

[0134] The generating module is specifically adapted to: generate a character animation corresponding to the target animation model in the i+mth animation frame; wherein i and m are natural numbers;

[0135] The surface direction of the virtual bearing surface corresponding to the virtual character includes: the surface direction of the virtual bearing surface corresponding to the virtual character in the i-th animation frame, and / or the surface direction of the virtual bearing surface corresponding to the virtual character in the i+m-th animation frame;

[0136] Furthermore, the virtual bearing surface corresponding to the virtual character is of a wall type, including: the virtual bearing surface corresponding to the virtual character in the i-th animation frame is of a wall type, and / or the virtual bearing surface corresponding to the virtual character in the i+m-th animation frame is of a wall type.

[0137] In an optional implementation, the animation state library includes: a plurality of stage animation libraries corresponding to a plurality of different animation switching stages respectively;

[0138] The generation module is specifically adapted to: according to the animation switching stage corresponding to the virtual character, select a stage animation library corresponding to the animation switching stage from the multiple stage animation libraries, and obtain a target animation model with a facing angle matching the moving direction of the character from the multiple animation models in the selected stage animation library.

[0139] In an optional implementation, the multiple stage animation libraries include at least two of the following: a first stage animation database for simulating a virtual character switching from a non-wall type virtual bearing surface to a wall type virtual bearing surface, a second stage animation database for simulating a virtual character switching actions inside a wall type virtual bearing surface, and a third stage animation database for simulating a virtual character switching from a wall type virtual bearing surface to a non-wall type virtual bearing surface;

[0140] Furthermore, the animation switching phase corresponding to the virtual character is determined in the following manner:

[0141] Obtaining a first judgment result of whether the virtual bearing surface corresponding to the virtual character in the i-th animation frame is a wall type, and a second judgment result of whether the virtual bearing surface corresponding to the virtual character in the i+m-th animation frame is a wall type;

[0142] Determining the animation switching stage corresponding to the virtual character according to the first judgment result and the second judgment result;

[0143] Among them, if the first judgment result is no and the second judgment result is yes, then the animation switching stage corresponding to the virtual character is determined to be the first animation switching stage corresponding to the first-stage animation database; if the first judgment result is yes and the second judgment result is yes, then the animation switching stage corresponding to the virtual character is determined to be the second animation switching stage corresponding to the second-stage animation database; if the first judgment result is yes and the second judgment result is no, then the animation switching stage corresponding to the virtual character is determined to be the third animation switching stage corresponding to the third-stage animation database.

[0144] In an optional implementation, the adjustment module is specifically adapted to:

[0145] According to the surface direction of the virtual bearing surface, the user control direction is initially adjusted to obtain an initial moving direction of the virtual character;

[0146] The camera orientation of the virtual camera is obtained, and the initial moving direction is adjusted secondary according to the camera orientation to obtain the character moving direction of the virtual character.

[0147] In an optional implementation, the adjustment module is further adapted to:

[0148] According to the moving direction of the virtual character, the jib distance and / or the field of view of the virtual camera are adjusted; and / or, according to the angle between the moving direction of the character and the camera direction of the virtual camera, the camera direction of the virtual camera is adjusted.

[0149] In an optional implementation, the generating module is specifically adapted to:

[0150] Inputting the character movement direction of the virtual character and / or the action posture of the virtual character into a pre-trained animation generation model;

[0151] Obtaining a character animation corresponding to the target animation model according to an output result of the animation generation model;

[0152] The animation generation model is used to filter the target animation model from the animation state library, and when there are multiple target animation models, multiple target animation models are interpolated and / or fused in a hybrid space to obtain the character animation.

[0153] In an optional implementation, the response module is further adapted to:

[0154] When it is detected that the virtual bearing surface corresponding to the virtual character is of a wall type, the user control direction corresponding to the user control instruction is converted according to the surface direction of the virtual bearing surface of the wall type, so that the user control direction of the user control instruction after the conversion matches the surface direction of the virtual bearing surface.

[0155] In an optional implementation, the virtual character is a controlled character in a virtual scene of a game; and the virtual bearing surface corresponding to the virtual character includes: an object surface of a virtual bearing object corresponding to the virtual character; wherein the virtual bearing object includes at least one of the following: a mountain object, a wall object, and a building object;

[0156] Furthermore, the surface direction of the virtual bearing surface includes the normal direction of the virtual bearing surface; the wall-type virtual bearing surface satisfies the following conditions: the angle between the virtual bearing surface and the horizontal plane is greater than a preset angle threshold, and the surface attribute of the virtual bearing surface is a non-slip attribute.

[0157] Figure 6 A schematic structural diagram of an electronic device according to another embodiment of the present disclosure is shown. The specific embodiment of the present disclosure does not limit the specific implementation of the electronic device.

[0158] like Figure 6 As shown, the electronic device may include: a processor 502 , a communications interface 504 , a memory 506 , and a communications bus 508 . The processor 502 , the communications interface 504 , and the memory 506 communicate with each other via the communications bus 508 .

[0159] The communication interface 504 is used to communicate with other devices such as clients or other servers.

[0160] The processor 502 is used to execute the program 510, and specifically can execute the relevant steps in the above embodiment of the method for generating animation of a virtual character.

[0161] Specifically, the program 510 may include program codes, which include computer operation instructions.

[0162] The processor 502 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present disclosure. The one or more processors included in the electronic device may be processors of the same type, such as one or more CPUs. They may also be processors of different types, such as one or more CPUs and one or more ASICs.

[0163] The memory 506 is used to store the program 510. The memory 506 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0164] The program 510 can be specifically used to enable the processor 502 to execute the corresponding operations in the above-mentioned embodiment of the method for generating animation of a virtual character.

[0165] The algorithms and displays provided herein are not inherently related to any particular computer, virtual device or other device. Various general purpose devices may also be used together with the teachings based thereon. According to the above description, it is apparent that the structure required for constructing such devices is. In addition, the present disclosure is not directed to any particular programming language either. It should be understood that various programming languages ​​may be utilized to implement the disclosure described herein, and the description of the specific languages ​​above is intended to disclose the best mode of implementation of the present disclosure.

[0166] In the description provided herein, a large number of specific details are described. However, it is understood that the embodiments of the present disclosure can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.

[0167] Similarly, it should be understood that in order to streamline the present disclosure and aid in understanding one or more of the various disclosed aspects, in the above description of exemplary embodiments of the present disclosure, various features of the present disclosure are sometimes grouped together into a single embodiment, figure, or description thereof. However, this method of disclosure should not be interpreted as reflecting an intention that the claimed disclosure requires more features than are expressly recited in each claim.

[0168] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.

[0169] In addition, those skilled in the art will appreciate that, although some embodiments herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the present disclosure and form different embodiments. For example, any one of the claimed embodiments may be used in any combination.

[0170] The various component embodiments of the present disclosure may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or digital signal processor (DSP) may be used in practice to implement some or all of the functions of some or all of the components in the device according to the embodiments of the present disclosure. The present disclosure may also be implemented as a device or device program (e.g., a computer program and a computer program product) for executing part or all of the methods described herein. Such a program implementing the present disclosure may be stored on a computer-readable medium, or may have the form of one or more signals. Such a signal may be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.

[0171] It should be noted that the above embodiments illustrate the present disclosure rather than limit the present disclosure, and that those skilled in the art may design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets should not be constructed as a limitation to the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of multiple such elements. The present disclosure may be implemented by means of hardware including several different elements and by means of appropriately programmed computers. In a unit claim that lists several devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc. does not indicate any order. These words may be interpreted as names.

Claims

1. A method for generating an animation of a virtual character, the method comprising: In a case where the virtual bearing surface corresponding to the virtual character is a wall type, in response to a user manipulation instruction triggered for the virtual character, determining a user manipulation direction of the virtual character; According to the surface direction of the virtual bearing surface corresponding to the virtual character, the user control direction is adjusted to obtain the character movement direction of the virtual character; From the pre-configured animation models with multiple orientation angles corresponding to the virtual character, a target animation model with an orientation angle matching the moving direction of the character is obtained, and a character animation corresponding to the target animation model is generated.

2. The method according to claim 1, wherein: The method further comprises: pre-configuring an animation state library for storing the animation models of the plurality of orientation angles; wherein the animation models of the plurality of orientation angles comprise: animation models corresponding to a plurality of different preset orientation angles respectively; Then, obtaining a target animation model whose orientation angle matches the moving direction of the character from animation models of multiple orientation angles pre-configured and corresponding to the virtual character comprises: Matching the preset orientation angles of the plurality of animation models in the animation state library with the character movement direction of the virtual character to obtain orientation matching results of the plurality of animation models; The target animation model is acquired according to the orientation matching results of the multiple animation models.

3. The method according to claim 2, wherein: The animation model corresponding to the preset orientation angle includes: animation models of multiple different action postures; Then, obtaining the target animation model according to the orientation matching results of the multiple animation models includes: Acquiring the action posture of the virtual character, matching the action postures of multiple animation models in the animation state library with the action posture of the virtual character, and obtaining posture matching results of the multiple animation models; The target animation model is acquired according to the orientation matching results of the multiple animation models and the posture matching results.

4. The method according to any one of claims 1 to 3, wherein: The user control instruction triggered for the virtual character includes: the user control instruction triggered for the virtual character in the i-th animation frame; the action posture of the virtual character includes: the action posture of the virtual character in the i-th animation frame; The generating the character animation corresponding to the target animation model comprises: generating the character animation corresponding to the target animation model in the i+mth animation frame; wherein i and m are natural numbers; The surface direction of the virtual bearing surface corresponding to the virtual character includes: the surface direction of the virtual bearing surface corresponding to the virtual character in the i-th animation frame, and / or the surface direction of the virtual bearing surface corresponding to the virtual character in the i+m-th animation frame; Furthermore, the virtual bearing surface corresponding to the virtual character is of a wall type, including: the virtual bearing surface corresponding to the virtual character in the i-th animation frame is of a wall type, and / or the virtual bearing surface corresponding to the virtual character in the i+m-th animation frame is of a wall type.

5. The method according to claim 4, wherein: The animation state library comprises: a plurality of stage animation libraries corresponding to a plurality of different animation switching stages respectively; The method of obtaining a target animation model whose orientation angle matches the moving direction of the character from animation models of multiple orientation angles preconfigured to correspond to the virtual character comprises: selecting a stage animation library corresponding to the animation switching stage from the multiple stage animation libraries according to the animation switching stage corresponding to the virtual character, and obtaining a target animation model whose orientation angle matches the moving direction of the character from the multiple animation models in the selected stage animation library.

6. The method according to claim 5, wherein: The multiple stage animation libraries include at least two of the following: a first stage animation database for simulating a virtual character switching from a non-wall type virtual bearing surface to a wall type virtual bearing surface, a second stage animation database for simulating a virtual character switching actions inside a wall type virtual bearing surface, and a third stage animation database for simulating a virtual character switching from a wall type virtual bearing surface to a non-wall type virtual bearing surface; Furthermore, the animation switching phase corresponding to the virtual character is determined in the following manner: Obtaining a first judgment result of whether the virtual bearing surface corresponding to the virtual character in the i-th animation frame is a wall type, and a second judgment result of whether the virtual bearing surface corresponding to the virtual character in the i+m-th animation frame is a wall type; Determining the animation switching stage corresponding to the virtual character according to the first judgment result and the second judgment result; Among them, if the first judgment result is no and the second judgment result is yes, then the animation switching stage corresponding to the virtual character is determined to be the first animation switching stage corresponding to the first-stage animation database; if the first judgment result is yes and the second judgment result is yes, then the animation switching stage corresponding to the virtual character is determined to be the second animation switching stage corresponding to the second-stage animation database; if the first judgment result is yes and the second judgment result is no, then the animation switching stage corresponding to the virtual character is determined to be the third animation switching stage corresponding to the third-stage animation database.

7. The method according to any one of claims 1 to 6, wherein: The adjusting the user control direction according to the surface direction of the virtual bearing surface corresponding to the virtual character to obtain the character movement direction of the virtual character comprises: According to the surface direction of the virtual bearing surface, the user control direction is initially adjusted to obtain an initial moving direction of the virtual character; The camera orientation of the virtual camera is obtained, and the initial moving direction is adjusted secondary according to the camera orientation to obtain the character moving direction of the virtual character.

8. The method according to any one of claims 1 to 7, wherein: Before generating the character animation corresponding to the target animation model, the method further includes: According to the moving direction of the virtual character, the jib distance and / or the field of view of the virtual camera are adjusted; and / or, according to the angle between the moving direction of the character and the camera direction of the virtual camera, the camera direction of the virtual camera is adjusted.

9. The method according to any one of claims 3 to 8, wherein: The step of acquiring a target animation model whose orientation angle matches the moving direction of the character from animation models of multiple orientation angles pre-configured and corresponding to the virtual character, and generating a character animation corresponding to the target animation model comprises: Inputting the character movement direction of the virtual character and / or the action posture of the virtual character into a pre-trained animation generation model; Generate a character animation corresponding to the target animation model through the animation generation model; Wherein, when there are multiple target animation models, the animation generation model is used to perform interpolation processing and / or fusion processing on the multiple target animation models in the hybrid space to obtain the character animation.

10. The method according to any one of claims 1 to 9, wherein: The method further comprises: When it is detected that the virtual bearing surface corresponding to the virtual character is of a wall type, the user control direction corresponding to the user control instruction is converted according to the surface direction of the virtual bearing surface of the wall type, so that the user control direction after the conversion matches the surface direction of the virtual bearing surface.

11. The method according to any one of claims 1 to 10, wherein: The virtual character is a controlled character in a virtual game scene; Furthermore, the virtual bearing surface corresponding to the virtual character includes: an object surface of a virtual bearing object corresponding to the virtual character; wherein the virtual bearing object includes at least one of the following: a mountain-like object, a wall-like object, and a building-like object; Furthermore, the surface direction of the virtual bearing surface includes the normal direction of the virtual bearing surface; the wall-type virtual bearing surface satisfies the following conditions: the angle between the virtual bearing surface and the horizontal plane is greater than a preset angle threshold, and the surface attribute of the virtual bearing surface is a non-slip attribute.

12. The method according to any one of claims 1 to 11, wherein: The method further comprises: Determining whether the virtual bearing surface corresponding to the virtual character meets a preset wall detection condition, and if so, determining that the virtual bearing surface corresponding to the virtual character is a wall type; The wall detection condition includes: the angle between the virtual bearing surface and the horizontal plane is greater than a preset angle threshold, and the surface property of the virtual bearing surface is a non-slip property.

13. A device for generating an animation of a virtual character, comprising: A response module, adapted to determine a user manipulation direction of the virtual character in response to a user manipulation instruction triggered for the virtual character when the virtual bearing surface corresponding to the virtual character is a wall type; An adjustment module, adapted to adjust the user control direction according to the surface direction of the virtual bearing surface corresponding to the virtual character, so as to obtain the character movement direction of the virtual character; The generation module is adapted to obtain a target animation model whose orientation angle matches the moving direction of the character from animation models of multiple orientation angles pre-configured corresponding to the virtual character, and generate a character animation corresponding to the target animation model.

14. An electronic device comprising: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute the animation generation method of the virtual character according to any one of claims 1-12.

15. A computer storage medium, wherein at least one executable instruction is stored in the storage medium, and the executable instruction enables a processor to execute the method for generating animation of a virtual character according to any one of claims 1 to 12.

16. A computer program product, characterized in that It includes a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the animation generation method of a virtual character as described in any one of claims 1 to 12.