Game resource processing method and device

By constructing and comparing the initial transformation components of prefabricated parts, synchronous updates of prefabricated parts are achieved, solving the problem of low update efficiency in the existing technology, simplifying the implementation process of the game engine, and improving development efficiency.

CN114100142BActive Publication Date: 2024-12-20TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111334843.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-11
Publication Date
2024-12-20
Estimated Expiration
2041-11-11

AI Technical Summary

Technical Problem

The prior art has high code complexity when prefabricated parts are updated, resulting in low update efficiency and lack of effective solutions.

Method used

By building basic prefabs and nested prefabs, comparing the attribute items of the initial transformation component, performing synchronous updates, and synchronizing the data values ​​of nested prefabs with the update transformation component, simplifying the update process.

Benefits of technology

It effectively improves the update efficiency of prefabricated parts, reduces the update time, simplifies the difficulty of implementing the game engine architecture, and improves the efficiency of game development.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114100142B_ABST
    Figure CN114100142B_ABST
Patent Text Reader

Abstract

The present application provides a method and device for processing game resources; it involves cloud technology, and the method includes: constructing a basic prefab and at least one nested prefab according to the initial transformation component of the game object; performing comparison processing on the initial transformation components included in any two of the one basic prefab and the at least one nested prefab to obtain target component attribute items, wherein the attribute names and data values ​​corresponding to the target component attribute items are the same; in response to a component update operation for the initial transformation component included in the basic prefab, updating the initial transformation component included in the basic prefab to obtain an updated transformation component; updating the data value corresponding to the target component attribute item in the initial transformation component included in the nested prefab to the data value corresponding to the target component attribute item in the updated transformation component. Through the present application, the updating efficiency of prefabs can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method and device for processing game resources. Background Art

[0002] With the development of game engine technology, game engines provide game designers with various tools needed to write games, with the aim of enabling game designers to easily and quickly create game programs. In the process of game design, prefabs play a vital role. Prefabs are reusable resource templates used in the process of developing games to accelerate the construction of game scenes. For the update of prefabs, the code complexity of related technologies is relatively high in the process of being implemented through game engines, which seriously affects the update efficiency of prefabs.

[0003] As for how to improve the renewal efficiency of prefabricated parts, there is no effective solution in the relevant technology. Summary of the invention

[0004] The embodiments of the present application provide a method, apparatus, device, computer-readable storage medium, and computer program product for processing game resources, which can improve the updating efficiency of prefabricated parts.

[0005] The technical solution of the embodiment of the present application is implemented as follows:

[0006] The present application embodiment provides a method for processing game resources, including:

[0007] Build a base prefab and at least one nested prefab based on the initial transformation component of the game object;

[0008] Comparing the one basic prefab and any two of the at least one nested prefab with initial transformation components to obtain target component attribute items, wherein the attribute names and data values ​​corresponding to the target component attribute items are the same;

[0009] In response to a component update operation on an initial transformation component included in the basic prefab, updating the initial transformation component included in the basic prefab to obtain an updated transformation component;

[0010] The data value corresponding to the attribute item of the target component in the initial transformation component included in the nested prefab is updated to the data value corresponding to the attribute item of the target component in the update transformation component.

[0011] The present application embodiment provides a device for processing game resources, including:

[0012] A construction module, for constructing a base prefab and at least one nested prefab according to an initial transformation component of a game object;

[0013] A comparison module, used for comparing the one basic prefab and any two of the at least one nested prefab to obtain target component attribute items, wherein the attribute names and data values ​​corresponding to the target component attribute items are the same;

[0014] A first updating module, configured to update the initial transformation component included in the basic prefab in response to a component updating operation on the initial transformation component included in the basic prefab, to obtain an updated transformation component;

[0015] The second updating module is used to update the data value of the target component attribute item in the initial transformation component included in the nested prefab to the data value of the target component attribute item in the updated transformation component.

[0016] An embodiment of the present application provides an electronic device, including:

[0017] A memory for storing executable instructions;

[0018] The processor is used to implement the method for processing game resources provided in the embodiment of the present application when executing the executable instructions stored in the memory.

[0019] An embodiment of the present application provides a computer-readable storage medium storing executable instructions for causing a processor to execute and implement the method for processing game resources provided in the embodiment of the present application.

[0020] The embodiment of the present application provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the above-mentioned method for processing game resources in the embodiment of the present application.

[0021] The embodiments of the present application have the following beneficial effects:

[0022] Since the initial transformation components included in the basic prefab and the nested prefab include target component attribute items with the same attribute names and data values, by constructing the basic prefab and the nested prefab, after updating the initial transformation components in the basic prefab, the data values ​​of the corresponding target component attribute items in the initial transformation components included in the nested prefab can be synchronously updated, thereby realizing the synchronous update of the basic prefab and the nested prefab, effectively saving the update time of the nested prefab, and thus effectively improving the update efficiency of the prefab. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1It is a structural diagram of the system architecture for processing game resources provided in an embodiment of the present application;

[0024] Figure 2 is a structural diagram of a device for processing game resources provided in an embodiment of the present application;

[0025] Figure 3A-3E It is a flowchart of a method for processing game resources provided in an embodiment of the present application;

[0026] Figure 4A-4F It is a schematic diagram of the principle of the method for processing game resources provided in the embodiment of the present application;

[0027] Figure 5A-5J It is a schematic diagram of the principle of the method for processing game resources provided in an embodiment of the present application. DETAILED DESCRIPTION

[0028] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of this application.

[0029] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0030] In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described here can be implemented in an order other than that illustrated or described here.

[0031] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0032] Before further describing the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.

[0033] 1) Game engine: refers to some pre-written editable computer game systems or core components of some interactive real-time graphics applications. These systems provide game designers with various tools needed to write games, with the aim of allowing game designers to easily and quickly create game programs without starting from scratch. Most of them support multiple operating platforms, such as Linux, Mac OS X, and Microsoft Windows. Game engines include the following systems: rendering engine (i.e. "renderer", including 2D graphics engine and 3D graphics engine), physics engine, collision detection system, sound effects, script engine, computer animation, artificial intelligence, network engine, and scene management.

[0034] 2) Game Object: It is a container for all components. All objects in the game are essentially game objects. Game objects themselves do not add any features to the game, but are containers for components that implement actual functions.

[0035] 3) Prefab: Also known as game prefab, it is a type of game resource, a reusable game object stored in the project view. It is a reusable resource template composed of one or more game objects or entities, used to speed up the construction of game scenes.

[0036] 4) Prefab Instance: A game object quickly created using prefabs in the game editor.

[0037] 5) Base prefab: a prefab that does not contain a prefab instance.

[0038] 6) Nested prefab: a prefab that contains a prefab instance. The nested prefab is based on the base prefab and has a nested relationship with the base prefab. The nested prefab includes the prefab instance of the base prefab.

[0039] 7) Game engine editor: including scene editor, particle special effect editor, model browser, animation editor and material editor, etc. Among them, the scene editor is responsible for placing model objects, light sources, cameras, etc.; the particle special effect editor is used to make various game special effects; the animation editor is used to edit animation functions and can trigger certain events in the game logic; the material editor is used to edit model effects.

[0040] 8) Games: Also known as video games, they refer to all interactive games that run on electronic equipment platforms. They are divided into five categories based on the different running media: console games (in a narrow sense, specifically referring to home console games), handheld games, arcade games, computer games, and mobile games.

[0041] During the implementation of the embodiments of the present application, the applicant discovered that the related art has the following problems: In the related art, the conventional process of updating the prefabricated parts can be found in Figure 5B When updating the component properties of a prefab instance according to the modified content of the prefab, the solution of the related technology maintains the difference information before and after the prefab modification, and updates all prefab instances affected by the prefab according to the difference information. In addition, in the related technology, in the case where some properties of the prefab instance created from the prefab have been modified by the editor, the game engine will also maintain a "does not follow the prefab modification" label for each modified content in these prefab instances. When updating the prefab instance according to the modification of the prefab, the game engine will determine whether to pass the difference information of the prefab modification to the prefab instance according to the maintained label. In this way, the related technology completes the update of the prefab by maintaining a "does not follow the prefab modification" label for each modified content in the prefab instance and maintaining the difference information before and after the prefab modification.

[0042] However, in the related art, since it is necessary to maintain a "not following prefab modification" label for each modified content in the prefab instance and maintain the difference information before and after the prefab modification to complete the update of the prefab, the code complexity of the game engine is high during the implementation process, resulting in a large time consumption when modifying the prefab, which seriously affects the update efficiency of the prefab. There is no effective solution in the related art on how to improve the update efficiency of the prefab.

[0043] The embodiments of the present application provide a method, apparatus, device, computer-readable storage medium and computer program product for processing game resources, which can effectively improve the updating efficiency of prefabricated parts. The following describes an exemplary application of the game resource processing device provided in the embodiments of the present application. The game resource processing device provided in the embodiments of the present application can be implemented as various types of user terminals such as laptop computers, tablet computers, desktop computers, set-top boxes, mobile devices (for example, mobile phones, portable music players, personal digital assistants, dedicated messaging devices, portable gaming devices), and can also be implemented as servers.

[0044] See also Figure 1 , Figure 1 It is an optional architecture diagram of the game resource processing system 100 provided in an embodiment of the present application. To realize the application scenario of game resource processing (for example, updating the game prefabricated components in the application scenario of online game development), the terminal (terminal 400 is shown as an example) is connected to the server 200 via the network 300. The network 300 can be a wide area network or a local area network, or a combination of the two.

[0045] The terminal 400 is used for the user to use the game client 410, which is displayed on a graphical interface 410-1 (graphical interface 410-1 is shown as an example). The terminal 400 and the server 200 are connected to each other via a wired or wireless network.

[0046] In some embodiments, the server 200 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The terminal 400 may be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, an intelligent voice interaction device, a smart home appliance, a car terminal, etc., but is not limited thereto. The terminal and the server may be directly or indirectly connected via wired or wireless communication, which is not limited in the embodiments of the present application.

[0047] In some embodiments, the game client 410 in the terminal 400 sends an update request to the server 200 through the network 300 in response to the component update operation for the base prefab, and the server 200 updates the initial transformation component in the base prefab and synchronously updates the data of the target component attribute item of the initial transformation component in the nested prefab.

[0048] See also Figure 2 , Figure 2 2 is a schematic diagram of the structure of the server 200 of the method for processing game resources provided in the embodiment of the present application. Figure 2 The server 200 shown includes: at least one processor 410, a memory 450, and at least one network interface 420. The various components in the server 200 are coupled together via a bus system 440. It is understood that the bus system 440 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 440 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, the bus system 440 is not described in detail. Figure 2 Various buses are labeled as bus system 440 .

[0049] Processor 410 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where the general-purpose processor can be a microprocessor or any conventional processor, etc.

[0050] The memory 450 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard disk drives, optical disk drives, etc. The memory 450 may optionally include one or more storage devices that are physically remote from the processor 410.

[0051] The memory 450 includes a volatile memory or a non-volatile memory, and may also include both volatile and non-volatile memories. The non-volatile memory may be a read-only memory (ROM), and the volatile memory may be a random access memory (RAM). The memory 450 described in the embodiments of the present application is intended to include any suitable type of memory.

[0052] In some embodiments, memory 450 can store data to support various operations, examples of which include programs, modules, and data structures, or a subset or superset thereof, as exemplarily described below.

[0053] The operating system 451 includes system programs for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., which are used to implement various basic businesses and process hardware-based tasks.

[0054] The network communication module 452 is used to reach other electronic devices via one or more (wired or wireless) network interfaces 420. Exemplary network interfaces 420 include: Bluetooth, Wireless LAN (WiFi), and Universal Serial Bus (USB).

[0055] In some embodiments, the game resource processing device provided in the embodiments of the present application can be implemented in a software manner. Figure 2 The processing device 455 of the game resources stored in the memory 450 is shown, which can be software in the form of programs and plug-ins, etc., including the following software modules: a construction module 4551, a comparison module 4552, a first update module 4553, and a second update module 4554. These modules are logical, so they can be arbitrarily combined or further divided according to the functions implemented. The functions of each module will be explained below.

[0056] In some embodiments, the terminal or server can implement the method for processing game resources provided in the embodiments of the present application by running a computer program. For example, the computer program can be a native program or software module in the operating system; it can be a native application (APP, Application), that is, a program that needs to be installed in the operating system to run, such as a game APP.

[0057] The method for processing game resources provided in the embodiment of the present application will be explained in combination with the exemplary application and implementation of the server provided in the embodiment of the present application.

[0058] In some embodiments, see Figure 3A , Figure 3A is a flowchart of a method for processing game resources provided in an embodiment of the present application, which will be combined with Figure 3A Steps 101 to 104 are shown for explanation.

[0059] In step 101, a base prefab and at least one nested prefab are constructed according to an initial transformation component of a game object.

[0060] In some embodiments, a game object is a container for all components in a game engine. All objects in a game are essentially game objects. Game objects themselves do not add any features to the game, but are containers for components that implement actual functions.

[0061] In some embodiments, a game object may include different initial transformation components, and different initial transformation components have different properties. For example, the initial transformation component may be a transformation component (Transform Component) or a camera component (Camera Component), wherein the transformation component includes a transformation function, and the transformation function is used to transform the parameters of the game object; the camera component is used to record the game screen.

[0062] In some embodiments, a prefab is a type of game resource. A prefab is a reusable game object stored in a project view. It is a reusable resource template composed of one or more game objects. Prefabs can be used to accelerate the construction of game scenes. Prefabs can be divided into basic prefabs and nested prefabs. A basic prefab can be a prefab that does not contain a prefab instance; a nested prefab can be a prefab that contains a prefab instance. A nested prefab is based on a basic prefab and has a nested relationship with the basic prefab.

[0063] As an example, see Figure 4A , Figure 4ASchematic diagram of the principle of the method for processing game resources provided in an embodiment of the present application. The basic prefab includes a game object 1; the nested prefab includes a prefab instance of the basic prefab in addition to its own unique game object 2. The prefab instance of the basic prefab is a game object quickly created using the basic prefab in the game editor, that is, the prefab instance of the basic prefab has a nested relationship with the basic prefab, and the nested prefab includes the prefab instance of the basic prefab, so there is a nested relationship between the nested prefab and the basic prefab.

[0064] As an example, see Figure 4A The game object 1 in the basic prefab includes an initial transformation component 1 and an initial transformation component 2. For example, the initial transformation component 1 may be a conversion component, and the initial transformation component 2 may be a recording component.

[0065] In some embodiments, see Figure 3B , Figure 3B is a flowchart of a method for processing game resources provided in an embodiment of the present application, Figure 3B The illustrated step 101 can be implemented through steps 1011 to 1012, which are described below respectively.

[0066] In step 1011, a base prefab is constructed according to the initial transformation component of the game object, and a prefab instance of the base prefab is determined.

[0067] As an example, see Figure 4A , construct a base prefab according to the initial transformation component 1 and the initial transformation component 2 of the game object 1. And determine the prefab instance of the base prefab according to the base prefab.

[0068] In some embodiments, the prefab instance of the base prefab is a game object quickly created using the base prefab in the game editor, that is, there is a nested relationship between the prefab instance of the base prefab and the base prefab.

[0069] In step 1012, at least one nested prefab is constructed from the prefab instance of the base prefab.

[0070] In some embodiments, at least one of the constructed nested prefabs needs to include a prefab instance of a base prefab to ensure the nested relationship between the base prefab and the nested prefab. It is understood that, in addition to the prefab instance of the base prefab, the nested prefab may also include game objects unique to the nested prefab (i.e., game objects not included in other prefabs except the nested prefab).

[0071] As an example, see Figure 4A, build a nested prefab based on the prefab instance of the base prefab and game object 2.

[0072] As an example, see Figure 4B , Figure 4B Schematic diagram of the principle of the method for processing game resources provided by the embodiment of the present application. A nested prefab is constructed according to the prefab instance of the basic prefab.

[0073] In some embodiments, when the number of nested preforms to be constructed is multiple (i.e., at least two), the above step 1012 can be implemented in the following manner: construct the first nested preform based on the prefab instance of the basic preform; generate the prefab instance of the first nested preform based on the first nested preform; iterate n to perform the following processing: construct the nth nested preform based on the prefab instance of the first nested preform, and generate the prefab instance of the nth nested preform, wherein n is an integer variable with a value range of 2≤n≤N-1, and N is the number of multiple nested preforms; construct the n+1th nested preform based on the prefab instance of the nth nested preform.

[0074] As an example, see Figure 4C , Figure 4C It is a schematic diagram of the principle of the method for processing game resources provided by the embodiment of the present application. According to the prefab instance of the basic prefab, the first nested prefab is constructed; or according to the prefab instance of the basic prefab and the game object 2, the first nested prefab is constructed.

[0075] As an example, see Figure 4C , when n=2, the second nested prefab is constructed according to the prefab instance of the first nested prefab, and the prefab instance of the second nested prefab is generated, wherein the prefab instance of the second nested prefab includes the prefab instance of the first nested prefab and the prefab instance of the base prefab. The third nested prefab is constructed according to the prefab instance of the second nested prefab, wherein the third nested prefab includes the prefab instance of the second nested prefab. Wherein, when n=2, N=3, that is, N-1=2, that is, the number of the plurality of nested prefabs is 3.

[0076] As an example, see Figure 4C, the nth nested prefab constructed includes the prefab instance of the n-1th nested prefab, or the nth nested prefab constructed includes the prefab instance of the game object n and the n-1th nested prefab. The n+1th nested prefab constructed includes the prefab instance of the nth nested prefab, or the n+1th nested prefab constructed includes the prefab instance of the game object n+1 and the nth nested prefab. It can be understood that the n+1th nested prefab and the first n nested prefabs need to maintain a nested relationship, so the n+1th nested prefab needs to include the prefab instance of the nth nested prefab, and the prefab instance of the nth nested prefab includes the prefab instance of the basic prefab, so the n+1th nested prefab needs to include the prefab instance of the nth nested prefab and the prefab instance of the basic prefab. At the same time, the n+1th nested prefab may also include a game object unique to the n+1th nested prefab (ie, game object n+1).

[0077] In this way, by constructing a basic prefab and then constructing at least one nested prefab based on the prefab instance of the basic prefab, the nested relationship between the basic prefab and the nested prefab is ensured, so that when the basic prefab is subsequently updated, the nested prefab can be modified synchronously, providing a guarantee.

[0078] In some embodiments, the above step 101 may also be implemented in the following manner: constructing a base prefab and at least one nested prefab through a prefab manager according to the initial transformation component of the game object.

[0079] As an example, see Figure 5D , Figure 5D It is a schematic diagram of the principle of the method for processing game resources provided by the embodiment of the present application. The construction of prefabs can be realized through the prefab manager (PrefabManager) in the serialization system (Serialize System) of the game engine, that is, a basic prefab and at least one nested prefab are constructed through the prefab manager.

[0080] In some embodiments, after constructing one of the base prefabs and at least one of the nested prefabs through the prefab manager, they are saved in the following manner: the constructed base prefab and the nested prefabs are saved in the game engine; wherein the nested prefabs saved in the game engine include all attribute names and partial data values ​​of the component attribute items of the base prefab.

[0081] As an example, see Figure 5D , save the base prefabs and nested prefabs built by the Prefab Manager to the game engine.

[0082] In this way, by saving the base prefab and the nested prefab in the game engine, and the nested prefab saved in the game engine includes all the attribute names of the component attribute items of the base prefab, the nested relationship between the base prefab and the nested prefab is ensured. At the same time, the nested prefab saved in the game engine includes some data values ​​of the component attribute items of the base prefab, thereby ensuring that the base prefab and the nested prefab have component attribute items with the same name and the same data value, so that when the base prefab is updated later, the nested prefab can be updated synchronously.

[0083] In step 102, initial transformation components included in any two of a basic prefab and at least one nested prefab are compared to obtain target component attribute items, wherein the attribute names and data values ​​corresponding to the target component attribute items are the same.

[0084] As an example, see Figure 4C , compare and process the initial transformation components included in a basic prefab and any two of at least one nested prefab, which may be to compare and process the initial transformation components included in the basic prefab and the initial transformation components included in the first nested prefab, to compare and process the initial transformation components included in the first nested prefab and the initial transformation components included in the nth nested prefab, and so on.

[0085] In some embodiments, the comparison process may be a process of comparing the attribute names and data values ​​of the component attribute items in the two initial transformation components to determine whether the attribute names of the two initial transformation components are the same, and for the component attribute items with the same attribute names, determining whether the data values ​​under the attribute names are the same.

[0086] In some embodiments, see Figure 3B , Figure 3B is a flowchart of a method for processing game resources provided in an embodiment of the present application. When the number of nested prefabricated parts constructed is one, Figure 3B The illustrated step 102 can be implemented through steps 1021 to 1022, which are described below respectively.

[0087] In step 1021, the initial transformation components respectively included in the basic prefab and the nested prefab are compared to obtain component attribute items with the same name and corresponding data value.

[0088] As an example, see Figure 4D, compare the initial transformation components (Transform Component) respectively included in the base prefab and the nested prefab, for example, compare each component attribute item with the same name in the Translation component in the initial transformation components respectively included in the base prefab and the nested prefab, wherein the expression of the component attribute item of Translation can be:

[0089] Translation(component attribute item 1; component attribute item 2; component attribute item 3) (1)

[0090] As an example, see Figure 4D , the component attribute item 1 of the base prefab is x:-50, where x is the name of the component attribute item 1 and -50 is the data value of the component attribute item 1; the component attribute item 1 of the nested prefab is x:-8, where x is the name of the component attribute item 1 and -8 is the data value of the component attribute item 1. After comparing the component attribute item 1 of the base prefab and the component attribute item 1 of the nested prefab, it can be seen that the names of the component attribute item 1 of the base prefab and the component attribute item 1 of the nested prefab are the same, both are x; but the data values ​​of the component attribute item 1 of the base prefab and the component attribute item 1 of the nested prefab are different, the data value of the component attribute item 1 of the base prefab is -50, and the data value of the component attribute item 1 of the nested prefab is -8. Therefore, the component attribute item 1 of the base prefab and the component attribute item 1 of the nested prefab are component attribute items with the same name but different corresponding data values.

[0091] In step 1022, the component attribute item with the same name and corresponding data value is used as the target component attribute item.

[0092] As an example, see Figure 4D, the component attribute item 2 of the basic prefab is y:0, where y is the name of the component attribute item 2 of the basic prefab, and 0 is the data value of the component attribute item 2 of the basic prefab; the component attribute item 2 of the nested prefab is y:0, where y is the name of the component attribute item 2 of the nested prefab, and 0 is the data value of the component attribute item 2 of the nested prefab. After comparing the component attribute item 2 of the basic prefab and the component attribute item 2 of the nested prefab, it can be seen that the name of the component attribute item 2 of the basic prefab and the component attribute item 2 of the nested prefab are the same, both are y; at the same time, the data values ​​of the component attribute item 2 of the basic prefab and the component attribute item 2 of the nested prefab are the same, the data value of the component attribute item 2 of the basic prefab is 0, and the data value of the component attribute item 2 of the nested prefab is 0. Therefore, the component attribute item 2 of the basic prefab and the component attribute item 2 of the nested prefab are component attribute items with the same name and the same corresponding data values. Therefore, the component property item 2 of the base prefab and the component property item 2 of the nested prefab can be used as the target component property item, that is, the component property item 2 can be used as the target component property item.

[0093] In this way, by determining the component attribute items with the same name and corresponding data values ​​in the basic prefab and a nested prefab as the target component attribute items, the component attribute items that may be modified in the nested prefab are determined, thereby facilitating subsequent rapid updating of the nested prefab.

[0094] In some embodiments, see Figure 3C , Figure 3C is a flowchart of a method for processing game resources provided in an embodiment of the present application. When the number of nested prefabricated parts constructed is multiple, Figure 3C The illustrated step 102 can be implemented through steps 1023 to 1025, which are described below respectively.

[0095] In step 1023, a comparison process is performed on the initial transformation components respectively included in any two nested prefabricated parts to obtain first component attribute items with the same name and the same corresponding data values.

[0096] As an example, see Figure 4E , when the number of nested prefabricated components constructed is two, the first nested prefabricated component and the second nested prefabricated component are compared and processed to obtain the first component attribute item with the same name and the same corresponding data value. Figure 4EIn the first nested prefab and the second nested prefab shown in , the first component attribute item can be the y:0 component item in the first nested prefab and the y:0 component item in the second nested prefab, and the z:300 component item in the first nested prefab and the z:300 component item in the second nested prefab, that is, the y:0 component item in the first nested prefab and the y:0 component item in the second nested prefab have the same name and the corresponding data values ​​are the same, and the z:300 component item in the first nested prefab and the z:300 component item in the second nested prefab have the same name and the corresponding data values ​​are the same.

[0097] In step 1024, the base prefab is compared with the initial transformation components included in each nested prefab to obtain second component attribute items with the same name and corresponding data value.

[0098] As an example, see Figure 4E When the number of nested prefabs constructed is two, the initial transformation component included in the base prefab is compared with the initial transformation components included in the first nested prefab and the second nested prefab, respectively, to obtain a second component attribute item with the same name and corresponding data value. Figure 4E For the first nested prefab, the second nested prefab and the base prefab shown in the figure, the second component attribute item can be the y:0 component item in the first nested prefab, the y:0 component item in the second nested prefab and the y:0 component item in the base prefab.

[0099] In step 1025, the data values ​​of the first component attribute item and the second component attribute item are compared and processed to obtain target component attribute items with the same data values.

[0100] As an example, see Figure 4E , the first component attribute item can be the y:0 component item in the first nested prefab and the y:0 component item in the second nested prefab, and the z:300 component item in the first nested prefab and the z:300 component item in the second nested prefab; the second component attribute item can be the y:0 component item in the first nested prefab, the y:0 component item in the second nested prefab, and the y:0 component item in the base prefab. The data values ​​of the first component attribute item and the second component attribute item are compared and processed to obtain a target component attribute item with the same data value, that is, the target component attribute item can be the y:0 component item in the first nested prefab, the y:0 component item in the second nested prefab, and the y:0 component item in the base prefab.

[0101] In this way, by comparing the basic prefab and multiple nested prefabs one by one, the component attribute items with the same name and corresponding data values ​​in the basic prefab and multiple nested prefabs are determined as the target component attribute items, thereby determining the component attribute items that may be modified in the nested prefabs, which facilitates the subsequent rapid update of the nested prefabs.

[0102] In step 103, in response to a component update operation on an initial transformation component included in the basic prefab, the initial transformation component included in the basic prefab is updated to obtain an updated transformation component.

[0103] In some embodiments, in response to a component update operation on an initial transformation component included in a base prefab, a data value of a component property item of the initial transformation component included in the base prefab is updated to obtain an updated transformation component.

[0104] As an example, see Figure 4F In response to a component update operation on an initial transformation component included in a base prefab, the initial transformation component included in the base prefab is updated to obtain an updated transformation component, wherein the component attribute item of the initial transformation component included in the base prefab is (x: -50, y: 0, z: 200), and the component attribute item of the updated transformation component obtained after the update is (x: -10, y: 50, z: 100), that is, the data value of the component attribute item of the updated transformation component is changed compared with the data value of the component attribute item of the initial transformation component, and the updated transformation component is obtained by updating the data value of the component attribute item of the initial transformation component included in the base prefab.

[0105] In some embodiments, see Figure 3C , Figure 3C is a flowchart of a method for processing game resources provided in an embodiment of the present application, Figure 3C The illustrated step 103 can be implemented through steps 1031 to 1032, which are described below respectively.

[0106] In step 1031 , in response to a component update operation on an initial transformation component included in a basic prefab, an update data value submitted by the update operation for at least one component property item in the initial transformation component is obtained.

[0107] As an example, see Figure 4F In response to a component update operation on an initial transformation component included in a basic prefab, an updated data value submitted by the update operation for a component property item in the initial transformation component is obtained, the updated data value submitted for component property item x is -10, the updated data value submitted for component property item y is 50, and the updated data value submitted for component property item z is 100.

[0108] In step 1032, the original data value corresponding to at least one component attribute item in the initial transformation component included in the basic prefab is replaced with the updated data value to obtain an updated transformation component.

[0109] As an example, see Figure 4F , replace the original data value -50 of the component attribute item x in the initial transformation component included in the basic prefab with the updated data value -10; replace the original data value 0 of the component attribute item y in the initial transformation component included in the basic prefab with the updated data value 50; replace the original data value 200 of the component attribute item z in the initial transformation component included in the basic prefab with the updated data value 100.

[0110] In this way, by replacing the original data value of at least one component attribute item in the initial transformation component included in the basic prefab with the updated data value, the update of the initial transformation component included in the prefab is achieved, laying the foundation for the update of subsequent nested prefabs.

[0111] In some embodiments, see Figure 3D , Figure 3D It is a flowchart of the method for processing game resources provided in an embodiment of the present application. In the above step 103, the initial transformation component included in the basic prefab is updated. After the updated transformation component is obtained, the updated prefab of the basic prefab is obtained by executing step 105.

[0112] In step 105, the initial transformation component included in the basic prefab is replaced with the updated transformation component to obtain an updated prefab of the basic prefab.

[0113] Thus, since the data value of the update transformation component has been updated, the initial transformation component included in the base prefab is replaced with the update transformation component, thereby obtaining the update prefab. It can be understood that the update prefab of the base prefab is a prefab of an updated version of the base prefab.

[0114] In step 104, the data value of the property item of the corresponding target component in the initial transformation component included in the nested prefab is updated to the data value of the property item of the corresponding target component in the updated transformation component.

[0115] In some embodiments, since the nested prefab and the base prefab have a nested relationship, after the initial transformation component included in the base prefab is updated to obtain the updated transformation component, the data value of the corresponding target component attribute item in the initial transformation component included in the nested prefab can be updated to the data value of the corresponding target component attribute item in the updated transformation component, thereby realizing the synchronous update of the nested prefab.

[0116] In some embodiments, see Figure 3D , Figure 3D It is a flow chart of the method for processing game resources provided in an embodiment of the present application. After the data value of the corresponding target component attribute item in the initial transformation component included in the nested prefab is updated to the data value of the corresponding target component attribute item in the updated transformation component in the above step 104, the updated prefab of the nested prefab is obtained by executing steps 106 to 107.

[0117] In step 106, the initial transformation component included in the updated nested prefab is determined as the updated transformation component of the nested prefab.

[0118] As an example, the data value of the target component property item of the initial transformation component included in the updated nested prefab has been updated, so that the initial transformation component included in the updated nested prefab is determined as the updated transformation component of the nested prefab.

[0119] In step 107, the initial transformation component included in the nested prefab is replaced with the updated transformation component of the nested prefab to obtain the updated prefab of the nested prefab.

[0120] As an example, by replacing the initial transformation component included in the nested prefab with the updated transformation component of the nested prefab, an updated prefab of the nested prefab is obtained, thereby implementing the updating of the nested prefab.

[0121] As an example, see Figure 4C , the initial transformation components included in the 1st nested prefab...the nth nested prefab and the n+1th nested prefab are replaced with the updated transformation component of the 1st nested prefab...the updated transformation component of the nth nested prefab and the updated transformation component of the n+1th nested prefab, respectively, thereby achieving synchronous updating of multiple nested prefabs.

[0122] In this way, by replacing the initial transformation component included in the nested prefab with the updated transformation component of the nested prefab, the synchronous update of multiple nested prefabs is achieved, and the update efficiency of the nested prefabs is effectively improved.

[0123] In some embodiments, see Figure 3E , Figure 3E is a flowchart of a method for processing game resources provided in an embodiment of the present application, which will be combined with Figure 3E Steps 201 to 202 are shown for explanation.

[0124] In step 201, in response to a scene loading operation for a game resource, a target game scene to be loaded among a plurality of game scenes to be loaded is determined, wherein the game resource includes a basic prefab, a nested prefab and a plurality of game scenes to be loaded.

[0125] In some embodiments, the game scene is the environment, buildings, machinery, props, etc. in the game. The game scene can generally be understood as the available elements (including weapons and props, etc.) such as buildings, trees, sky, roads, etc. in the game restored according to requirements.

[0126] As an example, see Figure 5D In response to a scene loading operation for a game resource, a scene manager (SceneManager) in a serialization system (Serialize System) determines a target game scene to be loaded among multiple game scenes to be loaded (for example, Figure 5D Scenario 1). Figure 5D As shown, the game resources include prefabs and scenes, that is, the game resources include prefabs and game scenes to be loaded, and the prefabs include basic prefabs and nested prefabs. Therefore, the game resources include basic prefabs, nested prefabs and multiple game scenes to be loaded.

[0127] In step 202, a scene manager is called to perform loading processing based on the target game scene to be loaded, and the loaded target game scene to be loaded is saved in the game engine.

[0128] As an example, see Figure 5D , based on the target game scene to be loaded, the scene manager is called to perform loading processing, and the loaded target game scene to be loaded is saved in the game engine.

[0129] In some embodiments, the loading process can read the data of the target game scene to be loaded, thereby achieving the purpose of displaying the game scene.

[0130] Below, an exemplary application of the embodiment of the present application in an actual application scenario of online game development will be described.

[0131] In an actual application scenario of online game development, a large number of prefabricated parts are usually required to build the game scene. As the game version is updated and iterated, the game scene needs to be rebuilt and the prefabricated parts also need to be updated synchronously. The update of a large number of prefabricated parts will consume a lot of time. The game resource processing method provided in the embodiment of the present application can greatly reduce the update time of prefabricated parts and effectively improve the update efficiency of prefabricated parts.

[0132] In some embodiments, Figure 5A Schematic diagram of the principle of the method for processing game resources provided in the embodiment of the present application. Figure 5A , the embodiment of the present application can be Figure 5A Steps 501 to 504 shown implement the generation and use of prefabricated parts.

[0133] In step 501, a game object in a selected game scene is received.

[0134] In step 502, the properties of all components of the game object are traversed, and the properties of all components of the game object are stored in a specific prefab file.

[0135] In step 503, in response to the dragging operation, the prefab is dragged into the game scene to generate a prefab instance (the properties of the prefab instance are consistent with the property items of the prefab file).

[0136] In step 504, some properties of the prefab instance are modified, and the modified properties are no longer affected by the prefab, while other properties are updated as the prefab is modified.

[0137] In some embodiments, see Figure 5B When solving the problem of updating the component properties of a prefab instance according to the prefab modification content, the solution of the related technology will maintain the difference information before and after the prefab modification, and update all prefab instances affected by the prefab according to the difference information. In addition, in the related technology, for the situation where some properties of the prefab instance created from the prefab have been modified by the editor, the game engine will also maintain a "does not follow the prefab modification" label for each modification content in these prefab instances. When updating the prefab instance according to the prefab modification, the engine will determine whether to pass the difference information of the prefab modification to the prefab instance based on the maintained label. In this way, the related technology completes the update of the prefab by maintaining a "does not follow the prefab modification" label for each modification content in the prefab instance and maintaining the difference information before and after the prefab modification.

[0138] Below, see Figure 5B , will combine Figure 5B Steps 510 to 515 are shown for explanation.

[0139] In step 510, the prefab is opened in the editor, and the components and other contents of the game object are adjusted, and the prefab is saved.

[0140] In step 511, it is determined whether there is a prefabricated component instance created by the prefabricated component. If yes, the process proceeds to step 512; if no, the process proceeds to step 513.

[0141] In step 512, the following operations are performed for each prefab instance: the modified prefab properties are traversed to obtain the label of the prefab property in the prefab instance; when the label is "follow the modification of the prefab", the prefab property is updated to the prefab instance; when the label is "do not follow the modification of the prefab", the prefab property will not be updated to the prefab instance; when all the prefab properties are traversed and the above operations are performed, the prefab instance is deemed to have been updated.

[0142] In step 513 , it is determined whether there are other prefabricated parts including the prefabricated part; if so, the process proceeds to step 514 ; if not, the process proceeds to step 515 .

[0143] In step 514, all other prefabs that contain the prefab are updated.

[0144] In step 515, end.

[0145] In some embodiments, the solution of the related art needs to update the difference information and labels maintained in the engine in real time when modifying the content of the prefab instance in the editor. Because there are many operations to modify the properties of game objects in game development, this will result in a very large time overhead. Secondly, the solution of the related art usually requires tens of thousands of lines of code to solve the modification and update mechanism of the prefab. These codes need to maintain the architecture of the difference information of the prefab instance and the prefab to support addition, deletion, modification and query, and also need to maintain a label for each attribute value of each prefab instance whether it is nested from the prefab. These implementation schemes based on difference information and labels require that when the editor edits the properties of the game object in the prefab instance, the difference information such as the game components between itself and the prefab is updated in real time, and the labels of these properties are updated according to the user input. It will be extremely complicated in the engine implementation process and the implementation difficulty is very high. In addition, the scheme still cannot avoid updating the affected prefabs and prefab instances in the update phase after the prefab is modified.

[0146] In the embodiment of the present application, based on the idea of ​​maintaining complete component information of prefab instances in the engine and determining whether to embed attribute values ​​from prefabs by information comparison, the problem of the editor needing to update engine information in real time when modifying the content of prefab instances is avoided. In the update phase after the prefab is modified, the modified and updated content will be synchronized to all affected prefabs and prefab instances by information comparison.

[0147] In the examples of this application, see Figure 5C , Figure 5CIt is a schematic diagram of the principle of the method for processing game resources provided by the embodiment of the present application. The resources included in the game installation package provided by the embodiment of the present application include: textures, animations, scenes, materials, sounds, scripts, prefabricated parts, etc., wherein there will be a large number of prefabricated part instances in the scene and prefabricated part resources. Through the embodiment of the present application, on the one hand, the difficulty of implementing the prefabricated part architecture in the game engine can be reduced, and on the other hand, the efficiency of game development can be improved. When developers modify the component properties of the prefabricated part instance, they do not need to update the maintenance information in real time, but only need to process the update logic when loading or saving the scene (or prefabricated part).

[0148] In the embodiment of the present application, the hardware environment includes a central processing unit (CPU), memory (RAM), a hard disk (HardDisk), a graphics processing unit (GPU) and input devices such as keyboard, mouse and touch, and a display, etc.

[0149] In the examples of this application, see Figure 5D , Figure 5D Schematic diagram of the principle of the method for processing game resources provided by the embodiment of the present application. The software environment includes a game engine, an editor, etc. Among them, the scene manager of the game engine manages multiple game scenes (see Figure 5D , Scene 1, Scene 2, Scene 3, Scene 4), each scene has its own serialization system (Serialize System) for creating and loading prefabs (Prefab) and game scenes. The serialization system includes the Prefab Manager (Prefab Manager) and the Scene Manager (Scene Manager). The Prefab Manager (PrefabManager) is used to create prefabs and prefab instances, and maintain the relationship between the two, so that when a prefab is modified, it is updated to all the prefab instances created by the prefab. The Scene Manager is used to load and save game scenes (see Figure 5D , Scene), and maintain a list of prefab instances used in each game scene. The prefabs in the embodiment of the present application allow nesting, and the prefab instances created from the prefabs can exist in other scenes or other prefabs.

[0150] In the examples of this application, see Figure 5E , Figure 5E Schematic diagram of the principle of the method for processing game resources provided by the embodiment of the present application. The embodiment of the present application is a solution for modifying and updating prefabricated parts and prefabricated part instances. In some embodiments, see Figure 5E , will combine Figure 5E Steps 520 to 523 are shown for explanation.

[0151] In step 520, prefabs are created and loaded.

[0152] In step 521 , a prefab instance is created.

[0153] In step 522, the prefab instance is modified.

[0154] In step 523, after the prefab is modified, the affected prefab and prefab instance are updated.

[0155] The following will introduce Figure 5E Technical details of steps 520 to 523 are shown.

[0156] In the embodiments of the present application, Fig. 5F As shown, Fig. 5F It is a schematic diagram of the principle of the processing method of the game resources provided in the embodiment of the present application. A group of game objects (Game Object) described by a prefabricated resource file, each game object may be composed of different components (Component), and the data of different components are different. In the embodiment of the present application, the prefabricated resource file is described using a Json data structure, wherein JavaScript Object Notation (JavaScript Object Notation, Json) is a data structure that replaces Extensible Markup Language (Extensible Markup Language, XML), and compared with XML, Js on data structure is more compact but description ability is not bad, due to the compactness of the Json data structure, so the transmission of data through the network will reduce more traffic and thus speed up, and each component is also described by the Json data structure.

[0157] Therefore, the process of creating the prefab in the above step 520 is to traverse all components in the selected game object in sequence according to the selected game object, and organize it into a file in the form of a Json data structure.

[0158] In the examples of this application, see Figure 5G , Figure 5G It is a schematic diagram of the principle of the processing method of the game resources provided by the embodiment of the present application. The basic prefab includes two game objects (game object 1 and game object 2), and in the nested prefab, in addition to the two game objects (game object 3 and game object 4) existing in itself, there are two prefab instances created by the basic prefab (prefab instance 1 of the basic prefab and prefab instance 2 of the basic prefab), and the prefab instance of each basic prefab includes two game objects. So there are actually 6 game objects in the nested prefab. So when loading the nested prefab, the embodiment of the present application actually stores the complete information of 6 game objects in the game engine, rather than the difference information of the storage part. This has laid the foundation for the realization of subsequent steps.

[0159] In some embodiments, see Figure 5H , Figure 5H Schematic diagram of the principle of the method for processing game resources provided by the embodiment of the present application. In the above step 521, the prefab instance is created according to all the game objects (game object 1 and game object 2) stored in the prefab and the required complete information (such as: Json data of each component, see Figure 5H In the prefab, the game object 1's own data and the Json data of each component, the game object 2's own data and the Json data of each component) are used to generate the game objects (game object 1 and game object 2) in the game scene, and the corresponding implicit information of the game objects (game object 1 and game object 2) in the game scene is maintained in the prefab instance. When modifying the content of the game object in the prefab instance in the editor, unlike the prior art solution, the game engine will maintain the difference information between the prefab instance and the prefab in real time and a label indicating whether it is affected by the prefab update. In the embodiment of the present application, no operation is required to modify the prefab instance, because the prefab instance has complete game object data, rather than difference information based on the prefab to which it belongs. This helps to improve the efficiency of game development, while also reducing the complexity of implementing difference information and impact labels in the engine.

[0160] See also Fig.5I , Fig.5I It is a schematic diagram of the principle of the method for processing game resources provided in an embodiment of the present application. Fig.5I What is shown is an example of the use of prefabs in a game scene. The base prefab is a base type of prefab, and nested prefab 2 is a prefab created based on the base prefab, and so on (nested prefab 3, nested prefab 4, nested prefab 5). These sets of nested prefabs with a nested relationship can create any prefab instance in the game scene. When editing and modifying the base prefab, all nested prefabs (nested prefab 2, nested prefab 3, nested prefab 4, nested prefab 5) and related prefab instances (prefab instance 2, prefab instance 3, prefab instance 4) that reference the base prefab can be updated.

[0161] See also Figure 5J , Figure 5J Schematic diagram of the principle of the method for processing game resources provided by the embodiment of the present application. Since the embodiment of the present application maintains the complete information required for constructing game objects in the nested prefabricated parts, Figure 5JAs shown, after modifying the position information (Translation) of a component in a game object in the base prefab, the modified information is updated to the corresponding game object in the nested prefab. At this time, you only need to pass the old and new data of the component in the base prefab to the nested prefab at the same time. The nested prefab first compares its own component data with the old data of the base prefab, and finds that the data value of the y attribute item in the Translation function of the nested prefab is consistent with the data value of the original data attribute item of the base prefab, indicating that these data values ​​must change with the changes of the base prefab. Then, the data value of the y attribute item in the Translation function in the new data of the base prefab is updated to the component in the nested prefab, thus completing the update process. Figure 5J Shows the nested prefab modifying the updated data according to the new data of the base prefab.

[0162] As for the update of the prefab instance, the prefab only needs to provide the latest Json data to the prefab instance to re-update the attribute data value of the game object in the engine.

[0163] The method for processing game resources provided by the embodiment of the present application avoids the complexity caused by modifying the labels of prefab instances based on difference information by maintaining complete information in the prefab for updating. The difficulty of implementing the prefab architecture in the game engine is reduced, and the efficiency of game development is improved because there is no need to maintain difference information and labels in real time in the game engine.

[0164] The following continues to describe the exemplary structure of the game resource processing device 455 provided in the embodiment of the present application implemented as a software module. In some embodiments, Figure 2 As shown, the software modules in the processing device 455 of the game resources stored in the memory 450 may include: a construction module, which is used to construct a basic prefab and at least one nested prefab according to the initial transformation component of the game object; a comparison module, which is used to compare the initial transformation components included in any two of a basic prefab and at least one nested prefab to obtain target component attribute items, wherein the attribute names and data values ​​corresponding to the target component attribute items are the same; a first update module, which is used to update the initial transformation component included in the basic prefab in response to a component update operation on the initial transformation component included in the basic prefab to obtain an updated transformation component; and a second update module, which is used to update the data value of the corresponding target component attribute item in the initial transformation component included in the nested prefab to the data value of the corresponding target component attribute item in the updated transformation component.

[0165] In some embodiments, the above-mentioned construction module is also used to construct a basic prefab according to the initial transformation component of the game object, and determine the prefab instance of the basic prefab; and construct at least one nested prefab according to the prefab instance of the basic prefab.

[0166] In some embodiments, the above-mentioned building module is also used to build the first nested prefab according to the prefab instance of the basic prefab; generate the prefab instance of the first nested prefab based on the first nested prefab; iterate n to perform the following processing: build the nth nested prefab according to the prefab instance of the first nested prefab, and generate the prefab instance of the nth nested prefab, wherein n is an integer variable, and the value range is 2≤n≤N-1, and N is the number of multiple nested prefabs; build the n+1th nested prefab according to the prefab instance of the nth nested prefab.

[0167] In some embodiments, when the number of nested prefabs constructed is one, the comparison module is also used to compare the initial transformation components respectively included in the basic prefab and the nested prefab to obtain component attribute items with the same name and corresponding data values; and use the component attribute items with the same name and corresponding data values ​​as target component attribute items.

[0168] In some embodiments, when the number of nested prefabricated parts constructed is multiple, the comparison module is also used to compare the initial transformation components respectively included in any two nested prefabricated parts to obtain first component attribute items with the same name and corresponding data values; compare the base prefab with the initial transformation components included in each nested prefabricated part to obtain second component attribute items with the same name and corresponding data values; compare the data values ​​of the first component attribute item with those of the second component attribute item to obtain target component attribute items with the same data values.

[0169] In some embodiments, the above-mentioned first update module is also used to respond to a component update operation on an initial transformation component included in a basic prefab, obtain an updated data value submitted by the update operation for at least one component attribute item in the initial transformation component; replace the original data value corresponding to at least one component attribute item in the initial transformation component included in the basic prefab with the updated data value, and obtain an updated transformation component.

[0170] In some embodiments, the above-mentioned game resource processing device also includes: a third update module, used to replace the initial transformation component included in the basic prefab with the updated transformation component to obtain the updated prefab of the basic prefab; a fourth update module, used to determine the initial transformation component included in the updated nested prefab as the updated transformation component of the nested prefab; replace the initial transformation component included in the nested prefab with the updated transformation component of the nested prefab to obtain the updated prefab of the nested prefab.

[0171] In some embodiments, the construction module is further used to construct a base prefab and at least one nested prefab through a prefab manager according to an initial transformation component of the game object;

[0172] In some embodiments, the above-mentioned game resource processing device also includes: a scene loading module, which is used to respond to the scene loading operation for the game resources, determine the target game scene to be loaded among multiple game scenes to be loaded, wherein the game resources include basic prefabricated parts, nested prefabricated parts and multiple game scenes to be loaded; based on the target game scene to be loaded, call the scene manager to perform loading processing, and save the target game scene to be loaded after loading processing to the game engine.

[0173] In some embodiments, the above-mentioned game resource processing device also includes: a saving module, used to save the constructed basic prefabs and nested prefabs to the game engine; wherein the nested prefabs saved in the game engine include all attribute names and partial data values ​​of the component attribute items of the basic prefabs.

[0174] An embodiment of the present application provides an electronic device, comprising: a memory for storing executable instructions; and a processor for implementing a method for processing game resources provided in the embodiment of the present application when executing the executable instructions stored in the memory.

[0175] The embodiment of the present application provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the above-mentioned method for processing game resources in the embodiment of the present application.

[0176] The present application embodiment provides a computer-readable storage medium storing executable instructions, wherein the executable instructions are stored. When the executable instructions are executed by a processor, the processor will execute the method for processing game resources provided by the present application embodiment, for example, Figure 3A The game resource processing method shown is as follows.

[0177] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EP ROM, EEPROM, flash memory, magnetic surface storage, optical disk, or CD-ROM; or it may be various devices including one or any combination of the above memories.

[0178] In some embodiments, executable instructions may be in the form of a program, software, software module, script or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine or other unit suitable for use in a computing environment.

[0179] As an example, executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, such as in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files storing one or more modules, subroutines, or code portions).

[0180] As an example, the executable instructions may be deployed to be executed on one electronic device, or on multiple electronic devices located at one site, or on multiple electronic devices distributed at multiple sites and interconnected by a communication network.

[0181] In summary, the embodiments of the present application have the following beneficial effects:

[0182] (1) By constructing a basic prefab and a nested prefab, since the initial transformation components included in the basic prefab and the nested prefab include target component attribute items with the same attribute names and data values, after the initial transformation components in the basic prefab are updated, the data values ​​of the corresponding target component attribute items in the initial transformation components included in the nested prefab can be synchronously updated, thereby realizing the synchronous update of the basic prefab and the nested prefab, effectively saving the update time of the nested prefab, and thus effectively improving the update efficiency of the prefab.

[0183] (2) By constructing a basic prefab, and then constructing at least one nested prefab based on the prefab instance of the basic prefab, the nested relationship between the basic prefab and the nested prefab is ensured, thereby providing a guarantee for synchronously modifying the nested prefab when the basic prefab is subsequently updated.

[0184] (3) By determining the component attribute items with the same name and corresponding data values ​​in the basic prefab and the nested prefab as the target component attribute items, the component attribute items that may be modified in the nested prefab are determined, which facilitates the subsequent rapid update of the nested prefab.

[0185] (4) By comparing the basic prefab and the multiple nested prefabs in pairs, the component attribute items with the same name and corresponding data values ​​in the basic prefab and the multiple nested prefabs are determined as the target component attribute items, thereby determining the component attribute items that may be modified in the nested prefabs, which facilitates the subsequent rapid update of the nested prefabs.

[0186] (5) By replacing the original data value of at least one component attribute item in the initial transformation component included in the basic prefab with the updated data value, the initial transformation component included in the prefab is updated, laying a foundation for the subsequent update of the nested prefab.

[0187] (6) By replacing the initial transformation component included in the nested prefabricated parts with the updated transformation component of the nested prefabricated parts, the synchronous updating of multiple nested prefabricated parts is achieved, thereby effectively improving the updating efficiency of the nested prefabricated parts.

[0188] (7) By saving the base prefab and the nested prefab in the game engine, and the nested prefab saved in the game engine includes all the attribute names of the component attribute items of the base prefab, the nested relationship between the base prefab and the nested prefab is ensured. At the same time, the nested prefab saved in the game engine includes some data values ​​of the component attribute items of the base prefab, thereby ensuring that the base prefab and the nested prefab have component attribute items with the same name and the same data value, so that when the base prefab is updated later, the nested prefab can be updated synchronously.

[0189] The above are only embodiments of the present application and are not intended to limit the protection scope of the present application. Any modifications, equivalent substitutions and improvements made within the spirit and scope of the present application are included in the protection scope of the present application.

Claims

1. A method for processing game resources, characterized in that: The method comprises: Build a base prefab and at least one nested prefab based on the initial transformation component of the game object; When the number of the nested prefabricated parts constructed is one, the initial transformation component included in the basic prefabricated part and the initial transformation component included in the nested prefabricated part are compared to obtain the target component attribute item; or, when the number of the nested prefabricated parts constructed is multiple, the initial transformation components respectively included in any two of the nested prefabricated parts are compared to obtain the target component attribute item, wherein the attribute names and data values ​​corresponding to the target component attribute items are the same; In response to a component update operation on an initial transformation component included in the basic prefab, updating the initial transformation component included in the basic prefab to obtain an updated transformation component; The data value corresponding to the attribute item of the target component in the initial transformation component included in the nested prefab is updated to the data value corresponding to the attribute item of the target component in the update transformation component.

2. The method according to claim 1, characterized in that The step of constructing a base prefab and at least one nested prefab according to the initial transformation component of the game object comprises: Constructing a base prefab according to the initial transformation component of the game object, and determining a prefab instance of the base prefab; At least one nested prefab is constructed from the prefab instance of the base prefab.

3. The method according to claim 2, characterized in that When the number of the nested prefabs to be constructed is plural, constructing at least one nested prefab according to the prefab instance of the basic prefab comprises: Constructing a first nested prefab according to the prefab instance of the base prefab; Based on the first nested prefab, generating a prefab instance of the first nested prefab; Iteration n performs the following processing: According to the prefab instance of the first nested prefab, construct an nth nested prefab, and generate a prefab instance of the nth nested prefab, wherein n is an integer variable and has a value range of 2≤n≤N-1, and N is the number of the plurality of nested prefabs; Constructing the (n+1)th nested preform according to the preform instance of the (n)th nested preform.

4. The method according to claim 1, characterized in that: When the number of the nested prefab constructed is one, the initial transformation component included in the base prefab and the initial transformation component included in the nested prefab are compared to obtain target component attribute items, including: Comparing the initial transformation components respectively included in the basic prefab and the nested prefab, obtaining component attribute items having the same name and corresponding data values; The component attribute item with the same name and corresponding data value is used as the target component attribute item.

5. The method according to claim 1, characterized in that When the number of the nested prefabricated parts constructed is multiple, the initial transformation components respectively included in any two of the nested prefabricated parts are compared to obtain the target component attribute items, including: Comparing the initial transformation components respectively included in any two of the nested prefabricated parts, and obtaining first component attribute items with the same name and the same corresponding data value; Compare the basic prefab with the initial transformation components included in each of the nested prefabs to obtain second component attribute items with the same name and corresponding data value; The data values ​​of the first component attribute item and the second component attribute item are compared and processed to obtain a target component attribute item with the same data value.

6. The method according to claim 1, characterized in that The step of updating the initial transformation component included in the basic prefab in response to the component update operation on the initial transformation component included in the basic prefab to obtain an updated transformation component comprises: In response to a component update operation on an initial transformation component included in the basic prefab, obtaining an update data value submitted by the update operation for at least one component property item in the initial transformation component; The original data value corresponding to the at least one component attribute item in the initial transformation component included in the basic prefab is replaced with the updated data value to obtain an updated transformation component.

7. The method according to claim 1, characterized in that After the initial transformation component included in the basic prefab is updated to obtain an updated transformation component, the method further includes: Replacing the initial transformation component included in the basic prefab with the updated transformation component to obtain an updated prefab of the basic prefab; After updating the data value corresponding to the target component attribute item in the initial transformation component included in the nested prefab to the data value corresponding to the target component attribute item in the update transformation component included in the base prefab, the method further includes: Determine the initial transformation component included in the updated nested prefab as the updated transformation component of the nested prefab; The initial transformation component included in the nested prefab is replaced with the updated transformation component of the nested prefab to obtain the updated prefab of the nested prefab.

8. The method according to claim 1, characterized in that The step of constructing a base prefab and at least one nested prefab according to the initial transformation component of the game object comprises: According to the initial transformation component of the game object, construct one of the base prefabs and at least one of the nested prefabs through a prefab manager; The method further comprises: In response to a scene loading operation for a game resource, determining a target game scene to be loaded among a plurality of game scenes to be loaded, wherein the game resource includes the basic prefab, the nested prefab, and the plurality of game scenes to be loaded; Based on the target game scene to be loaded, the scene manager is called to perform loading processing, and the target game scene to be loaded after loading processing is saved in the game engine.

9. The method according to claim 8, characterized in that After constructing the base prefab and at least one nested prefab through the prefab manager, the method further includes: Saving the constructed base prefab and the nested prefab into the game engine; The nested prefab saved in the game engine includes all attribute names and partial data values ​​of component attribute items of the base prefab.

10. A device for processing game resources, characterized in that: The device comprises: A construction module, for constructing a base prefab and at least one nested prefab according to an initial transformation component of a game object; A comparison module, for comparing the initial transformation component included in the base prefab and the initial transformation component included in the nested prefab when the number of the nested prefab to be constructed is one, to obtain a target component attribute item; or, when the number of the nested prefab to be constructed is multiple, comparing the initial transformation components respectively included in any two of the nested prefabs to obtain a target component attribute item, wherein the attribute names and data values ​​corresponding to the target component attribute items are the same; A first updating module, configured to update the initial transformation component included in the basic prefab in response to a component updating operation on the initial transformation component included in the basic prefab, to obtain an updated transformation component; The second updating module is used to update the data value of the target component attribute item in the initial transformation component included in the nested prefab to the data value of the target component attribute item in the updated transformation component.