A method for managing localized resources of a game client
Through the combination of resource variant package and variant root directory, the problem of resource management difficulties in cross-regional distribution of the game is solved, unified resource management and rapid localization are achieved, and resource localization efficiency and flexibility are improved.
Patent Information
- Application Number
- CN202211285639.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-20
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2042-10-20
AI Technical Summary
When game projects are promoted and released across regions, the localization of resources in each branch area is large and error-prone, and resource management is difficult.
The resource variant package is combined with the variant root directory, and the high-frequency reference resources are directly replaced by the real variant package, the low-frequency reference resources are dynamically loaded, and the basic and variant indexes are generated to achieve unified management and rapid localization of resources.
The unified management and rapid localization of resources in each target region are achieved, the resource mixing is avoided, the resource localization efficiency is improved, and the resource integrity and flexibility are ensured.
Smart Images

Figure CN115562716B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of game software technology, and in particular to a game client localized resource management method. Background Art
[0002] When a game project is promoted and distributed across regions, it is usually developed based on the main version (usually the domestic version) according to the cultural background, customs, regional characteristics and market demand of each region. Therefore, the game resource configuration in different regions will be different, thus forming a resource package that adapts to each branch region. When the game is running, the client localizes the resources by loading the corresponding resource package. With the increase in the number of distribution regions and the continuous upgrading of game versions, the number of times that clients in each branch region need to localize resources has gradually increased, and it is easy to mix resources. The workload of resource localization in each branch region is large and prone to errors, and resource management becomes difficult. Summary of the invention
[0003] In order to solve the above problems, the present invention provides a method for managing localized resources of a game client.
[0004] The present invention adopts the following technical solutions:
[0005] A method for managing localized resources of a game client comprises the following steps:
[0006] S1. Pack all basic resources in the basic game version of the main region into folders to generate corresponding basic resource packages, wherein the basic resources are divided into high-frequency reference resources and low-frequency reference resources;
[0007] S2. Each target sub-region creates a resource variant package for replacing the basic resource package. The resource variant package is divided into a real variant package and a virtual variant package. The real variant package contains characteristic resources exclusive to the target sub-region, and the characteristic resources are used to replace the high-frequency reference resources. The virtual variant package contains the low-frequency reference resources.
[0008] S3. Create a variant root directory according to the reference relationship between the basic resource package and the resource variant package;
[0009] S4. Each target region will package the corresponding resource variant into the game client package as needed;
[0010] S5, generating a basic index according to the correspondence between the basic resource package and the basic resource, and then generating variant indexes for each target region according to the variant root directory;
[0011] S6. When the game is running, the target sub-region first loads the basic index, then loads the variant index corresponding to this region, merges the basic index and the variant index to form the final resource index, and then loads the corresponding resources according to the final resource index to complete the resource localization of this target sub-region.
[0012] Further, both the basic resources and the featured resources are stored in the corresponding folders according to the preset rule paths.
[0013] Further, the name of the resource variant package is formed by adding a suffix to the name of the corresponding basic resource package, and the number of resource files contained in the resource variant package is the same as that of its corresponding basic resource package.
[0014] Further, step S1 also generates a basic resource mapping file, and the basic resource mapping file is used to indicate the path mapping relationship between the basic resource package and its corresponding basic resource.
[0015] Further, step S2 also generates a variant resource mapping file, and the variant resource mapping file is used to indicate the path mapping relationship between the resource package variant and the corresponding featured resource or low-frequency reference resource.
[0016] Further, the variant root directory is divided into several levels. The first-level directory is the resource function type, the second-level directory is the name of the region where the resource belongs, the third-level directory is the name of the basic resource package, and the fourth-level directory is the name of the resource package variant.
[0017] Further, when the basic index and the variant index are merged in step S6, the variant index is compared with the basic index item by item. If the variant index is the same as the basic index, the corresponding basic index is directly replaced with the variant index. If there is a newly added resource index in the variant index, this resource index is added on the basis of the basic index.
[0018] After adopting the above technical solution, compared with the background technology, the present invention has the following advantages:
[0019] The present invention realizes the unified management and rapid localization of resources in each target sub-region by means of the resource variant package combined with the variant root directory. When running, each region finds the corresponding resource loading path through the index to correctly load the resources. For the resources with high-frequency references, the real variant package is directly used to replace the original basic resources. For the resources with low-frequency references, the original basic resources are dynamically loaded in the form of virtual variant packages, so as to realize the flexible combination of local resource requirements. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 It is a flowchart of the method of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0021] In order to make the objectives, technical solutions and advantages of the present invention more clear and understandable, the present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0022] Embodiment
[0023] Resource package: Unity can package various resources used in the game (such as pictures, animations, special effects, texts, etc.) into a resource package (assets bundle). When the client is running, these resource packages can be loaded through the corresponding interfaces, and the resources in the resource packages can be used to take effect in the game.
[0024] Resource package variant: When generating a resource package, a resource package of a certain type variant (i.e., a resource package variant) can be specified to be generated. After generation, a corresponding suffix name will be added to the resource package (such as adding a suffix name of.cn or.en). When there are multiple resource package variants with the same name, only one of them can take effect during the game operation, and the number of files and file names in these resource package variants need to be the same. The effective resource package variant can automatically replace all references in the game with the resources in the resource package variant. For example: When designing the game, the font in one of the resource package variants (such as: font.bundle.cn) is used. After loading another resource package variant (such as: font.bundle.en) during operation, all fonts in the game will be automatically replaced with the fonts in the new resource package variant with the suffix name of en.
[0025] As Figure 1 shown, a method for managing localized resources of a game client includes the following steps:
[0026] S1. Package all the basic resources in the basic game version of the main region into corresponding basic resource packages according to folders. The basic resources are divided into high-frequency reference resources and low-frequency reference resources; for example: resources such as pictures and animations that are less used can be defined as low-frequency reference resources, while resources such as fonts that are widely used and referenced in the game are defined as high-frequency reference resources.
[0027] The name of the resource variant package is formed by adding a suffix name after the name of the corresponding basic resource package, and the number of resource files included in the resource variant package is the same as that of its corresponding basic resource package.
[0028] S2. Create resource variant packages for replacing the basic resource packages in each target sub-region. The resource variant packages are divided into real variant packages and virtual variant packages. The real variant package contains the exclusive characteristic resources of the target sub-region, and the characteristic resources are used to replace the high-frequency reference resources. The virtual variant package contains the low-frequency reference resources.
[0029] Among them, both the basic resources and the characteristic resources are stored in the corresponding folders according to the preset rule paths. Step S1 also generates a basic resource mapping file, which is used to indicate the path mapping relationship between the basic resource package and its corresponding basic resources. Step S2 also generates a variant resource mapping file, which is used to indicate the path mapping relationship between the resource package variant and the corresponding characteristic resources or low-frequency reference resources. When the game runs, according to the basic resource mapping file and the variant resource mapping file, the corresponding resources can be loaded according to the path.
[0030] For high-frequency reference resources, each target sub-region needs to carry out characteristic development and modification according to the local characteristics and the needs of game version development. Therefore, the developed characteristic resources are packaged into a real variant package. When the game runs, in the way of direct replacement, the high-frequency reference resources in the basic version of the main region are replaced by the real variant package; while for low-frequency reference resources, each target sub-region has less modification and change. Therefore, the low-frequency reference resources in the basic version are directly referenced in the way of dynamic loading. Here, although each target sub-region also uses the form of a resource variant package, this resource variant package is actually a virtual resource variant package. The virtual variant package formed by adding a suffix name still points to the basic resources (low-frequency reference resources) although it exists in the form of a resource variant package and no characteristic resources for the target sub-region are developed. Therefore, when the game runs, it is actually the way of dynamically loading the basic resources to realize the localization of resources.
[0031] S3. Create a variant root directory according to the reference relationship between the basic resource package and the resource variant package; the variant root directory is divided into several levels. The first-level directory is the resource function type (such as: voice package, font package, language package, etc.), the second-level directory is the name of the region where the resource belongs (such as: Chinese region, Japanese region, etc.), the third-level directory is the name of the basic resource package, and the fourth-level directory is the name of the resource package variant. In the fourth-level directory, as long as the path is the same as that of the resource file in the basic game version, a corresponding virtual variant package directory will be generated, and a real variant package directory will be generated corresponding to the path of the characteristic resources.
[0032] Creating a variant root directory facilitates the unified management of the basic resource package and the resource variant package. According to the needs of version development, developers can flexibly modify the variant root directory, so as to realize the unified management and flexible modification of the resources in each target sub-region and avoid the situation of resource mixing.
[0033] S4. Each target sub-region packs the corresponding resource variant package into the game client package body according to the needs;
[0034] S5. Generate a basic index according to the correspondence between the basic resource package and the basic resources, and then generate variant indexes for each target sub-region according to the variant root directory respectively;
[0035] S6. When the game runs, the target sub-region first loads the basic index, then loads the variant index corresponding to this region, merges the basic index and the variant index to form the final resource index, and then loads the corresponding resources according to the final resource index to complete the resource localization of this target sub-region.
[0036] When the basic index and the variant index in step S6 are merged, compare the variant index with the basic index item by item. If the variant index is the same as the basic index, directly replace the corresponding basic index with the variant index. If there is a newly added resource index in the variant index, add this resource index on the basis of the basic index. When loading, according to the final resource index, combined with the basic resource mapping file and the variant resource mapping file, the corresponding path can be found and the resources can be loaded.
[0037] Through the solution of this embodiment, different game release regions can use different variant resources. Since the dynamic loading and direct replacement are combined during loading, for each target sub-region, its resource variant package is independent and complete, ensuring the integrity of the resources in this region and avoiding the situation of resource mixing. At the same time, each target sub-region can flexibly determine the frequently referenced resources and infrequently referenced resources according to the local situation. For the resources with low reference frequency, by referencing the same basic resources through the virtual variant package, the efficiency of resource localization can be effectively improved, and it is convenient for each target sub-region to flexibly modify and configure resources.
[0038] As mentioned above, the above is only a preferred specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by those skilled in the art within the technical scope disclosed by the present invention should be covered by the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.
Claims
1. A method for managing localized resources of a game client, characterized in that: It includes the following steps: S1. Pack all the basic resources in the basic game version of the main region into corresponding basic resource packages by folder respectively. The basic resources are divided into high-frequency reference resources and low-frequency reference resources. S2. Create resource variant packages for replacing the basic resource packages in each target sub-region. The resource variant packages are divided into real variant packages and virtual variant packages. The real variant packages contain the exclusive feature resources of the target sub-region, and the feature resources are used to replace the high-frequency reference resources. The virtual variant packages contain the low-frequency reference resources. S3. Create a variant root directory according to the reference relationship between the basic resource packages and the resource variant packages. S4. Each target sub-region packs the corresponding resource variant package into the game client package body as needed. S5. Generate a basic index according to the corresponding relationship between the basic resource packages and the basic resources, and then generate variant indexes for each target sub-region according to the variant root directory. S6. When the game runs, the target sub-region first loads the basic index, then loads the variant index corresponding to this region, merges the basic index and the variant index to form the final resource index, and then loads the corresponding resources according to the final resource index to complete the resource localization of the target sub-region.
2. The method for managing localized resources of a game client according to claim 1, wherein: Both the basic resources and the feature resources are stored in the corresponding folders according to the preset rule paths.
3. The method for managing localized resources of a game client according to claim 2, wherein: The name of the resource variant package is formed by adding a suffix to the name of the corresponding basic resource package, and the number of resource files contained in the resource variant package is the same as that of its corresponding basic resource package.
4. The method for managing localized resources of a game client according to claim 3, wherein: Step S1 also generates a basic resource mapping file, which is used to indicate the path mapping relationship between the basic resource package and its corresponding basic resource.
5. The method for managing localized resources of a game client according to claim 4, wherein: Step S2 also generates a variant resource mapping file, which is used to indicate the path mapping relationship between the resource variant package and the corresponding feature resource or low-frequency reference resource.
6. The method for managing localized resources of a game client according to claim 5, wherein: The variant root directory is divided into several levels. The first-level directory is the resource function type, the second-level directory is the name of the region where the resource belongs, the third-level directory is the name of the basic resource package, and the fourth-level directory is the name of the resource package variant.
7. The method for managing localized resources of a game client according to claim 6, wherein: When the basic index and the variant index are merged in step S6, the variant index is compared with the basic index item by item. If the variant index is the same as the basic index, the variant index is directly used to replace the corresponding basic index. If there are new resource indexes in the variant index, these resource indexes are added on the basis of the basic index.
Citation Information
Patent Citations
Platform package delivery method for generating a plurality of game channel packages based on one key
CN109522030A
Interface switching method and device
CN111061535A