WO2024120529A1 - 动画播放方法及装置 - Google Patents

动画播放方法及装置 Download PDF

Info

Publication number
WO2024120529A1
WO2024120529A1 PCT/CN2023/137661 CN2023137661W WO2024120529A1 WO 2024120529 A1 WO2024120529 A1 WO 2024120529A1 CN 2023137661 W CN2023137661 W CN 2023137661W WO 2024120529 A1 WO2024120529 A1 WO 2024120529A1
Authority
WO
WIPO (PCT)
Prior art keywords
video
animation
playback
group
files
Prior art date
Application number
PCT/CN2023/137661
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 WO2024120529A1 publication Critical patent/WO2024120529A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/431Generation of visual interfaces for content selection or interaction; Content or additional data rendering
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/478Supplemental services, e.g. displaying phone caller identification, shopping application
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/81Monomedia components thereof

Definitions

  • the present application relates to the field of game design technology, and in particular to an animation playing method and device.
  • Dynamic UI User Interface Design
  • transition effects dynamic interaction design
  • dynamic background design etc.
  • Dynamic UI significantly improves the look and feel of the game, and is of great significance for improving the user's gaming experience.
  • dynamic effects can be achieved by animation playback.
  • the UI transition effects in games are usually based on Animator (animator) animation to achieve dynamic effects, which specifically requires using Animator to adjust the values of UI controls; while the UI background boards and 2D (Two Dimension) special effects in games are usually based on sequence frame animation to achieve dynamic effects, which specifically requires preparing a sufficient number of pictures and loading them continuously in sequence at high speed, so that relatively delicate animation effects can be obtained at a high frame rate.
  • Animator animations are usually used to achieve relatively simple motion effects, such as color gradients, coordinate displacements, simple deformations, etc., which are difficult to achieve when faced with complex UI motion effects.
  • Sequence frame animations require the production of a large number of images, which is not only labor-intensive and costly, but also has a complicated production process.
  • the large amount of image resources required for sequence frame animations will increase the burden on memory and game packages.
  • the present application provides an animation playback method and device, the main purpose of which is to solve the current problems of heavy workload, high cost, complicated production process, and the large amount of image resources required for sequence frame animation, which will increase memory and The problem of the burden of the game package.
  • the technical solution is as follows:
  • an animation playing method comprising:
  • the plurality of animation video files are divided into at least one video group;
  • a playback controller is created for each video group in the at least one video group, and the video playback component is controlled to play the multiple video groups in sequence by using the playback controller corresponding to each video group.
  • a character climbing device comprising:
  • An acquisition module used for acquiring a video file list in response to an animation play instruction of a game scene, and extracting a plurality of animation video files from the video file list;
  • a division module configured to divide the plurality of animation video files into at least one video group according to the animation video files indicated to be played in a loop included in the plurality of animation video files;
  • the playback module is used to create a playback controller for each video group in the at least one video group, and use the playback controller corresponding to each video group to control the video playback component to play the multiple video groups in sequence.
  • a computer device including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the animation playback method described in any one of the first aspects when executing the computer program.
  • a computer-readable storage medium on which a computer program is stored.
  • the steps of the animation playback method described in any one of the first aspects are implemented.
  • the present application provides an animation playback method and device, which responds to the animation playback instruction of the game scene, obtains a video file list, extracts multiple animation video files from the video file list, and plays the animation video files in a loop according to the instructions included in the multiple animation video files, divides the multiple animation video files into at least one video group, creates a playback controller for each video group in at least one video group, and uses the playback controller corresponding to each video group to control the video playback component to play the multiple video groups in sequence, with one video playback component serving as a display, and one or more playback controllers being responsible for controlling the loading, unloading, playback, and pause of the video files, and using the video playback to achieve dynamic effects such as transitions and UI, which is not only simple to operate, but also does not need to occupy the equivalent of the actual UI, Resources for real-time rendering of special effects and scenes only require a small amount of decoding and rendering resources to achieve film-level animation effects, reducing the burden
  • FIG1 is a schematic diagram showing a flow chart of an animation playing method provided in an embodiment of the present application.
  • FIG2A shows a schematic diagram of another animation playing method provided in an embodiment of the present application.
  • FIG. 2B shows a schematic flow chart of an animation playing method provided in an embodiment of the present application
  • FIG2C shows a schematic flow chart of another animation playing method provided in an embodiment of the present application.
  • FIG3 shows a schematic structural diagram of an animation playback device provided in an embodiment of the present application
  • FIG4 shows a schematic diagram of the device structure of a computer device provided in an embodiment of the present application.
  • the present application provides an animation playing method, as shown in FIG1 , the method comprising:
  • this application proposes an animation playback method, in which a video playback component is used as a display, and one or more playback controllers are responsible for controlling the loading, unloading, playback, and pause of video files.
  • the video playback is used to achieve dynamic effects such as transitions and UI. It is not only simple to operate, but also does not need to occupy the equivalent of actual UI, special effects and scene real-time. Rendering resources only require a small amount of decoding and rendering resources to achieve film-level animation effects, reducing the burden on memory and game packages.
  • the present application can be applied to stand-alone games, online games or virtual worlds developed based on game engines.
  • the game engines can specifically be UE4 (Unreal Engine 4), UE5 (Unreal Engine 5), Untiy and other game engines, and the present application does not specifically limit this.
  • the timing of displaying animation effects will be set in the game.
  • the game will determine that an animation playback instruction has been received, and in response to the animation playback instruction, it will start to perform the animation playback operation.
  • developers will carry these contents in the game in the form of a video file list in advance. Therefore, when performing the animation playback operation, the game will obtain a video file list, extract multiple animation video files from the video file list, and then play these animation video files to achieve UI animation effects.
  • the video file list will include animation video files that indicate loop playback, and these animation video files that indicate loop playback will be used as loop point marks.
  • Multiple animation video files are grouped according to the loop point marks, and the videos in the same group will be played sequentially until the end, and loop playback will wait.
  • there can be one or more animation video files that indicate loop playback in the video file list and this application does not specifically limit this.
  • a playback controller is created for each video group in at least one video group, and the playback controller corresponding to each video group is used to control the video playback component to play multiple video groups in sequence. That is, the playback controller is created according to the number of video groups, and each playback controller is responsible for controlling the animation video file in its corresponding video group.
  • the video playback component may be an Image component in the game scene. It should be noted that when creating a playback controller according to the number of video groups, a rendering operation of the first frame of the video needs to be performed to prevent mistakes from occurring during the handover of the playback controller.
  • the method provided in the embodiment of the present application responds to the animation playback instruction of the game scene, obtains a video file list, extracts multiple animation video files from the video file list, and
  • the invention includes instructions for loop playback of animation video files, dividing multiple animation video files into at least one video group, creating a playback controller for each video group in at least one video group, and using the playback controller corresponding to each video group to control the video playback component to play multiple video groups in sequence.
  • a video playback component is used as a display, and one or more playback controllers are responsible for controlling the loading, unloading, playback, and pause of video files.
  • the video playback is used to achieve dynamic effects such as transitions and UI. It is not only simple to operate, but also does not require resources equivalent to actual UI, special effects, and real-time rendering of scenes. Only a small amount of decoding and rendering resources are required to achieve film-level animation effects, reducing the burden on memory and game packages.
  • the embodiment of the present application provides another animation playback method, as shown in FIG. 2A, the method includes:
  • Obtain multiple preset play trigger operations continuously collect game operations performed by players in the game scene, and compare the collected game operations with multiple preset play trigger operations. When the comparison determines that the collected game operation is the same as one of the multiple preset play trigger operations, it is determined that an animation play instruction has been received.
  • the game will set a time for displaying animation effects.
  • the game will determine that an animation playback instruction has been received, and in response to the animation playback instruction, it will start to execute the animation playback operation. Therefore, in the actual game process, the game will obtain multiple preset playback trigger operations, which are operations that require displaying UI dynamic effects, and continue to collect game operations that occur in the game scene, and compare the collected game operations with multiple preset playback trigger operations.
  • the comparison determines that the collected game operation is the same as a preset playback trigger operation in multiple preset playback trigger operations, it means that it is necessary to start executing the animation playback operation to realize the display of UI dynamic effects, that is, it is determined that the animation playback instruction has been received.
  • step 204 when the query determines that there is an animation video file whose video parameters indicate loop playback among multiple animation video files, execute the following step 204; when the query determines that there is no animation video file whose video parameters indicate loop playback among multiple animation video files, execute the following step 205.
  • the next animation video file will be played only if a player's operation is detected during the loop playback, otherwise the loop playback will continue. Therefore, after obtaining multiple animation video files, it is necessary to read the video parameters corresponding to each animation video file in the video file list of the multiple animation video files, and query whether there is an animation video file among the multiple animation video files whose video parameters indicate loop playback.
  • At least one loop point mark is sorted according to the order of the animation video files corresponding to each loop point mark in the video file list to obtain a first sorting result.
  • the first loop point mark ranked first is extracted from the first sorting result, and at least one first animation video file ranked before the first loop point mark is extracted from the plurality of animation video files.
  • a first animation video file and an animation video file corresponding to a first loop point mark are taken as a video group.
  • a second loop point mark that is next to the first loop point mark is continuously extracted from the first sorting result, and at least one second animation video file that is between the first loop point mark and the second loop point mark is extracted from multiple animation video files, and at least one second animation video file and an animation video file corresponding to the second loop point mark are taken as a video group, until at least one loop point mark is traversed to obtain at least one video group.
  • the multiple animation video files are regarded as a video group, and the following steps 206 to 207 are executed.
  • the multiple animation video files are regarded as a video group, and the following steps 206 to 207 are executed to implement the execution of the animation playback operation.
  • a playback controller is created for each video group in at least one video group, and the playback controller corresponding to each video group is used to control the video playback component to play multiple video groups in sequence. That is, a playback controller is created according to the number of video groups, and each playback controller is responsible for controlling the animation video file in its corresponding video group.
  • the video playback component can be an Image component in a game scene. It should be noted that while creating a playback controller according to the number of video groups, it is necessary to perform a rendering operation on the first frame of the video in order to prevent mistakes from occurring during the handover of the playback controller.
  • the process of controlling the video playback component to play multiple video groups in sequence is as follows:
  • At least one video group is sorted according to the arrangement order of the multiple animation video files in the video file list to obtain a second sorting result.
  • the playback controller of the video group sequentially inputs the rendering data of at least one animation video file included in the video group to the video playback component. Since the playback of the next video group can only be continued after the player's game operation is detected, it is also necessary to continuously detect whether the player has performed a game operation in the game scene during the playback process.
  • the game will re-based on the playback controller, sequentially input the rendering data of at least one animation video file included in the video group to the video playback component, and continuously detect whether the player has performed a game operation in the game scene, until the player is detected to have performed a game operation in the game scene, stop the playback controller, and continue to determine the next video group to be played and execute the playback operation of the video group.
  • video group can be played in the manner of inputting rendering data to the video playback component, continuously detecting whether the player has performed a game operation in the game scene during the playback process, and determining whether to play it in a loop.
  • the first playback controller is stopped, the second video group ranked next to the first video group is determined in the second sorting result, and the second playback controller corresponding to the second video group is used to control the video playback component to play the second video group until it is detected that the player requests to stop playing or at least one video group has been played.
  • the first playback controller is stopped, the second video group ranked next to the first video group is determined in the second sorting result, and the second playback controller corresponding to the second video group is used to control the video playback component to play the second video group until it is detected that the player requests to stop playing or at least one video group has been played.
  • some games will have a "skip" button, and after the player triggers this button, it is also necessary to stop playing the animation and enter the game. Therefore, when it is detected that the player triggers this button, it also means that the player's request to stop playing is detected.
  • At least one playback controller created in the game scene is destroyed, the playback cache of the video playback component is cleared, and the video playback component is hidden in the game scene.
  • Alpha channel video a channel representing additional information on the transparency of each pixel.
  • the main purpose of Alpha channel video is to realize complex cutscene animations. The "occlusion" process in the current cutscene.
  • the game scene is configured with a specified animation video file that indicates transparent playback, it is necessary to produce it based on the specified animation video file that indicates transparent playback, add a transparent playback layer on the specified animation video file, and based on the transparent playback layer, display the pixels of the specified part of the specified animation video file in a transparent manner to obtain the animation video file to be played.
  • the specified part is the part of the specified animation video file without video content.
  • the specified animation video file can be an RGB (Red Green Blue, red, green and blue channel) video.
  • an Alpha layer that is, a transparent playback layer
  • a transparent playback layer can be added to make the pixels of the content-free part of the specified animation video file displayed in a transparent manner, rather than gray or black, to ensure that during the video playback process, the game scene can still be seen through the transparent part, but at least one frame must be retained to block the full screen for scene resource loading.
  • the animation video file to be played can be applied in the actual game scene. Specifically, when using the animation video file to be played, as shown in Figure 2B, it is necessary to pass the animation video file to be played into the game scene, and according to the transition parameters set in the game scene, set a pause frame in the animation video file to be played, wherein the pause frame indicates when it is necessary to pause the playback to wait for the loading of the scene resource. Next, in response to the transition instruction of the player in the game scene, determine the specified game scene to be jumped indicated by the transition instruction, and play the animation video file to be played.
  • this design does not need to realize occlusion with simple displacement or deformation, can support the design of more complex graphics, more diverse styles, and supports adding post-production special effects to the video, which is completed by third-party tools without being limited by the Unity engine function.
  • a video file list is obtained to identify whether the video file list includes an animation video file indicating loop playback. If included, the video is grouped according to the loop point, a playback controller equal to the number of groups is created, and the first video group is started to be played. If not included, no grouping is required, and the video file playback operation is directly started.
  • it is continuously detected whether the player requests to stop playback. If not, loop playback is performed, and when the player's input instruction is received, the playback operation of the current playback controller is stopped, and the playback controller of the next video group is controlled to start the playback operation.
  • the video file list does not include an animation video file indicating loop playback
  • the video file list is automatically started. For video files, after a round of playback is completed, the playback end process will be entered. If a player request to stop playback is detected during the playback process, the playback end process will be entered, all playback controllers will be destroyed, the cache of the video playback component will be cleared, and the video playback component will be hidden to end the current process.
  • Video is a large-capacity information carrier. It can provide players with more information when used in cutscenes and UI. If used properly in design, it can help enhance fragmented narratives and player guidance. Moreover, the space is relatively small, benefiting from the improvement of video encoding format related technologies, such as VP8 (a video compression format) and VP9 (a video compression format). The compression rate of lossless compressed video can reach more than 99%. Compared with the premise of obtaining the same visual effect, the video is smaller in package size and memory usage.
  • the method provided in the embodiment of the present application uses a video playback component as a display, and one or more playback controllers are responsible for controlling the loading, unloading, playback, and pause of video files.
  • the video playback is used to achieve dynamic effects such as transitions and UI. It is not only simple to operate, but also does not require resources equivalent to actual UI, special effects, and real-time rendering of scenes. Only a small amount of decoding and rendering resources are required to achieve film-level animation effects, thereby reducing the burden on memory and game packages.
  • an embodiment of the present application provides an animation playback device, as shown in FIG. 3 , the device includes: an acquisition module 301 , a division module 302 and a playback module 303 .
  • the acquisition module 301 is used to obtain a video file list in response to an animation play instruction of a game scene, and extract multiple animation video files from the video file list;
  • the division module 302 is used to divide the multiple animation video files into at least one video group according to the animation video files included in the multiple animation video files indicating the animation video files to be played in a loop;
  • the playback module 303 is used to create a playback controller for each video group in the at least one video group, and use the playback controller corresponding to each video group to control the video playback component to play the multiple video groups in sequence.
  • the device also includes:
  • a collection module is used to obtain multiple preset play trigger operations, continuously collect game operations performed by players in the game scene, and compare the collected game operations with the multiple preset play trigger operations. Make a comparison;
  • the determination module is used to determine that the animation playback instruction is received when the collected game operation is determined to be the same as a preset playback trigger operation among the multiple preset playback trigger operations.
  • the division module 302 is used to read the video parameters corresponding to each of the multiple animation video files in the video file list, and query whether there is an animation video file whose video parameters indicate loop playback among the multiple animation video files; when the query determines that there is an animation video file whose video parameters indicate loop playback among the multiple animation video files, extract at least one animation video file whose video parameters indicate loop playback among the multiple animation video files as at least one loop point mark, and use the at least one loop point mark to divide the multiple animation video files into the at least one video group; when the query determines that there is no animation video file whose video parameters indicate loop playback among the multiple animation video files, treat the multiple animation video files as one video group.
  • the division module 302 is used to sort the at least one loop point mark according to the order of the animation video file corresponding to each loop point mark in the video file list to obtain a first sorting result; extract the first loop point mark ranked first in the first sorting result, extract at least one first animation video file ranked before the first loop point mark from the multiple animation video files, and take the at least one first animation video file and the animation video file corresponding to the first loop point mark as a video group; continue to extract the second loop point mark ranked after the first loop point mark in the first sorting result, extract at least one second animation video file ranked between the first loop point mark and the second loop point mark from the multiple animation video files, and take the at least one second animation video file and the animation video file corresponding to the second loop point mark as a video group, until the at least one loop point mark is traversed to obtain the at least one video group.
  • the playback module 303 is used to sort the at least one video group according to the arrangement order of the multiple animation video files in the video file list to obtain a second sorting result; while creating a playback controller for each video group in the at least one video group, extract the first video group ranked first in the second sorting result, and use the first playback controller corresponding to the first video group to control the video playback component to play the first video group; when a player operation is detected in the game scene, the first playback controller is stopped, and the second video group ranked next to the first video group is determined in the second sorting result, and the second playback controller is used to control the video playback component to play the first video group.
  • the second playback controller corresponding to the video group controls the video playback component to play the second video group until it is detected that the player requests to stop playing or the at least one video group is finished playing.
  • the playback module 303 is used to determine the current video group to be played, and based on the playback controller of the video group, sequentially input the rendering data of at least one animation video file included in the video group to the video playback component, and continuously detect whether the player performs a game operation in the game scene; when the at least one animation video file is played and the player is not detected to perform a game operation in the game scene, the rendering data of at least one animation video file included in the video group is sequentially input to the video playback component based on the playback controller, and continuously detect whether the player performs a game operation in the game scene until the player is detected to perform a game operation in the game scene, then the playback controller is stopped, and the next video group to be played is continuously determined and the playback operation of the video group is executed.
  • the device also includes:
  • a destroying module configured to destroy at least one created play controller in the game scene when detecting that a player requests to stop playing or the at least one video group has finished playing;
  • the hiding module is used to clear the playback cache of the video playback component and hide the video playback component in the game scene.
  • the device also includes:
  • An adding module configured to add a transparent playback layer on the specified animation video file if the game scene is configured with a specified animation video file indicating transparent playback;
  • the processing module is used to display the pixel points of the specified part on the specified animation video file in a transparent manner based on the transparent playback layer to obtain the animation video file to be played, wherein the specified part is the part of the specified animation video file without video content.
  • the playback module 303 is also used to transfer the animation video file to be played into the game scene, and set a pause frame in the animation video file to be played according to the transition parameters set in the game scene; in response to the player's transition instruction in the game scene, determine the designated game scene to be jumped to indicated by the transition instruction, and play the animation video file to be played; when it is detected that the current playback progress of the animation video file to be played reaches the pause frame, pause the playback of the animation video file to be played, and wait for the loading of the designated game scene; when it is detected that the loading of the designated game scene is complete, continue to play the animation video file to be played.
  • the device provided in the embodiment of the present application responds to the animation playing instruction of the game scene to obtain the video file
  • a video file list is provided, and multiple animation video files are extracted from the video file list.
  • the animation video files are played in a loop according to the instructions included in the multiple animation video files, the multiple animation video files are divided into at least one video group, and a playback controller is created for each video group in the at least one video group, and the playback controller corresponding to each video group is used to control the video playback component to play the multiple video groups in sequence.
  • a video playback component is used as a display, and one or more playback controllers are responsible for controlling the loading, unloading, playback, and pause of video files.
  • the video playback is used to realize dynamic effects such as transitions and UI.
  • user information including but not limited to user device information, user personal information, etc.
  • data including but not limited to data used for analysis, stored data, displayed data, etc.
  • a computer device which includes a bus, a processor, a memory and a communication interface, and may also include an input/output interface and a display device, wherein each functional unit can communicate with each other through the bus.
  • the memory stores a computer program
  • the processor is used to execute the program stored in the memory and execute the animation playing method in the above embodiment.
  • a computer-readable storage medium stores a computer program, which implements the steps of the animation playing method when executed by a processor.
  • the present application can be implemented by hardware, or by software plus necessary general hardware platform.
  • the technical solution of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each implementation scenario of the present application.
  • a non-volatile storage medium which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.
  • a computer device which can be a personal computer, a server, or a network device, etc.
  • modules in the device in the implementation scenario can be distributed in the device in the implementation scenario according to the implementation scenario description, or can be changed accordingly and located in one or more devices different from the implementation scenario.
  • the modules in the above implementation scenario can be combined into one module, or can be further split into multiple sub-modules.

Landscapes

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

Abstract

本发明公开了一种动画播放方法及装置,涉及游戏设计技术领域。包括:响应于游戏场景的动画播放指令,获取视频文件列表,在视频文件列表中提取多个动画视频文件;根据多个动画视频文件中包括的指示进行循环播放的动画视频文件,将多个动画视频文件划分为至少一个视频组;分别为至少一个视频组中每个视频组创建播放控制器,以及利用每个视频组对应的播放控制器,控制视频播放组件依次播放多个视频组。本发明由一个视频播放组件作为显示器,由一个或多个播放控制器负责控制视频文件的加载、卸载、播放、暂停等,利用视频的播放实现转场等动态效果,操作简单,无需占用等价于实际UI、特效和场景实时渲染的资源。

Description

动画播放方法及装置
交叉引用
本申请要求2022年12月08日递交的、申请号为“202211573420.X”、发明名称为“动画播放方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及游戏设计技术领域,特别是涉及一种动画播放方法及装置。
背景技术
随着游戏设计技术的不断发展,动态UI(User Interface Design,用户界面设计)被广泛应用于游戏开发的各个环节,常见的有转场效果、动态交互设计、动态背景设计等等。动态UI对游戏观感提升显著,对于提高用户游戏体验具有非常重要的意义,具体可以采用动画播放的方式实现动态效果。
相关技术中,游戏中的UI转场效果通常基于Animator(动画绘制器)动画实现动态效果,具体需要利用Animator调整UI控件数值实现;而游戏中的UI背景板和2D(Two Dimension,二维)特效通常基于序列帧动画实现动态效果,具体需要准备足够数量的图片,依照顺序高速连续加载,在高帧率下可以获得相对细腻的动画效果。
在实现本申请的过程中,申请人发现相关技术至少存在以下问题:
Animator动画通常用于实现相对简单的动效,例如:颜色渐变、坐标位移、简单形变等,面对复杂UI动效实现起来比较困难,而序列帧动画则需要制作大量的图片,不仅工作量大,成本高,制作工序繁杂,而且序列帧动画所需要的大量图片资源会增加内存和游戏包体的负担。
发明内容
本申请提供了一种动画播放方法及装置,主要目的在于解决目前工作量大,成本高,制作工序繁杂,而且序列帧动画所需要的大量图片资源会增加内存和 游戏包体的负担的问题。所述技术方案如下:
依据本申请一个方面,提供了一种动画播放方法,该方法包括:
响应于游戏场景的动画播放指令,获取视频文件列表,在所述视频文件列表中提取多个动画视频文件;
根据所述多个动画视频文件中包括的指示进行循环播放的动画视频文件,将所述多个动画视频文件划分为至少一个视频组;
分别为所述至少一个视频组中每个视频组创建播放控制器,以及利用所述每个视频组对应的播放控制器,控制视频播放组件依次播放所述多个视频组。
依据本申请另一个方面,提供了一种角色攀爬装置,该装置包括:
获取模块,用于响应于游戏场景的动画播放指令,获取视频文件列表,在所述视频文件列表中提取多个动画视频文件;
划分模块,用于根据所述多个动画视频文件中包括的指示进行循环播放的动画视频文件,将所述多个动画视频文件划分为至少一个视频组;
播放模块,用于分别为所述至少一个视频组中每个视频组创建播放控制器,以及利用所述每个视频组对应的播放控制器,控制视频播放组件依次播放所述多个视频组。
依据本申请又一个方面,提供了一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,所述处理器执行所述计算机程序时实现上述第一方面中任一项所述动画播放方法的步骤。
依据本申请再一个方面,提供了一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述第一方面中任一项所述动画播放方法的步骤。
借由上述技术方案,本申请提供的一种动画播放方法及装置,本申请响应于游戏场景的动画播放指令,获取视频文件列表,在视频文件列表中提取多个动画视频文件,根据多个动画视频文件中包括的指示进行循环播放的动画视频文件,将多个动画视频文件划分为至少一个视频组,分别为至少一个视频组中每个视频组创建播放控制器,以及利用每个视频组对应的播放控制器,控制视频播放组件依次播放多个视频组,由一个视频播放组件作为显示器,由一个或多个播放控制器负责控制视频文件的加载、卸载、播放、暂停等,利用视频的播放实现转场、UI等动态效果,不仅操作简单,而且无需占用等价于实际UI、 特效和场景实时渲染的资源,仅需占用少量解码和渲染资源,就可以实现影视级的动画效果,减轻内存和游戏包体的负担。
附图说明
图1示出了本申请实施例提供的一种动画播放方法流程示意图;
图2A示出了本申请实施例提供的另一种动画播放方法流程示意图;
图2B示出了本申请实施例提供的一种动画播放方法流程示意图;
图2C示出了本申请实施例提供的另一种动画播放方法流程示意图;
图3示出了本申请实施例提供的一种动画播放装置的结构示意图;
图4示出了本申请实施例提供的一种计算机设备的装置结构示意图。
具体实施方式
下面将参照附图更详细地描述本申请的示例性实施例。虽然附图中显示了本申请的示例性实施例,然而应当理解,可以以各种形式实现本申请而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本申请,并且能够将本申请的范围完整的传达给本领域的技术人员。
本申请实施例提供了一种动画播放方法,如图1所示,该方法包括:
101、响应于游戏场景的动画播放指令,获取视频文件列表,在视频文件列表中提取多个动画视频文件。
申请人认识到,基于Animator动画或序列帧动画实现动态效果时存在以下两个弊端,一是从制作角度考虑,序列帧动画的实现效果高度依赖图片的精细程度和每帧图片之间的连贯性,用于制作时长较长的动效时,工作量特别大,成本极高,而从资源角度考虑,序列帧动画所需要的大量图片资源会增加内存和游戏包体的负担;二是Animator动画通常用于实现相对简单的动效,例如:颜色渐变、坐标位移、简单形变等,面对复杂UI动效实现起来比较困难。而如今世界范围内二次元游戏领域竞争加剧,小型的UI动效的设计差距逐渐缩小,很难独树一帜,产生令人眼前一亮的效果,需要在大型动画效果的设计和使用等领域进行深耕,从而实现产品风格化,扩大IP优势,因此,本申请提出了一种动画播放方法,由一个视频播放组件作为显示器,由一个或多个播放控制器负责控制视频文件的加载、卸载、播放、暂停等,利用视频的播放实现转场、UI等动态效果,不仅操作简单,而且无需占用等价于实际UI、特效和场景实时 渲染的资源,仅需占用少量解码和渲染资源,就可以实现影视级的动画效果,减轻内存和游戏包体的负担。
本申请可以应用于基于游戏引擎开发的单机游戏、网络游戏或者虚拟世界中,游戏引擎具体可以是UE4(Unreal Engine 4,虚幻引擎4)、UE5(Unreal Engine5,虚幻引擎5)、Untiy等游戏引擎,本申请对此不进行具体限定。在本申请实施例中,游戏中会设置动画效果的展现时机,一般为玩家在游戏场景中发生需要展示UI动效的操作后,游戏会确定接收到动画播放指令,响应于该动画播放指令,开始执行动画的播放操作。进一步,由于一些负载的UI动画效果需要体现出很多内容,开发人员会将这些内容事先以视频文件列表的形式搭载在游戏中,因此,在执行动画的播放操作时,游戏会获取视频文件列表,在视频文件列表中提取多个动画视频文件,后续通过播放这些动画视频文件实现UI动画效果。
102、根据多个动画视频文件中包括的指示进行循环播放的动画视频文件,将多个动画视频文件划分为至少一个视频组。
在本申请实施例中,视频文件列表中会包括指示进行循环播放的动画视频文件,这些指示进行循环播放的动画视频文件将作为循环点标记,根据循环点标记将多个动画视频文件进行分组,同一组的视频将顺序播放,直至末尾,循环播放等待。其中,视频文件列表中可以存在一个或者多个指示进行循环播放的动画视频文件,本申请对此不进行具体限定。
103、分别为至少一个视频组中每个视频组创建播放控制器,以及利用每个视频组对应的播放控制器,控制视频播放组件依次播放多个视频组。
在本申请实施例中,完成分组后,分别为至少一个视频组中每个视频组创建播放控制器,以及利用每个视频组对应的播放控制器,控制视频播放组件依次播放多个视频组。也即根据视频组的组数创建播放控制器,每个播放控制器负责控制其对应的视频组中的动画视频文件。
其中,视频播放组件可以为游戏场景中的Image(图像)组件。需要说明的是,在根据视频组的组数创建播放控制器的同时需要执行视频第一帧的渲染操作,以便防止播放控制器交接过程中出现穿帮情况。
本申请实施例提供的方法,响应于游戏场景的动画播放指令,获取视频文件列表,在视频文件列表中提取多个动画视频文件,根据多个动画视频文件中 包括的指示进行循环播放的动画视频文件,将多个动画视频文件划分为至少一个视频组,分别为至少一个视频组中每个视频组创建播放控制器,以及利用每个视频组对应的播放控制器,控制视频播放组件依次播放多个视频组,由一个视频播放组件作为显示器,由一个或多个播放控制器负责控制视频文件的加载、卸载、播放、暂停等,利用视频的播放实现转场、UI等动态效果,不仅操作简单,而且无需占用等价于实际UI、特效和场景实时渲染的资源,仅需占用少量解码和渲染资源,就可以实现影视级的动画效果,减轻内存和游戏包体的负担。
进一步的,作为上述实施例具体实施方式的细化和扩展,为了完整说明本实施例的具体实施过程,本申请实施例提供了另一种动画播放方法,如图2A所示,该方法包括:
201、获取多个预设播放触发操作,持续采集玩家在游戏场景中发生的游戏操作,以及将采集到的游戏操作与多个预设播放触发操作进行比对,当比对确定采集到的游戏操作与多个预设播放触发操作中的一预设播放触发操作相同时,确定接收到动画播放指令。
在本申请实施例中,游戏中会设置动画效果的展现时机,一般为玩家在游戏场景中发生需要展示UI动效的操作后,游戏会确定接收到动画播放指令,响应于该动画播放指令,开始执行动画的播放操作。因此,在实际游戏的过程中,游戏会获取多个预设播放触发操作,多个预设播放触发操作也即需要展示UI动效的操作,并持续采集玩家在游戏场景中发生的游戏操作,以及将采集到的游戏操作与多个预设播放触发操作进行比对。当比对确定采集到的游戏操作与多个预设播放触发操作中的一预设播放触发操作相同时,表示需要开始执行动画播放操作,实现UI动效的展示,也即确定接收到动画播放指令。
202、响应于游戏场景的动画播放指令,获取视频文件列表,在视频文件列表中提取多个动画视频文件。
在本申请实施例中,由于一些负载的UI动画效果需要体现出很多内容,开发人员会将这些内容事先以视频文件列表的形式搭载在游戏中,因此,响应于游戏场景的动画播放指令,游戏会获取视频文件列表,在视频文件列表中提取多个动画视频文件。
203、读取多个动画视频文件中每个动画视频文件在视频文件列表中对应的 视频参数,查询多个动画视频文件中是否存在视频参数指示循环播放的动画视频文件,当查询确定多个动画视频文件中存在视频参数指示循环播放的动画视频文件时,执行下述步骤204;当查询确定多个动画视频文件中不存在视频参数指示循环播放的动画视频文件时,执行下述步骤205。
在本申请实施例中,由于有些动画视频文件需要循环播放,循环播放的过程中如果检测到玩家的操作,才会继续播放下一动画视频文件,否则会持续循环播放,因此,获取到多个动画视频文件后,需要读取多个动画视频文件中每个动画视频文件在视频文件列表中对应的视频参数,查询多个动画视频文件中是否存在视频参数指示循环播放的动画视频文件。
当查询确定多个动画视频文件中存在视频参数指示循环播放的动画视频文件时,这些指示进行循环播放的动画视频文件将作为循环点标记,根据循环点标记将多个动画视频文件进行分组,同一组的视频将顺序播放,直至末尾,循环播放等待,因此,执行下述步骤204。而当查询确定多个动画视频文件中不存在视频参数指示循环播放的动画视频文件时,表示无需执行循环播放,直接按照正常的顺序播放多个动画视频文件至结尾即可,因此,执行下述步骤205。
204、当查询确定多个动画视频文件中存在视频参数指示循环播放的动画视频文件时,在多个动画视频文件中提取视频参数指示循环播放的至少一个动画视频文件作为至少一个循环点标记,利用至少一个循环点标记,将多个动画视频文件划分为至少一个视频组,以及执行下述步骤206至步骤207。
在本申请实施例中,当查询确定多个动画视频文件中存在视频参数指示循环播放的动画视频文件时,这些指示进行循环播放的动画视频文件将作为循环点标记,根据循环点标记将多个动画视频文件进行分组,同一组的视频将顺序播放,直至末尾,循环播放等待。因此,需要在多个动画视频文件中提取视频参数指示循环播放的至少一个动画视频文件作为至少一个循环点标记,利用至少一个循环点标记,将多个动画视频文件划分为至少一个视频组,具体分组过程如下:
首先,根据至少一个循环点标记中每个循环点标记对应的动画视频文件在视频文件列表中的顺序,对至少一个循环点标记进行排序,得到第一排序结果。
随后,在第一排序结果中提取排在首位的第一循环点标记,在多个动画视频文件中提取排在第一循环点标记之前的至少一个第一动画视频文件,将至少 一个第一动画视频文件和第一循环点标记对应的动画视频文件作为一视频组。接着,继续在第一排序结果中提取排在第一循环点标记下一位的第二循环点标记,在多个动画视频文件中提取排在第一循环点标记和第二循环点标记之间的至少一个第二动画视频文件,将至少一个第二动画视频文件和第二循环点标记对应的动画视频文件作为一视频组,直至遍历至少一个循环点标记,得到至少一个视频组。
这样,通过上述过程便实现了根据至少一个循环点标记将视频进行分组,后续按照组别依次执行动画播放操作,也即执行下述步骤206至步骤207。
205、当查询确定多个动画视频文件中不存在视频参数指示循环播放的动画视频文件时,将多个动画视频文件作为一个视频组,以及执行下述步骤206至步骤207。
在本申请实施例中,当查询确定多个动画视频文件中不存在视频参数指示循环播放的动画视频文件时,表示无需执行循环播放,直接按照正常的顺序播放多个动画视频文件至结尾即可,因此,将多个动画视频文件作为一个视频组,以及执行下述步骤206至步骤207,实现动画播放操作的执行。
206、分别为至少一个视频组中每个视频组创建播放控制器,以及利用每个视频组对应的播放控制器,控制视频播放组件依次播放多个视频组。
在本申请实施例中,完成分组后,分别为至少一个视频组中每个视频组创建播放控制器,以及利用每个视频组对应的播放控制器,控制视频播放组件依次播放多个视频组。也即根据视频组的组数创建播放控制器,每个播放控制器负责控制其对应的视频组中的动画视频文件。其中,视频播放组件可以为游戏场景中的Image组件。需要说明的是,在根据视频组的组数创建播放控制器的同时需要执行视频第一帧的渲染操作,以便防止播放控制器交接过程中出现穿帮情况。在一个可选地实施方案中,控制视频播放组件依次播放多个视频组的过程如下:
首先,根据多个动画视频文件在视频文件列表中的排列顺序,对至少一个视频组进行排序,得到第二排序结果。
随后,在为至少一个视频组中每个视频组创建播放控制器的同时,在第二排序结果中提取排在首位的第一视频组,利用第一视频组对应的第一播放控制器,控制视频播放组件播放第一视频组。具体在播放第一视频组时,需要基于 视频组的播放控制器,向视频播放组件依次输入视频组中包括的至少一个动画视频文件的渲染数据。而由于在检测到玩家发生游戏操作后才能够继续执行下一视频组的播放,因此,在播放的过程中还需要持续检测玩家是否在游戏场景中发生游戏操作。相应地,当至少一个动画视频文件播放完毕且未检测到玩家在游戏场景中发生游戏操作时,需要循环播放,因此,游戏会重新基于播放控制器,向视频播放组件依次输入视频组中包括的至少一个动画视频文件的渲染数据,以及持续检测玩家是否在游戏场景中发生游戏操作,直至检测到玩家在游戏场景中发生游戏操作,将播放控制器停止,并继续确定下一待播放的视频组以及执行视频组的播放操作。需要说明的是,无论是哪一视频组的播放,均可以采用上述向视频播放组件输入渲染数据、播放的过程中持续检测玩家是否在游戏场景中发生游戏操作并判断是否循环播放的方式进行播放。
这样,当在游戏场景中检测到玩家发生游戏操作时,表示需要对下一视频组进行播放,因此,将第一播放控制器停止,在第二排序结果中确定排在第一视频组下一位的第二视频组,以及利用第二视频组对应的第二播放控制器,控制视频播放组件播放第二视频组,直至检测到玩家请求停止播放或至少一个视频组播放完毕。需要说明的是,有些游戏中会设置“跳过”按键,玩家触发该按键后也需要停止播放动画并进入到游戏中,因此,当检测到玩家触发该按键时,也表示检测到玩家请求停止播放。
207、当检测到玩家请求停止播放或至少一个视频组播放完毕时,在游戏场景中将创建的至少一个播放控制器销毁,清空视频播放组件的播放缓存,以及在游戏场景中将视频播放组件隐藏。
在本申请实施例中,当检测到玩家请求停止播放或至少一个视频组播放完毕时,为了避免影响玩家后续的正常游戏操作,需要在游戏场景中将创建的至少一个播放控制器销毁,清空视频播放组件的播放缓存,以及在游戏场景中将视频播放组件隐藏,结束本次的动画播放操作。这样,通过本申请的技术方案普通视频,可以实现基于Image组件的一切功能与其它UI组件兼容适配性良好。
需要说明的是,实际应用的过程中,有些游戏中需要以透明的方式播放动画,也即使播放的动画中部分区域是透明的,通过透明部分仍然可以看到游戏场景的画面。因此,本申请实施例还引入了Alpha(代表各像素点透明度的附加信息的通道)通道视频,Alpha通道视频主要目的是为了实现复杂过场动画,实 现过场动画中的“遮挡”过程。若游戏场景配置有指示进行透明播放的指定动画视频文件,则需要在指示进行透明播放的指定动画视频文件的基础上进行制作,在指定动画视频文件上添加透明播放图层,基于透明播放图层,将指定动画视频文件上指定部分的像素点以透明方式显示,得到待播放动画视频文件。其中,指定部分是指定动画视频文件中无视频内容的部分,指定动画视频文件可以为RGB(Red Green Blue,红绿蓝通道)视频,实际应用的过程中可以在RGB视频基础上制作,添加Alpha层(也即透明播放图层),使指定动画视频文件中无内容的部分的像素点以透明方式显示,而非灰色或黑色,保证在视频播放过程中,通过透明部分仍然可以看到游戏场景画面,但仍需至少保留一帧遮挡全屏幕,用于场景资源加载。
完成了待播放动画视频文件的制作后,便可以将待播放动画视频文件应用在实际的游戏场景中。具体地,在使用该待播放动画视频文件时,如图2B所示,需要将待播放动画视频文件传入游戏场景,以及根据游戏场景中设置的转场参数,在待播放动画视频文件中设置暂停帧,其中,该暂停帧指示了需要在何时暂停播放等待场景资源的加载。接下来,响应于游戏场景中玩家的转场指令,确定转场指令指示的待跳转的指定游戏场景,以及播放待播放动画视频文件。当检测到待播放动画视频文件的当前播放进度达到暂停帧时,需要暂停待播放动画视频文件的播放,等待指定游戏场景的加载,并在检测到指定游戏场景加载完成时,继续播放待播放动画视频文件。这种设计与传统UI切入遮挡相比,无需以简单的位移或形变实现遮挡,可以支持设计的图形更加复杂,风格也更多样,而且支持对视频添加后期特效,由第三方工具完成,无需受到Unity引擎功能限制。
综上所述,本申请的技术方案总结如下:
如图2C所示,响应于游戏场景的动画播放指令,获取视频文件列表,识别视频文件列表中是否包括指示循环播放的动画视频文件。若包括,则根据循环点将视频分组,创建与分组数量相等的播放控制器,并开始播放第一视频组,而若未包括,则无需分组,直接开始执行视频文件的播放操作。在播放的过程中持续检测玩家是否请求停止播放,如果没有,则循环播放,并在接收到玩家输入指令时,停止当前播放控制器的播放操作,控制下一视频组的播放控制器开始执行播放操作。另外,如果视频文件列表中没有包括指示循环播放的动画 视频文件,则在执行完一轮次的播放后,便进入播放结束流程。而如果在播放的过程中检测到玩家请求停止播放,则进入播放结束流程,销毁全部的播放控制器,清空视频播放组件的缓存,并将视频播放组件隐藏,结束当前流程。
这样,用一个类似于传统CG(Computer Graphics,计算机动画)动画的播放方式,由一个Image组件作为“显示器”。由一个或多个控制器负责视频资源的加载、卸载、播放和暂停等功能,逻辑经由视频管理器提供的接口进行操作,采用这种方式能够提高播放的动画的信息容量,视频是一种大容量信息载体,在过场和UI中使用可以给玩家提供更多的信息,在设计上如果利用得当,对碎片化叙事和玩家引导的增强有一定帮助;而且,空间相对较小,受益于视频编码格式相关技术的提升,诸如VP8(一种视频压缩格式)、VP9(一种视频压缩格式)的编码格式,无损压缩视频的压缩率可以达到99%以上,以获得同等视觉效果为前提做对比,视频在包体和内存占用量上较小。
本申请实施例提供的方法,由一个视频播放组件作为显示器,由一个或多个播放控制器负责控制视频文件的加载、卸载、播放、暂停等,利用视频的播放实现转场、UI等动态效果,不仅操作简单,而且无需占用等价于实际UI、特效和场景实时渲染的资源,仅需占用少量解码和渲染资源,就可以实现影视级的动画效果,减轻内存和游戏包体的负担。
进一步地,作为图1所述方法的具体实现,本申请实施例提供了一种动画播放装置,如图3所示,所述装置包括:获取模块301,划分模块302和播放模块303。
该获取模块301,用于响应于游戏场景的动画播放指令,获取视频文件列表,在所述视频文件列表中提取多个动画视频文件;
该划分模块302,用于根据所述多个动画视频文件中包括的指示进行循环播放的动画视频文件,将所述多个动画视频文件划分为至少一个视频组;
该播放模块303,用于分别为所述至少一个视频组中每个视频组创建播放控制器,以及利用所述每个视频组对应的播放控制器,控制视频播放组件依次播放所述多个视频组。
在具体的应用场景中,该装置还包括:
采集模块,用于获取多个预设播放触发操作,持续采集玩家在所述游戏场景中发生的游戏操作,以及将采集到的游戏操作与所述多个预设播放触发操作 进行比对;
确定模块,用于当比对确定采集到的游戏操作与所述多个预设播放触发操作中的一预设播放触发操作相同时,确定接收到所述动画播放指令。
在具体的应用场景中,该划分模块302,用于读取所述多个动画视频文件中每个动画视频文件在所述视频文件列表中对应的视频参数,查询所述多个动画视频文件中是否存在视频参数指示循环播放的动画视频文件;当查询确定所述多个动画视频文件中存在视频参数指示循环播放的动画视频文件时,在所述多个动画视频文件中提取视频参数指示循环播放的至少一个动画视频文件作为至少一个循环点标记,利用所述至少一个循环点标记,将所述多个动画视频文件划分为所述至少一个视频组;当查询确定所述多个动画视频文件中不存在视频参数指示循环播放的动画视频文件时,将所述多个动画视频文件作为一个视频组。
在具体的应用场景中,该划分模块302,用于根据所述至少一个循环点标记中每个循环点标记对应的动画视频文件在所述视频文件列表中的顺序,对所述至少一个循环点标记进行排序,得到第一排序结果;在所述第一排序结果中提取排在首位的第一循环点标记,在所述多个动画视频文件中提取排在所述第一循环点标记之前的至少一个第一动画视频文件,将所述至少一个第一动画视频文件和所述第一循环点标记对应的动画视频文件作为一视频组;继续在所述第一排序结果中提取排在所述第一循环点标记下一位的第二循环点标记,在所述多个动画视频文件中提取排在所述第一循环点标记和所述第二循环点标记之间的至少一个第二动画视频文件,将所述至少一个第二动画视频文件和所述第二循环点标记对应的动画视频文件作为一视频组,直至遍历所述至少一个循环点标记,得到所述至少一个视频组。
在具体的应用场景中,该播放模块303,用于根据所述多个动画视频文件在所述视频文件列表中的排列顺序,对所述至少一个视频组进行排序,得到第二排序结果;在为所述至少一个视频组中每个视频组创建播放控制器的同时,在所述第二排序结果中提取排在首位的第一视频组,利用所述第一视频组对应的第一播放控制器,控制所述视频播放组件播放所述第一视频组;当在所述游戏场景中检测到玩家发生游戏操作时,将所述第一播放控制器停止,在所述第二排序结果中确定排在所述第一视频组下一位的第二视频组,以及利用所述第二 视频组对应的第二播放控制器,控制所述视频播放组件播放所述第二视频组,直至检测到所述玩家请求停止播放或所述至少一个视频组播放完毕。
在具体的应用场景中,该播放模块303,用于确定当前待播放的视频组,基于所述视频组的播放控制器,向所述视频播放组件依次输入所述视频组中包括的至少一个动画视频文件的渲染数据,以及持续检测所述玩家是否在所述游戏场景中发生游戏操作;当所述至少一个动画视频文件播放完毕且未检测到所述玩家在所述游戏场景中发生游戏操作时,重新基于所述播放控制器,向所述视频播放组件依次输入所述视频组中包括的至少一个动画视频文件的渲染数据,以及持续检测所述玩家是否在所述游戏场景中发生游戏操作,直至检测到所述玩家在所述游戏场景中发生游戏操作,将所述播放控制器停止,并继续确定下一待播放的视频组以及执行视频组的播放操作。
在具体的应用场景中,该装置还包括:
销毁模块,用于当检测到玩家请求停止播放或所述至少一个视频组播放完毕时,在所述游戏场景中将创建的至少一个播放控制器销毁;
隐藏模块,用于清空所述视频播放组件的播放缓存,以及在所述游戏场景中将所述视频播放组件隐藏。
在具体的应用场景中,该装置还包括:
添加模块,用于若所述游戏场景配置有指示进行透明播放的指定动画视频文件,则在所述指定动画视频文件上添加透明播放图层;
处理模块,用于基于所述透明播放图层,将所述指定动画视频文件上指定部分的像素点以透明方式显示,得到待播放动画视频文件,其中,所述指定部分是所述指定动画视频文件中无视频内容的部分。
在具体的应用场景中,该播放模块303,还用于将所述待播放动画视频文件传入所述游戏场景,以及根据所述游戏场景中设置的转场参数,在所述待播放动画视频文件中设置暂停帧;响应于所述游戏场景中玩家的转场指令,确定所述转场指令指示的待跳转的指定游戏场景,以及播放所述待播放动画视频文件;当检测到所述待播放动画视频文件的当前播放进度达到所述暂停帧时,暂停所述待播放动画视频文件的播放,等待所述指定游戏场景的加载;在检测到所述指定游戏场景加载完成时,继续播放所述待播放动画视频文件。
本申请实施例提供的装置,响应于游戏场景的动画播放指令,获取视频文 件列表,在视频文件列表中提取多个动画视频文件,根据多个动画视频文件中包括的指示进行循环播放的动画视频文件,将多个动画视频文件划分为至少一个视频组,分别为至少一个视频组中每个视频组创建播放控制器,以及利用每个视频组对应的播放控制器,控制视频播放组件依次播放多个视频组,由一个视频播放组件作为显示器,由一个或多个播放控制器负责控制视频文件的加载、卸载、播放、暂停等,利用视频的播放实现转场、UI等动态效果,不仅操作简单,而且无需占用等价于实际UI、特效和场景实时渲染的资源,仅需占用少量解码和渲染资源,就可以实现影视级的动画效果,减轻内存和游戏包体的负担。
需要说明的是,本申请实施例提供的一种动画播放装置所涉及各功能单元的其他相应描述,可以参考图1和图2A至图2C中的对应描述,在此不再赘述。
需要说明的是,本申请所涉及的用户信息(包括但不限于用户设备信息、用户个人信息等)和数据(包括但不限于用于分析的数据、存储的数据、展示的数据等),均为经用户授权或者经过各方充分授权的信息和数据。
以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对本申请专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请的保护范围应以所附权利要求为准。
在示例性实施例中,参见图4,还提供了一种计算机设备,该计算机设备包括总线、处理器、存储器和通信接口,还可以包括输入输出接口和显示设备,其中,各个功能单元之间可以通过总线完成相互间的通信。该存储器存储有计算机程序,处理器,用于执行存储器上所存放的程序,执行上述实施例中的动画播放方法。
一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现所述的动画播放方法的步骤。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到本申请可以通过硬件实现,也可以借助软件加必要的通用硬件平台的方式来实现。基 于这样的理解,本申请的技术方案可以以软件产品的形式体现出来,该软件产品可以存储在一个非易失性存储介质(可以是CD-ROM,U盘,移动硬盘等)中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施场景所述的方法。
本领域技术人员可以理解附图只是一个优选实施场景的示意图,附图中的模块或流程并不一定是实施本申请所必须的。
本领域技术人员可以理解实施场景中的装置中的模块可以按照实施场景描述进行分布于实施场景的装置中,也可以进行相应变化位于不同于本实施场景的一个或多个装置中。上述实施场景的模块可以合并为一个模块,也可以进一步拆分成多个子模块。
上述本申请序号仅仅为了描述,不代表实施场景的优劣。
以上公开的仅为本申请的几个具体实施场景,但是,本申请并非局限于此,任何本领域的技术人员能思之的变化都应落入本申请的保护范围。

Claims (10)

  1. 一种动画播放方法,所述方法由计算机设备执行,所述方法包括:
    响应于游戏场景的动画播放指令,获取视频文件列表,在所述视频文件列表中提取多个动画视频文件;
    根据所述多个动画视频文件中包括的指示进行循环播放的动画视频文件,将所述多个动画视频文件划分为至少一个视频组;
    分别为所述至少一个视频组中每个视频组创建播放控制器,以及利用所述每个视频组对应的播放控制器,控制视频播放组件依次播放所述多个视频组。
  2. 根据权利要求1所述的方法,其中,所述响应于游戏场景的动画播放指令,获取视频文件列表,在所述视频文件列表中提取多个动画视频文件之前,所述方法还包括:
    获取多个预设播放触发操作,持续采集玩家在所述游戏场景中发生的游戏操作,以及将采集到的游戏操作与所述多个预设播放触发操作进行比对;
    当比对确定采集到的游戏操作与所述多个预设播放触发操作中的一预设播放触发操作相同时,确定接收到所述动画播放指令。
  3. 根据权利要求1所述的方法,其中,所述根据所述多个动画视频文件中包括的指示进行循环播放的动画视频文件,将所述多个动画视频文件划分为至少一个视频组,包括:
    读取所述多个动画视频文件中每个动画视频文件在所述视频文件列表中对应的视频参数,查询所述多个动画视频文件中是否存在视频参数指示循环播放的动画视频文件;
    当查询确定所述多个动画视频文件中存在视频参数指示循环播放的动画视频文件时,在所述多个动画视频文件中提取视频参数指示循环播放的至少一个动画视频文件作为至少一个循环点标记,利用所述至少一个循环点标记,将所述多个动画视频文件划分为所述至少一个视频组;
    当查询确定所述多个动画视频文件中不存在视频参数指示循环播放的动画视频文件时,将所述多个动画视频文件作为一个视频组。
  4. 根据权利要求3所述的方法,其中,所述利用所述至少一个循环点标记,将所述多个动画视频文件划分为所述至少一个视频组,包括:
    根据所述至少一个循环点标记中每个循环点标记对应的动画视频文件在所 述视频文件列表中的顺序,对所述至少一个循环点标记进行排序,得到第一排序结果;
    在所述第一排序结果中提取排在首位的第一循环点标记,在所述多个动画视频文件中提取排在所述第一循环点标记之前的至少一个第一动画视频文件,将所述至少一个第一动画视频文件和所述第一循环点标记对应的动画视频文件作为一视频组;
    继续在所述第一排序结果中提取排在所述第一循环点标记下一位的第二循环点标记,在所述多个动画视频文件中提取排在所述第一循环点标记和所述第二循环点标记之间的至少一个第二动画视频文件,将所述至少一个第二动画视频文件和所述第二循环点标记对应的动画视频文件作为一视频组,直至遍历所述至少一个循环点标记,得到所述至少一个视频组。
  5. 根据权利要求1所述的方法,其中,所述利用所述每个视频组对应的播放控制器,控制视频播放组件依次播放所述多个视频组,包括:
    根据所述多个动画视频文件在所述视频文件列表中的排列顺序,对所述至少一个视频组进行排序,得到第二排序结果;
    在为所述至少一个视频组中每个视频组创建播放控制器的同时,在所述第二排序结果中提取排在首位的第一视频组,利用所述第一视频组对应的第一播放控制器,控制所述视频播放组件播放所述第一视频组;
    当在所述游戏场景中检测到玩家发生游戏操作时,将所述第一播放控制器停止,在所述第二排序结果中确定排在所述第一视频组下一位的第二视频组,以及利用所述第二视频组对应的第二播放控制器,控制所述视频播放组件播放所述第二视频组,直至检测到所述玩家请求停止播放或所述至少一个视频组播放完毕。
  6. 根据权利要求5所述的方法,其中,对于所述至少一个视频组中每个视频组,利用视频组对应的播放控制器,控制视频播放组件播放所述视频组,包括:
    确定当前待播放的视频组,基于所述视频组的播放控制器,向所述视频播放组件依次输入所述视频组中包括的至少一个动画视频文件的渲染数据,以及持续检测所述玩家是否在所述游戏场景中发生游戏操作;
    当所述至少一个动画视频文件播放完毕且未检测到所述玩家在所述游戏场 景中发生游戏操作时,重新基于所述播放控制器,向所述视频播放组件依次输入所述视频组中包括的至少一个动画视频文件的渲染数据,以及持续检测所述玩家是否在所述游戏场景中发生游戏操作,直至检测到所述玩家在所述游戏场景中发生游戏操作,将所述播放控制器停止,并继续确定下一待播放的视频组以及执行视频组的播放操作。
  7. 根据权利要求1所述的方法,其中,所述分别为所述至少一个视频组中每个视频组创建播放控制器,以及利用所述每个视频组对应的播放控制器,控制视频播放组件依次播放所述多个视频组之后,所述方法还包括:
    当检测到玩家请求停止播放或所述至少一个视频组播放完毕时,在所述游戏场景中将创建的至少一个播放控制器销毁;
    清空所述视频播放组件的播放缓存,以及在所述游戏场景中将所述视频播放组件隐藏。
  8. 根据权利要求1所述的方法,其中,所述方法还包括:
    若所述游戏场景配置有指示进行透明播放的指定动画视频文件,则在所述指定动画视频文件上添加透明播放图层;
    基于所述透明播放图层,将所述指定动画视频文件上指定部分的像素点以透明方式显示,得到待播放动画视频文件,其中,所述指定部分是所述指定动画视频文件中无视频内容的部分。
  9. 根据权利要求8所述的方法,其中,所述方法还包括:
    将所述待播放动画视频文件传入所述游戏场景,以及根据所述游戏场景中设置的转场参数,在所述待播放动画视频文件中设置暂停帧;
    响应于所述游戏场景中玩家的转场指令,确定所述转场指令指示的待跳转的指定游戏场景,以及播放所述待播放动画视频文件;
    当检测到所述待播放动画视频文件的当前播放进度达到所述暂停帧时,暂停所述待播放动画视频文件的播放,等待所述指定游戏场景的加载;
    在检测到所述指定游戏场景加载完成时,继续播放所述待播放动画视频文件。
  10. 一种动画播放装置,所述装置包括:
    获取模块,用于响应于游戏场景的动画播放指令,获取视频文件列表,在所述视频文件列表中提取多个动画视频文件;
    划分模块,用于根据所述多个动画视频文件中包括的指示进行循环播放的动画视频文件,将所述多个动画视频文件划分为至少一个视频组;
    播放模块,用于分别为所述至少一个视频组中每个视频组创建播放控制器,以及利用所述每个视频组对应的播放控制器,控制视频播放组件依次播放所述多个视频组。
PCT/CN2023/137661 2022-12-08 2023-12-08 动画播放方法及装置 WO2024120529A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211573420.XA CN117714767A (zh) 2022-12-08 2022-12-08 动画播放方法及装置
CN202211573420.X 2022-12-08

Publications (1)

Publication Number Publication Date
WO2024120529A1 true WO2024120529A1 (zh) 2024-06-13

Family

ID=90150314

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/137661 WO2024120529A1 (zh) 2022-12-08 2023-12-08 动画播放方法及装置

Country Status (2)

Country Link
CN (1) CN117714767A (zh)
WO (1) WO2024120529A1 (zh)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9827496B1 (en) * 2015-03-27 2017-11-28 Electronics Arts, Inc. System for example-based motion synthesis
CN111111192A (zh) * 2019-12-27 2020-05-08 珠海金山网络游戏科技有限公司 一种游戏角色的移动方法及装置
CN111669646A (zh) * 2019-03-07 2020-09-15 北京陌陌信息技术有限公司 透明视频的播放方法、装置、设备及介质
CN111669623A (zh) * 2020-06-28 2020-09-15 腾讯科技(深圳)有限公司 视频特效的处理方法、装置以及电子设备
CN114299208A (zh) * 2021-12-28 2022-04-08 网易(杭州)网络有限公司 游戏中闪电特效的呈现方法、装置、电子设备及存储介质
CN114363666A (zh) * 2021-12-22 2022-04-15 咪咕互动娱乐有限公司 视频处理方法、装置及电子设备
CN114404960A (zh) * 2022-02-07 2022-04-29 腾讯科技(深圳)有限公司 云游戏资源数据处理方法、装置、计算机设备和存储介质

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9827496B1 (en) * 2015-03-27 2017-11-28 Electronics Arts, Inc. System for example-based motion synthesis
CN111669646A (zh) * 2019-03-07 2020-09-15 北京陌陌信息技术有限公司 透明视频的播放方法、装置、设备及介质
CN111111192A (zh) * 2019-12-27 2020-05-08 珠海金山网络游戏科技有限公司 一种游戏角色的移动方法及装置
CN111669623A (zh) * 2020-06-28 2020-09-15 腾讯科技(深圳)有限公司 视频特效的处理方法、装置以及电子设备
CN114363666A (zh) * 2021-12-22 2022-04-15 咪咕互动娱乐有限公司 视频处理方法、装置及电子设备
CN114299208A (zh) * 2021-12-28 2022-04-08 网易(杭州)网络有限公司 游戏中闪电特效的呈现方法、装置、电子设备及存储介质
CN114404960A (zh) * 2022-02-07 2022-04-29 腾讯科技(深圳)有限公司 云游戏资源数据处理方法、装置、计算机设备和存储介质

Also Published As

Publication number Publication date
CN117714767A (zh) 2024-03-15

Similar Documents

Publication Publication Date Title
CN105354872B (zh) 一种基于3d网页游戏的渲染引擎、实现方法及制作工具
CN105306997B (zh) 移动终端播放方式切换方法及装置
WO2022048097A1 (zh) 一种基于多显卡的单帧画面实时渲染方法
CN110908625A (zh) 多屏显示方法、装置、设备、系统、舱体及存储介质
US20220245881A1 (en) Virtual scene display method and apparatus, and storage medium
WO2018000619A1 (zh) 一种数据展示方法、装置、电子设备与虚拟现实设备
EP2071578A1 (en) Video interaction apparatus and method
CN105959814B (zh) 基于场景识别的视频弹幕显示方法及其显示装置
WO2022048098A1 (zh) 一种基于多显卡的游戏画面渲染方法和系统
JP2008250813A (ja) 画像生成装置、画像処理方法、および、プログラム
CN111491208B (zh) 视频处理方法、装置、电子设备及计算机可读介质
KR20130001164A (ko) 컴퓨터 구현된 비디오 퍼즐
US10643580B2 (en) Method and device for switching playing mode of a mobile terminal, storage medium and program
US20180143741A1 (en) Intelligent graphical feature generation for user content
JP7164761B2 (ja) グラフィック処理のためのアセット認識コンピューティングアーキテクチャ
CN112346935A (zh) 渲染耗时的获取、显示方法、性能监控方法、装置及设备
CN111870948A (zh) 一种云游戏单主机多用户环境下的窗口管理方法及系统
WO2023140786A2 (zh) 特效视频处理方法、装置、电子设备及存储介质
WO2012071844A1 (zh) 多媒体动画的生成和播放的方法和装置
WO2024120529A1 (zh) 动画播放方法及装置
WO2024124670A1 (zh) 视频播放方法、装置、计算机设备及计算机可读存储介质
CN110944218B (zh) 多媒体信息的播放系统、方法、装置、设备及存储介质
WO2005002198A2 (en) Video playback image processing
CN114913277A (zh) 一种物体立体交互展示方法、装置、设备及介质
EP3876543A1 (en) Video playback method and apparatus