Game flyer synchronization method and device

Through the client and server simultaneously compute and adjust the trajectory of the flyer, the problem of inconsistent trajectory caused by poor network environment is solved, the game is improved smoothness and fairness, and a more real-time and smooth flying object synchronization experience is provided.

CN119015711APending Publication Date: 2024-11-26XIAMEN TRUE FUN INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411059136.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-02
Publication Date
2024-11-26

Smart Images

  • Figure CN119015711A_ABST
    Figure CN119015711A_ABST
Patent Text Reader

Abstract

The invention discloses a game flyer synchronization method, and the method applied to a client comprises the following steps: obtaining the current movement data of a flyer, including the type of the flyer, the initial flight position of the flyer, and the flight direction of the flyer; a flight path and a current flight coordinate point are calculated through a flight object path formula according to the movement data, a flight path calculation result issued by the server is received, and the flight path calculation result comprises the flight path and the current flight coordinate point; and periodically comparing the received flight path calculation result with a local calculation result, and if the data difference between the two results exceeds a set range, dynamically adjusting the flight path of the local flyer, so that the flight path and the current flight coordinate point are kept consistent with the server. The problem that due to network synchronization errors in an existing game, all clients may display incompletely-consistent flight paths is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of computer application, and in particular relates to a synchronization method and device for a game flying object. Background Art

[0002] When game users play competitive games (such as Game for Peace, Knives Out, and Fortnite), the game objects controlled by game players may need to use flying scene props such as throwing objects (such as grenades and smoke bombs). In the case of poor network connection, due to abnormal network environment, it is easy to have inconsistent flight trajectories displayed on different clients.

[0003] To solve the above problems, the existing technology mainly adopts the following two solutions: Solution 1: Only the starting point and speed of the flying object are synchronized on each client device, and the subsequent flight trajectory is handed over to each client device for trajectory calculation; Solution 2: The server calculates the flight trajectory of the flying object, synchronizes the flying object coordinates each time at a fixed frame rate, and sends the coordinates to each client device. At this time, the flying object of the client device directly uses the received flying object coordinate point. However, by adopting Solution 1, since the client device may cause calculation errors due to factors such as hardware performance and algorithm implementation, the flight trajectories calculated on different devices may show large trajectory differences, affecting the fairness and consistency of the game. By adopting Solution 2, game users can clearly perceive that there is a freeze problem in the flight trajectory of the flying object, especially when the flight speed increases, the freeze phenomenon will become more obvious.

[0004] The Chinese patent with publication number CN111135578A discloses a method and device for moving a game character, wherein the method for moving a game character is applied to a client, including: receiving a water surface drift instruction; obtaining water surface drift information according to the water surface drift instruction, and transmitting the water surface drift information to a server, so that the server generates coordinate information of the game character according to the water surface drift information; receiving the coordinate information transmitted by the server; and moving the game character according to the coordinate information and the water surface drift information to generate a water surface drift animation. This invention receives the water surface drift information transmitted by the client through the server to calculate the coordinate information of the game character and sends the coordinate information to the client, which may cause a delay and cause a freeze. Summary of the invention

[0005] The present invention provides a method and device for synchronizing a game flying object, aiming to solve the problem in existing games that each client may display an incompletely consistent flight trajectory due to network synchronization error.

[0006] In order to solve the above technical problems, the present invention provides a method for synchronizing a flying object in a game, which is applied to a client and comprises the following steps:

[0007] Get the current movement data of the flying object, including the type of the flying object, the starting flight position of the flying object, and the flying direction of the flying object.

[0008] The flight trajectory and the current coordinate point of the flight are calculated according to the movement data by using the flying object trajectory formula, and the flight trajectory calculation result sent by the server is received, wherein the flight trajectory calculation result includes the flight trajectory and the current coordinate point of the flight.

[0009] The received flight trajectory calculation results are periodically compared with the local calculation results. If the data difference between the two exceeds the set range, the flight trajectory of the local aircraft is dynamically adjusted to make the flight trajectory and the current flight coordinate point consistent with the server.

[0010] Preferably, the current coordinate point of the flight is calculated by the flying object trajectory formula according to the movement data as follows:

[0011] P0=v0*t0*d0*DP

[0012] Wherein, P0 is the current coordinate point of the flight; v0 is the flight speed of the flying object, which is assigned when the flying object is triggered; t0 is the current time; d0 is the trajectory formula of the flying object, and the selection of d is assigned according to the type of the flying object when the flying object is triggered; DP is the percentage of network synchronization difference between the client and the server, which compensates for the network delay difference between different clients and servers.

[0013] Preferably, each flight trajectory is obtained by calculating the smooth curve of the current coordinate point, and the moving position point of the flying object is re-corrected by a linear difference algorithm and applied to the movement of the flying object. The specific calculation formula is:

[0014] Lerp=(a+(ba)*t)

[0015] Where Lerp is the corrected flying object moving position; a is the current flight coordinate point calculated locally by the client; b is the current flight coordinate point sent by the server; and t is the interval time.

[0016] On the other hand, the present invention provides a method for synchronizing a game flying object, which is applied to a server and comprises the following steps:

[0017] Receive the current movement data of the flying object sent by the client, including the type of the flying object, the starting flight position of the flying object, and the flying direction of the flying object.

[0018] The current coordinate point of the flight is calculated based on the movement data using the flying object trajectory formula, and the flight trajectory calculation result is sent to the client.

[0019] Preferably, the calculation formula of the current coordinate point of the flight is specifically:

[0020] P1=v1*t1*d1

[0021] Where P1 is the coordinate end point of the flight trajectory; v1 is the flight speed of the flying object; t1 is the current time; d1 is the trajectory formula of the flying object.

[0022] On the other hand, the present invention provides a synchronization device for a flying object in a game, which is applied to a client and includes a data acquisition module, a trajectory calculation module and a flight synchronization module.

[0023] The data acquisition module is used to obtain the current movement data of the flying object, including the type of the flying object, the starting flight position of the flying object, and the flight direction of the flying object.

[0024] The trajectory calculation module is used to calculate the flight trajectory and the current coordinate point of the flight according to the movement data through the flying object trajectory formula, and receive the flight trajectory calculation result sent by the server, and the flight trajectory calculation result includes the flight trajectory and the current coordinate point of the flight.

[0025] The flight synchronization module is used to periodically compare the received flight trajectory calculation results with the local calculation results. If the data difference between the two exceeds the set range, the flight trajectory of the local aircraft is dynamically adjusted to make the flight trajectory and the current flight coordinate point consistent with the server.

[0026] On the other hand, the present invention provides a synchronization device for game flying objects, which is applied to a server and includes a data receiving module and a data calculating module.

[0027] The data receiving module is used to receive the current movement data of the flying object sent by the client, including the type of the flying object, the starting flight position of the flying object, and the flight direction of the flying object.

[0028] The data calculation module is used to calculate the flight trajectory coordinate end point according to the movement data through the flying object trajectory formula, and send the flight trajectory calculation result to the client.

[0029] On the other hand, the present invention also provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method for synchronizing game flying objects as described in any embodiment of the present invention when executing the computer program.

[0030] On the other hand, the present invention further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method for synchronizing a game flying object as described in any embodiment of the present invention.

[0031] Compared with the prior art, the present invention has the following technical effects:

[0032] The present invention greatly reduces the problem of inconsistent flight positions of various clients due to network synchronization errors by allowing the client and server to simultaneously calculate the flight trajectory synchronization equation, and synchronizing the flight results obtained by the server with the client to correct and smoothly adjust the flight trajectory. At the same time, by adopting the corresponding smooth calculation equation, the smoothness of the flying object's flight process is further improved. In summary, the present invention can further improve the smoothness of the flying object synchronization process, allowing game users to experience smoother and real-time flying object performance, and solve the problem of untimely synchronization of flying objects in scenarios with poor network conditions. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 It is an overall flow chart of the synchronization method of the game flying object applied to the client according to the present invention;

[0034] Figure 2 It is an overall flow chart of the synchronization method of game flying objects applied to a server according to the present invention. DETAILED DESCRIPTION

[0035] In order to make the objectives, technical solutions and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in combination with specific embodiments of the present application and with reference to the accompanying drawings.

[0036] Embodiment 1

[0037] This embodiment provides a method for synchronizing a flying object in a game, which is applied to a client and includes the following steps:

[0038] Get the current movement data of the flying object, including the type of flying object, the starting flight position of the flying object, and the flight direction of the flying object. The type of flying object is used to determine which flying object trajectory equation to start for trajectory simulation calculation. In the calculation of the flying object trajectory equation, it is necessary to combine the initial recorded data of the flying object and the current game running time, and finally calculate the flight coordinate points of the flying object at the current time point and combine them into the flying object trajectory. The flying object trajectory equation can include linear equations, Bezier curves, and custom curves. The following takes the quadratic Bezier curve as an example to calculate the flying object trajectory:

[0039] D=(1-t 2 )A+2t(1-t)B+t 2 C

[0040] Where D is the coordinate point of the quadratic Bezier curve of the flying object; A is the starting coordinate point of the flying object; B is the curve addition point, which is obtained from the configured position file; C is the coordinate end point of the flying object's flight trajectory; and t is the current time.

[0041] The flight trajectory and the current coordinate point of the flight are calculated according to the movement data by using the flying object trajectory formula, and the flight trajectory calculation result sent by the server is received, wherein the flight trajectory calculation result includes the flight trajectory and the current coordinate point of the flight.

[0042] The received flight trajectory calculation results are periodically compared with the local calculation results. If the data difference between the two exceeds the set range, the flight trajectory of the local aircraft is dynamically adjusted to make the flight trajectory and the current flight coordinate point consistent with the server.

[0043] As a preferred implementation of this embodiment, the current coordinate point of the flight is calculated according to the movement data by the flying object trajectory formula:

[0044] P0=v0*t0*d0*DP

[0045] In the formula, p0 is the current coordinate point of the flight; v0 is the flight speed of the flying object; t0 is the current time; d0 is the trajectory formula of the flying object, and the selection of d is assigned according to the type of the flying object when the flying object is triggered; DP is the difference percentage between the calculation results of the client and the server, that is, the difference percentage between the current coordinate point of the flight calculated by the client and the current coordinate point of the flight calculated by the server at the same time point. The difference percentage is mainly used to affect the selection of the flight speed of the client. If the difference percentage is positive, it means that the flight trajectory of the client's calculation result lags behind the server and requires additional speed supplement; if the difference percentage is negative, it means that the flight trajectory of the client's calculation result is ahead of the server, and the flight speed of the current flying object needs to be reduced.

[0046] As a preferred implementation of this embodiment, for each flight trajectory change, instead of directly assigning coordinate points, each flight trajectory is obtained by calculating the smooth curve of the current coordinate points, and the current coordinate points of the flight are re-corrected by a linear difference algorithm and applied to the movement of the flying object. The specific calculation formula is:

[0047] Lerp=(a+(ba)*t)

[0048] Where Lerp is the corrected flying object moving position; a is the current flight coordinate point calculated locally by the client; b is the current flight coordinate point sent by the server; and t is the interval time of the difference.

[0049] Accordingly, this embodiment provides a method for synchronizing a flying object in a game, which is applied to a server and includes the following steps:

[0050] Receive the current movement data of the flying object sent by the client, including the type of the flying object, the starting flight position of the flying object, and the flying direction of the flying object.

[0051] The current coordinate point of the flight is calculated based on the movement data using the flight object trajectory formula, and the flight trajectory calculation result is sent to the client. Furthermore, the flight object trajectory calculation equation on the server is the same as that on the client, and the parameter requirements for calculating the coordinate end point are the same as those on the client, thereby ensuring that the calculation results of the client and server are consistent. At this time, the difference in coordinate points can only be the calculation result error caused by the difference in network synchronization time.

[0052] As a preferred implementation of this embodiment, the calculation formula for calculating the current coordinate point of the flight is specifically:

[0053] P1=v1*t1*d1

[0054] Where P1 is the current coordinate point of the flight; v1 is the flight speed of the flying object; t1 is the current time; d1 is the trajectory formula of the flying object.

[0055] Embodiment 2

[0056] Correspondingly, this embodiment provides a synchronization device for game flying objects, which is applied to a client, including a data acquisition module, a trajectory calculation module and a flight synchronization module. The device implements a synchronization method for game flying objects applied to a client as described in any embodiment of the present invention.

[0057] The data acquisition module is used to obtain the current movement data of the flying object, including the type of the flying object, the starting flight position of the flying object, and the flight direction of the flying object.

[0058] The trajectory calculation module is used to calculate the flight trajectory and the current coordinate point of the flight according to the movement data through the flying object trajectory formula, and receive the flight trajectory calculation result sent by the server, and the flight trajectory calculation result includes the flight trajectory and the current coordinate point of the flight.

[0059] The flight synchronization module is used to periodically compare the received flight trajectory calculation results with the local calculation results. If the data difference between the two exceeds the set range, the flight trajectory of the local aircraft is dynamically adjusted to make the flight trajectory and the current flight coordinate point consistent with the server.

[0060] Correspondingly, this embodiment also provides a synchronization device for game flying objects, which is applied to a server and includes a data receiving module and a data calculation module. The device implements a synchronization method for game flying objects applied to a server as described in any embodiment of the present invention.

[0061] The data receiving module is used to receive the current movement data of the flying object sent by the client, including the type of the flying object, the starting flight position of the flying object, and the flight direction of the flying object.

[0062] The data calculation module is used to calculate the current coordinate point of the flight according to the movement data through the flying object trajectory formula, and send the flight trajectory calculation result to the client.

[0063] Embodiment 3

[0064] This embodiment provides an electronic device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, it implements the method for synchronizing game flying objects as described in any embodiment of the present invention.

[0065] Embodiment 4

[0066] This embodiment provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method for synchronizing a flying object in a game as described in any embodiment of the present invention is implemented.

[0067] In the embodiments of the present application, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent the existence of A alone, the existence of A and B at the same time, and the existence of B alone. Among them, A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b and c can be represented by: a, b, c, a and b, a and c, b and c, or a and b and c, where a, b, c can be single or multiple.

[0068] Those of ordinary skill in the art will appreciate that the various units and algorithm steps described in the embodiments disclosed herein can be implemented in a combination of electronic hardware, computer software, and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0069] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0070] In several embodiments provided in the present application, if any function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory; hereinafter referred to as: ROM), random access memory (Random Access Memory; hereinafter referred to as: RAM), disk or optical disk, and other media that can store program codes.

[0071] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A method for synchronizing a flying object in a game, characterized in that: Applied to the client, it includes the following steps: Get the current movement data of the flying object, including the type of flying object, the starting flight position of the flying object, and the flying direction of the flying object; Calculate the flight trajectory and the current coordinate point of the flight according to the movement data using the flying object trajectory formula, and receive the flight trajectory calculation result sent by the server, wherein the flight trajectory calculation result includes the flight trajectory and the current coordinate point of the flight; The received flight trajectory calculation results are periodically compared with the local calculation results. If the data difference between the two exceeds the set range, the flight trajectory of the local aircraft is dynamically adjusted to make the flight trajectory and the current flight coordinate point consistent with the server.

2. The method for synchronizing game flying objects according to claim 1, characterized in that: According to the movement data, the current coordinate point of the flight is calculated by the flying object trajectory formula: P0=v0*t0*d0*DP Wherein, P0 is the current coordinate point of the flight; v0 is the flight speed of the flying object, which is assigned when the flying object is triggered; t0 is the current time; d0 is the trajectory formula of the flying object, and the selection of d is assigned according to the type of the flying object when the flying object is triggered; DP is the percentage of network synchronization difference between the client and the server, which compensates for the network delay difference between different clients and servers.

3. The method for synchronizing game flying objects according to claim 2, characterized in that: Each flight trajectory is obtained by calculating the smooth curve of the current coordinate point, and the moving position of the flying object is re-corrected through the linear difference algorithm and applied to the movement of the flying object. The specific calculation formula is: Lerp=(a+(ba)*t) Where Lerp is the corrected flying object moving position; a is the current flight coordinate point calculated locally by the client; b is the current flight coordinate point sent by the server; and t is the interval time.

4. A method for synchronizing a flying object in a game, characterized in that: Applied to the server, including the following steps: Receive the current movement data of the flying object sent by the client, including the type of the flying object, the starting flight position of the flying object, and the flying direction of the flying object; The current coordinate point of the flight is calculated based on the movement data using the flying object trajectory formula, and the flight trajectory calculation result is sent to the client.

5. A method for synchronizing a flying object in a game according to claim 4, characterized in that: The calculation formula of the current coordinate point of the flight is specifically: P1=v1*t1*d1 Where P1 is the coordinate end point of the flight trajectory; v1 is the flight speed of the flying object; t1 is the current time; d1 is the trajectory formula of the flying object.

6. A synchronization device for a flying object in a game, characterized in that: Applied to the client, including data acquisition module, trajectory calculation module and flight synchronization module; The data acquisition module is used to obtain the current movement data of the flying object, including the type of the flying object, the starting flight position of the flying object, and the flight direction of the flying object; A trajectory calculation module is used to calculate the flight trajectory and the current coordinate point of the flight according to the movement data through the flying object trajectory formula, and receive the flight trajectory calculation result sent by the server, the flight trajectory calculation result includes the flight trajectory and the current coordinate point of the flight; The flight synchronization module is used to periodically compare the received flight trajectory calculation results with the local calculation results. If the data difference between the two exceeds the set range, the flight trajectory of the local aircraft is dynamically adjusted to make the flight trajectory and the current flight coordinate point consistent with the server.

7. A synchronization device for a flying object in a game, characterized in that: Applied to the server, including a data receiving module and a data computing module; The data receiving module is used to receive the current movement data of the flying object sent by the client, including the type of the flying object, the starting flight position of the flying object, and the flying direction of the flying object; The data calculation module is used to calculate the current coordinate point of the flight according to the movement data through the flying object trajectory formula, and send the flight trajectory calculation result to the client.

8. An electronic device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method for synchronizing a game flying object as described in any one of claims 1 to 5 when executing the computer program.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for synchronizing a game flying object as claimed in any one of claims 1 to 5 is implemented.