CN106528201B - Method and device for loading animation in game - Google Patents
Method and device for loading animation in game Download PDFInfo
- Publication number
- CN106528201B CN106528201B CN201610882725.7A CN201610882725A CN106528201B CN 106528201 B CN106528201 B CN 106528201B CN 201610882725 A CN201610882725 A CN 201610882725A CN 106528201 B CN106528201 B CN 106528201B
- Authority
- CN
- China
- Prior art keywords
- game
- animation
- animation file
- game action
- loading
- Prior art date
- Legal status (The legal status 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 status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44521—Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
- G06F9/44526—Plug-ins; Add-ons
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Processing Or Creating Images (AREA)
Abstract
the embodiment of the invention provides a method for loading animation in a game. The method comprises the following steps: when an animation file corresponding to a game action needs to be played in a game, determining the animation file corresponding to the game action according to a pre-stored corresponding relation between a game action identifier and the animation file; and reading the animation file corresponding to the game action and playing the animation file. By establishing the corresponding relation between the game action identifier and the animation file in advance, when the animation file corresponding to any game action needs to be played, the corresponding animation file can be read immediately for playing, and all the animation files do not need to be read into the memory for standby at one time when the game is started, so that the game loading speed is increased. In addition, the embodiment of the invention provides a device for loading the animation in the game.
Description
Technical Field
The embodiment of the invention relates to the technical field of online games, in particular to a method and a device for loading animation in a game.
background
this section is intended to provide a background or context to the embodiments of the invention that are recited in the claims. The description herein is not admitted to be prior art by inclusion in this section.
unity 3D is a comprehensive game development tool developed by Unity Technologies that can easily create multiple platforms of types of interactive content such as three-dimensional video games, building visualizations, real-time three-dimensional animations, etc., and is a fully integrated professional game engine.
an Animation Controller (Animation Controller) is a mechanism for configuring an Animation state machine in the Unity, and after a user configures an Animation card (Animation Clip) in a relevant state conversion and a corresponding state, the Animation card can be played in a game according to a configured mode. The rewrite Controller (Override Controller) is provided by the Unity and can be used for redirecting the Animation file in the original Animation Controller, so that the rewrite Controller is convenient for performing quick modification under a large Animation file, and a user can use the rewrite Controller to perform Animation modification.
Disclosure of Invention
However, in the prior art, the Unity mechanism is that a reference is loaded immediately, and after the user configures the Animation Controller, the user uses different Override controllers to load, so that a large amount of Animation information in the Override controllers can be loaded into the memory at one time, that is, when the user starts a game, all Animation information can be loaded into the memory.
however, in the game process, usually, only part of the animation file needs to be played, if all the animation information is loaded into the memory when the game is started, memory waste is caused, the game loading speed is reduced, and because a large amount of memory is occupied by loading all the animation information, the memory overhead is increased, and the game running speed is reduced.
Therefore, an improved method for loading animation in a game is highly needed to reduce the memory overhead and increase the loading speed and the running speed of the game.
in this context, embodiments of the present invention are intended to provide a method and apparatus for loading animation in a game.
in a first aspect of embodiments of the present invention, there is provided a method for loading animation in a game, comprising:
When an animation file corresponding to a game action needs to be played in a game, determining the animation file corresponding to the game action according to a pre-stored corresponding relation between a game action identifier and the animation file;
And reading the animation file corresponding to the game action and playing the animation file.
preferably, the method is applied in a game engine Unity.
optionally, before determining an animation file corresponding to the game action according to a predefined correspondence between the game action identifier and the animation file, the method further includes:
the overwrite Controller Override Controller is configured null.
optionally, before reading and loading the animation file corresponding to the game action, the method further includes:
Judging whether an animation file corresponding to the game action exists in a memory; and
Reading and playing the animation file corresponding to the game action, and specifically comprising the following steps:
if the animation file corresponding to the game action exists in the memory, reading the animation file corresponding to the game action from the memory and playing the animation file;
And if the animation file corresponding to the game action does not exist in the memory, reading the animation file corresponding to the game action from the hard disk and playing the animation file.
Preferably, reading the animation file corresponding to the game action from the hard disk and playing the animation file, specifically comprising:
Reading an animation card adapter AnimationClipAdap file from a hard disk;
Searching an animation card animation clip file corresponding to a game action needing to be played from the animation clip adapter file;
updating the Override Controller according to the found AnimationClip file;
And loading the updated Override Controller for playing.
Optionally, before playing after loading the updated Override Controller, the method further includes:
and reconfiguring the game engine according to the updated Override Controller.
In a second aspect of the embodiments of the present invention, there is provided an apparatus for loading animation in a game, including:
The game playing device comprises a determining unit, a playing unit and a playing unit, wherein the determining unit is used for determining an animation file corresponding to a game action according to the corresponding relation between a pre-stored game action identifier and the animation file when the animation file corresponding to the game action needs to be played in a game;
and the loading unit is used for reading the animation file corresponding to the game action and playing the animation file.
Preferably, the device is applied in a game engine Unity.
Optionally, the apparatus further comprises:
and the first configuration unit is used for configuring the Override Controller to be null before the determining unit determines the animation file corresponding to the game action according to the corresponding relation between the predefined game action identifier and the animation file.
Optionally, the apparatus further includes a determining unit, wherein:
The judging unit is used for judging whether the animation file corresponding to the game action exists in the memory before the loading unit reads and loads the animation file corresponding to the game action;
The loading unit is specifically configured to, if the judgment result of the judgment unit is yes, read the animation file corresponding to the game action from the memory and play the animation file; and if the judgment result of the judgment unit is negative, reading the animation file corresponding to the game action from the hard disk and playing the animation file.
Preferably, the loading unit includes:
the reading subunit is used for reading an animation card adapter animation clipadapter file from the hard disk;
the searching subunit is used for searching an animation card animaticclip file corresponding to the game action to be played from the animaticclip adapter file;
An updating subunit, configured to update the Override Controller according to the found AnimationClip file;
And the loading subunit is used for loading the updated Override Controller for playing.
optionally, the apparatus further comprises:
And the second configuration unit is used for reconfiguring the game engine according to the updated Override Controller before the updated Override Controller is loaded and played by the loading subunit.
in a third aspect of embodiments of the present invention, there is provided a method for loading animation in a game, including:
establishing a mapping relation between the animation file and the game action identifier;
And when the game is operated, gradually loading the animation file corresponding to the game action identifier to the memory and playing according to the called sequence of the game action.
in a fourth aspect of the embodiments of the present invention, an apparatus for loading animation in a game is provided, for example, the apparatus may include a memory and a processor, where the processor may be configured to read a program in the memory and execute the following processes: when an animation file corresponding to a game action needs to be played in a game, determining the animation file corresponding to the game action according to a pre-stored corresponding relation between a game action identifier and the animation file; and reading the animation file corresponding to the game action and playing the animation file.
in a fifth aspect of embodiments of the present invention, there is provided a program product comprising program code for performing, when the program product is run, the following: when an animation file corresponding to a game action needs to be played in a game, determining the animation file corresponding to the game action according to a pre-stored corresponding relation between a game action identifier and the animation file; and reading the animation file corresponding to the game action and playing the animation file.
according to the method and the device for loading the animation in the game, disclosed by the embodiment of the invention, the corresponding relation between the game action identifier and the animation file is pre-established, so that when the animation file corresponding to any game action needs to be played in the game running process, the animation file corresponding to the game action can be read in real time according to the pre-established corresponding relation for playing, all the animation files do not need to be read into the memory for standby at one time during starting, the loading speed during starting the game is improved, and in addition, as only part of the animation files read in real time in the game running process need to be stored in the memory, all the animation files do not need to be stored, the memory overhead is saved, the game running speed is improved, and better experience is brought to users.
Drawings
The above and other objects, features and advantages of exemplary embodiments of the present invention will become readily apparent from the following detailed description read in conjunction with the accompanying drawings. Several embodiments of the invention are illustrated by way of example, and not by way of limitation, in the figures of the accompanying drawings and in which:
FIG. 1 is a schematic flow chart illustrating a method for loading animation in a game according to an embodiment of the invention;
FIG. 2 is a schematic flow chart illustrating the establishment of a correspondence between game action identifiers and corresponding animation files according to an embodiment of the present invention;
FIG. 3 schematically illustrates a flowchart of a method for loading animation in a game according to yet another embodiment of the invention;
FIG. 4 is a schematic flow chart illustrating a process of reading an animation file corresponding to the game action from a hard disk and playing the animation file according to a further embodiment of the present invention;
FIG. 5 is a flow chart that schematically illustrates an implementation of a method for loading animation in a game, in accordance with a further embodiment of the present invention;
FIG. 6 is a schematic diagram of an apparatus for loading animation in a game according to an embodiment of the invention;
FIG. 7 is a schematic diagram illustrating an apparatus for loading animation in a game according to an embodiment of the present invention;
FIG. 8 schematically illustrates a program product diagram of an apparatus for loading animation in a game according to an embodiment of the present invention;
in the drawings, the same or corresponding reference numerals indicate the same or corresponding parts.
Detailed Description
the principles and spirit of the present invention will be described with reference to a number of exemplary embodiments. It is understood that these embodiments are given solely for the purpose of enabling those skilled in the art to better understand and to practice the invention, and are not intended to limit the scope of the invention in any way. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
as will be appreciated by one skilled in the art, embodiments of the present invention may be embodied as a system, apparatus, device, method, or computer program product. Accordingly, the present disclosure may be embodied in the form of: entirely hardware, entirely software (including firmware, resident software, micro-code, etc.), or a combination of hardware and software.
According to the embodiment of the invention, a method and a device for loading animation in a game are provided.
In this document, any number of elements in the drawings is by way of example and not by way of limitation, and any nomenclature is used solely for differentiation and not by way of limitation.
the principles and spirit of the present invention are explained in detail below with reference to several representative embodiments of the invention.
summary of The Invention
The inventor finds that the existing game engine can read all animation files into the internal memory for standby at one time when starting a game, if a certain animation file needs to be played in the game running process, the corresponding animation file is read from the internal memory for playing, but only a part of the animation files may need to be played in the game running process, so that long time is consumed for loading all the animation files at one time when starting the game, and the game loading speed is reduced; in the running process of the game, the more animation files are loaded, the more memory overhead is occupied, and the running speed of the game is influenced.
In view of this, in the embodiment of the present invention, the corresponding relationship between the action identifier and the animation file is predefined, and an empty file is loaded when the game is started, so that the game loading speed is increased, and in the game running process, the corresponding animation file is read immediately to be played when an action needs to be executed according to actual requirements, so that the animation file is read as needed, the animation files stored in the memory are greatly reduced, the memory overhead is reduced, and the game running speed is increased.
Having described the general principles of the invention, various non-limiting embodiments of the invention are described in detail below.
Application scene overview
The method for loading the animation in the game provided by the embodiment of the invention is suitable for the game engine, and the game is suitable for the Unity game engine.
it should be noted that the above application scenarios are only for the convenience of understanding the spirit and principle of the present invention, and the embodiments of the present invention are not limited in this respect. Rather, embodiments of the present invention may be applied to any scenario where applicable.
Exemplary method
As shown in fig. 1, an implementation flow diagram of a method for loading an animation in a game provided by an embodiment of the present invention includes the following steps:
and S11, establishing a mapping relation between the animation file and the game action identifier.
in specific implementation, according to actual needs of a game, corresponding animation files are produced for game actions that may occur, for example, animation files corresponding to game actions such as walking, kicking, bending, running, jumping and the like, and a corresponding relationship between a game action identifier and the corresponding animation files is established. As shown in fig. 2, which is one possible illustration of the established mapping relationship.
and S12, gradually loading the animation file corresponding to the game action identifier to the memory and playing the animation file according to the called sequence of the game action when the game is run.
In this step, in the game running process, according to the sequence in which the game actions are called, the animation file corresponding to the game action identifier is gradually loaded into the memory for playing. For example, when the game character moves straight and then turns left, the animation file corresponding to the game action "move" is read into the memory and played first, and when the game character needs to move, the animation file corresponding to the game action "turn left" is read into the memory and played, so that the animation file corresponding to the game action identifier can be gradually loaded into the memory and played according to the called sequence of the game action.
It should be noted that, in order to increase the speed of playing the animation file, when reading the animation file corresponding to the game action, it may be determined whether the animation file corresponding to the game action exists in the memory first, if so, the corresponding animation file may be directly played, and if not, the corresponding animation file may be read from the hard disk into the memory and played. Based on this, step S12 can be implemented according to the following flow: and judging whether the animation file corresponding to the game action exists in the memory, if the animation file corresponding to the game action does not exist in the memory, assigning the animation file to the rewriting controller again, and loading the animation file in the corresponding hard disk into the memory and playing the animation file.
Aiming at the Unity game engine, in the embodiment of the invention, an empty override controller can be used for replacing the original override controller, and because the new override controller is an empty file and does not contain any animation file, the problem of loading the animation files corresponding to all defined game actions when the game is started is avoided, and therefore, the game starting speed is improved; in the game running process, part of animation files are loaded according to game needs, so that compared with the process of loading all the animation files, the memory overhead is saved, and the game running speed is increased.
Based on the mapping relationship between the animation file and the game action identifier established in step S11, as shown in fig. 3, an implementation flow diagram of a method for loading an animation in a game according to another embodiment of the present invention may include the following steps:
And S31, when the game action corresponding animation file needs to be played, determining the animation file corresponding to the game action according to the corresponding relation between the game action identification and the animation file which are stored in advance.
In step S31, after the game is run, if a game action needs to be executed according to the need of the game character, the animation file corresponding to the game action identifier is found out from the correspondence between the game action identifier and the animation file according to the game action identifier of the game action that needs to be executed.
and S32, reading the animation file corresponding to the game action and playing the animation file.
and reading the corresponding animation file into the memory and playing the corresponding animation file according to the animation file searched in the step S31.
It should be noted that, when the embodiment of the present invention is applied to the game engine Unity, before step S31 is executed, the Override Controller needs to be configured to be null, so that the Override Controller is loaded during the game starting process, and because the Override Controller is a null file and has no content therein, the game loading speed can be increased.
in specific implementation, the animation file that has been read into the memory may be cached in the memory, and in the game running process, before executing step S32, the method may further include the following steps: and judging whether an animation file corresponding to the game action exists in the memory. Specifically, when an animation file corresponding to a game action needs to be played in a game, firstly, the animation file corresponding to the game action is determined according to a corresponding relation between a pre-stored game action identifier and the animation file, then, a cache record of the animation file is loaded according to a memory, whether the animation file corresponding to the game action is cached in the memory is judged, if yes, the corresponding animation file is directly read from the memory for playing, and if the animation file corresponding to the game action does not exist in the memory, the animation file corresponding to the game action is read from a hard disk and played, namely, the corresponding animation file is firstly read into the memory from the hard disk, and then the corresponding animation file is read from the memory for playing.
In specific implementation, the animation file corresponding to the game action is read from the hard disk according to the flow shown in fig. 4 and played:
And S41, reading the animation card adapter animation ClipAdap file from the hard disk.
S42, the animation card animaticclip file corresponding to the game action needing playing is searched from the animaticClipAdap file.
and S43, updating the Override Controller according to the found AnimationClip file.
s44, loading the updated Override Controller for playing.
in specific implementation, since the Override Controller is modified, before step S44 is executed, the game engine needs to be reconfigured according to the updated Override Controller.
It should be noted that, when the game is quitted each time, the animation file read into the memory is cleared, and when the game is started next time, the corresponding animation file is gradually loaded into the memory according to the game requirement.
as shown in fig. 5, which is a schematic implementation flow diagram of a method for loading an animation in a game according to an embodiment of the present invention, the method may include the following steps:
And S51, establishing a mapping relation between the animation file and the game action identifier.
In specific implementation, taking game engine Unity as an example, the original OverrideController can be stripped, all mapping information contained in the OverrideController is extracted, the mapping information is transferred by using a custom format through a scriptable object, and the mapping relationship between the original game action identifier and the animation file in the OverrideController and the mapping relationship between the newly-loaded game action identifier and the animation file are recorded.
And S52, starting the game.
it should be noted that, according to the embodiment of the present invention, by configuring the OverrideController as null, it is not necessary to load any animation file into the memory in advance during the process of starting the game, so that the game loading speed is increased.
and S53, when the animation file corresponding to the game action needs to be played in the game running process, determining the animation file corresponding to the game action according to the established corresponding relation between the game action identifier and the animation file.
In specific implementation, the corresponding animation file may be looked up in the table shown in fig. 2 according to the game action identifier.
s54, judging whether the memory has the animation file corresponding to the game action, if yes, executing step S55, otherwise, executing step S56.
And S55, reading the animation file corresponding to the game action from the memory and playing the animation file, and ending the process.
and S56, reading the animation card adapter animation ClipAdap file from the hard disk.
S57, searching an animation card animaticclip file corresponding to the game action needing to be played from the animaticclip adapter file.
s58, updating the Override Controller according to the found AnimationClip file.
and S59, reconfiguring the game engine according to the updated Override Controller.
S510, loading the updated Override Controller for playing.
According to the method for loading the animation in the game, provided by the embodiment of the invention, when the game is started, any animation file is not loaded into the memory, so that the game loading speed is increased, in the game running process, the corresponding animation file is gradually loaded into the memory according to the requirement, and as the animation file loaded into the memory is only the animation file corresponding to the game action involved in the game running process of the time, not all animation files designed for the game, the memory overhead is reduced, and the ordered running speed is increased.
Exemplary device
having described the method of an exemplary embodiment of the present invention, an apparatus for loading animation in a game according to an exemplary embodiment of the present invention will be described with reference to fig. 6.
Fig. 6 is a schematic structural diagram of an apparatus for loading an animation in a game according to an embodiment of the present invention, including:
The determining unit 61 is configured to determine an animation file corresponding to a game action according to a correspondence between a pre-stored game action identifier and the animation file when the animation file corresponding to the game action needs to be played in a game;
and the loading unit 62 is configured to read the animation file corresponding to the game action and play the animation file.
Preferably, the device for loading animation in the game provided by the embodiment of the invention can be applied to game engine Unity.
optionally, the apparatus for loading an animation in a game provided in the embodiment of the present invention may further include:
A first configuration unit 63, configured to configure the override controller to be null before the determining unit 61 determines the animation file corresponding to the game action according to the predefined correspondence between the game action identifier and the animation file.
Optionally, the apparatus for loading an animation in a game provided in the embodiment of the present invention may further include a determining unit 64, where:
The judging unit 64 is configured to judge whether an animation file corresponding to the game action exists in a memory before the loading unit 62 reads and loads the animation file corresponding to the game action;
The loading unit 62 is specifically configured to, if the determination result of the determining unit 64 is yes, read the animation file corresponding to the game action from the memory and play the animation file; if the judgment result of the judgment unit 64 is negative, the animation file corresponding to the game action is read from the hard disk and played.
Preferably, the loading unit 62 includes:
A reading subunit 621, configured to read an animation card adapter animation clipadapter file from the hard disk;
A searching subunit 622, configured to search, from the animaticclip adapter file, an animation card animaticclip file corresponding to a game action to be played;
an update subunit 623, configured to update the Override Controller according to the found AnimationClip file;
And the loading subunit 624 is configured to load the updated Override Controller for playing.
Optionally, the apparatus for loading an animation in a game provided in the embodiment of the present invention may further include:
a second configuration unit 65, configured to reconfigure the game engine according to the updated Override Controller before the loading subunit 624 loads the updated Override Controller and then plays the game.
in some possible embodiments, the apparatus for loading animation in a game according to the present invention may include at least one processing unit, and at least one storage unit. Wherein the storage unit stores program code that, when executed by the processing unit, causes the processing unit to perform various steps in a method of loading animation in a game according to various exemplary embodiments of the present invention described in the above section "exemplary method" of this specification. For example, the processing unit may execute step S31 shown in fig. 3, when an animation file corresponding to a game action needs to be played in a game, determine the animation file corresponding to the game action according to a pre-stored correspondence relationship between a game action identifier and the animation file, and read and play the animation file corresponding to the game action in step S32.
An apparatus 70 for loading animation in a game according to this embodiment of the present invention will be described with reference to fig. 7. The apparatus for loading animation in game shown in fig. 7 is only an example, and should not bring any limitation to the function and the scope of use of the embodiment of the present invention.
as shown in FIG. 7, the animation-loading mechanism 70 may be embodied in the form of a general purpose computing device, which may be a server device, for example. Components of the in-game animation-loading device 70 may include, but are not limited to: the at least one processing unit 71, the at least one memory unit 72, and a bus 73 connecting the various system components (including the memory unit 72 and the processing unit 71).
Bus 73 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a processor, or a local bus using any of a variety of bus architectures.
the storage unit 72 may include readable media in the form of volatile memory, such as Random Access Memory (RAM)721 and/or cache memory 722, and may further include Read Only Memory (ROM) 723.
The memory unit 72 may also include a program/utility 725 having a set (at least one) of program modules 724, such program modules 724 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
the apparatus for loading animation in a game 70 may also be in communication with one or more external devices 74 (e.g., keyboard, pointing device, etc.), one or more devices that enable a user to interact with the apparatus for loading animation in a game 70, and/or any device (e.g., router, modem, etc.) that enables the apparatus for loading animation in a game 70 to communicate with one or more other computing devices. Such communication may be through an input/output (I/O) interface 75. Also, the in-game animation-loading device 70 may be in communication with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet) via a network adapter 76. As shown, the network adapter 76 communicates with the other modules of the in-game animation-loading device 70 via the bus 73. It should be understood that although not shown, other hardware and/or software modules may be used in conjunction with the in-game animation-loading device 70, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
exemplary program product
In some possible embodiments, the aspects of the present invention may also be implemented as a program product, which includes program code for causing a terminal device to execute the steps in the method for loading animation in game according to various exemplary embodiments of the present invention described in the section "exemplary method" above in this specification when the program product runs on the terminal device, for example, the terminal device may execute step S31 shown in fig. 3, when an animation file corresponding to a game action needs to be played in a game, determine an animation file corresponding to the game action according to a pre-stored correspondence relationship between a game action identifier and the animation file, and read and play the animation file corresponding to the game action in step S32.
the program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
As shown in fig. 8, a program product 80 for loading animation in a game according to an embodiment of the present invention is described, which may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a terminal device. However, the program product of the present invention is not limited in this regard and, in the present document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device over any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., over the internet using an internet service provider).
It should be noted that although several units or sub-units of the apparatus are mentioned in the above detailed description, such division is merely exemplary and not mandatory. Indeed, the features and functions of two or more of the units described above may be embodied in one unit, according to embodiments of the invention. Conversely, the features and functions of one unit described above may be further divided into embodiments by a plurality of units.
moreover, while the operations of the method of the invention are depicted in the drawings in a particular order, this does not require or imply that the operations must be performed in this particular order, or that all of the illustrated operations must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions.
While the spirit and principles of the invention have been described with reference to several particular embodiments, it is to be understood that the invention is not limited to the disclosed embodiments, nor is the division of aspects, which is for convenience only as the features in such aspects may not be combined to benefit. The invention is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.
Claims (10)
1. A method for loading animation in a game is applied to game engine Unity and comprises the following steps:
Configuring an Override Controller to be null, so that no animation file is loaded into a memory in the process of starting the game;
When an animation file corresponding to a game action needs to be played in the running process of a game, determining the animation file corresponding to the game action according to the corresponding relation between a pre-stored game action identifier and the animation file;
and reading the animation file corresponding to the game action and playing the animation file.
2. The method of claim 1, before reading and loading the animation file corresponding to the game action, further comprising:
judging whether an animation file corresponding to the game action exists in a memory; and
reading and playing the animation file corresponding to the game action, and specifically comprising the following steps:
If the animation file corresponding to the game action exists in the memory, reading the animation file corresponding to the game action from the memory and playing the animation file;
And if the animation file corresponding to the game action does not exist in the memory, reading the animation file corresponding to the game action from the hard disk and playing the animation file.
3. The method according to claim 2, wherein the step of reading the animation file corresponding to the game action from the hard disk and playing the animation file comprises the following steps:
Reading an animation card adapter AnimationClipAdap file from a hard disk;
Searching an animation card animation clip file corresponding to a game action needing to be played from the animation clip adapter file;
Updating the Override Controller according to the found AnimationClip file;
And loading the updated Override Controller for playing.
4. The method of claim 3, before playing after loading the updated Override Controller, further comprising:
and reconfiguring the game engine according to the updated Override Controller.
5. An apparatus for loading animation in a game, applied to a game engine Unity, comprises:
The game playing device comprises a determining unit, a playing unit and a playing unit, wherein the determining unit is used for determining an animation file corresponding to a game action according to the corresponding relation between a pre-stored game action identifier and the animation file when the animation file corresponding to the game action needs to be played in the game running process;
The loading unit is used for reading the animation file corresponding to the game action and playing the animation file;
The first configuration unit is used for configuring the Override Controller to be null before the determining unit determines the animation file corresponding to the game action according to the predefined corresponding relation between the game action identifier and the animation file, so that no animation file is loaded into the memory in the process of starting the game.
6. The apparatus of claim 5, further comprising a determination unit, wherein:
the judging unit is used for judging whether the animation file corresponding to the game action exists in the memory before the loading unit reads and loads the animation file corresponding to the game action;
The loading unit is specifically configured to, if the judgment result of the judgment unit is yes, read the animation file corresponding to the game action from the memory and play the animation file; and if the judgment result of the judgment unit is negative, reading the animation file corresponding to the game action from the hard disk and playing the animation file.
7. The apparatus of claim 6, the load unit, comprising:
The reading subunit is used for reading an animation card adapter animation clipadapter file from the hard disk;
The searching subunit is used for searching an animation card animaticclip file corresponding to the game action to be played from the animaticclip adapter file;
an updating subunit, configured to update the Override Controller according to the found AnimationClip file;
And the loading subunit is used for loading the updated Override Controller for playing.
8. the apparatus of claim 7, further comprising:
And the second configuration unit is used for reconfiguring the game engine according to the updated Override Controller before the updated Override Controller is loaded and played by the loading subunit.
9. A method for loading animation in a game is applied to game engine Unity and comprises the following steps:
establishing a mapping relation between the animation file and the game action identifier, and configuring the rewriting controller to be empty, so that no animation file is loaded into a memory in the process of starting the game;
And gradually loading the animation file corresponding to the game action identifier to the memory and playing the animation file according to the called sequence of the game actions in the running process of the running game.
10. The method of claim 9, wherein gradually loading the animation file corresponding to the game action identifier into the memory and playing the animation file comprises:
judging whether an animation file corresponding to the game action exists in a memory;
And if the animation file corresponding to the game action does not exist in the memory, the animation file in the corresponding hard disk is loaded to the memory and played by reassigning the animation file to the rewriting controller.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610882725.7A CN106528201B (en) | 2016-10-10 | 2016-10-10 | Method and device for loading animation in game |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610882725.7A CN106528201B (en) | 2016-10-10 | 2016-10-10 | Method and device for loading animation in game |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106528201A CN106528201A (en) | 2017-03-22 |
CN106528201B true CN106528201B (en) | 2019-12-13 |
Family
ID=58331768
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610882725.7A Active CN106528201B (en) | 2016-10-10 | 2016-10-10 | Method and device for loading animation in game |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106528201B (en) |
Families Citing this family (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108010112B (en) * | 2017-11-28 | 2023-08-22 | 腾讯数码(天津)有限公司 | Animation processing method, device and storage medium |
CN108038160B (en) * | 2017-12-06 | 2019-03-08 | 央视动画有限公司 | Dynamic animation store method, dynamic animation call method and device |
CN108416830B (en) * | 2018-02-26 | 2021-10-26 | 网易(杭州)网络有限公司 | Animation display control method, device, equipment and storage medium |
CN111135580B (en) * | 2019-12-26 | 2024-03-19 | 珠海金山数字网络科技有限公司 | Game character standby animation generation method and device |
CN111443913B (en) * | 2020-03-27 | 2023-05-12 | 网易(杭州)网络有限公司 | Interactive animation configuration method and device, storage medium and electronic equipment |
CN111481928B (en) * | 2020-04-13 | 2023-04-07 | 网易(杭州)网络有限公司 | Animation loading method and device, server and storage medium |
CN111880877B (en) * | 2020-07-24 | 2023-10-31 | 上海米哈游天命科技有限公司 | Animation switching method, device, equipment and storage medium |
CN113473171A (en) * | 2021-08-09 | 2021-10-01 | 上海哔哩哔哩科技有限公司 | Resource processing method and device |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101477592A (en) * | 2008-12-16 | 2009-07-08 | 腾讯科技(深圳)有限公司 | Method and apparatus for displaying 3D animation |
CN101833459A (en) * | 2010-04-14 | 2010-09-15 | 四川真视信息技术有限公司 | Dynamic 2D bone personage realizing system based on webpage |
CN104461662A (en) * | 2014-12-25 | 2015-03-25 | 上海恺英网络科技有限公司 | Unity3d bone animation plugin SmoothMoves loading optimizing method |
CN104517306A (en) * | 2013-09-27 | 2015-04-15 | 北大方正集团有限公司 | Method and device for playing animation |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2011186834A (en) * | 2010-03-09 | 2011-09-22 | Copcom Co Ltd | Game program, recording medium, and computer device |
US9256745B2 (en) * | 2011-03-01 | 2016-02-09 | Microsoft Technology Licensing, Llc | Protecting operating system configuration values using a policy identifying operating system configuration settings |
-
2016
- 2016-10-10 CN CN201610882725.7A patent/CN106528201B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101477592A (en) * | 2008-12-16 | 2009-07-08 | 腾讯科技(深圳)有限公司 | Method and apparatus for displaying 3D animation |
CN101833459A (en) * | 2010-04-14 | 2010-09-15 | 四川真视信息技术有限公司 | Dynamic 2D bone personage realizing system based on webpage |
CN104517306A (en) * | 2013-09-27 | 2015-04-15 | 北大方正集团有限公司 | Method and device for playing animation |
CN104461662A (en) * | 2014-12-25 | 2015-03-25 | 上海恺英网络科技有限公司 | Unity3d bone animation plugin SmoothMoves loading optimizing method |
Also Published As
Publication number | Publication date |
---|---|
CN106528201A (en) | 2017-03-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106528201B (en) | Method and device for loading animation in game | |
CN110162345B (en) | Application program access method and device and storage medium | |
CN103227812B (en) | Smart machine is supported method for down loading and the device of breakpoint transmission | |
CN103744709B (en) | patch loading method and device | |
CN103795759B (en) | The dispatching method and system of a kind of virtual machine image file | |
CN102725733A (en) | Porting virtual machine images between platforms | |
CN104468226A (en) | Nginx configuration method and device | |
JP2003015871A (en) | System and method for constructing target operating system from source operating system | |
CN111866099B (en) | Method, device, system, equipment and storage medium for downloading mirror image file | |
US10025630B2 (en) | Operating programs on a computer cluster | |
CN103092742A (en) | Optimization method and system of program logging | |
CN105450759A (en) | System mirror image management method and device | |
CN105052111A (en) | Service migration across cluster boundaries | |
JP6996629B2 (en) | Verification automation equipment, verification automation methods, and programs | |
CN112068852B (en) | Method, system, equipment and medium for installing open-source software based on domestic server | |
CN113760306B (en) | Method and device for installing software, electronic equipment and storage medium | |
CN107800730A (en) | The expansion method and device of a kind of virtual disk | |
US20170329700A1 (en) | Executing Multi-Version Tests Against a Multi-Version Application | |
CN103514004A (en) | Method and device for managing system environment under Windows system | |
CN106621334B (en) | Method and device for controlling non-player control role | |
CN111352664A (en) | Distributed machine learning task starting method, system, equipment and storage medium | |
US8000952B2 (en) | Method and system for generating multiple path application simulations | |
US20230342181A1 (en) | Validation of combined software/firmware updates | |
CN116069366A (en) | Client application program updating method and device, storage medium and electronic equipment | |
CN115268950A (en) | Mirror image file importing method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |