CN112221120A - Game state synchronization method and device, electronic equipment and storage medium - Google Patents

Game state synchronization method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN112221120A
CN112221120A CN202011106206.4A CN202011106206A CN112221120A CN 112221120 A CN112221120 A CN 112221120A CN 202011106206 A CN202011106206 A CN 202011106206A CN 112221120 A CN112221120 A CN 112221120A
Authority
CN
China
Prior art keywords
virtual character
current
rocker
information
joystick
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
CN202011106206.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 CN202011106206.4A priority Critical patent/CN112221120A/en
Publication of CN112221120A publication Critical patent/CN112221120A/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
    • A63F13/355Performing operations on behalf of clients with restricted processing capabilities, e.g. servers transform changing game scene into an encoded video stream for transmitting to a mobile phone or a thin client
    • 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
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/40Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterised by details of platform network
    • A63F2300/404Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterised by details of platform network characterized by a local network connection

Landscapes

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

Abstract

The application provides a game state synchronization method, a game state synchronization device, electronic equipment and a storage medium, and relates to the technical field of games. The method comprises the following steps: sending initial rocker information to a server, wherein the initial rocker information is used for indicating orientation parameters and motion states of the virtual character, and the motion states comprise: in the process, for the game client, the moving direction and animation of the virtual character in the game client can be advanced only by newly adding the orientation parameters and the relevant functions of the motion state of the virtual character, so that the operation of a player can be fed back immediately, the development workload of the game client can be reduced, and the experience of the player is improved.

Description

Game state synchronization method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of game technologies, and in particular, to a method and an apparatus for synchronizing game states, an electronic device, and a storage medium.
Background
An Action Game (Action Game) is a Game type that can be broadly classified as an Action Game, i.e., a Game in which "Action" is a main expression form of the Game, and in the Action Game, a player can control a Game character to eliminate enemies with various weapons, and can also play against other players.
For action type games, the quality of the network greatly affects the experience of the action type network games, and in the prior art, in order to enable a game character to respond to the movement operation of a player instantly to improve the game experience, a Client-Side Prediction (Client-Side Prediction) is generally added, that is, a Client performs an operation logic in advance, that is, the Client starts to execute without waiting for the response of a server.
However, in the conventional implementation mode, a state synchronization method completely following the state of the server needs to be changed into a mode of client advance, so that the problem of large development workload exists.
Disclosure of Invention
An object of the present application is to provide a game state synchronization method, device, electronic device and storage medium, which can solve the problem of large development workload of the existing game client.
In order to achieve the above purpose, the technical solutions adopted in the embodiments of the present application are as follows:
in a first aspect, an embodiment of the present application provides a game state synchronization method, which is applied to a game client, and the method includes:
sending initial rocker information to a server, wherein the initial rocker information is used for indicating orientation parameters and motion states of the virtual character, and the motion states comprise: a moving state and a stopped state;
receiving first rocker information and first position information sent by the server according to the initial rocker information;
and controlling the virtual character to move according to the first rocker information and the first position information.
Optionally, the controlling the virtual character to move according to the first joystick information and the first position information includes:
if the first rocker direction indicated by the first rocker information is determined to be an effective value, determining a target orientation parameter of the virtual character according to the first rocker direction;
and controlling the virtual character to move according to the target orientation parameter and the first position information.
Optionally, the determining a target orientation parameter of the virtual character according to the first joystick direction includes:
determining a target orientation parameter of the virtual character according to the direction of the first rocker, adjusting the orientation of the virtual character according to the target orientation parameter, and setting the motion state of the virtual character to be a moving state;
correspondingly, the controlling the virtual character to move according to the orientation parameter and the first position information comprises:
and controlling the virtual character to move according to the target orientation parameter, the moving state and the first position information.
Optionally, the method further comprises:
if the first rocker information is determined not to contain the first rocker direction, acquiring the current rocker information;
and determining the current orientation parameters and the current motion state of the virtual character according to the current rocker information.
Optionally, the determining, according to the current joystick information, a current orientation parameter and a current motion state of the virtual character includes:
acquiring the current rocker direction indicated by the current rocker information;
and determining the current orientation parameter and the current motion state of the virtual character according to the current rocker direction.
Optionally, the determining the current orientation parameter and the current motion state of the virtual character according to the current joystick direction includes:
if the current rocker direction indicated by the current rocker information is determined to be an effective value, determining the current orientation parameter of the virtual character according to the current rocker direction;
and adjusting the orientation of the virtual character according to the current orientation parameter, and setting the current motion state of the virtual character as a moving state.
Optionally, the determining the current orientation parameter and the current motion state of the virtual character according to the current joystick direction includes:
if the current rocker information does not comprise the current rocker direction, keeping the orientation parameters of the virtual character unchanged, and setting the current motion state of the virtual character as a stop state.
In a second aspect, an embodiment of the present application provides a game state synchronization apparatus, applied to a game client, where the apparatus includes: the device comprises a sending module, a receiving module and a control module;
the sending module is configured to send initial joystick information to a server, where the initial joystick information is used to indicate orientation parameters and a motion state of a virtual character, and the motion state includes: a moving state and a stopped state;
the receiving module is used for receiving first rocker information and first position information sent by the server according to the initial rocker information;
the control module is used for controlling the virtual character to move according to the first rocker information and the first position information.
Optionally, the control module is specifically configured to determine, if it is determined that the first joystick direction indicated by the first joystick information is an effective value, a target orientation parameter of the virtual character according to the first joystick direction;
and controlling the virtual character to move according to the target orientation parameter and the first position information.
Optionally, the control module is specifically configured to determine a target orientation parameter of the virtual character according to the direction of the first joystick, adjust the orientation of the virtual character according to the target orientation parameter, and set the motion state of the virtual character to a moving state; and controlling the virtual character to move according to the target orientation parameter, the moving state and the first position information.
Optionally, the apparatus further comprises: the device comprises an acquisition module and a determination module;
the acquisition module is used for acquiring the current rocker information if the first rocker information does not contain the first rocker direction;
and the determining module is used for determining the current orientation parameter and the current motion state of the virtual character according to the current rocker information.
Optionally, the determining module is specifically configured to obtain a current joystick direction indicated by the current joystick information;
and determining the current orientation parameter and the current motion state of the virtual character according to the current rocker direction.
Optionally, the determining module is specifically configured to determine, if it is determined that the current joystick direction indicated by the current joystick information is an effective value, a current orientation parameter of the virtual character according to the current joystick direction;
and adjusting the orientation of the virtual character according to the current orientation parameter, and setting the current motion state of the virtual character as a moving state.
Optionally, the determining module is specifically configured to, if it is determined that the current joystick information does not include the current joystick direction, keep the orientation parameter of the virtual character unchanged, and set the current motion state of the virtual character to a stopped state.
In a third aspect, an embodiment of the present application provides an electronic device, including: the game state synchronization method comprises a processor, a storage medium and a bus, wherein the storage medium stores machine readable instructions executable by the processor, when the electronic device runs, the processor and the storage medium communicate through the bus, and the processor executes the machine readable instructions to execute the steps of the game state synchronization method of the first aspect.
In a fourth aspect, the present application provides a storage medium, on which a computer program is stored, where the computer program is executed by a processor to perform the steps of the game state synchronization method of the first aspect.
The beneficial effect of this application is:
the game state synchronization method, device, electronic device and storage medium provided by the embodiment of the application can be applied to a game client, and comprise the step of sending initial rocker information to a server, wherein the initial rocker information is used for indicating orientation parameters and motion states of virtual characters, and the motion states comprise: in the process, for the game client, the moving direction and animation of the virtual character in the game client can be advanced only by newly adding the orientation parameters and the relevant functions of the motion state of the virtual character, so that the operation of a player can be fed back immediately, the development workload of the game client can be reduced, and the experience of the player is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
Fig. 1 is a schematic flowchart of a game state synchronization method according to an embodiment of the present disclosure;
FIG. 2 is an interaction diagram of a game state synchronization method according to an embodiment of the present disclosure;
FIG. 3 is a schematic flow chart illustrating another game state synchronization method according to an embodiment of the present disclosure;
FIG. 4 is a schematic flow chart illustrating another game state synchronization method according to an embodiment of the present disclosure;
FIG. 5 is a schematic flow chart illustrating another game state synchronization method according to an embodiment of the present disclosure;
FIG. 6 is a schematic flow chart illustrating another game state synchronization method according to an embodiment of the present disclosure;
FIG. 7 is a schematic flow chart illustrating another game state synchronization method according to an embodiment of the present disclosure;
fig. 8 is a functional block diagram of a game state synchronization apparatus according to an embodiment of the present disclosure;
FIG. 9 is a schematic diagram of functional modules of another game state synchronization apparatus according to an embodiment of the present disclosure;
fig. 10 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
The mobile synchronization mode of the online game generally comprises two modes, one mode is a lock step synchronization mode, the other mode is a state synchronization mode, and the two synchronization modes have respective advantages and disadvantages and are equally divided into autumn colors in the aspect of application range. For the state synchronization mode, generally, the server undertakes all computations, and the client is only responsible for performance, particularly, for action type network games, the requirement for immediate feedback of the operation of the game by the player is very strict, and the quality of the network greatly affects the experience of the action type network games.
In the prior art, in order to enable a game character to respond to a movement operation of a player in real time to improve game experience, a Client-Side Prediction (Client-Side Prediction) is added, that is, a Client Side performs unilateral pre-representation already at the Client Side when sending game frame data to a server and does not receive corresponding game frame data sent by the server at the moment, and after sending the game frame data of the server, the Client Side performs rollback according to the latest game frame data to re-correct a position, and enables a virtual character position to be in smooth transition to the corrected position. In this way, when the client is in advance, the client starts to execute the operation logic without waiting for the server response, so that the time for waiting for the server response is saved, and the operation feedback hand feeling of the player can be improved.
In addition, other experience problems also exist in the existing synchronization mode, for example, after the calculation of the virtual role position is changed into independent parallel operation at the server and the client, errors necessarily exist at two ends, and two common methods are respectively: the client follows the position information sent by the server and the server follows the position information predicted by the client. For the first mode, the client follows the position information sent by the server, which can cause the position of the virtual character on the client to be corrected, and the player experience is influenced; for the second way, the server follows the position information predicted by the client, which can cause the occurrence of a plug-in phenomenon and cause negative influence on the experience of other players in the online game.
In view of this, the embodiments of the present application provide a game state synchronization method, which can reduce the development workload of a game client and improve the experience of a player.
Fig. 1 is a schematic flowchart of a game state synchronization method according to an embodiment of the present disclosure, and fig. 2 is an interaction schematic diagram of a game state synchronization method according to an embodiment of the present disclosure. The method can be applied to a game client, the game client can be installed on a game client device such as a mobile terminal, a computer, a palm computer, and the like, the game client device can store a game program and be used for presenting a graphical user interface, the graphical user interface includes a game screen, and the game screen can present a virtual Character and a Non-Player Character (NPC) controlled by a Player, such as a virtual pet and a virtual sprite. As shown in fig. 1, the method may include:
s101, sending initial rocker information to a server, wherein the initial rocker information is used for indicating orientation parameters and motion states of the virtual character, and the motion states comprise: a moving state or a stopped state.
The graphical user interface can comprise a virtual joystick object, a player can control the turning, the movement and the like of a virtual character in a game by controlling the virtual joystick object, and then the initial joystick information can be generated by controlling the virtual joystick object by the player; or, the game client device may be externally connected to other input devices, such as a keyboard, a mouse, a joystick, etc., and the player may generate the initial joystick information by operating the keyboard, the mouse, the joystick, etc., which is not limited herein. In some implementations, the initial joystick information, when generated by the player manipulating the virtual joystick object, may include an offset value of the virtual joystick from a center of the joystick, which may be any angle value between-180 ° and 180 °; or, when the initial joystick information is generated by manipulating a keyboard, a mouse, a joystick, etc., the initial joystick information may include a keyboard key value, a mouse signal, an input instruction of the joystick, etc., and the application is not limited herein.
After the game client generates the initial rocker information, the game client can send the initial rocker information to the server, for the game client, the orientation parameters and the motion state of the virtual character in the game can be predicted according to the initial rocker information, the orientation and the motion state of the virtual character are set according to the orientation parameters and the motion state, the advance of the moving direction and the animation of the virtual character is realized, the operation of a player can be fed back immediately, and the influence of the network state on the game client is reduced; in addition, it can be seen that the method has the characteristic of simple realization because only judgment of orientation parameters and motion states needs to be added at the game client. It should be noted that the moving state may correspond to a basic moving action, for example, an action of walking in place, and the stopping state may correspond to an action of not moving any more, for example, an action of standing still in place, but not limited thereto.
For example, a certain game frame includes a virtual character operated by a player, the player may operate a virtual joystick object based on a touch screen of a game client to generate initial joystick information, if the virtual character is located at a first position (e.g., beside a castle, etc.) in a game scene, and the player wants to operate the virtual character to move to a second position (e.g., beside a rockery, etc.) in the game scene, the player may operate the virtual joystick to deviate from a corresponding angle value of a center of the joystick to generate the initial joystick information, and the game client may obtain an orientation parameter and a motion state of the virtual character according to the initial joystick information, so that a turning direction of the virtual character may be adjusted according to the orientation parameter, and a motion state of the virtual character may be set, thereby implementing a moving direction and an advance of an animation of the virtual.
S102, receiving first rocker information and first position information sent by the server according to the initial rocker information.
For the server, when the server receives initial rocker information sent by the game client, the server can calculate and obtain first rocker information and first position information corresponding to the initial rocker information on the server side according to the initial rocker information and a preset position algorithm. The first joystick information may include a corresponding first joystick direction, the first joystick direction may be used to indicate an orientation of the virtual character, the first position information may be a three-dimensional coordinate vector (x, y, z) used to indicate a coordinate position of the virtual character in the game scene, and the first position information may be calculated and generated according to the position information of the virtual character stored on the server side and the first joystick information, which is not limited herein.
It should be noted that the touch control corresponding to the initial rocker information and the first rocker information may be the same touch control operation, that is, the player may control the virtual rocker object based on the touch screen of the game client to generate the initial rocker information, where the initial rocker information corresponds to the initial timestamp, and the game client may send the initial rocker information to the server after generating the initial rocker information.
For the interaction between the game client and the server, see fig. 2, where a1 may be initial joystick information, the game client may send the initial joystick information a1 to the server, and at this time, the server generates B1 (first joystick information and first position information) according to the initial joystick information, sends B1 to the game client, and the game client receives the B1 and controls the virtual character to move according to the first joystick information and the first position information.
S103, controlling the virtual character to move according to the first rocker information and the first position information.
As described above, after receiving the first joystick information and the first position information sent by the server, the game client may control the virtual character to move according to the first joystick information and the first position information, it can be understood that the orientation parameter and the motion state in the moving process may be determined according to the first joystick information, and the moving position in the moving process may be determined according to the first position information, so that when receiving the first joystick information and the first position information sent by the server, the game client may perform the expression of the moving direction and the animation of the virtual character according to the message sent by the server.
Based on the above description, it can be understood that, for the game client, under the condition that the game client does not receive the first rocker information and the first position information issued by the server, the advance of the virtual character moving direction and the animation in the game client does not affect the relevant logic in the server, and under the condition that the game client receives the first rocker information and the first position information issued by the server, the game client follows the information issued by the server, so that the logic at the server side is not affected in the whole game interaction process, and the logic information affecting the balance in the game client is completely consistent with the server. Meanwhile, it can be seen that how the game client represents the logic which does not affect the server completely, so that the plug-in which affects the balance does not occur.
To sum up, the game state synchronization method provided by the embodiment of the present application may be applied to a game client, and the method includes sending initial joystick information to a server, where the initial joystick information is used to indicate an orientation parameter and a motion state of a virtual character, and the motion state includes: in the process, for the game client, the moving direction and animation of the virtual character in the game client can be advanced only by newly adding the orientation parameters and the relevant functions of the motion state of the virtual character, so that the operation of a player can be fed back immediately, the development workload of the game client can be reduced, and the experience of the player is improved.
Based on the embodiment of the application, the game state synchronization method can reduce the influence of the network state on the game client, and has the characteristic of simple realization; in addition, the embodiment of the application realizes that the logic information of the game client influencing the balance is completely consistent with the server, so that the performance of the game client cannot influence the logic of the server side, and the plug-in influencing the balance cannot occur.
Fig. 3 is a schematic flowchart of another game state synchronization method according to an embodiment of the present disclosure. Optionally, as shown in fig. 3, the controlling the virtual character to move according to the first joystick information and the first position information includes:
s201, if the first rocker direction indicated by the first rocker information is determined to be an effective value, determining a target orientation parameter of the virtual character according to the first rocker direction.
The valid value can indicate that the first rocker information contains the first rocker direction.
And S202, controlling the virtual character to move according to the target orientation parameter and the first position information.
Wherein the different first rocker information may indicate different first rocker directions, optionally, the first rocker directions may include: front, back, left, right, etc., but not limited thereto, for example, it can also be expressed by angles, such as 0 °, 90 °, 180 °, 270 °, etc. The direction of the first joystick is an effective value, which can represent that a player controls a virtual joystick object, a keyboard, a mouse, a game handle and the like, that is, the movement of the virtual character is not stopped, and correspondingly, if the direction of the first joystick is an invalid value or a null value, which can represent that the player does not control, that is, the movement of the virtual character is not started or is just finished. If the direction of the first rocker indicated by the first rocker information is determined to be an effective value, the target orientation parameter of the virtual character in the game can be determined according to the direction of the first rocker, and the virtual character is controlled to move according to the target orientation parameter and the first position information. In some embodiments, the orientation of the virtual character may be set according to the target orientation parameter, and then the virtual character may be controlled to move according to the first position information, but not limited thereto.
Optionally, as shown in fig. 4, the determining the target orientation parameter of the virtual character according to the first joystick direction includes:
s301, determining a target orientation parameter of the virtual character according to the direction of the first rocker, adjusting the orientation of the virtual character according to the target orientation parameter, and setting the motion state of the virtual character to be a moving state.
The target orientation parameter of the virtual character can indicate the orientation of the virtual character, and after the target orientation parameter of the virtual character is determined according to the direction of the first rocker, the orientation (steering) of the virtual character can be adjusted according to the target orientation parameter, and the motion state of the virtual character is set to be a moving state, so that preparation is made for controlling the next movement of the virtual character.
Of course, the orientation adjustment of the virtual character and the sequence of setting the motion state are not limited in the present application, and according to the actual application scenario, the orientation of the virtual character may be first adjusted according to the target orientation parameter, and then the motion state of the virtual character is set to the moving state, or the motion state of the virtual character may be first set to the moving state, and then the orientation of the virtual character is adjusted according to the target orientation parameter, and the adjustment may be flexible according to the actual application scenario.
Correspondingly, the controlling the virtual character to move according to the orientation parameter and the first position information includes:
and S302, controlling the virtual character to move according to the target orientation parameter, the moving state and the first position information.
Based on the acquisition of the target orientation parameter and the movement state, the virtual character can be further controlled to move according to the target orientation parameter, the movement state and the first position information. In some embodiments, the orientation of the virtual character may be adjusted according to the target orientation parameter, the orientation of the adjusted virtual character is obtained, then the motion state of the virtual character is set to be the moving state based on the orientation of the adjusted virtual character, and finally the virtual character is controlled to move to the corresponding position according to the first position information, but not limited thereto.
Fig. 5 is a schematic flowchart of another game state synchronization method according to an embodiment of the present application. Optionally, as shown in fig. 5, the method further includes:
s401, if the first rocker information does not contain the first rocker direction, current rocker information is obtained.
S402, determining the current orientation parameters and the current motion state of the virtual character according to the current rocker information.
After the game client receives the first rocker information sent by the server, if the game client determines that the first rocker information does not contain the rocker direction, and the game client indicates that a player in the game client does not control the movement of the virtual rocker object, the game client can acquire the current rocker information and determine the current orientation parameter and the current motion state of the virtual character according to the current rocker information. It should be noted that the current rocker information may be the next new rocker information generated after the initial rocker information. For example, the initial rocker information may be rocker information generated at a first time stamp of the game client, the current rocker information may be rocker information generated at a second time stamp of the game client, and the second time stamp may be greater than the first time stamp, as shown in fig. 2, and if the initial rocker information is a1, the current rocker information may be a 2.
It can be understood that, in this process, since the first joystick information received by the game client does not include the joystick direction, the current joystick information, that is, the next new joystick information, can be obtained, and according to the current joystick information, the current orientation parameter and the current motion state of the virtual character are determined, thereby implementing the advance of the virtual character moving direction and animation, that is, the virtual character orientation and motion state are predicted for the next new joystick information.
Fig. 6 is a schematic flowchart of another game state synchronization method according to an embodiment of the present application. Optionally, as shown in fig. 6, the determining the current orientation parameter and the current motion state of the virtual character according to the current joystick information includes:
s501, obtaining the current rocker direction indicated by the current rocker information.
And S502, determining the current orientation parameters and the current motion state of the virtual character according to the current rocker direction.
The current rocker information can be the same as the generation mode of the initial rocker information, namely the virtual rocker object can be controlled and generated by the player, or external input equipment such as a keyboard, a mouse and a gamepad which are externally connected with the game client equipment can be controlled and generated by the player, and the method is not repeated herein. After obtaining the current rocker information, the current rocker direction indicated by the current rocker information may be obtained, and optionally, the current rocker direction indicated by the current rocker information may include: the front, the back, the left, the right, etc., or may be a specific angle, which may be referred to the aforementioned description about the direction of the first rocker, and will not be described herein again. It can be understood that, based on the foregoing description about the direction of the first joystick, the current orientation parameter and the current motion state of the virtual character can be determined according to the current joystick direction, and details are not described herein again.
Fig. 7 is a schematic flowchart of another game state synchronization method according to an embodiment of the present application. Optionally, as shown in fig. 7, the determining the current orientation parameter and the current motion state of the virtual character according to the current direction of the joystick includes:
s601, if the current rocker direction indicated by the current rocker information is determined to be an effective value, determining the current orientation parameter of the virtual character according to the current rocker direction.
S602, adjusting the orientation of the virtual character according to the current orientation parameter, and setting the current motion state of the virtual character as a moving state.
The description that the current direction of the rocker is the effective value can refer to the related description that the direction of the first rocker is the effective value, and the description of the application is omitted.
For example, a game frame includes a virtual character manipulated by a player, in some optional embodiments, the player may manipulate a virtual joystick object based on a touch screen of a game client to control a movement of the virtual character, during a game, if the virtual character is located at a first position (e.g., beside a river, etc.) in a game scene, if the player wants to manipulate the virtual character to move to a second position (e.g., beside a rockery, etc.) in the game scene, optionally, the player may manipulate the virtual joystick to shift toward the second position based on a center of the joystick to generate current joystick information, the game client may obtain an indicated current joystick direction (e.g., may be right ahead, etc.) according to the current joystick information, determine a current orientation parameter of the virtual character according to the current joystick direction, adjust an orientation of the virtual character to a direction from the first position to the second position, and the current motion state of the virtual character is set to be a moving state, so that the game client can realize the advance of the moving direction and the animation of the virtual character under the condition that the player controls the virtual rocker object, and the game operation hand feeling of the player is improved.
Optionally, as shown in fig. 7, the determining the current orientation parameter and the current motion state of the virtual character according to the current direction of the joystick includes:
s603, if the current rocker information does not comprise the current rocker direction, keeping the orientation parameters of the virtual character unchanged, and setting the current motion state of the virtual character to be a stop state.
The current rocker information does not include the description of the current rocker direction, which can be referred to the description that the first rocker information does not include the related description of the first rocker direction, and the description of the application is not repeated. It can be understood that, if the current joystick information does not include the current joystick direction, it indicates that the player does not currently control the virtual joystick object, and for the game client, the game client may keep the orientation parameter of the virtual character unchanged, that is, the turning direction of the virtual character is not adjusted, and set the current motion state of the virtual character to be the stop state, that is, set the virtual character to be the stationary state, so that the game client may keep the same with the control of the player under the condition that the player does not control the virtual joystick object, thereby implementing an instant response.
Based on the foregoing embodiments, it can be seen that, for the game client, as the implementation logic is relatively simple, and no complex algorithm is introduced, the game state synchronization method provided in the embodiment of the present application has the characteristics of simple implementation and high execution efficiency.
Fig. 8 is a functional module schematic diagram of a game state synchronization device according to an embodiment of the present application, where the device can be applied to a game client, the basic principle and the generated technical effect of the device are the same as those of the foregoing corresponding method embodiment, and for brief description, reference may be made to corresponding contents in the method embodiment for a part not mentioned in this embodiment. As shown in fig. 8, the game state synchronization device 200 includes: a transmitting module 210, a receiving module 220, and a control module 230;
a sending module 210, configured to send initial joystick information to a server, where the initial joystick information is used to indicate an orientation parameter and a motion state of a virtual character, and the motion state includes: a moving state and a stopped state; the receiving module 220 is configured to receive first rocker information and first position information sent by the server according to the initial rocker information; and a control module 230 for controlling the virtual character to move according to the first joystick information and the first position information.
Optionally, the control module 230 is specifically configured to determine, if it is determined that the first joystick direction indicated by the first joystick information is an effective value, a target orientation parameter of the virtual character according to the first joystick direction; and controlling the virtual character to move according to the target orientation parameter and the first position information.
Optionally, the control module 230 is specifically configured to determine a target orientation parameter of the virtual character according to the first joystick direction, adjust the orientation of the virtual character according to the target orientation parameter, and set the motion state of the virtual character to be a moving state; and controlling the virtual character to move according to the target orientation parameter, the moving state and the first position information.
Fig. 9 is a schematic functional block diagram of another game state synchronization apparatus according to an embodiment of the present disclosure. Optionally, as shown in fig. 9, the game state synchronization apparatus 200 further includes: an acquisition module 250 and a determination module 260.
An obtaining module 250, configured to obtain current rocker information if it is determined that the first rocker information does not include the first rocker direction; and the determining module 260 is configured to determine the current orientation parameter and the current motion state of the virtual character according to the current joystick information.
Optionally, the determining module 260 is specifically configured to obtain a current joystick direction indicated by the current joystick information; and determining the current orientation parameter and the current motion state of the virtual character according to the current rocker direction.
Optionally, the determining module 260 is specifically configured to determine, if it is determined that the current joystick direction indicated by the current joystick information is an effective value, a current orientation parameter of the virtual character according to the current joystick direction; and adjusting the orientation of the virtual character according to the current orientation parameter, and setting the current motion state of the virtual character as a moving state.
Optionally, the determining module 260 is specifically configured to, if it is determined that the current joystick information does not include the current joystick direction, keep the orientation parameter of the virtual character unchanged, and set the current motion state of the virtual character to a stop state.
The above-mentioned apparatus is used for executing the method provided by the foregoing embodiment, and the implementation principle and technical effect are similar, which are not described herein again.
These above modules may be one or more integrated circuits configured to implement the above methods, such as: one or more Application Specific Integrated Circuits (ASICs), or one or more microprocessors (DSPs), or one or more Field Programmable Gate Arrays (FPGAs), among others. For another example, when one of the above modules is implemented in the form of a Processing element scheduler code, the Processing element may be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor capable of calling program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
Fig. 10 is a schematic structural diagram of an electronic device according to an embodiment of the present application. As shown in fig. 10, the electronic device may include: a processor 510, a storage medium 520, and a bus 530, the storage medium 520 storing machine-readable instructions executable by the processor 510, the processor 510 communicating with the storage medium 520 via the bus 530 when the electronic device is operating, the processor 510 executing the machine-readable instructions to perform the steps of the above-described method embodiments. The specific implementation and technical effects are similar, and are not described herein again.
Optionally, the present application further provides a storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the computer program performs the steps of the above method embodiments. The specific implementation and technical effects are similar, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of a unit is merely a logical division, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
The integrated unit implemented in the form of a software functional unit may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute some steps of the methods according to the embodiments of the present application. And the aforementioned storage medium includes: a U disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be 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 apparatus 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 apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The above description is only a preferred embodiment of the present application and is not intended to limit the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application. It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. The above description is only a preferred embodiment of the present application and is not intended to limit the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (10)

1. A game state synchronization method is applied to a game client, and comprises the following steps:
sending initial rocker information to a server, wherein the initial rocker information is used for indicating orientation parameters and motion states of the virtual character, and the motion states comprise: a moving state and a stopped state;
receiving first rocker information and first position information sent by the server according to the initial rocker information;
and controlling the virtual character to move according to the first rocker information and the first position information.
2. The method of claim 1, wherein the controlling the virtual character to move according to the first joystick information and the first position information comprises:
if the first rocker direction indicated by the first rocker information is determined to be an effective value, determining a target orientation parameter of the virtual character according to the first rocker direction;
and controlling the virtual character to move according to the target orientation parameter and the first position information.
3. The method of claim 2, wherein determining the target orientation parameter of the virtual character based on the first joystick direction comprises:
determining a target orientation parameter of the virtual character according to the direction of the first rocker, adjusting the orientation of the virtual character according to the target orientation parameter, and setting the motion state of the virtual character to be a moving state;
correspondingly, the controlling the virtual character to move according to the orientation parameter and the first position information comprises:
and controlling the virtual character to move according to the target orientation parameter, the moving state and the first position information.
4. The method of claim 1, further comprising:
if the first rocker information is determined not to contain the first rocker direction, acquiring the current rocker information;
and determining the current orientation parameters and the current motion state of the virtual character according to the current rocker information.
5. The method of claim 4, wherein determining the current orientation parameter and the current motion state of the virtual character based on the current joystick information comprises:
acquiring the current rocker direction indicated by the current rocker information;
and determining the current orientation parameter and the current motion state of the virtual character according to the current rocker direction.
6. The method of claim 5, wherein determining the current orientation parameter and the current motion state of the virtual character based on the current joystick direction comprises:
if the current rocker direction indicated by the current rocker information is determined to be an effective value, determining the current orientation parameter of the virtual character according to the current rocker direction;
and adjusting the orientation of the virtual character according to the current orientation parameter, and setting the current motion state of the virtual character as a moving state.
7. The method of claim 5, wherein determining the current orientation parameter and the current motion state of the virtual character based on the current joystick direction comprises:
if the current rocker information does not comprise the current rocker direction, keeping the orientation parameters of the virtual character unchanged, and setting the current motion state of the virtual character as a stop state.
8. A game state synchronization apparatus applied to a game client, the apparatus comprising: the device comprises a sending module, a receiving module and a control module;
the sending module is configured to send initial joystick information to a server, where the initial joystick information is used to indicate orientation parameters and a motion state of a virtual character, and the motion state includes: a moving state and a stopped state;
the receiving module is used for receiving first rocker information and first position information sent by the server according to the initial rocker information;
the control module is used for controlling the virtual character to move according to the first rocker information and the first position information.
9. An electronic device, comprising: a processor, a storage medium and a bus, the storage medium storing machine-readable instructions executable by the processor, the processor and the storage medium communicating via the bus when the electronic device is operating, the processor executing the machine-readable instructions to perform the steps of the game state synchronization method according to any one of claims 1 to 7.
10. A storage medium having stored thereon a computer program for performing the steps of the game state synchronization method according to any one of claims 1 to 7 when executed by a processor.
CN202011106206.4A 2020-10-15 2020-10-15 Game state synchronization method and device, electronic equipment and storage medium Pending CN112221120A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011106206.4A CN112221120A (en) 2020-10-15 2020-10-15 Game state synchronization method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011106206.4A CN112221120A (en) 2020-10-15 2020-10-15 Game state synchronization method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112221120A true CN112221120A (en) 2021-01-15

Family

ID=74118597

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011106206.4A Pending CN112221120A (en) 2020-10-15 2020-10-15 Game state synchronization method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112221120A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113457127A (en) * 2021-07-21 2021-10-01 网易(杭州)网络有限公司 Control method and device of virtual role, electronic equipment and storage medium
CN113577769A (en) * 2021-07-07 2021-11-02 广州三七极耀网络科技有限公司 Game character action control method, device, equipment and storage medium
CN113658492A (en) * 2021-08-09 2021-11-16 国网上海市电力公司 Cable line operation and inspection training method and system with relay protection equipment
CN115025495A (en) * 2022-06-02 2022-09-09 北京新唐思创教育科技有限公司 Role model synchronization method and device, electronic equipment and storage medium
WO2024051372A1 (en) * 2022-09-06 2024-03-14 腾讯科技(深圳)有限公司 Synchronous role display method and apparatus, and device, storage medium and program product

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120283008A1 (en) * 2011-05-03 2012-11-08 Ray Martone Secure, parallel, and independent script execution
CN107222510A (en) * 2017-07-21 2017-09-29 腾讯科技(深圳)有限公司 A kind of game synchronization method, system and relevant device
CN107837530A (en) * 2017-11-06 2018-03-27 网易(杭州)网络有限公司 Game synchronization method, apparatus and equipment
WO2019076309A1 (en) * 2017-10-17 2019-04-25 腾讯科技(深圳)有限公司 Animation synchronous playback method and device, storage medium and electronic device
CN109718540A (en) * 2018-12-26 2019-05-07 网易(杭州)网络有限公司 Implementation method, device, equipment and the storage medium of drift effect in game
CN109731330A (en) * 2019-01-31 2019-05-10 腾讯科技(深圳)有限公司 The display methods and device of picture, storage medium, electronic device
CN111054073A (en) * 2019-12-27 2020-04-24 珠海金山网络游戏科技有限公司 Method and device for moving double game roles
CN111659120A (en) * 2020-07-16 2020-09-15 网易(杭州)网络有限公司 Virtual role position synchronization method, device, medium and electronic equipment

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120283008A1 (en) * 2011-05-03 2012-11-08 Ray Martone Secure, parallel, and independent script execution
CN107222510A (en) * 2017-07-21 2017-09-29 腾讯科技(深圳)有限公司 A kind of game synchronization method, system and relevant device
WO2019076309A1 (en) * 2017-10-17 2019-04-25 腾讯科技(深圳)有限公司 Animation synchronous playback method and device, storage medium and electronic device
CN107837530A (en) * 2017-11-06 2018-03-27 网易(杭州)网络有限公司 Game synchronization method, apparatus and equipment
CN109718540A (en) * 2018-12-26 2019-05-07 网易(杭州)网络有限公司 Implementation method, device, equipment and the storage medium of drift effect in game
CN109731330A (en) * 2019-01-31 2019-05-10 腾讯科技(深圳)有限公司 The display methods and device of picture, storage medium, electronic device
CN111054073A (en) * 2019-12-27 2020-04-24 珠海金山网络游戏科技有限公司 Method and device for moving double game roles
CN111659120A (en) * 2020-07-16 2020-09-15 网易(杭州)网络有限公司 Virtual role position synchronization method, device, medium and electronic equipment

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113577769A (en) * 2021-07-07 2021-11-02 广州三七极耀网络科技有限公司 Game character action control method, device, equipment and storage medium
CN113577769B (en) * 2021-07-07 2024-03-08 广州三七极耀网络科技有限公司 Game character action control method, apparatus, device and storage medium
CN113457127A (en) * 2021-07-21 2021-10-01 网易(杭州)网络有限公司 Control method and device of virtual role, electronic equipment and storage medium
CN113658492A (en) * 2021-08-09 2021-11-16 国网上海市电力公司 Cable line operation and inspection training method and system with relay protection equipment
CN115025495A (en) * 2022-06-02 2022-09-09 北京新唐思创教育科技有限公司 Role model synchronization method and device, electronic equipment and storage medium
WO2024051372A1 (en) * 2022-09-06 2024-03-14 腾讯科技(深圳)有限公司 Synchronous role display method and apparatus, and device, storage medium and program product

Similar Documents

Publication Publication Date Title
CN111729306B (en) Method and device for transmitting game roles, electronic equipment and storage medium
CN112221120A (en) Game state synchronization method and device, electronic equipment and storage medium
US10828568B2 (en) Game system, etc. performing path finding of non-player character on the basis of movement history of player
EP3760287B1 (en) Method and device for generating video frames
US8678929B1 (en) Client-side prediction of a local game object to reduce apparent network lag of multiplayer simulations
CN109731330B (en) Method and device for displaying picture, storage medium and electronic device
US8805773B2 (en) Minimizing latency in network program through transfer of authority over program assets
CN112206511A (en) Game action synchronization method, game action synchronization device, electronic device and storage medium
JP2003006127A (en) Distributed processing system and method therefor, and client terminal capable of using the method
CN111494953B (en) Game role movement synchronization method, device, equipment and storage medium
US20160114243A1 (en) Image processing program, server device, image processing system, and image processing method
CN111265863B (en) Target object position correction method, device, equipment and medium
CN113457119B (en) Game control method, game control device and computer equipment
WO2022183610A1 (en) Game mode switching method and apparatus, and electronic device
US20180008888A1 (en) Method and program for providing game based on touch screen
CN113198179B (en) Steering control method and device for virtual object, storage medium and electronic equipment
CN111729312A (en) Position synchronization method, device and equipment
CN113457127A (en) Control method and device of virtual role, electronic equipment and storage medium
CN115569381A (en) Game control method, device, equipment and storage medium
US20220001282A1 (en) Information processing program, information processing method, and information processing device
CN112717403B (en) Virtual object control method and device, electronic equipment and storage medium
CN112138411A (en) Accompanying playing control method, device, equipment and storage medium based on cloud game
US11607613B2 (en) Method and apparatus for switching game mode, and electronic device
WO2024051069A1 (en) Game skill control method and apparatus, electronic device, and storage medium
CN114840285B (en) Processing method and device in game, terminal equipment and storage medium

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