CN114443306A - Resource processing method and device, electronic equipment and computer readable storage medium - Google Patents

Resource processing method and device, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN114443306A
CN114443306A CN202210112291.8A CN202210112291A CN114443306A CN 114443306 A CN114443306 A CN 114443306A CN 202210112291 A CN202210112291 A CN 202210112291A CN 114443306 A CN114443306 A CN 114443306A
Authority
CN
China
Prior art keywords
resource
plug
package
file
target
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.)
Pending
Application number
CN202210112291.8A
Other languages
Chinese (zh)
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.)
Xiamen Yaji Software Co Ltd
Original Assignee
Xiamen Yaji Software 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 Xiamen Yaji Software Co Ltd filed Critical Xiamen Yaji Software Co Ltd
Priority to CN202210112291.8A priority Critical patent/CN114443306A/en
Publication of CN114443306A publication Critical patent/CN114443306A/en
Priority to PCT/CN2023/073636 priority patent/WO2023143545A1/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • 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/30Interconnection arrangements between game servers and game devices; Interconnection arrangements between game devices; Interconnection arrangements between game servers
    • A63F13/35Details of game servers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • G06F9/44526Plug-ins; Add-ons
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44594Unloading

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the application provides a resource processing method and device, electronic equipment and a computer readable storage medium, and relates to the field of computer software. The method comprises the following steps: receiving a calling operation for calling a target plug-in; responding to the calling operation, and acquiring a target resource file corresponding to the target plug-in the engine resource package; the target resource file is imported from a plug-in resource package corresponding to the target plug-in; project resource files in the engine resource package are imported from the project resource package. According to the embodiment of the application, the resources are respectively imported into the engine resource package through the plug-in resource package and the project resource package, so that the adaptability of the target plug-in and the game engine is enhanced.

Description

Resource processing method and device, electronic equipment and computer readable storage medium
Technical Field
The present application relates to the field of computer software technologies, and in particular, to a resource processing method and apparatus, an electronic device, and a computer-readable storage medium.
Background
A game item can be divided into two major parts, game engine and game resource. The game resources comprise images, sounds, animations and the like, and the game engine calls the game resources sequentially according to the requirements of game design.
Often, game items require the use of a large number of game resources, which vary in format. Therefore, the game resources are preprocessed in the game project development process and are imported into the specified directory so as to be identified and called by the game engine.
In the prior art, when a newly added resource is introduced into a game project based on a plug-in, the newly added resource often affects the processing logic of the original project resource in the introduction process, and the development efficiency of the game plug-in is affected.
Disclosure of Invention
The embodiment of the application provides a resource processing method and device, electronic equipment and a computer readable storage medium, and can solve the problem that the development efficiency of game plug-ins is low in the prior art. The technical scheme is as follows:
according to an aspect of an embodiment of the present application, there is provided a resource processing method, including:
receiving a calling operation for calling a target plug-in;
responding to the calling operation, and acquiring a target resource file corresponding to the target plug-in the engine resource package; the target resource file is imported from a plug-in resource package corresponding to the target plug-in; project resource files in the engine resource package are imported from the project resource package.
Optionally, the process of importing the original resource file in the plug-in resource package into the engine resource package includes:
starting a target plug-in;
scanning the plug-in resource package, and determining an original resource file to be imported;
and importing the original resource file to be imported into the engine resource package.
Optionally, the method further includes:
correspondingly configuring a plug-in resource packet for each target plug-in; wherein the import priority of the project resource package is higher than the import priority of the plug-in resource package.
Optionally, the scanning the plug-in resource package to determine the original resource file to be imported includes:
scanning the plug-in resource package to obtain the attribute information of the original resource file;
determining import information corresponding to the plug-in resource package;
and when the attribute information is matched with the import information, taking the original resource file as the original resource file to be imported.
Optionally, the importing the original resource file to be imported into the engine resource package includes:
analyzing an original resource file to be imported according to a preset format to generate a target resource file;
and saving the target resource file into the engine resource package.
Optionally, the method further includes:
and when receiving a closing notification aiming at the target plug-in, deleting the plug-in resource packet corresponding to the target plug-in.
Optionally, the method further includes:
each plug-in resource package is correspondingly configured with a cache file package, and when cache data exist correspondingly in the plug-in resource package, the cache data are stored in the engine resource package and the cache file package; the cache data comprises at least one of intermediate data and temporary data generated by the plug-in resource package when the resource is imported.
According to another aspect of the embodiments of the present application, there is provided a resource processing apparatus, including:
the receiving module is used for receiving the calling operation of calling the target plug-in;
the acquisition module is used for responding to the calling operation and acquiring a target resource file corresponding to the target plug-in the engine resource package; the target resource file is imported from a plug-in resource package corresponding to the target plug-in; project resource files in the engine resource package are imported from the project resource package.
Optionally, the apparatus further includes an importing module, configured to:
starting a target plug-in;
scanning the plug-in resource package, and determining an original resource file to be imported;
and importing the original resource file to be imported into the engine resource package.
Optionally, the apparatus further includes a configuration module, configured to:
correspondingly configuring a plug-in resource packet for each target plug-in; wherein the import priority of the project resource package is higher than the import priority of the plug-in resource package.
Optionally, the import module is further configured to:
scanning the plug-in resource package to acquire the attribute information of the original resource file;
determining import information corresponding to the plug-in resource package;
and when the attribute information is matched with the import information, taking the original resource file as the original resource file to be imported.
Optionally, the import module is further configured to:
analyzing an original resource file to be imported according to a preset format to generate a target resource file;
and saving the target resource file into the engine resource package.
Optionally, the apparatus further includes a deleting module, configured to:
and when receiving a closing notification aiming at the target plug-in, deleting the plug-in resource packet corresponding to the target plug-in.
Optionally, the apparatus further includes a cache module, configured to:
each plug-in resource package is correspondingly configured with a cache file package, and when cache data exist correspondingly in the plug-in resource package, the cache data are stored in the engine resource package and the cache file package; the cache data comprises at least one of intermediate data and temporary data generated by the plug-in resource package when the resource is imported.
According to another aspect of an embodiment of the present application, there is provided an electronic apparatus including: the device comprises a memory, a processor and a computer program stored on the memory, wherein the processor executes the computer program to realize the steps of the method shown in the first aspect of the embodiment of the application.
According to a further aspect of embodiments of the present application, there is provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method as set forth in the first aspect of embodiments of the present application.
According to an aspect of embodiments of the present application, there is provided a computer program product comprising a computer program that, when executed by a processor, performs the steps of the method illustrated in the first aspect of embodiments of the present application.
The technical scheme provided by the embodiment of the application has the following beneficial effects:
the method comprises the steps of responding to calling operation of a target plug-in to obtain a target resource file corresponding to the target plug-in a game engine package; meanwhile, the target plug-in is configured with a corresponding plug-in resource package which is independent from the project resource package for storing the original project resource; the method and the device have the advantages that resources are respectively led into the engine resource package based on the plug-in resource package and the project resource package, so that the bug (program error) probability in the development process of the target plug-in is reduced; in addition, aiming at the condition that the target plug-in needs to dynamically register resources, the target plug-in is configured with an independent plug-in resource package, so that the purpose of isolating the plug-in resources from the original project resources is achieved. Compared with the prior art that newly added resources often influence the processing logic of original project resources in the importing process, the method and the system enhance the adaptability of the target plug-in and the game engine, improve the development efficiency of the game plug-in and reduce the development cost.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings used in the description of the embodiments of the present application will be briefly described below.
Fig. 1 is a schematic view of an application scenario of a resource processing method according to an embodiment of the present application;
fig. 2 is a schematic flowchart of a resource processing method according to an embodiment of the present application;
fig. 3 is a schematic flowchart illustrating a process of determining an original resource file to be imported in a resource processing method according to an embodiment of the present application;
fig. 4 is a schematic flowchart illustrating importing a plug-in resource package in a resource processing method according to an embodiment of the present application;
fig. 5 is a flowchart illustrating an exemplary resource processing method according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a resource processing apparatus according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a resource processing electronic device according to an embodiment of the present application.
Detailed Description
Embodiments of the present application are described below in conjunction with the drawings in the present application. It should be understood that the embodiments set forth below in connection with the drawings are exemplary descriptions for explaining technical solutions of the embodiments of the present application, and do not limit the technical solutions of the embodiments of the present application.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should be further understood that the terms "comprises" and/or "comprising," when used in this specification in connection with embodiments of the present application, specify the presence of stated features, information, data, steps, operations, elements, and/or components, but do not preclude the presence or addition of other features, information, data, steps, operations, elements, components, and/or groups thereof, as embodied in the art. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may be present. Further, "connected" or "coupled" as used herein may include wirelessly connected or wirelessly coupled. The term "and/or" as used herein indicates at least one of the items defined by the term, e.g., "a and/or B" may be implemented as "a", or as "B", or as "a and B".
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
The game engine refers to a core component of some edited computer game system or some interactive real-time image application program. These systems provide game designers with the various tools required to compose games, with the goal of allowing game designers to easily and quickly program games without starting from zero. Most support various operating platforms, such as Linux, Mac OS X, microsoft Windows. The game engine comprises the following systems: rendering engines (i.e., "renderers," including two-dimensional and three-dimensional graphics engines), physics engines, collision detection systems, sound effects, scripting engines, computer animation, artificial intelligence, network engines, and scene management.
The engine is equivalent to a game framework, and after the framework is built, the level designer, the modeler and the animator only need to fill contents in. Therefore, in the development process of 3D games, the production of the engine often takes a very large amount of time. Just for cost savings, cycle reduction, and risk reduction, more and more developers tend to produce their own games using third party off-the-shelf engines, and a large authorized engine market has emerged.
In the process of developing the game project, when adding new resources for the game project based on the plug-in, the new resources need to be introduced into the engine resource package from the original resource package according to a preset format, so that the game engine can directly call the resources from the engine resource package. The inventor finds that:
(1) original resources (including resources of projects and newly added resources of plug-ins) in a conventional scheme are stored in the same original resource package, and when newly added resources of a plurality of rename plug-ins exist in the original resource package, conflicts can occur when the original resources are imported, so that exceptions can occur in plug-in development.
(2) The temporary data generated in the resource import process can be directly imported into the engine resource package; when the resource is updated, the importer needs to manage the temporary data, which increases the code complexity of the resource-related function.
The resource processing method, device and compiler provided by the application aim to solve the above technical problems in the prior art.
The embodiment of the application provides a resource processing method, which can be realized by a terminal or a server. The terminal or the server related to the embodiment of the application acquires the target resource file corresponding to the target plug-in the game engine package by responding to the calling operation of the target plug-in; meanwhile, the target plug-in is configured with the corresponding plug-in resource package, and the plug-in resource package and the project resource package for storing the original project resource are independent of each other, so that the resources are respectively led into the engine resource package based on the plug-in resource package and the project resource package, the resource leading-in process is optimized, and the development efficiency of the game plug-in is improved.
The technical solutions of the embodiments of the present application and the technical effects produced by the technical solutions of the present application will be described below through descriptions of several exemplary embodiments. It should be noted that the following embodiments may be referred to, referred to or combined with each other, and the description of the same terms, similar features, similar implementation steps and the like in different embodiments is not repeated.
As shown in fig. 1, the resource processing method of the present application may be applied to the scenario shown in fig. 1, specifically, the server 101 may receive, from the client 102, a call operation of a target plug-in, and obtain, in response to the call operation, a target resource file corresponding to the target plug-in an engine resource package; the target resource file is imported from the plug-in resource package, and the project resource file in the engine resource package is imported from the project resource package.
In the scenario shown in fig. 1, the resource processing method may be performed in the server, or in another scenario, may be performed in the terminal.
Those skilled in the art will understand that the "terminal" used herein may be a Mobile phone, a tablet computer, a PDA (Personal Digital Assistant), an MID (Mobile Internet Device), etc.; a "server" may be implemented as a stand-alone server or as a server cluster comprised of multiple servers.
An embodiment of the present application provides a resource processing method, and as shown in fig. 2, the method includes:
s201, receiving a calling operation of calling the target plug-in.
The calling operation can be generated based on a calling instruction of a user.
Specifically, the terminal or the server for performing resource processing may receive a call instruction of a user, and determine a call operation based on the call instruction.
In this embodiment of the present application, the call instruction may be triggered based on at least one of the following operations:
dragging or moving the interface element component corresponding to the calling operation to an operation within a preset range of the current interface;
clicking operation of an interface element component corresponding to the calling operation;
and inputting an identifier corresponding to the calling operation in a preset input control.
S202, responding to the calling operation, and acquiring a target resource file corresponding to a target plug-in the engine resource package; the target resource file is imported from a plug-in resource package corresponding to the target plug-in; project resource files in the engine resource package are imported from the project resource package.
Specifically, the terminal or the server for performing resource processing may obtain the target resource file in the engine resource package according to the determined call operation. The target resource file is imported from the plug-in resource package corresponding to the target plug-in, and the target resource file is preprocessed, so that the resource file can be directly identified and used by the game engine.
In some embodiments, a target resource file corresponding to a target plug-in an engine resource package may be acquired based on a correspondence between a calling operation and the target plug-in; and inquiring an index table in the engine resource package based on the identification of the calling operation to obtain the target resource file.
Meanwhile, resources in the plug-in resource package and the project resource package can be imported into the engine resource package based on the resource manager; on one hand, a terminal or a server for performing resource processing may perform an import operation on a resource in combination with resource management, and on the other hand, a resource manager may be integrated into the terminal or the server for performing resource processing, and the import operation on the resource is performed according to the terminal or the server for performing resource processing, which is not specifically limited in the embodiment of the present application.
The method comprises the steps of responding to calling operation of a target plug-in to obtain a target resource file corresponding to the target plug-in a game engine package; meanwhile, the target plug-in is configured with a corresponding plug-in resource package which is independent from the project resource package for storing the original project resource; according to the method and the device, resources are respectively led into the engine resource package based on the plug-in resource package and the project resource package, and the bug probability in the development process of the target plug-in is reduced; in addition, aiming at the condition that the target plug-in needs to dynamically register resources, the target plug-in is configured with an independent plug-in resource package, so that the purpose of isolating the plug-in resources from the original project resources is achieved. Compared with the prior art that newly added resources often influence the processing logic of original project resources in the importing process, the method and the system enhance the adaptability of the target plug-in and the game engine, improve the development efficiency of the game plug-in and reduce the development cost.
In an embodiment of the present application, a possible implementation manner is provided, and the method further includes:
correspondingly configuring a plug-in resource packet for each target plug-in; wherein the import priority of the project resource package is higher than the import priority of the plug-in resource package.
In the embodiment of the application, the number of the target plug-ins can be at least one, each target plug-in is correspondingly configured with a plug-in resource package, and the plug-in resource package is independent of the project resource package; the plug-in resource package may include an original resource file attached to the plug-in, and the project resource package may include an original project resource. Before registering the original resource files based on the target plug-ins, whether the project resource packages are imported or not can be detected, and after the project resource packages are successfully imported, the original resource files of the target plug-ins are imported. When the original resource file is registered based on the target plug-in, the resource manager is required to perform import operation on the original resource file, that is, the original resource file is correspondingly preprocessed and stored in a corresponding engine resource package, so that the game engine can call the original resource file.
In the embodiment of the application, the number of the target plug-ins is at least one, each target plug-in corresponds to one plug-in resource package, and the plug-in resource packages and the project resource packages are independent of each other. For example, the project resource package may be named "assets database", and when the target plug-in is an A plug-in, the corresponding plug-in resource package may be named "A database". The import flow of the project resource package and the plug-in resource package is the same, and the detailed steps of the import flow will be specifically described below by taking the plug-in resource package as an example.
A possible implementation manner is provided in the embodiment of the present application, and a process of importing an original resource file in a plug-in resource package into an engine resource package includes:
(1) the target plug-in is started.
Specifically, the terminal or the server for processing the resource may start the target plug-in according to the selection operation of the user.
(2) And scanning the plug-in resource package, and determining an original resource file to be imported.
Specifically, the terminal or the server for performing resource processing may scan a plug-in resource package corresponding to the target plug-in, detect an import state of a resource in the plug-in resource package, and determine an original resource file to be imported based on the import state.
A possible implementation manner is provided in the embodiment of the present application, as shown in fig. 3, the scanning the plug-in resource package and determining the original resource file to be imported includes:
a. and scanning the plug-in resource package to acquire the attribute information of the original resource file.
The attribute information includes a file name, a file type, a file size, modification time, and the like of the original resource file.
Specifically, the terminal or the server for performing resource processing may scan the plug-in resource package to obtain a file name, a file type, a file size, a modification time, and the like of the original resource file.
b. And determining the import information corresponding to the plug-in resource package.
Specifically, the terminal or the server for performing resource processing may obtain the import information from the cache file package corresponding to the plug-in resource package. Wherein the import information may include a historical import record of the original resource file.
c. And when the attribute information is matched with the import information, taking the original resource file as the original resource file to be imported.
In this embodiment, a terminal or a server for performing resource processing obtains import information from a cached file package, where the import information includes, but is not limited to, modification time of the original resource file, an importer used in last import, whether the last import was successful, file information generated after the last import was successful, and the like. According to the import information, the current import flow can be optimized, for example, the attribute information can be compared with the file modification time in the import information, and if the attribute information is consistent with the file modification time in the import information, the resource is not modified; and then judging whether the file generated by the last import is lost or not, if the generated file is normal, skipping the import process, and if not, continuing the subsequent import process.
According to the method and the device, the original resource file to be imported is determined by matching the attribute information of the original resource file with the import information corresponding to the plug-in resource package, when the resource file is successfully imported before and the imported generated file is normal, the import operation does not need to be repeated, and the resource import efficiency is improved.
(3) And importing the original resource file to be imported into the engine resource package.
Specifically, the terminal or the server for performing resource processing may convert an original resource file to be imported to obtain a target resource file, and store the target resource file in the engine resource package, where a specific import process will be described in detail below.
A possible implementation manner is provided in the embodiment of the present application, where the importing an original resource file to be imported into an engine resource package includes:
a. and analyzing the original resource file to be imported according to a preset format to generate a target resource file.
Specifically, the terminal or the server for performing resource processing may configure a corresponding importer for the original resource file according to the attribute information of the original resource file, where each original resource file corresponds to one importer. And the importer analyzes the original resource file to be imported according to a preset format and generates a corresponding target resource file.
b. And saving the target resource file into the engine resource package.
Specifically, the terminal or the server for performing resource processing may store the target resource file in the engine resource package, and store the current import information in the cache file package.
In the embodiment of the application, the original resource file is imported into the engine resource packet according to the preset format based on the importer corresponding to the original resource file, so as to obtain the target resource file. The target resource file is subjected to format analysis in the importing process and can be directly identified and used by the game engine.
In the embodiment of the present application, as shown in fig. 4, before the plug-in resource package is imported, if the resource in the project resource package is not imported yet, the original project file in the project resource package is imported, and a process of importing the original project resource file into the engine resource package is the same as an import process of the original resource file in the plug-in resource package, which is not described in detail in the present application. In the application, at least two import paths in the engine resource package are provided, namely the project resource package and at least one plug-in resource package, through the at least two import paths, the resource isolation between the target plug-ins and the original project resources can be realized, and aiming at the condition that the target plug-ins need to dynamically register the resources, the application supports the simultaneous starting of a plurality of plug-in resource packages, and can achieve the technical effect of dynamically mounting and unloading resource sets based on the target plug-ins under the condition that the original project resources of game projects are not influenced.
A possible implementation manner is provided in the embodiment of the present application, and the method further includes:
and when receiving a closing notification aiming at the target plug-in, deleting the plug-in resource packet corresponding to the target plug-in.
In the embodiment of the application, the plug-in resource package can be automatically removed along with the deletion or closing of the plug-in, and the original resources in the project are not influenced. The target plug-in is taken as an A plug-in, and the plug-in resource package is Adatabase for example: when the target plug-in is deleted, a terminal or a server for resource processing firstly receives a closing notice of the target plug-in; after receiving the shutdown notification, the terminal or the server for resource processing may remove the previously started a database from the resource packet index list, and then remove the a database from the memory. Therefore, the effect of deleting the A database without influencing other plug-in resource packages or project resource packages is achieved.
Meanwhile, in an editor of the game engine, when a target plug-in is started, a plug-in resource package can be automatically mounted in the editor, and the identifier of the plug-in resource package is displayed on a preset interface; when the target plug-in is closed, the mark displayed in the preset interface is hidden, so that a user can intuitively understand the opening or closing state of the target plug-in.
A possible implementation manner is provided in the embodiment of the present application, and the method further includes:
each plug-in resource package is correspondingly configured with a cache file package, and when cache data exist correspondingly in the plug-in resource package, the cache data are stored in the engine resource package and the cache file package; the cache data comprises at least one of intermediate data and temporary data generated by the plug-in resource package when the resource is imported.
In the embodiment of the application, the terminal or the server for resource processing can simultaneously store the intermediate data or the temporary data generated by the plug-in resource package during the import into the cache file package and the engine resource package, thereby realizing the unified management of the cache data and the resource data. When a certain original resource file needs to be re-imported, the terminal or the server for resource processing will automatically delete the cache data (stored in the cache file packet) and the target resource data (stored in the engine resource packet) corresponding to the original resource file. The import flow can be made to be purer, and the complexity of codes and logics is reduced.
Taking the original resource file as "fbx" resource as an example, the importer needs to convert "fbx" into intermediate data "gltf", and then analyze "gltf" to obtain the corresponding target resource file. In the embodiment of the application, each original resource file is reserved with a cache file packet temp, and the importer only needs to query "gltf" from the temp, and if the "gltf" does not exist, the importer generates the "gltf" without considering whether the intermediate data "gltf" needs to be generated.
In addition, the method can also process a lot of non-temporary file data, for example, the original resource is a png (bitmap format using lossless compression algorithm) file, and the target resource file that we need to generate is a thumbnail. In the prior art, where a game item needs to use a thumbnail, a resource manager acquires an original resource file and generates the thumbnail, and records attribute data of the original resource file, such as import generation time, resource modification time and the like, so as to determine whether the thumbnail needs to be regenerated when used next time; the above judgment process obviously adds logic steps to the resource-related procedure. In the present application, since the cache file package is emptied before the import flow starts, the data is the latest data as long as the data exists in the file package. Therefore, the terminal or the server for processing the resources can synchronously store the thumbnails in the corresponding cache file packages, and the game engine can be used as long as the game engine exists and can not generate the thumbnails each time the game engine acquires the thumbnails, so that the code logic in the functions related to the resources is greatly simplified.
In the embodiment of the application, two export positions, namely an engine resource packet and a cache file packet, are provided for a terminal or a server for resource processing aiming at cache data generated in a resource import process; when the original resource file is changed, the cache file packet corresponding to the resource is deleted, and when the resource file is changed and needs to be imported again, the corresponding data in the engine resource packet is also deleted, so that the resource management scheme in the application only needs to be responsible for generating the cache data, and does not need to judge whether the cache data is the latest cache data, and the purpose of simplifying the resource processing flow is achieved.
In order to better understand the above resource processing method, an example of the resource processing method of the present application, which can be applied in a resource manager, is set forth in detail below with reference to fig. 5; wherein the resource manager is used for providing matched resources for the game engine. The method comprises the following steps:
s501, determining a target plug-in; wherein, the target plug-in is used for registering an original resource file; and the original resource file is stored in a plug-in resource package corresponding to the target plug-in.
In some embodiments, the resource manager may determine the target plug-in and the original resource file corresponding to the target plug-in based on the plug-in operation instruction of the user.
In other embodiments, the resource manager may directly obtain the target plug-in and the original resource file corresponding to the target plug-in from the preset database.
The original resource file can be a resource to be imported into the engine resource package; the original resource file may include at least one of an image file, an audio file, and an animation file.
In the embodiment of the application, because the form and the content of the original resource file are not uniform, the original resource file is difficult to be directly identified by a game engine; when the original resource file is registered based on the target plug-in, the resource manager is required to perform import operation on the original resource file, that is, the original resource file is correspondingly preprocessed and stored in a corresponding engine resource package, so that the game engine can call the original resource file.
S502, when detecting that the original project resource in the project resource package is not imported, scanning the project resource package, and importing the original project resource into the engine resource package.
Wherein, the project resource package can include the original project resource. The import priority of the project resource package is higher than the import priority of the plug-in resource package.
Specifically, the resource manager may detect the engine resource package, and scan the project resource package and import the original project resource into the engine resource package when the project resource file corresponding to the original project resource cannot be detected in the engine resource package.
In the embodiment of the application, the number of the target plug-ins is at least one, each target plug-in corresponds to one plug-in resource package, and the plug-in resource packages and the project resource packages are independent of each other. For example, the project resource package may be named "assets database", and when the target plug-in is an A plug-in, the corresponding plug-in resource package may be named "A database". The import flow of the project resource package and the plug-in resource package is the same, and the detailed steps of the import flow will be specifically described below by taking the plug-in resource package as an example.
S503, scanning the plug-in resource package to obtain the attribute information of the original resource file.
The attribute information includes a file name, a file type, a file size, modification time, and the like of the original resource file.
Specifically, the resource manager may scan the plug-in resource package to obtain a file name, a file type, a file size, a modification time, and the like of the original resource file.
S504, determining import information corresponding to the plug-in resource package; and when the attribute information is matched with the import information, taking the original resource file as the original resource file to be imported.
Specifically, the resource manager may obtain the import information from the cache file package corresponding to the plug-in resource package. Wherein the import information may include a historical import record of the original resource file.
In this embodiment of the present application, the resource manager obtains import information from the cached file package, where the import information includes, but is not limited to, a modification time of the original resource file, an importer used in a last import, whether the import was successful last time, and file generation information after the import was successful last time. According to the import information, the current import flow can be optimized, for example, the attribute information can be compared with the file modification time in the import information, and if the attribute information is consistent with the file modification time in the import information, the resource is not modified; and then judging whether the file generated by the last import is lost or not, if the generated file is normal, skipping the import process, and if not, continuing the subsequent import process.
And S505, analyzing the original resource file to be imported according to a preset format, generating a target resource file, and storing the target resource file into an engine resource package.
Specifically, the resource manager may configure a corresponding importer for the original resource file according to the attribute information of the original resource file, where each original resource file corresponds to one importer. The importer analyzes the original resource file to be imported according to a preset format and generates a corresponding target resource file, and the resource manager stores the target resource file in the engine resource packet and stores the current import information in the cache file packet.
In some embodiments, when a close notification for a target plug-in is received, a plug-in resource package corresponding to the target plug-in is deleted.
In the embodiment of the application, the plug-in resource package can be automatically removed along with the deletion or closing of the plug-in, and the original resources in the project are not influenced. The target plug-in is taken as an A plug-in, and the plug-in resource package is Adatabase for example: when the target plug-in is deleted, the resource manager firstly receives a closing notice of the target plug-in; after receiving the shutdown notification, the resource manager removes the previously started a database from the resource packet index list, and then removes the a database from the memory. Therefore, the effect of deleting the A database without influencing other plug-in resource packages or project resource packages is achieved.
S506, configuring a cache file packet corresponding to each plug-in resource packet; when the plug-in resource package correspondingly has cache data, the cache data is stored in the engine resource package and the cache file package; the cache data comprises at least one of intermediate data and temporary data generated when the plug-in resource packet is imported.
In the embodiment of the application, the resource manager can simultaneously store the intermediate data or the temporary data generated by the plug-in resource package during the import into the cache file package and the engine resource package, so that the unified management of the cache data and the resource data is realized. When an original resource file needs to be imported again, the resource manager automatically deletes the cache data (stored in the cache file packet) and the target resource data (stored in the engine resource packet) corresponding to the original resource file. The import flow can be made to be purer, and the complexity of codes and logics is reduced.
Taking the original resource file as "fbx" resource as an example, the importer needs to convert "fbx" into intermediate data "gltf", and then analyze "gltf" to obtain the corresponding target resource file. In the embodiment of the application, each original resource file is reserved with a cache file packet temp, and the importer only needs to query "gltf" from the temp, and if the "gltf" does not exist, the importer generates the "gltf" without considering whether the intermediate data "gltf" needs to be generated.
In the embodiment of the present application, whenever an original resource file is changed, the resource manager deletes a cache file packet corresponding to the resource, and the resource manager only needs to be responsible for generating cache data, and does not need to determine whether the cache data is the latest cache data, thereby achieving the purpose of simplifying the resource processing flow.
S507, receiving the calling operation of calling the target plug-in.
The calling operation can be generated based on a calling instruction of a user.
Specifically, the resource manager may receive a call instruction of a user, and determine a call operation based on the call instruction.
S508, responding to the calling operation, and acquiring the target resource file corresponding to the target plug-in the engine resource package.
Specifically, the resource manager may obtain a target resource file in the engine resource package according to the determined calling operation, the target resource file is imported from the plug-in resource package corresponding to the target plug-in, and the target resource file is preprocessed, so that the resource file may be directly identified and used by the game engine.
The method comprises the steps of responding to calling operation of a target plug-in to obtain a target resource file corresponding to the target plug-in a game engine package; meanwhile, the target plug-in is configured with a corresponding plug-in resource package which is independent from the project resource package for storing the original project resource; according to the method and the device, resources are respectively led into the engine resource package based on the plug-in resource package and the project resource package, and the bug probability in the development process of the target plug-in is reduced; in addition, aiming at the condition that the target plug-in needs to dynamically register resources, the resource manager supports the simultaneous starting of a plurality of plug-in resource packages, and the target plug-in is configured with independent plug-in resource packages, so that the aim of isolating the plug-in resources from the original project resources is fulfilled. Compared with the prior art that newly added resources often influence the processing logic of original project resources in the importing process, the method and the system enhance the adaptability of the target plug-in and the game engine, improve the development efficiency of the game plug-in and reduce the development cost.
An embodiment of the present application provides a resource processing apparatus, and as shown in fig. 6, the resource processing apparatus 60 may include: a receiving module 601 and an obtaining module 602;
the receiving module 601 is configured to receive a calling operation for calling a target plug-in;
an obtaining module 602, configured to obtain, in response to a call operation, a target resource file corresponding to a target plug-in an engine resource package; the target resource file is imported from a plug-in resource package corresponding to the target plug-in; project resource files in the engine resource package are imported from the project resource package.
The embodiment of the present application provides a possible implementation manner, and the apparatus further includes an importing module, configured to:
starting a target plug-in;
scanning the plug-in resource package, and determining an original resource file to be imported;
and importing the original resource file to be imported into the engine resource package.
In an embodiment of the present application, a possible implementation manner is provided, where the apparatus further includes a configuration module, configured to:
correspondingly configuring a plug-in resource packet for each target plug-in; wherein the import priority of the project resource package is higher than the import priority of the plug-in resource package.
The embodiment of the present application provides a possible implementation manner, and the import module is further configured to:
scanning the plug-in resource package to acquire the attribute information of the original resource file;
determining import information corresponding to the plug-in resource package;
and when the attribute information is matched with the import information, taking the original resource file as the original resource file to be imported.
The embodiment of the present application provides a possible implementation manner, and the import module is further configured to:
analyzing an original resource file to be imported according to a preset format to generate a target resource file;
and saving the target resource file into the engine resource package.
The embodiment of the present application provides a possible implementation manner, and the apparatus further includes a deleting module, configured to:
and when receiving a closing notification aiming at the target plug-in, deleting the plug-in resource packet corresponding to the target plug-in.
In an embodiment of the present application, a possible implementation manner is provided, and the apparatus further includes a cache module, configured to:
each plug-in resource package is correspondingly configured with a cache file package, and when cache data exist correspondingly in the plug-in resource package, the cache data are stored in the engine resource package and the cache file package; the cache data comprises at least one of intermediate data and temporary data generated by the plug-in resource package when the resource is imported.
The apparatus of the embodiment of the present application may execute the method provided by the embodiment of the present application, and the implementation principle is similar, the actions executed by the modules in the apparatus of the embodiments of the present application correspond to the steps in the method of the embodiments of the present application, and for the detailed functional description of the modules of the apparatus, reference may be specifically made to the description in the corresponding method shown in the foregoing, and details are not repeated here.
The method comprises the steps of responding to calling operation of a target plug-in to obtain a target resource file corresponding to the target plug-in a game engine package; meanwhile, the target plug-in is configured with a corresponding plug-in resource package which is independent from the project resource package for storing the original project resource; the method and the device have the advantages that resources are respectively led into the engine resource package based on the plug-in resource package and the project resource package, so that the bug (program error) probability in the development process of the target plug-in is reduced; in addition, aiming at the condition that the target plug-in needs to dynamically register resources, the target plug-in is configured with an independent plug-in resource package, so that the purpose of isolating the plug-in resources from the original project resources is achieved. Compared with the prior art that newly added resources often influence the processing logic of original project resources in the importing process, the method and the system enhance the adaptability of the target plug-in and the game engine, improve the development efficiency of the game plug-in and reduce the development cost.
The embodiment of the application provides an electronic device, which comprises a memory, a processor and a computer program stored on the memory, wherein the processor executes the computer program to realize the steps of the resource processing method, and compared with the related art, the method can realize the following steps: the method comprises the steps of responding to calling operation of a target plug-in to obtain a target resource file corresponding to the target plug-in a game engine package; meanwhile, the target plug-in is configured with a corresponding plug-in resource package which is independent from the project resource package for storing the original project resource; according to the method and the device, resources are respectively led into the engine resource package based on the plug-in resource package and the project resource package, so that the probability of bug (program error) in the development process of the target plug-in is reduced; in addition, aiming at the condition that the target plug-in needs to dynamically register resources, the target plug-in is configured with an independent plug-in resource package, so that the aim of isolating the plug-in resources from the original project resources is fulfilled. Compared with the prior art that newly added resources often influence the processing logic of original project resources in the importing process, the method and the system enhance the adaptability of the target plug-in and the game engine, improve the development efficiency of the game plug-in and reduce the development cost.
In an alternative embodiment, an electronic device is provided, as shown in fig. 7, the electronic device 700 shown in fig. 7 comprising: a processor 701 and a memory 703. The processor 701 is coupled to a memory 703, such as via a bus 702. Optionally, the electronic device 700 may further include a transceiver 704, and the transceiver 704 may be used for data interaction between the electronic device and other electronic devices, such as transmission of data and/or reception of data. It should be noted that the transceiver 704 is not limited to one in practical applications, and the structure of the electronic device 700 is not limited to the embodiment of the present application.
The Processor 701 may be a CPU (Central Processing Unit), a general purpose Processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (field programmable Gate Array) or other programmable logic device, a transistor logic device, a hardware component, or any combination thereof. Which may implement or perform the various illustrative logical blocks, modules, and circuits described in connection with the disclosure. The processor 701 may also be a combination of computing functions, e.g., comprising one or more microprocessors, DSPs, and combinations of microprocessors, and the like.
Bus 702 may include a path that transfers information between the above components. The bus 702 may be a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus 702 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 7, but this is not intended to represent only one bus or type of bus.
The Memory 703 may be a ROM (Read Only Memory) or other type of static storage device that can store static information and instructions, a RAM (Random Access Memory) or other type of dynamic storage device that can store information and instructions, an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact disk Read Only Memory) or other optical disk storage, optical disk storage (including Compact disk, laser disk, optical disk, digital versatile disk, blu-ray disk, etc.), a magnetic disk storage medium, other magnetic storage devices, or any other medium that can be used to carry or store a computer program and that can be Read by a computer, without limitation.
The memory 703 is used for storing computer programs for executing the embodiments of the present application, and is controlled by the processor 701 to execute. The processor 701 is adapted to execute a computer program stored in the memory 703 to implement the steps shown in the foregoing method embodiments.
Among them, electronic devices include but are not limited to: mobile terminals such as mobile phones, notebook computers, PADs, etc. and fixed terminals such as digital TVs, desktop computers, etc.
Embodiments of the present application provide a computer-readable storage medium, on which a computer program is stored, and when being executed by a processor, the computer program may implement the steps and corresponding contents of the foregoing method embodiments.
Embodiments of the present application provide a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device realizes the following when executed:
receiving a calling operation for calling a target plug-in;
responding to the calling operation, and acquiring a target resource file corresponding to the target plug-in the engine resource package; the target resource file is imported from a plug-in resource package corresponding to the target plug-in; project resource files in the engine resource package are imported from the project resource package.
The terms "first," "second," "third," "fourth," "1," "2," and the like in the description and in the claims of the present application and in the above-described drawings (if any) are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It should be understood that the data so used are interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in other sequences than illustrated or otherwise described herein.
It should be understood that, although each operation step is indicated by an arrow in the flowchart of the embodiment of the present application, the implementation order of the steps is not limited to the order indicated by the arrow. In some implementation scenarios of the embodiments of the present application, the implementation steps in the flowcharts may be performed in other sequences as desired, unless explicitly stated otherwise herein. In addition, some or all of the steps in each flowchart may include multiple sub-steps or multiple stages based on an actual implementation scenario. Some or all of these sub-steps or stages may be performed at the same time, or each of these sub-steps or stages may be performed at different times, respectively. In a scenario where execution times are different, an execution sequence of the sub-steps or the phases may be flexibly configured according to requirements, which is not limited in the embodiment of the present application.
The foregoing is only an optional implementation manner of a part of implementation scenarios in this application, and it should be noted that, for those skilled in the art, other similar implementation means based on the technical idea of this application are also within the protection scope of the embodiments of this application without departing from the technical idea of this application.

Claims (10)

1. A method for processing resources, comprising:
receiving a calling operation for calling a target plug-in;
responding to the calling operation, and acquiring a target resource file corresponding to the target plug-in the engine resource package; the target resource file is imported from a plug-in resource package corresponding to the target plug-in; and importing the project resource file in the engine resource package from the project resource package.
2. The method according to claim 1, wherein the process of importing the original resource file in the plug-in resource package into the engine resource package comprises:
starting the target plug-in;
scanning the plug-in resource package, and determining an original resource file to be imported;
and importing the original resource file to be imported into the engine resource package.
3. The method of claim 1, further comprising:
correspondingly configuring a plug-in resource packet for each target plug-in; wherein the import priority of the project resource package is higher than the import priority of the plug-in resource package.
4. The method of claim 2, wherein the scanning the plug-in resource package to determine an original resource file to be imported comprises:
scanning the plug-in resource package to acquire the attribute information of the original resource file;
determining import information corresponding to the plug-in resource package;
and when the attribute information is matched with the import information, taking the original resource file as the original resource file to be imported.
5. The method according to claim 2, wherein importing the original resource file to be imported into the engine resource package comprises:
analyzing the original resource file to be imported according to a preset format to generate a target resource file;
and saving the target resource file into the engine resource package.
6. The method of claim 1, further comprising:
and when receiving a closing notification aiming at the target plug-in, deleting the plug-in resource packet corresponding to the target plug-in.
7. The method of claim 3, further comprising:
each plug-in resource package is correspondingly configured with a cache file package, and when cache data exist correspondingly in the plug-in resource package, the cache data are stored in the engine resource package and the cache file package; the cache data comprises at least one of intermediate data and temporary data generated by the plug-in resource packet when the resource is imported.
8. A resource processing apparatus, comprising:
the receiving module is used for receiving the calling operation of calling the target plug-in;
the obtaining module is used for responding to the calling operation and obtaining a target resource file corresponding to the target plug-in the engine resource package; the target resource file is imported from a plug-in resource package corresponding to the target plug-in; and importing the project resource file in the engine resource package from the project resource package.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory, characterized in that the processor executes the computer program to implement the steps of the method of any of claims 1-7.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
CN202210112291.8A 2022-01-29 2022-01-29 Resource processing method and device, electronic equipment and computer readable storage medium Pending CN114443306A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202210112291.8A CN114443306A (en) 2022-01-29 2022-01-29 Resource processing method and device, electronic equipment and computer readable storage medium
PCT/CN2023/073636 WO2023143545A1 (en) 2022-01-29 2023-01-29 Resource processing method and apparatus, electronic device, and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210112291.8A CN114443306A (en) 2022-01-29 2022-01-29 Resource processing method and device, electronic equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN114443306A true CN114443306A (en) 2022-05-06

Family

ID=81371216

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210112291.8A Pending CN114443306A (en) 2022-01-29 2022-01-29 Resource processing method and device, electronic equipment and computer readable storage medium

Country Status (2)

Country Link
CN (1) CN114443306A (en)
WO (1) WO2023143545A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023143545A1 (en) * 2022-01-29 2023-08-03 厦门雅基软件有限公司 Resource processing method and apparatus, electronic device, and computer-readable storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10104086B2 (en) * 2015-04-24 2018-10-16 Oracle International Corporation Techniques for fine grained protection of resources in an access management environment
CN113157306A (en) * 2021-04-16 2021-07-23 上海米哈游璃月科技有限公司 Resource packaging management method, device, equipment and storage medium
CN113076122B (en) * 2021-04-16 2024-08-09 上海米哈游璃月科技有限公司 Resource file management method, device, equipment and storage medium
CN113101643B (en) * 2021-04-16 2024-08-13 上海米哈游璃月科技有限公司 Resource file management method, device, equipment and storage medium
CN114443306A (en) * 2022-01-29 2022-05-06 厦门雅基软件有限公司 Resource processing method and device, electronic equipment and computer readable storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023143545A1 (en) * 2022-01-29 2023-08-03 厦门雅基软件有限公司 Resource processing method and apparatus, electronic device, and computer-readable storage medium

Also Published As

Publication number Publication date
WO2023143545A1 (en) 2023-08-03

Similar Documents

Publication Publication Date Title
CN109542399B (en) Software development method and device, terminal equipment and computer readable storage medium
CN113065656B (en) Rule engine configuration method and device, server and readable storage medium
CN108228188A (en) A kind of view component processing method, electronic equipment and readable storage medium storing program for executing
CN107526623B (en) Data processing method and device
CN110471701B (en) Image rendering method and device, storage medium and electronic equipment
EP4300303A1 (en) Animation resource information processing method and apparatus, device, medium and product
CN112817657A (en) Application program starting item loading method, device and system and storage medium
CN110599581B (en) Image model data processing method and device and electronic equipment
WO2023143545A1 (en) Resource processing method and apparatus, electronic device, and computer-readable storage medium
CN110806913A (en) Webpage screenshot method, device and equipment
CN113391811A (en) Function compiling method and device, electronic equipment and computer readable storage medium
CN110619204A (en) Invitation code generation method and device, terminal equipment and storage medium
CN114040189A (en) Multimedia test method, device, storage medium and electronic equipment
CN111813407B (en) Game development method, game running device and electronic equipment
CN113220446A (en) Image or video data processing method and terminal equipment
CN117065357A (en) Media data processing method, device, computer equipment and storage medium
CN113805854A (en) Method, system and device for realizing Hook of application layer based on Linux system and storage medium
CN116204201B (en) Service processing method and device
CN113849157B (en) Animation playing management method, device, equipment and storage medium
CN116824018B (en) Rendering abnormality detection method and device, storage medium and electronic equipment
CN118605883A (en) Metadata analysis method, device, equipment and medium
CN117235318A (en) Data processing method, device, electronic equipment and readable storage medium
CN118708225A (en) Configuration method of application system, data processing method and related device
CN115421650A (en) Data storage method and device, electronic equipment and storage medium
CN118642704A (en) Method and device for realizing Bean object copying based on Cglib

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