Game role processing method and device and computer program product
By adjusting the playback magnification and stride distance of the animation model, a sequence of motion images of the game character in the game scene is generated, which solves the problem of the game character sliding when switching speeds and achieves natural animation transitions and improved realism.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NETEASE (HANGZHOU) NETWORK CO LTD
- Filing Date
- 2024-11-12
- Publication Date
- 2026-05-12
AI Technical Summary
In existing technologies, game characters are prone to slipping when switching speeds, resulting in inconsistencies between the animation and the actual position, which undermines the user's immersion, especially in demanding scenarios.
By acquiring the movement path and speed of the game character in the game scene, adjusting the playback magnification and stride distance of the corresponding image sequence of the animation model, a motion image sequence is generated to ensure a smooth transition of the game character between different speeds.
It reduces the slippage phenomenon, realizes natural animation transitions between different speeds for game characters, improves the smoothness and realism of the animation, and meets the needs of high-quality animation production.
Smart Images

Figure CN122006252A_ABST
Abstract
Description
Technical Field
[0001] This specification relates to the field of computer graphics technology, and in particular to a method, apparatus, and computer program product for processing game characters. Background Technology
[0002] Game characters typically need to switch between various movement modes and speeds when moving in-game, such as from stationary to walking, from walking to running, and switching between different running speeds. However, current methods often result in a slippage phenomenon when the character's speed needs to change. This is a discrepancy between the animation and the actual position, making the character appear to be sliding in the scene rather than walking or running naturally. This phenomenon usually disrupts the user's immersion and feels unrealistic. The slippage problem is particularly pronounced in demanding scenarios, such as realistic natural environments or highly dynamic interactive scenes. Summary of the Invention
[0003] This specification provides one or more embodiments of a method for processing a game character. The method includes: obtaining a playback magnification of an image sequence corresponding to an animation model of the game character, the playback magnification being determined based on the movement path and movement speed of the game character in a game scene; generating a motion image sequence of the game character in the game scene based on the animation model of the game character, the playback magnification, the movement path, and the movement speed, the motion image sequence comprising an image sequence corresponding to the animation model played at the playback magnification; wherein the image sequence corresponding to the animation model includes keyframes and one or more transition frames located between any two adjacent keyframes, the keyframes including at least a jump frame and a fall frame; the horizontal position of the game character's axis of rotation in the fall frame is shifted forward by a step distance compared to the horizontal position in the jump frame.
[0004] According to one or more embodiments of this specification, the game character is a quadruped, and in the take-off frame, the horizontal plane of the game character's front two legs is higher than the horizontal plane of its rear two legs; in the fall frame, the horizontal plane of the game character's rear two legs is higher than the horizontal plane of its front two legs.
[0005] According to the method provided in one or more embodiments of this specification, in different playbacks of the image sequence corresponding to the animation model, the vertical position of the axis of the game character in the same keyframe and / or the stride distance are different.
[0006] According to one or more embodiments of the method provided in this specification, the keyframe further includes a start frame located before the jump frame and an end frame located after the fall frame.
[0007] According to one or more embodiments of the present specification, the vertical position of the axis of the game character is different in at least one keyframe among the start frame, the jump frame, the fall frame and the end frame.
[0008] According to one or more embodiments of this specification, the method further includes, before obtaining the playback magnification of the image sequence corresponding to the animation model of the game character, detecting whether a preset condition is met; if the preset condition is not met, the movement path, the movement speed, and the playback magnification are preset.
[0009] According to one or more embodiments of this specification, the method further includes, before obtaining the playback magnification of the image sequence corresponding to the animation model of the game character, the method further includes: detecting whether a preset condition is met; the method further includes, when the preset condition is met, obtaining the player character's operation data and preset strategy, and determining the real-time movement path and real-time movement speed of the game character in the game scene in real time based on the operation data and preset strategy; obtaining the playback magnification of the image sequence corresponding to the animation model of the game character includes: obtaining the playback magnification in real time based on the real-time movement path and real-time movement speed of the game character in the game scene.
[0010] According to one or more embodiments of this specification, the method further includes: adjusting in real time the stride distance and / or the vertical position of the game character's axis of rotation in at least one keyframe in the image sequence corresponding to the animation model based on a preset animation curve function, the movement path, and the movement speed.
[0011] According to one or more embodiments of this specification, the method further includes, before obtaining the playback multiplier of the image sequence corresponding to the animation model of the game character, the method includes: detecting whether a preset condition is met; obtaining the playback multiplier of the image sequence corresponding to the animation model of the game character includes: when the preset condition is met, obtaining the player character's operation data and preset strategy, and obtaining the real-time movement path and real-time movement speed of the game character in the game scene in real time according to the operation data and preset strategy; selecting a corresponding set of parameter values from a plurality of preset parameter values of the animation model according to the real-time movement path and real-time movement speed of the game character in the game scene, wherein the parameter values include the playback multiplier, and the animation models with different parameter values correspond to different gaits of the game character.
[0012] According to the method provided in one or more embodiments of this specification, each of the multiple sets of parameter values also includes the stride distance and / or the vertical position of the game character's axis of rotation in at least one keyframe.
[0013] According to one or more embodiments of this specification, the preset conditions include: detecting that the game character needs to respond to the actions of other game characters to perform corresponding actions.
[0014] According to one or more embodiments of this specification, the game character is a non-player character, or the game character is a quadruped.
[0015] One or more embodiments of this specification also provide a processing device for a game character, comprising: an acquisition module, configured to acquire a playback magnification of an image sequence corresponding to an animation model of the game character, the playback magnification being determined based on the movement path and movement speed of the game character in a game scene; and a generation module, configured to generate a motion image sequence of the game character in a game scene based on the animation model of the game character, the playback magnification, the movement path, and the movement speed, the motion image sequence comprising an image sequence corresponding to the animation model played at the playback magnification; wherein the image sequence corresponding to the animation model includes keyframes and one or more transition frames located between any two adjacent keyframes, the keyframes including jump frames and fall frames; and the horizontal position of the game character's axis of rotation in the fall frame is shifted forward by a step distance compared to the horizontal position in the jump frame.
[0016] One or more embodiments of this specification also provide a computer program product, including a computer program that, when at least a portion of the computer program is executed by a processor, can implement the game character processing method described in some embodiments of this specification.
[0017] In one or more embodiments of this specification, when generating a sequence of motion images of a game character in a game scene based on an animation model of the game character, the game character is not moving in place in the image sequence corresponding to the animation model itself. The horizontal position of the game character's axis of rotation in the image frame has shifted. The horizontal position of the game character's axis of rotation in the falling frame has moved forward by a step distance compared to the horizontal position in the jumping frame. During the movement of the animation model in the game scene, the playback magnification of the image sequence corresponding to the animation model and the step distance can be adjusted to match the appropriate step speed of the game character during the movement, reducing the slippage phenomenon. Moreover, the transition between different speeds in the same state of the game character can be controlled, achieving a smooth and natural animation speed switch. Attached Figure Description
[0018] This specification will be further described by way of exemplary embodiments, which will be described in detail with reference to the accompanying drawings. The same numbers in the drawings denote the same structures or steps.
[0019] Figure 1A and Figure 1B These are schematic diagrams of two keyframes in the image sequence corresponding to the animation model of a game character in some embodiments.
[0020] Figure 2 This is a flowchart illustrating the methods for processing game characters according to some embodiments of this specification.
[0021] Figure 3A and Figure 3B These are schematic diagrams of an embodiment of the take-off frame and the fall frame, respectively.
[0022] Figure 3C and Figure 3D These are schematic diagrams of an embodiment of the start frame and the end frame.
[0023] Figure 4 This is a flowchart illustrating the processing method for game characters in some other embodiments of this specification.
[0024] Figure 5 This is a flowchart illustrating the processing method for game characters in some other embodiments of this specification.
[0025] Figure 6 This is a schematic diagram of the logic framework of a game character processing device according to some embodiments of this specification. Detailed Implementation
[0026] To more clearly illustrate the technical solutions of the embodiments in this specification, the embodiments will be described in detail below with reference to the accompanying drawings. Obviously, the content described below are some examples or embodiments of this specification. For those skilled in the art, without creative effort, the technical solutions or means disclosed in this specification can be applied to other scenarios based on this technical content.
[0027] It should be understood that the terms "system," "device," "unit," and / or "module" used in this specification are a method of distinguishing different components, elements, parts, sections, or assemblies at different levels. However, if other terms can achieve the same purpose, they may be replaced by other expressions.
[0028] Unless otherwise specified, the technical terms used to describe components, elements, etc. in this specification are not singular but may include plural. Generally speaking, terms such as "comprising" or "including" only indicate that explicitly identified steps, elements, or components are included, and these steps, elements, and components do not constitute an exclusive list, as the described method or apparatus may also include other steps or components.
[0029] This specification uses flowcharts to illustrate the operational steps performed by the apparatus or system of related embodiments. However, unless otherwise specified, the order in which these steps are described should not be construed as a limitation on the order of execution. Those skilled in the art can adjust the order of these steps based on the knowledge and information conveyed by the embodiments in this specification. Such adjustments include, but are not limited to, reversing the order of steps, merging multiple steps, and splitting a step.
[0030] In some embodiments of the game, the animation model of the game character adopts the root motion mode, that is, the position of the game character's axis remains unchanged in the animation, and what is presented is an animation clip of the game character moving in place. The movement of the game character in the scene is shown by moving the animation model corresponding to the game character in the scene.
[0031] Figure 1A and Figure 1B These are schematic diagrams of two keyframes in an image sequence corresponding to the animation model of a game character in some embodiments. The image sequence includes two keyframes and multiple transition frames between them. Figure 1A and Figure 1B As shown, in these two keyframes, the game character's axis M only changes in the vertical direction, remaining unchanged in the horizontal direction. That is, the horizontal coordinate of axis M remains constant at x0 in both keyframes. Figure 1A The vertical coordinate in the keyframe shown is y1. Figure 1B The vertical coordinate in the keyframe changes to y2. By playing the image sequence at the corresponding speed, the animated model shows the game character jumping in place. By moving the animated model within some game scenes while playing the corresponding animation clip at a matching speed, it shows the game character jumping forward at a constant speed within that game scene.
[0032] In some game implementations, different gaits require different animation models for game characters. When displaying different gaits of a game character, the game engine calls different animation models to play at corresponding speeds and controls the animation models to move with corresponding displacements in the scene to achieve the different gaits of the game character. For example, the animation model for a walking game character is an animation clip of the game character stepping in place at a corresponding speed, while the animation model for a running game character is an animation clip of the game character jumping in place at a corresponding speed. Since the axis of the game character in the animation model remains unchanged, resulting in a constant speed, adjusting the playback rate of the original animation will change the overall rhythm of the animation. For example, if the game character in this animation has a small stride, but the speed to be displayed is running speed, and the actual stride is large, and the only thing that can be changed is the playback speed of the animation, then it is equivalent to actually displaying the animation model moving in small steps and quickly, which does not match the actual situation and results in a strange presentation effect. Therefore, the animation model of the root motion mode cannot use a single animation model to adapt to multiple speeds, but different animation models must be used to adapt to different speeds respectively.
[0033] In this approach, because the game character in the animation model moves in place, to avoid slipping, these animation models are only suitable for constant speed playback and movement within the game scene with a fixed stride. When handling animation transitions, when switching the game character's gait, for example, after determining that the game character needs to run, the animation clip is directly switched from walking to running, such as an instantaneous speed change from 20 to 100. If other speeds are needed, new animation clips must be added to correspond to those speeds. This results in multiple speed settings and adjustments during game design, which is not conducive to rapid game validation and is inefficient. Furthermore, when switching these animation models to achieve game character transitions between different speeds, it is difficult to precisely control the matching between the playback speed of the animation model and the actual walking speed of the game character.
[0034] Therefore, some embodiments of this specification propose a method for processing game characters that can reduce sliding phenomena and achieve smooth and natural animation speed switching.
[0035] Figure 2 This is a flowchart illustrating a method for processing game characters according to some embodiments of this specification. In some embodiments, Figure 2 The process 200 of the game character processing method shown can be executed by a processing device. Specifically, process 200 can be implemented by a game character processing device 600 deployed on the processing device. Figure 2 As shown, the process 200 of the game character handling method may include the following steps.
[0036] Step S201 involves obtaining the playback magnification of the image sequence corresponding to the game character's animation model. The playback magnification is determined based on the game character's movement path and speed in the game scene. In some embodiments, step S201 can be implemented by the acquisition module 601.
[0037] In some embodiments, the image sequence corresponding to the animation model may include keyframes and one or more transition frames located between any two adjacent keyframes. Keyframes may include jump frames and fall frames.
[0038] Figure 3A and Figure 3B These are schematic diagrams of an embodiment of the jump frame and the fall frame. In some embodiments, the game character can be a quadruped or a bipedal animal capable of jumping or falling. Taking a quadrupedal game character as an example, such as... Figure 3A As shown, in the take-off frame, the horizontal plane of the game character's front two feet is higher than the horizontal plane of its rear two feet; as Figure 3B As shown, in the falling frame, the horizontal plane of the game character's rear two feet is higher than the horizontal plane of its front two feet. Furthermore, the horizontal coordinate x2 of the game character's axis of rotation N in the falling frame is shifted forward by a step distance X compared to its horizontal position x1 in the jumping frame. The game character's movement is formed by repeatedly playing the image sequence corresponding to the animation model. It can be understood that the playback ratio of this image sequence can remain constant, thus presenting the game character as moving at a constant speed; or, the playback ratio of this image sequence can change at different times, thus presenting the game character as moving at a varying speed.
[0039] Step S202 involves generating a sequence of motion images of the game character within the game scene based on the game character's animation model, playback magnification, movement path, and movement speed. In some embodiments, step S202 can be implemented by the generation module 602.
[0040] In some embodiments, the motion image sequence is fused together with an image sequence corresponding to the animation model, played at a playback speed, and an image sequence corresponding to the scene. Animation clips corresponding to the game character and scene images are fused together to form an image of the game character moving within the scene.
[0041] Compared to some examples where a single gait of a game character uses a single animation model and can only be played at a constant speed, in one or more embodiments of this specification, when generating a sequence of motion images of the game character in a game scene based on the animation model, the game character is not moving in place in the image sequence corresponding to the animation model itself. The horizontal position of the game character's axis of rotation in the image frame has shifted. The horizontal position of the game character's axis of rotation in the falling frame has moved forward by a stride distance compared to the horizontal position in the jumping frame. During the movement of the animation model in the game scene, the playback speed and stride distance of the image sequence corresponding to the animation model can be adjusted to match the appropriate walking speed of the game character during movement, thereby reducing slippage. Furthermore, the transition between different speeds in the same state of the game character can be controlled, achieving smooth and natural animation speed switching.
[0042] In some embodiments, the vertical position and / or stride distance of the game character's axis of rotation in the same keyframe can differ in different playbacks of the image sequence corresponding to the animation model. In some embodiments, the image sequence corresponding to the animation model includes images 1 to n, and the movement of the animation model is displayed by looping through images 1 to n, where each playback refers to one loop of images 1 to n. The different vertical positions and / or stride distances of the game character's axis of rotation in different playbacks allow for the implementation of different gaits of the game character using a single animation model, eliminating the need for different animation models as in some other solutions. For example, in a slow jogging state, the game character's take-off and landing heights are low, and the airtime is short; correspondingly, the vertical position of the game character's axis of rotation in the take-off and landing frames is low, and the stride distance is small. In a fast jogging state, the game character's take-off and landing heights are high, and the airtime is long; correspondingly, the vertical position of the game character's axis of rotation in the take-off and landing frames is high, and the stride distance is large.
[0043] The embodiments described in this specification can be applied to game clients or game servers. The game client can be a smartphone, tablet, computer, augmented reality (AR) device, or other smart electronic device, and there are no limitations on this. For example, when the game client is running, in response to the player character's request, the game engine renders the game scene in real time according to the game character processing method described in this specification.
[0044] In some embodiments, the game engine can set preset conditions and, before step S201, perform a step to detect whether the preset conditions are met. Different processing is applied to the game character based on whether the preset conditions are met. For example, the game engine can detect whether the game character needs to respond to the actions of other game characters to determine if the preset conditions are met. When it is detected that the game character needs to respond to the actions of other game characters, it is determined that the preset conditions are met. Furthermore, based on different detection results, motion image sequences of the game character in the game scene are generated in different ways.
[0045] In some examples, the game character can be either a non-player character or a player character. The game character can interact with other game characters in different ways in different game scenarios.
[0046] When not interacting with other game characters, a game character's walking speed, gait, and path within the scene can be pre-set. The vertical and horizontal positions of the axis of its image sequence in each keyframe of each loop playback can also be pre-set. The game engine can then call upon the game character's animation model based on the pre-set vertical and horizontal positions and playback magnification to render the pre-set game scene.
[0047] When game characters need to interact with other game characters—for example, when a non-player character needs to respond to player character actions—the game engine can also obtain the operation data and preset strategies of other game characters. Based on this data and strategies, it determines the real-time movement path and speed of the game character within the game scene and obtains the playback speed in real time. Therefore, the game engine can call upon the game character's animation model based on the real-time playback speed to render the corresponding game scene visuals.
[0048] In some embodiments, the game engine determines whether a preset condition is met. This preset condition might be that the game engine detects that the game character needs to respond to actions performed by other game characters. In some examples, the game character can be a non-player character. As a non-player character, it can have states where it interacts with player characters or states where it does not. The game engine can detect whether the non-player character needs to respond to actions performed by other player characters.
[0049] Figure 4 This is a flowchart illustrating a method for processing game characters according to other embodiments of this specification. In some embodiments, Figure 4The process 400 of the game character processing method shown can be executed by a processing device; specifically, process 400 can be implemented by a game character processing device 600 deployed on the processing device. For example... Figure 4 As shown, the process 400 for handling game characters may include the following steps.
[0050] Step S401: Check whether the preset conditions are met.
[0051] For example, the preset condition could be that the game character needs to interact with other game characters, or more specifically, that the game engine detects that the game character needs to respond to the actions of other game characters. The game engine can determine whether the preset condition is met by detecting whether the game character needs to respond to the actions of other game characters. When it detects that the game character needs to respond to the actions of other game characters, it is determined that the preset condition is met. When it detects that the game character does not need to respond to the actions of other game characters, it is determined that the preset condition is not met. In some embodiments, step S401 can be implemented by the detection module 603.
[0052] Step S402: If the preset conditions are not met, obtain the preset playback magnification of the image sequence corresponding to the animation model of the game character. The preset playback magnification can be determined based on the preset movement path and preset movement speed of the game character in the game scene. In some embodiments, step S402 can be implemented by the acquisition module 601.
[0053] In some embodiments, the game engine detects whether a game character needs to respond to actions performed by other game characters. When no action is detected requiring a response from another game character, i.e., when preset conditions are not met, the game character's movement path, movement speed, and playback speed can be preset. This playback speed can be calculated and determined based on the game character's preset movement path and speed in the game scene, and is preset within the game engine.
[0054] In some embodiments, when the preset conditions are met, such as when it is detected that the game character needs to respond to the operation of other game characters (e.g., a game character that is not a player character needs to respond to the operation of a player character) to perform a corresponding action, the operation data and preset strategies of other game characters can also be obtained, and the real-time movement path and real-time movement speed of the game character in the game scene can be determined in real time based on the operation data and preset strategies.
[0055] Step S403: Generate a sequence of motion images of the game character in the game scene based on the game character's animation model, a preset playback magnification, a preset movement path, and a preset movement speed. In some embodiments, step S403 can be implemented by the generation module 602.
[0056] When rendering a game scene, the game engine can obtain a pre-set playback magnification to set the playback of the game character's animation clips in the motion image sequence. In some embodiments, the game character can be a non-player character. Since the game character is a non-player character, its walking speed, gait, and path in the scene can be pre-set before interaction with the player character. The vertical and horizontal positions of the axis centers in each keyframe of the image sequence in each loop playback can also be pre-set. The game engine can call the game character's animation model based on the pre-set playback magnification, preset movement path, and preset movement speed to generate a motion image sequence of the game character in the game scene.
[0057] Figure 5 This is a flowchart illustrating a method for processing game characters according to other embodiments of this specification. In some embodiments, Figure 5 The game character processing method flow 500 shown can be executed by a processing device; specifically, flow 500 can be implemented by a game character processing device 600 deployed on the processing device. For example... Figure 5 As shown, the process 500 for handling game characters may include the following steps.
[0058] Step S501: Check whether the preset conditions are met.
[0059] Further explanation of the preset conditions can be found in step S401, and will not be repeated here.
[0060] Step S502: When the preset conditions are met, acquire the player character's operation data and preset strategy, and determine the game character's real-time movement path and real-time movement speed in the game scene based on the player character's operation data and preset strategy.
[0061] In some embodiments, when the game engine detects that a game character needs to respond to the actions of other game characters, that is, when preset conditions are met, it can obtain the operation data and preset strategies of other game characters, and determine the real-time movement path and real-time movement speed of the game character in the game scene in real time based on the operation data and preset strategies of other game characters.
[0062] For example, if the game character is a non-player character that the player character is attacking, when the game engine detects that the player character is attacking the game character, it obtains the specific attack operation of the player character and calculates the real-time movement speed and real-time movement path of the game character in response to the specific attack operation based on the game's preset strategy.
[0063] Step S503: Obtain the playback multiplier in real time based on the game character's real-time movement path and speed in the game scene.
[0064] In some embodiments, the game engine can calculate and determine the playback multiplier of the image sequence corresponding to the game character's animation model based on the game character's real-time movement path and speed in the game scene.
[0065] Step S504: Generate a sequence of motion images of the game character in the game scene based on the game character's animation model, playback magnification, real-time movement path, and real-time movement speed.
[0066] Further explanation regarding the generation of motion image sequences of game characters in the game scene can be found in step S202, and will not be repeated here.
[0067] In some embodiments, when preset conditions are met, such as when the game engine detects that a game character needs to respond to the actions of other game characters, the vertical position of the axis of the game character's animation model's corresponding image sequence in different playbacks and / or the stride distance can be adjusted in real time according to the player character's operation data and preset strategies. For example, the vertical and horizontal positions of the game character's axis of rotation in each keyframe are adjustable. By setting the vertical and horizontal positions of the game character in each keyframe, the gait and speed of the game character can be adjusted.
[0068] In some embodiments, by keeping the axis fluctuation of the game character small in all keyframes and adjusting the stride distance to the stride of the game character when walking, and in conjunction with the playback magnification, the image sequence corresponding to the animation model of the game character can be looped to present the animation effect of the game character walking.
[0069] In other embodiments, by maintaining a moderate degree of axial undulation of the game character in all keyframes and adjusting the stride distance to match the stride length of the game character when running, and in conjunction with the playback magnification, the image sequence corresponding to the game character's animation model can be looped to present the animation effect of the game character running; on this basis, by changing the stride length and playback magnification, the running speed of the game character can be further adjusted.
[0070] In some examples, when preset conditions are met, such as when a game character needs to respond to the actions of other game characters, the game engine can also adjust the stride distance and / or the vertical position of the game character's axis of rotation in at least one keyframe in real time based on preset animation curve functions, movement paths, and movement speeds. Since the movement path and speed are obtained in real time based on the player character's operation data and preset strategies when preset conditions are met, the game engine can also call preset animation curve functions to calculate the vertical and / or horizontal position of the axis of rotation in each keyframe of the image sequence corresponding to the animation model during each loop playback, based on the real-time obtained movement path and speed. This allows for precise control over the speed adjustment of each gait of the game character, ensuring that the game character maintains stable and natural steps in different movement states. This not only solves the slippage problem but also improves the smoothness and realism of the animation, thereby greatly enhancing the expressiveness of the game character, meeting the needs of high-quality animation production, and providing a more flexible and efficient solution for the production of game character motion animations.
[0071] In some embodiments, the keyframe may further include a start frame preceding the jump frame and an end frame following the fall frame. For example... Figure 3C and Figure 3D As shown, Figure 3C and Figure 3D These are schematic diagrams of an embodiment of the start frame and end frame. Taking a quadrupedal game character as an example, in both the start and end frames, the game character's four legs are on the same horizontal plane, and the vertical coordinate of the game character's axis N is y0. In the start and end frames, the horizontal coordinates of the game character's axis N are x3 and x4, respectively, where x3 is less than x1 and x4 is greater than x2. By adding start and end frames, the vertical and horizontal positions of the game character's axis can be more precisely controlled in each loop of the image sequence corresponding to the game character's animation model, making the game character's movements in the animation more realistic.
[0072] Optionally, the horizontal position of the game character's axis of rotation in the take-off frame can be shifted forward by a first distance compared to its horizontal position in the starting frame, and the horizontal position of the game character's axis of rotation in the ending frame can be shifted forward by a second distance compared to its horizontal position in the falling frame. These first and second distances can be the same as or different from the stride distance. These first and second distances can be freely set or fixed, and are not limited here.
[0073] In some embodiments, when preset conditions are met, the game engine may not calculate the playback multiplier of the image sequence corresponding to the game character's animation model in real time based on real-time movement speed and real-time movement distance. Instead, the game engine may preset multiple sets of parameter values. After obtaining the real-time movement path and real-time movement speed of the game character in the game scene based on the player character's operation data and preset strategies, the game engine may select a corresponding set of parameter values from the multiple sets of parameter values preset for the animation model based on the real-time movement path and real-time movement speed. Each of the multiple sets of parameter values may include a playback multiplier, and animation models with different parameter values may correspond to different gaits of the game character.
[0074] Optionally, each of the multiple sets of parameter values may also include stride distance and / or the vertical position of the game character's axis of rotation in at least one keyframe. This eliminates the need for the game engine to call animation curve functions to calculate the game character's stride distance and vertical position of the axis of rotation in real time, thus saving computational resources.
[0075] Some embodiments of this specification also propose a device for processing game characters. Figure 6 This is a schematic diagram of the logic framework of a game character processing device according to some embodiments of this specification. For example... Figure 6 As shown, the game character processing device 600 may include an acquisition module 601 and a generation module 602.
[0076] The acquisition module 601 is used to acquire the playback magnification of the image sequence corresponding to the animation model of the game character. The playback magnification is determined based on the movement path and movement speed of the game character in the game scene.
[0077] The generation module 602 is used to generate a sequence of motion images of the game character in the game scene based on the game character's animation model, playback magnification, movement path, and movement speed. The sequence of motion images includes a sequence of images corresponding to the animation model played at the playback magnification.
[0078] The image sequence corresponding to the game character's animation model includes keyframes and one or more transition frames between any two adjacent keyframes. Each keyframe includes at least a jump frame and a fall frame. The game character's axis of rotation in the fall frame moves forward a step distance compared to its horizontal position in the jump frame.
[0079] In some embodiments, the game character processing device 600 may further include a detection module 603 for detecting whether preset conditions are met. The acquisition module 601, when acquiring the playback magnification of the image sequence corresponding to the game character's animation model, specifically acquires the player character's operation data and preset strategy when the detection module 603 determines that the preset conditions are met. It can also acquire the game character's real-time movement path and speed in the game scene based on the player character's operation data and preset strategy; and select a corresponding set of parameter values from multiple preset parameter values of the animation model based on the game character's real-time movement path and speed in the game scene. Each of the aforementioned multiple sets of parameter values may include a playback magnification, and animation models with different parameter values may correspond to different gaits of the game character. As an example, the preset conditions may include detecting that the game character needs to respond to the actions of other game characters to perform corresponding actions.
[0080] Optionally, each of the aforementioned sets of parameter values may also include stride distance and / or the vertical position of the game character's axis of rotation in at least one keyframe.
[0081] In some optional embodiments, the game character processing device 600 may further include: a determining module 604, configured to acquire player character operation data and preset strategies when preset conditions are met, and determine the real-time movement path and real-time movement speed of the game character in the game scene based on the player character operation data and preset strategies. When acquiring the playback magnification of the image sequence corresponding to the game character's animation model, the acquiring module 601 can acquire the playback magnification in real-time based on the game character's real-time movement path and real-time movement speed in the game scene.
[0082] In some alternative embodiments, the game character processing device 600 may further include: an adjustment module 605, used to adjust the stride distance and / or the vertical position of the game character's axis in at least one keyframe in real time according to a preset animation curve function, movement path and movement speed.
[0083] For more information on each module, please refer to [link / reference]. Figures 2-5 The relevant explanations will not be repeated here. It should be understood that... Figure 6The apparatus and modules shown can be implemented in various ways. For example, in some embodiments, the apparatus and modules can be implemented in hardware, software, or a combination of both. The hardware portion can be implemented using dedicated logic; the software portion can be stored in memory and executed by an appropriate instruction execution system, such as a microprocessor or dedicated-design hardware. Those skilled in the art will understand that the methods and systems described above can be implemented using computer-executable instructions and / or included in the control code of a processor, such as on a media such as a disk, CD, or DVD-ROM, or in the memory of a programmable device. The systems and modules of this specification can be implemented not only with hardware circuits such as very large-scale integrated circuits or gate arrays, semiconductors such as logic chips or transistors, or programmable hardware devices such as field-programmable gate arrays or programmable logic devices, but also with software, for example, executed by various types of processors, or with a combination of the aforementioned hardware circuits and software (e.g., firmware).
[0084] It should be noted that the above description of the system and its modules is for convenience only and should not be construed as limiting this specification to the embodiments described. It is understood that those skilled in the art, after understanding the principles of this system, may arbitrarily combine the various modules without departing from these principles to form subsystems connected to other modules. Alternatively, some modules may be split to obtain more modules or multiple units under a single module. Such modifications are all within the scope of this specification.
[0085] Some embodiments of this specification also provide a computer program product, including computer instructions or computer code, which, when at least a portion of the computer instructions or computer code is executed by a processor, can implement the methods described in some embodiments of this specification. In some embodiments, the computer program product may involve only computer instructions or computer code, and may be carried on a storage medium or processing device. In other embodiments, the computer program product may also be a storage medium or processing device containing the aforementioned computer instructions or computer code. The processing device may include one or more processors, and the storage medium.
[0086] The beneficial effects that the embodiments of this specification may bring include, but are not limited to: (1) When generating the motion image sequence of the game character in the game scene based on the animation model of the game character, since the animation model moves in the game scene, the playback magnification and stride distance of the image sequence corresponding to the animation model can be adjusted to match the appropriate step speed of the game character during movement, thereby reducing the slippage phenomenon. (2) By adjusting the playback magnification and stride distance of the image sequence corresponding to the animation model to match the appropriate step speed of the game character during movement, the transition between different speeds in the same state of the game character can be controlled, thereby achieving smooth and natural animation speed switching. (3) By calling the preset animation curve function to calculate the vertical position and / or horizontal position of the axis center in each key frame of the image sequence corresponding to the animation model during each loop playback based on the real-time obtained movement path and movement speed, the speed adjustment of each gait of the game character can be precisely controlled, thereby ensuring that the game character can maintain a stable and natural gait in different movement states. This not only solves the slippage problem, but also improves the smoothness and realism of the animation. (4) By adding start and end frames, the vertical and horizontal positions of the game character's axis of rotation in each loop of the image sequence corresponding to the game character's animation model can be controlled more precisely, making the game character's movements in the animation more realistic. (5) By using parameters such as stride distance and / or the vertical position of the game character's axis of rotation in keyframes, the game engine does not need to call the animation curve function to calculate the stride distance and vertical position of the game character's axis of rotation in real time, thus saving computing power. It should be noted that different embodiments may produce different beneficial effects. In different embodiments, the beneficial effects that may be produced can be any one or a combination of the above, or any other possible beneficial effects.
[0087] The basic concepts have been described above. It is obvious that the detailed disclosure above is merely illustrative and does not constitute a limitation of this specification. Although not explicitly stated herein, various modifications, improvements, and corrections may be made to this specification by those skilled in the art. Such modifications, improvements, and corrections are taught in this specification and therefore remain within the spirit and scope of the exemplary embodiments described herein.
Claims
1. A method for processing game characters, comprising: The playback magnification of the image sequence corresponding to the animation model of the game character is obtained, and the playback magnification is determined based on the movement path and movement speed of the game character in the game scene; Based on the game character's animation model, the playback magnification, the movement path, and the movement speed, a motion image sequence of the game character in the game scene is generated, the motion image sequence including an image sequence corresponding to the animation model played at the playback magnification; The image sequence corresponding to the animation model includes keyframes and one or more transition frames located between any two adjacent keyframes. The keyframes include at least a jump frame and a fall frame. The game character's axis of rotation shifts forward a step distance in the horizontal position of the falling frame compared to its horizontal position in the jumping frame.
2. The method for processing game characters according to claim 1, characterized in that, The game character is a quadruped. In the take-off frame, the horizontal plane of the game character's front two legs is higher than the horizontal plane of its rear two legs; in the fall frame, the horizontal plane of the game character's rear two legs is higher than the horizontal plane of its front two legs.
3. The method for processing game characters according to claim 1, characterized in that, In different playbacks of the image sequence corresponding to the animation model, the vertical position of the game character's axis of rotation and / or the stride distance are different in the same keyframe.
4. The method for processing game characters according to claim 1, characterized in that, The keyframes also include a start frame preceding the jump frame and an end frame following the fall frame.
5. The method for processing game characters according to claim 4, characterized in that, The vertical position of the game character's axis of rotation differs in at least one of the keyframes: the start frame, the jump frame, the fall frame, and the end frame.
6. The method for processing game characters according to claim 1, characterized in that, Before obtaining the playback magnification of the image sequence corresponding to the animation model of the game character, the method further includes: detecting whether a preset condition is met; If the preset conditions are not met, the movement path, the movement speed, and the playback magnification are preset.
7. The method for processing game characters according to claim 1, characterized in that, Before obtaining the playback magnification of the image sequence corresponding to the animation model of the game character, the method further includes: detecting whether a preset condition is met; The method further includes: When the preset conditions are met, the player character's operation data and preset strategy are obtained, and the real-time movement path and real-time movement speed of the game character in the game scene are determined in real time based on the operation data and preset strategy. The process of obtaining the playback magnification of the image sequence corresponding to the game character's animation model includes: The playback multiplier is obtained in real time based on the game character's real-time movement path and speed in the game scene.
8. The method for processing game characters according to any one of claims 1 to 7, characterized in that, The method further includes: The stride distance and / or the vertical position of the game character's axis of rotation in at least one keyframe are adjusted in real time according to the preset animation curve function, the movement path, and the movement speed.
9. The method for processing game characters according to claim 1, characterized in that, Before obtaining the playback magnification of the image sequence corresponding to the animation model of the game character, the method further includes: detecting whether a preset condition is met; The process of obtaining the playback magnification of the image sequence corresponding to the game character's animation model includes: When the preset conditions are met, the player character's operation data and preset strategy are obtained, and the game character's real-time movement path and real-time movement speed in the game scene are obtained in real time based on the operation data and preset strategy. Based on the real-time movement path and speed of the game character in the game scene, a corresponding set of parameter values is selected from multiple sets of parameter values preset by the animation model. The parameter values include the playback multiplier, and the animation models with different parameter values correspond to different gaits of the game character.
10. The method for processing game characters according to claim 9, characterized in that, Each of the multiple sets of parameter values also includes the stride distance and / or the vertical position of the game character's axis of rotation in at least one keyframe.
11. The method for processing game characters according to claim 6, 7, or 9, characterized in that, The preset conditions include: detecting that the game character needs to respond to the actions of other game characters to perform corresponding actions.
12. The method for processing game characters according to claim 1, characterized in that, The game character is either a non-player character or a quadruped.
13. A device for processing game characters, comprising: The acquisition module is used to acquire the playback magnification of the image sequence corresponding to the animation model of the game character, wherein the playback magnification is determined based on the movement path and movement speed of the game character in the game scene; The generation module is used to generate a sequence of motion images of the game character in the game scene based on the animation model of the game character, the playback magnification, the movement path, and the movement speed. The sequence of motion images includes a sequence of images corresponding to the animation model that are played at the playback magnification. The image sequence corresponding to the animation model includes keyframes and one or more transition frames located between any two adjacent keyframes. The keyframes include jump frames and fall frames. The game character's axis of rotation shifts forward a step distance in the horizontal position of the falling frame compared to its horizontal position in the jumping frame.
14. A computer program product, characterized in that, Includes a computer program that, when at least a portion of the computer program is executed by a processor, enables the implementation of the method as described in any one of claims 1 to 12.