A game state restoration method and device, computer device and storage medium

By building the game world and updating the game state on the server side, the problem of not being able to determine the cause of server failure in existing technologies is solved, and the game state can be fully restored and the fault can be troubleshooted.

CN115869627BActive Publication Date: 2026-11-24NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211610865.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-14
Publication Date
2026-11-24
Estimated Expiration
2042-12-14

AI Technical Summary

Technical Problem

Existing technologies cannot determine the cause of server-side problems when troubleshooting online game malfunctions, making troubleshooting difficult.

Method used

By acquiring client-side game data, including initialization parameters and game update data sequences, the game world is constructed on the server side. Target update data is then obtained from the game update data sequences, and the game world is updated based on this data until the game ends, fully restoring the server-side state.

Benefits of technology

It enables a complete restoration of the game server's state, facilitating troubleshooting of server-side problems and causes during failures, and improving the accuracy and efficiency of troubleshooting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115869627B_ABST
    Figure CN115869627B_ABST
Patent Text Reader

Abstract

This invention discloses a game state restoration method, apparatus, computer device, and storage medium. It can acquire client-side game data, including initialization parameters used when constructing the game world on the client and a corresponding game update data sequence. The game world is constructed on the server based on the initialization parameters. The target game update data, currently at the beginning of the game update data sequence, is retrieved. Based on the target game update data, the game world is updated to obtain the game server state corresponding to the current game time. The process then returns to re-execute the step of retrieving the target game update data, currently at the beginning of the game update data sequence, until no more game update data is found in the game update data sequence. This method can comprehensively restore the server state during gameplay, facilitating troubleshooting of potential server-side problems and their causes when game malfunctions occur.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of game technology, and specifically to a game state restoration method, apparatus, computer device, and storage medium. Background Technology

[0002] With the rapid development of internet technology, people often use games for entertainment and relaxation. Online games typically require cooperation between the game client and server to enable interaction between users within the game world.

[0003] For online games, game malfunctions can be caused by problems on the client or server side. Currently, the common solution for troubleshooting game malfunctions is to re-parse and execute the data packets sent by the server during actual gameplay on the client side to recreate the game process. However, this approach cannot determine the server's status during actual gameplay and cannot pinpoint the cause of the game malfunction due to server-side issues. Summary of the Invention

[0004] This invention provides a game state restoration method, apparatus, computer device, and storage medium, which can comprehensively restore the state of the server during the game, making it easier to troubleshoot potential problems and causes on the game server when a game malfunctions.

[0005] This invention provides a method for restoring a game state, comprising:

[0006] Acquire client-side game data, which includes initialization parameters when the game world is constructed on the client and the game update data sequence corresponding to the game world;

[0007] The game world is constructed on the server according to the initialization parameters.

[0008] Obtain the target game update data that is currently at the beginning of the game update data sequence;

[0009] Based on the target game update data, the game world is updated to obtain the game server status corresponding to the current game time;

[0010] Return to the step of retrieving the target game update data that is currently at the beginning of the game update data sequence, until there is no more game update data in the game update data sequence.

[0011] Accordingly, embodiments of the present invention also provide a game state restoration device, comprising:

[0012] A game data acquisition unit is used to acquire client game data, which includes initialization parameters when the client constructs the game world and the game update data sequence corresponding to the game world.

[0013] A game world construction unit is used to construct a game world on the server according to the initialization parameters.

[0014] The update data acquisition unit is used to acquire the target game update data that is currently at the beginning of the game update data sequence from the game update data sequence;

[0015] The game world update unit is used to update the game world based on the target game update data to obtain the game server status corresponding to the current game time.

[0016] The loop update unit is used to return to the step of retrieving the target game update data that is currently at the beginning of the game update data sequence, until there is no more game update data in the game update data sequence.

[0017] Accordingly, embodiments of the present invention also provide a computer device, including a memory and a processor; the memory stores an application program, and the processor is used to run the application program in the memory to perform the steps in any of the game state restoration methods provided in the embodiments of the present invention.

[0018] Accordingly, embodiments of the present invention also provide a computer-readable storage medium storing a plurality of instructions adapted for loading by a processor to execute steps in any of the game state restoration methods provided in embodiments of the present invention.

[0019] Furthermore, embodiments of the present invention also provide a computer program product, including a computer program or instructions, wherein when the computer program or instructions are executed by a processor, they implement the steps in any of the game state restoration methods provided in embodiments of the present invention.

[0020] The solution of this invention can acquire client-side game data, including initialization parameters when constructing the game world on the client and the corresponding game update data sequence. The game world is constructed on the server based on the initialization parameters. The target game update data currently at the beginning of the game update data sequence is retrieved. Based on this target game update data, the game world is updated to obtain the game server state corresponding to the current game time. The process of retrieving the target game update data from the game update data sequence is repeated until no more game update data is found in the game update data sequence. Since this invention constructs the game world on the server based on the initialization parameters during actual gameplay and updates the game world on the server based on data from the gameplay process, the server state during gameplay can be fully restored. This facilitates troubleshooting potential problems and their causes on the game server when game malfunctions occur. Attached Figure Description

[0021] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0022] Figure 1 This is a schematic diagram of a game state restoration method provided in an embodiment of the present invention;

[0023] Figure 2 This is a flowchart of the game state restoration method provided in an embodiment of the present invention;

[0024] Figure 3 This is another flowchart of the game state restoration method provided in the embodiments of the present invention;

[0025] Figure 4 This is a schematic diagram of the game state restoration device provided in an embodiment of the present invention;

[0026] Figure 5 This is another structural schematic diagram of the game state restoration device provided in an embodiment of the present invention;

[0027] Figure 6 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention. Detailed Implementation

[0028] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0029] This invention provides a game state restoration method, apparatus, computer device, and computer-readable storage medium. Specifically, this invention provides a game state restoration method suitable for a game state restoration apparatus, which can be integrated into a computer device.

[0030] The computer device can be a terminal or other device, including but not limited to mobile terminals and fixed terminals. For example, mobile terminals include but are not limited to smartphones, smartwatches, tablets, laptops, smart vehicles, etc., while fixed terminals include but are not limited to desktop computers, smart TVs, etc.

[0031] The computer device can also be a server or other similar device. The server can be an independent physical server, 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 communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms, but it is not limited to these.

[0032] The game state restoration method of this invention can be implemented by a server or by both a terminal and a server.

[0033] The following example illustrates how the game state restoration method is implemented jointly by the terminal and the server.

[0034] like Figure 1 As shown, the game state restoration system provided in this embodiment of the invention includes a terminal 10 and a server 20, etc.; the terminal 10 and the server 20 are connected through a network, such as through a wired or wireless network, etc., wherein the terminal 10 can exist as a computer device running a game client.

[0035] Terminal 10 can be used to record client game data during actual gameplay, and to send client game data to server 20, etc.

[0036] Server 20 can obtain client game data, which includes initialization parameters when building the game world on the client and the game update data sequence corresponding to the game world. Based on the initialization parameters, the server builds the game world, retrieves the target game update data that is currently at the beginning of the game update data sequence, updates the game world based on the target game update data, obtains the game server status corresponding to the current game time, and returns to execute the step of retrieving the target game update data that is currently at the beginning of the game update data sequence until there is no more game update data in the game update data sequence.

[0037] It is understood that client-side game data can also be generated by server 20, and this embodiment of the invention does not limit this.

[0038] The following sections provide detailed descriptions of each example. It should be noted that the order in which the embodiments are described is not intended to limit the preferred order of the embodiments.

[0039] This invention will be described from the perspective of a game state restoration device, which can be integrated into a server or terminal.

[0040] like Figure 2 As shown, the specific process of the game state restoration method in this embodiment can be as follows:

[0041] 201. Obtain client game data. Client game data may include initialization parameters when the game world is built on the client and the game update data sequence corresponding to the game world.

[0042] In this embodiment of the invention, the client-side game data is obtained based on relevant data of the game world during actual gameplay. For example, the client-side game data may include, but is not limited to, initialization parameters when constructing the game world during actual gameplay, time data for updating the game world, and operation data generated by game users performing operations through the client during actual gameplay, etc.

[0043] Corresponding to the client, the game can have a server. In some optional embodiments, the server and client can interact based on a state-synchronized game synchronization method. The principle of this state-synchronized game synchronization method is that the server sends the information that needs to be synchronized (such as the position of game objects, the direction of movement of game objects, etc.) to other clients. Other clients can then create the same entity at the corresponding location to achieve data synchronization across different clients.

[0044] For example, a game can have a server set up on the game server, and all game clients can connect to this server. The server will periodically or irregularly send information that needs to be synchronized during the game to each client.

[0045] Specifically, initialization parameters can be used to create the game world on both the server and client sides. Understandably, to ensure data consistency between the game user on the client and server sides, the game world created on both sides is generally identical. Therefore, the initialization parameters used when building the game world on the client side are actually the same initialization parameters used when building the game world on the server side during actual gameplay.

[0046] The game update data sequence can be a sequence of data related to updates to the game world during actual gameplay. For example, the game update data sequence may include, but is not limited to, the game world time at the time of each game world update, operation data generated by game users performing operations through the client, and / or the game world time at the time of game users performing operations, etc.

[0047] It is understandable that to restore the game state corresponding to the actual game process, it is necessary to record game-related data during the actual game process, that is, to generate client game data. Therefore, before the step "obtain client game data", the game state restoration method provided in this embodiment of the invention may further include:

[0048] In actual gameplay, the initialization parameters for constructing the game world are obtained, and the game world is constructed based on the initialization parameters.

[0049] Acquire game data of the game world during actual gameplay, update the game world based on the game data, and generate a game update data sequence;

[0050] The initialization parameters and game update data sequence are stored as client game data.

[0051] The initialization parameters obtained for constructing the game world can be either those used by the server during actual gameplay or by the client. In some examples, the game world can be constructed based on these initialization parameters to obtain the specific object `GameEnv` within the game process. Simultaneously, the initialization parameters are stored in a pre-defined storage object, which can be named `init_args`.

[0052] Specifically, the step "Constructing the game world based on initialization parameters" can be done during the actual gameplay, either on the game's server or client.

[0053] Game data may include, but is not limited to, the game world time when the game world is updated during actual gameplay, the operation data generated by the game user through the client, and / or the game world time when the game user performs an operation, etc.

[0054] When generating game update data sequences, one approach is to sort the game data based on the real-world time or game-world time corresponding to each piece of game data after the actual gameplay has ended. Alternatively, the game update data sequence can be generated by storing each piece of game data at the end of an ordered list as it is obtained during the actual gameplay, and so on.

[0055] For example, in some optional embodiments, game data may include user action data generated by game users performing actions through the client, and the game world time each time the game world is updated. The server or client may pre-set an ordered data storage list, update_list. The step "obtaining game data of the game world during actual gameplay, updating the game world based on the game data, and generating a game update data sequence" may specifically include:

[0056] If user operation data is received from the client, respond to the user operation data and store the user operation data at the end of the preset data storage list;

[0057] Get the real-world time, update the current game time in the game world to the real-world time, get the updated current game time, and store the current game time at the end of the data storage list;

[0058] Return to the execution of steps that respond to user operation data input from the client if such data is obtained, until the actual game process ends.

[0059] In other words, during actual gameplay, the game world can be constructed based on the initialization parameters to obtain GameEnv, and the parameters can be stored in init_args; it can be determined whether there is client input (user operation data), and if so, it can be processed, and the input data can be stored at the end of update_list.

[0060] It is understandable that the game world can be updated during actual gameplay. Specifically, before the step "update the current game time in the game world to real-world time to obtain the updated current game time", the game state restoration method provided in this embodiment of the invention may further include:

[0061] Get the current game time and calculate the time interval based on real-world time and current game time;

[0062] The game world is updated at regular intervals.

[0063] Specifically, the time interval can be the elapsed game time delta_time obtained by subtracting the current game time GameEnv.game_time from the real-world time.

[0064] When updating the game world, you can update the game time corresponding to the game world, modifying the current game time GameEnv.game_time in the original game world to the real world time; you can also use the game world update function GameEnv.Update(delta_time) to update the game world according to the time interval, such as updating the position of game characters in the game world.

[0065] In some examples, the updated GameEnv.game_time is stored at the end of update_list so that during the server-side state restoration process, the time interval can be calculated based on the current game time stored in the game update data sequence, and the game world on the server can be updated, etc.

[0066] 202. Construct the game world on the server based on the initialization parameters.

[0067] The game world can be a game scene provided by a game application when it runs on a terminal and / or server. The game world can include game objects such as game characters and game items.

[0068] It is understandable that when building the game world on the server side, there is no need to render the game interface. It is only necessary to create the game objects and items corresponding to the game world in the game process on the server side, and store information such as the location of each game object and item.

[0069] Specifically, the initialization parameter init_args can be used to construct the game world and obtain the specific object GameEnv of the game world in the game process.

[0070] 203. Obtain the target game update data that is currently at the top of the game update data sequence from the game update data sequence.

[0071] In some optional embodiments, before obtaining game update data, it can be determined whether the game update data sequence is empty. If the game update data sequence is empty, it means that the game process that needs to restore the game state has ended. At this time, there is no need to continue updating the game world on the server.

[0072] If the game update data sequence is not empty, the target game update data can be obtained from the game update data sequence arranged in chronological order.

[0073] In some alternative embodiments, the target game update data can be obtained directly from the game update data sequence. If the obtained target game update data is empty, it can also indicate that the game process that needs to be restored has ended.

[0074] 204. Based on the target game update data, update the game world to obtain the game server status corresponding to the current game time.

[0075] Specifically, the game server status refers to the server's status information at the current game time during the actual game process, obtained through game status restoration.

[0076] For example, if the current game time in the game world recreated on the server is 50 seconds, then the game server status is the server status information at the 50th second of the actual game process.

[0077] In practical applications, the target game update data can include at least one type.

[0078] In some optional embodiments, the target game update data may be the update time of the game world during actual gameplay. The step "updating the game world based on the target game update data to obtain the game server status corresponding to the current game time" may include:

[0079] If the target game update data is the game world update time, obtain the current game time corresponding to the game world.

[0080] Calculate the time interval between the game world update time and the current game time;

[0081] The game world is updated based on game time intervals to obtain the game server status corresponding to the current game time.

[0082] The game world update time refers to the real-world time at the time the game world is updated during actual gameplay; that is, the new current game time obtained after updating the game world during actual gameplay. The current game time during the game state restoration process is the game world time corresponding to that moment in the restored game world.

[0083] Generally speaking, the game world usually has its own game time. The game updates the game world at a certain frame rate, and at the same time, it also updates the game time.

[0084] It is understandable that when the server updates the game world, it also updates the current game time of the game world. In other words, the game state restoration method provided in this embodiment of the invention may further include: updating the current game time of the game world according to the game world update time to obtain a new current game time.

[0085] In some alternative embodiments, the target game update data may be user operation data generated by game users performing certain operations through the client during actual gameplay. The step "updating the game world based on the target game update data to obtain the game server status corresponding to the current game time" may include:

[0086] If the target game update data is user operation data, simulate a response based on the user operation data to update the game world and obtain the game server status corresponding to the current game time.

[0087] In other words, during the process of restoring the game state, if it is found that the user performed certain game operations through the client during the actual game, thereby generating user operation data, the server can simulate responding to the user operation data to update the game world correctly and in a timely manner, so that the restored game server state matches the actual game state.

[0088] In games, a large number of random numbers are typically used to update the game world. Most computer-generated random numbers are pseudo-random, starting with a true random number (seed) and then iteratively generating random numbers using a specific algorithm. Because game code uses a large number of random numbers, to recreate the state of a particular game, the result of each randomization must match the final result of the original game.

[0089] To achieve this goal, it is necessary to save the random number seed of the game. That is, the client game data can also include the game world's random number seed. Before the step "update the game world based on the target game update data to obtain the game server state corresponding to the current game time", the game state restoration method provided in this embodiment of the invention can also include:

[0090] Based on the game's random seed, a random number generation calculation is performed to obtain pseudo-random numbers.

[0091] Furthermore, pseudo-random numbers can be used to update the game world. The step "update the game world based on the target game update data to obtain the game server state corresponding to the current game time" can specifically include:

[0092] Based on the target game update data and pseudo-random numbers, the game world is updated to obtain the game server status corresponding to the current game time.

[0093] A random seed is a type of random number generator that uses a truly random number (seed) as its initial condition. A randomizer using this seed performs random calculations on it, and each random result will be consistent with the outcome of the game.

[0094] 205. Return to the step of retrieving the target game update data that is currently at the beginning of the game update data sequence, until there is no more game update data in the game update data sequence.

[0095] It is understandable that when there is no game update data in the game update data sequence, it means that the actual game process that requires game state restoration no longer needs to update the game world, that is, the actual game process has ended.

[0096] In practical applications, a game process typically needs to update the game world at a fixed frame rate, such as a game process with a frequency of 30 frames per second (updating 30 times per second), where each frame of the game world lasts for 0.03333 seconds (1 / 30 of a second). In some optional embodiments, to make the restored game server state more stable, before the step "returning to execute the step of obtaining the target game update data currently at the beginning of the game update data sequence", the game state restoration method provided by the embodiments of the present invention may further include:

[0097] Get the game world's update frame rate;

[0098] Calculate the corresponding update time interval for the game world based on the update frame rate.

[0099] The update frame rate is the game frame rate at which the game process updates the game world.

[0100] Accordingly, the step "Return to the step of retrieving the target game update data that is currently at the beginning of the game update data sequence, until no more game update data exists in the game update data sequence" can include:

[0101] Wait for the update interval, then return to the step of retrieving the target game update data that is currently at the beginning of the game update data sequence, until there is no more game update data in the game update data sequence.

[0102] The reason for updating the game world using an update interval calculated with a fixed update frame rate is that the update frame rate can meet the game's refresh requirements, and a fixed frame rate will make the game performance more stable.

[0103] It is understandable that after the game server's state during the actual game is restored on the server side, if a problem occurs during the actual game, in addition to relying on the client-side recording, the location of the problem can also be determined based on the server-side state. The game state restoration method provided in this embodiment of the invention may further include:

[0104] Obtain the game failure time and determine the game server status corresponding to the game failure time from the restored game server status;

[0105] Based on the game server status, troubleshooting is performed on the game process to obtain the cause of the game failure corresponding to the time of failure.

[0106] The game malfunction time can be the game world time during actual gameplay, real-world time, or the game frame number from which the game malfunction occurs (i.e., from which game frame the game malfunction begins).

[0107] Specifically, during troubleshooting, you can analyze the process information of the current server status, insert monitoring logs into the game process, trace the code that causes problems with the server status, and so on.

[0108] For example, a game can be composed of game object A and game object B, then the state of the game can be considered to be composed of the states of game object A and game object B.

[0109] Each game object's state consists of physical state and skill state, as follows:

[0110] 1. Physical state, such as the position and orientation of game objects;

[0111] 2. Skill status, such as the skill range of a game object's attack skill (under normal game conditions, the game object cannot attack game objects that are outside the skill range), whether the attack skill is on cooldown (under normal game conditions, a skill on cooldown cannot be released), and whether the attack skill is disabled (under normal game conditions, a disabled skill cannot be released).

[0112] Further assuming the game scene is a two-dimensional scene, with scene position coordinates represented in the format (x, y), and the current positions of game object A and game object B are (0, 0) and (0, 5), respectively. If game object B remains stationary, game object A has a speed of 1 and moves towards B. Upon reaching the vicinity of B, game object A releases an attack skill on game object B.

[0113] The game updates at a fixed frame rate. Assuming the game updates at a frame rate of 1 frame (1 frame per second, with each frame lasting 1 second (delta_time)), since game object B remains stationary, the game state changes in this scenario can be simplified to the state of game object A. If the game world update sequence is: game object A: (0, 0), game object A: (0, 1), game object A: (0, 2), game object A: (0, 3), game object A: (0, 4), game object A releases an attack skill on game object B, but the skill release fails.

[0114] Normally, when game object A is at position (0,4), the attack skill's range can reach game object B. The attack skill, as displayed on the client side, is neither on cooldown nor disabled, yet it fails to be released. This is a typical game bug, but client-side recordings alone are insufficient to troubleshoot this type of problem because developers lack server-side state data. They cannot easily determine which state of the attack skill is causing the issue—is it the skill's range, cooldown, or disabled state? Even if developers know which state is causing the problem, pinpointing the cause is difficult due to the extensive code affecting skill states.

[0115] In short, because state-synchronized games lack a state restoration mechanism, it is impossible to reproduce the process environment when the problem occurred, making it impossible to debug the server-side process and making it very difficult to locate the problem.

[0116] Once the server process returns to the state it was in when the problem occurred, as in the example above, developers can pause the process in frame 6. At this point, they can debug the process and identify which state caused the problem by examining the process memory data. They can also add logs to trace the code that caused the problem.

[0117] As can be seen from the above, the embodiments of the present invention can acquire client game data, which includes initialization parameters when constructing the game world on the client and the game update data sequence corresponding to the game world. The game world is constructed on the server based on the initialization parameters. The target game update data currently at the beginning of the game update data sequence is obtained from the game update data sequence. Based on the target game update data, the game world is updated to obtain the game server state corresponding to the current game time. The process of retrieving the target game update data currently at the beginning of the game update data sequence is repeated until no more game update data is found in the game update data sequence. Since the game world is constructed on the server based on the initialization parameters during the actual game process, and the game world on the server is updated based on the data during the game process, the state of the server during the game process can be fully restored. This facilitates troubleshooting potential problems and their causes on the game server when game malfunctions occur.

[0118] Based on the methods described in the preceding embodiments, the following examples will provide further detailed explanations.

[0119] In this embodiment, the combination Figure 1 The system will be explained.

[0120] like Figure 3 As shown, the game state restoration method in this embodiment can be described in the following specific steps:

[0121] 301. In the actual game process, obtain the initialization parameters for constructing the game world, and construct the game world according to the initialization parameters.

[0122] In this embodiment of the invention, GameEnv represents a specific object of the game world within the game process; GameEnv.game_time: a variable that stores the game time, which the game code typically uses to obtain the game time rather than the real-world time; GameEnv.Update(delta_time): a game world update function, whose parameter delta_time is the elapsed game time.

[0123] The game world, GameEnv, is constructed based on the initialization parameters, and the initialization parameters are stored in init_args. Init_args is used to store the initialization parameters for the game world.

[0124] 302. Set the random number seed during the actual game process.

[0125] Set the game's random number seed and store the seed in random_seed. random_seed: The game's random seed.

[0126] 303. Obtain game data of the game world during actual gameplay, update the game world based on the game data, and generate a game update data sequence.

[0127] Specifically, step 303 may include: repeating the following steps until the game ends:

[0128] Sleep for one game frame time;

[0129] Check if there is game data input from the client. If so, process the game data and store the input game data at the end of update_list.

[0130] Subtract GameEnv.game_time from real-world time to get the elapsed game time delta_time;

[0131] Update the game time by setting GameEnv.game_time to real-world time and storing the current GameEnv.game_time at the end of update_list;

[0132] Use the function GameEnv.Update(delta_time) to update the game world.

[0133] Delta_time is the time elapsed between the current game world update and the last game world update. For example, in a game that updates at 30 frames per second, Delta_time is typically 0.03333 seconds. Delta_time is important in game updates, such as updates to the game world's physics system, which usually update in-game units and their orientation.

[0134] For a unit with uniform linear motion, the position updated in this game is: current position + velocity * Delta_time. Derived from the physics system, Delta_time is very important for game updates. This is mainly because many in-game behaviors simulate the real world, and changes in the real world change over time. As long as Delta_time is small enough, it can meet the game requirements and make the game behave normally and smoothly.

[0135] 304. Obtain the initialization parameters, random number seed, and game update data sequence corresponding to the game world when the game world is built on the client.

[0136] 305. Construct the game world on the server based on the initialization parameters.

[0137] The game world is constructed using the initialization parameters init_args to obtain the original GameEnv.

[0138] 306. Retrieve the target game update data that is currently at the top of the game update data sequence.

[0139] After setting the random number seed using random_seed, the embodiments of the present invention can repeat the following steps until the game ends:

[0140] Sleep for one game frame time;

[0141] Check if update_list is empty. If it is empty, end the game and restore the state. Otherwise, get the first element in update_list (the target game update data).

[0142] If this element is player input data, then process this input data and return to the step of sleeping for one game frame time;

[0143] If this element is the game time of a certain game world update, subtract GameEnv.game_time from that time to get delta_time, update the game time, and set GameEnv.game_time to that time;

[0144] The GameEnv.Update(delta_time) function updates the game world and returns a step that executes a sleep for one game frame.

[0145] 307. Based on the target game update data, update the game world to obtain the game server status corresponding to the current game time.

[0146] Taking MOBA games as an example, each game is organized into rounds, and `update_list` stores the client input and game update timeline for that round. In the restore mechanism, each update pops an element from `update_list`, and an empty `update_list` naturally indicates that the game has ended.

[0147] 308. Return to the step of retrieving the target game update data that is currently at the beginning of the game update data sequence, until there is no more game update data in the game update data sequence.

[0148] As can be seen from the above, the embodiments of the present invention can acquire client game data, which includes initialization parameters when constructing the game world on the client and the game update data sequence corresponding to the game world. The game world is constructed on the server based on the initialization parameters. The target game update data currently at the beginning of the game update data sequence is obtained from the game update data sequence. Based on the target game update data, the game world is updated to obtain the game server state corresponding to the current game time. The process of retrieving the target game update data currently at the beginning of the game update data sequence is repeated until no more game update data is found in the game update data sequence. Since the game world is constructed on the server based on the initialization parameters during the actual game process, and the game world on the server is updated based on the data during the game process, the state of the server during the game process can be fully restored. This facilitates troubleshooting potential problems and their causes on the game server when game malfunctions occur.

[0149] To better implement the above methods, the present invention also provides a game state restoration device.

[0150] refer to Figure 4 The device includes:

[0151] The game data acquisition unit 401 can be used to acquire client game data, which may include initialization parameters when the game world is built on the client and the game update data sequence corresponding to the game world.

[0152] Game world building unit 402 can be used to build a game world on the server based on initialization parameters;

[0153] The update data acquisition unit 403 can be used to acquire the target game update data that is currently at the beginning of the game update data sequence from the game update data sequence;

[0154] The game world update unit 404 can be used to update the game world based on the target game update data to obtain the game server status corresponding to the current game time;

[0155] The loop update unit 405 can be used to return to the step of retrieving the target game update data that is currently at the beginning of the game update data sequence, until there is no more game update data in the game update data sequence.

[0156] In some optional embodiments, the game world update unit 404 can be used to obtain the current game time corresponding to the game world if the target game update data is the game world update time;

[0157] Calculate the time interval between the game world update time and the current game time;

[0158] The game world is updated based on game time intervals to obtain the game server status corresponding to the current game time.

[0159] In some optional embodiments, the game world update unit 404 can be used to simulate a response based on the user operation data if the target game update data is user operation data, so as to update the game world and obtain the game server status corresponding to the current game time.

[0160] In some alternative embodiments, such as Figure 5 As shown, the client game data may also include a game random seed for the game world, and the game state restoration device may also include a random number calculation unit 406, which can be used to perform random number generation calculation based on the game random seed to obtain pseudo-random numbers;

[0161] The game world update unit 404 can be used to update the game world based on the target game update data and pseudo-random numbers to obtain the game server status corresponding to the current game time.

[0162] In some optional embodiments, the game state restoration device may further include a game data acquisition unit 407, which can be used to acquire initialization parameters for constructing the game world during actual gameplay and construct the game world based on the initialization parameters.

[0163] Acquire game data of the game world during actual gameplay, update the game world based on the game data, and generate a game update data sequence;

[0164] The initialization parameters and game update data sequence are stored as client game data.

[0165] In some optional embodiments, the game state restoration device may further include an update time calculation unit, which can be used to obtain the update frame rate of the game world;

[0166] Calculate the corresponding update time interval for the game world based on the update frame rate;

[0167] The cyclic update unit 405 can be used to wait for the update time interval and return to the step of retrieving the target game update data that is currently at the beginning of the game update data sequence, until there is no more game update data in the game update data sequence.

[0168] In some optional embodiments, the game state restoration device may further include a fault cause determination unit 408, which can be used to obtain the game fault time and determine the game server state corresponding to the game fault time from the restored game server state.

[0169] Based on the game server status, troubleshooting is performed on the game process to obtain the cause of the game failure corresponding to the time of failure.

[0170] As can be seen from the above, the game state restoration device can acquire client game data, including initialization parameters when constructing the game world on the client and the game update data sequence corresponding to the game world. The game world is constructed on the server based on the initialization parameters. The target game update data currently at the beginning of the game update data sequence is obtained. Based on the target game update data, the game world is updated to obtain the game server state corresponding to the current game time. The process of retrieving the target game update data currently at the beginning of the game update data sequence is repeated until no more game update data is found in the game update data sequence. Since, in this embodiment of the invention, the game world is constructed on the server based on the initialization parameters during the actual game process, and the game world on the server is updated based on the data during the game process, the server state during the game process can be fully restored. This facilitates troubleshooting potential problems and their causes on the game server when game malfunctions occur.

[0171] Furthermore, correspondingly, embodiments of this application also provide a computer device, which can be a terminal. For example... Figure 6 The diagram shown is a structural schematic of a computer device provided in an embodiment of this application. The computer device 600 includes a processor 601 with one or more processing cores, a memory 602 with one or more computer-readable storage media, and a computer program stored in the memory 602 and executable on the processor. The processor 601 and the memory 602 are electrically connected. Those skilled in the art will understand that... Figure 6 The computer device structure shown does not constitute a limitation on the computer device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0172] The processor 601 is the control center of the computer device 600. It connects various parts of the computer device 600 through various interfaces and lines. By running or loading software programs and / or modules stored in the memory 602, and calling data stored in the memory 602, it performs various functions of the computer device 600 and processes data, thereby monitoring the computer device 600 as a whole.

[0173] In this embodiment, the processor 601 in the computer device 600 loads the instructions corresponding to the processes of one or more applications into the memory 602 according to the following steps, and the processor 601 runs the applications stored in the memory 602 to achieve various functions:

[0174] Acquire client-side game data, which may include initialization parameters when the game world is built on the client and the corresponding game update data sequence for the game world;

[0175] The game world is constructed on the server based on the initialization parameters.

[0176] Retrieve the target game update data that is currently at the top of the game update data sequence;

[0177] Based on the target game update data, the game world is updated to obtain the game server status corresponding to the current game time;

[0178] Return to the step of retrieving the target game update data that is currently at the beginning of the game update data sequence, until there is no more game update data in the game update data sequence.

[0179] In some optional embodiments, updating the game world based on the target game update data to obtain the game server status corresponding to the current game time may include:

[0180] If the target game update data is the game world update time, obtain the current game time corresponding to the game world.

[0181] Calculate the time interval between the game world update time and the current game time;

[0182] The game world is updated based on game time intervals to obtain the game server status corresponding to the current game time.

[0183] In some optional embodiments, updating the game world based on the target game update data to obtain the game server status corresponding to the current game time may include:

[0184] If the target game update data is user operation data, simulate a response based on the user operation data to update the game world and obtain the game server status corresponding to the current game time.

[0185] In some optional embodiments, the client game data may also include a game world random seed;

[0186] Before updating the game world based on the target game update data and obtaining the game server state corresponding to the current game time, the game state restoration method provided in this embodiment of the invention may further include:

[0187] Based on the game's random seed, perform random number generation calculations to obtain pseudo-random numbers;

[0188] Based on the target game update data, the game world is updated to obtain the game server status corresponding to the current game time, which may include:

[0189] Based on the target game update data and pseudo-random numbers, the game world is updated to obtain the game server status corresponding to the current game time.

[0190] In some optional embodiments, before acquiring client game data, the game state restoration method provided in this embodiment of the invention may further include:

[0191] In actual gameplay, the initialization parameters for constructing the game world are obtained, and the game world is constructed based on the initialization parameters.

[0192] Acquire game data of the game world during actual gameplay, update the game world based on the game data, and generate a game update data sequence;

[0193] The initialization parameters and game update data sequence are stored as client game data.

[0194] In some optional embodiments, before returning to the step of retrieving the target game update data currently at the beginning of the game update data sequence, the game state restoration method provided by the embodiments of the present invention may further include:

[0195] Get the game world's update frame rate;

[0196] Calculate the corresponding update time interval for the game world based on the update frame rate;

[0197] Returning to the step of retrieving the target game update data that is currently at the beginning of the game update data sequence, until no more game update data exists in the game update data sequence, may include:

[0198] Wait for the update interval, then return to the step of retrieving the target game update data that is currently at the beginning of the game update data sequence, until there is no more game update data in the game update data sequence.

[0199] In some optional embodiments, the game state restoration method provided by the present invention may further include:

[0200] Obtain the game failure time and determine the game server status corresponding to the game failure time from the restored game server status;

[0201] Based on the game server status, troubleshooting is performed on the game process to obtain the cause of the game failure corresponding to the time of failure.

[0202] This solution can acquire client-side game data, including initialization parameters used when building the game world on the client and the corresponding game update data sequence. Based on the initialization parameters, the game world is built on the server. The target game update data, currently at the top of the game update data sequence, is retrieved. Based on this target game update data, the game world is updated, resulting in the game server state corresponding to the current game time. The solution then returns to the previous step of retrieving the target game update data, continuing until no more game update data is found in the game update data sequence. Because in this embodiment, the game world is built on the server based on the initialization parameters used in the actual game process, and the game world on the server is updated based on data from the game process, the server state during the game can be fully restored. This facilitates troubleshooting potential problems and their causes on the game server when game malfunctions occur.

[0203] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.

[0204] Optional, such as Figure 6 As shown, the computer device 600 also includes: a touch screen display 603, a radio frequency circuit 604, an audio circuit 605, an input unit 606, and a power supply 607. The processor 601 is electrically connected to the touch screen display 603, the radio frequency circuit 604, the audio circuit 605, the input unit 606, and the power supply 607. Those skilled in the art will understand that... Figure 6 The computer device structure shown does not constitute a limitation on the computer device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0205] The touch display screen 603 can be used to display a graphical user interface (GUI) and receive operation commands generated by the user interacting with the GUI. The touch display screen 603 may include a display panel and a touch panel. 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 computer device. These graphical user interfaces can be composed of graphics, text, icons, video, and any combination thereof. Optionally, the display panel can be configured using a liquid crystal display (LCD), organic light-emitting diode (OLED), or other similar technologies. The touch panel can be used to collect touch operations performed by the user on or near it (such as operations performed by the user using a finger, stylus, or any suitable object or accessory on or near the touch panel), generate corresponding operation commands, and execute the corresponding program according to the operation commands. Optionally, the touch panel may include two parts: a touch detection device and a touch controller. The touch detection device detects the user's touch location and the signal generated by the touch operation, transmitting the signal to the touch controller. The touch controller receives touch information from the touch detection device, converts it into touch point coordinates, and sends it to the processor 601. It can also receive and execute commands from the processor 601. The touch panel can cover the display panel. When the touch panel detects a touch operation on or near it, it transmits the information to the processor 601 to determine the type of touch event. Subsequently, the processor 601 provides corresponding visual output on the display panel based on the type of touch event. In this embodiment, the touch panel and the display panel can be integrated into the touch display screen 603 to achieve input and output functions. However, in some embodiments, the touch panel and the touch display screen 603 can be implemented as two independent components to achieve input and output functions. That is, the touch display screen 603 can also be used as part of the input unit 606 to achieve input functions.

[0206] The radio frequency circuit 604 can be used to transmit and receive radio frequency signals to establish wireless communication with network devices or other computer devices, and to transmit and receive signals with network devices or other computer devices.

[0207] Audio circuitry 605 can be used to provide an audio interface between a user and a computer device via a speaker and a microphone. Audio circuitry 605 can convert received audio data into electrical signals and transmit them to the speaker, where the speaker converts them into sound signals for output. Conversely, the microphone converts collected sound signals into electrical signals, which are then received by audio circuitry 605, converted back into audio data, and then processed by processor 601 before being transmitted via radio frequency circuitry 604 to, for example, another computer device, or output to memory 602 for further processing. Audio circuitry 605 may also include an earphone jack to facilitate communication between peripheral headphones and computer devices.

[0208] The input unit 606 can be used to receive input numbers, characters, or user characteristic information (such as fingerprints, iris, facial information, etc.), and to generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control.

[0209] Power supply 607 is used to supply power to various components of computer device 600. Optionally, power supply 607 can be logically connected to processor 601 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. Power supply 607 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0210] although Figure 6 As not shown in the diagram, computer device 600 may also include a camera, sensor, wireless fidelity module, Bluetooth module, etc., which will not be described in detail here.

[0211] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0212] As can be seen from the above, the computer device provided in this embodiment can acquire client game data, which includes initialization parameters when constructing the game world on the client and the game update data sequence corresponding to the game world. The game world is constructed on the server side according to the initialization parameters. The target game update data currently at the beginning of the game update data sequence is obtained from the game update data sequence. Based on the target game update data, the game world is updated to obtain the game server state corresponding to the current game time. The process of retrieving the target game update data currently at the beginning of the game update data sequence is repeated until no more game update data is found in the game update data sequence. Since, in this embodiment of the invention, the game world is constructed on the server side according to the initialization parameters during the actual game process, and the game world on the server side is updated according to the data during the game process, the state of the server side during the game process can be fully restored. This facilitates troubleshooting potential problems and causes on the game server side when game malfunctions occur.

[0213] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.

[0214] Therefore, embodiments of this application provide a computer-readable storage medium storing multiple computer programs that can be loaded by a processor to execute steps in any of the game state restoration methods provided in embodiments of this application. For example, the computer program can execute the following steps:

[0215] Acquire client-side game data, which may include initialization parameters when the game world is built on the client and the corresponding game update data sequence for the game world;

[0216] The game world is constructed on the server based on the initialization parameters.

[0217] Retrieve the target game update data that is currently at the top of the game update data sequence;

[0218] Based on the target game update data, the game world is updated to obtain the game server status corresponding to the current game time;

[0219] Return to the step of retrieving the target game update data that is currently at the beginning of the game update data sequence, until there is no more game update data in the game update data sequence.

[0220] In some optional embodiments, updating the game world based on the target game update data to obtain the game server status corresponding to the current game time may include:

[0221] If the target game update data is the game world update time, obtain the current game time corresponding to the game world.

[0222] Calculate the time interval between the game world update time and the current game time;

[0223] The game world is updated based on game time intervals to obtain the game server status corresponding to the current game time.

[0224] In some optional embodiments, updating the game world based on the target game update data to obtain the game server status corresponding to the current game time may include:

[0225] If the target game update data is user operation data, simulate a response based on the user operation data to update the game world and obtain the game server status corresponding to the current game time.

[0226] In some optional embodiments, the client game data may also include a game world random seed;

[0227] Before updating the game world based on the target game update data and obtaining the game server state corresponding to the current game time, the game state restoration method provided in this embodiment of the invention may further include:

[0228] Based on the game's random seed, perform random number generation calculations to obtain pseudo-random numbers;

[0229] Based on the target game update data, the game world is updated to obtain the game server status corresponding to the current game time, which may include:

[0230] Based on the target game update data and pseudo-random numbers, the game world is updated to obtain the game server status corresponding to the current game time.

[0231] In some optional embodiments, before acquiring client game data, the game state restoration method provided in this embodiment of the invention may further include:

[0232] In actual gameplay, the initialization parameters for constructing the game world are obtained, and the game world is constructed based on the initialization parameters.

[0233] Acquire game data of the game world during actual gameplay, update the game world based on the game data, and generate a game update data sequence;

[0234] The initialization parameters and game update data sequence are stored as client game data.

[0235] In some optional embodiments, before returning to the step of retrieving the target game update data currently at the beginning of the game update data sequence, the game state restoration method provided by the embodiments of the present invention may further include:

[0236] Get the game world's update frame rate;

[0237] Calculate the corresponding update time interval for the game world based on the update frame rate;

[0238] Returning to the step of retrieving the target game update data that is currently at the beginning of the game update data sequence, until no more game update data exists in the game update data sequence, may include:

[0239] Wait for the update interval, then return to the step of retrieving the target game update data that is currently at the beginning of the game update data sequence, until there is no more game update data in the game update data sequence.

[0240] In some optional embodiments, the game state restoration method provided by the present invention may further include:

[0241] Obtain the game failure time and determine the game server status corresponding to the game failure time from the restored game server status;

[0242] Based on the game server status, troubleshooting is performed on the game process to obtain the cause of the game failure corresponding to the time of failure.

[0243] This solution can acquire client-side game data, including initialization parameters used when building the game world on the client and the corresponding game update data sequence. Based on the initialization parameters, the game world is built on the server. The target game update data, currently at the top of the game update data sequence, is retrieved. Based on this target game update data, the game world is updated, resulting in the game server state corresponding to the current game time. The solution then returns to the previous step of retrieving the target game update data, continuing until no more game update data is found in the game update data sequence. Because in this embodiment, the game world is built on the server based on the initialization parameters used in the actual game process, and the game world on the server is updated based on data from the game process, the server state during the game can be fully restored. This facilitates troubleshooting potential problems and their causes on the game server when game malfunctions occur.

[0244] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.

[0245] The storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0246] Since the computer program stored in the storage medium can execute the steps in any of the game state restoration methods provided in the embodiments of this application, the beneficial effects that any of the game state restoration methods provided in the embodiments of this application can achieve can be realized. For details, please refer to the previous embodiments, which will not be repeated here.

[0247] The above provides a detailed description of a game state restoration method, apparatus, storage medium, and computer device provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A method for restoring a game state, characterized in that, include: In the actual game process, the initialization parameters for constructing the game world are obtained, and the game world is constructed according to the initialization parameters; Acquire game data of the game world during actual gameplay, update the game world based on the game data, and generate a game update data sequence; store the initialization parameters and the game update data sequence as client game data; Acquire client-side game data, which includes initialization parameters when the game world is constructed on the client and the game update data sequence corresponding to the game world; The game world is constructed on the server according to the initialization parameters. When the game world is constructed on the server side, no game interface rendering is performed; Obtain the target game update data that is currently at the beginning of the game update data sequence; Based on the target game update data, the game world is updated to obtain the game server status corresponding to the current game time; Return to the step of retrieving the target game update data that is currently at the beginning of the game update data sequence, until there is no more game update data in the game update data sequence; Obtain the game failure time and determine the game server status corresponding to the game failure time from the restored game server status; Based on the game server status, troubleshooting is performed on the game process to obtain the cause of the game failure corresponding to the game failure time.

2. The game state restoration method according to claim 1, characterized in that, The step of updating the game world based on the target game update data to obtain the game server status corresponding to the current game time includes: If the target game update data is the game world update time, obtain the current game time corresponding to the game world; Calculate the time interval between the game world update time and the current game time; The game world is updated based on the game time interval to obtain the game server status corresponding to the current game time.

3. The game state restoration method according to claim 1, characterized in that, The step of updating the game world based on the target game update data to obtain the game server status corresponding to the current game time includes: If the target game update data is user operation data, a simulated response is performed based on the user operation data to update the game world and obtain the game server status corresponding to the current game time.

4. The game state restoration method according to claim 1, characterized in that, The client game data also includes the game world's random seed; Before updating the game world based on the target game update data to obtain the game server status corresponding to the current game time, the method further includes: Based on the game's random seed, a random number generation calculation is performed to obtain a pseudo-random number; The step of updating the game world based on the target game update data to obtain the game server status corresponding to the current game time includes: Based on the target game update data and the pseudo-random number, the game world is updated to obtain the game server status corresponding to the current game time.

5. The game state restoration method according to claim 1, characterized in that, Before the step of returning to perform the step of retrieving the target game update data that is currently at the beginning of the game update data sequence, the method further includes: Obtain the update frame rate of the game world; Calculate the update time interval corresponding to the game world based on the update frame rate; The step of returning to the execution of the step of retrieving the target game update data currently located at the beginning of the game update data sequence, until no game update data exists in the game update data sequence, includes: Wait for the update time interval, then return to the step of retrieving the target game update data that is currently at the beginning of the game update data sequence, until there is no more game update data in the game update data sequence.

6. A game state restoration device, characterized in that, include: The game data acquisition unit is used to acquire initialization parameters for constructing the game world during actual gameplay, and to construct the game world based on the initialization parameters. Acquire game data of the game world during actual gameplay, update the game world based on the game data, and generate a game update data sequence; store the initialization parameters and the game update data sequence as client game data; A game data acquisition unit is used to acquire client game data, which includes initialization parameters when the client constructs the game world and the game update data sequence corresponding to the game world. A game world construction unit is used to construct a game world on the server according to the initialization parameters. When the game world is constructed on the server side, no game interface rendering is performed; The update data acquisition unit is used to acquire the target game update data that is currently at the beginning of the game update data sequence from the game update data sequence; The game world update unit is used to update the game world based on the target game update data to obtain the game server status corresponding to the current game time. The loop update unit is used to return to the step of retrieving the target game update data that is currently at the beginning of the game update data sequence, until there is no more game update data in the game update data sequence; The fault cause determination unit is used to obtain the game fault time and determine the game server state corresponding to the game fault time from the restored game server state. Based on the game server status, troubleshooting is performed on the game process to obtain the cause of the game failure corresponding to the game failure time.

7. A computer device, characterized in that, It includes a memory and a processor; the memory stores an application program, and the processor runs the application program within the memory to perform the steps of the game state restoration method according to any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a plurality of instructions adapted for loading by a processor to perform the steps of the game state restoration method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Data generation device and application execution device

    CN110612519A