CN111481928A - Animation loading method and device, server and storage medium - Google Patents

Animation loading method and device, server and storage medium Download PDF

Info

Publication number
CN111481928A
CN111481928A CN202010284505.0A CN202010284505A CN111481928A CN 111481928 A CN111481928 A CN 111481928A CN 202010284505 A CN202010284505 A CN 202010284505A CN 111481928 A CN111481928 A CN 111481928A
Authority
CN
China
Prior art keywords
animation
file
skeleton
identifier
action
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.)
Granted
Application number
CN202010284505.0A
Other languages
Chinese (zh)
Other versions
CN111481928B (en
Inventor
张宁新
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co Ltd
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 Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202010284505.0A priority Critical patent/CN111481928B/en
Publication of CN111481928A publication Critical patent/CN111481928A/en
Application granted granted Critical
Publication of CN111481928B publication Critical patent/CN111481928B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/50Controlling the output signals based on the game progress
    • A63F13/52Controlling the output signals based on the game progress involving aspects of the displayed game scene
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T13/00Animation
    • G06T13/203D [Three Dimensional] animation
    • G06T13/403D [Three Dimensional] animation of characters, e.g. humans, animals or virtual beings

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The application provides an animation loading method, device, server and storage medium, a skeleton identification is determined according to a model used by a game object, an animation storage directory corresponding to the model is determined by searching a mapping table, an animation file is searched under the storage directory according to an object name and an action identification, the animation file is read, and animation loading is realized.

Description

Animation loading method and device, server and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to an animation loading method, an animation loading device, a server, and a storage medium.
Background
The game rendering process refers to a process in which the game engine reads game model data and converts the model data into an image.
Aiming at the rendering process of the game role, the game engine reads the fashion file of the game role and then converts the fashion file into an image. The fashion files comprise model files, material files, map files, animation files and the like. Typically, the game engine will read the entire fashion file, however, only a portion of the motion data will be played during the game run. Therefore, as an improvement, the game engine reads the empty animation file while only the model file, the material file, and the map file. When a user inputs a playing action, determining a directory where the animation file is located according to the action identifier and the mapping table, determining the name of the animation file according to the action identifier and the mapping table, and calling the animation file. In order to implement the action playing of the game object, each game object needs to be configured with an animation file, and the animation file stores the action data of each part of the model of the game object.
However, in the existing loading method, an animation file needs to be configured for each game character, and the animation file stores the motion data of each part of the model of the game object, so that the resource redundancy of the animation file is caused.
Disclosure of Invention
The application provides an animation loading method, an animation loading device, a server and a storage medium, and aims to solve the technical problem that animation file resources are redundant due to the fact that animation files need to be configured for each game role in the existing loading method, and action data of all parts of a model of a game object are stored in the animation files.
In a first aspect, the present application provides an animation loading method, including: acquiring the playing operation input by a user on a game object on a current display interface; determining playing data according to the playing operation, wherein the playing data comprises an action identifier and a skeleton identifier of at least one skeleton; determining a first storage directory according to each skeleton identifier and a first mapping table, wherein the first mapping table is used for representing the corresponding relation between the skeleton identifiers and the storage directories of the animation files; and reading the animation file in the first storage directory according to the action identifier.
Optionally, playing the data further comprises: an object name of the game object; reading the animation file in the storage directory according to the action identifier, which specifically comprises the following steps: determining whether a first animation file exists in a first storage directory or not, wherein the file name of the first animation file comprises an object name and an action identifier; and if so, reading the first animation file in the first storage directory.
Optionally, if not, determining a second mapping table associated with the game object, where the second mapping table is used to represent a correspondence between the motion identifier and a file name of the animation file; determining a file name according to the action identifier and a second mapping table; and reading the animation file corresponding to the file name in the first storage directory.
Optionally, before reading the animation file under the first storage directory according to the action identifier, the method further includes: acquiring a skeleton identifier, an object name and an action identifier associated with each animation file; and after the skeleton identification, the object name and the action identification are superposed, generating a file name of each animation file.
Optionally, after superimposing the skeleton identifier, the object name, and the action identifier, and generating a file name of each animation file, the method further includes: and storing the animation files related to the same skeleton identification into the same storage directory.
Optionally, an animation file is used to store the keyframe motion data for a single set of skeletons.
Optionally, before reading the animation file under the storage directory according to the action identifier, the method further includes: acquiring a skeleton identification and a file name associated with a to-be-modified picture file; determining a second storage directory according to the skeleton identifier and the first mapping table; searching a modified picture file to be modified under the second storage directory according to the file name; and modifying the file to be modified.
Optionally, after modifying the file to be modified, the method further includes: and modifying the corresponding relation between the file name and the action identifier of the animation file to be modified.
Optionally, after reading the animation file under the first storage directory according to the action identifier, the method further includes: and generating the current frame animation data of each skeleton according to the read animation file.
Optionally, before acquiring the play action of the game object input by the user on the current display interface, the method further includes: reading submodels and skeleton identifications of frameworks of game objects, wherein the display models of the game objects comprise at least one submodel, and each submodel comprises at least one skeleton; judging whether an animation file associated with each skeleton identification is stored in the memory; and if not, stopping generating the current frame animation data of each skeleton.
Optionally, after stopping generating the current frame animation data of the skeleton if not, the method further includes: and waiting for the user to input a playing operation.
In a second aspect, the present application provides an animation loading apparatus, comprising:
the acquisition module is used for acquiring the playing operation input by the user on the game object on the current display interface;
the determining module is used for determining playing data according to the playing operation, wherein the playing data comprises an action identifier and a skeleton identifier of at least one skeleton;
the determining module is further used for determining a first storage directory according to each skeleton identifier and a first mapping table, wherein the first mapping table is used for representing the corresponding relation between the skeleton identifiers and the storage directories of the animation files;
and the reading module is used for reading the animation file in the first storage directory according to the action identifier.
In a third aspect, the present application provides a server, comprising:
a memory for storing a program;
a processor for executing the program stored in the memory, the processor being adapted to perform the animation loading method according to the first aspect and the alternative when the program is executed.
In a fourth aspect, the present application provides a computer-readable storage medium, which includes computer-executable instructions stored therein, and when the computer-executable instructions are executed by a processor, the animation loading method according to the first aspect and the optional embodiments is provided.
The application provides an animation loading method, an animation loading device, a server and a storage medium, animation files related to the same model skeleton identification are stored in the same directory, a mapping table of the relation between the model skeleton identification and the animation file storage directory is configured, when the animation files are loaded, the skeleton identification of a sub-model is determined through a sub-model of a game object, and then the animation files can be read by searching the mapping table. Compared with the prior art, the method has the advantages that the skeleton identification is used as the primary index of the animation file, so that the submodels related to the same skeleton identification can multiplex the same animation file, and data redundancy in the animation file is effectively avoided.
Drawings
FIG. 1 is a schematic flow chart of rendering 3D resources by a 2D engine provided herein;
FIG. 2 is a schematic diagram of a skeletal hierarchy provided herein;
FIG. 3 is a schematic structural diagram of a fashion resource of a game character provided by the present application;
FIG. 4 is a schematic flow chart of animation loading provided by the prior art;
FIG. 5 is a schematic diagram of an animation loading method provided by the present application;
FIG. 6 is a flowchart illustrating an animation loading method according to an embodiment of the present application;
FIG. 7 is a schematic diagram of a storage directory of an animation file according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of an animation loading device according to a fourth embodiment of the present application;
fig. 9 is a schematic structural diagram of an electronic device according to a fifth embodiment of the present application.
Detailed Description
To make the purpose, technical solutions and advantages of the present application clearer, the technical solutions in the present application will be clearly and completely described below with reference to the drawings in the present application, and it is obvious that the described embodiments are some, but not all embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
A Massive Multiplayer Online Role Playing Game (MMORPG) is one of many Online games. The game rules of MMORPG are that a player plays a fictitious role and controls the various activities of that role.
The game resources of the MMORPG can be 3D resources, or can be a combination mode of 2D resources and 3D resources, and the 2D game engine or the 3D game engine can be used for running the game resources. For game resources that run 2D and 3D in a 2D game engine, in general, resources such as scenes, Non-Player characters (NPCs), special effects, and the like are all 2D resources. Since the player character can wear different fashion, the player character fashion resource employs a 3D resource. Fig. 1 is a schematic flow diagram of rendering 3D resources by a 2D engine according to the present application, and as shown in fig. 1, when game resources are operated, a two-process mode is generally adopted, and a rendering process renders the 3D resources, so as to implement off-screen rendering of a 3D fashion model. The game process communicates with the rendering process in a memory sharing mode, when the 3D fashion model needs to be rendered, the game process sends rendering information to the rendering process, the rendering process renders the 3D fashion model off a screen and generates a plurality of frames of 2D sequence frame images, and the 2D sequence frame images are sent to the game process in the memory sharing mode, so that the game process can display the 3D fashion.
The principle of the skeleton skinning animation is that the model mesh vertex is bound to a skeleton level, and after the skeleton level changes, the new model mesh vertex coordinate can be calculated according to the binding information, so as to drive the model mesh to deform. A complete skeletal animation is generally composed of a skeleton hierarchy, a binding mesh, and a series of keyframes, where one keyframe corresponds to a new state of the skeleton, and the state between two keyframes can be obtained by interpolation. Fig. 2 is a schematic diagram of the skeleton hierarchy provided by the present application, and as shown in fig. 2, the skeleton is composed of a series of joints and joint chains having a hierarchical relationship, and is a tree structure, the root joint 110 is a parent joint of other joints 120, and other joints 120 are child joints of the root joint, and the root joint is translated and rotated to determine the position and orientation of the whole skeleton in the world space. The motion of the father joint can affect the motion of the son joints, but the motion of the son joints does not affect the father joints, so when the father joint is translated or rotated, all the son joints are translated or rotated at the same time.
Fig. 3 is a schematic structural diagram of a fashion resource of a game character provided in the present application, and as shown in fig. 3, the fashion resource is based on a skeleton skinning animation principle, and includes resources such as a model file, material data, chartlet data, and an animation file, where the model mainly describes three-dimensional model data, skin grid coordinates, a skeleton, and an associated animation file. The material file mainly describes rendering parameters and a Shader file during model rendering. The mapping mainly describes the apparent texture representation of the model. The animation file primarily describes a series of key frames of skeletal motion.
The model of the game role can be split into a set of size submodel and a plurality of pendant submodels. The body shape sub-model comprises a body model and various sub-component models for representing hands, heads, feet and the like. According to the effect and the position of the pendant submodel, the pendant submodel comprises a head pendant model, a weapon pendant model and the like. The multiple game roles can multiplex the same set of body type submodels or multiplex the same set of pendant submodels. In addition, a plurality of sub-models can multiplex the same skeleton, that is, the skeletons in a plurality of sub-model files can be the same.
Fig. 4 is a schematic flow diagram of action loading provided in the prior art, as shown in fig. 4, when a game engine reads a model file, an empty animation file is read at the same time, and when a user inputs a play action instruction for a game character, an action mapping table of the game character is obtained, as shown in table 1, the action mapping table is used for representing a correspondence between an action identifier and an animation file, and determining an animation file for playing an action according to the action mapping table, and the game engine reads the animation file.
Table 1 prior art action mapping table
Mario's action sign Animation file
Run …\Game\Mario01\run.gis
Turn_left …\Game\Mario02\Turn_left.gis
Turn_right …\Game\Mario03\Turn_right.gis
In order to realize animation playing of game objects in the prior art, each game role needs to be configured with an animation file, action data of each part of a model of each game object is stored in the animation file, and as a plurality of game objects can comprise the same submodel and a plurality of submodel files can comprise the same skeleton, the animation file of each game object can store the same key frame data, so that the key frame data in the animation file are redundant.
The application provides an animation loading method which aims to solve the problems in the prior art. Fig. 5 is a schematic diagram of an animation loading method provided by the present application, and as shown in fig. 5, the inventive concept of the present application is: there are multiplexing cases for the models of game objects, for example: and a plurality of game roles reuse the same body type model or the same pendant model. Multiple models can in turn multiplex the same skeleton, for example: and the plurality of hanging rack models reuse the same framework. And the data stored in the animation file is the key frame skeleton motion data, so that the data in the animation files of a plurality of game objects can be multiplexed.
Based on the analysis, only motion data of a single group of skeletons is stored in each animation file, the animation files related to the same skeleton identification are stored in the same storage directory, a mapping table used for expressing the relation between the skeleton identification and the animation file storage directory is configured, then the animation files are named according to the related action identification and object name, the animation files are searched in the storage directory through the object name and the action identification, and loading of the game animation files is achieved.
As a technical problem to be solved by the present invention, in the prior art, a lost motion picture file is loaded when a model is loaded, so that the animation file and the model file are loaded separately. The application provides an animation loading method, which judges whether to load an animation file after loading a model file, if not, does not generate animation data of the current frame, and waits for a user to input playing operation. Compared with the prior art, the loading speed can be further improved.
Fig. 6 is a schematic flowchart of an animation loading method according to an embodiment of the present application, where the animation loading method is applicable to a terminal device and a computer. As shown in fig. 6, an animation loading method provided in an embodiment of the present application includes the following steps:
s101, obtaining playing operation input by a user on the game object on the current display interface.
The method is operated on the terminal equipment, and the current display interface refers to the interface currently displayed on the terminal display screen. When the method is operated on a computer, the current display equipment refers to the current display interface of the computer display screen. The user inputs a play operation for the game object on the currently displayed interface by using a finger, a touch pen, a mouse or other devices. A game object refers to an object capable of playing animation, such as: a player character. The play operation can attack, run, turn left, turn right, squat, lie prone, and the like.
S102, determining the playing data according to the playing operation.
Wherein the playing data includes: an object name of the game object, an action identification of the game object, and a model identification of at least one model of the game object. The object name of the game object may be an english name or a chinese acronym.
And determining a display model used for displaying the game object on the current display interface according to the fashion resource of the game object displayed on the current display interface, and determining the submodel forming the display model. Each sub-model also comprises a skeleton, and the skeleton identification of each skeleton is extracted. And determining the action identifier and at least one skeleton identifier of the action according to the playing operation input to the game object.
When the game object is a game character, each skeleton mark can be composed of two parts, wherein the first part is used for representing the body type skeleton to which the skeleton belongs, and the second part is used for representing the type of the skeleton.
The following description will be made of the playing data by taking the display model of the game character as an example, for example: one set of the game role leisure life is composed of two sets of fashion resources, and the first set of display model fashion resources comprises a body model and a hair hanging piece model. The set of display models corresponds to a set of body type frameworks, and the body type frameworks comprise a body framework and a hair hanging piece framework. The body model file is stored with a body skeleton, the hair hanging piece model file is stored with a hair hanging piece skeleton, the model identification skeleton of the body skeleton model is man01\ base1, wherein man01 is used for indicating that the body skeleton belongs to the body type skeleton identified as man 01. Base1 indicates that the skeleton belongs to a body skeleton. The skeleton of the hair pendant skeleton is identified as man01\ pelvis2, and pelvis2 indicates that the skeleton belongs to the head pendant skeleton. The skeleton identification in the playing data is: man01\ base1 and man01\ pelvis2, the name of an object in playing data is xys, and the action identifier of an action in playing data is attack. The model of the hair pendant model is identified as pelvis 1. The second set of fashion resources includes a body model and a hair pendant model, the body model having a model identification of base1 and the hair pendant model having a model identification of pelvis 2. And displaying the first set of fashion resources on the current display interface, and acquiring model identifications base1 and pelvis1 forming the first set of fashion resources. The object name is abbreviated as Chinese letter, and the object name of Xiaoyao Sheng is xys. The action of the game object is an attack action, and the action is identified as attack.
S103, determining a first storage directory according to each skeleton identification and the first mapping table.
The mapping table is used for representing the relation between each skeleton mark and the animation file storage directory. The mapping table is loaded during server initialization. And determining the storage directory of the animation file corresponding to each model identification skeleton identification by looking up the mapping table shown in the table 2.
The file name of the game object is the model file of gy _ collaer2, and the storage directory of the model file is mesh \ man 01. And if the model identification of the model file is 1base, the storage directory of the animation file is mesh \ man01\1 base. The file name of the game object is the gy _ pendant1 model file, and the storage directory of the model file is mesh \ man 01. And if the model identification of the model file is 1base, the storage directory of the animation file is mesh \ man01\1 base.
The file name of the game object is a model file with default _ hat3_ wzs, and the storage directory of the model file is mesh \ man 02. And the model identification of the model file is 2head, the storage directory of the animation file is mesh \ man02\2 head. The file name of the game object is a model file of default _ hat _ jxk, and the storage directory of the model file is mesh \ man 02. And the model identification of the model file is 2head, the storage directory of the animation file is mesh \ man02\2 head.
And S104, reading the animation file in the first storage directory according to the action identifier.
And if so, reading the animation file with the file name containing the object name and the action identifier under the storage directory. If not, determining the file name by adopting a table look-up mode.
The step of determining the file name in a table look-up manner specifically comprises the following steps: and determining a second mapping table corresponding to the game object, wherein the second mapping table is used for representing the relation between the action identifier and the file name of the animation file. And determining the file name of the animation file according to the action identifier and a second mapping table corresponding to the game object. And reading the animation file under each storage directory according to the file name of the animation file. The animation files are named by the associated action identifiers and the object names, and the animation files with the file names containing the object names and the action identifiers are read in the storage directories corresponding to the models, so that a plurality of animation files can be obtained.
And S105, generating current frame animation data according to the read animation file.
The animation file is the key frame motion data of the skeleton, and after the model key frame animation data are obtained, the current frame animation data are calculated. The calculation method is a conventional calculation algorithm of the skeleton skin animation, and is not described herein again.
In the animation loading method provided in the embodiment of the present application, the skeleton identifier is used as an index of the animation file, so that the models with the same skeleton identifier can call data in the same animation file, data multiplexing in the animation file is realized, data redundancy is avoided, the animation file associated with the same model is stored in the same directory, only a mapping table between the model and the animation file storage directory needs to be configured, and different roles can multiplex the model, thereby further reducing the scale of the mapping table.
The following description focuses on the animation loading method provided in the second embodiment of the present application, where the animation loading method provided in the second embodiment of the present application includes the following steps:
s201, obtaining a skeleton identification, an object name and an action identification associated with each animation file.
The animation file stores key frame motion data of a single group of skeletons, and when the skeletons are used by the model, animation data of certain action of the model can be determined according to the key frame motion data of the skeletons. The key frame motion data in the animation file can be key frame motion data of a single action or key frame motion data of a plurality of actions.
In the animation file production process, if two game objects are based on the same group of skeletons but the key frame motion data of the same action of the two game objects are different, the key frame motion data of the skeletons needs to be stored in the two files respectively, so that the game objects related to the key frame motion data of the single group of skeletons are also stored in the animation file. And determining the skeleton identifier, the action identifier and the object name associated with the animation file according to the data stored in the animation file.
And S202, generating a file name of the animation file after the skeleton identification, the object name and the action identification are overlapped.
If the two game objects multiplex the same model file, the two game objects multiplex the same skeleton or the respective model files of the two game objects multiplex the same skeleton, the animation file is based on the skeleton, and if the two game objects have the same key frame motion data based on the skeleton, the two game objects can multiplex the same animation file. Therefore, the naming prefixes of a plurality of animation files which are made based on the same skeleton identification are consistent, and the prefixes are all the skeleton identifications. The appointment uses the game object name associated with the animation file as a suffix of the action file name. The object name of the game object may be an english name or a chinese acronym.
The model identification skeleton identification, the object name and the action identification are all character string data, the superposition of the character string data refers to the connection of the character strings through connecting symbols, and the connection sequence is the model identification skeleton identification, the action identification and the object name. When an animation file associates an object name and an action identifier, and the skeleton identifier is composed of two parts, for example: the model identifies the skeleton as man01\1base, the object name as xys, and the action as attach. Selecting only a portion of the skeletal identification generates the filename of the animation file. For example: and selecting an identifier representing a skeleton part to generate an action file name, wherein the file name after superposition processing is 1base _ attack _ xys, and the storage directory of the file is man01\1base \1base _ attack _ xy. When the action file associates a plurality of object names and a plurality of action identifiers, only one object name is displayed in the file name of the animation file, for example: the model identifies skeleton identification man01\1base, object names xys and lhy, action identifications are attack and ride, and the files after superposition processing are as follows: the man01\1base _ attack _ edge _ xys, the storage directory of the file is man01\1base \1base _ attack _ edge _ xy.
Through the naming mode, the file name prefixes of the animation files related to the same skeleton model are the same. For example: the file name prefixes of the animation files of the same body model skeleton are all 1base, and the file name prefixes of the animation files of the same head suspension part skeleton are all 2 head. Whether the animation files correspond to the same model skeleton can be judged by judging whether the file name prefixes of the animation files are consistent. And judging the game role game object associated with the animation file through the file name suffix of the animation file.
Model identification is combined by numbers and parts, and the common model identification skeleton identification used for representing the part described by the skeleton is as follows: 1base, 2head, 3pelvis2, 4pelvis, 4weapon, 5spine, 6weapon, 5hat, 5pelvis, 6pelvis, 7pelvis, 8pelvis, and the like. And then the skeleton identifier can be generated by combining the skeleton identifier with the body type identifier.
And S203, storing the animation files related to the same skeleton identification into the same storage directory.
Fig. 7 is a schematic diagram of a storage directory of an animation file according to an embodiment of the present application, and as shown in fig. 7, a skeleton identifier associated with the animation file is determined according to a file name of the animation file, and the animation file associated with the same skeleton identifier is stored in the same directory. And configures a mapping table representing the correspondence between the skeleton identification and the storage directory of the animation file, as shown in table 2.
Table 2 shows a first mapping table in the present application
Skeleton identification Storage directory for animation file
man01\1base mesh\man01\1base\
man02\2head mesh\man02\2head\
And S204, acquiring the playing operation input by the user on the game object on the current display interface.
Here, this step has already been described in detail in S101 of the first embodiment, and is not described here again.
And S205, determining the playing data according to the playing operation.
Here, this step has already been described in detail in S102 of the first embodiment, and is not described here again.
S206, determining a first storage directory according to each skeleton identification and the first mapping table.
Here, this step has already been described in detail in S103 of the first embodiment, and is not described here again.
And S207, reading the animation file in the first storage directory according to the action identifier.
Here, the step has already been described in detail in S104 of the first embodiment, and is not described here again.
And S208, generating current frame animation data by using the read animation file.
Here, this step has already been described in detail in S105 of the first embodiment, and is not described here again.
The following illustrates the beneficial effects of the above storage approach: the file name of the model file is gy _ collaer2, and the name of the sub-model file is gy _ pendant1, and the two model files are both stored in the mesh \ man01 directory. The two sub-model files store the same skeleton, the skeleton of the skeleton is identified as man01\1base, the storage directories of the animation files associated with the two sub-models are both mesh \ man01\1base, and the same animation files can be called.
In the animation loading method provided by the second embodiment of the present application, only the key frame motion data of a single skeleton is stored in each animation file, and then the animation files associated with the same skeleton identifier are stored in the same directory, so that the models with the same skeleton identifier can call the data in the same animation file, thereby realizing the data multiplexing in the animation file and avoiding the data redundancy.
The following description focuses on a flowchart of the animation loading method provided in the third embodiment of the present application, and the animation loading method provided in the third embodiment of the present application includes the following steps:
s301, reading at least one submodel of the game object.
When the game object is rendered, the display model of the game object is determined, the storage path of the submodel forming the display model is determined, the submodel of the game object is read in the storage path, the display model loading of the game object is completed, and the game object can be displayed on the display interface by rendering the display model.
S302, obtaining the skeleton identification of each skeleton.
After the submodel of the game object is loaded, a skeleton and a skeleton identification in the submodel are obtained.
And S303, judging whether the memory stores the animation file associated with each skeleton identification, if so, entering S304, and otherwise, entering S305.
When the model is initially loaded, the animation file is not loaded, and the judgment step is added, so that the error report of the animation loading process can be prevented.
And S304, generating current frame animation data of the skeleton by using the animation file.
The animation file is the model key frame action data, and after the model key frame animation data are obtained, the current frame animation data are calculated. The calculation method is a conventional calculation algorithm of the skeleton skin animation, and is not described herein again.
S305, stopping generating the current frame animation data.
And the animation file does not exist in the memory, so that the generation of the animation data of the current frame is stopped, and the error report of the animation loading process is prevented.
S306, waiting for the user to input the playing action of the game object.
After the model is loaded and the animation data is updated, the process of waiting for the user to input the playing action of the game object is started.
S307, obtaining the playing operation input to the game object by the user on the current display interface.
Here, this step has already been described in detail in S101 of the first embodiment, and is not described here again.
And S308, determining the playing data according to the playing operation.
Here, this step has already been described in detail in S102 of the first embodiment, and is not described here again.
S309, determining a first storage directory according to each skeleton identification and the first mapping table.
Here, this step has already been described in detail in S103 of the first embodiment, and is not described here again.
And S310, reading the animation file in the first storage directory according to the action identifier.
Here, the step has already been described in detail in S104 of the first embodiment, and is not described here again.
And S311, generating current frame animation data by using the read animation file.
Here, this step has already been described in detail in S105 of the first embodiment, and is not described here again.
In the animation loading method provided in the second embodiment of the present application, after the model is loaded, it is determined whether an animation file is stored in the memory, and if no animation file is stored, the updating of animation data is stopped, and a user is waited to input a play operation, so as to implement loading and separating of the animation file and the model file.
Fig. 8 is a schematic structural diagram of an animation loading device according to a third embodiment of the present application, and as shown in fig. 8, the animation loading device according to the third embodiment of the present application includes:
an obtaining module 401, configured to obtain a play operation input by a user on a current display interface for a game object;
a determining module 402, configured to determine playing data according to a playing operation, where the playing data includes an action identifier and a skeleton identifier of at least one skeleton;
the determining module 402 is further configured to determine a first storage directory according to each skeleton identifier and a first mapping table, where the first mapping table is used to represent a correspondence between the skeleton identifier and the storage directory of the animation file;
and a reading module 403, configured to read the animation file in the first storage directory according to the action identifier.
Optionally, playing the data further comprises: an object name of the game object; the reading module 403 is specifically configured to: determining whether a first animation file exists in a first storage directory or not, wherein the file name of the first animation file comprises an object name and an action identifier; and if so, reading the first animation file in the first storage directory.
Optionally, if not, determining a second mapping table associated with the game object, where the second mapping table is used to represent a correspondence between the motion identifier and a file name of the animation file; determining a file name according to the action identifier and a second mapping table; and reading the animation file corresponding to the file name in the first storage directory.
Optionally, the apparatus further includes a storage module 404, where the storage module 404 is specifically configured to: acquiring a skeleton identifier, an object name and an action identifier associated with each animation file; and after the skeleton identification, the object name and the action identification are superposed, generating a file name of each animation file.
Optionally, the storage module 404 is further configured to: and storing the animation files related to the same skeleton identification into the same storage directory.
Optionally, an animation file is used to store the keyframe motion data for a single set of skeletons.
Optionally, the apparatus further includes a modification module 405, where the modification module 405 is specifically configured to: acquiring a skeleton identification and a file name associated with a to-be-modified picture file; determining a second storage directory according to the skeleton identifier and the first mapping table; searching a modified picture file to be modified under the second storage directory according to the file name; and modifying the file to be modified.
Optionally, the modifying module 405 is further configured to: and modifying the corresponding relation between the file name and the action identifier of the animation file to be modified.
Optionally, the apparatus further includes an updating module 405, and the updating module 406 is specifically configured to: and generating the current frame animation data of each skeleton according to the read animation file.
Optionally, the updating module 406 is further configured to: reading submodels and skeleton identifications of frameworks of game objects, wherein the display models of the game objects comprise at least one submodel, and each submodel comprises at least one skeleton; judging whether an animation file associated with each skeleton identification is stored in the memory; and if not, stopping generating the current frame animation data of each skeleton.
Optionally, the apparatus further includes a waiting module 407, where the waiting module 407 is specifically configured to: and waiting for the user to input a playing operation.
Fig. 9 is a schematic structural diagram of an electrical device according to the fourth embodiment of the present application. As shown in fig. 9, the present embodiment provides an electrical apparatus 500 including: a transmitter 501, a receiver 502, a memory 503, and a processor 504.
A transmitter 501 for transmitting instructions and data;
a receiver 502 for receiving instructions and data;
a memory 503 for storing computer-executable instructions;
a processor 504 for executing the computer executable instructions stored in the memory to implement the steps performed by the animation loading method in the above embodiments. Reference may be made in detail to the related description in the foregoing animation loading method embodiment.
Alternatively, the memory 503 may be separate or integrated with the processor 504.
When the memory 503 is provided separately, the electrical device also includes a bus for connecting the memory 4503 and the processor 504.
An embodiment of the present application further provides a computer-readable storage medium, in which computer execution instructions are stored, and when the processor executes the computer execution instructions, the animation loading method implemented by the powered device is implemented.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.

Claims (14)

1. An animation loading method, comprising:
acquiring the playing operation input by a user on a game object on a current display interface;
determining playing data according to the playing operation, wherein the playing data comprises an action identifier and a skeleton identifier of at least one skeleton;
determining a first storage directory according to each skeleton identifier and a first mapping table, wherein the first mapping table is used for representing the corresponding relation between the skeleton identifiers and the storage directories of the animation files;
and reading the animation file in the first storage directory according to the action identifier.
2. The method of claim 1, wherein playing the data further comprises: an object name of the game object;
reading the animation file in the first storage directory according to the action identifier, which specifically comprises the following steps:
determining whether a first animation file exists in the first storage directory, wherein the file name of the first animation file comprises the object name and the action identifier;
and if so, reading the first animation file under the first storage directory.
3. The method of claim 2, wherein:
if not, determining a second mapping table associated with the game object, wherein the second mapping table is used for representing the corresponding relation between the action identifier and the file name of the animation file;
determining a file name according to the action identifier and the second mapping table;
and reading the animation file corresponding to the file name in the first storage directory.
4. The method of claim 1, wherein prior to reading an animation file under the first stored directory in accordance with the action identification, the method further comprises:
acquiring a skeleton identifier, an object name and an action identifier associated with each animation file;
and superposing the skeleton identification, the object name and the action identification to generate the file name of each animation file.
5. The method of claim 4, wherein after superimposing the skeleton identifier, the object name, and the action identifier to generate a file name for each animation file, the method further comprises:
and storing the animation files related to the same skeleton identification into the same storage directory.
6. The method of any of claims 1 to 5, wherein the animation file is used to store key frame motion data for a single set of skeletons.
7. The method according to any one of claims 1 to 5, further comprising:
acquiring a file name of an animation file to be modified and an associated skeleton identifier;
determining a second storage directory according to the skeleton identifier and the first mapping table;
searching the modified picture file to be modified in the second storage directory according to the file name;
and modifying the file to be modified.
8. The method of claim 7, wherein after modifying the file to be modified, the method further comprises:
and modifying the corresponding relation between the file name and the action identifier of the animation file to be modified.
9. The method of any of claims 1 to 5, wherein after reading an animation file under the first storage directory according to the action identification, the method further comprises:
and generating the current frame animation data of each skeleton according to the read animation file.
10. The method according to any one of claims 1 to 5, wherein before the acquiring the play action of the game object input by the user on the current display interface, the method further comprises:
reading sub models and skeleton identifications of skeletons of the game objects, wherein the display models of the game objects comprise at least one sub model, and each sub model comprises at least one skeleton;
judging whether an animation file associated with each skeleton identification is stored in the memory;
and if not, stopping generating the current frame animation data of each skeleton.
11. The method of claim 10, wherein after if not, ceasing to generate current frame animation data for the skeleton, the method further comprises:
and waiting for the user to input a playing operation.
12. An animation loading device, comprising:
the acquisition module is used for acquiring the playing operation input by the user on the game object on the current display interface;
the determining module is used for determining playing data according to the playing operation, wherein the playing data comprises an action identifier and a skeleton identifier of at least one skeleton;
the determining module is further configured to determine a first storage directory according to each skeleton identifier and a first mapping table, where the first mapping table is used to represent a correspondence between the skeleton identifier and the storage directory of the animation file;
and the reading module is used for reading the animation file in the first storage directory according to the action identifier.
13. A server, comprising:
a memory for storing a program;
a processor for executing the program stored in the memory, the processor being configured to perform the animation loading method as claimed in any one of claims 1 to 11 when the program is executed.
14. A computer-readable storage medium, comprising: the computer-readable storage medium has stored therein computer-executable instructions for implementing the animation loading method as claimed in any one of claims 1 to 11 when executed by a processor.
CN202010284505.0A 2020-04-13 2020-04-13 Animation loading method and device, server and storage medium Active CN111481928B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010284505.0A CN111481928B (en) 2020-04-13 2020-04-13 Animation loading method and device, server and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010284505.0A CN111481928B (en) 2020-04-13 2020-04-13 Animation loading method and device, server and storage medium

Publications (2)

Publication Number Publication Date
CN111481928A true CN111481928A (en) 2020-08-04
CN111481928B CN111481928B (en) 2023-04-07

Family

ID=71790020

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010284505.0A Active CN111481928B (en) 2020-04-13 2020-04-13 Animation loading method and device, server and storage medium

Country Status (1)

Country Link
CN (1) CN111481928B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112328325A (en) * 2020-11-06 2021-02-05 深圳壹账通智能科技有限公司 Execution method and device of model file, terminal equipment and storage medium
CN112354186A (en) * 2020-11-10 2021-02-12 网易(杭州)网络有限公司 Game animation model control method, device, electronic equipment and storage medium
CN113379876A (en) * 2021-06-07 2021-09-10 腾讯科技(上海)有限公司 Animation data processing method, animation data processing device, computer equipment and storage medium
CN113546415A (en) * 2021-08-11 2021-10-26 北京字跳网络技术有限公司 Plot animation playing method, plot animation generating method, terminal, plot animation device and plot animation equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106528201A (en) * 2016-10-10 2017-03-22 网易(杭州)网络有限公司 Method and device for cartoon loading in game
CN106780681A (en) * 2016-12-01 2017-05-31 北京像素软件科技股份有限公司 A kind of role action generation method and device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106528201A (en) * 2016-10-10 2017-03-22 网易(杭州)网络有限公司 Method and device for cartoon loading in game
CN106780681A (en) * 2016-12-01 2017-05-31 北京像素软件科技股份有限公司 A kind of role action generation method and device

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112328325A (en) * 2020-11-06 2021-02-05 深圳壹账通智能科技有限公司 Execution method and device of model file, terminal equipment and storage medium
CN112354186A (en) * 2020-11-10 2021-02-12 网易(杭州)网络有限公司 Game animation model control method, device, electronic equipment and storage medium
CN113379876A (en) * 2021-06-07 2021-09-10 腾讯科技(上海)有限公司 Animation data processing method, animation data processing device, computer equipment and storage medium
CN113379876B (en) * 2021-06-07 2023-09-01 腾讯科技(上海)有限公司 Animation data processing method, device, computer equipment and storage medium
CN113546415A (en) * 2021-08-11 2021-10-26 北京字跳网络技术有限公司 Plot animation playing method, plot animation generating method, terminal, plot animation device and plot animation equipment
CN113546415B (en) * 2021-08-11 2024-03-29 北京字跳网络技术有限公司 Scenario animation playing method, scenario animation generating method, terminal, device and equipment

Also Published As

Publication number Publication date
CN111481928B (en) 2023-04-07

Similar Documents

Publication Publication Date Title
CN111481928B (en) Animation loading method and device, server and storage medium
CN110102050B (en) Virtual object display method and device, electronic equipment and storage medium
CN106075909B (en) Game reloading system and method
CN112044074A (en) Method, device, storage medium and computer equipment for seeking path to non-player character
CN112927332B (en) Bone animation updating method, device, equipment and storage medium
CN111714880B (en) Picture display method and device, storage medium and electronic device
CN108339270A (en) The processing method of static component, rendering intent and device in scene of game
CN111563945B (en) Generation method, device and equipment of character morphing animation and readable storage medium
US11816772B2 (en) System for customizing in-game character animations by players
JP2008250813A (en) Image creating device, image processing method, and program
CN110852942A (en) Model training method, and media information synthesis method and device
CN110070609A (en) Processing method, device, storage medium, processor and the terminal of terrain data
CN109395387A (en) Display methods, device, storage medium and the electronic device of threedimensional model
CN105597314B (en) Rendering system and method of 2D game and terminal equipment
CN112843683A (en) Control method and device of virtual role, electronic equipment and storage medium
CN113313796B (en) Scene generation method, device, computer equipment and storage medium
CN113034651B (en) Playing method, device, equipment and storage medium of interactive animation
US11878239B2 (en) Replay editor in video games
CN116233532A (en) Video playing method, device, computer equipment and computer readable storage medium
CN115526967A (en) Animation generation method and device for virtual model, computer equipment and storage medium
CN113888679A (en) Animation generation method, device, equipment and medium
JP2014044710A (en) Character display device
CN113546415A (en) Plot animation playing method, plot animation generating method, terminal, plot animation device and plot animation equipment
US20240238679A1 (en) Method and system for generating an image representing the results of a gaming session
US20230166187A1 (en) Program, terminal, and game system

Legal Events

Date Code Title Description
PB01 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