WO2022198971A1 - 一种虚拟角色的动作切换方法、装置及存储介质 - Google Patents

一种虚拟角色的动作切换方法、装置及存储介质 Download PDF

Info

Publication number
WO2022198971A1
WO2022198971A1 PCT/CN2021/121352 CN2021121352W WO2022198971A1 WO 2022198971 A1 WO2022198971 A1 WO 2022198971A1 CN 2021121352 W CN2021121352 W CN 2021121352W WO 2022198971 A1 WO2022198971 A1 WO 2022198971A1
Authority
WO
WIPO (PCT)
Prior art keywords
animation
action
frame
frames
switching
Prior art date
Application number
PCT/CN2021/121352
Other languages
English (en)
French (fr)
Inventor
陈铁
Original Assignee
完美世界(北京)软件科技发展有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 完美世界(北京)软件科技发展有限公司 filed Critical 完美世界(北京)软件科技发展有限公司
Publication of WO2022198971A1 publication Critical patent/WO2022198971A1/zh

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/50Controlling the output signals based on the game progress
    • A63F13/52Controlling the output signals based on the game progress involving aspects of the displayed game scene

Definitions

  • the present invention relates to the field of computers, and in particular, to a method, device and storage medium for action switching of a virtual character.
  • the actions of game characters are displayed through frame animation, but frame animation is used to do it.
  • frame animation is used to do it.
  • the present invention provides an action switching method and device for a virtual character, so as to at least solve the technical problem in the related art that the fluency of the action display is poor when the virtual character performs the action switching.
  • an action switching method for a virtual character which is applied to a 2D game.
  • the method includes: when the virtual character is showing a first frame of animation corresponding to a first action, obtaining Action switching information to the virtual character, the action switching information is used to instruct to switch the action of the virtual character from the first action to the second action; according to the part of the animation not shown in the first frame of animation generating a temporary animation corresponding to the first action, the number of animation frames included in the temporary animation is less than the number of animation frames included in the partial animation; and, in response to the action switching information, stop displaying the first animation One frame of animation, and the temporary animation and the second frame of animation corresponding to the second action are displayed in sequence.
  • generating the temporary animation corresponding to the first action according to the partial animation not shown in the first frame of animation includes: extracting key animation frames from the partial animation; The temporal sequences in the partial animations are connected to obtain the temporary animation.
  • an action switching device for a virtual character, which is applied to a 2D game.
  • the device includes: an acquisition module for displaying a first frame corresponding to a first action when the virtual character is showing In the case of animation, the action switching information of the virtual character is obtained, and the action switching information is used to instruct to switch the action of the virtual character from the first action to the second action;
  • the partial animation not shown in the first frame of animation generates a temporary animation corresponding to the first action, and the number of animation frames included in the temporary animation is less than the number of animation frames included in the partial animation; and, showing
  • the module is configured to, in response to the action switching information, stop displaying the first frame of animation, and sequentially display the temporary animation and the second frame of animation corresponding to the second action.
  • a storage medium is further provided, where the storage medium includes a stored program, and the above method is executed when the program runs.
  • an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor executes the above method through the computer program.
  • a computer program product which includes a computer program/instruction, and when the computer program/instruction is executed by a processor, implements the steps of the above method.
  • the action switching information of the virtual character is obtained when the virtual character is displaying the first frame of animation corresponding to the first action,
  • the action switching information is used to indicate that the action of the virtual character is switched from the first action to the second action;
  • the temporary animation corresponding to the first action is generated according to the partial animation not shown in the first frame of animation, and the number of animation frames included in the temporary animation It is less than the number of animation frames included in some animations; in response to the action switching information, the display of the first frame of animation is stopped, and the temporary animation and the second frame of animation corresponding to the second action are displayed in turn.
  • the action switching information of the virtual character is obtained to instruct to switch the action of the virtual character from the first action to the second action, and the first action is generated according to the part of the animation not shown in the first frame of animation.
  • the temporary animation is played first and then the second frame of animation of the second action is played, so as to achieve the purpose of quickly playing the original action and then playing the target action when the virtual character switches actions.
  • the different actions of the same virtual character can be smoothly connected between the two actions, which overcomes the problem that the virtual character of the 2D game cannot switch the actions smoothly like the virtual character of the 3D game due to the lack of bones and skins, thus realizing the improvement of the performance.
  • the technical effect of the fluency of the action display when the virtual character performs the action switching thereby solving the technical problem of the poor fluency of the action display when the virtual character performs the action switching.
  • FIG. 1 is a schematic diagram of a hardware environment of a method for switching an action of a virtual character according to an embodiment of the present invention.
  • FIG. 2 is a flowchart of an optional action switching method for a virtual character according to an embodiment of the present invention.
  • FIG. 3 is a schematic diagram of a process of controlling a 2D game virtual character switching action according to an optional embodiment of the present invention.
  • FIG. 4 is a schematic diagram of an optional action switching apparatus for a virtual character according to an embodiment of the present invention.
  • FIG. 5 is a structural block diagram of an electronic device according to an embodiment of the present invention.
  • Figure 6 schematically shows a block diagram of a computer program product implementing the method according to the invention.
  • 2D game refers to two-dimensional interactive animation. Art resources (character walking, character status, map, etc.) in 2D games can be rendered in png or jpg graphics files, and 2D games cannot complete perspective conversion.
  • 3D game It is a game that uses spatial three-dimensional computing technology to achieve operation. From the perspective of programming implementation, the basic model of the game (game characters, scenes, and basic terrain) is implemented using a three-dimensional three-dimensional model, and the character control of the game is implemented using a spatial three-dimensional programming algorithm.
  • Avatars are game characters in game applications.
  • the game virtual character may be in the form of a character, and may be in an animal, cartoon, or other form, which is not limited in this embodiment of the present invention.
  • a virtual character in a 2D game may be called a 2D game virtual character, and a virtual character in a 3D game may be called a 3D game virtual character.
  • an embodiment of a method for switching actions of a virtual character is provided, which is applied to a 2D game.
  • the above-mentioned action switching method for a virtual character may be applied to a hardware environment composed of a terminal 101 and a server 103 as shown in FIG. 1 .
  • the server 103 is connected to the terminal 101 through the network, and can be used to provide services (such as game services, application services, etc.) for the terminal or the client installed on the terminal, and a database can be set on the server or independently of the server,
  • the above-mentioned network includes but is not limited to: a wide area network, a metropolitan area network or a local area network, and the terminal 101 is not limited to a PC, a mobile phone, a tablet computer, and the like.
  • the action switching method for a virtual character in this embodiment of the present invention may be executed by the server 103 , may also be executed by the terminal 101 , or may be executed jointly by the server 103 and the terminal 101 .
  • the terminal 101 executes the action switching method of the virtual character according to the embodiment of the present invention, and may also be executed by a client installed on the terminal 101 .
  • FIG. 2 is a flowchart of an optional action switching method for a virtual character according to an embodiment of the present invention. As shown in FIG. 2 , the method may include the following steps: step S202 to step S206 .
  • step S202 when the avatar is showing the first frame of animation corresponding to the first action, the action switching information of the avatar is obtained, where the action switching information is used to indicate that the action of the avatar is to be changed from all the actions of the avatar.
  • the first action is switched to the second action.
  • step S204 a temporary animation corresponding to the first action is generated according to the partial animation not displayed in the first frame of animation, and the number of animation frames included in the temporary animation is less than the number of animation frames included in the partial animation quantity.
  • step S206 in response to the action switching information, stop displaying the first frame of animation, and sequentially display the temporary animation and the second frame of animation corresponding to the second action.
  • the temporary animation corresponding to the first action is generated according to the part of the animation that is not displayed in the first frame of animation.
  • the temporary animation is played first, and then the second frame of animation of the second action is played, so as to achieve the switch between the virtual characters.
  • the purpose of playing the original action quickly and then playing the target action during the action so that the two actions can be smoothly connected when switching between different actions of the same virtual character in 2D games, overcoming the lack of bones and skins of virtual characters in 2D games.
  • the problem of smooth switching of actions like 3D game virtual characters so as to achieve the technical effect of improving the fluency of action display when virtual characters perform action switching, and then solve the technical problem of poor fluency of action display when virtual characters perform action switching .
  • the above-mentioned action switching method of a virtual character may be applied to, but not limited to, a control engine of a virtual character, such as a game engine, a video animation production engine, a live video engine, and so on.
  • a control engine of a virtual character such as a game engine, a video animation production engine, a live video engine, and so on.
  • the above-mentioned virtual character may be, but is not limited to, a 2D game virtual character in a 2D game application, or a 2D game virtual character in a 2D game function included in any other type of application.
  • Types of applications may include, but are not limited to, multimedia applications, live broadcast applications, short video applications, instant messaging applications, financial applications, shopping applications, social networking applications, office applications, educational applications, and the like.
  • the 2D game avatar can be, but is not limited to, an avatar that exhibits actions through frame animation. Compared with the way that 3D game virtual characters realize character actions through bones and skins, 2D game virtual characters that display actions through frame animation may experience sluggish movements when switching between actions.
  • the frame animation corresponding to the action of the virtual character may be, but not limited to, produced by action software.
  • the action software may include, but is not limited to, 3DMAX, which is used to create a 2D game virtual character corresponding to the action production specification of a 3D model through 3DMAX. Actions. And use the same standard from 3DMAX (for example: a fixed number of frames per second, the lens is fixed at the set position) to export the produced action as a frame animation and import it into the engine for use.
  • the action switching information is used to instruct to switch the action of the avatar from the first action to the second action
  • the action switching information may be, but is not limited to, an action switching instruction issued when controlling the avatar,
  • the action switching information is used to instruct to switch the action of the game character from the action of lowering the arm to the action of punching out. Fist action.
  • the partial animation is content not displayed in the first frame of animation corresponding to the first action.
  • the first action is the action of lowering the arm
  • the corresponding part of the animation may be, but not limited to, switching from acquisition to action The information starts the animation between where the arm is and where the arm is at the end of the arm-down motion.
  • the temporary animation is generated according to the part of the animation that is not displayed in the first frame of animation, and the temporary animation can be used, but not limited to, to quickly display the remaining part of the first action, so that the display can be completed as far as possible.
  • the time for displaying the first frame of animation of the first action is shortened.
  • generating the temporary animation corresponding to the first action according to the partial animation not shown in the first frame of animation includes: step S11 and step S12.
  • step S11 key animation frames are extracted from the partial animation.
  • step S12 the key animation frames are connected in time sequence in the partial animation to obtain the temporary animation.
  • key animation frames may be, but not limited to, extracted from part of the animation that is not displayed in the first frame of animation, and then the key animation frames are connected in time sequence to obtain a temporary animation, thereby shortening the display of the first frame of animation. The effect of the timing of the first frame of the animation of the action.
  • the method of extracting key animation frames may be extracted according to time, for example, determining the switching time, and then extracting key animation frames according to the switching time.
  • it can also be extracted according to the number of animation frames, for example: determining the number of animation frames to be extracted, and then extracting key animation frames satisfying the number from some animations.
  • the way of determining the number of extracted animation frames may include but is not limited to: setting a predetermined number, setting the proportion of the number of key animation frames in the number of animation frames included in the partial animation (for example: 5%, 7%, 15%, etc.
  • the key animation frames are connected in chronological order in the partial animation, so that the remainder of the first action shown in the temporary animation can be coherent and smooth.
  • the key animation frames are extracted from some animations, and then connected to temporary animations in chronological order.
  • the temporary animation is displayed first, and then the frame animation of the next action is displayed.
  • the two actions can be smoothly connected, thus overcoming the problem that the virtual character of the 2D game cannot switch between the different actions of the same virtual character in the 2D game due to the lack of bones and skins. It realizes the smooth display of actions when the same virtual character switches between different actions in 2D games.
  • extracting key animation frames from the partial animation includes steps S21 and S22.
  • step S21 the number of key frames is determined according to the switching time, which is the time from the end of displaying the first action to the beginning of displaying the second action, and the switching time is less than the display time of the partial animation .
  • step S22 an animation frame satisfying the number of key frames is extracted from the partial animation as the key animation frame.
  • the switching time is the time from the end of displaying the first action to the beginning of displaying the second action, and the switching time may be, but not limited to, preset, such as: 5 milliseconds, 8 milliseconds, and so on.
  • the switching time can also be determined adaptively according to the display information (resolution and other information) of the frame animation, for example, if the resolution is higher, a longer switching time is determined, and if the resolution is lower, a longer switching time is determined. Short switching times. This capability can be obtained, but not limited to, by training an artificial intelligence model using samples.
  • the switching time is shorter than the display time of part of the animation, so as to reflect the effect of rapidly displaying the remaining part of the first action.
  • the switching time can also, but is not limited to, be determined according to the display time of some animations.
  • the switching time can be determined by setting the ratio of the switching time to the display time of the partial animations. For example, setting the switching time is the display time of the partial animations. 10%, 20%, 25%, etc. Taking the setting of the switching time as 20% of the display time of the partial animation, if the display time of the partial animation is 2 seconds, the switching time can be determined to be 0.4 seconds.
  • the number of keyframes is the number of animation frames that need to be displayed during the switching time.
  • the animation frames satisfying this number are extracted from some animations as key animation frames, which can reflect the effect of fast playback of the first action.
  • determining the number of key frames according to the switching time includes: step S31 and step S32.
  • step S31 the switching time and the frame animation frame rate of the action of the virtual character are acquired, and the frame animation frame rate is used to indicate the number of animation frames displayed per unit time.
  • step S32 the product value of the switching time and the frame rate of the frame animation is determined as the number of key frames.
  • the number of key frames may be determined according to, but not limited to, the switching time and the frame animation frame rate of the action of the virtual character.
  • the frame animation frame rate is used to indicate the number of animation frames displayed per unit time, and the frame animation frame rate The value multiplied by the transition time can indicate the number of animation frames that can be shown during the transition time.
  • the above-mentioned unit time may be preset, but not limited to, such as: 1 millisecond, 10 milliseconds, 1 second, 10 seconds, 1 minute, 1 hour, and so on.
  • extracting animation frames satisfying the number of key frames from the partial animation as the key animation frames includes one of steps S41 to S44.
  • step S41 an animation frame satisfying the number of key frames is randomly extracted from the partial animation as the key animation frame.
  • step S42 animation frames satisfying the number of key frames are extracted from the partial animation at regular intervals as the key animation frames.
  • step S43 the start frame and the end frame are extracted from the partial animation, and N-2 animation frames are randomly extracted from the remaining frames except the start frame and the end frame to obtain the key animation frame, N is the number of the key frames, and the key animation frames include the start frame, the N-2 animation frames and the end frame.
  • step S44 the start frame and the end frame are extracted from the partial animation, and N-2 animation frames are extracted at equal intervals from the remaining frames except the start frame and the end frame to obtain the key animation frame, N is the number of the key frames, and the key animation frames include the start frame, the N-2 animation frames and the end frame.
  • the animation frames satisfying the number of key frames may be, but not limited to, randomly extracted from part of the animation, or may be extracted at equal intervals.
  • the method of extracting at equal intervals may be, but not limited to, starting from the first frame in some animations, and extracting a frame at regular intervals, or, skipping the first frame and extracting at regular intervals one frame.
  • the interval can be, but is not limited to, the ratio of the total number of animation frames in some animations to the number of keyframes. For example, if the total number of animation frames in some animations is 8 and the number of keyframes is 4, then one frame is extracted from every two frames. .
  • One extraction method may be to extract the 1st, 3rd, 5th, and 7th frames, and another extraction method may be to extract the 2nd, 4th, 6th, and 8th frames.
  • the start frame and the end frame in the partial animation may be directly determined as key animation frames, and then the remaining key animation frames are extracted from the start frame and the end frame.
  • the manner of extracting the remaining key animation frames may be, but not limited to, random extraction, or may also be extraction at equal intervals.
  • the interval can be, but is not limited to, the ratio of the number of animation frames between the start frame and the end frame to the number of key frames N-2. For example, if the total number of animation frames in some animations is 8 and the number of key frames is 4, then the extracted After starting frame 1 and ending frame 8, two frames are extracted from 2, 3, 4, 5, 6, and 7, for example, one frame can be extracted every three frames.
  • One extraction method may be to extract the 2nd and 5th frames, another extraction method may be to extract the 3rd and 6th frames, and another extraction method may be to extract the 4th and 7th frames.
  • generating the temporary animation corresponding to the first action according to the partial animation not shown in the first frame of animation includes: step S51 and step S52.
  • step S51 the display time of the partial animation is determined.
  • step S52 when the display time of the partial animation is greater than or equal to the target time, the temporary animation is generated according to the partial animation.
  • whether to generate a temporary animation may be determined according to the display time of the partial animation, and if the display time of the partial animation is longer (eg, greater than or equal to the target time), the temporary animation is generated according to the partial animation. For example, it can be set to generate temporary animations for some animations whose display time is more than 3 seconds.
  • a temporary animation may not be generated, and the second frame of animation may be directly switched to play.
  • some animations whose display time is less than 1 second can be set to not generate temporary animations, and switch actions directly.
  • the temporary animation is extracted from the remaining part of the animation.
  • the temporary animation is displayed first and then the next action is displayed.
  • Frame animation so that the two actions can be smoothly connected, thus overcoming the problem that the 2D game virtual character lacks bones and skins in the process of switching between different actions of the same virtual character. It realizes the smooth display of actions when the same virtual character switches between different actions.
  • step S206 after the display of the first frame of animation is stopped, the temporary animation is displayed first, and then the second frame of animation corresponding to the second action is displayed, which can make the animation of the first frame to the animation of the second frame smooth and smooth. Excessive, making the avatar's movements look more coordinated and smooth.
  • stopping the display of the first frame of animation, and sequentially displaying the temporary animation and the second frame of animation corresponding to the second action includes steps S61 to S63.
  • step S61 in response to the action switching information, the display of the first frame of animation is stopped, and the display of the first frame of animation is stopped at the current frame.
  • step S62 the temporary animation is displayed in conjunction with the current frame.
  • step S63 the second frame of animation is displayed in conjunction with the temporary animation.
  • to stop displaying the first frame of animation it may be determined that the first frame of animation is stopped at the current frame, and then the current frame is connected to display the temporary animation, and then the second frame of animation is displayed after the temporary animation is connected.
  • displaying the second frame of animation in conjunction with the temporary animation includes: step S71 and step S72.
  • step S71 connecting the temporary animation to display the switching animation included in the second frame of animation, where the switching animation is used to display the switching action between the first action and the second action.
  • step S72 the switching animation is connected to display the action animation included in the second frame of animation, and the action animation is used to display the second action.
  • the second frame of animation corresponding to the second action may include, but is not limited to, a switching animation and an action animation, the switching animation is used to show the switching action between the first action and the second action, and the action animation is used to show the first action Second action.
  • the switching actions between different actions may be different, and the switching actions may be produced when the action animation is produced, and may be produced by the above-mentioned action software 3DMAX.
  • the switching action between the two actions when switching from the arm down action to the punching action, can be the arm raising action, and when switching from the extending hand action to the punching action, The switching action between the two actions can be the action of retracting the arm, and so on.
  • the first frame animation of the action of lowering the arm stops at a certain target position in the process of lowering the arm, and the generated temporary animation is the speed of the rest of the action of lowering the arm.
  • Display connect to the above target position and continue to play a temporary animation that quickly shows the remaining action of the arm lowering action, then play the arm raising action, and then play the punching action.
  • the generated temporary animation is displayed first, then the switching animation of the switching action between the two actions is displayed, and then the next action is displayed.
  • the 2D game virtual character lacks bones and skins, and the same virtual character cannot switch actions smoothly like a 3D game virtual character during the switching process of different actions of the same virtual character. In this way, a smooth display between actions when the same virtual character switches between different actions is realized.
  • FIG. 3 is a method for controlling the switching of 2D game virtual characters according to an optional embodiment of the present invention.
  • a schematic diagram of an action process, as shown in FIG. 3 the process includes steps S301 to S306 .
  • step S301 the corresponding action of the 2D game virtual character and the switching action between each two actions are produced according to the action production specification of the 3D model by using action software such as 3DMAX.
  • step S302 the actions are exported as frame animations from 3DMAX and imported into the game engine.
  • step S303 the control of action switching is implemented in the engine through the following frame animation switching logic: first, when the action switching is detected. Determine the frame number of the current frame of animation (equivalent to the first frame of animation above), and how many frames of the animation of the current frame remain unplayed (ie, the above-mentioned part of the animation), and determine the switching time.
  • step S304 it is determined that within the switching time, the game character can play N frames of animation.
  • step S305 the start frame and the end frame are extracted from the remaining unplayed animations of the current frame animation, and then N-2 frame animations are extracted at equal intervals from the remaining unplayed frames to synthesize new frame animations (that is, the above temporary animations). ).
  • step S306 the temporary animation is switched to be played, and after the temporary animation is played, it directly switches to the switching animation between the two actions that should be played, and then plays the animation of the switched action (ie, the above-mentioned second frame of animation).
  • the embodiment of the present invention further provides an action switching device for a virtual character for implementing the above-mentioned method for switching action of a virtual character, which is applied to a 2D game.
  • FIG. 4 is a schematic diagram of an optional action switching apparatus for a virtual character according to an embodiment of the present invention. As shown in FIG. 4 , the apparatus may include an acquisition module 42 , a generation module 44 and a display module 46 .
  • the obtaining module 42 is configured to obtain the action switching information of the virtual character when the virtual character is showing the first frame of animation corresponding to the first action, where the action switching information is used to indicate that the action of the virtual character is to be displayed Switch from the first action to the second action.
  • the generating module 44 is configured to generate a temporary animation corresponding to the first action according to the partial animation, where the number of animation frames included in the temporary animation is less than the number of animation frames included in the partial animation.
  • the display module 46 is configured to, in response to the action switching information, stop displaying the first frame of animation, and sequentially display the temporary animation and the second frame of animation corresponding to the second action.
  • the acquiring module 42 in this embodiment may be used to perform step S202 in this embodiment of the present invention
  • the generating module 44 in this embodiment may be used to perform step S204 in this embodiment of the present invention
  • the presentation module 46 in can be used to perform step S206 in this embodiment of the present invention.
  • the action switching information of the virtual character is obtained to instruct to switch the action of the virtual character from the first action to the second action, according to the first action Part of the animation not shown in the frame animation generates a temporary animation corresponding to the first action.
  • the temporary animation is played first and then the second frame of animation of the second action is played, so as to achieve fast playback when the virtual character switches actions.
  • the purpose of playing the target action after the original action is completed, so that the two actions can be smoothly connected when switching between different actions of the same virtual character in the 2D game, which overcomes the lack of bones and skins of the 2D game virtual character. Therefore, the technical effect of improving the fluency of the action display when the virtual character performs the action switch is realized, and the technical problem of the poor fluency of the action display when the virtual character performs the action switch is solved.
  • the generation module includes: an extraction unit and a connection unit.
  • the extraction unit is used for extracting key animation frames from the partial animation.
  • a connecting unit configured to connect the key animation frames according to the time sequence in the partial animation to obtain the temporary animation.
  • the extraction unit includes a determination subunit and an extraction subunit.
  • the determination subunit is used to determine the number of key frames according to the switching time, the switching time is the time from the end of displaying the first action to the beginning of displaying the second action, and the switching time is less than the part of the animation. Show time.
  • An extraction subunit configured to extract animation frames satisfying the number of key frames from the partial animation as the key animation frames.
  • the determining subunit is used to: acquire the switching time and the frame animation frame rate of the action of the virtual character, where the frame animation frame rate is used to indicate the number of animation frames displayed per unit time; The product value of the switching time and the frame rate of the frame animation is determined as the number of key frames.
  • the extracting subunit is configured to perform one of the following manners: randomly extract animation frames satisfying the number of key frames from the partial animation as the key animation frames; Extract the animation frames that meet the number of key frames as the key animation frames; extract the start frame and the end frame from the partial animation, and randomly extract N from the remaining frames except the start frame and the end frame -2 animation frames, obtain the key animation frame, N is the number of the key frame, the key animation frame includes the start frame, the N-2 animation frames and the end frame; Extract the start frame and end frame from the partial animation, and extract N-2 animation frames from the remaining frames except the start frame and the end frame at equal intervals to obtain the key animation frame, where N is the key frame number, the key animation frames include the start frame, the N-2 animation frames and the end frame.
  • the generating module includes: a determining unit and a generating unit.
  • a determining unit configured to determine the display time of the partial animation.
  • a generating unit configured to generate the temporary animation according to the partial animation when the display time of the partial animation is greater than or equal to the target time.
  • the presentation module includes: a processing unit, a first presentation unit and a second presentation unit.
  • the processing unit is configured to, in response to the action switching information, stop displaying the first frame of animation, and the display of the first frame of animation is stopped at the current frame.
  • the first display unit is used for displaying the temporary animation in conjunction with the current frame.
  • a second display unit configured to connect the temporary animation to display the second frame of animation.
  • the second display unit is configured to: connect the temporary animation to display the switching animation included in the second frame of animation, and the switching animation is used to display the first action and the first animation.
  • a switching action between two actions connecting the switching animation to display the action animation included in the second frame of animation, and the action animation is used to display the second action.
  • the above modules may run in the hardware environment as shown in FIG. 1 , and may be implemented by software or hardware, and the hardware environment includes a network environment.
  • the embodiments of the present invention further provide an electronic device for implementing the above-mentioned method for switching actions of virtual characters.
  • FIG. 5 is a structural block diagram of an electronic device according to an embodiment of the present invention.
  • the electronic device may include: one or more (only one is shown in the figure) a processor 501, a memory 503, and a transmission Apparatus 505 , as shown in FIG. 5 , the electronic apparatus may further include an input/output device 507 .
  • the memory 503 may be used to store software programs and modules, such as program instructions/modules corresponding to the action switching method and apparatus for a virtual character in the embodiments of the present invention.
  • the processor 501 executes the software stored in the memory 503 by running the software. Programs and modules are used to execute various functional applications and data processing, that is, to implement the above-mentioned method for switching actions of virtual characters.
  • Memory 503 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory.
  • the memory 503 may further include memory located remotely relative to the processor 501, and these remote memories may be connected to the electronic device through a network. Examples of such networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
  • the above-mentioned transmission device 505 is used for receiving or sending data via a network, and can also be used for data transmission between the processor and the memory.
  • Specific examples of the above-mentioned networks may include wired networks and wireless networks.
  • the transmission device 505 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers through a network cable so as to communicate with the Internet or a local area network.
  • the transmission device 505 is a radio frequency (Radio Frequency, RF) module, which is used for wirelessly communicating with the Internet.
  • RF Radio Frequency
  • memory 503 is used to store application programs.
  • the processor 501 may call the application program stored in the memory 503 through the transmission device 505 to perform the following steps: in the case where the virtual character is showing the first frame of animation corresponding to the first action, obtain the action switching information of the virtual character , the action switching information is used to instruct to switch the action of the virtual character from the first action to the second action; according to the partial animation not shown in the first frame of animation, a temporary animation corresponding to the first action is generated animation, the number of animation frames included in the temporary animation is less than the number of animation frames included in the partial animation; in response to the action switching information, the display of the first frame of animation is stopped, and the temporary animation is displayed in sequence A second frame of animation corresponding to the second action.
  • a solution for action switching of a virtual character is provided. If the action switching information of the avatar is obtained when the avatar is showing the first frame of animation corresponding to the first action to instruct to switch the action of the avatar from the first action to the second action, then according to the unavailability in the first frame of animation Some of the animations displayed generate temporary animations corresponding to the first action. After stopping the playback of the first frame of animation, the temporary animation is played first and then the second frame of animation of the second action is played, so that the original action can be quickly played when the virtual character switches between actions.
  • the purpose of playing the target action is to make the two actions of the same virtual character switch smoothly in a 2D game, and overcome the lack of bones and skins of the 2D game virtual character. Therefore, the technical effect of improving the fluency of the action display when the virtual character performs the action switching is realized, thereby solving the technical problem of the poor fluency of the action display when the virtual character performs the action switching.
  • FIG. 5 is only a schematic diagram, and the electronic device can be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a palmtop computer, and a mobile Internet Device (Mobile Internet Devices, MID) , PAD and other electronic equipment.
  • FIG. 5 does not limit the structure of the above electronic device.
  • the electronic device may also include more or fewer components than those shown in FIG. 5 (eg, network interface, display device, etc.), or have a different configuration than that shown in FIG. 5 .
  • Embodiments of the present invention also provide a storage medium.
  • the above-mentioned storage medium can be used to execute the program code of the action switching method of the virtual character.
  • the above-mentioned storage medium may be located on at least one network device among multiple network devices in the network shown in the above-mentioned embodiments.
  • the storage medium is configured to store program codes for executing the following steps: in the case that the virtual character is showing the first frame of animation corresponding to the first action, the action switching information of the virtual character is obtained, The action switching information is used to instruct to switch the action of the virtual character from the first action to the second action; a temporary animation corresponding to the first action is generated according to the partial animation not shown in the first frame of animation , the number of animation frames included in the temporary animation is less than the number of animation frames included in the partial animation; in response to the action switching information, the display of the first frame of animation is stopped, and the temporary animation and The second animation frame corresponding to the second action.
  • the above-mentioned storage medium may include, but is not limited to, a USB flash drive, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a mobile hard disk, a magnetic disk, or an optical disk, etc.
  • Various media that can store program code may include, but is not limited to, a USB flash drive, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a mobile hard disk, a magnetic disk, or an optical disk, etc.
  • ROM read-only memory
  • RAM Random Access Memory
  • mobile hard disk a magnetic disk
  • optical disk etc.
  • Figure 6 schematically shows a block diagram of a computer program product implementing the method according to the invention.
  • the computer program product includes a computer program/instruction 610 that, when executed by a processor such as the processor 501 shown in FIG. 5, can implement the action switching of the virtual character described above steps in the method.
  • the integrated units in the above-mentioned embodiments are implemented in the form of software functional units and sold or used as independent products, they may be stored in the above-mentioned computer-readable storage medium.
  • the technical solution of the present invention is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium,
  • Several instructions are included to cause one or more computer devices (which may be personal computers, servers, or network devices, etc.) to perform all or part of the steps of the methods described in the various embodiments of the present invention.
  • the disclosed client may be implemented in other manners.
  • the apparatus embodiments described above are only illustrative.
  • the division of the units is only a logical function division.
  • multiple units or components may be combined or integrated into Another system, or some features can be ignored, or not implemented.
  • the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of units or modules, and may be in electrical or other forms.
  • the units described as separate components may or may not be physically separated, and components shown as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Processing Or Creating Images (AREA)

Abstract

本发明涉及一种虚拟角色的动作切换方法和装置,应用于2D游戏,该方法包括:在虚拟角色正在展示第一动作对应的第一帧动画的情况下,获取到虚拟角色的动作切换信息,动作切换信息用于指示将虚拟角色的动作从第一动作切换为第二动作;根据第一帧动画中未展示的部分动画生成第一动作对应的临时动画,临时动画所包括的动画帧的数量少于部分动画所包括的动画帧的数量;响应动作切换信息,停止展示第一帧动画,并依次展示临时动画和第二动作对应的第二帧动画。本发明解决了虚拟角色进行动作切换时动作展示的流畅度较差的技术问题。

Description

一种虚拟角色的动作切换方法、装置及存储介质
相关申请的交叉引用
本申请要求于2021年3月26日提交、申请号为202110328078.6且名称为“虚拟角色的动作切换方法和装置”的中国专利申请的优先权,其全部内容通过引用合并于此。
技术领域
本发明涉及计算机领域,尤其涉及一种虚拟角色的动作切换方法、装置及存储介质。
背景技术
目前在一些2D游戏中,游戏角色的动作都是通过帧动画来展示的,但是使用帧动画来做,在角色切换时,因为没法保证当前动作展示到的帧和下一个动作开头的帧一致,所以切换时会显得特别生硬,有特别明显的替换现象。
现有的解决方式一般会在2D动画上加上骨骼后制作相应动画,然后通过计算骨骼位置来进行融合切换。例如使用某插件执行上述操作,但是使用该插件进行动作切换时角色动作依然很僵硬,很像皮影戏和提线木偶,达不到流畅展示的效果。
针对上述的问题,目前尚未提出有效的解决方案。
发明内容
本发明提供了一种虚拟角色的动作切换方法和装置,以至少解决相关技术中虚拟角色进行动作切换时动作展示的流畅度较差的技术问题。
根据本发明实施例的第一方面,提供了一种虚拟角色的动作切换方法,应用于2D游戏,所述方法包括:在虚拟角色正在展示第一动作对应的第一帧动画的情况下,获取到所述虚拟角色的动作切换信息,所述动作切换信息用于指示将所述虚拟角色的动作从所述第一动作切换为第二动作;根据所述第一帧动画中未展示的部分动画生成所述第一动作对应的临时动画,所述临时动画所包括的动画帧的数量少于所述部分动画所包括的动画帧的数量;以及,响应所述动作切换信息,停止展示所述第一帧动画,并依次展示所述临时动画和所述第二动作对应的第二帧动画。
在一些实施例中,根据所述第一帧动画中未展示的部分动画生成所述第一动作对应的临时动画包括:从所述部分动画中提取关键动画帧;将所述关键动画帧按照在所述部分动画中的时间顺序连接,得到所述临时动画。
根据本发明实施例的第二方面,还提供了一种虚拟角色的动作切换装置,应用于2D游戏,所述装置包括:获取模块,用于在虚拟角色正在展示第一动作对应的第一帧动画的情况下,获取到所述虚拟角色的动作切换信息,所述动作切换信息用于指示将所述虚拟角色的动作从所述第一动作切换为第二动作;生成模块,用于根据所述第一帧动画中未展示的部分动画生成所述第一动作对应的临时动画,所述临时动画所包括的动画帧的数量少于所述部分动画所包括的动画帧的数量;以及,展示模块,用于响应所述动作切换信息, 停止展示所述第一帧动画,并依次展示所述临时动画和所述第二动作对应的第二帧动画。
根据本发明实施例的第三方面,还提供了一种存储介质,该存储介质包括存储的程序,程序运行时执行上述的方法。
根据本发明实施例的第四方面,还提供了一种电子装置,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,处理器通过计算机程序执行上述的方法。
根据本发明实施例的第五方面,还提供了一种计算机程序产品,包括计算机程序/指令,所述计算机程序/指令被处理器执行时实现上述方法的步骤。
依据本发明实施例提供的虚拟角色的动作切换方法、装置及存储介质的技术方案,采用在虚拟角色正在展示第一动作对应的第一帧动画的情况下,获取到虚拟角色的动作切换信息,动作切换信息用于指示将虚拟角色的动作从第一动作切换为第二动作;根据第一帧动画中未展示的部分动画生成第一动作对应的临时动画,临时动画所包括的动画帧的数量少于部分动画所包括的动画帧的数量;响应动作切换信息,停止展示第一帧动画,并依次展示临时动画和第二动作对应的第二帧动画的方式,如果在虚拟角色正在展示第一动作对应的第一帧动画时,获取到了虚拟角色的动作切换信息来指示将虚拟角色的动作从第一动作切换为第二动作,则根据第一帧动画中未展示的部分动画生成第一动作对应的临时动画,停止播放第一帧动画后,先播放临时动画再播放第二动作的第二帧动画,达到了在虚拟角色切换动作时快速播放完原动作再播放目标动作的目的,使得在2D游戏中同一虚拟角色的不同动作切换时两个动作之间能够流畅衔接,克服了由于2D游戏虚拟角色缺少骨骼和蒙皮而无法像3D游戏虚拟角色那样流畅切换动作的问题,从而实现了提高虚拟角色进行动作切换时动作展示的流畅度的技术效果,进而解决了虚拟角色进行动作切换时动作展示的流畅度较差的技术问题。
附图说明
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本发明的实施例,并与说明书一起用于解释本发明的原理。
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,对于本领域普通技术人员而言,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1是根据本发明实施例的虚拟角色的动作切换方法的硬件环境的示意图。
图2是根据本发明实施例的一种可选的虚拟角色的动作切换方法的流程图。
图3是根据本发明可选实施例的一种控制2D游戏虚拟角色切换动作的过程的示意图。
图4是根据本发明实施例的一种可选的虚拟角色的动作切换装置的示意图。
图5是根据本发明实施例的一种电子装置的结构框图。
图6示意性地示出了实现根据本发明的方法的计算机程序产品的框图。
具体实施方式
为了使本技术领域的人员更好地理解本发明方案,下面将结合本发明实施例中的 附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分的实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本发明保护的范围。
需要说明的是,本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本发明的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。
在对本发明实施例进行介绍说明之前,首先对本发明中涉及的相关名词进行解释说明。
2D游戏:是指二维交互式动画。2D游戏中的美术资源(角色行走、角色状态、地图等等)可以是以png或jpg的图形文件渲染而成,2d游戏是没办法完成视角转换。
3D游戏:是使用空间立体计算技术实现操作的游戏。从编程实现角度来说游戏基础模型(游戏的人物,场景,基础地形)是使用三维立体模型实现的,游戏的人物角色控制是使用空间立体编程算法实现的。
虚拟角色:是在游戏应用程序中的游戏角色。游戏虚拟角色可以是人物形态,可以是动物、卡通或者其它形态,本发明实施例对此不作限定。2D游戏中的虚拟角色可以称为2D游戏虚拟角色,3D游戏中的虚拟角色可以称为3D游戏虚拟角色。
根据本发明实施例的第一方面,提供了一种虚拟角色的动作切换的方法实施例,应用于2D游戏。
在一些实施例中,上述虚拟角色的动作切换方法可以应用于如图1所示的由终端101和服务器103所构成的硬件环境中。如图1所示,服务器103通过网络与终端101进行连接,可用于为终端或终端上安装的客户端提供服务(如游戏服务、应用服务等),可在服务器上或独立于服务器设置数据库,用于为服务器103提供数据存储服务,上述网络包括但不限于:广域网、城域网或局域网,终端101并不限定于PC、手机、平板电脑等。本发明实施例的虚拟角色的动作切换方法可以由服务器103来执行,也可以由终端101来执行,还可以是由服务器103和终端101共同执行。终端101执行本发明实施例的虚拟角色的动作切换方法也可以是由安装在其上的客户端来执行。
图2是根据本发明实施例的一种可选的虚拟角色的动作切换方法的流程图,如图2所示,该方法可以包括以下步骤:步骤S202至步骤S206。
在步骤S202,在虚拟角色正在展示第一动作对应的第一帧动画的情况下,获取到所述虚拟角色的动作切换信息,所述动作切换信息用于指示将所述虚拟角色的动作从所述第一动作切换为第二动作。
在步骤S204,根据所述第一帧动画中未展示的部分动画生成所述第一动作对应的临时动画,所述临时动画所包括的动画帧的数量少于所述部分动画所包括的动画帧的数量。
在步骤S206,响应所述动作切换信息,停止展示所述第一帧动画,并依次展示所 述临时动画和所述第二动作对应的第二帧动画。
通过上述步骤S202至步骤S206,如果在虚拟角色正在展示第一动作对应的第一帧动画时,获取到了虚拟角色的动作切换信息来指示将虚拟角色的动作从第一动作切换为第二动作,则根据第一帧动画中未展示的部分动画生成第一动作对应的临时动画,停止播放第一帧动画后,先播放临时动画再播放第二动作的第二帧动画,达到了在虚拟角色切换动作时快速播放完原动作再播放目标动作的目的,使得在2D游戏中同一虚拟角色的不同动作切换时两个动作之间能够流畅衔接,克服了由于2D游戏虚拟角色缺少骨骼和蒙皮而无法像3D游戏虚拟角色那样流畅切换动作的问题,从而实现了提高虚拟角色进行动作切换时动作展示的流畅度的技术效果,进而解决了虚拟角色进行动作切换时动作展示的流畅度较差的技术问题。
在一些实施例中,上述虚拟角色的动作切换方法可以但不限于应用于虚拟角色的控制引擎中,比如:游戏引擎,影视动漫制作引擎,视频直播引擎等等。
在步骤S202提供的技术方案中,上述虚拟角色可以但不限于是2D游戏应用中的2D游戏虚拟角色,也可以是任何其他类型的应用所包括的2D游戏功能中的2D游戏虚拟角色,上述其他类型的应用可以但不限于包括:多媒体应用,直播应用,短视频应用,即时通信应用,金融应用,购物应用,社交应用,办公应用,教育应用等等。2D游戏虚拟角色可以但不限于为通过帧动画展示动作的虚拟角色。相比于3D游戏虚拟角色通过骨骼和蒙皮实现角色动作的方式,通过帧动画展示动作的2D游戏虚拟角色在发生动作切换时可能会出现动作不流畅的现象。
在一些实施例中,虚拟角色的动作对应的帧动画可以但不限于是通过动作软件制作的,例如:动作软件可以但不限于包括3DMAX,通过3DMAX按照3D模型动作制作规范制作2D游戏虚拟角色相应的动作。并从3DMAX中用同样标准(比如:每秒固定帧数,镜头固定在设置好的位置)将制作的动作导出为帧动画并导入引擎中使用。
可选地,在本实施例中,动作切换信息用于指示将虚拟角色的动作从第一动作切换为第二动作,动作切换信息可以但不限于是在控制虚拟角色时发出的动作切换指令,比如:玩家控制游戏角色的过程中在游戏角色执行将手臂放下的动作时玩家触发了出拳的动作,则获取到的动作切换信息用于指示将游戏角色的动作从手臂放下的动作切换为出拳的动作。
在步骤S204提供的技术方案中,部分动画是第一动作对应的第一帧动画中未展示的内容。比如:对于上述指示将游戏角色的动作从手臂放下的动作切换为出拳的动作的动作切换信息,第一动作为手臂放下的动作,其对应的部分动画可以但不限于是从获取到动作切换信息开始手臂所在的位置到手臂放下的动作结束时手臂所在的位置之间的动画。
可选地,在本实施例中,临时动画是根据第一帧动画中未展示的部分动画生成的,临时动画可以但不限于用于快速展示第一动作的剩余部分,从而在能够尽量展示完第一动作的同时,缩短展示完第一动作的第一帧动画的时间。
在一些实施例中,根据所述第一帧动画中未展示的部分动画生成所述第一动作对应的临时动画包括:步骤S11和步骤S12。
在步骤S11,从所述部分动画中提取关键动画帧。
在步骤S12,将所述关键动画帧按照在所述部分动画中的时间顺序连接,得到所 述临时动画。
在一些实施例中,可以但不限于从第一帧动画中未展示的部分动画中提取出关键动画帧,再按照时间顺序将关键动画帧连接起来得到临时动画,从而起到缩短展示完第一动作的第一帧动画的时间的作用。
在一些实施例中,提取关键动画帧的方式可以按照时间来提取,比如:确定切换时间,再按照切换时间提取关键动画帧。或者,也可以按照动画帧数量来提取,比如:确定提取的动画帧数量,再从部分动画中提取满足该数量的关键动画帧。确定提取的动画帧数量的方式可以但不限于包括:设置预定数量,设置关键动画帧的数量在部分动画所包括的动画帧的数量中所占比例(比如:5%,7%,15%等等),设置部分动画所包括的动画帧的数量落入不同阈值范围对应不同的关键动画帧的数量(比如:部分动画中有5至10帧,则取3帧作为关键动画帧,部分动画中有10帧以上,则取6帧作为关键动画帧)等等。
在一些实施例中,按照在部分动画中的时间顺序连接关键动画帧,从而使得临时动画中展示的第一动作的剩余部分能够连贯顺畅。
通过上述过程,从部分动画中提取出关键动画帧,再将其按时间顺序连接成临时动画,在2D游戏中同一虚拟角色切换不同动作时先展示该临时动画再展示下一个动作的帧动画,使得两个动作之间能够流畅衔接,从而克服了由于2D游戏虚拟角色缺少骨骼和蒙皮在2D游戏中同一虚拟角色的不同动作切换过程中无法像3D游戏虚拟角色那样流畅切换动作的问题,进而实现了2D游戏中同一虚拟角色切换不同动作时动作之间的流畅展示。
在一些实施例中,从所述部分动画中提取关键动画帧包括:步骤S21和步骤S22。
在步骤S21,根据切换时间确定关键帧数量,所述切换时间是从结束展示所述第一动作到开始展示所述第二动作之间的时间,所述切换时间小于所述部分动画的展示时间。
在步骤S22,从所述部分动画中提取满足所述关键帧数量的动画帧作为所述关键动画帧。
在一些实施例中,切换时间是从结束展示第一动作到开始展示第二动作之间的时间,该切换时间可以但不限于是预先设置的,比如:5毫秒,8毫秒等等。或者,切换时间也可以但不限于是根据帧动画的展示信息(分辨率等信息)自适应确定的,比如:分辨率较高则确定出较长的切换时间,分辨率较低则确定出较短的切换时间。该功能可以但不限于通过使用样本训练人工智能模型来获取。
在一些实施例中,切换时间小于部分动画的展示时间,从而体现出快速展示第一动作剩余部分的效果。切换时间还可以但不限于是根据部分动画的展示时间确定的,一方面可以通过设置切换时间相对于部分动画的展示时间的比例来确定切换时间,比如:设置切换时间是部分动画的展示时间的10%,20%,25%等等。以设置切换时间是部分动画的展示时间的20%为例,如果部分动画的展示时间为2秒,则可以确定切换时间为0.4秒。另一方面可以设置部分动画的展示时间落入不同的范围对应不同的切换时间,比如:部分动画的展示时间在0至1秒间可以不生成临时动画,1至3秒内生成0.5秒的临时动画,3秒以上生成1秒的临时动画。
在一些实施例中,关键帧数量是在切换时间内所需要展示的动画帧的数量。从部分动画中提取出满足该数量的动画帧作为关键动画帧,能够体现出第一动作快速播放的效果。
在一些实施例中,根据切换时间确定关键帧数量包括:步骤S31和步骤S32。
在步骤S31,获取所述切换时间以及所述虚拟角色的动作的帧动画帧率,所述帧动画帧率用于指示每单位时间展示动画帧的数量。
在步骤S32,将所述切换时间与所述帧动画帧率的乘积值确定为所述关键帧数量。
在一些实施例中,关键帧数量可以但不限于根据切换时间以及虚拟角色的动作的帧动画帧率来确定的,帧动画帧率用于指示每单位时间展示动画帧的数量,帧动画帧率与切换时间的乘积值可以指示在切换时间内能够展示的动画帧的数量。
在一些实施例中,上述单位时间可以但不限于是预先设定的,比如:1毫秒,10毫秒,1秒,10秒,1分,1小时等等。
在一些实施例中,从所述部分动画中提取满足所述关键帧数量的动画帧作为所述关键动画帧包括步骤S41至步骤S44之一。
在步骤S41,从所述部分动画中随机提取满足所述关键帧数量的动画帧作为所述关键动画帧。
在步骤S42,从所述部分动画中等间隔提取满足所述关键帧数量的动画帧作为所述关键动画帧。
在步骤S43,从所述部分动画中提取开始帧和结尾帧,并从除所述开始帧和所述结尾帧外的剩余帧中随机提取N-2个动画帧,得到所述关键动画帧,N为所述关键帧数量,所述关键动画帧包括所述开始帧,所述N-2个动画帧和所述结尾帧。
在步骤S44,从所述部分动画中提取开始帧和结尾帧,并从除所述开始帧和所述结尾帧外的剩余帧中等间隔提取N-2个动画帧,得到所述关键动画帧,N为所述关键帧数量,所述关键动画帧包括所述开始帧,所述N-2个动画帧和所述结尾帧。
在一些实施例中,满足关键帧数量的动画帧可以但不限于是从部分动画中随机提取的,或者,可以是等间隔提取的。
在一些实施例中,等间隔提取的方式可以但不限于是从部分动画中的第一帧开始,每隔一定间隔提取一帧,或者,也可以是跳过第一帧,每隔一定间隔提取一帧。该间隔可以但不限于是部分动画中的动画帧总数量与关键帧数量的比值,比如:部分动画中的动画帧总数量为8,关键帧数量为4,则从每两帧中提取一帧。一种提取方式可以是提取第1,3,5,7帧,另一种提取方式可以是提取第2,4,6,8帧。
在一些实施例中,可以直接将部分动画中的开始帧和结尾帧确定为关键动画帧,再从开始帧和结尾帧之间提取其余的关键动画帧。提取其余的关键动画帧的方式可以但不限于是随机提取,或者,也可以是等间隔提取。该间隔可以但不限于是开始帧和结尾帧之间的动画帧数量与关键帧数量N-2的比值,比如:部分动画中的动画帧总数量为8,关键帧数量为4,则提取出开始帧1和结尾帧8后,再从2,3,4,5,6,7中提取两帧,比如可以每三帧提取出一帧。一种提取方式可以是提取第2,5帧,另一种提取方式可以是提取第3,6帧,还有一种提取方式可以是提取第4,7帧。
通过上述过程,在同一虚拟角色切换不同动作时设置一定的切换时间来展示临时动画再展示下一个动作的帧动画,使得两个动作之间能够流畅衔接,从而克服了由于2D游戏虚拟角色缺少骨骼和蒙皮在同一虚拟角色的不同动作切换过程中无法像3D游戏虚拟角色那样流畅切换动作的问题,进而实现了同一虚拟角色切换不同动作时动作之间的流畅 展示。
在一些实施例中,根据所述第一帧动画中未展示的部分动画生成所述第一动作对应的临时动画包括:步骤S51和步骤S52。
在步骤S51,确定所述部分动画的展示时间。
在步骤S52,在所述部分动画的展示时间大于或者等于目标时间的情况下,根据所述部分动画生成所述临时动画。
在一些实施例中,可以根据部分动画的展示时间判断是否生成临时动画,如果部分动画的展示时间较长(比如大于或者等于目标时间),则根据部分动画生成临时动画。例如:可以设置为展示时间在3秒以上的部分动画生成临时动画。
在一些实施例中,如果部分动画的展示时间较短(比如小于目标时间),则可以不生成临时动画,直接切换为播放第二帧动画。例如:可以设置展示时间在1秒以下的部分动画则不生成临时动画,直接进行动作切换。
通过上述过程,在同一虚拟角色切换不同动作时,如果前一个动作剩余的展示时间较长,则从其剩余的部分动画中提取出临时动画在切换动作是先展示临时动画再展示下一个动作的帧动画,使得两个动作之间能够流畅衔接,从而克服了由于2D游戏虚拟角色缺少骨骼和蒙皮在同一虚拟角色的不同动作切换过程中无法像3D游戏虚拟角色那样流畅切换动作的问题,进而实现了同一虚拟角色切换不同动作时动作之间的流畅展示。
在步骤S206提供的技术方案中,停止展示第一帧动画后,先展示临时动画,再展示第二动作对应的第二帧动画,能够使得第一帧动画到第二帧动画之间平滑流畅的过度,使得虚拟角色的动作看起来更加协调顺畅。
在一些实施例中,响应所述动作切换信息,停止展示所述第一帧动画,并依次展示所述临时动画和所述第二动作对应的第二帧动画包括:步骤S61至步骤S63。
在步骤S61,响应所述动作切换信息,停止展示所述第一帧动画,所述第一帧动画的展示停止在当前帧。
在步骤S62,衔接所述当前帧展示所述临时动画。
在步骤S63,衔接所述临时动画展示所述第二帧动画。
在一些实施例中,停止展示第一帧动画是可以确定第一帧动画停止在当前帧上,再衔接该当前帧展示临时动画,接着衔接临时动画展示第二帧动画。
比如:将游戏角色的动作从手臂放下的动作切换为出拳的动作,手臂放下的动作的第一帧动画停止在手臂放下过程中的某目标位置,生成的临时动画是手臂放下动作的剩余动作的快速展示,衔接上述目标位置继续播放快速展示手臂放下动作的剩余动作的临时动画,再播放出拳的动作的第二帧动画。
通过上述过程,在同一虚拟角色切换不同动作时,停止展示前一个动作的帧动画后,接着先展示生成的临时动画再展示下一个动作的帧动画,使得两个动作之间能够流畅衔接,从而克服了由于2D游戏虚拟角色缺少骨骼和蒙皮在同一虚拟角色的不同动作切换过程中无法像3D游戏虚拟角色那样流畅切换动作的问题,进而实现了同一虚拟角色切换不同动作时动作之间的流畅展示。
在一些实施例中,衔接所述临时动画展示所述第二帧动画包括:步骤S71和步骤S72。
在步骤S71,衔接所述临时动画展示所述第二帧动画中所包括的切换动画,所述切换动画用于展示所述第一动作和所述第二动作之间的切换动作。
在步骤S72,衔接所述切换动画展示所述第二帧动画中所包括的动作动画,所述动作动画用于展示所述第二动作。
在一些实施例中,第二动作对应的第二帧动画可以但不限于包括切换动画和动作动画,切换动画用于展示第一动作和第二动作之间的切换动作,动作动画用于展示第二动作。
在一些实施例中,不同动作之间的切换动作可以不同,切换动作可以是在制作动作动画时制作出来的,可以通过上述动作软件3DMAX制作。
比如:对于上述出拳的动作,从手臂放下的动作切换为出拳的动作时,两个动作之间的切换动作可以是抬起手臂的动作,从伸手的动作切换为出拳的动作时,两个动作之间的切换动作可以是收回手臂的动作等等。
将游戏角色的动作从手臂放下的动作切换为出拳的动作,手臂放下的动作的第一帧动画停止在手臂放下过程中的某目标位置,生成的临时动画是手臂放下动作的剩余动作的快速展示,衔接上述目标位置继续播放快速展示手臂放下动作的剩余动作的临时动画,再播放抬起手臂的动作,接着再播放出拳的动作。
通过上述过程,在同一虚拟角色切换不同动作时,停止展示前一个动作的帧动画后,接着先展示生成的临时动画,然后展示两个动作之间的切换动作的切换动画,再展示下一个动作的动作动画,使得两个动作之间能够流畅衔接,从而克服了由于2D游戏虚拟角色缺少骨骼和蒙皮在同一虚拟角色的不同动作切换过程中无法像3D游戏虚拟角色那样流畅切换动作的问题,进而实现了同一虚拟角色切换不同动作时动作之间的流畅展示。
本发明还提供了一种可选实施例,该可选实施例提供了一种控制2D游戏虚拟角色切换动作的过程,图3是根据本发明可选实施例的一种控制2D游戏虚拟角色切换动作的过程的示意图,如图3所示,该过程包括:步骤S301至步骤S306。
在步骤S301,利用3DMAX等动作软件按照3D模型动作制作规范制作2D游戏虚拟角色相应动作和每两个动作之间的切换动作。
在步骤S302,从3DMAX中将动作导出为帧动画并导入游戏引擎。
在步骤S303,在引擎中通过以下帧动画切换逻辑来实现动作切换的控制:首先在检测到动作切换时。确定当前帧动画(相当于上述第一帧动画)播放到了第几帧,以及当前帧动画还剩多少帧没播放完(即上述部分动画),并确定切换时间。
在步骤S304,确定出在切换时间内,游戏角色能播放N帧帧动画。
在步骤S305,从当前帧动画剩余没播放完的动画中提取开始帧和结尾帧,再从余下没播完的帧里等间隔取出N-2帧帧动画合成新的帧动画(即上述临时动画)。
在步骤S306,切换播放该临时动画,等播放完临时动画后再直接切到本来应该播放的两个动作之间的切换动画,再播放切换到的动作的动画(即上述第二帧动画)。
通过上述过程,对于动画制作人员无任何学习成本,还是利用自己熟悉的软件制作3D动画即可;同时比起Spine等插件,无关节感,不像木偶戏那么僵硬,同时比起帧动画传统直接切换方式显得更加流畅自然。对游戏玩家来说,增加了游戏角色动作流畅度,使得观感更好。
需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本发明并不受所描述的动作顺序的限制,因为依据本发明,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本发明所必须的。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台电子设备(可以是手机,计算机,服务器,或者网络设备等)执行本发明各个实施例所述的方法。
根据本发明实施例的第二方面,本发明实施例还提供了一种用于实施上述虚拟角色的动作切换方法的虚拟角色的动作切换装置,应用于2D游戏。图4是根据本发明实施例的一种可选的虚拟角色的动作切换装置的示意图,如图4所示,该装置可以包括:获取模块42、生成模块44和展示模块46。
获取模块42,用于在虚拟角色正在展示第一动作对应的第一帧动画的情况下,获取到所述虚拟角色的动作切换信息,所述动作切换信息用于指示将所述虚拟角色的动作从所述第一动作切换为第二动作。
生成模块44,用于根据所述部分动画生成所述第一动作对应的临时动画,所述临时动画所包括的动画帧的数量少于所述部分动画所包括的动画帧的数量。
展示模块46,用于响应所述动作切换信息,停止展示所述第一帧动画,并依次展示所述临时动画和所述第二动作对应的第二帧动画。
需要说明的是,该实施例中的获取模块42可以用于执行本发明实施例中的步骤S202,该实施例中的生成模块44可以用于执行本发明实施例中的步骤S204,该实施例中的展示模块46可以用于执行本发明实施例中的步骤S206。
此处需要说明的是,上述模块与对应的步骤所实现的示例和应用场景相同,但不限于上述实施例所公开的内容。需要说明的是,上述模块作为装置的一部分可以运行在如图1所示的硬件环境中,可以通过软件实现,也可以通过硬件实现。
通过上述模块,如果在虚拟角色正在展示第一动作对应的第一帧动画时,获取到了虚拟角色的动作切换信息来指示将虚拟角色的动作从第一动作切换为第二动作,则根据第一帧动画中未展示的部分动画生成第一动作对应的临时动画,停止播放第一帧动画后,先播放临时动画再播放第二动作的第二帧动画,达到了在虚拟角色切换动作时快速播放完原动作再播放目标动作的目的,使得在2D游戏中同一虚拟角色的不同动作切换时两个动作之间能够流畅衔接,克服了由于2D游戏虚拟角色缺少骨骼和蒙皮而无法像3D游戏虚拟角色那样流畅切换动作的问题,从而实现了提高虚拟角色进行动作切换时动作展示的流畅度的技术效果,进而解决了虚拟角色进行动作切换时动作展示的流畅度较差的技术问题。
在一些实施例中,所述生成模块包括:提取单元和连接单元。
提取单元,用于从所述部分动画中提取关键动画帧。
连接单元,用于将所述关键动画帧按照在所述部分动画中的时间顺序连接,得到 所述临时动画。
在一些实施例中,所述提取单元包括:确定子单元和提取子单元。
确定子单元,用于根据切换时间确定关键帧数量,所述切换时间是从结束展示所述第一动作到开始展示所述第二动作之间的时间,所述切换时间小于所述部分动画的展示时间。
提取子单元,用于从所述部分动画中提取满足所述关键帧数量的动画帧作为所述关键动画帧。
在一些实施例中,所述确定子单元用于:获取所述切换时间以及所述虚拟角色的动作的帧动画帧率,所述帧动画帧率用于指示每单位时间展示动画帧的数量;将所述切换时间与所述帧动画帧率的乘积值确定为所述关键帧数量。
在一些实施例中,所述提取子单元用于执行以下方式之一:从所述部分动画中随机提取满足所述关键帧数量的动画帧作为所述关键动画帧;从所述部分动画中等间隔提取满足所述关键帧数量的动画帧作为所述关键动画帧;从所述部分动画中提取开始帧和结尾帧,并从除所述开始帧和所述结尾帧外的剩余帧中随机提取N-2个动画帧,得到所述关键动画帧,N为所述关键帧数量,所述关键动画帧包括所述开始帧,所述N-2个动画帧和所述结尾帧;以及,从所述部分动画中提取开始帧和结尾帧,并从除所述开始帧和所述结尾帧外的剩余帧中等间隔提取N-2个动画帧,得到所述关键动画帧,N为所述关键帧数量,所述关键动画帧包括所述开始帧,所述N-2个动画帧和所述结尾帧。
在一些实施例中,所述生成模块包括:确定单元和生成单元。
确定单元,用于确定所述部分动画的展示时间。
生成单元,用于在所述部分动画的展示时间大于或者等于目标时间的情况下,根据所述部分动画生成所述临时动画。
在一些实施例中,所述展示模块包括:处理单元、第一展示单元和第二展示单元。
处理单元,用于响应所述动作切换信息,停止展示所述第一帧动画,所述第一帧动画的展示停止在当前帧。
第一展示单元,用于衔接所述当前帧展示所述临时动画。
第二展示单元,用于衔接所述临时动画展示所述第二帧动画。
在一些实施例中,所述第二展示单元用于:衔接所述临时动画展示所述第二帧动画中所包括的切换动画,所述切换动画用于展示所述第一动作和所述第二动作之间的切换动作;衔接所述切换动画展示所述第二帧动画中所包括的动作动画,所述动作动画用于展示所述第二动作。
此处需要说明的是,上述模块与对应的步骤所实现的示例和应用场景相同,但不限于上述实施例所公开的内容。需要说明的是,上述模块作为装置的一部分可以运行在如图1所示的硬件环境中,可以通过软件实现,也可以通过硬件实现,硬件环境包括网络环境。
根据本发明实施例的另一个方面,本发明实施例还提供了一种用于实施上述虚拟角色的动作切换方法的电子装置。
图5是根据本发明实施例的一种电子装置的结构框图,如图5所示,该电子装置可以包括:一个或多个(图中仅示出一个)处理器501、存储器503、以及传输装置505, 如图5所示,该电子装置还可以包括输入输出设备507。
在一些实施例中,存储器503可用于存储软件程序以及模块,如本发明实施例中的虚拟角色的动作切换方法和装置对应的程序指令/模块,处理器501通过运行存储在存储器503内的软件程序以及模块,从而执行各种功能应用以及数据处理,即实现上述的虚拟角色的动作切换方法。存储器503可包括高速随机存储器,还可以包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些示例中,存储器503可进一步包括相对于处理器501远程设置的存储器,这些远程存储器可以通过网络连接至电子装置。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
上述的传输装置505用于经由一个网络接收或者发送数据,还可以用于处理器与存储器之间的数据传输。上述的网络具体实例可包括有线网络及无线网络。在一个示例中,传输装置505包括一个网络适配器(Network Interface Controller,NIC),其可通过网线与其他网络设备与路由器相连从而可与互联网或局域网进行通讯。在一个实例中,传输装置505为射频(Radio Frequency,RF)模块,其用于通过无线方式与互联网进行通讯。
在一些实施例中,存储器503用于存储应用程序。
处理器501可以通过传输装置505调用存储器503存储的应用程序,以执行下述步骤:在虚拟角色正在展示第一动作对应的第一帧动画的情况下,获取到所述虚拟角色的动作切换信息,所述动作切换信息用于指示将所述虚拟角色的动作从所述第一动作切换为第二动作;根据所述第一帧动画中未展示的部分动画生成所述第一动作对应的临时动画,所述临时动画所包括的动画帧的数量少于所述部分动画所包括的动画帧的数量;响应所述动作切换信息,停止展示所述第一帧动画,并依次展示所述临时动画和所述第二动作对应的第二帧动画。
采用本发明实施例,提供了一种虚拟角色的动作切换的方案。如果在虚拟角色正在展示第一动作对应的第一帧动画时,获取到了虚拟角色的动作切换信息来指示将虚拟角色的动作从第一动作切换为第二动作,则根据第一帧动画中未展示的部分动画生成第一动作对应的临时动画,停止播放第一帧动画后,先播放临时动画再播放第二动作的第二帧动画,达到了在虚拟角色切换动作时快速播放完原动作再播放目标动作的目的,使得在2D游戏中同一虚拟角色的不同动作切换时两个动作之间能够流畅衔接,克服了由于2D游戏虚拟角色缺少骨骼和蒙皮而无法像3D游戏虚拟角色那样流畅切换动作的问题,从而实现了提高虚拟角色进行动作切换时动作展示的流畅度的技术效果,进而解决了虚拟角色进行动作切换时动作展示的流畅度较差的技术问题。
本实施例中的具体示例可以参考上述实施例中所描述的示例,本实施例在此不再赘述。
本领域普通技术人员可以理解,图5所示的结构仅为示意,电子装置可以是智能手机(如Android手机、iOS手机等)、平板电脑、掌上电脑以及移动互联网设备(Mobile Internet Devices,MID)、PAD等电子设备。图5其并不对上述电子装置的结构造成限定。例如,电子装置还可包括比图5中所示更多或者更少的组件(如网络接口、显示装置等),或者具有与图5所示不同的配置。
本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令电子设备相关的硬件来完成,该程序可以存储于一计算机可读存储介质中,存储介质可以包括:闪存盘、只读存储器(Read-Only Memory,ROM)、随机存取器(Random Access Memory,RAM)、磁盘或光盘等。
本发明的实施例还提供了一种存储介质。在一些实施例中,上述存储介质可以用于执行虚拟角色的动作切换方法的程序代码。
在一些实施例中,上述存储介质可以位于上述实施例所示的网络中的多个网络设备中的至少一个网络设备上。
在一些实施例中,存储介质被设置为存储用于执行以下步骤的程序代码:在虚拟角色正在展示第一动作对应的第一帧动画的情况下,获取到所述虚拟角色的动作切换信息,所述动作切换信息用于指示将所述虚拟角色的动作从所述第一动作切换为第二动作;根据所述第一帧动画中未展示的部分动画生成所述第一动作对应的临时动画,所述临时动画所包括的动画帧的数量少于所述部分动画所包括的动画帧的数量;响应所述动作切换信息,停止展示所述第一帧动画,并依次展示所述临时动画和所述第二动作对应的第二帧动画。
本实施例中的具体示例可以参考上述实施例中所描述的示例,本实施例在此不再赘述。
在一些实施例中,上述存储介质可以包括但不限于:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。
图6示意性地示出了实现根据本发明的方法的计算机程序产品的框图。所述计算机程序产品包括计算机程序/指令610,当所述计算机程序/指令610被诸如图5所示的处理器501之类的处理器执行时,可实现上文所描述的虚拟角色的动作切换方法中的各个步骤。
上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。
上述实施例中的集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在上述计算机可读取的存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在存储介质中,包括若干指令用以使得一台或多台计算机设备(可为个人计算机、服务器或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。
在本发明的上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。
在本发明所提供的几个实施例中,应该理解到,所揭露的客户端,可通过其它的方式实现。以上所描述的装置实施例仅仅是示意性的,例如所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,单元或模块的间接耦合或通信连接,可以是电性或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显 示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
以上所述仅是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。

Claims (12)

  1. 一种虚拟角色的动作切换方法,应用于2D游戏,包括:
    在虚拟角色正在展示第一动作对应的第一帧动画的情况下,获取到所述虚拟角色的动作切换信息,所述动作切换信息用于指示将所述虚拟角色的动作从所述第一动作切换为第二动作;
    根据所述第一帧动画中未展示的部分动画生成所述第一动作对应的临时动画,所述临时动画所包括的动画帧的数量少于所述部分动画所包括的动画帧的数量;
    响应所述动作切换信息,停止展示所述第一帧动画,并依次展示所述临时动画和所述第二动作对应的第二帧动画。
  2. 根据权利要求1所述的方法,其中,根据所述第一帧动画中未展示的部分动画生成所述第一动作对应的临时动画包括:
    从所述部分动画中提取关键动画帧;
    将所述关键动画帧按照在所述部分动画中的时间顺序连接,得到所述临时动画。
  3. 根据权利要求2所述的方法,其中,从所述部分动画中提取关键动画帧包括:
    根据切换时间确定关键帧数量,所述切换时间是从结束展示所述第一动作到开始展示所述第二动作之间的时间,所述切换时间小于所述部分动画的展示时间;
    从所述部分动画中提取满足所述关键帧数量的动画帧作为所述关键动画帧。
  4. 根据权利要求3所述的方法,其中,根据切换时间确定关键帧数量包括:
    获取所述切换时间以及所述虚拟角色的动作的帧动画帧率,所述帧动画帧率用于指示每单位时间展示动画帧的数量;
    将所述切换时间与所述帧动画帧率的乘积值确定为所述关键帧数量。
  5. 根据权利要求3所述的方法,其中,从所述部分动画中提取满足所述关键帧数量的动画帧作为所述关键动画帧包括以下之一:
    从所述部分动画中随机提取满足所述关键帧数量的动画帧作为所述关键动画帧;
    从所述部分动画中等间隔提取满足所述关键帧数量的动画帧作为所述关键动画帧;
    从所述部分动画中提取开始帧和结尾帧,并从除所述开始帧和所述结尾帧外的剩余帧中随机提取N-2个动画帧,得到所述关键动画帧,N为所述关键帧数量,所述关键动画帧包括所述开始帧,所述N-2个动画帧和所述结尾帧;
    从所述部分动画中提取开始帧和结尾帧,并从除所述开始帧和所述结尾帧外的剩余帧中等间隔提取N-2个动画帧,得到所述关键动画帧,N为所述关键帧数量,所述关键动画帧包括所述开始帧,所述N-2个动画帧和所述结尾帧。
  6. 根据权利要求1所述的方法,其中,根据所述第一帧动画中未展示的部分动画生成所述第一动作对应的临时动画包括:
    确定所述部分动画的展示时间;
    在所述部分动画的展示时间大于或者等于目标时间的情况下,根据所述部分动画生成所述临时动画。
  7. 根据权利要求1所述的方法,其中,响应所述动作切换信息,停止展示所述第一帧动画,并依次展示所述临时动画和所述第二动作对应的第二帧动画包括:
    响应所述动作切换信息,停止展示所述第一帧动画,所述第一帧动画的展示停止在当前帧;
    衔接所述当前帧展示所述临时动画;
    衔接所述临时动画展示所述第二帧动画。
  8. 根据权利要求7所述的方法,其中,衔接所述临时动画展示所述第二帧动画包括:
    衔接所述临时动画展示所述第二帧动画中所包括的切换动画,所述切换动画用于展示所述第一动作和所述第二动作之间的切换动作;
    衔接所述切换动画展示所述第二帧动画中所包括的动作动画,所述动作动画用于展示所述第二动作。
  9. 一种虚拟角色的动作切换装置,应用于2D游戏,包括:
    获取模块,用于在虚拟角色正在展示第一动作对应的第一帧动画的情况下,获取到所述虚拟角色的动作切换信息,所述动作切换信息用于指示将所述虚拟角色的动作从所述第一动作切换为第二动作;
    生成模块,用于根据所述第一帧动画中未展示的部分动画生成所述第一动作对应的临时动画,所述临时动画所包括的动画帧的数量少于所述部分动画所包括的动画帧的数量;
    展示模块,用于响应所述动作切换信息,停止展示所述第一帧动画,并依次展示所述临时动画和所述第二动作对应的第二帧动画。
  10. 一种存储介质,所述存储介质包括存储的程序,所述程序运行时执行上述权利要求1至8任一项中所述的方法。
  11. 一种电子装置,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述处理器通过所述计算机程序执行上述权利要求1至8任一项中所述的方法。
  12. 一种计算机程序产品,包括计算机程序/指令,所述计算机程序/指令被处理器执行时实现根据权利要求1至8中任一项所述的方法。
PCT/CN2021/121352 2021-03-26 2021-09-28 一种虚拟角色的动作切换方法、装置及存储介质 WO2022198971A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110328078.6A CN113018855B (zh) 2021-03-26 2021-03-26 一种虚拟角色的动作切换方法和装置
CN202110328078.6 2021-03-26

Publications (1)

Publication Number Publication Date
WO2022198971A1 true WO2022198971A1 (zh) 2022-09-29

Family

ID=76472618

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/121352 WO2022198971A1 (zh) 2021-03-26 2021-09-28 一种虚拟角色的动作切换方法、装置及存储介质

Country Status (2)

Country Link
CN (1) CN113018855B (zh)
WO (1) WO2022198971A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113018855B (zh) * 2021-03-26 2022-07-01 完美世界(北京)软件科技发展有限公司 一种虚拟角色的动作切换方法和装置

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030045334A1 (en) * 2000-01-24 2003-03-06 Hirotaka Hosokawa Video game device, character action setting method in video game, and computer-readable recording medium storing character action setting program
CN101609561A (zh) * 2009-06-30 2009-12-23 广州市八丁动漫网络科技有限公司 一种实现动画间平滑过渡的方法
CN109947338A (zh) * 2019-03-22 2019-06-28 腾讯科技(深圳)有限公司 图像切换显示方法、装置、电子设备及存储介质
CN111773668A (zh) * 2020-07-03 2020-10-16 珠海金山网络游戏科技有限公司 一种动画播放方法和装置
CN113018855A (zh) * 2021-03-26 2021-06-25 完美世界(北京)软件科技发展有限公司 一种虚拟角色的动作切换方法和装置

Family Cites Families (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5999195A (en) * 1997-03-28 1999-12-07 Silicon Graphics, Inc. Automatic generation of transitions between motion cycles in an animation
JP3701557B2 (ja) * 2000-09-14 2005-09-28 エヌ・ティ・ティ・アドバンステクノロジ株式会社 画像表示制御方法及び装置、並びにコンピュータ読取可能な記録媒体
US7477254B2 (en) * 2005-07-13 2009-01-13 Microsoft Corporation Smooth transitions between animations
US20100095236A1 (en) * 2007-03-15 2010-04-15 Ralph Andrew Silberstein Methods and apparatus for automated aesthetic transitioning between scene graphs
TWI356355B (en) * 2007-12-03 2012-01-11 Inst Information Industry Motion transition method and system for dynamic im
CN102129705A (zh) * 2010-01-18 2011-07-20 腾讯科技(深圳)有限公司 一种动画制作方法、装置和动画播放方法、装置
CN104700444A (zh) * 2015-03-10 2015-06-10 上海鸿利数码科技有限公司 一种图片动画的实现方法
CN105976417B (zh) * 2016-05-27 2020-06-12 腾讯科技(深圳)有限公司 动画生成方法和装置
US10369469B2 (en) * 2016-11-09 2019-08-06 Electronic Arts Inc. Runtime animation substitution
CN108242071A (zh) * 2016-12-27 2018-07-03 方正国际软件(北京)有限公司 一种动画插值方法及装置
CN110102057B (zh) * 2019-05-28 2022-10-21 上海米哈游网络科技股份有限公司 一种过场动画衔接方法、装置、设备及介质
CN110248115B (zh) * 2019-06-21 2020-11-24 上海摩象网络科技有限公司 图像处理方法、装置及存储介质
CN111063013A (zh) * 2019-12-26 2020-04-24 珠海金山网络游戏科技有限公司 一种角色动作拼接方法及装置
CN111773686A (zh) * 2020-06-30 2020-10-16 完美世界(北京)软件科技发展有限公司 动画的生成方法和装置、存储介质、电子装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030045334A1 (en) * 2000-01-24 2003-03-06 Hirotaka Hosokawa Video game device, character action setting method in video game, and computer-readable recording medium storing character action setting program
CN101609561A (zh) * 2009-06-30 2009-12-23 广州市八丁动漫网络科技有限公司 一种实现动画间平滑过渡的方法
CN109947338A (zh) * 2019-03-22 2019-06-28 腾讯科技(深圳)有限公司 图像切换显示方法、装置、电子设备及存储介质
CN111773668A (zh) * 2020-07-03 2020-10-16 珠海金山网络游戏科技有限公司 一种动画播放方法和装置
CN113018855A (zh) * 2021-03-26 2021-06-25 完美世界(北京)软件科技发展有限公司 一种虚拟角色的动作切换方法和装置

Also Published As

Publication number Publication date
CN113018855B (zh) 2022-07-01
CN113018855A (zh) 2021-06-25

Similar Documents

Publication Publication Date Title
US11325037B2 (en) Apparatus and method of mapping a virtual environment
CN107154069B (zh) 一种基于虚拟角色的数据处理方法及系统
JP5987060B2 (ja) ゲームシステム、ゲーム装置、制御方法、プログラム及び記録媒体
JP6232423B2 (ja) 情報処理装置、描画装置、方法及びプログラム
CN111766950B (zh) 虚拟角色交互方法、装置、计算机设备和存储介质
CN110062271A (zh) 场景切换方法、装置、终端及存储介质
US8405662B2 (en) Generation of video
KR101612199B1 (ko) 가상 이미지 상에 자동적으로 표정을 재생하는 방법 및 장치
CN104580973A (zh) 一种虚拟手术模拟过程的录制、回放方法及装置
CN112528936B (zh) 视频序列编排方法、装置、电子设备及存储介质
JP6379107B2 (ja) 情報処理装置並びにその制御方法、及びプログラム
WO2022198971A1 (zh) 一种虚拟角色的动作切换方法、装置及存储介质
JP2008544393A (ja) 3d画面に動映像を挿入する方法及びその記録媒体
CN115631270A (zh) 虚拟角色的直播方法及装置、计算机存储介质、终端
CN113209640B (zh) 解说的生成方法、装置、设备及计算机可读存储介质
JP6200062B2 (ja) 情報処理装置、制御方法、プログラム及び記録媒体
KR20130130625A (ko) 비디오 생성 시스템 및 방법
US20240004529A1 (en) Metaverse event sequencing
US20220172431A1 (en) Simulated face generation for rendering 3-d models of people that do not exist
US10834561B2 (en) Smart hardware operation method and apparatus
WO2019213879A1 (zh) 输出内容处理方法、输出方法、电子设备及存储介质
US20230412852A1 (en) Live interactive method and apparatus, device, and storage medium
TWI814318B (zh) 用於使用模擬角色訓練模型以用於將遊戲角色之臉部表情製成動畫之方法以及用於使用三維(3d)影像擷取來產生遊戲角色之臉部表情之標籤值之方法
US11766617B2 (en) Non-transitory medium and video game processing system
US20230206534A1 (en) System to convert expression input into a complex full body animation, in real time or from recordings, analyzed over time

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21932580

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21932580

Country of ref document: EP

Kind code of ref document: A1