CN114570017A - Game object position synchronization method and device in game and electronic equipment - Google Patents

Game object position synchronization method and device in game and electronic equipment Download PDF

Info

Publication number
CN114570017A
CN114570017A CN202210361761.4A CN202210361761A CN114570017A CN 114570017 A CN114570017 A CN 114570017A CN 202210361761 A CN202210361761 A CN 202210361761A CN 114570017 A CN114570017 A CN 114570017A
Authority
CN
China
Prior art keywords
game
displacement
game object
target
operation formula
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210361761.4A
Other languages
Chinese (zh)
Inventor
许诗豪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202210361761.4A priority Critical patent/CN114570017A/en
Publication of CN114570017A publication Critical patent/CN114570017A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/30Interconnection arrangements between game servers and game devices; Interconnection arrangements between game devices; Interconnection arrangements between game servers
    • A63F13/35Details of game servers
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/55Controlling game characters or game objects based on the game progress
    • A63F13/56Computing the motion of game characters with respect to other game characters, game objects or elements of the game scene, e.g. for simulating the behaviour of a group of virtual soldiers or for path finding
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/55Controlling game characters or game objects based on the game progress
    • A63F13/57Simulating properties, behaviour or motion of objects in the game world, e.g. computing tyre load in a car race game
    • A63F13/573Simulating properties, behaviour or motion of objects in the game world, e.g. computing tyre load in a car race game using trajectories of game objects, e.g. of a golf ball according to the point of impact
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/55Controlling game characters or game objects based on the game progress
    • A63F13/57Simulating properties, behaviour or motion of objects in the game world, e.g. computing tyre load in a car race game
    • A63F13/577Simulating properties, behaviour or motion of objects in the game world, e.g. computing tyre load in a car race game using determination of contact between game characters or objects, e.g. to avoid collision between virtual racing cars

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The embodiment of the invention provides a method, a device, electronic equipment and a storage medium for synchronizing positions of game objects in a game, wherein the method comprises the following steps: receiving a displacement instruction of a game object in a game, which is sent by terminal equipment; the displacement instruction comprises initial motion state data of the game object in the game, and the initial motion state data comprises a displacement motion type of the game object; obtaining a displacement operation formula corresponding to the displacement motion type; the displacement operation formula is used for indicating that the game object performs displacement motion according to a certain motion rule in the game; filling the initial motion state data into a displacement operation formula to obtain a target displacement operation formula; and synchronizing the target displacement operation formula to the target terminal equipment so that the target terminal equipment predicts the position of the game object in the game based on the target displacement operation formula. The embodiment of the invention does not need the terminal equipment and the server to realize synchronous data transmission for many times, thereby reducing the performance pressure of the equipment.

Description

Game object position synchronization method and device in game and electronic equipment
Technical Field
The embodiment of the invention relates to the technical field of internet, in particular to a method for synchronizing positions of game objects in games, a device for synchronizing positions of game objects in games, electronic equipment and a storage medium.
Background
At present, with the rapid development of network technologies, network games gradually enter people's lives, more and more people play games through terminal devices (such as smart phones, computers and the like), and people enjoy leisure time through game playing, so that the lives are more colorful.
In short, a game can be understood as a 3D (three-dimensional) animation of a controllable computer, which is composed of one frame of picture. The displacement of the game object in the game needs to be kept within a relatively stable moving range if a smooth animation is observed from the player, and a common stuttering situation occurs if the moving range of the game object in a certain frame is small or even not moving.
In a game, synchronization is a very important concept, specifically, a player sees contents at his terminal device, and sees contents at other player's terminal devices are consistent, specifically, achieving synchronization requires the terminal device to transmit the position of a game object in the game to other terminal devices, and the other terminal devices perform calculation and display based on the received position. However, since the realization of synchronization in a game requires the transmission of a large amount of data at the terminal device, the performance pressure of the terminal device is large.
Disclosure of Invention
The embodiment of the invention provides a method for synchronizing positions of game objects in a game, which aims to solve the problems that in the prior art, synchronization is realized in the game, a large amount of data needs to be transmitted in terminal equipment, and the performance pressure of the terminal equipment is high.
Correspondingly, the embodiment of the invention also provides a game object position synchronizing device in the game, which is used for ensuring the realization and the application of the method.
In order to solve the above problem, an embodiment of the present invention discloses a method for synchronizing positions of game objects in a game, where the method includes:
receiving a displacement instruction of a game object in a game, which is sent by terminal equipment; the displacement instruction comprises initial motion state data of the game object in the game, and the initial motion state data comprises a displacement motion type of the game object;
obtaining a displacement operation formula corresponding to the displacement motion type; the displacement operation formula is used for indicating the game object to perform displacement motion according to a certain motion rule in the game;
filling the initial motion state data into the displacement operation formula to obtain a target displacement operation formula;
and synchronizing the target displacement operation formula to target terminal equipment so that the target terminal equipment predicts the position of the game object in the game based on the target displacement operation formula.
Optionally, after the synchronizing the target displacement operation formula to the target terminal device so that the target terminal device predicts the position of the game object in the game based on the target displacement operation formula, the method further includes:
calculating the predicted position of the game object in the game by adopting the target displacement operation formula;
and if the game object is determined to collide with other game objects in the game based on the predicted position, sending a prediction stopping instruction to the target terminal device so that the target terminal device stops predicting the position of the game object in the game based on the target displacement operation formula.
Optionally, after the synchronizing the target displacement operation formula to the target terminal device so that the target terminal device predicts the position of the game object in the game based on the target displacement operation formula, the method further includes:
and if the predicted position meets the corresponding end condition in the target displacement operation formula, sending a prediction stopping instruction to the target terminal equipment so as to enable the target terminal equipment to stop predicting the position of the game object in the game based on the target displacement operation formula.
Optionally, the calculating the predicted position of the game object in the game by using the target displacement operation formula includes:
acquiring the generation time of the target displacement operation formula, and determining the elapsed time after the generation time;
and filling the elapsed time into the target displacement operation formula, and calculating the predicted position of the game object in the game.
Optionally, after receiving the instruction of the displacement of the game object in the game sent by the terminal device, the method further includes:
acquiring the continuous movement time of the game object; the continuous movement time is generated based on the current network delay time;
calculating a predicted position of the game object in the game by using the initial motion state data and the continuous motion time;
synchronizing the predicted location to the target terminal device.
Optionally, the initial motion state data includes an initial position, a displacement speed, a displacement direction, and a displacement state of the game object.
Optionally, the calculating a predicted position of the game object in the game by using the initial motion state data and the continuous motion time includes:
and when the displacement state is a continuous movement state, calculating the predicted position of the game object in the game by adopting the initial position, the displacement speed, the displacement direction and the continuous movement time.
Optionally, the method further comprises:
if the next displacement instruction of the game object in the game sent by the terminal equipment is not received within the appointed time, after the continuous movement time, the calculation of the predicted position of the game object in the game by adopting the initial movement state data and the continuous movement time is stopped.
The embodiment of the invention also discloses a game object position synchronizing device in the game, which comprises:
the receiving module is used for receiving a displacement instruction of a game object in the game, which is sent by the terminal equipment; the displacement instruction comprises initial motion state data of the game object in the game, and the initial motion state data comprises a displacement motion type of the game object;
the acquisition module is used for acquiring a displacement operation formula corresponding to the displacement motion type; the displacement operation formula is used for indicating the game object to perform displacement motion according to a certain motion rule in the game;
the obtaining module is used for filling the initial motion state data into the displacement operation formula to obtain a target displacement operation formula;
and the synchronization module is used for synchronizing the target displacement operation formula to the target terminal equipment so that the target terminal equipment predicts the position of the game object in the game based on the target displacement operation formula.
Optionally, the apparatus further comprises: the prediction stopping module is used for calculating the predicted position of the game object in the game by adopting the target displacement operation formula; and if the game object is determined to collide with other game objects in the game based on the predicted position, sending a prediction stopping instruction to the target terminal device so that the target terminal device stops predicting the position of the game object in the game based on the target displacement operation formula.
Optionally, the apparatus further comprises: and the stop prediction module is used for sending a stop prediction instruction to the target terminal equipment if the predicted position meets a corresponding end condition in the target displacement operation formula, so that the target terminal equipment stops predicting the position of the game object in the game based on the target displacement operation formula.
Optionally, the stop prediction module is configured to obtain a generation time of the target displacement operation formula, and determine an elapsed time after the generation time; and filling the elapsed time into the target displacement operation formula, and calculating the predicted position of the game object in the game.
Optionally, the apparatus further comprises: the position prediction module is used for acquiring the continuous movement time of the game object; the continuous movement time is generated based on the current network delay time; calculating a predicted position of the game object in the game by using the initial motion state data and the continuous motion time; synchronizing the predicted location to the target terminal device.
Optionally, the initial motion state data includes an initial position, a displacement speed, a displacement direction, and a displacement state of the game object.
Optionally, the position prediction module is configured to, when the displacement state is a continuous movement state, calculate a predicted position of the game object in the game by using the initial position, the displacement speed, the displacement direction, and the continuous movement time.
Optionally, the apparatus further comprises: and the prediction stopping module is used for stopping calculating the predicted position of the game object in the game by adopting the initial motion state data and the continuous motion time after the continuous motion time if the next displacement instruction of the game object in the game, which is sent by the terminal equipment, is not received in the appointed time.
The embodiment of the invention discloses electronic equipment, which comprises a processor, a memory and a computer program which is stored on the memory and can run on the processor, wherein when the computer program is executed by the processor, the steps of the in-game object position synchronization method in the game are realized.
The embodiment of the invention discloses a computer readable storage medium, wherein a computer program is stored on the computer readable storage medium, and when the computer program is executed by a processor, the steps of the method for synchronizing the positions of the game objects in the game are realized.
The embodiment of the invention also discloses a computer program product, which is stored in a storage medium and is executed by at least one processor to realize the method according to the embodiment of the invention.
The embodiment of the invention has the following advantages:
in the embodiment of the invention, a displacement instruction of a game object in a game sent by a terminal device is received, a corresponding displacement operation formula is obtained based on the displacement motion type in the displacement instruction, initial motion state data in the displacement instruction is filled in the displacement operation formula to obtain a target displacement operation formula, and then the target displacement operation formula is synchronized to a target terminal device, so that the target terminal device predicts the position of the game object based on the target displacement operation formula. In the embodiment of the invention, if the displacement motion type of the game object has the corresponding displacement operation formula, which indicates that the game object performs displacement motion according to a certain motion rule in the game, the target displacement operation formula is synchronized to the target terminal device, and then the target terminal device can perform position prediction on the game object based on the target displacement operation formula, so that the position synchronization can be realized only by transmitting a small amount of data, and the terminal device and the server are not required to transmit position data for multiple times in order to realize the position synchronization, thereby reducing the performance pressure of the device.
Drawings
FIG. 1 is a flow chart of the steps of an embodiment of a method for synchronizing the position of game objects in a game according to the present invention;
FIG. 2 is a schematic diagram of an application environment for in-game object location synchronization according to the present invention;
FIG. 3 is a timing diagram of another process for implementing game object synchronization in a game in accordance with the present invention;
FIG. 4 is a block diagram of an embodiment of an apparatus for synchronizing positions of objects in a game according to the present invention;
fig. 5 is a block diagram of an electronic device provided in an embodiment of the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
At present, the scheme for realizing game object synchronization in the game has state synchronization and frame synchronization:
and (3) state synchronization:
the terminal equipment of the player can continuously upload the current position of the game object controlled by the player in the game and broadcast the current position to the terminal equipment of other players, and then the terminal equipment of other players receives the current position and smoothly transits the game object from the current position to the next position in the game according to a set interpolation algorithm, thereby achieving the synchronization of the positions.
Frame synchronization:
the terminal device of the player sends the game instruction corresponding to the game object to the server, the server receives and gathers the game instruction and then forwards the game instruction to all the terminal devices logged in the same game, and the terminal devices perform calculation and display the position corresponding to the game object according to the received game instruction.
However, the two above solutions have the following common disadvantages: 1. more data is needed for synchronization, and the accuracy and smoothness of synchronization is positively correlated with the frequency of data synchronization. 2. The requirement on the network state is high, and once network fluctuation occurs in the synchronization process, the synchronized party is easy to jam.
In addition, since the frame synchronization is performed in the local terminal device based on the game command, more data are required for correction in order to maintain the data consistency; due to the limitation of the frame rate of the server, even if the terminal device keeps a higher frame rate to upload the position of the game object (for example, 25 frames per second), when the server broadcasts data, it is generally impossible to broadcast data at the same frame rate as the terminal device (for example, 10 frames per second), which may cause a certain data loss and cause a certain error in synchronization of other terminal devices.
Of course, in practice, it is still necessary to use two schemes, state synchronization and frame synchronization, to solve the problem of position synchronization of game objects in the game in many cases, but these two schemes are obviously not suitable if all synchronization schemes are applied.
In the embodiment of the invention, considering that the motion of the game object is regular in the game, and once the motion of the displacement motion type of the game object is generated, the game object can predict the position according to a displacement operation formula for a long time, for example, parabolic motion of a throwing object in the game, linear motion without gravity or ground motion, and the like, and the regular motions still use frame synchronization and state synchronization to solve the synchronization problem, but require the terminal device to synchronize a large amount of data to other terminal devices. Therefore, in the embodiment of the invention, aiming at the game object with a certain regular motion, a smoother and consistent synchronization effect can be realized by using less data volume and lower synchronization frequency.
The method for synchronizing the positions of the game objects in the game in one embodiment of the invention can be operated on a local terminal device or a server. When the in-game object position synchronization method runs on the server, the in-game object position synchronization method can be implemented and executed based on a cloud interaction system, wherein the cloud interaction system comprises the server and the client device.
In an optional embodiment, various cloud applications may be run under the cloud interaction system, for example: and (5) cloud games. Taking a cloud game as an example, a cloud game refers to a game mode based on cloud computing. In the cloud game operation mode, the operation main body of the game program and the game picture presentation main body are separated, the storage and the operation of the game object position synchronization method in the game are completed on the cloud game server, and the client device is used for receiving and sending data and presenting the game picture, for example, the client device can be a display device with a data transmission function close to the user side, such as a first terminal device, a television, a computer, a palmtop computer and the like; but the cloud game server of the cloud is used for carrying out the game object position synchronization method in the game. When a game is played, a player operates the client device to send an operation instruction to the cloud game server, the cloud game server runs the game according to the operation instruction, data such as game pictures and the like are coded and compressed, the data are returned to the client device through a network, and finally, the data are decoded through the client device and the game pictures are output.
In an optional implementation manner, taking a game as an example, the local terminal device stores a game program and is used for presenting a game screen. The local terminal device is used for interacting with the player through a graphical user interface, namely, a game program is downloaded and installed and operated through an electronic device conventionally. The manner in which the local terminal device provides the graphical user interface to the player may include a variety of ways, for example, it may be rendered for display on a display screen of the terminal or provided to the player through holographic projection. By way of example, the local terminal device may include a display screen for presenting a graphical user interface including game screens and a processor for running the game, generating the graphical user interface, and controlling display of the graphical user interface on the display screen.
Referring to fig. 1, a flowchart illustrating steps of an embodiment of a method for synchronizing positions of game objects in a game according to the present invention is shown, where the embodiment of the present invention may specifically include the following steps:
step 101, receiving a displacement instruction of a game object in a game, which is sent by terminal equipment; the displacement instruction comprises initial motion state data of the game object in the game, and the initial motion state data comprises a displacement motion type of the game object.
In this embodiment of the present invention, the application executed on the processor of the terminal device may be an application that needs to be downloaded and installed, or may also be an application that is ready to use, which is not limited in this embodiment of the present invention. The terminal device can be an electronic device such as a smart phone, a tablet computer, a game host, an electronic book reader, a multimedia playing device, a wearable device, and a robot.
The application running on the terminal device may be a game application and renders a graphical user interface on a touch-sensitive display of the terminal device, the content displayed by the graphical user interface at least partially comprising a partial or complete game scene. In addition, the game scene may include at least one game object, where the game object may be a game virtual Character manipulated by a player through a mobile terminal, a Non-player Character (NPC) preset by a game developer in a specific game scene, a virtual article (e.g., a stone, a bomb, a rope, a medicine), and the like.
The displacement motion type may include a parabolic motion, an acceleration motion, a linear uniform motion, and the like.
In a specific implementation, the game object can be manipulated by a player through a terminal device to perform displacement motion in a game scene, for example, the player drops the game object from a standstill in the air to perform displacement motion (the type of displacement motion is acceleration), lets the game object perform displacement motion on a smooth ground (the type of displacement motion is straight line and uniform speed), throws the game object from the air to the ground to perform displacement motion (the type of displacement motion is parabola), and the like. Correspondingly, the terminal equipment correspondingly extracts data such as the initial position, the speed, the acceleration, the displacement motion type and the like of the game object from the data, the data serve as the initial motion state data of the game object, a displacement instruction is generated based on the initial motion state data and submitted to the server, and the server forwards the displacement instruction to other terminal equipment.
102, acquiring a displacement operation formula corresponding to the displacement motion type; the displacement operation formula is used for indicating the game object to perform displacement motion according to a certain motion rule in the game.
And 103, filling the initial motion state data into the displacement operation formula to obtain a target displacement operation formula.
If the displacement motion of the game object has a certain motion rule, the displacement motion can be expressed by using a displacement operation formula (mathematical formula). For example, the acceleration motion can be expressed by using an acceleration formula, the parabolic motion can be expressed by using a parabolic formula, and the straight-line uniform motion can be expressed by using a speed formula.
In the embodiment of the present invention, if the displacement motion type has a corresponding displacement operation formula, the initial motion state data submitted by the terminal device may be filled in the displacement operation formula after the displacement operation formula corresponding to the displacement motion type is obtained, so as to obtain the target displacement operation formula.
Of course, if the type of the displacement motion does not have a corresponding displacement operation formula, it indicates that the displacement motion of the game object does not have a certain motion law, and frame synchronization or state synchronization may be selected to implement position synchronization of the game object in the game.
And step 104, synchronizing the target displacement operation formula to target terminal equipment so that the target terminal equipment predicts the position of the game object in the game based on the target displacement operation formula.
Wherein the target terminal device comprises other terminal devices entering the same game as the terminal device. Of course, the terminal device itself may also be included, and the embodiment of the present invention is not limited to this.
Illustratively, referring to fig. 2, which is a schematic diagram of an application environment for position synchronization of a game object in a game according to the present invention, a terminal device 201 may submit a displacement instruction containing initial motion state data to a server 202, the server 202 may determine a displacement operation formula based on a displacement motion type in the initial motion state data, and after a target displacement operation formula is obtained by filling the initial motion state data, the target displacement operation formula may be synchronized to the terminal device 201 and a target terminal device 203, so that the target terminal device 203 may predict a position of the game object based on the target displacement operation formula.
It can be understood that, if the displacement motion of the game object can be expressed by using a displacement operation formula, the target displacement operation formula is obtained based on the displacement operation formula corresponding to the initial motion state data submitted by the terminal device, which indicates that the game object can move according to the target displacement operation formula within a certain time or under a certain condition, and therefore, if all the terminal devices predict the position of the game object by themselves based on the target displacement operation formula, the predicted position is accurate, and the pressure of the terminal devices is reduced because the terminal devices do not need to synchronize the position to other terminal devices.
It should be noted that, if the displacement motion type of the game object does not have the corresponding displacement operation formula, the position synchronization of the game object may be implemented by using other schemes, for example, the position synchronization of the game object may be implemented by using frame synchronization or state synchronization, which is not limited in this embodiment of the present invention.
In the method for synchronizing the position of the game object in the game, a displacement instruction of the game object in the game sent by the terminal equipment is received, a corresponding displacement operation formula is obtained based on the displacement motion type in the displacement instruction, initial motion state data in the displacement instruction is filled in the displacement operation formula to obtain a target displacement operation formula, and then the target displacement operation formula is synchronized to the target terminal equipment so that the target terminal equipment can predict the position of the game object based on the target displacement operation formula. In the embodiment of the invention, if the displacement motion type of the game object has the corresponding displacement operation formula, which indicates that the game object performs displacement motion according to a certain motion rule in the game, the target displacement operation formula is synchronized to the target terminal device, and then the target terminal device can perform position prediction on the game object based on the target displacement operation formula, so that the position synchronization can be realized only by transmitting a small amount of data, and the terminal device and the server are not required to transmit position data for multiple times in order to realize the position synchronization, thereby reducing the performance pressure of the device.
On the basis of the above-described embodiment, a modified embodiment of the above-described embodiment is proposed, and it is to be noted herein that, in order to make the description brief, only the differences from the above-described embodiment are described in the modified embodiment.
In an exemplary embodiment, after the step 104, synchronizing the target displacement operation formula to a target terminal device so that the target terminal device predicts the position of the game object in the game based on the target displacement operation formula, the method may further include the following steps:
calculating the predicted position of the game object in the game by adopting the target displacement operation formula;
and if the game object is determined to collide with other game objects in the game based on the predicted position, sending a prediction stopping instruction to the target terminal device so that the target terminal device stops predicting the position of the game object in the game based on the target displacement operation formula.
In the embodiment of the invention, the displacement motion of the game object is initiated by a client (client) in the terminal equipment, and a server (server) is informed to prepare for starting the displacement motion, at the moment, the server can prepare a target displacement operation formula generated based on initial motion state data and synchronize all the terminal equipment, after the terminal equipment receives the target displacement operation formula, the position of the game object can be predicted to simulate the displacement motion of the game object in the client, and meanwhile, the server can start predicting the position of the game object based on the target displacement operation formula to simulate the displacement motion of the game object in the client.
In practice, during the course of the displacement movement of the game object in the game, there may be a case where the displacement movement is interrupted. For example, if the game object is a bomb, the bomb may collide with other objects in the game scene during the parabolic motion, for example, when the bomb collides with an obstacle such as a ground or a wall, the bomb will explode, and the parabolic motion needs to be ended.
Therefore, in the embodiment of the present invention, a target displacement operation formula is used to calculate the predicted position of the game object in the game, and whether a collision will occur with another object in the game scene is determined based on the predicted position, for example, if the predicted position overlaps with the position of another game object in the game, or a connection line between the predicted position and a previous position intersects with another game object, it may be determined that the game object collides with another game object in the game, and it indicates that the current motion needs to be ended, a stop prediction instruction is sent to the target terminal device, and the target terminal device stops predicting the position of the game object based on the target displacement operation formula after receiving the stop prediction instruction.
In the above exemplary embodiment, when the target displacement operation formula is used to calculate the predicted position of the game object in the game, if it is determined that the game object collides with another game object in the game based on the predicted position, which indicates that the game object will not continue to move according to the target displacement operation formula, the target terminal device may send the prediction stopping instruction, so as to stop continuing predicting the position of the game object in the game based on the target displacement operation formula, thereby avoiding the server and the target terminal device from performing wrong position prediction.
In an exemplary embodiment, after the step 104, synchronizing the target displacement operation formula to a target terminal device so that the target terminal device predicts the position of the game object in the game based on the target displacement operation formula, the method may further include the following steps:
and if the predicted position meets the corresponding end condition in the target displacement operation formula, sending a prediction stopping instruction to the target terminal equipment so as to enable the target terminal equipment to stop predicting the position of the game object in the game based on the target displacement operation formula.
In practice, in addition to the fact that the prediction of the game object needs to be finished when the displacement motion is interrupted (for example, the game object collides with another game object in the game) in the process of the motion of the game object in the game scene, the prediction of the game object can also be finished when the predicted position meets the corresponding end condition in the target displacement operation formula.
Specifically, in order to provide a more real game experience for a player in a game, when a game object in the game moves in a game scene, the game object needs to conform to a motion rule in the real world, for example, when the game object moves in a parabolic manner in the game scene, if a movement trajectory is a complete parabolic path, the game object will not continue to move in the parabolic manner, and for example, when the movement time of the game object moving at an accelerated speed in the game scene reaches a certain movement time, the game object will not continue to move in the accelerated speed.
In the above exemplary embodiment, a target displacement operation formula is used to calculate a predicted position of a game object in a game, whether the predicted position meets a corresponding end condition in the target displacement operation formula or not is detected, if the predicted position meets the corresponding end condition in the target displacement operation formula, which indicates that the motion of this time needs to be ended, a prediction stopping instruction is sent to the target terminal device, and after receiving the prediction stopping instruction, the target terminal device stops predicting the position of the game object based on the target displacement operation formula, thereby avoiding the server and the target terminal device from performing wrong position prediction.
In an exemplary embodiment, the calculating the predicted position of the game object in the game by using the target displacement operation formula may include:
acquiring the generation time of the target displacement operation formula, and determining the elapsed time after the generation time;
and filling the elapsed time into the target displacement operation formula, and calculating the predicted position of the game object in the game.
The target displacement operation formula can be expressed as: p ═ f (t).
Where t represents the elapsed time, F represents the displacement mode, p represents the predicted position where the movement is displaced in the mode of F after the time t has elapsed.
As a specific example, the target displacement operation formula of the uniform acceleration linear motion may be:
p=F(t)=p0+vt+0.5at*t
where p0 represents the initial position of the game object and acceleration represents a, that is, p represents the position where the game object starts from p0, moves with a displacement motion at a velocity v and an acceleration a, and reaches after the lapse of time t. For example, it is assumed that the server or the target terminal device receives a displacement instruction of the game object at a time point T0, and then, if the displacement of the game object reaches a time point TN, T is TN-T0.
In the embodiment of the present invention, when the terminal device or the server calculates the predicted position based on the target displacement operation formula, the position of the next frame may also be calculated based on the time of each frame (for example, assuming that 25 frames per second, the time of each frame is 1/25 seconds). For example, assuming that the game object in the previous frame has moved to p12, if the time of each frame is t ', the predicted position of the next frame is p13 ═ p12+ t × + v +0.5a ×) t'.
Of course, the predicted position calculation method calculated based on the time per frame has a relatively large error compared to the predicted position calculation method calculated based on the elapsed time, and therefore, if used for a synchronous and high-speed displacement motion, the calculation method of the predicted position from the start of the displacement motion to the current elapsed time t of the game object can be selected, and the most accurate predicted position can be calculated.
The embodiment of the invention reduces the data volume required to be transmitted during position synchronization, and in the related technology, position data is synchronized once per frame, and a section of displacement can be uploaded hundreds of times. It can be understood that, since the other terminal devices can perform position prediction by themselves, so as to simulate the displacement motion of the game object in the game on the other terminal devices, there is no need to wait for the position data of the next frame synchronization, and since there is no need to wait for the terminal device synchronization position, the representation of the displacement motion of the game object on the other terminal devices will be smoother.
In order to make it better understood by those skilled in the art, a specific example is used for the following description. Referring to fig. 3, a timing chart of a process of integrally implementing game object synchronization in a game according to an embodiment of the present invention is shown, where the timing chart includes a terminal device (client), a server (server), and other terminal devices (others), and the specific process may include:
1. starting to move; when a game object in a game of the terminal equipment starts to move, sending a displacement instruction to the server;
2. simulating a track; the server simulates the track of the game object in the terminal equipment based on the initial motion state data of the game object in the displacement instruction;
3. transmitting displacement data; the server sends the displacement data (namely the target displacement operation formula) to the terminal equipment and other terminal equipment;
4. synchronizing; in a terminal device, a server, and other terminal devices, position prediction is performed based on a target displacement operation formula to simulate a trajectory at a game object.
5. Dynamic collision occurs, and displacement is interrupted; when the motion of the game object is interrupted or normally finished due to the detection of the collision, the server can send a prediction stopping instruction to the terminal equipment and other terminal equipment;
6. finishing the displacement; the terminal device, the server, and the other terminal device end the position prediction of the game object based on the stop prediction instruction.
By applying the embodiment of the invention, for the game object which can express the displacement motion by using the mathematical formula, the target displacement operation formula generated based on the initial motion state data of the game object submitted by the terminal equipment and the displacement operation formula can be broadcasted to all the terminal equipment at one time, so that the terminal equipment can simulate the displacement motion of the game object in the game based on the target displacement operation formula.
In an exemplary embodiment, after receiving the instruction of the displacement of the game object in the game sent by the terminal device in step 101, the method may further include the following steps:
acquiring the continuous movement time of the game object; the continuous movement time is generated based on the current network delay time;
calculating a predicted position of the game object in the game by using the initial motion state data and the continuous motion time;
synchronizing the predicted location to the target terminal device.
Wherein the continuation movement time indicates a time during which the game object is moved in a displacement manner in the game until the next displacement instruction is not received.
In the embodiment of the present invention, the predicted position of the game object in the game is calculated based on the continuous motion time and the initial motion state data, and then the game object is synchronized to other terminal devices, so that the displacement motion of the game object in the game in other terminal devices is always smooth even if the network environment is not good.
In an exemplary embodiment, the initial motion state data may include an initial position, a displacement speed, a displacement direction, and a displacement state of the game object. For example, the initial motion state data included in the displacement command of a certain frame received by the server includes: 1. the initial position p which needs to be reached by the frame of game object; 2. a displacement velocity v; 3. displacement direction drc; 4. displacement state of the game object moveState.
Specifically, the movement distance may be calculated according to the displacement velocity v, the displacement direction drc and the continuous movement time, the movement distance may be added to the initial position p to obtain the predicted position, and then the predicted position may be synchronized to the target terminal device, so as to achieve position synchronization of the game object in the game.
In the implementation process, in consideration of the situation that the network environment has network jitter, that is, the delay time is high or low, for example, the delay time of this frame delay may be 100ms (milliseconds), and the delay time of the next frame may be 250ms, in the embodiment of the present invention, the value of the continuous motion time may be dynamically adjusted and generated with reference to the delay time of the current network environment, so that there is an actually observable optimization for the network jitter within the range of 100ms to 250 ms.
Of course, if a displacement instruction of the next frame is received when the predicted position is calculated based on the continuation movement time, a displacement movement may be performed based on the displacement instruction of the next frame at the predicted position, so that the displacement movement of the game object in the game is smooth. For example, if the predicted position a is calculated based on the displacement command of the previous frame, the game object will move to the predicted position a, and if the displacement command of the next frame is received, the game object will move from the predicted position a to the position B in the displacement command of the next frame.
In the above exemplary embodiment, the position synchronization of the game object may be achieved even if the network environment is not good, by calculating the predicted position of the game object in the game and then synchronizing to the target terminal device in conjunction with the initial motion state data of the previous frame according to the continuous motion time generated based on the current network delay.
In an exemplary embodiment, the calculating the predicted position of the game object in the game using the initial motion state data and the continued motion time may include the steps of:
and when the displacement state is a continuous movement state, calculating the predicted position of the game object in the game by adopting the initial position, the displacement speed, the displacement direction and the continuous movement time.
Wherein, the displacement state (moveState) is used for representing whether the game object continues to perform displacement motion in the game.
In the embodiment of the invention, if the displacement state in the initial motion state data received in the previous frame is the continuous motion state, and when the displacement instruction of the next frame is not received, the game object can be determined to still be in the displacement motion, the displacement speed, the displacement direction and the continuous motion time in the displacement instruction of the previous frame can be used for calculating the moving distance, the moving distance and the initial position in the initial motion state data are added to obtain the predicted position, and then the predicted position is synchronized to other terminal equipment, so that the position synchronization of the game object is realized.
Of course, if the displacement state in the displacement instruction received in the previous frame is not the continuous motion state, which indicates that the game object has stopped performing displacement motion in the game, the position prediction of the game object does not need to be performed by using the initial motion state data of the previous frame.
In the above-described exemplary embodiment, determining whether or not to perform position prediction of the game object based on the displacement state can avoid performing position prediction in a case where the game object has no longer displaced motion, reducing unnecessary consumption of calculation performance.
In an exemplary embodiment, the method may further include the steps of:
and if the next displacement instruction of the game object in the game, which is sent by the terminal equipment, is not received within the appointed time, after the continuous movement time, the calculation of the predicted position of the game object in the game by adopting the initial movement state data and the continuous movement time is stopped.
Wherein the specified time may be a continuation movement time.
In the embodiment of the invention, if a displacement instruction of the next frame of the game object is received in the position prediction process, the game object can be controlled to perform displacement motion on the predicted position based on the displacement instruction; if the displacement instruction of the next frame of the game object is still not received after the specified time, which indicates that the network environment is poor, the player may not normally play the game, and the meaning of the predicted position is not large, the position prediction of the game object is stopped after the specified time, for example, after the movement time is continued.
In the above-described exemplary embodiment, if the displacement instruction of the next frame is not received at the specified time, the position prediction of the game object can be stopped, so to speak, the consumption of unnecessary calculation performance is reduced.
It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the illustrated order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments of the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
Referring to fig. 4, a block diagram of a game object position synchronization apparatus in a game according to an embodiment of the present invention is shown, where the game object position synchronization apparatus in the game according to the embodiment of the present invention may specifically include the following modules:
a receiving module 401, configured to receive a displacement instruction of a game object in a game, sent by a terminal device; the displacement instruction comprises initial motion state data of the game object in the game, and the initial motion state data comprises a displacement motion type of the game object;
an obtaining module 402, configured to obtain a displacement operation formula corresponding to the displacement motion type; the displacement operation formula is used for indicating the game object to perform displacement motion according to a certain motion rule in the game;
an obtaining module 403, configured to fill the initial motion state data into the displacement operation formula to obtain a target displacement operation formula;
a synchronization module 404, configured to synchronize the target displacement operation formula to a target terminal device, so that the target terminal device predicts a position of the game object in the game based on the target displacement operation formula.
In an exemplary embodiment, the apparatus may further include: the prediction stopping module is used for calculating the predicted position of the game object in the game by adopting the target displacement operation formula; and if the game object is determined to collide with other game objects in the game based on the predicted position, sending a prediction stopping instruction to the target terminal device so that the target terminal device stops predicting the position of the game object in the game based on the target displacement operation formula.
In an exemplary embodiment, the apparatus may further include: and the stop prediction module is used for sending a stop prediction instruction to the target terminal equipment if the predicted position meets a corresponding end condition in the target displacement operation formula, so that the target terminal equipment stops predicting the position of the game object in the game based on the target displacement operation formula.
In an exemplary embodiment, the stop prediction module is configured to obtain a generation time of the target displacement operation formula, and determine an elapsed time after the generation time; and filling the elapsed time into the target displacement operation formula, and calculating the predicted position of the game object in the game.
In an exemplary embodiment, the apparatus may further include: the position prediction module is used for acquiring the continuous movement time of the game object; the continuous movement time is generated based on the current network delay time; calculating a predicted position of the game object in the game by using the initial motion state data and the continuous motion time; synchronizing the predicted location to the target terminal device.
In an exemplary embodiment, the initial motion state data may include an initial position, a displacement speed, a displacement direction, and a displacement state of the game object.
In an exemplary embodiment, the position prediction module is configured to calculate the predicted position of the game object in the game by using the initial position, the displacement speed, the displacement direction and the continuous movement time when the displacement state is the continuous movement state.
In an exemplary embodiment, the apparatus may further include: and the prediction stopping module is used for stopping calculating the predicted position of the game object in the game by adopting the initial motion state data and the continuous motion time after the continuous motion time if the next displacement instruction of the game object in the game, which is sent by the terminal equipment, is not received in the appointed time.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
In addition, an embodiment of the present invention further provides an electronic device, which may include electronic devices such as a terminal device and a server (cluster), as shown in fig. 5, and includes a processor 501, a communication interface 502, a memory 503 and a communication bus 504, where the processor 501, the communication interface 502, and the memory 503 complete mutual communication through the communication bus 504,
a memory 503 for storing a computer program;
the processor 501, when executing the program stored in the memory 503, implements the following steps, for example:
receiving a displacement instruction of a game object in a game, which is sent by terminal equipment; the displacement instruction comprises initial motion state data of the game object in the game, and the initial motion state data comprises a displacement motion type of the game object;
obtaining a displacement operation formula corresponding to the displacement motion type; the displacement operation formula is used for indicating the game object to perform displacement motion according to a certain motion rule in the game;
filling the initial motion state data into the displacement operation formula to obtain a target displacement operation formula;
and synchronizing the target displacement operation formula to a target terminal device so that the target terminal device predicts the position of the game object in the game based on the target displacement operation formula.
Optionally, after the synchronizing the target displacement operation formula to the target terminal device so that the target terminal device predicts the position of the game object in the game based on the target displacement operation formula, the method further includes:
calculating the predicted position of the game object in the game by adopting the target displacement operation formula;
and if the game object is determined to collide with other game objects in the game based on the predicted position, sending a prediction stopping instruction to the target terminal device so that the target terminal device stops predicting the position of the game object in the game based on the target displacement operation formula.
Optionally, after the synchronizing the target displacement operation formula to the target terminal device so that the target terminal device predicts the position of the game object in the game based on the target displacement operation formula, the method further includes:
and if the predicted position meets the corresponding end condition in the target displacement operation formula, sending a prediction stopping instruction to the target terminal equipment so as to enable the target terminal equipment to stop predicting the position of the game object in the game based on the target displacement operation formula.
Optionally, the calculating the predicted position of the game object in the game by using the target displacement operation formula includes:
acquiring the generation time of the target displacement operation formula, and determining the elapsed time after the generation time;
and filling the elapsed time into the target displacement operation formula, and calculating the predicted position of the game object in the game.
Optionally, after receiving the instruction of the displacement of the game object in the game sent by the terminal device, the method further includes:
acquiring the continuous movement time of the game object; the continuous movement time is generated based on the current network delay time;
calculating a predicted position of the game object in the game by using the initial motion state data and the continuous motion time;
synchronizing the predicted location to the target terminal device.
Optionally, the initial motion state data includes an initial position, a displacement speed, a displacement direction, and a displacement state of the game object.
Optionally, the calculating a predicted position of the game object in the game by using the initial motion state data and the continuous motion time includes:
and when the displacement state is a continuous movement state, calculating the predicted position of the game object in the game by adopting the initial position, the displacement speed, the displacement direction and the continuous movement time.
Optionally, the method further comprises:
and if the next displacement instruction of the game object in the game, which is sent by the terminal equipment, is not received within the appointed time, after the continuous movement time, the calculation of the predicted position of the game object in the game by adopting the initial movement state data and the continuous movement time is stopped.
Through the mode, if the displacement motion type of the game object has the corresponding displacement operation formula, the game object is shown to perform displacement motion according to a certain motion rule in the game, the target displacement operation formula is synchronized to the target terminal device, the target terminal device can perform position prediction on the game object on the basis of the target displacement operation formula, position synchronization can be achieved only by transmitting a small amount of data, the terminal device and the server are not required to transmit position data for multiple times in order to achieve position synchronization, and the performance pressure of the device is reduced.
The communication bus mentioned in the above terminal may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the terminal and other equipment.
The Memory may include a Random Access Memory (RAM) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component.
The embodiment of the invention discloses a computer readable storage medium, wherein a computer program is stored on the computer readable storage medium, and when the computer program is executed by a processor, the steps of the embodiment of the method for synchronizing the positions of game objects in a game are realized, for example:
receiving a displacement instruction of a game object in a game, which is sent by terminal equipment; the displacement instruction comprises initial motion state data of the game object in the game, and the initial motion state data comprises a displacement motion type of the game object;
obtaining a displacement operation formula corresponding to the displacement motion type; the displacement operation formula is used for indicating the game object to perform displacement motion according to a certain motion rule in the game;
filling the initial motion state data into the displacement operation formula to obtain a target displacement operation formula;
and synchronizing the target displacement operation formula to target terminal equipment so that the target terminal equipment predicts the position of the game object in the game based on the target displacement operation formula.
Optionally, after the synchronizing the target displacement operation formula to the target terminal device so that the target terminal device predicts the position of the game object in the game based on the target displacement operation formula, the method further includes:
calculating the predicted position of the game object in the game by adopting the target displacement operation formula;
and if the game object is determined to collide with other game objects in the game based on the predicted position, sending a prediction stopping instruction to the target terminal device so that the target terminal device stops predicting the position of the game object in the game based on the target displacement operation formula.
Optionally, after the synchronizing the target displacement operation formula to the target terminal device so that the target terminal device predicts the position of the game object in the game based on the target displacement operation formula, the method further includes:
and if the predicted position meets the corresponding end condition in the target displacement operation formula, sending a prediction stopping instruction to the target terminal equipment so as to enable the target terminal equipment to stop predicting the position of the game object in the game based on the target displacement operation formula.
Optionally, the calculating the predicted position of the game object in the game by using the target displacement operation formula includes:
acquiring the generation time of the target displacement operation formula, and determining the elapsed time after the generation time;
and filling the elapsed time into the target displacement operation formula, and calculating the predicted position of the game object in the game.
Optionally, after receiving the instruction of the displacement of the game object in the game sent by the terminal device, the method further includes:
acquiring the continuous movement time of the game object; the continuous movement time is generated based on the current network delay time;
calculating a predicted position of the game object in the game by using the initial motion state data and the continuous motion time;
synchronizing the predicted location to the target terminal device.
Optionally, the initial motion state data includes an initial position, a displacement speed, a displacement direction, and a displacement state of the game object.
Optionally, the calculating a predicted position of the game object in the game by using the initial motion state data and the continuous motion time includes:
and when the displacement state is a continuous movement state, calculating the predicted position of the game object in the game by adopting the initial position, the displacement speed, the displacement direction and the continuous movement time.
Optionally, the method further comprises:
and if the next displacement instruction of the game object in the game, which is sent by the terminal equipment, is not received within the appointed time, after the continuous movement time, the calculation of the predicted position of the game object in the game by adopting the initial movement state data and the continuous movement time is stopped.
Through the mode, if the displacement motion type of the game object has the corresponding displacement operation formula, the game object is shown to perform displacement motion according to a certain motion rule in the game, the target displacement operation formula is synchronized to the target terminal device, the target terminal device can perform position prediction on the game object on the basis of the target displacement operation formula, position synchronization can be achieved only by transmitting a small amount of data, the terminal device and the server are not required to transmit position data for multiple times in order to achieve position synchronization, and the performance pressure of the device is reduced.
Embodiments of the present invention provide a computer program product, which is stored in a storage medium and executed by at least one processor to implement the processes of the method for synchronizing positions of game objects in a game as described above, and achieve the same technical effects, and therefore, the description of the process is omitted here to avoid repetition.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including the preferred embodiment and all changes and modifications that fall within the true scope of the embodiments of the present invention.
Finally, it should also be noted that, in this document, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or terminal that comprises the element.
The method for synchronizing the position of the game object in the game, the device for synchronizing the position of the game object in the game, the electronic device and the storage medium provided by the invention are described in detail, specific examples are applied in the description to explain the principle and the implementation of the invention, and the description of the above embodiments is only used for helping to understand the method and the core idea of the invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (11)

1. An in-game object position synchronization method, the method comprising:
receiving a displacement instruction of a game object in a game, which is sent by terminal equipment; the displacement instruction comprises initial motion state data of the game object in the game, and the initial motion state data comprises a displacement motion type of the game object;
obtaining a displacement operation formula corresponding to the displacement motion type; the displacement operation formula is used for indicating the game object to perform displacement motion according to a certain motion rule in the game;
filling the initial motion state data into the displacement operation formula to obtain a target displacement operation formula;
and synchronizing the target displacement operation formula to target terminal equipment so that the target terminal equipment predicts the position of the game object in the game based on the target displacement operation formula.
2. The method of claim 1, wherein after synchronizing the target displacement operational formula to a target terminal device to cause the target terminal device to predict a position of the game object in the game based on the target displacement operational formula, the method further comprises:
calculating the predicted position of the game object in the game by adopting the target displacement operation formula;
and if the game object is determined to collide with other game objects in the game based on the predicted position, sending a prediction stopping instruction to the target terminal device so that the target terminal device stops predicting the position of the game object in the game based on the target displacement operation formula.
3. The method of claim 2, wherein after synchronizing the target displacement operational formula to a target terminal device to cause the target terminal device to predict the position of the game object in the game based on the target displacement operational formula, the method further comprises:
and if the predicted position meets the corresponding end condition in the target displacement operation formula, sending a prediction stopping instruction to the target terminal equipment so as to enable the target terminal equipment to stop predicting the position of the game object in the game based on the target displacement operation formula.
4. The method of claim 2, wherein said calculating a predicted position of said game object in said game using said target displacement operational formula comprises:
acquiring the generation time of the target displacement operation formula, and determining the elapsed time after the generation time;
and filling the elapsed time into the target displacement operation formula, and calculating the predicted position of the game object in the game.
5. The method according to claim 1, wherein after receiving the instruction of the displacement of the game object in the game sent by the terminal device, the method further comprises:
acquiring the continuous movement time of the game object; the continuous movement time is generated based on the current network delay time;
calculating a predicted position of the game object in the game by using the initial motion state data and the continuous motion time;
synchronizing the predicted location to the target terminal device.
6. The method of claim 5, wherein the initial motion state data comprises an initial position, a displacement speed, a displacement direction, and a displacement state of the game object.
7. The method of claim 6, wherein said calculating a predicted position of said game object in said game using said initial motion state data and said continued motion time comprises:
and when the displacement state is a continuous movement state, calculating the predicted position of the game object in the game by adopting the initial position, the displacement speed, the displacement direction and the continuous movement time.
8. The method of claim 6, further comprising:
and if the next displacement instruction of the game object in the game, which is sent by the terminal equipment, is not received within the appointed time, after the continuous movement time, the calculation of the predicted position of the game object in the game by adopting the initial movement state data and the continuous movement time is stopped.
9. An in-game object position synchronization apparatus, comprising:
the receiving module is used for receiving a displacement instruction of a game object in the game, which is sent by the terminal equipment; the displacement instruction comprises initial motion state data of the game object in the game, and the initial motion state data comprises a displacement motion type of the game object;
the acquisition module is used for acquiring a displacement operation formula corresponding to the displacement motion type; the displacement operation formula is used for indicating the game object to perform displacement motion according to a certain motion rule in the game;
the obtaining module is used for filling the initial motion state data into the displacement operation formula to obtain a target displacement operation formula;
and the synchronization module is used for synchronizing the target displacement operation formula to target terminal equipment so as to enable the target terminal equipment to predict the position of the game object in the game based on the target displacement operation formula.
10. An electronic device comprising a processor, a memory and a computer program stored on the memory and executable on the processor, the computer program, when executed by the processor, implementing the steps of the in-game gaming object position synchronization method according to any of claims 1 to 8.
11. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the in-game object position synchronization method according to any one of claims 1 to 8.
CN202210361761.4A 2022-04-07 2022-04-07 Game object position synchronization method and device in game and electronic equipment Pending CN114570017A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210361761.4A CN114570017A (en) 2022-04-07 2022-04-07 Game object position synchronization method and device in game and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210361761.4A CN114570017A (en) 2022-04-07 2022-04-07 Game object position synchronization method and device in game and electronic equipment

Publications (1)

Publication Number Publication Date
CN114570017A true CN114570017A (en) 2022-06-03

Family

ID=81785524

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210361761.4A Pending CN114570017A (en) 2022-04-07 2022-04-07 Game object position synchronization method and device in game and electronic equipment

Country Status (1)

Country Link
CN (1) CN114570017A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115228084A (en) * 2022-09-23 2022-10-25 深圳乐娱游网络科技有限公司 Game picture synchronization method and related equipment
CN116688493A (en) * 2023-07-31 2023-09-05 厦门真有趣信息科技有限公司 Interactive control method for football game

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115228084A (en) * 2022-09-23 2022-10-25 深圳乐娱游网络科技有限公司 Game picture synchronization method and related equipment
CN116688493A (en) * 2023-07-31 2023-09-05 厦门真有趣信息科技有限公司 Interactive control method for football game
CN116688493B (en) * 2023-07-31 2023-10-24 厦门真有趣信息科技有限公司 Interactive control method for football game

Similar Documents

Publication Publication Date Title
EP3760287A1 (en) Method and device for generating video frames
US10771565B2 (en) Sending application input commands over a network
CN114570017A (en) Game object position synchronization method and device in game and electronic equipment
CN109847361B (en) Method and device for synchronizing motion states, storage medium and electronic device
JP7436644B2 (en) Encoder tuning to improve the trade-off between latency and video quality in cloud gaming applications
EP3691280B1 (en) Video transmission method, server, vr playback terminal and computer-readable storage medium
US11539960B2 (en) Game application providing scene change hint for encoding at a cloud gaming server
CN111659120B (en) Virtual role position synchronization method, device, medium and electronic equipment
CN109568948B (en) Method and device for synchronizing motion states of objects in online game
US10987579B1 (en) 2.5D graphics rendering system
CN111167116A (en) Smooth display method, terminal and computer storage medium
CN110935172B (en) Virtual object processing method, device, system and storage medium thereof
CN111494953B (en) Game role movement synchronization method, device, equipment and storage medium
JP2024509065A (en) Virtual object control method, device, equipment, system and computer program
CN113490006A (en) Live broadcast interaction method and equipment based on bullet screen
CN113827974A (en) AI role control method and device in game
US20170019693A1 (en) Method of providing broadcasting service and playing broadcast by using object state transmitting method
CN111790155B (en) Network game state synchronization method, device, terminal and storage medium
JP7244450B2 (en) Computer program, server device, terminal device, and method
JP6897284B2 (en) Game equipment, programs and game systems
JP6533022B1 (en) Terminal, server and program
CN114669046A (en) Control method and control device
CN111065053B (en) System and method for video streaming
JP2020140684A (en) Terminal, server and program
US20240062456A1 (en) Variable update adaptation and simulation delay in multiuser virtual reality application

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination