A method for batch setting of game resources and an electronic device
Setting the sub-configuration item rules for game resources in batches through the graphical interface solves the complex problems of art resource management and configuration in game development, improves game performance and stability, and reduces the development burden of developers.
Patent Information
- Application Number
- CN202410327965.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-21
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2044-03-21
AI Technical Summary
In modern game development, as the number of art resources increases, developers need to spend a lot of time manually configuring and managing these resources, resulting in an increase in development burden and may lead to problems in the game running, affecting game performance and stability.
Provides a batch setting method for game resources, selecting label types through a graphical interface, configuring local variables, setting game configuration paths, refreshing unconfigured information, selecting game resource types, reading the current rules, and batch setting of all sub-configuration items rules under game resource types according to the rules.
By setting sub-configuration items rules for art resources in batches, avoid missed settings, improve game performance and stability, and reduce the development burden of developers.
Smart Images

Figure CN118059478B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of game development, and in particular, to a method for batch setting of game resources and an electronic device. Background Art
[0002] In modern game development, the management and configuration of art resources is an important and complex task. As the scale of the project expands, the number of art resources will increase sharply, and developers need to spend a lot of time manually configuring and managing these art resources.
[0003] For each type of art resource, developers may need to set its attributes separately, such as resource type and resource size. In addition, when new art resources are added to the project, developers need to reconfigure them, thus increasing the development burden on developers. If a developer neglects the setting of a certain art resource during the configuration process, problems may occur with this art resource during game operation, thereby affecting the performance and stability of the game.
[0004] Therefore, a method is needed that can uniformly configure art resources according to set rules, thereby improving the performance and stability of the game. Summary of the Invention
[0005] To overcome the problems existing in the related art, one of the objectives of the present invention is to provide a method for batch setting of game resources, which can uniformly configure art resources according to set rules, thereby improving the performance and stability of the game.
[0006] A method for batch setting of game resources includes:
[0007] Open a graphical interface and select a label type;
[0008] If the interaction option is not in the interface element protection period, configure local variables corresponding to the interface element; click on the interaction option, and if the interaction option is a configuration option, select a resource rule type;
[0009] Set the game configuration path and refresh the unconfigured information; the game configuration path corresponds to the label type;
[0010] Select the game resource type and read the current rule corresponding to the game configuration path;
[0011] According to the current rule, batch set the rules of all sub-configuration items under the game resource type.
[0012] In a preferred technical solution of the present invention, the refreshing of the unconfigured information includes:
[0013] Detect whether game resources are imported into the project. If so, traverse all the game resources in the specified directory;
[0014] Filter out the game resources not selected by the game configuration path to obtain unconfigured resources;
[0015] Display the unconfigured resources in the statistics information list.
[0016] In a preferred technical solution of the present invention, after clicking the interaction option, it further includes:
[0017] If the interaction option is rule setting, set the rule name;
[0018] Set the game resource path according to the rule name;
[0019] Display the resource configuration items according to the game resource types under the game resource path.
[0020] In a preferred technical solution of the present invention, after setting the rule name, it further includes:
[0021] Set a regular expression;
[0022] Use the regular expression to verify the rule name;
[0023] If the rule name passes the verification, keep the rule name unchanged;
[0024] If the rule name fails to pass the verification, modify the rule name.
[0025] In a preferred technical solution of the present invention, after setting the game resource path according to the rule name, it further includes:
[0026] Select the current folder path;
[0027] Click the path add button of the text box of the game resource path to add the current folder path.
[0028] In a preferred technical solution of the present invention, after clicking the interaction option, it further includes:
[0029] If the interaction option is a statistics information option, display the name of the game resource;
[0030] Display the attributes of the game resource.
[0031] In a preferred technical solution of the present invention, after displaying the attributes of the game resource, it further includes:
[0032] Detect whether the attributes of the game resource meet the expected settings;
[0033] If not, display the attributes of the game resources that do not meet the expected settings in red.
[0034] In a preferred technical solution of the present invention, before selecting the resource rule type, it further includes:
[0035] Add the resource rule type;
[0036] Modify the resource rule type;
[0037] Delete the resource rule type.
[0038] In a preferred technical solution of the present invention, the label types include FBX file labels and texture map file labels.
[0039] The second object of the present invention is to provide an electronic device, including:
[0040] A processor; and
[0041] A memory, on which executable code is stored, and when the executable code is executed by the processor, the processor is caused to execute the above-mentioned game resource batch setting method.
[0042] The beneficial effects of the present invention are:
[0043] A game resource batch setting method provided by the present invention includes opening a graphical interface and selecting a label type. The graphical interface supports multiple label types, and different label types correspond to game resources in different formats. If the interaction option is not in the interface element protection period, configure local variables corresponding to the interface element. Click the interaction option. If the interaction option is a configuration option, select the resource rule type. Set the game configuration path and refresh the unconfigured information. The game configuration path corresponds to the label type. Select the game resource type and read the current rule corresponding to the game configuration path. The current rule corresponds to the game resource type, and the above method supports multiple game resource types. According to the current rule, batch set the rules of all sub-configuration items under the game resource type. Batch setting can avoid missing the setting of one or several game resources, set unified sub-configuration item rules for the same type of game resources, thereby improving the performance and stability of the game, and reducing the development burden of developers. Description of the Drawings
[0044] Figure 1 is a flowchart of the game resource batch setting method provided by the present invention;
[0045] Figure 2 is a flowchart of the rule setting provided by the present invention;
[0046] Figure 3It is a schematic flowchart of the statistical information provided by the present invention. Detailed implementation manners
[0047] The preferred implementation manners of the present invention will be described in more detail below with reference to the accompanying drawings. Although the preferred implementation manners of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the implementation manners set forth herein. On the contrary, these implementation manners are provided to make the present invention more thorough and complete, and to fully convey the scope of the present invention to those skilled in the art.
[0048] Example 1
[0049] As Figure 1 shown, this embodiment provides a method for batch setting of game resources, including:
[0050] S1: Open the graphical interface and select the label type.
[0051] The label types include FBX file labels and texture map file labels. The FBX file label supports resources with the suffix.fbx, and the texture map file label supports resources with the suffixes.png and.jpg.
[0052] Open the graphical interface. At the top of the graphical interface, there are options for FBX file labels and texture map file labels. Select the FBX file label or the texture map file label.
[0053] S2: If the interaction option is not in the interface element protection period, configure local variables corresponding to the interface element; click on the interaction option. If the interaction option is a configuration option, then select the resource rule type.
[0054] The graphical interface has three modules, namely the configuration option module, the rule setting module, and the statistical information module. Click on the interaction option. If the interaction option is a configuration option, then select the resource rule type. The resource rule types include scene resources, character resources, special effect resources, and UI resources. All resource rule types are saved in the Json format for easy modification and adjustment. After saving the resource rule type for the first time, read the configuration initialization tool from the resource tool configuration file under the path.
[0055] Since after clicking on the interaction option, the game configuration path will be set, the game resource type will be selected, and all sub-configuration item rules under the game resource type will be batch set. Batch setting all sub-configuration item rules under the game resource type will consume a relatively large amount of computing resources. If the user frequently interacts with the interface elements in the graphical interface, such as the option box corresponding to the interaction option, or the option box corresponding to batch setting all sub-configuration item rules under the game resource type, it may cause the background program of the graphical interface to malfunction, such as getting into an infinite loop or terminating abnormally.
[0056] Detect whether the interactive option is in the interface element protection period, that is, detect the time interval from the current moment to the last time the user clicks the interactive option. If the time interval is less than or equal to the time interval threshold, it is determined that the interactive option is not in the interface element protection period, and a local variable is configured. The local variable is a variable related to the interactive option. If the time interval is greater than the time interval threshold, it is determined that the interactive option is in the interface element protection period, and the background of the graphical interface does not respond to the user's operation of clicking the interactive option.
[0057] Configuring local variables can change the colors and positions of some interface elements, such as the option boxes corresponding to interactive options, thereby highlighting some interface elements. Setting the interface element protection period and detecting whether the interactive option is in the interface element protection period can prevent failures in the background program of the graphical interface.
[0058] Preferably, detect whether the option boxes corresponding to the game configuration path, the game resource type, and the batch setting are in the interface element protection period, and configure local variables corresponding to the interface elements.
[0059] S3: Set the game configuration path and refresh the unconfigured information; the game configuration path corresponds to the label type.
[0060] Select the game resource directory to be set. Refreshing the unconfigured information means that whenever a new game resource is imported into the project, the system will automatically perform a refresh operation.
[0061] S4: Select the game resource type and read the current rule corresponding to the game configuration path.
[0062] The game resource types include scene resources, character resources, special effect resources, and UI resources. Each game resource type may have multiple sub-configuration item rules. Therefore, there can be multiple sub-configuration items under a game resource type, and each sub-configuration item can have its own settings. For example, for the "character resource" game resource type, multiple sub-configuration item rules are set to configure different types of character resources, such as the protagonist, NPC, or enemy. Each type of character resource can have different model settings, material settings, and / or animation settings, etc.
[0063] Developers can add, delete, and rename game resource types in the graphical interface. After selecting the game resource type, click the Execute Current Rule button to read the current rule corresponding to the game configuration path.
[0064] S5: Batch-set all sub-configuration item rules under the game resource type according to the current rule.
[0065] After reading the current rules corresponding to the game configuration path, according to the current rules, batch set the rules of all sub-configuration items under the game resource type. Batch setting can avoid missing the setting of one or several game resources, set unified sub-configuration item rules for the same type of game resources, thereby improving the performance and stability of the game, and reducing the development burden of developers. The game resources in this embodiment can be game art resources or other resources, which are not limited here.
[0066] Preferably, the configuration option module further includes an option for automatic setting during import. If the developer checks this option, when importing the game resource, search for the game configuration path of the newly imported game resource. If the configuration file already contains this game configuration path, use the current rules corresponding to the game configuration path to set the game resource.
[0067] A method for batch setting game resources provided in this embodiment includes opening a graphical interface and selecting a label type. The graphical interface supports multiple label types, and different label types correspond to game resources in different formats. If the interaction option is not in the interface element protection period, configure local variables corresponding to the interface elements. Click the interaction option. If the interaction option is a configuration option, select a resource rule type. Set the game configuration path, refresh the unconfigured information, and the game configuration path corresponds to the label type. Select the game resource type, and read the current rules corresponding to the game configuration path. The current rules correspond to the game resource type, and the above method supports multiple game resource types. According to the current rules, batch set the rules of all sub-configuration items under the game resource type. Batch setting can avoid missing the setting of one or several game resources, set unified sub-configuration item rules for the same type of game resources, thereby improving the performance and stability of the game, and reducing the development burden of developers.
[0068] Embodiment 2
[0069] This embodiment only describes the differences from Embodiment 1. The refreshing of the unconfigured information includes:
[0070] S32: Detect whether there are game resources imported into the project. If so, traverse all the game resources in the specified directory.
[0071] S33: Screen out the game resources not selected by the game configuration path to obtain unconfigured resources.
[0072] S34: Display the unconfigured resources in the statistical information list.
[0073] Before step S32, it further includes step S31: Set the game configuration path.
[0074] Whenever new game resources are imported into the project, the system will automatically perform a refresh operation. It traverses all resources of this type in the directory, filters out the game resources not covered by the game configuration path, and displays this type of game resources in the statistics list.
[0075] As Figure 2 shown, after clicking the interaction option, it further includes:
[0076] S31’: If the interaction option is rule setting, set the rule name.
[0077] S32’: Set the game resource path according to the rule name.
[0078] S33’: Display the resource configuration items according to the game resource type under the game resource path.
[0079] If the interaction option is rule setting, set the rule name in the rule setting module of the graphical interface. The rule setting module includes options for adding, deleting, and adjusting positions. Click the add option to add a rule; click the delete option to delete a rule; first select a rule, and then click the position adjustment option to move the selected rule up and down.
[0080] The resource path also supports addition and deletion operations. Each resource configuration item contains one or more resource paths. After setting the rule name and the game resource path, click the refresh statistics button to display the resource attributes and the current settings of the file names that match the regular expression under the resource path.
[0081] After setting the rule name, it further includes:
[0082] S34’: Set the regular expression.
[0083] S35’: Use the regular expression to verify the rule name.
[0084] S36’: If the rule name passes the verification, keep the rule name unchanged.
[0085] S37’: If the rule name fails the verification, modify the rule name.
[0086] A regular expression is a string used to describe and match text patterns. Regular expressions can be used to retrieve and replace text that conforms to specific rules. Regular expressions are composed of ordinary characters and special characters. Ordinary characters include letters from a to z.
[0087] Regular expression (optional). After filling it in, the rule name needs to satisfy the regular expression. When the rule name passes the verification, the rule name remains unchanged. When the rule name fails the verification, the rule name is modified. By using regular expressions, specific types of resources can be located, and then batch settings can be made according to the preset configuration, improving the efficiency of game development.
[0088] After setting the game resource path according to the rule name, it further includes:
[0089] S38’: Select the current folder path.
[0090] S39’: Click the path addition button of the text box of the game resource path to add the current folder path.
[0091] Clicking the button of the path text box can quickly add the currently selected folder path. The resource configuration items correspond to the common settings in the resource property panel and are configured according to actual needs, supporting the display of all or part of the property items of the current game resource.
[0092] The resource configuration items include import morphology target, mesh compression, read / write enable, optimize mesh, enable generation of lightmap UVs, animation type, import animation, and import material.
[0093] Import morphology target: If the model contains BlendShapes, i.e., morphology targets, developers are allowed to import BlendShapes, which are usually used for animations, especially facial expressions.
[0094] Mesh compression: Set the level of mesh compression. Compressing the mesh can reduce the amount of memory used by the mesh, but may reduce the quality of the model.
[0095] Read / write enable: If this option is enabled, developers can modify the vertex data of the mesh at runtime through scripts. If there is no need to modify the mesh data, disabling this option can save memory.
[0096] Optimize mesh: Enabling this option will rearrange the vertices and triangles of the mesh, thereby improving the rendering performance.
[0097] Enable generation of lightmap UVs: If developers plan to use lightmaps on the model, this option will generate a second set of UVs for lightmaps to avoid baking problems with lightmaps. The UV information determines how the 2D texture is mapped onto the 3D model, affecting the visual effect of the 3D model.
[0098] Animation Type: If the model does not contain animations, select "None"; if it involves the legacy animation system, select "Legacy"; if it involves the generic animation system, select "Generic"; if it is an animation system for humanoid characters and allows the use of Unity's Mecanim animation system for humanoid animation redirection and other advanced features, select "Humanoid".
[0099] Import Animations: If the model contains animations, this option allows developers to import these animations. Developers can choose to import all animations or specific animation clips.
[0100] Import Materials: This option allows developers to import the model's materials and related textures. Developers can choose to create new Unity materials or try to match existing Unity materials.
[0101] As an example, there is a series of 3D model resources that need to be configured to better integrate the 3D model resources into the game. Create a rule with the rule name CharacterOptimization. Set the resource path to Path A and the regular expression to Expression One. In the resource configuration item, set the import morph targets to False, the mesh compression to Medium, the read / write enable to False, the optimize mesh to True; set the generate lightmap UVs enabled to True, the animation type to Humanoid, i.e., humanoid characters. If the 3D model contains animations, set the import animations to True. If the external materials are already set up, set the import materials to True.
[0102] In this embodiment, if the interaction option is rule setting, set the rule name. Set the game resource path according to the rule name. Display the resource configuration item according to the game resource type under the game resource path. The resource configuration item supports displaying all property items or some property items of the current game resource. The resource configuration item includes import morph targets, mesh compression, read / write enable, optimize mesh, generate lightmap UVs enabled, animation type, import animations, and import materials. Fill in the regular expression, verify the rule name according to the regular expression, and modify the rule name that fails the verification.
[0103] Embodiment 3
[0104] As Figure 3 shown, this embodiment only describes the differences from Embodiment 1. After clicking the interaction option, it further includes:
[0105] S31": If the interaction option is the statistics information option, display the name of the game resource.
[0106] "S32": Display the attributes of the game resources.
[0107] Click on the statistics option in the graphical interface to enter the statistics module, which displays the total number of statistical resources and the settings of a certain type of game resources. The settings of the new game resources after batch setting will also be reflected in the table of the total number of statistical resources, and modifying the configuration items will be refreshed in real time.
[0108] After displaying the attributes of the game resources, it further includes:
[0109] "S33": Detect whether the attributes of the game resources meet the expected settings;
[0110] "S34": If not, display the attributes of the game resources that do not meet the expected settings in red.
[0111] Display the options that do not meet the expected settings in red, so that developers can discover and fix problems in a timely manner.
[0112] Before selecting the resource rule type, it further includes:
[0113] "S11'": Add the resource rule type.
[0114] "S12'": Modify the resource rule type.
[0115] "S13'": Delete the resource rule type.
[0116] By adding, modifying, and deleting the resource rule types, the resource rule types can be adjusted according to the development needs. The resource rule types include scene resources, character resources, special effect resources, and UI resources. Each resource rule type includes one or more sub-configuration items, and each sub-configuration item can have its own settings.
[0117] After clicking the interaction option in this embodiment, it further includes that if the interaction option is the statistics option, display the name of the game resources and display the attributes of the game resources. After displaying the attributes of the game resources, it further includes: Detect whether the attributes of the game resources meet the expected settings. If not, display the attributes of the game resources that do not meet the expected settings in red, so that developers can discover and fix problems in a timely manner.
[0118] Embodiment 4
[0119] This embodiment provides an electronic device, which includes a memory and a processor.
[0120] The processor can be a Central Processing Unit (CPU), or can also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate Arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.
[0121] The memory can include various types of storage units, such as system memory, read-only memory (ROM), and permanent storage devices.
[0122] Executable code is stored on the memory, and when the executable code is processed by the processor, it can cause the processor to execute some or all of the game resource batch setting methods described above.
[0123] Unless otherwise specifically stated, the relative arrangements of components and steps, numerical expressions, and numerical values set forth in these embodiments do not limit the scope of the present application. In all the examples shown and discussed here, any specific value should be construed as merely exemplary, rather than as a limitation. Therefore, other examples of the exemplary embodiments may have different values. It should be noted that like reference numerals and letters denote like items in the following figures, and thus, once an item is defined in one figure, it does not need to be further discussed in subsequent figures.
[0124] It should be understood that the spatially relative terms are intended to encompass different orientations in use or operation in addition to the orientation depicted in the figures of the device. For example, if the device in the figures is inverted, the device described as "above" or "on top of" other devices or structures will then be oriented "below" or "beneath" the other devices or structures. Thus, the exemplary term "above" can include both orientations of "above" and "below". The device can also be oriented in other different ways (rotated 90 degrees or at other orientations), and the spatially relative descriptions used herein are to be interpreted accordingly.
[0125] In addition, it should be noted that the use of terms such as "first" and "second" to limit components is only for the convenience of distinguishing the corresponding components. Without otherwise stating, the above terms have no special meanings, and thus, should not be construed as limiting the protection scope of the present application.
[0126] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. A method for batch setting of game resources, characterized in that: include: Open the graphical interface and select the tag type; the tag type includes FBX file tags and texture file tags; Detect whether the interactive option is in the interface element protection period, that is, detect the time interval between the current moment and the last time the user clicked the interactive option. If the time interval is less than or equal to the time interval threshold, it is determined that the interactive option is not in the interface element protection period; If the interactive option is not in the interface element protection period, configure the local variable corresponding to the interface element; Click the interactive option, if the interactive option is a configuration option, select the resource rule type; the local variable is a variable related to the interactive option; if the time interval is greater than the time interval threshold, it is determined that the interactive option is in the interface element protection period, and the background of the graphical interface does not respond to the user's operation of clicking the interactive option; Set the game configuration path and refresh the unconfigured information; the game configuration path corresponds to the tag type; Select the game resource type and read the current rules corresponding to the game configuration path; There are multiple sub-configuration items under a game resource type; According to the current rules, batch set all sub-configuration item rules under the game resource type; The refreshing of unconfigured information includes: Check whether there are any game resources imported into the project. If so, traverse all the game resources in the specified directory; Filter out the game resources that are not selected by the game configuration path to obtain unconfigured resources; Displaying the unconfigured resources in a statistical information list; After clicking the interactive option, the method further includes: If the interactive option is a statistical information option, displaying the name of the game resource; Displays the properties of the game resource.
2. The method for batch setting of game resources according to claim 1, characterized in that: After clicking the interactive option, the method further includes: If the interactive option is a rule setting, then set the rule name; Set the game resource path according to the rule name; Display resource configuration items according to the game resource type under the game resource path.
3. The method for batch setting of game resources according to claim 2, characterized in that: After the setting rule name, it also includes: Set the regular expression; Verifying the rule name using the regular expression; If the rule name passes the verification, the rule name remains unchanged; If the rule name fails to pass the verification, the rule name is modified.
4. The method for batch setting of game resources according to claim 2, characterized in that: After setting the game resource path according to the rule name, the method further includes: Select the current folder path; Click the path add button in the text box of the game resource path to add the current folder path.
5. The method for batch setting of game resources according to claim 4, characterized in that: After displaying the attributes of the game resources, the method further includes: Detecting whether the attributes of the game resources meet the expected settings; If not, the attributes of the game resource that do not meet the expected settings will be displayed in red.
6. The method for batch setting of game resources according to claim 1, characterized in that: Before selecting the resource rule type, the method further includes: Add the resource rule type; Modify the resource rule type; Delete the resource rule type.
7. An electronic device, characterized in that: include: processor; as well as A memory having executable codes stored thereon, which, when executed by the processor, causes the processor to execute the method for batch setting of game resources according to any one of claims 1-6.
Citation Information
Patent Citations
Game resource configuration method and device, and electronic equipment
CN110201397A