Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The terminology used in the embodiments of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in this application and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise, the "plurality" generally includes at least two.
The words "if", as used herein, may be interpreted as "at" or "when" or "in response to a determination" or "in response to a detection", depending on the context. Similarly, the phrase "if determined" or "if detected (stated condition or event)" may be interpreted as "when determined" or "in response to determination" or "when detected (stated condition or event)" or "in response to detection (stated condition or event), depending on the context.
In addition, the sequence of steps in the method embodiments described below is only an example and is not strictly limited.
In the existing game scene, in order to enrich the game display effect, corresponding cutscenes are inserted according to different game links or scenes. In the prior art, in order to make the consistency of the transition between the game scene and the cut scene better, the characters and the contents related to the game are integrated into the cut scene. For example, in a game link of a big bid, in order to promote the display effect of the special effect of the big bid, when one of the game characters releases the big bid, a cut scene is inserted, and the special effect of the big bid is comprehensively displayed. For another example, in some game scenes, when going to a certain link, in order to better attract the interests of users and more comprehensively understand the story content of the game, a cutscene in a dialogue form is added in the game scene. When the user does not want to see the scene, the fast forward operation of the scene can be realized by clicking the fast forward button. When the user cannot continue watching the cut scene in the temporary event, the pause operation of the cut scene can be realized by clicking the pause button. However, no matter the fast forward operation or the pause operation is performed on the cutscene, all relevant roles in the cutscene can generate discontinuous actions such as pause or fast forward. Especially, the main roles in the cutscene are also affected by the influence, so that the playing is not consistent. Therefore, the application provides a technical scheme capable of effectively improving the play consistency of the cutscene.
Fig. 1 is a schematic flow chart of a cutscene playing method according to an embodiment of the present application. As can be seen from fig. 1, the method specifically comprises the following steps:
101, in the playing process of the cut scene, establishing an animation state machine of a target role in the cut scene.
And 102, determining a target action label corresponding to the first playing time of the cutscene, which is configured on the time axis of the cutscene.
And 103, when the cut scene is played to a first playing time on the time axis, controlling the target role to execute a target action corresponding to the target action label at the first playing time through a target state node corresponding to the target action label established in the animation state machine.
The cut scene referred to herein is a cut scene inserted into a game scene. Of course, the technical scheme of the application is not limited to the cutscene used for the game scene, but can be applied to various animation scenes such as novels with animation or novels displayed in an animation mode. In the cutscene, there are many animated characters, for example, there are animated main angles or animated match angles as target characters, and there are scenic models, architectural models, mountains, flowers and trees, etc. in the animated scene. The focus of the user's attention is often focused on the target character.
In the cutscene, a corresponding time axis is configured, the time axis comprises a role action track, and action labels corresponding to each time interval on the time axis can be configured on the track, so that actions represented by the action labels are executed (i.e. played) by the roles bound with the track in each time interval according to the role action track. In practical application, an animation state machine can be established for a target role needing independent update in the process of playing the cutscene. The animation demonstration of the target character in the animation state machine is not influenced by operations such as pause, skip and the like of the cutscene, namely, when a user changes the playing state of the cutscene, the animation content of the target character is not changed immediately along with the cutscene. For example, in a cut scene where two target characters are involved in a conversation, when a pause point is configured on a time axis (through which, for example, cut scene pausing after the target character 1 finishes a speech, and waiting for an interactive operation by a user is realized), a conversation subtitle in the cut scene may be immediately tentative, but since character animations of the two target characters (i.e., actions performed (or called playing) in the cut scene by the target characters) are controlled by corresponding animation state machines, playing of animation actions of the target characters may not be immediately paused due to pausing of the cut scene, but the target character may be controlled by the animation state machine to continue to perform the current character actions (e.g., the above-described target actions).
Specifically, each action tag may be configured on a role action track bound with the target role, where each action tag corresponds to a time interval on the time axis, that is, each time tag has a start time and an end time, and according to the role action track, the target role may be controlled to execute a corresponding action in the time interval corresponding to each action tag. And when the starting time of a certain action label is the first playing time, for example, when the playing progress of the over-the-scene animation reaches the first playing time, the target action of the corresponding target character is played.
In practical applications, execution of the target action is controlled by the target state node. Specifically, when the cutscene is normally played, a target state node is established in the animation state machine, and then the target role is controlled to execute a corresponding target action in the cutscene (i.e. play the target action on the target role model) through the target state node. Through the scheme, the target actions, the lens movements and the like of the target characters are independently updated independently of the time axis of the cutscene, and a transition mechanism is provided to eliminate the influence on the target actions of the target characters when the playing state of the cutscene changes, for example, the target actions are incoherent.
In one or more embodiments of the present application, before the target role executes the target action corresponding to the target action tag at the first playing time, the method further includes determining whether the target role is executing the target action at the first playing time, if the target role is not executing the target action at the first playing time, setting up the target state node in the animation state machine according to the target action tag, and controlling the target role to execute the target action corresponding to the target action tag at the first playing time through the target state node.
In practical application, since the moving picture state machine is empty when the cutscene starts playing, when reaching a starting time point on the time axis (for example, when the first playing time is the starting time point), a state node (for example, a standby state node) corresponding to a standby action is established in a first state machine layer of the moving picture state machine, and the state node controls the target role to circularly execute the standby action in the cutscene; in addition, after the target character is controlled by the standby state node to perform the loop execution standby action, when the current playing time of the cut scene on the time axis (i.e. when the first playing time is not the starting time point) is bound with the action label of the action different from the standby action, when the target action required to be played at the playing time is required to be determined, a corresponding target state node is dynamically created in real time at the second state machine layer of the animation state machine, the second state machine layer in the animation state machine is switched to the state corresponding to the target state node, so that the target character is controlled by the target state node established in the second state machine layer to perform the corresponding target action, i.e. the playing of the target action of the target character is controlled by the target state node, so that the character animation (i.e. the action performed by the character or the action called playing on the character) is updated independently of the time axis of the cut scene, and the playing state change (for example, pause or fast forward) occurs in the cut scene, but the target action can continue to complete playing without the situation that the target action is paused together with the cut scene.
Fig. 2 is a flowchart of a method for creating an animation state machine according to an embodiment of the present application. As can be seen from fig. 2, the method further includes determining a role action track corresponding to the target role on a time axis of the cutscene, and taking an action label corresponding to the first playing time in action labels configured by the role action track as the target action label, wherein the action label corresponds to the first playing time in the action labels configured by the role action track, and the target action label is determined by the method.
In practical applications, according to different target characters and different animation playing requirements, action labels of different target actions are configured on character action tracks (or called character animation tracks) of the characters, so that action playing of the characters is controlled through the character action tracks.
For ease of understanding, the animation state machine setup scheme will be specifically illustrated below.
Fig. 3 is a schematic diagram of displaying a cutscene according to an embodiment of the present application. As can be seen from fig. 3, there are subtitles tied to the time axis in the cutscene, and a plurality of action tags configured in the character animation track of the time axis. Fig. 4 is a schematic diagram of an animation state machine according to an embodiment of the present application, in fig. 4, it can be seen that the animation state machine has two layers, a first state machine layer and a second state machine layer, respectively, and the state machine is empty.
In one or more embodiments of the application, the target actions (corresponding to actions represented by action tags configured in the character animation track in FIG. 3) include standby actions and character actions (or referred to as non-standby actions). The method further comprises the steps that when the target action is a standby action, the target state node is built in the moving picture state machine according to the target action label, the method comprises the steps of creating a first target state node corresponding to the standby action in a first state machine layer of the moving picture state machine when the standby action is played for the first time on a time axis of the cutscene at the first playing time, and when the target action is not the standby action, the target state node is built in the moving picture state machine according to the target action label, and the method comprises creating a second target state node corresponding to the target action in a second state machine layer of the moving picture state machine.
In order to meet the moving picture playing requirement of the target character and to cope with the influence of the cut scene on the action playing of the target character due to pause or fast forward and fast backward, the target action is divided into standby action and character action. The standby action (for example, the stand-by action) may be a cyclic play action, for example, when no state node exists in a second state machine layer of the animation state machine, the second state machine layer is empty, and a time interval exists between two state nodes of the second state machine layer respectively corresponding to time periods (i.e., time periods corresponding to the play actions of the two state nodes), and the target role is controlled to execute the standby action in a cyclic manner. Fig. 5 is a schematic diagram of a standby action of playing a target character by a first state machine layer according to an embodiment of the present application. As shown in fig. 5, when reaching the starting point a shown in fig. 3, the first play standby action dynamically creates a corresponding first target state node because the first state machine layer is empty, and switches the first state machine layer to a state corresponding to the standby action (i.e., standby state), and the first target state node controls the cyclic play of the standby action of the target character. Similarly, when the starting moment corresponding to the shoulder shrugging action is played, a second target state node corresponding to the shoulder shrugging action is dynamically created in the second state machine layer, the second state machine layer is switched to a role action state (namely, a state corresponding to the second target state node), the second target state node controls the target role to execute the corresponding role action (namely, the shoulder shrugging action), the shoulder shrugging action covers the cycle of the standby action, and accordingly the target role is presented in the cut scene to execute the shoulder shrugging action. In the embodiment of the application, the role action played according to the second state machine layer can cover the standby action circularly played according to the first state machine layer.
In one or more embodiments of the present application, after the target role is controlled to execute the target action corresponding to the target action label at the first playing time by the target state node corresponding to the target action label established in the animation state machine, the method further includes establishing a third target state node corresponding to the action label corresponding to the second playing time in the second state machine layer when the cutscene is played to the second playing time, and controlling the target role to execute the role action represented by the action label corresponding to the second playing time in the cutscene by the third target state node in the second state machine layer, wherein the role action is a non-standby action.
Fig. 6 is a schematic diagram of a play target action of two state machine layers according to an embodiment of the present application. As shown in fig. 6, the cutscene continues to play to the starting moment of the shrugging action (e.g., the first play moment or the second play moment), dynamically creates a corresponding state node, and switches the second state machine layer to the shrugging state. In practical application, the actions played in the two state nodes which are connected in front and back (or the corresponding time periods overlap) can be interpolated according to the fade-in and fade-out configuration information configured on the character animation track, for example, the fade-in and fade-out time periods, for example, the standby action and the shoulder-shrugging action are interpolated, so that the interpolated actions are played in the time periods, the natural and smooth transition from the standby action to the shoulder-shrugging action is realized, and the natural transition of the actions between two different state machine layers is realized. When the shrugging action is played, the shrugging action can cover the standby action, so that the shrugging action of the target character is displayed in the cutscene.
In one or more embodiments of the present application, after the third target state node in the second state machine layer controls the target character to execute the character action indicated by the action tag corresponding to the second playing time in the cut scene, the method further includes when the cut scene is played to a third playing time, the playing of the character action is ended, the cyclic state is not set for the character action, and if no new state node exists in the second state machine layer, the second state machine layer is switched to an empty state, and the first target state node controls the target character to execute the standby action.
For example, when the play reaches the end time of the shrugging action (i.e. the third play time), the shrugging action is played at the end, and the moving image state will remain updated, and since the shrugging action is not set with a cycle, after the shrugging action is played, the shrugging action is switched to the standby action, interpolation can be performed during the switching process, so as to realize a natural smooth transition from the shrugging action to the standby action, wherein the second state machine layer is automatically switched to the null state, and the first state machine layer is still in the standby cycle state at the moment, so that the standby action is continuously played in a cycle.
In one or more embodiments of the present application, when a jump instruction for the cutscene is received, the cutscene is jumped to a fourth playing time, and based on the fourth playing time on the time axis, a target action represented by an action tag corresponding to the fourth playing time is controlled by a target state node corresponding to the action tag corresponding to the fourth playing time, which is built in the animation state machine, to execute in the cutscene by the target role. The method comprises the steps of controlling a target role to execute a target action represented by an action label corresponding to a fourth playing time in a cut scene through a target state node corresponding to the action label corresponding to the fourth playing time, which is established in an animation state machine, based on the fourth playing time on the time axis, wherein the method specifically comprises the steps of starting playing the target action from a designated position if the target role does not start playing at the target action corresponding to the fourth playing time, and continuing to play the target action if the target role starts playing at the target action corresponding to the fourth playing time, wherein the target action represented by the action label corresponding to the fourth playing time is a role action.
For example, in connection with fig. 3, if the player clicks directly to skip the session when the time axis is played between the start point a and the pause point a, the time axis will jump directly to the pause point a position and continue playing.
Fig. 7 is a schematic diagram illustrating playing of a target action according to an embodiment of the present application. As shown in fig. 7, at the fourth playing time, if the shrugging action has not been started, the shrugging action is started from the beginning (or half of the target action, depending on the setting) of the target action, and if the second state machine layer has no new playing action request, the shrugging action is completely played. Optionally, when the time interval between the fourth target state node and the fifth state node located behind the fourth target state node in the second state machine layer is smaller than the playing duration required by the target action corresponding to the fourth target state node, performing action interpolation according to the fade-in fade-out configuration information of the time axis and playing interpolation action in the transition time period, and if the time interval between the role action second state machine layer 'shoulder shrugging' and 'head lifting' on the time axis is smaller than the duration required to play by the shoulder shrugging action, executing state switching when the time axis is played to the 'head lifting' starting position, and switching from shoulder shrugging to head lifting action. And performing interpolation transition between the two actions according to the configuration on the time axis. If the shrugging action is already playing when the game player clicks the skip dialogue, the second state machine layer will not switch states, so the shrugging action will continue to play unaffected.
In this embodiment, when the over-scene animation is played to a pause point (for example, a fifth playing time) configured on a time axis, a target state node corresponding to an action tag corresponding to the fifth playing time in the animation state machine is determined, and the target role is continuously controlled by the target state node to execute a target action corresponding to the action tag corresponding to the fifth playing time so as to complete playing of the target action.
For example, as shown in fig. 3, when the play reaches the pause point a, it can be seen that the shoulder-shrugging action is not yet played at this time, and the time axis is paused at the pause point a, assuming that the game player is no longer operating at this time. However, the animation state is kept updated to control the target character to complete execution of the shoulder-shrugging action (i.e. play the shoulder-shrugging action), and after the shoulder-shrugging action is played, the second state machine layer is switched to an empty state, and the first state machine layer is still in a standby circulation state at this time, so that the standby circulation is played continuously, and transition from the shoulder-shrugging action to the standby action is realized, wherein in the transition process, the target character can be controlled to be interpolated from the shoulder-shrugging action (i.e. the character action) to the standby action in a fade-out mode according to the fade-in and fade-out configuration information set on the time axis.
In one or more embodiments of the present application, a lens state machine of a lens in the cutscene is established in the playing process of the cutscene, a lens motion corresponding to a first playing time on a time axis of the cutscene is determined, and when the cutscene is played to the first playing time on the time axis, the lens motion is controlled to be executed in the cutscene by a target lens motion node established in the lens state machine.
It should be noted that, the lens motion is understood to be the action of shooting the cut scene, and similar to the playing control of the character animation, when the cut scene is played, the animation of the lens motion is updated independently of the time axis, so that the lens motion can be controlled according to the lens motion state node in the lens state machine under the condition that the cut scene is paused, and the lens motion (namely, the animation of the lens motion) corresponding to the current playing time can still be played continuously under the condition that the cut scene is paused. For specific implementation, reference may be made to each embodiment corresponding to fig. 1 to 7, and detailed description will not be repeated here.
Based on the same thought, the embodiment of the application also provides an animation playing device. Fig. 8 is a schematic structural diagram of an animation playing device according to an embodiment of the present application. As can be seen from fig. 8, the device comprises:
The establishing module 81 is configured to establish an animation state machine of a target character in a cutscene in the cutscene in a playing process of the cutscene;
a determining module 82, configured to determine a target action tag configured on a time axis of the cutscene and corresponding to a first playing time of the cutscene;
And the control module 83 is configured to control, when the cutscene is played to a first playing time on the time axis, the target role to execute a target action corresponding to the target action label at the first playing time through a target state node corresponding to the target action label established in the animation state machine.
Optionally, a determining module 82 is configured to determine whether the target role is executing the target action at the first playing time, and if the target role is not executing the target action at the first playing time, establish the target state node in the animation state machine according to the target action label, and control the target role to execute the target action corresponding to the target action label at the first playing time through the target state node.
Optionally, the determining module 82 is further configured to determine a role action track corresponding to the target role on the time axis of the cutscene, and take an action label corresponding to the first playing time in the action labels configured by the role action track as the target action label.
Optionally, the method further includes a node establishment module 84, when the target action is a standby action, the node establishment module 84 is configured to create a first target state node corresponding to the standby action in a first state machine layer of the animation state machine when the standby action is played at the first playing time as the standby action is played for the first time on a time axis of the cutscene;
When the target action is a non-standby action, a node creation module 84 is configured to create a second target state node corresponding to the target action in a second state machine layer of the animation state machine.
The node establishing module 84 is configured to establish a third target state node corresponding to an action tag corresponding to a second playing time in the second state machine layer when the cutscene is played to the second playing time, switch the second state machine layer of the animation state machine to a state corresponding to the third target state node, and control the target character to execute a character action represented by the action tag corresponding to the second playing time in the cutscene through the third target state node in the second state machine layer, where the character action is a non-standby action.
Optionally, the control module 83 is configured to switch the second state machine layer to an empty state when the cutscene is played to a third playing time, the playing of the role motion is finished and the role motion is not set to a circulation state, and if no new state node exists in the second state machine layer, and control the target role to execute the standby motion through the first target state node.
Optionally, the control module 83 is further configured to skip the cutscene to a fourth playing time when responding to the received skip instruction for the cutscene;
And based on the fourth playing time on the time axis, controlling the target role to execute the target action represented by the action label corresponding to the fourth playing time in the cut scene by the target state node corresponding to the action label corresponding to the fourth playing time, which is established in the animation state machine.
Optionally, the control module 83 is configured to start playing the target action from a designated position if the target action corresponding to the target character at the fourth playing time has not yet started playing;
And if the target action corresponding to the target role at the fourth playing time is started to play, continuing to play the target action.
Optionally, the establishing module 81 is further configured to establish a lens state machine of a lens in the cutscene during the playing process of the cutscene;
determining lens movement corresponding to a first playing moment on a time axis of the cut scene;
And when the cut scene is played to the first playing time on the time axis, controlling the lens to execute the lens movement in the cut scene through a target lens movement node established in the lens state machine.
In one possible design, the structure of the animation playing device shown in fig. 8 may be implemented as an electronic device. As shown in fig. 9, the electronic device may include a processor 91, a memory 92. Wherein the memory 92 has stored thereon executable code which, when executed by the processor 91, at least enables the processor 91 to implement the animation playing method as provided in the foregoing embodiments. The electronic device may also include a communication interface 93 in its structure for communicating with other devices or communication networks.
In addition, embodiments of the present invention provide a non-transitory machine-readable storage medium having executable code stored thereon, which when executed by a processor of a wireless router, causes the processor to perform the animation playback method provided in the foregoing embodiments.
Based on the embodiment, in the playing process of the cut scene, an animation state machine of a target role in the cut scene is established, the target action of the target role corresponding to the first playing time bound on the time axis of the cut scene is determined, and when the cut scene is played to the first playing time on the time axis, the target action is controlled to be executed in the cut scene by a target state node established in the animation state machine. By creating a separate state machine to execute the target action of the target character in the cut scene independently of the time axis of the cut scene, when the action adjustment is performed on the cut scene, the target action of the target character is updated independently and cannot be influenced by operations such as pause or fast forward on the cut scene, so that the target action of the target character can always keep a consistent display effect, and a user can obtain better watching experience.
The apparatus embodiments described above are merely illustrative, wherein the various modules illustrated as separate components may or may not be physically separate. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by adding necessary general purpose hardware platforms, or may be implemented by a combination of hardware and software. Based on such understanding, the foregoing aspects and their substantial or contributing portions may be embodied in the form of a computer product, which may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
It should be noted that the above-mentioned embodiments are merely for illustrating the technical solution of the present invention, and not for limiting the same, and although the present invention has been described in detail with reference to the above-mentioned embodiments, it should be understood by those skilled in the art that the technical solution described in the above-mentioned embodiments may be modified or some technical features may be equivalently replaced, and these modifications or substitutions do not make the essence of the corresponding technical solution deviate from the spirit and scope of the technical solution of the embodiments of the present invention.