A method, system and device for smooth synchronization of game entity positions

By caching on the client and adjusting the period T according to the length of the cache queue, the movement process of targets in online games is optimized, the lag problem caused by network delays is solved, and the game experience is improved.

CN113965625BActive Publication Date: 2024-09-03GUANGZHOU AIYOU INFORMATION TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111067732.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-13
Publication Date
2024-09-03
Estimated Expiration
2041-09-13

AI Technical Summary

Technical Problem

In existing online games, the moving process of the target on the client is limited by the synchronization frequency between the server and the client, which leads to the phenomenon of lag and discontinuity when the network delay is high, giving users a bad gaming experience.

Method used

By caching the status data sent by the server on the client side, and setting the period T according to the length of the cache queue, the status data is read one by one, so that the target moves to the indicated position within the period T, optimizing the performance of the target's movement process.

Benefits of technology

It effectively reduces the impact of network delay and synchronization frequency on the target movement process, making the target movement process smooth and improving the user's gaming experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113965625B
    Figure CN113965625B
Patent Text Reader

Abstract

The present disclosure relates to a method, system and device for smooth synchronization of game entity positions, and the method includes the following steps: S01, the server sends status data D for indicating the target moving position to the client; S02, after receiving the status data D, the client caches the status data D in the cache queue L; S03, the client reads the status data D in the cache queue L one by one in sequence, sets the period T according to the length l of the cache queue L, and the client reads the first status data D1 in the cache queue L, so that the target corresponding to the first status data D1 moves to the position indicated by the first status data D1 within the period T and is presented in the game screen, and then reads the next status data D2. The system includes a server and a client. The device is used to execute the above method. The present disclosure can optimize the performance of the target moving screen in the client, make the target moving process smooth, and help improve the user's gaming experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of game development technology, and in particular to a method, system and device for smooth synchronization of game entity positions. Background Art

[0002] Online games generally refer to electronic games in which multiple users interact and entertain each other through the computer Internet, also known as online games, including multiplayer online games, such as Massive Multiplayer Online Role-Playing Game (MMORPG) and Multiplayer Online Battle Arena (MOBA). When users play online games, it is necessary to ensure data interaction between users of the online game. Therefore, it is extremely important to synchronize the status data (mainly location coordinates) between the user terminals of each user.

[0003] Currently, there are two main methods for synchronizing the status data of online games:

[0004] 1. Client A obtains the coordinates of the moving position, rotation angle and other data of the target (such as the role or person in the game) according to the user's input instructions. These data are called state data. Client A sends the state data to the server (i.e. the server of the online game). The server verifies the state data and forwards it to other online clients. After receiving the state data, the client moves the corresponding target to the position indicated by the state data according to the target ID, physical world coordinates and rotation angle indicated by the state data. In this process, the movement of the target is presented in the game screen through screen rendering.

[0005] 2. Client A sends the operation command input by the user to the server. The server obtains the status data corresponding to the operation command after verification and calculation, and then broadcasts the status data to other online clients. After receiving the status data, the client controls the corresponding target to move and present it on the game screen.

[0006] In the above-mentioned state data synchronization method, after receiving the state data broadcast by the server, the client reads the state data and presents it on the game screen. However, due to the limitation of the synchronization frequency between the server and the client, the client often cannot show a smooth effect on the target movement process, and it is easy to experience stuttering and discontinuity when the network delay is high. A more direct method is to directly set the position coordinates and rotation angle of the target on the client according to the received state data, but in this way, the target will appear to be "teleported" on the game screen, which will bring a bad gaming experience to users. Summary of the invention

[0007] In order to solve the problems existing in the above-mentioned prior art, the present invention aims to provide a method, system and device for smooth synchronization of game entity positions. The present invention can optimize the performance of the target moving screen in the client, make the target moving process smooth, and help improve the user's gaming experience.

[0008] The present invention discloses a method for smooth synchronization of game entity positions, comprising the following steps:

[0009] S01, the server sends status data D indicating the target moving position to the client;

[0010] S02, after receiving the state data D, the client caches the state data D into a cache queue L;

[0011] S03. The client reads the status data D in the cache queue L one by one in sequence, sets a period T according to the length l of the cache queue L, and reads the first status data D1 in the cache queue L, so that the target corresponding to the first status data D1 moves to the position indicated by the first status data D1 within the period T and is presented on the game screen, and then reads the next status data D2.

[0012] Preferably, in step S03, the client sequentially reads the status data D in the cache queue L one by one, including:

[0013] Check whether there is status data D in the cache queue L. If yes, read the first status data D1 in the cache queue L. Otherwise, repeat this step.

[0014] Preferably, in step S03, setting the period T according to the length l of the cache queue L comprises:

[0015] Take t = 1 / V;

[0016] Wherein, t represents a reference value, and V represents the broadcast frequency of the server;

[0017] When there is no state data D in the cache queue L, the period T is infinitely long;

[0018] When state data D exists in the cache queue L, the period T is associated with the data length l of the state data D through an inverse function or a piecewise function, so that the period T decreases as the data length l increases;

[0019] In the inverse function, the period T and the data length l are calculated as follows:

[0020] (k and b are both constants and k>0, b>0)

[0021] In the piecewise function, the period T and the data length l are calculated as follows:

[0022] For the data length l, take n values ​​of the length threshold that increase in sequence, denoted as A1, A2...A n According to the length threshold, n+1 length threshold intervals are set, which are recorded as (0, A1], (A1, A2]...(A n-1 , A n ],(A n ,+∞), corresponding to each length threshold interval, take n+1 proportional coefficients with decreasing values ​​in sequence, denoted as B1, B2...B n+1 , wherein B1, B2...B n+1 All are greater than 0;

[0023] When the data length is l∈(0, A1], the period T=B1*t,

[0024] When the data length is l∈(A1, A2], the period T=B2*t, ......

[0026] When the data length l∈(A n ,+∞), the period T=B n+1 *t.

[0027] Preferably, the value range of the constant b is [0.5t, t), and the value of k+b satisfies k+b∈(t, 1.2t].

[0028] Preferably, the proportional coefficients B1, B2...B n+1 The value range is [0.5,1.2].

[0029] Preferably, in the step S03, moving the target corresponding to the first state data D1 to the position indicated by the first state data D1 within the period T comprises:

[0030] The period T is divided into m rendering frames, and the moving path of the target is divided into m sub-paths, so that the target moves a sub-path in each rendering frame, and finally moves the target to the position indicated by the first state data D1 after m rendering frames.

[0031] Preferably, the state data includes a target ID, entity world coordinates and a rotation angle.

[0032] The present disclosure also provides a game entity position smooth synchronization system, comprising:

[0033] A server, the server is used to send status data D indicating the target moving position to the client according to the operation instruction;

[0034] A client, wherein the client is used to cache the status data D into a cache queue L after receiving the status data D; the client reads the status data D in the cache queue L one by one in sequence, sets a period T according to the length l of the cache queue L, and reads the first status data D1 in the cache queue L, so that the target corresponding to the first status data D1 moves to the position indicated by the first status data D1 within the period T, and then reads the next status data D2.

[0035] The present disclosure also provides a computer device, including a processor and a memory, wherein the memory stores at least one instruction or at least one program, and when the at least one instruction or the at least one program is loaded by the processor, the method for smooth synchronization of game entity positions as described above is executed.

[0036] The advantages of the method, system and device for smooth synchronization of game entity positions disclosed in the present disclosure are:

[0037] 1. The disclosed method for smooth synchronization of game entity positions is to cache the state data D in the cache queue L after receiving the state data D broadcast by the server, set the period T according to the length l of the cache queue L, and read the state data D in the cache queue L one by one by the client, so that the target corresponding to the state data D moves to the position indicated by the state data within the period T and is presented in the game screen, that is, the movement process indicated by the state data D is completed within the period T. By adopting the method of caching first and then reading for performance on the client, the influence of factors such as network delay and synchronization frequency on the performance of the target movement process can be effectively reduced, the performance of the target movement screen in the client can be optimized, and the target movement process can be performed smoothly, which is conducive to improving the user's game experience.

[0038] 2. The time of the target movement process, that is, the period T is set according to the length l of the cache queue. The period T can be adjusted in real time according to the length l of the cache queue, that is, the rate at which the client reads the status data D is adjusted according to the length l of the cache queue, which can further optimize the performance of the target movement picture in the client and enhance the user's gaming experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 is a flowchart of the steps of a method for smooth synchronization of game entity positions described in the present disclosure;

[0040] Figure 2 It is a judgment flow chart of a method for smooth synchronization of game entity positions described in the present disclosure;

[0041] Figure 3 It is a structural block diagram of a game entity position smooth synchronization system described in the present invention.

[0042] Explanation of the accompanying drawings: 1-server, 2-client. DETAILED DESCRIPTION

[0043] like Figure 1 , Figure 2 As shown, a method for smooth synchronization of game entity positions described in the present disclosure comprises the following steps:

[0044] S01, the server sends state data D indicating the moving position of a target to the client. Specifically, for a multiplayer online network game, one of the clients, denoted as client A, sends state data D of the moving position of a target to the server according to the user's operation instruction. After receiving the state data D, the server verifies it. After the verification is passed, the server broadcasts the state data D to all online clients. The state data D is used to indicate the moving position of the corresponding target.

[0045] S02, after receiving the state data D, the client caches the state data D in the cache queue L. In the actual online game operation process, the target, such as the characters and characters in the game, which are controlled by the user, is usually in a high-frequency moving state. Therefore, in step S01, the state data D sent by the server to the client usually contains multiple state data to indicate the moving position of the target that changes at all times. Therefore, in this step, there is usually more than one state data in the cache queue L, and each state data is cached in the cache queue L in order according to the time before and after the receiving time point.

[0046] S03. The client reads the status data D in the cache queue L one by one in order, that is, reads each status data one by one according to the cache order of each status data. A period T is set according to the length l of the cache queue L. The client reads the first state data D1 in the cache queue L, that is, the state data first cached in the current cache queue L, so that the target corresponding to the first state data D1 moves to the position indicated by the first state data D1 in the period T and is presented on the game screen. This process is the presentation process of the first state data D1 on the client. After reading the first state data D1, the client finds the target corresponding to the first state data D1 in the game file, such as the corresponding character, and then moves the target to the corresponding entity position coordinates and rotates the target by the corresponding angle according to the entity world coordinates and rotation angle indicated by the first state data D1, that is, the entity position coordinates to which the target is to move and the rotation angle of the target. In this process, the target's movement process is correspondingly presented on the game screen. When the target ends the movement process, the target moves to the indicated position on the game screen. The whole process is completed at a uniform speed within the period T, so that the target's movement process appears smooth on the game screen.

[0047] The disclosed method for smooth synchronization of game entity positions caches the state data D in a cache queue L after receiving the state data D broadcast by the server, sets a period T according to the length l of the cache queue L, and reads the state data D in the cache queue L one by one by the client, so that the target corresponding to the state data D moves to the position indicated by the state data within the period T and is presented in the game screen, that is, the movement process indicated by the state data D is completed within the period T. By adopting the method of caching first and then reading for performance on the client, the influence of factors such as network delay and synchronization frequency on the performance of the target movement process can be effectively reduced, the performance of the target movement screen in the client can be optimized, and the target movement process can be performed smoothly, which is conducive to improving the user's game experience.

[0048] The time of the target movement process, that is, the period T is set according to the length l of the cache queue. The period T can be adjusted in real time according to the length l of the cache queue, that is, the rate at which the client reads the status data D is adjusted according to the length l of the cache queue, which can further optimize the performance of the target movement picture in the client and enhance the user's gaming experience.

[0049] Further, in this embodiment, if Figure 2 As shown, in step S03, the client sequentially reads the status data D in the cache queue L one by one, including:

[0050] When the client is started and the user is playing the game, the client detects in real time whether there is status data D in the cache queue L. If so, the first status data D1 in the cache queue L is read and executed, that is, the status data is executed and presented on the client. Otherwise, this step is repeated, that is, this step is actually a process of cyclically detecting the status of the cache queue L, so that the status data is read out and presented as soon as there is status data cached in the cache queue L.

[0051] Further, in this embodiment, in step S03, setting the period T according to the length l of the cache queue L includes:

[0052] Take t = 1 / V;

[0053] Wherein, t represents a reference value, i.e., a standard period, and V represents a broadcast frequency of the server;

[0054] When there is no state data D in the cache queue L, the period T is infinitely long;

[0055] When state data D exists in the cache queue L, the period T is associated with the data length l of the state data D through an inverse function or a piecewise function, so that the period T decreases as the data length l increases;

[0056] In the inverse function, the period T and the data length l are calculated as follows:

[0057] (k and b are both constants and k>0, b>0)

[0058] The value range of the constant b is [0.5t, t), and the value of k+b satisfies k+b∈(t, 1.2t].

[0059] In the piecewise function, the period T and the data length l are calculated as follows:

[0060] For the data length l, take n values ​​of the length threshold that increase in sequence, denoted as A1, A2...A n According to the length threshold, n+1 length threshold intervals are set, which are recorded as (0, A1], (A1, A2]...(A n-1 , A n ],(A n ,+∞), corresponding to each length threshold interval, take n+1 proportional coefficients with decreasing values ​​in sequence, denoted as B1, B2...B n+1 , wherein B1, B2...B n+1 are all greater than 0; more specifically, the proportionality coefficients B1, B2...B n+1 The value range of is [0.5,1.2];

[0061] When the data length is l∈(0, A1], the period T=B1*t,

[0062] When the data length is l∈(A1, A2], the period T=B2*t, ......

[0064] When the data length l∈(A n ,+∞), the period T=B n+1 *t.

[0065] Exemplarily, the number of length thresholds is 3, which are denoted as A1, A2, A3, respectively, where A1, A2, A3 are equal to 3, 5, and 10 respectively. Four length threshold intervals are set, which are denoted as (0, 3], (3, 5], (5, 10], and (10, +∞), and corresponding to the four length threshold intervals, four proportional coefficients B1, B2, B3, and B4 with decreasing values ​​are taken, where B1, B2, B3, and B4 are equal to 1.2, 1, 0.7, and 0.5 respectively;

[0066] Then, when the data length l∈(0,3], the period T=1.2*t;

[0067] When the data length l∈(3,5], the period T=1*t;

[0068] When the data length l∈(5,10], the period T=0.7*t;

[0069] When the data length l∈(10,+∞), the period T=0.5*t.

[0070] Through the above steps, the size of the period T can be adjusted according to the data length l of the cache queue L, and then the rate at which the client reads the status data can be adjusted, so that the target movement process appears smooth in the game screen, which is conducive to improving the user experience.

[0071] Furthermore, in this embodiment, in step S03, moving the target corresponding to the first state data D1 to the position indicated by the first state data D1 within the period T includes:

[0072] The cycle T is divided into n rendering frames, and the moving path of the target is divided into m sub-paths, so that the target moves a sub-path in each rendering frame, and finally moves the target to the position indicated by the first state data D1 after m rendering frames. By dividing the entire moving path into m sub-paths and then moving the target frame by frame, the rendering of the game screen can be smooth and the performance can be smooth during the target movement.

[0073] Furthermore, in this embodiment, the state data includes a target ID, entity world coordinates, and a rotation angle.

[0074] The present disclosure also provides a game entity position smooth synchronization system, comprising:

[0075] A server, the server is used to send status data D indicating the target moving position to the client according to the operation instruction;

[0076] A client, wherein the client is used to cache the status data D into a cache queue L after receiving the status data D; the client reads the status data D in the cache queue L one by one in sequence, sets a period T according to the length l of the cache queue L, and reads the first status data D1 in the cache queue L, so that the target corresponding to the first status data D1 moves to the position indicated by the first status data D1 within the period T, and then reads the next status data D2.

[0077] The game entity position smooth synchronization system described in the embodiment of the present disclosure and the above-mentioned game entity position smooth synchronization method are based on the same inventive concept, and can be understood by referring to the description of the game entity position smooth synchronization method above, which will not be repeated here.

[0078] The game entity position smooth synchronization system described in the embodiment of the present disclosure can optimize the performance of the target movement picture in the client, make the target movement process smooth, and help improve the user's gaming experience.

[0079] The embodiment of the present disclosure also provides a computer device, including a processor and a memory, wherein at least one instruction or at least one program is stored in the memory, and when the at least one instruction or at least one program is loaded by the processor, the method for smooth synchronization of game entity positions as described above is executed, and the memory can be used to store software programs and modules, and the processor executes various functional applications by running the software programs and modules stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, application programs required for functions, etc.; the data storage area can store data created according to the use of the device, etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory can also include a memory controller to provide the processor with access to the memory.

[0080] The method embodiments provided in the embodiments of the present disclosure may be executed in a computer terminal, a server or a similar computing device, that is, the above-mentioned computer device may include a computer terminal, a server or a similar computing device. The internal structure of the computer device may include but is not limited to: a processor, a network interface and a memory. Among them, the processor, network interface and memory in the computer device may be connected via a bus or other means.

[0081] Among them, the processor (or CPU (Central Processing Unit, central processing unit)) is the computing core and control core of the computer device. The network interface may optionally include a standard wired interface, a wireless interface (such as WI-FI, a mobile communication interface, etc.). Memory is a memory device in a computer device for storing programs and data. It is understandable that the memory here can be a high-speed RAM storage device or a non-volatile storage device (non-volatile memory), such as at least one disk storage device; optionally, it can also be at least one storage device located away from the aforementioned processor. The memory provides a storage space, which stores the operating system of the electronic device, including but not limited to: Windows system (an operating system), Linux (an operating system), Android (Android, a mobile operating system) system, IOS (a mobile operating system) system, etc., and the present disclosure does not limit this; and, in the storage space, one or more instructions suitable for being loaded and executed by the processor are also stored, and these instructions can be one or more computer programs (including program codes). In the embodiment of this specification, the processor loads and executes one or more instructions stored in the memory to implement the game entity position smooth synchronization method described in the above method embodiment.

[0082] In the description of the present disclosure, it is necessary to understand that the directions or positional relationships indicated by directional words such as "front, back, up, down, left, right", "lateral, vertical, horizontal" and "top, bottom" are usually based on the directions or positional relationships shown in the drawings, and are only for the convenience of describing the present disclosure and simplifying the description. Unless otherwise specified, these directional words do not indicate or imply that the device or element referred to must have a specific orientation or be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the scope of protection of the present disclosure.

[0083] For those skilled in the art, various other corresponding changes and deformations can be made according to the technical solutions and concepts described above, and all of these changes and deformations should fall within the protection scope of the claims of the present disclosure.

Claims

1. A method for smooth synchronization of game entity positions, characterized in that: The following steps are involved: S01, the server sends status data D indicating the target moving position to the client; S02, after receiving the state data D, the client caches the state data D into a cache queue L; S03, the client reads the status data D in the cache queue L one by one in order, and reads the status data D in the cache queue L according to the length of the cache queue L. Set the period T so that the period T varies with the data length The client reads the first state data D1 in the cache queue L, moves the target corresponding to the first state data D1 to the position indicated by the first state data D1 within the period T and presents it on the game screen, and then reads the next state data D2; In step S03, the client sequentially reads the status data D in the cache queue L one by one, including: Detect whether there is status data D in the cache queue L, if yes, read the first status data D1 in the cache queue L, otherwise repeat this step; In step S03, according to the length of the cache queue L Setting the period T includes: Take t=1 / V; Wherein, t represents a reference value, and V represents the broadcast frequency of the server; When there is no state data D in the cache queue L, the period T is infinitely long; When there is state data D in the cache queue L, the period T is equal to the data length of the state data D. related by inverse or piecewise functions; In the inverse function, the period T is proportional to the data length. It is calculated as follows: ; ( , are constants and , ) In the piecewise function, the period T and the data length It is calculated as follows: Data length Take n length thresholds with increasing values ​​in sequence, denoted as , ... , according to the length threshold, set n+1 length threshold intervals, which are recorded as , ... , , corresponding to each length threshold interval, take n+1 proportional coefficients with decreasing values ​​in turn, recorded as , ... , where , ... All are greater than 0; When the data length Time, cycle , When the data length Time, cycle , ...... When the data length Time, cycle .

2. The method for smooth synchronization of game entity positions according to claim 1, characterized in that: The constant The value range is ,and The value of satisfies .

3. The method for smooth synchronization of game entity positions according to claim 2, characterized in that: The proportionality factor The value range is .

4. The method for smooth synchronization of game entity positions according to claim 1, characterized in that: In the step S03, moving the target corresponding to the first item of status data D1 to the position indicated by the first item of status data D1 within the period T comprises: The period T is divided into m rendering frames, and the moving path of the target is divided into m sub-paths, so that the target moves a sub-path in each rendering frame, and finally moves the target to the position indicated by the first state data D1 after m rendering frames.

5. The method for smooth synchronization of game entity positions according to claim 1, characterized in that: The state data includes target ID, entity world coordinates and rotation angle.

6. A system for smooth synchronization of game entity positions, used to implement the method for smooth synchronization of game entity positions as claimed in any one of claims 1 to 5, characterized in that: include: A server, the server is used to send status data D indicating the target moving position to the client according to the operation instruction; The client is used to cache the state data D in a cache queue L after receiving the state data D; the client reads the state data D in the cache queue L one by one in sequence, and according to the length of the cache queue L Set the period T so that the period T varies with the data length The client reads the first item of status data D1 in the cache queue L, moves the target corresponding to the first item of status data D1 to the position indicated by the first item of status data D1 within the period T, and then reads the next item of status data D2.

7. A computer device comprising a processor and a memory, characterized in that: The memory stores at least one instruction or at least one program, and when the at least one instruction or the at least one program is loaded by the processor, the method for smooth synchronization of game entity positions as described in any one of claims 1-5 is executed.