Filling method and device in game, storage medium and electronic equipment
By serializing the attributes and asynchronous node information of the blueprint object, the problem of low efficiency in game archives in the existing technology is solved, and efficient game archives are achieved.
Patent Information
- Application Number
- CN202510669455.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-22
- Publication Date
- 2025-07-25
AI Technical Summary
Existing game archive methods cannot efficiently archive gameplay based on blueprints, resulting in low saving efficiency.
By responding to archive events, determine the blueprint object that the target game runs, serialize the blueprint attributes and asynchronous nodes, obtain the attributes and node serialization information, and archive them based on this information.
It realizes efficient archiving of gameplay based on blueprints, avoids the increase in workload and compatibility issues caused by modifying blueprint objects, and improves the archive efficiency.
Smart Images

Figure CN120361522A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and particularly to a method, device, storage medium, and electronic device for saving game progress in a game. Background Art
[0002] With the rapid development of life and technology, people often use game applications for entertainment. To allow players to save their game states at specific time points and continue the game at a later time, game saving is required. Saving refers to a mechanism in a game for saving and loading player progress.
[0003] In the research and practice of the prior art, it is found that due to the limitation of the blueprint implementation principle, some gameplays implemented based on blueprints do not have a saving mechanism, and the existing game saving methods cannot efficiently save gameplays implemented based on blueprints, resulting in low saving efficiency in the game. Summary of the Invention
[0004] Embodiments of this application provide a method, device, storage medium, and electronic device for saving game progress in a game, which can efficiently save gameplays implemented based on blueprints, thereby improving the saving efficiency in the game.
[0005] Embodiments of this application provide a method for saving game progress in a game, including:
[0006] In response to a saving event for a target game, determining a target blueprint object that the target game is running on when the saving event occurs;
[0007] Serializing target blueprint attributes corresponding to the target blueprint object to obtain attribute serialization information;
[0008] Determining a target asynchronous node that is being executed in the target blueprint object;
[0009] Serializing the target asynchronous node to obtain node serialization information;
[0010] Based on the attribute serialization information and the node serialization information, saving the target blueprint object.
[0011] Correspondingly, embodiments of this application provide a device for saving game progress in a game, including:
[0012] A first determination unit, configured to determine a target blueprint object that the target game is running on when a saving event for the target game occurs;
[0013] A first serialization unit, configured to serialize target blueprint attributes corresponding to the target blueprint object to obtain attribute serialization information;
[0014] A second determination unit, configured to determine a target asynchronous node that is being executed in the target blueprint object;
[0015] A second serialization unit, configured to serialize the target asynchronous node to obtain node serialization information;
[0016] An archiving unit, configured to archive the target blueprint object based on the attribute serialization information and the node serialization information.
[0017] In addition, an embodiment of the present application further provides a computer-readable storage medium, which stores a computer program, and the computer program is suitable for being loaded by a processor to execute the steps in any of the game archiving methods provided by the embodiments of the present application.
[0018] In addition, an embodiment of the present application further provides an electronic device, including a processor and a memory, where the memory stores an application program, and the processor is configured to run the application program in the memory to implement the game archiving method provided by the embodiments of the present application.
[0019] An embodiment of the present application further provides a computer program product, which includes a computer program, and the computer program is stored in a computer-readable storage medium; when a processor of an electronic device reads the computer program from the computer-readable storage medium, the processor executes the computer program, so that the electronic device executes the steps in the game archiving method provided by the embodiments of the present application.
[0020] In the embodiments of the present application, in response to an archiving event for a target game, a target blueprint object that is running when the archiving event occurs in the target game is determined; the target blueprint attributes corresponding to the target blueprint object are serialized to obtain attribute serialization information; a target asynchronous node that is being executed in the target blueprint object is determined; the target asynchronous node is serialized to obtain node serialization information; and the target blueprint object is archived based on the attribute serialization information and the node serialization information. In this way, by simplifying the archiving of the target game to the archiving of the blueprint attributes of the target blueprint object and the asynchronous nodes that are being executed, it is possible to efficiently archive the game play implemented based on the blueprint, and avoid the problems of increased workload and poor compatibility caused by modifying the blueprint object during game archiving, thereby effectively improving the archiving efficiency in the game. Description of the Drawings
[0021] To more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the accompanying drawings required for the description of the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present application. For those skilled in the art, without creative efforts, other accompanying drawings can be obtained based on these drawings.
[0022] Figure 1 It is a schematic diagram of an implementation scenario of a game save method provided by an embodiment of the present application;
[0023] Figure 2 It is a flowchart of a game save method provided by an embodiment of the present application;
[0024] Figure 3a It is a serialization flowchart of a game save method provided by an embodiment of the present application;
[0025] Figure 3b It is a deserialization flowchart of a game save method provided by an embodiment of the present application;
[0026] Figure 4 It is a schematic diagram of the overall flowchart of a game save method provided by an embodiment of the present application;
[0027] Figure 5 It is a schematic diagram of the structure of a game save device provided by an embodiment of the present application;
[0028] Figure 6 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present application. Detailed implementation manners
[0029] The following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only some embodiments of the present application, rather than all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative efforts belong to the scope of protection of the present application.
[0030] The embodiments of the present application provide a game save method, device, storage medium, and electronic device. Among them, the game save device can be integrated in the electronic device, and the electronic device can be a server or a terminal device, etc.
[0031] Among them, the server can be an independent physical server, a server cluster or a 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, network acceleration services (Content Delivery Network, CDN), and big data and artificial intelligence platforms. The terminal can include, but is not limited to, mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle-mounted terminals, aircraft, etc. The terminal and the server can be directly or indirectly connected through wired or wireless communication methods, and this application does not make any restrictions here.
[0032] Please refer to Figure 1 , taking the example that the save device in the game is integrated in the electronic device, Figure 1 is a schematic diagram of the implementation scenario of the save method in the game provided by the embodiment of this application. Among them, the electronic device can respond to the save event for the target game, determine the target blueprint object that the target game is running at the time of the save event; serialize the target blueprint attributes corresponding to the target blueprint object to obtain attribute serialization information; determine the target asynchronous node that is being executed in the target blueprint object; serialize the target asynchronous node to obtain node serialization information; and save the target blueprint object based on the attribute serialization information and the node serialization information.
[0033] It should be noted that Figure 1 the schematic diagram of the implementation environment scenario of the save method in the game shown is only an example. The implementation environment scenario of the save method in the game described in the embodiment of this application is to more clearly illustrate the technical solution of the embodiment of this application, and does not constitute a limitation on the technical solution provided by the embodiment of this application. Those of ordinary skill in the art know that with the evolution of data processing and the emergence of new business scenarios, the technical solution provided by this application is equally applicable to similar technical problems.
[0034] The solution provided by the embodiment of this application is specifically described through the following embodiments. It should be noted that the description order of the following embodiments does not limit the preferred order of the embodiments.
[0035] This embodiment will be described from the perspective of the save device in the game. The save device in the game can be specifically integrated in the electronic device, and the electronic device can be a terminal and / or a server, and this application does not make any restrictions here.
[0036] Please refer to Figure 2 , Figure 2 is a flowchart of the save method in the game provided by the embodiment of this application. The save method in the game includes:
[0037] In step 101, in response to a save event for a target game, determine the target blueprint object that the target game is running at the time of the save event.
[0038] Among them, the target game can be a game that requires saving and loading, and can be a game implemented based on blueprints. A blueprint (BP for short) is a visual scripting system in the Unreal Engine, aiming to simplify the game development process, enabling developers to implement complex game logics and interactions without deeply writing code. The save event can be an event that triggers saving the target game. Optionally, the save event can be triggered by a player or by the system. For example, a save control can be provided in the game interface of the target game, and the player can trigger the save event for the target game by triggering this save control. Also, for example, the system can regularly trigger the save event for the target game to save the game progress of the target game. Saving can be referred to as a save system or save / load. The save system in a single-player game refers to a mechanism in the game for saving and loading the player's progress, which allows players to save their game states at specific time points to continue the game at a later time. The target blueprint object can be a blueprint object that the target game is moving at the time of the save event, and this blueprint object can be an object instance created based on the blueprint system.
[0039] In the blueprint system of the Unreal Engine, a node is the basic element that composes the blueprint graphical logic. Each node represents a specific operation, event, or data processing function. By connecting these nodes together, developers can create complex game logics and behaviors. Nodes are some objects, such as events, function calls, control flow operations, variables, etc., which can be used in the graph to define the functions of a specific graph and the blueprint containing it. The node graph uses events and function calls to execute the response actions of game events related to the blueprint. Among them, nodes can include synchronous nodes and asynchronous nodes. A synchronous node can refer to a node where the start and completion of its execution occur in the same frame, such as reading or modifying a value, or printing a log, etc. An asynchronous node can also be called a delayed node. Different from synchronous nodes, after the execution of the node is triggered, it may not be completed in this frame. For example, for the "wait for N rounds" node, since this node starts waiting when it starts executing and needs to reach N rounds before triggering the callback or pin for execution completion and triggering the connected nodes or processes, the "wait for N rounds" node is an asynchronous node.
[0040] To allow players to save their game states at specific time points so that they can continue the game at a later time, game saving is required. For the save and load of gameplay implemented based on blueprints, it is necessary to be able to continue execution from the previously interrupted process during loading. For example, if the execution of a blueprint object before saving was in an asynchronous node, and the asynchronous node itself expected to execute the subsequent logic after a 3-second delay. Suppose the save is triggered when the current delay reaches 1 second. During loading, it is still expected to continue from this asynchronous node, that is, wait for 2 more seconds before proceeding with the subsequent logic.
[0041] In step 102, serialize the target blueprint properties corresponding to the target blueprint object to obtain property serialization information.
[0042] Among them, the target blueprint property can be the blueprint property of the target blueprint object. Blueprint properties are variables used to store data in a blueprint class. The property serialization information can be the result obtained after serializing the target blueprint property. Serialization can be a process of converting a data structure or object into a format that can be stored or transmitted. This mechanism is usually used to convert complex data structures (such as objects, lists, dictionaries, etc.) into byte streams or strings for storage on network transmissions, file saves, or other storage media.
[0043] Among them, there can be multiple ways to serialize the target blueprint properties corresponding to the target blueprint object. For example, the target blueprint property can include a first blueprint property and a second blueprint property. The second blueprint property is used to store object reference information, and the object reference information indicates the object referenced by the second blueprint property. Thus, the first serialization method can be used to serialize the first blueprint property of the target blueprint object; the second serialization method can be used to serialize the second blueprint property of the target blueprint object based on the object reference information.
[0044] Among them, the first blueprint property can be a regular blueprint property. For example, it can be a property of types such as integer (Int) or string (String). The second blueprint property can be a special type of blueprint property. For example, it can be an object reference property (UObject property). The UObject property is a special type of property used to store a reference to an object of the UObject type. UObject is the base class of all objects in the Unreal Engine. Therefore, the UObject property can reference any object inherited from UObject. The object reference information can be the information stored in the second blueprint property and can be used to indicate the object referenced by the second blueprint property. The object reference information can include target object information, type name, outer object information, serialization status, etc. of the target object to which the second blueprint property belongs. The target object can be the object to which the second blueprint property belongs. The object can be a UObject object, a node, or a blueprint object, etc. The target object information can be the object path or object name of the target object. The outer object information (Outer) can be used to represent the hierarchical relationship and ownership relationship between objects. The outer object can be the parent object of the target object. Outer is a member of the UObject class, representing the outer object (Outer Object) of an object, that is, the "parent object" or "owning object" of the object. Through the Outer mechanism, the Unreal Engine can effectively manage the hierarchical structure and lifecycle of objects. The first serialization method can be a serialization method implemented based on the serialization mechanism provided by the Unreal Engine itself. The second serialization method can be a serialization method based on the object reference information. The serialization status can be the status indicating whether the target object is being serialized.
[0045] In the embodiments of the present application, for a blueprint object instance, the synchronous nodes (i.e., nodes that can be executed within one frame without delay) may not need to be archived. If the output of the synchronous nodes is meaningful for the save / load of the blueprint gameplay, it can be represented as a property of the blueprint object, that is, a blueprint property. For the asynchronous nodes among them, if they have not been executed when archiving, they do not need to be archived, and only the executing asynchronous nodes need to be archived. Therefore, for the save / load of the gameplay implemented based on blueprints, the embodiments of the present application simplify the save / load of the blueprint gameplay to the save / load problem of blueprint properties and executing asynchronous nodes, thereby simplifying the operation process and workload of saving and loading the blueprint gameplay, and effectively improving the save / load efficiency in games based on blueprints.
[0046] Among them, the save / load of blueprint attributes can include two parts: the save / load of regular attributes (i.e., the first blueprint attributes) and the save / load of UObject attributes (i.e., the second blueprint attributes). The save / load of the first blueprint attributes can be implemented based on the serialization mechanism provided by the Unreal Engine. However, this is not the case for the save / load of the second blueprint attributes. Because the conventional solution for saving and loading UObjects in the Unreal Engine is to use the property serialization interface (FObjectAndNameAsStringProxyArchive) for serialization. Then, this property serialization interface only saves the name of the object, which will cause the serialization of blueprint attributes to fail when the object is not loaded. Therefore, it is necessary to use the second serialization method provided in the embodiments of this application to serialize the second blueprint attributes.
[0047] Among them, when using the second serialization method, there are various ways to serialize the second blueprint attributes of the target blueprint object based on the object reference information. For example, the object reference information corresponding to the second blueprint attributes can be obtained. The object reference information includes at least one of the target object information, type name, outer object information, and serialization status of the target object to which the second blueprint attributes belong. Using the second serialization method, the object reference information is serialized, and the target object is serialized to complete the serialization of the second blueprint attributes of the target blueprint object.
[0048] Among them, the second serialization method can be a serialization method implemented based on the target property serialization interface. The target property serialization interface (FObjectPropertySerializableProxyArchive) can be a proxy archive class (FNameAsStringProxyArchive) that inherits from the class in the Unreal Engine for serializing and deserializing data. In addition to saving the object name, it also saves information such as the type name (abbreviated as class name) and Outer. And when the object cannot be found or loaded during deserialization, an object can be created to ensure that the object can be obtained correctly. Then, its corresponding serialization interface (Serialize) can be called to trigger the serialization of data such as properties and objects. At the same time, before Serialize, the target property serialization interface will determine whether the object to which the second blueprint attributes belong is being serialized. If it is being serialized, the subsequent serialization operations will be skipped; otherwise, the serialization operation of this object will be entered to ensure that there will be no circular reference problem that causes a dead loop.
[0049] In one embodiment, taking the serialization of blueprint properties with the second blueprint property being a UObject property as an example, an enumeration type named "OBJECTMARK_Serializing" can be added to the UObject in the object mark type (EObjectMark) to indicate whether the UObject is being serialized. Here, EObjectMark is an enumeration type used to identify the mark status of the UObject. Then, a target property serialization interface can be created. The name of the target property serialization interface can be "FObjectPropertySerializableProxyArchive", and it can inherit from FArchiveProxy of the proxy archive class FNameAsStringProxyArchive. FArchiveProxy is a base class used to implement the modification of the behavior of other archive types. Then, its interface for serializing objects of the UObject type (operator<<(UObject*& Obj)) can be overloaded so that this interface can be used to handle the serialization of UObject properties.
[0050] Among them, in the Unreal Engine, overloading operator<< is used to customize the serialization logic of objects. The overloading of UObject*& Obj is usually used to write the state of UObject properties into an archive object (FArchive) or read the state of UObject properties from the archive object. When serializing UObject properties, object reference information such as the object path, type name, Outer, and whether it is being serialized of the target object can be serialized, and a serialization mark (OBJECTMARK_Serializing) can be added to mark whether the target object is being serialized. Then, the Serialize interface of the target property serialization interface FObjectPropertySerializableProxyArchive can be called to serialize the object.
[0051] For example, please refer to Figure 3a , Figure 3aIt is a schematic diagram of the serialization process of a game save method provided by an embodiment of the present application. Through the FObjectPropertySerializableProxyArchive, the object name, class name, Outer, and the execution flag indicating whether the object is being serialized corresponding to the second blueprint property of the target blueprint object can be serialized. Then, it can be determined whether the object is in serialization. If it is in serialization, no subsequent serialization operation is performed. If it is not in serialization, the object is marked as being in serialization. Thus, the object can be serialized based on the FObjectPropertySerializableProxyArchive, and then the Serialize interface of the object can be called to further serialize properties, etc.
[0052] In step 103, determine the target asynchronous node that is being executed in the target blueprint object.
[0053] Among them, the target asynchronous node can be an asynchronous node that is being executed in the target blueprint object.
[0054] Among them, there are various ways to determine the target asynchronous node that is being executed in the target blueprint object. For example, the blueprint object corresponding to the target game can have a preset property, and the preset property can be used to store an asynchronous node list. The asynchronous node list can be used to record the asynchronous nodes that are being executed in the blueprint object. Thus, the target asynchronous node list corresponding to the target blueprint object can be obtained from the preset property corresponding to the target blueprint object; based on the target asynchronous node list, the target asynchronous node that is being executed in the target blueprint object can be determined.
[0055] Among them, the preset property (ArchivedNodes) can be a property set for the blueprint object in advance, and can be used to represent the list of asynchronous nodes in execution. The target asynchronous node list can be the asynchronous node list corresponding to the target blueprint object.
[0056] Among them, the target blueprint object can be configured to inherit from a node management class. The node management class can define a preset property, and the preset property can be configured with an archive label. The archive label can be used to indicate that the content stored in the preset property needs to be archived.
[0057] Optionally, the node management class can define a registered node interface and an unregistered node interface. Before determining the target asynchronous node that is being executed in the target blueprint object, when the target asynchronous node in the target blueprint object is executed, the target blueprint object to which it belongs can be determined through the target asynchronous node, and the corresponding node registration interface of the target blueprint object can be called to add the target asynchronous node to the target asynchronous node list corresponding to the target blueprint object. In addition, when the target asynchronous node finishes execution, the corresponding unregistration node interface of the target blueprint object can be called through the target asynchronous node to delete the target asynchronous node from the target asynchronous node list corresponding to the target blueprint object.
[0058] To serialize the target asynchronous node that is being executed, the asynchronous nodes in the blueprint object need to be bound to the blueprint object to which they belong. Specifically, all blueprint objects that need to consider saving and loading inherit from the node management class (ArchiveNodeManager). ArchiveNodeManager defines a preset property (ArchivedNodes) marked with an archive label (SaveGame) to represent the asynchronous node list where the executing asynchronous nodes are located, and this property is marked for archiving.
[0059] In addition, ArchiveNodeManager can define two functions, namely the registered node interface function (RegisterNode) and the unregistered node interface function (UnregisterNode), which are used to add the executing asynchronous nodes to ArchivedNodes or remove them from it.
[0060] Among them, when the blueprint object is executed, it will automatically trigger the execution of the asynchronous node based on the actual situation, that is, call its corresponding trigger function (Activate). The Activate function is usually used to trigger the execution of a certain node or task. When the asynchronous node is executed, it can obtain the blueprint object to which it belongs, call its RegisterNode interface, and add itself to the asynchronous node list ArchivedNodes of the blueprint object to which it belongs for recording the executing asynchronous nodes. After the asynchronous node finishes execution, it can call its UnregisterNode interface to remove itself from the asynchronous node list of the blueprint object to which it belongs.
[0061] Optionally, the ArchiveNodeManager can also define two functions, namely the Load function and the Save function. When saving and loading the blueprint object, some operations different from normal execution can be performed as needed, such as initialization operations. At the same time, the Load function and the Save function of the asynchronous nodes in the asynchronous node list ArchivedNodes can be called to do similar things. For example, some operations related to updating or obtaining the callback function parameters of the asynchronous nodes can be performed. The specific operations can be set according to the actual business requirements, and the embodiments of the present application do not limit this here.
[0062] In step 104, the target asynchronous node is serialized to obtain node serialization information.
[0063] Among them, the node serialization information can be the result of serializing the target asynchronous node.
[0064] Among them, there are multiple ways to serialize the target asynchronous node to obtain node serialization information. For example, the node attributes of the target asynchronous node can be serialized, and the callback function corresponding to the target asynchronous node can be serialized to obtain node serialization information.
[0065] Among them, the node attributes can be the attributes of the target asynchronous node, and the callback function can be the callback function bound to the target asynchronous node. The callback function can be a delegate callback function.
[0066] Among them, there are multiple ways to serialize the callback function corresponding to the target asynchronous node. For example, the delegate attribute corresponding to the target asynchronous node can be obtained; the callback list bound to the delegate attribute can be obtained; the callback function information in the callback list can be serialized to complete the serialization of the callback function corresponding to the target asynchronous node.
[0067] Among them, the delegate attribute can be a special attribute that allows an object to store a reference to a function or method as an attribute. The callback list can be a list composed of callback functions bound to the delegate attribute, and the callback function information can be the information to be archived corresponding to the callback function. For example, it can include information such as the name of the callback function and the name of the object to which the callback function belongs.
[0068] In the embodiments of the present application, the save and load of an asynchronous node during execution may include three parts: the save and load of the attributes of the asynchronous node, the operation differentiation during the asynchronous node load, and the save and load of the asynchronous node callback. Among them, the save and load of the attributes of the asynchronous node will be automatically serialized based on the serialization mechanism of the Unreal Engine when the asynchronous node is serialized. The operation differentiation during the asynchronous node save and load will call the save function or the load function based on the business-specific logic when the asynchronous node load operation is triggered for differentiation and implementation. The save and load of the asynchronous node callback is implemented by obtaining all the delegate attributes corresponding to the multicast delegate implementation class (FMulticastScriptDelegate), that is, the callback list (InvocationList), when the asynchronous node is serialized, so that the names, function names, and target objects of all the callbacks in the callback list can be serialized.
[0069] Among them, FMulticastScriptDelegate is a class used to implement the multicast delegate, which allows an event to notify multiple listeners.
[0070] In one embodiment, for the serialization of the asynchronous node, all asynchronous nodes that need to consider save and load need to inherit the asynchronous node class (UArchiveNode). Among them, the serialization (Serialize) interface of UArchiveNode can be overridden to call the customized delegate implementation function (SerializeDelegate) to serialize the delegate callback corresponding to the target asynchronous node.
[0071] Among them, in the delegate implementation function SerializeDelegate, all the delegate attributes of the target asynchronous node can be obtained through reflection or other operations, and the bound callback list, that is, the InvocationList attribute, can be obtained. Then, the function names and target objects among them can be saved and all serialized. UArchiveNode can also define two functions, namely the Load function and the Save function, which can be used by subclasses to do some logic different from the first execution during save and load. The attributes of the asynchronous node that need to be archived can be marked as SaveGame and will be automatically serialized based on the property serialization rules of UObject when it is serialized itself.
[0072] In step 105, archive the target blueprint object based on the property serialization information and the node serialization information.
[0073] Among them, the save method in the game provided by the embodiments of the present application abstracts the save problem of the gameplay implemented based on blueprints into the serialization problem of blueprint attributes and the asynchronous nodes being executed, and the serialization problem of asynchronous nodes itself is the serialization problem of the delegate callback attributes therein. To implement the save method in the game provided by the embodiments of the present application, it is necessary to bind the asynchronous nodes to the belonging blueprint objects so that the asynchronous nodes can be managed by the belonging blueprint objects, and it is necessary to support the independent serialization of UObject attributes, that is, to enable UObject attributes to be correctly serialized without the need to be loaded first. In addition, it is necessary to support the serialization of the delegate callbacks of asynchronous nodes so that the delegate callbacks of asynchronous nodes can be correctly serialized, so that the delegate callbacks of asynchronous nodes can restore the bindings at the time of saving after loading. In this way, the save and load of the blueprint business logic can be simplified to the save and load of blueprint attributes and the callbacks of asynchronous nodes, eliminating the dependence on blueprint objects and asynchronous nodes, improving work efficiency, and benefiting from the tag-based UObject attribute serialization mechanism, making the save of blueprint gameplay also have good compatibility. Furthermore, the SerializeDelegate interface for the serialization of asynchronous nodes can simplify the save and load of asynchronous operations to the save and load of the callback functions of asynchronous nodes and the target objects, eliminating the dependence of the save and load work on the number of asynchronous nodes and without the need to modify the asynchronous nodes. In addition, the UObject attribute serialization scheme customized based on the embodiments of the present application can effectively solve the problem that UObject attributes cannot be normally serialized and avoid circular references, effectively improving the save and load efficiency of the gameplay implemented based on blueprints.
[0074] In one embodiment, the target blueprint object after saving can be loaded. Specifically, in response to the load event for the saved target blueprint object, the attribute serialization information can be deserialized, and the node serialization information can be deserialized to obtain the deserialization result corresponding to the target blueprint object; based on the deserialization result, the load process for the saved target blueprint object can be completed.
[0075] Among them, the load event can be an event for loading the saved target blueprint object. The deserialization result can be the result after deserializing the attribute serialization information and the node serialization information corresponding to the target blueprint object.
[0076] Among them, there can be multiple ways to deserialize the property serialization information. For example, the property serialization information can include the property serialization information corresponding to the second blueprint property, and the object reference information in the property serialization information can be deserialized; based on the deserialized object reference information, the target object information of the target object to which the second blueprint property belongs can be obtained; based on the target object information, the target object can be obtained, and the target object can be deserialized to complete the deserialization of the property serialization information.
[0077] Among them, the target object information can be information indicating the target object. For example, it can include the storage path or object name of the target object. The target object can be the object to which the second blueprint property belongs.
[0078] Among them, there can be multiple ways to obtain the target object based on the target object information. For example, based on the target object information, the target object can be searched for in the Unreal Engine. When the target object cannot be found, the target object can be loaded based on the target object information to obtain the target object.
[0079] Optionally, if the target object cannot be obtained based on the target object information, then based on the deserialized object reference information, the type name of the target object and the outer object information of the outer object corresponding to the target object are loaded; based on the outer object information and the type name, the target object is created; the created target object is deserialized to complete the deserialization of the property serialization information.
[0080] In one embodiment, when deserializing the second blueprint property, the object path, type name, Outer, and whether it is being serialized, etc. of the second blueprint property in the property serialization information can be deserialized first. Then, the target object to which the second blueprint property belongs can be searched for through the object finding function (FindObject). When it cannot be found, the object loading function (LoadObject) can be used to load the target object. When the loading fails, the object creation function (NewObject) can be called according to Outer and the type name of the target object to create the target object to ensure that the target object can be correctly obtained.
[0081] For example, please refer to Figure 3b , Figure 3bIt is a schematic diagram of the deserialization process of a game save method provided by an embodiment of the present application. When deserializing UObject properties, the property serialization information can be deserialized first. Information such as the object name, class name, Outer, and execution flag of the target object corresponding to the second blueprint property can be deserialized, and then an attempt is made to load the object. For example, the target object can be found in the Unreal Engine based on the object name. When the object cannot be found, the target object can be loaded based on the object name. When the target object cannot be loaded, the outer object Outer of the target object can be found based on the deserialized Outer information. Then, the class to which the target object belongs can be loaded or found based on the type name of the target object. Then, an object can be created based on Outer and the class to obtain the target object. Then, it can be determined whether the target object is in serialization. If the target object is not in serialization, the target object can be deserialized based on the created target object and the property serialization information, based on FObjectPropertySerializableProxyArchive. Then, the Serialize interface of the target object can be called to further deserialize.
[0082] In one embodiment, please refer to Figure 4 , Figure 4 It is a schematic diagram of the overall process of a game save method provided by an embodiment of the present application. When performing blueprint save / load, the blueprint (which can also be called a blueprint object) can be serialized first, that is, including the serialization of blueprint properties and asynchronous nodes in execution. The serialization of asynchronous nodes includes the serialization of the properties of asynchronous nodes and the delegate callback properties of asynchronous nodes.
[0083] When performing blueprint save and load operations, the blueprint objects can be saved and loaded as needed according to the business logic. The core operation is to call the interface (such as SerializeUObject) customized in the embodiments of this application that can correctly serialize UObject properties to serialize the blueprint objects, or call the deserialization interface (DeserializeUObject) customized in the embodiments of this application to deserialize the objects. SerializeUObject mainly serializes the objects based on the customized FObjectPropertySerializableProxyArchive and calls its Serialize interface for further serialization. Similarly, the deserialization interface DeserializeUObject also performs deserialization based on FObjectPropertySerializableProxyArchive. First, the type name of the object needs to be loaded, and then the class loading function (StaticLoadClass) is called to load the type of the object. After that, NewObject is called according to the type to construct a UObject object, and then the Serialize interface of UObject is called to deserialize the target blueprint object. When serializing the blueprint, the serialization of the properties marked with SaveGame can be triggered, including the list of asynchronous nodes being executed ArchivedNodes, and the Serialize interfaces of all asynchronous nodes in it will also be called. When the blueprint save and load operations are called, the Save and Load functions of the blueprint customization interface are called to perform the customization operations for blueprint save and load and the customization operations for the asynchronous nodes therein.
[0084] Among them, StaticLoadClass is a function for dynamically loading a class (UClass). It allows the corresponding class object to be dynamically loaded and obtained according to the name of the class at runtime.
[0085] Blueprints is a visual scripting system that enables developers to easily create game logic and interactions through a graphical interface without delving deep into programming. However, there is no good solution for saving the gameplay based on Blueprints because the Blueprints diagrams are data only available in the Blueprint editor. During runtime, the execution of Blueprints is parsed and executed through a virtual machine, and this execution process cannot be saved. Evidently, due to the limitations of the Blueprints implementation principle, the gameplay implemented based on Blueprints itself does not have a save mechanism. Regarding the execution principle mechanism of Blueprints in the Unreal Engine, the Blueprints in the Unreal Engine are compiled into bytecode and parsed and executed through the Blueprint virtual machine. Therefore, in the released version of the game, the nodes, connections, etc. in the Blueprints are actually inaccessible as they are data exclusive to the Blueprint editor. The execution flow of Blueprints is also a logic that cannot be interrupted and saved. Thus, saving the functionality of the gameplay based on Blueprints is not about saving or serializing the Blueprint assets themselves, but rather saving the gameplay or process implemented within them.
[0086] In the existing methods for saving gameplay based on Blueprints, it is necessary to design the states or events of the Blueprints based on asynchronous nodes. For each asynchronous node, there needs to be one or more corresponding states or events, which can be referred to as the coupling of Blueprints to asynchronous nodes. Additionally, increasing or decreasing asynchronous nodes also requires modifying the Blueprints, which leads to a linear increase in the workload. Finally, modifying the gameplay implemented based on Blueprints also brings about modifications to various state and event attributes, resulting in compatibility issues, i.e., old saves may not be compatible with the new Blueprints. Regarding the issue of saving UObject properties, there is a problem with the serialization of UObject properties of the UObject objects in the current Unreal Engine. UObject serializes based on FObjectAndNameAsStringProxyArchive, which only saves the object's path. When the object does not exist, it cannot be serialized properly. And when this serialization problem is solved, a circular reference problem will occur. Since UObject itself is a reference type, if UObject B in the UObject property of UObject A references UObject A again, there will be a dead loop problem, which is also an asynchronous node callback or delegate property saving problem that urgently needs to be solved. Moreover, the delegate callback property defined in the asynchronous nodes of the Unreal Engine is itself a type (TMulticastScriptDelegate) used to define and manage multicast delegates. Its serialization is the same as that of a regular reference, only storing the pointer to the callback-bound reference. When directly serializing it, when restarting the game and loading the save, the relevant objects will not be deserialized. The existing save methods in games are inefficient.
[0087] To this end, the embodiments of the present application abstract the archive of the blueprint gameplay into the archives of blueprint attributes and asynchronous nodes, and at the same time solve the serialization problem of UObject attributes in the Unreal Engine and the loop engine problem. In addition, the save / load method in the game provided by the embodiments of the present application does not require modifying the blueprint and has no requirements for asynchronous nodes, reducing the workload from being directly related to the blueprint and nodes to being irrelevant, and further improving the work efficiency, stability, and compatibility of the archive of gameplay functions based on blueprints.
[0088] As can be seen from the above, the embodiments of the present application determine the target blueprint object that the target game is running at the time of the save event in response to the save event for the target game; serialize the target blueprint attributes corresponding to the target blueprint object to obtain attribute serialization information; determine the target asynchronous node that is being executed in the target blueprint object; serialize the target asynchronous node to obtain node serialization information; and archive the target blueprint object based on the attribute serialization information and the node serialization information. In this way, by simplifying the save of the target game to the save of the blueprint attributes of the target blueprint object and the asynchronous nodes being executed, it is possible to efficiently save the gameplay implemented based on blueprints, avoid the problems of increased workload and poor compatibility caused by modifying the blueprint object during game saving, and thus effectively improve the save efficiency in the game.
[0089] To better implement the above method, the embodiments of the present invention also provide a save device in a game. The save device in the game can be integrated in an electronic device, and the electronic device can be a terminal or a server.
[0090] For example, as Figure 5 shown, it is a schematic structural diagram of the save device in the game provided by the embodiments of the present application. The save device in the game can include a first determination unit 201, a first serialization unit 202, a second determination unit 203, a second serialization unit 204, and an archive unit 205, as follows:
[0091] The first determination unit 201 is configured to determine the target blueprint object that the target game is running at the time of the save event in response to the save event for the target game;
[0092] The first serialization unit 202 is configured to serialize the target blueprint attributes corresponding to the target blueprint object to obtain attribute serialization information;
[0093] The second determination unit 203 is configured to determine the target asynchronous node that is being executed in the target blueprint object;
[0094] The second serialization unit 204 is configured to serialize the target asynchronous node to obtain node serialization information;
[0095] An archive unit 205 for archiving a target blueprint object based on attribute serialization information and node serialization information.
[0096] In some embodiments, a second serialization unit 204 is configured to:
[0097] Serialize the node attributes of a target asynchronous node and serialize the callback function corresponding to the target asynchronous node to obtain node serialization information.
[0098] In some embodiments, the above serialization of the callback function corresponding to the target asynchronous node is specifically configured to:
[0099] Obtain the delegate attribute corresponding to the target asynchronous node;
[0100] Obtain the callback list bound to the delegate attribute;
[0101] Serialize the callback function information in the callback list to complete the serialization of the callback function corresponding to the target asynchronous node.
[0102] In some embodiments, the target blueprint attribute includes a first blueprint attribute and a second blueprint attribute. The second blueprint attribute is used to store object reference information, and the object reference information indicates the object referenced by the second blueprint attribute. A first serialization unit 202 is configured to:
[0103] Serialize the first blueprint attribute of the target blueprint object using a first serialization method;
[0104] Based on the object reference information, serialize the second blueprint attribute of the target blueprint object using a second serialization method.
[0105] In some embodiments, the above serialization of the second blueprint attribute of the target blueprint object based on the object reference information using the second serialization method is specifically configured to:
[0106] Obtain the object reference information corresponding to the second blueprint attribute, where the object reference information includes at least one of target object information, type name, outer object information, and serialization status of the target object to which the second blueprint attribute belongs;
[0107] Using the second serialization method, serialize the object reference information and serialize the target object to complete the serialization of the second blueprint attribute of the target blueprint object.
[0108] In some embodiments, the blueprint object corresponding to the target game has preset attributes. The preset attributes are used to store an asynchronous node list, and the asynchronous node list is used to record the asynchronous nodes being executed in the blueprint object;
[0109] A second determination unit 203 is configured to:
[0110] Obtain the target asynchronous node list corresponding to the target blueprint object from the preset attributes corresponding to the target blueprint object;
[0111] Based on the target asynchronous node list, determine the target asynchronous node that is being executed in the target blueprint object.
[0112] In some embodiments, the target blueprint object is configured to inherit from a node management class, and the node management class defines preset attributes. The preset attributes are configured with an archive tag, and the archive tag is used to indicate that the content stored in the preset attributes needs to be archived.
[0113] In some embodiments, the node management class defines a registered node interface and an unregistered node interface. The archive device in the game further includes a node addition unit for:
[0114] When the target asynchronous node in the target blueprint object is executed, determine the target blueprint object to which the target asynchronous node belongs through the target asynchronous node, call the node registration interface corresponding to the target blueprint object, and add the target asynchronous node to the target asynchronous node list corresponding to the target blueprint object;
[0115] The archive device in the game further includes a node removal unit for:
[0116] When the target asynchronous node finishes execution, call the unregistered node interface corresponding to the target blueprint object through the target asynchronous node, and delete the target asynchronous node from the target asynchronous node list corresponding to the target blueprint object.
[0117] In some embodiments, the archive device in the game further includes a load unit for:
[0118] In response to a load event for the archived target blueprint object, deserialize the attribute serialization information and deserialize the node serialization information to obtain a deserialization result corresponding to the target blueprint object;
[0119] Based on the deserialization result, complete the load processing of the archived target blueprint object.
[0120] In some embodiments, the attribute serialization information includes the attribute serialization information corresponding to the second blueprint attribute. The above deserialization of the attribute serialization information is specifically used for:
[0121] Deserialize the object reference information in the attribute serialization information;
[0122] Based on the deserialized object reference information, obtain the target object information of the target object to which the second blueprint attribute belongs;
[0123] Based on the target object information, obtain the target object and deserialize the target object to complete the deserialization of the attribute serialization information.
[0124] In some embodiments, the save device in the game further includes an object creation unit for:
[0125] If the target object cannot be obtained based on the target object information, then based on the deserialized object reference information, load the type name of the target object and the outer object information of the outer object corresponding to the target object;
[0126] Create the target object based on the outer object information and the type name;
[0127] Deserialize the created target object to complete the deserialization of the attribute serialization information.
[0128] In specific implementation, each of the above units can be implemented as an independent entity, or can be combined arbitrarily and implemented as the same or several entities. For the specific implementation of each of the above units, reference can be made to the foregoing method embodiments, which will not be elaborated herein.
[0129] As can be seen from the above, in the embodiment of the present application, the first determination unit 201 determines the target blueprint object that the target game is running at the time of the save event in response to the save event for the target game; the first serialization unit 202 serializes the target blueprint attributes corresponding to the target blueprint object to obtain attribute serialization information; the second determination unit 203 determines the target asynchronous node that is being executed in the target blueprint object; the second serialization unit 204 serializes the target asynchronous node to obtain node serialization information; the save unit 205 archives the target blueprint object based on the attribute serialization information and the node serialization information. In this way, by simplifying the save of the target game to the save of the blueprint attributes of the target blueprint object and the asynchronous nodes that are being executed, it is possible to achieve efficient saving of the game play implemented based on the blueprint, and avoid the problems of increased workload and poor compatibility caused by modifying the blueprint object during game saving, thereby effectively improving the save efficiency in the game.
[0130] The embodiment of the present application also provides an electronic device, as Figure 6 shown, which shows the structural schematic diagram of the electronic device involved in the embodiment of the present application. The electronic device can be a terminal or a server. Specifically:
[0131] The electronic device 300 includes a processor 301 having one or more processing cores, a memory 302 having one or more computer-readable storage media, and a computer program stored on the memory 302 and executable on the processor. Among them, the processor 301 is electrically connected to the memory 302. Those skilled in the art can understand that the structure of the electronic device shown in the figure does not constitute a limitation on the electronic device, and it may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.
[0132] The processor 301 is the control center of the electronic device 300, connecting various parts of the entire electronic device 300 through various interfaces and lines. By running or loading software programs and / or modules stored in the memory 302, and by calling data stored in the memory 302, it executes various functions of the electronic device 300 and processes data, thereby monitoring the entire electronic device 300.
[0133] In the embodiment of the present application, the processor 301 in the electronic device 300 will load the instructions corresponding to the processes of one or more application programs into the memory 302 according to the following steps, and the processor 301 will run the application programs stored in the memory 302 to achieve various functions:
[0134] In response to an archive event for a target game, determine the target blueprint object that the target game is running at the time of the archive event;
[0135] Serialize the target blueprint attributes corresponding to the target blueprint object to obtain attribute serialization information;
[0136] Determine the target asynchronous node that is being executed in the target blueprint object;
[0137] Serialize the target asynchronous node to obtain node serialization information;
[0138] Archive the target blueprint object based on the attribute serialization information and the node serialization information.
[0139] This solution can determine the target blueprint object that the target game is running when a save event for the target game occurs; serialize the target blueprint attributes corresponding to the target blueprint object to obtain attribute serialization information; determine the target asynchronous nodes that are executing in the target blueprint object; serialize the target asynchronous nodes to obtain node serialization information; and archive the target blueprint object based on the attribute serialization information and the node serialization information. In this way, by simplifying the saving of the target game to the saving of the blueprint attributes of the target blueprint object and the asynchronous nodes that are executing, it is possible to achieve efficient saving of game play implemented based on blueprints, avoiding the problems of increased workload and poor compatibility caused by modifying the blueprint object during game saving, thereby effectively improving the saving efficiency in the game.
[0140] For the specific implementation of each of the above operations, reference can be made to the previous embodiments and will not be elaborated here.
[0141] Optionally, as Figure 6 shown, the electronic device 300 further includes: a touch display screen 303, a radio frequency circuit 304, an audio circuit 305, an input unit 306, and a power supply 307. Among them, the processor 301 is electrically connected to the touch display screen 303, the radio frequency circuit 304, the audio circuit 305, the input unit 306, and the power supply 307 respectively. Those skilled in the art can understand that Figure 6 the structure of the electronic device shown in
[0142] The touch display screen 303 can be used to display a graphical user interface and receive operation instructions generated by a user acting on the graphical user interface. The touch display screen 303 may include a display panel and a touch panel. Among them, the display panel can be used to display information input by the user or information provided to the user, as well as various graphical user interfaces of the electronic device. These graphical user interfaces can be composed of graphics, text, icons, videos, and any combination thereof. Optionally, the display panel can be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc. The touch panel can be used to collect touch operations of the user on or near it (such as operations of the user using a finger, a stylus, or any suitable object or accessory on or near the touch panel), and generate corresponding operation instructions, and the operation instructions execute the corresponding program. Optionally, the touch panel can include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the touch orientation of the user, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it to the processor 301, and can receive and execute the commands sent by the processor 301. The touch panel can cover the display panel. When the touch panel detects a touch operation on or near it, it is transmitted to the processor 301 to determine the type of touch event. Subsequently, the processor 301 provides a corresponding visual output on the display panel according to the type of touch event. In the embodiment of the present application, the touch panel and the display panel can be integrated into the touch display screen 303 to implement input and output functions. However, in some embodiments, the touch panel and the touch panel can be implemented as two independent components to implement input and output functions. That is, the touch display screen 303 can also be used as a part of the input unit 306 to implement the input function.
[0143] The radio frequency circuit 304 can be used to transmit and receive radio frequency signals to establish wireless communication with a network device or other electronic devices through wireless communication, and transmit and receive signals with the network device or other electronic devices.
[0144] The audio circuit 305 can be used to provide an audio interface between the user and the electronic device through a speaker and a microphone. The audio circuit 305 can transmit the electrical signal converted from the received audio data to the speaker, and the speaker converts it into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 305 and then converted into audio data. After the audio data is output to the processor 301 for processing, it is transmitted through the radio frequency circuit 304 to, for example, another electronic device, or the audio data is output to the memory 302 for further processing. The audio circuit 305 may also include an earphone jack to provide communication between a peripheral earphone and the electronic device.
[0145] The input unit 306 can be used to receive input digital, character information or user feature information (such as fingerprint, iris, face information, etc.), and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
[0146] The power supply 307 is used to supply power to each component of the electronic device 300. Optionally, the power supply 307 can be logically connected to the processor 301 through a power management system, so as to realize functions such as management of charging, discharging, and power consumption management through the power management system. The power supply 307 can also include any components such as one or more DC or AC power supplies, a recharge system, a power failure detection circuit, a power converter or inverter, and a power status indicator.
[0147] Although Figure 6 not shown in the figure, the electronic device 300 may also include a camera, a sensor, a Wi-Fi module, a Bluetooth module, etc., which will not be elaborated here.
[0148] In the above embodiments, the descriptions of each embodiment have their own focuses. For parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments. It should be noted that the electronic device provided in the embodiments of the present application and the archive method applicable to games in the above embodiments belong to the same concept. The specific implementation process can be seen in the above method embodiments and will not be elaborated here.
[0149] As can be seen from the above, the electronic device provided in the embodiments of the present application can, by responding to an archive event for a target game, determine a target blueprint object that the target game is running when the archive event occurs; serialize the target blueprint attributes corresponding to the target blueprint object to obtain attribute serialization information; determine a target asynchronous node that is being executed in the target blueprint object; serialize the target asynchronous node to obtain node serialization information; and archive the target blueprint object based on the attribute serialization information and the node serialization information. In this way, by simplifying the archiving of the target game to the archiving of the blueprint attributes of the target blueprint object and the asynchronous nodes that are being executed, it is possible to achieve efficient archiving of gameplays implemented based on blueprints, and avoid the problems of increased workload and poor compatibility caused by modifying the blueprint object during game archiving, thereby effectively improving the archiving efficiency in the game.
[0150] Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by a computer program, or by controlling relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0151] To this end, an embodiment of the present application provides a computer-readable storage medium storing a computer program that can be loaded by a processor to execute the steps in any one of the game save methods provided by the embodiments of the present application. For example, the computer program can execute the following steps:
[0152] In response to a save event for a target game, determine a target blueprint object that the target game is running when the save event occurs;
[0153] Serialize the target blueprint attributes corresponding to the target blueprint object to obtain attribute serialization information;
[0154] Determine the target asynchronous node that is being executed in the target blueprint object;
[0155] Serialize the target asynchronous node to obtain node serialization information;
[0156] Based on the attribute serialization information and the node serialization information, archive the target blueprint object.
[0157] This solution can, in response to a save event for a target game, determine a target blueprint object that the target game is running when the save event occurs; serialize the target blueprint attributes corresponding to the target blueprint object to obtain attribute serialization information; determine the target asynchronous node that is being executed in the target blueprint object; serialize the target asynchronous node to obtain node serialization information; and based on the attribute serialization information and the node serialization information, archive the target blueprint object. In this way, by simplifying the save of the target game to the save of the blueprint attributes of the target blueprint object and the asynchronous nodes that are being executed, it is possible to efficiently save the game play implemented based on the blueprint, and avoid the problems of increased workload and poor compatibility caused by modifying the blueprint object during game saving, thereby effectively improving the save efficiency in the game.
[0158] For the specific implementation of each of the above operations, reference may be made to the previous embodiments and will not be elaborated here.
[0159] Among them, the computer-readable storage medium may include: read-only memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disc, etc.
[0160] Since the computer program stored in the computer-readable storage medium can execute the steps in any one of the game save methods provided by the embodiments of the present application, the beneficial effects achievable by any one of the game save methods provided by the embodiments of the present application can be realized. For details, reference may be made to the previous embodiments and will not be elaborated here.
[0161] Among them, according to one aspect of the present application, a computer program product is provided. The computer program product includes a computer program, and the computer program is stored in a computer-readable storage medium. When a processor of an electronic device reads the computer program from the computer-readable storage medium, the processor executes the computer program, so that the electronic device executes the methods provided in the various alternative implementations provided in the above embodiments.
[0162] The above has introduced in detail a method, device, storage medium and electronic device for archiving in a game provided by the embodiments of the present application. Specific examples are used in this article to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application. At the same time, for those skilled in the art, according to the idea of the present application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present application.
Claims
1. A method for saving files in a game, characterized in that, Including: In response to a save event for a target game, determining a target blueprint object that the target game is running at the time of the save event; Serializing target blueprint attributes corresponding to the target blueprint object to obtain attribute serialization information; Determining a target asynchronous node that is being executed in the target blueprint object; Serializing the target asynchronous node to obtain node serialization information; Based on the attribute serialization information and the node serialization information, archiving the target blueprint object.
2. The method for archiving in the game according to claim 1, characterized in that, The serializing the target asynchronous node to obtain node serialization information includes: Serializing the node attributes of the target asynchronous node and serializing the callback function corresponding to the target asynchronous node to obtain node serialization information.
3. The method for saving files in the game according to claim 2, characterized in that, The serializing the callback function corresponding to the target asynchronous node includes: Obtaining a delegate attribute corresponding to the target asynchronous node; Obtaining a callback list bound to the delegate attribute; Serializing the callback function information in the callback list to complete the serialization of the callback function corresponding to the target asynchronous node.
4. The method for saving a file in the game according to claim 1, characterized in that, The target blueprint attributes include a first blueprint attribute and a second blueprint attribute. The second blueprint attribute is used to store object reference information, and the object reference information indicates an object referenced by the second blueprint attribute. The serializing the target blueprint attributes corresponding to the target blueprint object includes: Serializing the first blueprint attribute of the target blueprint object using a first serialization method; Using a second serialization method to serialize the second blueprint attribute of the target blueprint object based on the object reference information.
5. The method for saving files in a game according to claim 4, wherein The using a second serialization method to serialize the second blueprint attribute of the target blueprint object based on the object reference information includes: Obtaining object reference information corresponding to the second blueprint attribute, where the object reference information includes at least one of target object information, type name, outer object information, and serialization status of the target object to which the second blueprint attribute belongs; Using a second serialization method to serialize the object reference information and serialize the target object to complete the serialization of the second blueprint attribute of the target blueprint object.
6. The method for saving a file in the game according to claim 1, wherein, The blueprint object corresponding to the target game has preset attributes, and the preset attributes are used to store an asynchronous node list, and the asynchronous node list is used to record asynchronous nodes that are being executed in the blueprint object; The determining a target asynchronous node that is being executed in the target blueprint object includes: Obtaining the target asynchronous node list corresponding to the target blueprint object from the preset attributes corresponding to the target blueprint object; Based on the target asynchronous node list, determining a target asynchronous node that is being executed in the target blueprint object.
7. The method for saving files in the game according to claim 6, characterized in that, The target blueprint object is configured to inherit from a node management class, and the node management class defines the preset attributes, and the preset attributes are configured with an archive label, and the archive label is used to indicate that the content stored in the preset attributes needs to be archived.
8. The method for archiving in the game according to claim 7, characterized in that, The node management class defines a registered node interface and an unregistered node interface. Before determining the target asynchronous node that is being executed in the target blueprint object, the method further includes: When the target asynchronous node in the target blueprint object is executed, determine the target blueprint object to which it belongs through the target asynchronous node, call the node registration interface corresponding to the target blueprint object, and add the target asynchronous node to the target asynchronous node list corresponding to the target blueprint object; The method further includes: When the target asynchronous node finishes execution, call the unregistered node interface corresponding to the target blueprint object through the target asynchronous node, and delete the target asynchronous node from the target asynchronous node list corresponding to the target blueprint object.
9. The method for saving game progress according to any one of claims 1 to 8, characterized in that, The method further includes: In response to a read event for the archived target blueprint object, deserialize the attribute serialization information and deserialize the node serialization information to obtain a deserialization result corresponding to the target blueprint object; Based on the deserialization result, complete the read processing of the archived target blueprint object.
10. The method for saving files in the game according to claim 9, wherein, The attribute serialization information includes the attribute serialization information corresponding to the second blueprint attribute. The deserialization of the attribute serialization information includes: Deserialize the object reference information in the attribute serialization information; Based on the deserialized object reference information, obtain the target object information of the target object to which the second blueprint attribute belongs; Based on the target object information, obtain the target object and deserialize the target object to complete the deserialization of the attribute serialization information.
11. The method for saving files in the game according to claim 10, characterized in that, The method further includes: If the target object cannot be obtained based on the target object information, then based on the deserialized object reference information, load the type name of the target object and the outer object information of the outer object corresponding to the target object; Create the target object based on the outer object information and the type name; Deserialize the created target object to complete the deserialization of the attribute serialization information.
12. An archiving device in a game, characterized in that, It includes: A first determination unit, configured to determine a target blueprint object that the target game is running at the time of the save event in response to a save event for the target game; A first serialization unit, configured to serialize the target blueprint attributes corresponding to the target blueprint object to obtain attribute serialization information; A second determination unit, configured to determine a target asynchronous node that is being executed in the target blueprint object; A second serialization unit, configured to serialize the target asynchronous node to obtain node serialization information; A save unit, configured to save the target blueprint object based on the attribute serialization information and the node serialization information.
13. An electronic device, characterized in that, It includes a processor and a memory. The memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of any one of claims 1 to 11 of the method.
14. A computer-readable storage medium, characterized in that, It includes a computer program which, when running on an electronic device, is used to cause the electronic device to execute the steps of any one of the methods recited in claims 1 to 11.