Virtual character motion control method and device, storage medium, and computer equipment
By setting the floating gravity coefficient of the virtual character and synchronously playing the prop animation, the problem of a single animation effect when the virtual character falls is solved, and the expressiveness and game quality of the falling action are improved.
Patent Information
- Application Number
- CN202310852072.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-12
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2043-07-12
AI Technical Summary
The animation effect of the falling virtual character in existing games is poor in expressiveness and authenticity, and the animation effect is single, making it difficult to improve the quality of the game.
By setting the floating gravity coefficient of the virtual character and synchronously playing the prop animation of the floating props, the virtual character can achieve a slow falling effect when falling and improve the expressiveness of the falling action.
It improves the expressiveness of the virtual character's falling movements, provides the game with richer animation effects and gameplay, and enhances the quality and competitiveness of the game.
Smart Images

Figure CN117695651B
Abstract
Description
Technical Field
[0001] The present application relates to the field of game animation technology, and in particular to a method and device for controlling the motion of a virtual character, a storage medium, and a computer device. Background Art
[0002] The animation effects of virtual characters in different motion states in the game are an important factor in reflecting the quality of the game. At present, the falling animation effects of virtual characters in the game are usually presented by playing a pre-made falling animation, which has poor expressiveness and authenticity and a single animation effect. Improving the falling animation effects of virtual characters in the game is crucial to improving the quality of the game. Summary of the invention
[0003] In view of this, the present application provides a motion control method and device for a virtual character, a storage medium, and a computer device, which present an effect of a virtual character "floating" and falling, thereby enhancing the expressiveness of the falling action.
[0004] According to one aspect of the present application, a motion control method for a virtual character is provided, the method comprising:
[0005] In response to a floating state trigger signal of the virtual character, clearing the speed of the virtual character in the vertical direction, and setting the motion parameters of the virtual character according to the target floating parameters corresponding to the virtual character, wherein the target floating parameters include the floating gravity coefficient of the virtual character;
[0006] The virtual character is controlled to perform a falling action based on the motion parameters, and a prop animation of a floating prop used by the virtual character is synchronously played, wherein the floating prop is a virtual resource that affects the floating effect of the virtual character.
[0007] According to another aspect of the present application, a motion control device for a virtual character is provided, the device comprising:
[0008] A parameter setting module, configured to respond to a floating state trigger signal of a virtual character, clear the vertical speed of the virtual character, and set the motion parameters of the virtual character according to a target floating parameter corresponding to the virtual character, wherein the target floating parameter includes a floating gravity coefficient of the virtual character;
[0009] The animation control module is used to control the virtual character to perform a falling action based on the motion parameters, and synchronously play the prop animation of the floating props used by the virtual character, wherein the floating props are virtual resources that affect the floating effect of the virtual character.
[0010] According to another aspect of the present application, a storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the motion control method of the virtual character described above is implemented.
[0011] According to another aspect of the present application, a computer device is provided, including a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein the processor implements the above-mentioned motion control method of a virtual character when executing the program.
[0012] By means of the above technical solution, the present application provides a method and device for controlling the motion of a virtual character, a storage medium, and a computer device. When the virtual character is triggered to enter a floating state, the vertical speed of the virtual character is reset to zero, and the motion parameters of the virtual character are set to the target floating parameters, and at least the gravity coefficient of the virtual character is changed to the floating gravity coefficient, so as to control the virtual character to perform a falling action, and synchronously play the prop animation of the floating props used by the virtual character during the falling process. Compared with the stiff and single character falling effect in the prior art, the present application presents an effect of a virtual character "floating" and falling by controlling the virtual character to perform a falling action based on the floating gravity coefficient and playing the prop animation of the floating props, thereby improving the expressiveness of the falling action, providing a basis for expanding more gameplay and animation effects in the game, and helping to further improve the quality and competitiveness of the game.
[0013] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0015] FIG. 1( a ) is a schematic diagram showing a flow chart of a method for controlling motion of a virtual character provided in an embodiment of the present application;
[0016] FIG1( b ) shows a schematic diagram of a floating effect of a virtual character provided in an embodiment of the present application;
[0017] FIG. 2( a ) is a schematic diagram showing a flow chart of another method for controlling motion of a virtual character provided in an embodiment of the present application;
[0018] FIG2( b ) shows a schematic diagram of a virtual character's shuttle state provided in an embodiment of the present application;
[0019] Figure 3 A schematic diagram of the structure of a motion control device for a virtual character provided in an embodiment of the present application is shown;
[0020] Figure 4 A schematic diagram of the device structure of a computer device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0021] The present application will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other without conflict.
[0022] In this embodiment, a motion control method for a virtual character is provided, as shown in FIG1( a), the method comprising:
[0023] Step 101, in response to a floating state trigger signal of a virtual character, clearing the vertical speed of the virtual character, and setting the motion parameters of the virtual character according to the target floating parameters corresponding to the virtual character, wherein the target floating parameters include the floating gravity coefficient of the virtual character.
[0024] Step 102, controlling the virtual character to perform a falling action based on the motion parameters, and synchronously playing a prop animation of a floating prop used by the virtual character, wherein the floating prop is a virtual resource that affects the floating effect of the virtual character.
[0025] In the embodiment of the present application, when a virtual character in the game world falls after a jump, or falls in a scene such as parachuting, if the virtual character is not required to perform a falling action directly and rigidly under the influence of the gravity conditions of the game world (or directly play a fixed falling animation), but it is desired that the virtual character can slowly fall in a "floating" form, this form of the virtual character slowly falling can be defined as the floating state of the virtual character. For example, as shown in FIG1(b), if the virtual character is expected to open an umbrella when falling, the floating state of the virtual character can be triggered, and the animation state machine can be used to control the virtual character to perform the falling action in the floating state.
[0026] First, when the player manually triggers the floating state trigger signal of the virtual character, or the floating state trigger signal of the virtual character is automatically generated based on a specific event in the game, the speed of the virtual character in the vertical direction is cleared, and the motion parameters of the virtual character are configured according to the preset target floating parameters. Among them, since the falling effect may be affected by the props used by the virtual character, the target floating parameter can be the floating parameter corresponding to the props used when the virtual character falls. The prop model that affects the falling effect of the virtual character is the floating prop. The floating prop can specifically include an umbrella, a parachute, a balloon, and the costumes of the virtual character (such as a cloak). For example, if the virtual character falls with an umbrella, the preset floating parameter corresponding to the umbrella is obtained as the target floating parameter. For another example, if the virtual character falls with a hydrogen balloon, the preset floating parameter corresponding to the hydrogen balloon is obtained as the target floating parameter. The target floating parameter at least includes a floating gravity coefficient, which is less than the real gravity coefficient of the virtual character in the game world. The floating gravity coefficient affects the floating falling speed. In addition, the target floating parameter can also include the maximum acceleration, maximum lateral speed, lateral deceleration, lateral movement control amount, and lateral motion air friction when falling. For example, set the character's own gravity coefficient to 0.1. If it is too small, the floating will be too slow, and if it is too large, it will not appear to be "floating"; set the maximum acceleration to 6150; set the maximum lateral speed when falling to 500; set the lateral deceleration when falling to 0; set the lateral movement control amount when falling to 1; set the lateral motion air friction when falling to 0.
[0027] Next, after setting the motion parameters of the virtual character, the virtual character is controlled to perform the falling action according to the motion parameters. Since the floating gravity coefficient is set to be smaller than the real gravity coefficient of the game world, the virtual character will show a "floating" and slowly falling effect when performing the falling action. In addition, during the falling process of the virtual character, the prop animation of the floating props used by the virtual character is played synchronously, such as the pre-set action performance of an umbrella during floating, so as to make the floating effect more realistic.
[0028] By applying the technical solution of this embodiment, when the virtual character is triggered to enter the floating state, the vertical speed of the virtual character is reset to zero, and the motion parameters of the virtual character are set to the target floating parameters, at least the gravity coefficient of the virtual character is changed to the floating gravity coefficient, so as to control the virtual character to perform the falling action, and synchronously play the prop animation of the floating props used by the virtual character during the falling process. Compared with the stiff and single character falling effect in the prior art, the embodiment of the present application controls the virtual character to perform the falling action based on the floating gravity coefficient and plays the prop animation of the floating props, presenting an effect of the virtual character "floating" and falling, which improves the expressiveness of the falling action, provides a basis for expanding more gameplay and animation effects in the game, and helps to further improve the quality and competitiveness of the game.
[0029] In the embodiment of the present application, optionally, before step 101, it also includes: when the virtual character is in any motion state, in response to a jump state trigger signal, determining whether the first current motion state of the virtual character belongs to a pre-jump state, wherein the pre-jump state is a motion state that can be directly switched to a jump state; if the first current motion state of the virtual character belongs to the pre-jump state, then based on the first current motion parameter of the virtual character, calculating the jump end condition of the virtual character's current jump state, and controlling the virtual character to perform a jumping action within the jump end condition; when the jump end condition is met, generating the floating state trigger signal.
[0030] In this embodiment, when the virtual character is in the process of performing a jumping action in the jumping state and the jumping end condition is met, the jumping is ended and a floating state trigger signal is generated, and the floating state is automatically entered. Specifically, in response to the jumping state trigger signal, it is first determined whether the virtual character meets the conditions for entering the jumping state. If the first current motion state of the virtual character currently belongs to a preset pre-jump state, it is considered that the conditions for entering the jumping state are met, wherein the pre-jump state includes a standing state, a running state, and other motion states that can be directly switched to the jumping state; then, the jumping end condition of the virtual character's current jumping state is calculated, and during the process of the virtual character performing the jumping action, it is detected whether the jumping end condition has been met. If it is met, the jumping state is ended, and a floating state trigger signal is automatically generated to enter the floating state.
[0031] Optionally, the calculating of the jumping end condition of the virtual character in this jumping state based on the first current motion parameter of the virtual character includes: calculating the duration of the current jumping state of the virtual character based on the current vertical acceleration of the virtual character, the jumping gravity coefficient and the gravity of the virtual world, and the jumping end condition includes the duration.
[0032] In this embodiment, when the virtual character starts to jump, the time required to reach the highest point of the jump (i.e., duration) is calculated by the initial velocity at the time of jumping (instantaneous vertical acceleration) * Z component of the current world gravity * -1 * the character's own gravity coefficient. When this time is reached, the character will begin to fall.
[0033] In the embodiment of the present application, optionally, before step 101, it also includes: when the virtual character is in any motion state, in response to a floating state trigger operation, determining whether the second current motion state of the virtual character belongs to a floating pre-state, wherein the floating pre-state is a motion state that can be directly switched to the floating state; if the second current motion state of the virtual character belongs to the floating pre-state, generating the floating state trigger signal.
[0034] In this embodiment, the player can also manually trigger the virtual character to enter the floating state. For example, when the virtual character is on a high-altitude flying object, the player can manually input the floating state trigger operation. The game system determines whether the virtual character currently meets the conditions for entering the floating state. Specifically, it determines whether the second current motion state of the virtual character belongs to the floating pre-state. Similar to the above-mentioned jump pre-state, the floating pre-state is a motion state that can be directly switched to the floating state. If the virtual character is currently in the floating pre-state, a floating state trigger signal is generated to trigger the virtual character to enter the floating state. In addition, in addition to state judgment, it is also possible to further judge whether other conditions of the virtual character meet the conditions for entering the floating state, such as whether the virtual character is in a position where it can fall. If the virtual character is in a position where it cannot fall, such as flat ground, even if the player triggers it to enter the input floating state trigger operation, the operation will be determined as an invalid operation.
[0035] Furthermore, the embodiment of the present application also provides a motion control method of a "shuttle state", where the shuttle state of a virtual character means that after selecting several targets, the virtual character moves quickly to each target in turn. For example, the virtual character uses props to set several monsters that it wants to attack as shuttle targets, generates afterimages of the props at the shuttle targets, and the virtual character moves to several afterimages in turn to complete the shuttle motion. The embodiment of the present application also provides another motion control method for a virtual character, as shown in FIG2(a), the method comprising:
[0036] Step 201: upon receiving a shuttle state trigger operation of the virtual character, determining at least one shuttle target, and acquiring a plurality of shuttle animation clips based on the number of the shuttle targets.
[0037] Step 202: Create an animation montage, and set the shuttle animation clip in the animation montage.
[0038] Step 203, triggering the first action notification of the animation montage, determining the first bone displacement of the virtual character based on the initial position of the virtual character and the first target position corresponding to the first shuttle target, and playing the first shuttle animation clip based on the first bone displacement.
[0039] Step 204, triggering a second action notification when the first shuttle animation clip is played to a preset frame, and when the first shuttle animation clip is finished playing, determining the second root bone displacement of the virtual character based on the current position of the virtual character and the second target position of the second shuttle target, and playing the second shuttle animation clip based on the second root bone displacement until all shuttle animation clips are played.
[0040] In the above embodiment, the rootmotion technology is used to realize the rapid shuttle of the virtual character between multiple targets. Rootmotion is a game animation development technology, and the root skeleton displacement is a part of the combination of the movement group and the animation system, indicating that the overall movement of the character (including physics) is driven by animation. When the player triggers the virtual character to enter the shuttle state, first determine the multiple shuttle targets indicated by the player or automatically determine multiple shuttle targets, and obtain a certain number of shuttle animation clips. Specifically, the number of selected shuttle animation clips is one more than the number of shuttle targets. Then, create an animation montage, set the above-mentioned shuttle animation clips in the montage, and use the created animation montage to control the virtual character to complete the shuttle action. Among them, when the virtual character shuttles, it moves from the initial position to the first shuttle target, the second shuttle target..., the last shuttle target in turn, and finally returns to the initial position. The first shuttle animation clip is automatically triggered to play. Specifically, the first action notification is automatically generated when the virtual character enters the shuttle state. When the virtual character moves from the initial position to the first shuttle target, the animation performance is the first shuttle animation clip. The root bone displacement of the virtual character is calculated based on the initial position, the first target position of the first shuttle target and the preset shuttle duration.
[0041] Next, when the first shuttle animation clip is played to a preset frame, the second action notification is triggered. When the first shuttle animation clip is played and the virtual character moves to the first shuttle target, the virtual character continues to move from the first shuttle target to the second shuttle target. Specifically, according to the current position of the virtual character, the second target position of the second shuttle target, and the preset shuttle duration, the second bone displacement of the virtual character is calculated, and the second shuttle animation clip is played based on the second bone displacement. This process is repeated until all shuttle animation clips are played and the virtual character returns to the initial position.
[0042] In the embodiment of the present application, if the shuttle targets are unordered, the shuttle order of the virtual character should be determined before the virtual character shuttles. Optionally, before determining the first bone displacement of the virtual character based on the initial position of the virtual character and the first target position corresponding to the first shuttle target, the method further includes: querying the first shuttle target in the shuttle targets based on the initial position of the virtual character;
[0043] Accordingly, the method further includes: when the playback of the first shuttle animation clip is finished, marking the first shuttle target with a shuttled tag, and based on the current location of the virtual character, querying the second shuttle target among the shuttle targets that are not marked with the shuttled tag; when all the shuttle targets are marked with the shuttled tag, determining the final root bone displacement of the virtual character based on the final target position of the last shuttle target and the initial position of the virtual character, and playing the last shuttle animation clip based on the final root bone displacement.
[0044] In the above embodiment, after receiving the virtual character shuttle instruction triggered by the game player, the first search range is determined according to the initial position of the virtual character, for example, a sphere with the initial position as the center and a preset radius is the first search range, and all shuttle targets with collision attributes are queried within the first search range. The shuttle target closest to the initial position of the virtual character is determined from all the queried shuttle targets as the first shuttle target, and the first action of the animation montage is played (that is, the first shuttle animation clip of the virtual character shuttling to the first shuttle target position is played). The virtual character completes the movement to the first shuttle target, triggering the first action notification of the animation montage (that is, the movement end notification). Continue to search for the second shuttle target at the current position of the virtual character (that is, the first shuttle target position). Similar to the method for searching the first shuttle target, the second search range can be determined according to the current position of the virtual character, and all shuttle targets with collision attributes are queried within the second search range. The shuttle target closest to the initial position of the virtual character is determined from all the queried shuttle targets as the second shuttle target. In addition, since the virtual character has completed the movement to the first shuttle target, the first shuttle target can be marked with a shuttled label, so that when searching for the second shuttle target, the shuttle target that is not marked with the shuttled label and is closest to the virtual character is searched in the second search range as the second shuttle target, so as to ensure that the second shuttle target is the shuttle target that is closest to the current position of the virtual character in the second search range and has not moved to its position before. And so on, the movement of the virtual character to each shuttle target is gradually completed until the virtual character completes the movement to all shuttle targets, all shuttle targets will be marked with the shuttled label, and then the initial position of the virtual character is used as the final position of the virtual character to return, and the virtual character is completed from the last shuttle target to the initial position.
[0045] Taking the example of a game player triggering a virtual character to move to multiple umbrella targets, after the player triggers the shuttle command, the first action notification is triggered, the first search range is determined and the first umbrella within the first search range is queried, the virtual character shuttles to the first umbrella, the animation montage plays the first shuttle animation clip, and when it moves to the first umbrella, the second action notification is triggered, the second search range is continued to be determined and the second umbrella is found within the range, and so on to complete the shuttle to all umbrellas.
[0046] It should be noted that if a search range does not contain a shuttle target that is not marked with a shuttle tag, then even if there is a shuttle target that is not marked with a shuttle tag outside the search range, the virtual character will exit the shuttle state. Specifically, the virtual character can directly stay at the current position and exit the shuttle state, or return to the initial position from the current position in the shuttle state and then exit the shuttle state.
[0047] In addition, after the first action notification of the animation montage is triggered, according to the first search range corresponding to the initial position of the virtual character, the shuttle target closest to the virtual character is queried among the shuttle targets in the first search range as the first shuttle target. After the virtual character is controlled to complete the movement to the first shuttle target, the first shuttle target can be deleted from the shuttle targets, and the second search range corresponding to the current position of the virtual character is continued to be determined, and the shuttle target closest to the virtual character is queried from the remaining shuttle targets as the second shuttle target, until the virtual character completes the movement to the last shuttle target and returns to the initial position from the last shuttle target.
[0048] Taking the above-mentioned "generating an afterimage of a prop at the shuttle target, and the virtual character moving to several afterimages in turn to complete the shuttle movement" as an example, when the virtual character completes the movement to a prop afterimage, the afterimage can continue to exist until the virtual character completes the movement to all prop afterimages and returns to the initial position, and then directly deletes the prop afterimages at various locations or deletes them based on the player's instructions. It is also possible to directly delete the afterimage when the virtual character completes the movement to a prop afterimage.
[0049] In addition, the shuttle targets can be all determined at the beginning of the shuttle, or new shuttle targets can be generated based on player selection or automatic triggering during the virtual character's shuttle process and new shuttle targets can be continuously added until the virtual character completes the movement to all shuttle targets and returns to the initial position, ending the shuttle state.
[0050] Step 205 : in the shuttle state of the virtual character, in response to a shuttle state exit signal, determine the stop position of the virtual character based on the current root bone position of the virtual character.
[0051] In this embodiment, if the player does not interrupt the shuttling state of the virtual character, the virtual character will return to the initial position and stay there after the shuttling ends. If the player interrupts the shuttling state of the virtual character, since the virtual character performs root bone displacement calculation during the shuttling process, the current root bone position of the virtual character can be determined when the player triggers the shuttling state exit signal, and the virtual character can be controlled to stay at this position.
[0052] In a specific implementation, for example, if there are three shuttle targets, then four action clips (A, B, C, D) are set, and a certain frame of each animation clip triggers an action notification, and the notification content is: 1. Search for the target within the specified spherical range, and record the target information and determine the coordinates of the final target point. 2. According to the target, detect whether the movement has been triggered. 3. Set the rootmotion data structure parameters, including but not limited to the following parameters: AccumulateMode = Override, Priority = 1000, TargetLocation (target location), StartLocation (starting location), Duration (duration), FinishVelocityParams (end speed). 4. Pass in the engine movement component to perform rootmotion movement calculation. Among them, accumulateMode represents the cumulative acceleration mode, override means each overwrite, and the other is additvie means accumulation on the basis of the previous one; Priority: priority, compared with other rootmotions, the higher the value, the higher the priority.
[0053] After the above four steps are completed, the character will quickly shuttle from the current point to the target point. When the montage is played from segment A to segment B, the animation notification in segment B will also be triggered. The animation will be executed in sequence to segment D, and the character will return to the starting point, as shown in Figure 2(b). In this way, the entire rapid shuttle performance between multiple targets is completed. If the montage is interrupted, the character will stay on the shuttle path.
[0054] Further, as a specific implementation of the method in FIG. 1 , the present application embodiment provides a motion control device for a virtual character, such as Figure 3 As shown, the device comprises:
[0055] A parameter setting module, configured to respond to a floating state trigger signal of a virtual character, clear the speed of the virtual character in the vertical direction, and set the motion parameters of the virtual character according to a target floating parameter corresponding to the virtual character, wherein the target floating parameter includes a floating gravity coefficient of the virtual character;
[0056] The animation control module is used to control the virtual character to perform a falling action based on the motion parameters, and synchronously play the prop animation of the floating props used by the virtual character, wherein the floating props are virtual resources that affect the floating effect of the virtual character.
[0057] Optionally, the device further comprises: a signal generating module, configured to:
[0058] When the virtual character is in any motion state, in response to a jump state trigger signal, determining whether the first current motion state of the virtual character belongs to a pre-jump state, wherein the pre-jump state is a motion state that can be directly switched to a jump state;
[0059] If the first current motion state of the virtual character belongs to the pre-jump state, a jump end condition of the current jump state of the virtual character is calculated based on the first current motion parameter of the virtual character, and the virtual character is controlled to perform a jump action within the jump end condition;
[0060] When the jump end condition is met, the floating state trigger signal is generated.
[0061] Optionally, the signal generating module is further used to calculate the duration of the current jumping state of the virtual character based on the current vertical acceleration of the virtual character, the jumping gravity coefficient and the gravity of the virtual world, and the jumping end condition includes the duration.
[0062] Optionally, the signal generating module is further used to:
[0063] When the virtual character is in any motion state, in response to a floating state triggering operation, determining whether the second current motion state of the virtual character belongs to a floating pre-state, wherein the floating pre-state is a motion state that can be directly switched to a floating state;
[0064] If the second current motion state of the virtual character belongs to the floating pre-state, the floating state trigger signal is generated.
[0065] Optionally, the animation control module is further used to:
[0066] Upon receiving a shuttle state trigger operation of the virtual character, determining at least one shuttle target, and acquiring a plurality of shuttle animation clips based on the number of the shuttle targets;
[0067] Creating an animation montage, and setting the shuttle animation clip in the animation montage;
[0068] triggering a first action notification of the animation montage, determining a first bone displacement of the virtual character based on an initial position of the virtual character and a first target position corresponding to a first shuttle target, and playing a first shuttle animation clip based on the first bone displacement;
[0069] When the first shuttle animation clip is played to a preset frame, a second action notification is triggered, and when the first shuttle animation clip is finished playing, the second bone displacement of the virtual character is determined based on the current position of the virtual character and the second target position of the second shuttle target, and the second shuttle animation clip is played based on the second bone displacement until all the shuttle animation clips are played.
[0070] Optionally, the animation control module is further used to:
[0071] Before determining the first bone displacement of the virtual character based on the initial position of the virtual character and the first target position corresponding to the first shuttle target, querying the first shuttle target in the shuttle targets based on the initial position of the virtual character;
[0072] When the first shuttle animation clip is finished playing, the first shuttle target is marked with a shuttled tag, and based on the current location of the virtual character, a second shuttle target is searched for in the shuttle targets that are not marked with the shuttled tag;
[0073] When all shuttle targets are marked with shuttled tags, the final root bone displacement of the virtual character is determined based on the final target position of the last shuttle target and the initial position of the virtual character, and the last shuttle animation clip is played based on the final root bone displacement.
[0074] Optionally, the animation control module is further used to:
[0075] In the shuttle state of the virtual character, in response to a shuttle state exit signal, the stop position of the virtual character is determined based on the current root bone position of the virtual character.
[0076] It should be noted that for other corresponding descriptions of the functional units involved in the motion control device for a virtual character provided in an embodiment of the present application, reference can be made to the corresponding descriptions in the methods of Figures 1 to 2, which will not be repeated here.
[0077] The present application also provides a computer device, which may be a personal computer, a server, a network device, etc. Figure 4As shown, the computer device includes a bus, a processor, a memory and a communication interface, and may also include an input and output interface and a display device. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store location information. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the steps in each method embodiment are implemented.
[0078] Those skilled in the art will understand that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0079] In one embodiment, a computer-readable storage medium is provided. The computer-readable storage medium may be non-volatile or volatile, and stores a computer program thereon. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0080] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0081] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0082] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0083] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0084] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for controlling the motion of a virtual character, characterized in that: The method comprises: In response to a floating state trigger signal of the virtual character, clearing the speed of the virtual character in the vertical direction, and setting the motion parameters of the virtual character according to the target floating parameters corresponding to the virtual character, wherein the target floating parameters include the floating gravity coefficient of the virtual character; Controlling the virtual character to perform a falling action based on the motion parameters, and synchronously playing a prop animation of a floating prop used by the virtual character, wherein the floating prop is a virtual resource that affects the floating effect of the virtual character; Upon receiving a shuttle state trigger operation of the virtual character, determining at least one shuttle target, and acquiring a plurality of shuttle animation clips based on the number of the shuttle targets; Creating an animation montage, and setting the shuttle animation clip in the animation montage; triggering a first action notification of the animation montage, determining a first bone displacement of the virtual character based on an initial position of the virtual character and a first target position corresponding to a first shuttle target, and playing a first shuttle animation clip based on the first bone displacement; When the first shuttle animation clip is played to a preset frame, a second action notification is triggered, and when the first shuttle animation clip is finished playing, the second bone displacement of the virtual character is determined based on the current position of the virtual character and the second target position of the second shuttle target, and the second shuttle animation clip is played based on the second bone displacement until all the shuttle animation clips are played.
2. The method according to claim 1, characterized in that The method further comprises: When the virtual character is in any motion state, in response to a jump state trigger signal, determining whether the first current motion state of the virtual character belongs to a pre-jump state, wherein the pre-jump state is a motion state that can be directly switched to a jump state; If the first current motion state of the virtual character belongs to the pre-jump state, a jump end condition of the current jump state of the virtual character is calculated based on the first current motion parameter of the virtual character, and the virtual character is controlled to perform a jump action within the jump end condition; When the jump end condition is met, the floating state trigger signal is generated.
3. The method according to claim 2, characterized in that The step of calculating the jumping end condition of the virtual character in the current jumping state based on the first current motion parameter of the virtual character includes: Based on the current vertical acceleration of the virtual character, the jumping gravity coefficient and the gravity of the virtual world, the duration of the current jumping state of the virtual character is calculated, and the jumping end condition includes the duration.
4. The method according to claim 1, characterized in that The method further comprises: When the virtual character is in any motion state, in response to a floating state triggering operation, determining whether the second current motion state of the virtual character belongs to a floating pre-state, wherein the floating pre-state is a motion state that can be directly switched to a floating state; If the second current motion state of the virtual character belongs to the floating pre-state, the floating state trigger signal is generated.
5. The method according to any one of claims 1 to 4, characterized in that Before determining the displacement of the first bone of the virtual character based on the initial position of the virtual character and the first target position corresponding to the first shuttle target, the method further includes: Based on the initial position of the virtual character, querying a first shuttle target among the shuttle targets; Accordingly, the method further comprises: When the first shuttle animation clip is finished playing, the first shuttle target is marked with a shuttled tag, and based on the current location of the virtual character, a second shuttle target is searched for in the shuttle targets that are not marked with the shuttled tag; When all shuttle targets are marked with shuttled tags, the final root bone displacement of the virtual character is determined based on the final target position of the last shuttle target and the initial position of the virtual character, and the last shuttle animation clip is played based on the final root bone displacement.
6. The method according to any one of claims 1 to 4, characterized in that The method further comprises: In the shuttle state of the virtual character, in response to a shuttle state exit signal, the stop position of the virtual character is determined based on the current root bone position of the virtual character.
7. A motion control device for a virtual character, characterized in that: The device comprises: A parameter setting module, configured to respond to a floating state trigger signal of a virtual character, clear the speed of the virtual character in the vertical direction, and set the motion parameters of the virtual character according to a target floating parameter corresponding to the virtual character, wherein the target floating parameter includes a floating gravity coefficient of the virtual character; An animation control module, used to control the virtual character to perform a falling action based on the motion parameters, and synchronously play the prop animation of the floating prop used by the virtual character, wherein the floating prop is a virtual resource that affects the floating effect of the virtual character; The animation control module is further used to: determine at least one shuttle target under the condition of receiving the shuttle state trigger operation of the virtual character, and obtain multiple shuttle animation clips based on the number of the shuttle targets; create an animation montage and set the shuttle animation clip in the animation montage; trigger a first action notification of the animation montage, determine the first bone displacement of the virtual character based on the initial position of the virtual character and the first target position corresponding to the first shuttle target, and play the first shuttle animation clip based on the first bone displacement; trigger a second action notification when the first shuttle animation clip is played to a preset frame, and when the first shuttle animation clip is finished, determine the second bone displacement of the virtual character based on the current position of the virtual character and the second target position of the second shuttle target, and play the second shuttle animation clip based on the second bone displacement, until all shuttle animation clips are played.
8. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
9. A computer device comprising a storage medium, a processor, and a computer program stored in the storage medium and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 6 is implemented.
