Game object state synchronization method and system, storage medium and equipment
By cache and interpolate the game object state data on the client, the game object state jump problem caused by low-frequency updates is solved, the game's movement fluency and physical simulation accuracy are improved, the server load is reduced, and the game experience is enhanced and the realism and competitive fairness are enhanced.
Patent Information
- Application Number
- CN202510725876.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-30
- Publication Date
- 2025-08-12
AI Technical Summary
In multiplayer online games, due to limited server resources, low-frequency updates cause game objects to jump, affecting the visual experience and operational feel of the game.
By cache the game object status data sent by the client on the client and interpolate the state before and after the target time point during rendering, a smooth intermediate state transition is generated to achieve smooth synchronization of game objects.
It improves the game's movement smoothness and physical simulation accuracy, reduces server load, and enhances the realism and competitive fairness of the game experience.
Smart Images

Figure CN120459620A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a method, system, storage medium, and device for synchronizing the state of a game object. Background Art
[0002] In the multiplayer online gaming world, a server-authoritative synchronization strategy is often used to ensure consistency across different clients. In this strategy, clients upload data such as keyboard operations and the game clock to the server, which then verifies and broadcasts a unified game state update to all clients, ensuring that the scenes seen by all players are synchronized.
[0003] However, this synchronization method has significant technical flaws. First, due to limited server resources, in order to balance performance and response speed, the server's processing frame rate is often limited to a relatively low level, such as 20Hz. This means that the server will only broadcast a game state update at regular intervals (such as every 50 milliseconds). When the client directly synchronizes the state of the game object based on these discrete state updates, due to the existence of the update interval, the state of the game object on the client may suddenly jump instead of smoothly transitioning. For example, in a scene where the client's vehicle is moving, this discrete state update will cause the vehicle to shake significantly, greatly affecting the visual experience and operational feel of the game. Summary of the Invention
[0004] In view of this, the embodiments of the present application provide a game object state synchronization method, system, storage medium, and device, which eliminate visual jitter through virtual state filling, improve movement smoothness, and delegate state calculation to the client, reducing server load.
[0005] According to one aspect of the present application, a game object state synchronization method is provided, which is applied to a client and includes:
[0006] Determining a target time for synchronization of the game object;
[0007] Acquire time status data adjacent to and before the target time, and interpolate the time status data adjacent to and after the target time based on the target time to obtain first target time status data corresponding to the target time;
[0008] The game state of the game object at the target time is synchronized according to the first target time state data.
[0009] According to another aspect of the present application, a game object state synchronization system is provided, comprising:
[0010] Server, multiple clients;
[0011] The client is configured to: determine a target time for synchronization of the game object; obtain state data of adjacent times before and after the target time, and interpolate the state data of adjacent times before and after the target time based on the target time to obtain first target time state data corresponding to the target time; and synchronize the game state of the game object at the target time based on the first target time state data;
[0012] The server is configured to: receive status data sent by any client and synchronize the status data of any client to other clients;
[0013] The client is further configured to store the state data of other clients synchronized with the server as the target time state cache data.
[0014] According to another aspect of the present application, a game object state synchronization device is provided, comprising:
[0015] A target time determination module, configured to determine a target time for synchronization of the game object;
[0016] a state data determination module configured to obtain, from the target time state cache data of the game object in the client, state data of a time immediately preceding the target time and state data of a time immediately following the target time corresponding to the target time, and interpolate the state data of the time immediately preceding and following the target time based on the target time to obtain first target time state data corresponding to the target time;
[0017] A game state synchronization module is used to synchronize the game state of the game object at the target time according to the first target time state data.
[0018] According to another aspect of the present application, a storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the above-mentioned game object state synchronization method is implemented.
[0019] According to another aspect of the present application, a computer device is provided, comprising a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein the processor implements the above-mentioned game object state synchronization method when executing the program.
[0020] By means of the above technical solution, the embodiment of the present application provides a method, system, storage medium, and device for synchronizing the state of a game object, which caches the state data of the game object sent by the server on the client, and performs interpolation calculations on the states before and after the target time point during rendering to generate a smooth intermediate state transition, thereby solving the problem of game object state jumps caused by low-frequency updates under the traditional server authoritative synchronization mechanism. Compared with the technical solution of the prior art that directly synchronizes the state based on the state data sent by the server, the embodiment of the present application eliminates visual jitter through virtual state filling, improves the smoothness of movement, and decentralizes the state calculation to the client, reducing the server load. The motion curve of the game object is smoothed through intermediate state calculation, thereby improving the accuracy of physical simulation.
[0021] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0023] Figure 1 A schematic diagram of a process for synchronizing game object states provided in an embodiment of the present application is shown;
[0024] Figure 2 A schematic diagram showing a flow chart of another method for synchronizing game object states provided in an embodiment of the present application is shown;
[0025] Figure 3 A structural diagram of a game object state synchronization device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0026] The present application will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that, unless there is a conflict, the embodiments and features in the embodiments of the present application can be combined with each other.
[0027] In this embodiment, a method for synchronizing game object status is provided, such as Figure 1 As shown, the method includes:
[0028] Step 101: Determine the target time for synchronization of the game object.
[0029] Step 102: Acquire time status data adjacent to and before the target time, and interpolate the time status data adjacent to and after the target time based on the target time to obtain first target time status data corresponding to the target time.
[0030] Step 103: Synchronize the game state of the game object at the target time according to the first target time state data.
[0031] This application addresses the jitter problem of client state synchronization in current server architectures by proposing a smooth synchronization mechanism based on timeline interpolation. By caching historical state data locally on the client and then using a timeline interpolation algorithm to generate continuous motion trajectories after receiving discrete state updates from the server, smooth transitions between game object states are achieved.
[0032] First, before rendering an image frame, the client determines the target time that needs to be synchronized (such as the timestamp corresponding to the current frame). The client can maintain a local buffer to continuously store the state cache data of each game object received from the server (specifically, it can include position, speed, direction, acceleration, state, and timestamp). Game objects refer to game objects that can or need to synchronize their state in the client. For example, in a racing game, game objects can be other cars participating in the same race as the car controlled by the client. Next, the buffer is searched for the latest historical state with a timestamp less than the target time (i.e., state data of the time immediately before the target time) and the most recent future state with a timestamp greater than the target time (i.e., state data of the time immediately after the target time). For example, if the server sends state data every 50ms and the target time is 80ms, then the state data of the time immediately before the target time is the state data corresponding to 50ms, and the state data of the time immediately after the target time is the state data corresponding to 100ms. Furthermore, an interpolation algorithm is used to interpolate the state data of the adjacent time before the target time and the state data of the adjacent time after the target time to determine the first target time state data corresponding to the target time. During the interpolation calculation, each data item in the state data can be interpolated separately to obtain the interpolation result of each data item as the first target time state data. Finally, the first target time state data obtained after the interpolation calculation is directly applied to the game object on the client to drive the rendering engine to generate a smooth animation effect. For example, a car can achieve continuous movement through interpolation between two server updates instead of jumping directly to the next position. Therefore, through the spatiotemporal decoupling design, the client experience quality of multiplayer online games is improved while ensuring the authority of the server. It is particularly suitable for game categories such as racing and fighting that require high operational accuracy and visual smoothness. While ensuring the authority of the server, this solution achieves decoupling optimization between the client presentation layer and the network layer.
[0033] In a specific application scenario of a racing game, assume that the server updates the racing state at a frequency of 20Hz and the client frame rate is 60Hz. In the traditional solution, the server sends the racing position (0,0,0) at t=0ms and the position (10,0,0) at t=50ms. The client directly applies the state at times such as t=16.6ms and 33.3ms, and the racing car will instantly jump from (0,0,0) to (10,0,0), causing obvious stuttering. However, using the technical solution of the embodiment of the present application, when the target time is 30ms, the client queries the adjacent time state data before the target time with a timestamp of 0ms and the adjacent time state data after the target time with a timestamp of 50ms, and performs interpolation calculation to obtain the middle position (6,0,0). The racing car appears on the client as a smooth moving trajectory from (0,0,0) to (6,0,0) and then to (10,0,0).
[0034] By applying the technical solution of this embodiment, the state data of the game object sent by the server is cached on the client, and the states before and after the target time point are interpolated during rendering to generate a smooth intermediate state transition, thereby solving the problem of game object state jumps caused by low-frequency updates under the traditional server authoritative synchronization mechanism. Compared with the technical solution of the prior art that directly synchronizes the state based on the state data sent by the server, the embodiment of the present application eliminates visual jitter through virtual state filling, improves the smoothness of movement, and decentralizes the state calculation to the client, reducing the server load. The intermediate state calculation smoothes the motion curve of the game object and improves the accuracy of the physical simulation.
[0035] Furthermore, as a refinement and extension of the specific implementation of the above embodiment, in order to fully illustrate the specific implementation process of this embodiment, another game object state synchronization method is provided, such as Figure 2 As shown, the method includes:
[0036] Step 201: In response to an entry signal of a target game scene, receive time synchronization information, and synchronize the client based on the time synchronization information; wherein, the target game scene includes a game scene in which the game objects therein use high-speed motion as a game means, and the high-speed motion is a motion with a moving speed greater than a preset speed.
[0037] In an embodiment of the present application, when entering the target game scene, the client receives the time synchronization information (e.g., including the server's current timestamp and clock calibration parameters) sent by the server, and uses the NTP protocol or a custom algorithm to correct the local clock deviation, ensuring that all clients participating in the target game scene share a unified time base with the server, thereby achieving multi-client time synchronization. Among them, the target game scene can be a game scene with high-speed motion as the gameplay method, such as a racing game scene. In this target game scene, each game object moves at high speed. If the state of each game object is refreshed at a lower frame rate, it is easy to cause the game object to drift. Therefore, the game object state synchronization method provided in the embodiment of the present application can be used to synchronize the state of the game object. High-speed motion can specifically refer to the ideal movement speed of the game object or the movement speed that is greater than the preset speed most of the time. Taking the racing scene as an example, in a 100-person online racing competition, all racing clients complete time alignment when entering the track. When the start countdown ends, the server timestamp T_server=10:00:00.000 is synchronized to each client, ensuring that the starting signal is triggered simultaneously on all devices. This eliminates the clock drift of the distributed system and provides high time accuracy for high-speed motion scenes.
[0038] Step 202: Send first state data corresponding to the current game object to the server, so that the server synchronizes the first state data to the clients of other game objects in the target game scene with the current game object; and receive second state data of other game objects sent by the server, and store the second state data as state cache data, wherein the other game objects include the game object.
[0039] In an embodiment of the present application, the client can send the state data of the local game object (i.e., the first state data, such as position, orientation, acceleration, state, and timestamp, etc.) to the server at a fixed frame rate (such as 60Hz). The server aggregates the state data of multiple clients and broadcasts it to all relevant clients at a lower frequency (such as 20Hz). The client can also directly send the state data of the local game object to the server at the frequency broadcast by the server, and the server broadcasts the received client state data to the relevant clients. Furthermore, the client can store the received state data (second state data) in a buffer according to the timestamp to form a timeline state list to support fast historical state review. Taking the racing scene as an example, player A's car is at coordinates (100,200) and speed (30,0) at local time t=100ms, and the car state data at t=100ms is uploaded to the server. The server then broadcasts player A's state data to player B's client for caching, and broadcasts player B's car state data at t=100ms to player A's client cache.
[0040] Step 203: Calculate the difference between the local time of the client and the fixed offset time as the target time to be synchronized.
[0041] In the embodiment of the present application, the client calculates the target time as the local time minus the fixed offset time, where the fixed offset time is a preset fixed compensation value (e.g., 100ms) to offset network transmission delays and make the interpolation result closer to the real-time state. Taking the racing scene as an example, if the current local time is t = 200ms and the fixed offset is set to 100ms, the target time is t = 100ms. The client will render the racing state at that moment, rather than the current moment, to compensate for the lag caused by network transmission.
[0042] Step 204: Acquire state data of adjacent times before and after the target time.
[0043] In this embodiment, the buffer cache data is queried for state data immediately before the target time and immediately after the target time, respectively, with timestamps before and after the target time. For example, if the target time t = 100ms falls between the server states S_50ms and S_150ms, the client extracts the race car state data at these two time points as the state data immediately before the target time and immediately after the target time, respectively.
[0044] Step 205: When the state data of the adjacent time after the target time is obtained, an interpolation position is calculated according to the target time, the historical time corresponding to the state data of the adjacent time before the target time, and the future time corresponding to the state data of the adjacent time after the target time; wherein the interpolation position is the ratio of the difference between the target time and the historical time to the difference between the future time and the historical time; the state data of the adjacent time before the target time and the state data of the adjacent time after the target time are interpolated according to the interpolation position to obtain first target time state data corresponding to the target time; and the game state of the game object at the target time is synchronized according to the first target time state data.
[0045] In an embodiment of the present application, if the adjacent time state data after the target time can be queried, then the adjacent time state data before the target time and the adjacent time state data after the target time are interpolated. Specifically, the interpolation weight α is calculated as (target time T_target-historical time T_prev) / (future time T_next-target time T_prev), and the parameters such as position, speed, and rotation are weighted averaged. For example, the target position to be synchronized after interpolation is determined as Position=historical time position S_prev.pos*(1-α)+future time position S_next.pos*α. For example, if α=0.6, the position of the car at t=100ms is (50,200)*0.4+(150,200)*0.6=(110,200), and the speed is 20*0.4+40*0.6=32, and the interpolation results of other state data are calculated in the same way to achieve a smooth transition from the 50ms to the 150ms state. This ensures that the position, speed and other states are continuous, and the car can turn and accelerate without lag.
[0046] Step 206: If the status data of the adjacent time after the target time cannot be obtained, the status data of the game object at the target time is estimated based on the status data of the adjacent time before the target time to obtain the second target time status data; based on the second target time status data, the game status of the game object at the target time is synchronized.
[0047] In this embodiment of the present application, when there is no future state data in the buffer (such as due to network reconnection or severe packet loss), the last known state is used for extrapolation. For example, if the client does not receive a server update at t = 150ms, the position at t = 150ms is estimated to be (100, 200) + (30, 0) * 50ms = (115, 200) based on the state of S_100ms. This allows the car to remain in motion during short disconnections (<200ms), avoiding sudden stops. In addition, the extrapolated results are corrected after receiving the new state to prevent error accumulation.
[0048] In an embodiment of the present application, optionally, the estimating the state data of the game object at the target time based on the adjacent time state data before the target time to obtain the second target time state data includes: obtaining the historical time corresponding to the adjacent time state data before the target time; when the time difference between the target time and the historical time is less than a preset duration, executing the step of estimating the state data of the game object at the target time based on the adjacent time state data before the target time to obtain the second target time state data; when the time difference between the target time and the historical time is greater than or equal to the preset duration, determining that the state of the game object is a stopped motion state.
[0049] In this embodiment, when the client cannot find future state data (i.e., the next server state data packet after the target time) in the state cache, the following logic is activated to ensure the continuity of the game object's motion. First, the client queries its internal cache to find the historical state record closest to the current target time. This record contains information such as the game object's position, velocity, and timestamp at a certain point in the past. The client calculates the time difference between the current target time and this most recent historical state record. If this time difference is less than a preset threshold (e.g., 200ms), the client considers it within an acceptable range and attempts to perform extrapolation compensation. If the time difference is greater than or equal to this threshold, the client considers the game object to be in an abnormal state (e.g., having not received server updates for a long time) and sets the game object's state to a stopped state. During the extrapolation compensation calculation, the game object's state data at the target time is estimated based on the velocity, acceleration, and other information in the most recent historical state record (the state data for the adjacent time before the target time). This estimation process is a form of extrapolation, inferring the future state based on the past state. Although this estimation may not be completely accurate, it can maintain the continuity of the game object's motion to a certain extent. Furthermore, when the client determines that a game object is stationary, it fixes its position to the position in the most recent state history and resets its velocity to zero. The client can also trigger visual effects (such as smoke or sparks from a locked tire) to alert the player to the abnormal state of the game object. For example, in a racing scenario, suppose the client fails to receive a server update at the target time, but the most recent state history shows the car's position at (100, 200) and velocity at (30, 0) 100ms ago. Because the time difference is less than the 200ms threshold, the client performs an extrapolation to compensate, estimating the car's position at the current target time to be (104.5, 200) (assuming zero acceleration and considering only velocity). This allows the car to continue moving along its trajectory, making it virtually unnoticeable to the player. If the network outage persists for an extended period, causing the time difference to exceed the 200ms threshold, the client will deem the car to be in an abnormal state. At this point, the client will fix the car's position at (100, 200), reset its speed, and may trigger a visual effect of tire locking to alert the player to a network problem. This embodiment of the application uses an extrapolation compensation mechanism to allow the client to maintain the continuity of the game object's motion even in the event of short-term network packet loss or delay, preventing players from experiencing an unpleasant gaming experience due to network issues. Additionally, when the game object stops moving, the client will trigger a visual effect to alert the player.
[0050] In an embodiment of the present application, optionally, the state data of the game object at the target time is estimated based on the state data of the adjacent time before the target time to obtain the second target time state data, including: determining the state estimated duration based on the difference between the target time and the historical time corresponding to the state data of the adjacent time before the target time, and determining the state change estimated information of the game object within the state estimated duration based on the motion data corresponding to the state data of the adjacent time before the target time, wherein the motion data includes acceleration data in the state data of the adjacent time before the target time, and the state change estimated information includes displacement estimated information and posture estimated information; the second target time state data is determined based on the state data of the adjacent time before the target time and the state change estimated information.
[0051] In this embodiment, when the client cannot find future state data in the target time state cache and starts the extrapolation compensation mechanism to estimate the state data of the game object at the target time point, the client first calculates the difference between the target time and the historical time corresponding to the most recent historical state data. This difference is the state estimation duration, which determines how long the client needs to estimate the state data after the historical time. Then, based on the motion data (such as acceleration) in the most recent historical state data (the state data of the adjacent time before the target time), the client will estimate the state change of the game object within the state estimation duration. This includes displacement estimation (i.e., how far the game object will move) and posture estimation (such as rotation angle, inclination, etc.). The estimation process can be based on simple kinematic formulas, such as the uniformly accelerated linear motion formula, to calculate the changes in displacement and velocity. The client combines the most recent historical state data with the state change estimation information to calculate the estimated state data of the game object at the target time point. This includes information such as estimated position, velocity, and posture. For example, let's assume the client fails to receive the server's update package at the target time. However, the most recent historical state data shows that the car's position 100 milliseconds ago was (100, 200), velocity (30, 0), and acceleration (0, 0) (i.e., the car is in uniform linear motion). Assuming the difference between the target time and the historical time corresponding to the most recent historical state data is 150 milliseconds, the estimated state duration is 150 milliseconds. Since the acceleration is 0, the car will continue in uniform linear motion. The distance the car will travel in 150 milliseconds is the velocity multiplied by the time, which is 30 × 0.15 = 4.5 units. Therefore, the estimated displacement is (4.5, 0). Since the car is in uniform linear motion, its attitude (such as rotation angle and tilt) is expected to remain unchanged. The client combines the position (100, 200) in the most recent historical state data with the estimated displacement (4.5, 0) to calculate the estimated position of the car at the target time point as (104.5, 200), the speed remains unchanged at (30, 0), and the posture remains unchanged. In the embodiment of the present application, through the extrapolation compensation mechanism, the client can maintain the motion continuity of the game object in the event of short-term network packet loss or delay. For example, in a racing game, this means that even if there is a brief fluctuation in the network, the car will not suddenly jump or stop, thereby improving the smoothness of the game and the player experience.
[0052] In an embodiment of the present application, optionally, the motion data also includes at least one of angular velocity data, air resistance data, ground friction data, and ground feature data.
[0053] In this embodiment, when the client cannot find future state data in the target time state cache and initiates an extrapolation compensation mechanism to estimate the state data of the game object at the target time, in addition to considering basic displacement and velocity changes, more dimensional motion data can be incorporated to improve the accuracy of the estimation, such as angular velocity data, air resistance data, ground friction data, and ground feature data. Angular velocity data affects the rotational state of the game object, such as the rate of change of the steering angle of a racing car; air resistance data affects the speed attenuation of the game object due to air resistance during movement; ground friction data affects the speed change of the game object when it interacts with the ground, such as the difference in sliding distance between a racing car on grass and asphalt; and ground feature data, such as the slope and roughness of the road surface, affects the motion trajectory and posture of the game object. The estimation process can comprehensively consider these factors and use more complex physical models to calculate changes in state parameters such as displacement, velocity, and posture. Using the racing scenario as an example, suppose the client fails to receive the server update package at the target time. However, the most recent historical state data shows that the car's position 100 milliseconds ago was (100, 200), its velocity was (30, 0), and its angular velocity was 0 (i.e., the car did not turn). The client also obtains ground feature data (e.g., asphalt road with a friction coefficient of 0.8) and air resistance data (a drag coefficient of 0.1) at the car's location. Assuming the difference between the target time and the time corresponding to the most recent historical state data is 150 milliseconds, the estimated state duration is 150 milliseconds. To account for air resistance, the car's velocity gradually decays. A physics model is used to calculate the displacement over 150 milliseconds, accounting for the decaying velocity. Since the car does not turn (its angular velocity is 0), its attitude is expected to remain stable. On asphalt, where friction is higher, the car decelerates more quickly after stopping acceleration. The client combines the most recent historical state data, air resistance, ground friction, and other factors to estimate the car's position, velocity, and attitude at the target time. For example, due to the influence of air resistance, the speed of a car may decay from 30 to 25, and the displacement is calculated based on the decayed speed. By incorporating more dimensions of motion data (such as angular velocity, air resistance, ground friction, etc.), the client can more accurately estimate the state of the game object at the target time point, which helps to reduce estimation errors and enhance the realism of the game and the player's immersion. Especially in racing games, this additional data makes the movement of the car more in line with the laws of physics. The difference in sliding distance on different ground features, the effect of air resistance on speed, etc., make the gaming experience closer to a real racing scene.
[0054] By applying the technical solution of this embodiment, through time synchronization between the client and the server, two-way state synchronization and caching (the client synchronizes local state data, the server broadcasts state data to the client, and the client caches state data), target time calculation, dual time point (historical time and future time) query and interpolation processing, and single time point extrapolation compensation and state maintenance strategy, efficient and accurate synchronization of game object states is achieved, which improves the movement continuity and operation response speed in multiplayer online games, enhances the realism and competitive fairness of the game experience, and at the same time has a certain ability to resist network fluctuations, can maintain the stability and smoothness of the game in different network environments, and provide players with a better quality immersive gaming experience.
[0055] Further, as Figure 1 The specific implementation of the method, the embodiment of the present application provides a game object state synchronization device, such as Figure 3 As shown, the device includes:
[0056] A target time determination module 301 is used to determine a target time for synchronization of the game object;
[0057] The state data determination module 302 is configured to obtain, from the target time state cache data of the game object in the client, state data of a time immediately preceding the target time and state data of a time immediately following the target time corresponding to the target time, and interpolate the state data of the time immediately preceding and following the target time based on the target time to obtain first target time state data corresponding to the target time;
[0058] The game state synchronization module 303 is used to synchronize the game state of the game object at the target time according to the first target time state data.
[0059] In the embodiment of the present application, optionally, the state data determination module 302 is further configured to:
[0060] Calculating an interpolation position based on the target time, the historical time corresponding to the state data of the adjacent time before the target time, and the future time corresponding to the state data of the adjacent time after the target time; wherein the interpolation position is the ratio of the difference between the target time and the historical time to the difference between the future time and the historical time;
[0061] Interpolation processing is performed on the adjacent time state data before the target time and the adjacent time state data after the target time according to the interpolation position to obtain first target time state data corresponding to the target time.
[0062] In the embodiment of the present application, optionally, the state data determination module 302 is further configured to:
[0063] If the state data of the adjacent time after the target time cannot be obtained, estimating the state data of the game object at the target time based on the state data of the adjacent time before the target time to obtain the second target time state data;
[0064] The game state synchronization module 303 is further configured to synchronize the game state of the game object at the target time according to the second target time state data.
[0065] In the embodiment of the present application, optionally, the state data determining module 302 is further configured to:
[0066] Obtain the historical time corresponding to the adjacent time status data before the target time;
[0067] When the time difference between the target time and the historical time is less than a preset time length, performing the step of estimating the state data of the game object at the target time based on the state data of the adjacent time before the target time to obtain the second target time state data;
[0068] When the time difference between the target time and the historical time is greater than or equal to a preset time length, the state of the game object is determined to be a stopped motion state.
[0069] In the embodiment of the present application, optionally, the state data determining module 302 is further configured to:
[0070] Determining a state estimated duration based on a difference between the target time and the historical time corresponding to the state data of the adjacent time before the target time, and determining estimated state change information of the game object within the state estimated duration based on motion data corresponding to the state data of the adjacent time before the target time, wherein the motion data includes acceleration data in the state data of the adjacent time before the target time, and the estimated state change information includes displacement estimated information and posture estimated information;
[0071] The second target time state data is determined according to the state data of the adjacent time before the target time and the state change estimation information.
[0072] In an embodiment of the present application, optionally, the motion data also includes at least one of angular velocity data, air resistance data, ground friction data, and ground feature data.
[0073] In the embodiment of the present application, optionally, the target time determination module 301 is further configured to:
[0074] In response to an entry signal of a target game scene, receiving time synchronization information, and performing time synchronization on the client based on the time synchronization information; wherein the target game scene includes a game scene in which game objects therein use high-speed motion as a gameplay means, wherein the high-speed motion is a motion with a moving speed greater than a preset speed;
[0075] Sending first state data corresponding to the current game object to a server, so that the server synchronizes the first state data with clients of other game objects in the target game scene with the current game object; and receiving second state data of other game objects sent by the server, and storing the second state data as the target time state cache data, wherein the other game objects include the game object;
[0076] The difference between the local time of the client and the fixed offset time is calculated as the target time to be synchronized.
[0077] It should be noted that for other corresponding descriptions of the functional units involved in the game object state synchronization device provided in the embodiment of the present application, please refer to Figures 1 to 2 The corresponding description in the method will not be repeated here.
[0078] The present application also provides a game object state synchronization system, including:
[0079] Server, multiple clients;
[0080] The client is configured to: determine a target time for synchronization of the game object; obtain state data of adjacent times before and after the target time, and interpolate the state data of adjacent times before and after the target time based on the target time to obtain first target time state data corresponding to the target time; and synchronize the game state of the game object at the target time based on the first target time state data;
[0081] The server is configured to: receive status data sent by any client and synchronize the status data of any client to other clients;
[0082] The client is further configured to store the state data of other clients synchronized with the server as the target time state cache data.
[0083] It should be noted that the server and client in the game object state synchronization system provided in the embodiment of the present application can refer to Figures 1 to 2 The corresponding description in the method will not be repeated here.
[0084] The embodiment of the present application also provides a computer device, which can be specifically a personal computer, a server, a network device, etc. The computer device includes a bus, a processor, a memory and a communication interface, and may also include an input and output interface and a display device. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store location information. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, the steps in each method embodiment are implemented.
[0085] Those skilled in the art will understand that the structure of the above-mentioned computer device is only a partial structure related to the solution of the present application and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components, or combine certain components, or have a different component arrangement.
[0086] In one embodiment, a computer-readable storage medium is provided. The computer-readable storage medium may be non-volatile or volatile, and stores a computer program thereon. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0087] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0088] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0089] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processor involved in the various embodiments provided herein may be, but are not limited to, a general-purpose processor, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, and the like.
[0090] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0091] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.
Claims
1. A method for synchronizing game object states, characterized in that: Applied to the client, including: Determining a target time for synchronization of the game object; Acquire time state data adjacent to and before the target time, and interpolate the time state data adjacent to and after the target time based on the target time to obtain first target time state data corresponding to the target time, wherein the time state data includes: the position, orientation, speed, state, and timestamp of the game object; The game state of the game object at the target time is synchronized according to the first target time state data.
2. The method according to claim 1, characterized in that The interpolation processing of the adjacent time state data before and after the target time based on the target time to obtain the first target time state data corresponding to the target time includes: Calculating an interpolation position based on the target time, the historical time corresponding to the state data of the adjacent time before the target time, and the future time corresponding to the state data of the adjacent time after the target time; wherein the interpolation position is the ratio of the difference between the target time and the historical time to the difference between the future time and the historical time; Interpolation processing is performed on the adjacent time state data before the target time and the adjacent time state data after the target time according to the interpolation position to obtain first target time state data corresponding to the target time.
3. The method according to claim 1, characterized in that The method further comprises: If the state data of the adjacent time after the target time cannot be obtained, estimating the state data of the game object at the target time based on the state data of the adjacent time before the target time to obtain the second target time state data; The game state of the game object at the target time is synchronized according to the second target time state data.
4. The method according to claim 3, characterized in that The step of estimating the state data of the game object at the target time based on the state data of the adjacent time before the target time to obtain the state data of the second target time includes: Obtain the historical time corresponding to the adjacent time status data before the target time; When the time difference between the target time and the historical time is less than a preset time length, performing the step of estimating the state data of the game object at the target time based on the state data of the adjacent time before the target time to obtain the second target time state data; When the time difference between the target time and the historical time is greater than or equal to a preset time length, the state of the game object is determined to be a stopped motion state.
5. The method according to claim 3 or 4, characterized in that The estimating the state data of the game object at the target time based on the state data of the adjacent time before the target time to obtain the second target time state data includes: Determining a state estimated duration based on a difference between the target time and the historical time corresponding to the state data of the adjacent time before the target time, and determining estimated state change information of the game object within the state estimated duration based on motion data corresponding to the state data of the adjacent time before the target time, wherein the motion data includes acceleration data in the state data of the adjacent time before the target time, and the estimated state change information includes displacement estimated information and posture estimated information; The second target time state data is determined according to the state data of the adjacent time before the target time and the state change estimation information.
6. The method according to claim 5, characterized in that The motion data also includes at least one of angular velocity data, air resistance data, ground friction data, and ground feature data.
7. The method according to any one of claims 1 to 6, characterized in that Before determining the target time for synchronizing the game object, the method further includes: In response to an entry signal of a target game scene, receiving time synchronization information, and performing time synchronization on the client based on the time synchronization information; wherein the target game scene includes a game scene in which game objects therein use high-speed motion as a gameplay means, wherein the high-speed motion is a motion with a moving speed greater than a preset speed; Sending first state data corresponding to the current game object to a server, so that the server synchronizes the first state data with clients of other game objects in the target game scene with the current game object; and receiving second state data of the other game objects sent by the server, and storing the second state data as state cache data, wherein the state cache data includes state data of adjacent times before and after the target time, and the other game objects include the game object; Determining the target time for synchronizing the game object includes: The difference between the local time of the client and the fixed offset time is calculated as the target time to be synchronized.
8. A game object state synchronization system, characterized in that: include: Server, multiple clients; The client is used to: determine the target time for synchronization of the game object; Acquire time state data adjacent to and before the target time, and interpolate the time state data adjacent to and before the target time based on the target time to obtain first target time state data corresponding to the target time, wherein the time state data includes: the position, orientation, speed, state, and timestamp of the game object; synchronize the game state of the game object at the target time according to the first target time state data; The server is configured to: receive status data sent by any client and synchronize the status data of any client to other clients; The client is further configured to store the state data of other clients synchronized with the server as the state cache data.
9. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
10. A computer device comprising a storage medium, a processor, and a computer program stored in the storage medium and executable on the processor, wherein: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.