WO2018028566A1 - 虚拟对象的移动同步方法、客户端、服务器及存储介质 - Google Patents

虚拟对象的移动同步方法、客户端、服务器及存储介质 Download PDF

Info

Publication number
WO2018028566A1
WO2018028566A1 PCT/CN2017/096436 CN2017096436W WO2018028566A1 WO 2018028566 A1 WO2018028566 A1 WO 2018028566A1 CN 2017096436 W CN2017096436 W CN 2017096436W WO 2018028566 A1 WO2018028566 A1 WO 2018028566A1
Authority
WO
WIPO (PCT)
Prior art keywords
virtual object
update
speed
time
location
Prior art date
Application number
PCT/CN2017/096436
Other languages
English (en)
French (fr)
Inventor
吴一帆
刘磊
何超
Original Assignee
腾讯科技(深圳)有限公司
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 腾讯科技(深圳)有限公司 filed Critical 腾讯科技(深圳)有限公司
Priority to EP17838696.7A priority Critical patent/EP3499844B1/en
Publication of WO2018028566A1 publication Critical patent/WO2018028566A1/zh
Priority to US16/206,717 priority patent/US11235234B2/en

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/358Adapting the game course according to the network or server load, e.g. for reducing latency due to different connection speeds between clients
    • 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/40Processing input control signals of video game devices, e.g. signals generated by the player or derived from the environment
    • A63F13/42Processing input control signals of video game devices, e.g. signals generated by the player or derived from the environment by mapping the input signals into game commands, e.g. mapping the displacement of a stylus on a touch screen to the steering angle of a virtual vehicle
    • 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/45Controlling the progress of the video 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
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/50Controlling the output signals based on the game progress
    • A63F13/52Controlling the output signals based on the game progress involving aspects of the displayed game scene
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/20Analysis of motion
    • G06T7/246Analysis of motion using feature-based methods, e.g. the tracking of corners or segments
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/131Protocols for games, networked simulations or virtual reality
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/52Network services specially adapted for the location of the user terminal
    • 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/60Methods for processing data by generating or executing the game program
    • A63F2300/64Methods for processing data by generating or executing the game program for computing dynamical parameters of game objects, e.g. motion determination or computation of frictional forces for a virtual car

Definitions

  • the present application relates to the field of data processing technologies, and in particular, to a mobile object synchronization method, a client, a server, and a storage medium.
  • the mobile synchronization of the virtual object refers to the moving state of the virtual object controlled by the client, and needs to be consistent with the mobile state of the virtual object controlled by the server, that is, the client updates the mobile state of the virtual object, and needs to be paired with the server.
  • the virtual object's mobile status update remains consistent.
  • Virtual objects are generally used in virtual scenes such as games and simulations. Take the game scene as an example, a virtual object such as a game character controlled by a game user, a logical object (such as a monster) in the game.
  • the game client and the game server need to synchronously control the game object to run forward, so that the game client and the game server pair The movement control of the same game object is consistent.
  • the mobile object synchronization is the basis for keeping the client and server consistently processing the same virtual object's mobile data, and maintaining the stable operation of virtual scenes such as games and simulations.
  • the embodiment of the present application provides a mobile object synchronization method, a client, and a server. And storage media.
  • a mobile object synchronization method is performed by a client, and the method includes:
  • the preset speed update time is greater than the preset location update time, and the system first accumulation time is recalculated after the client performs a speed update on the virtual object, and the second cumulative time of the system is in the client.
  • the end of the virtual object is recalculated after each location update.
  • the embodiment of the present application further provides a mobile synchronization method for a virtual object, which is executed by a server, and the method includes:
  • the speed and location of the virtual object are updated; wherein the system accumulation time is recalculated after the server performs the speed and location update for each virtual object.
  • the embodiment of the present application further provides a client, including:
  • a first detecting module configured to detect a first accumulated time of the system after the last speed update from the virtual object, and a second accumulated time of the system after the last position update of the virtual object;
  • a first update module configured to update a speed of the virtual object when the first accumulation time of the system reaches a preset speed update time; and when the second accumulation time of the system reaches a preset location update time, Updating the location of the virtual object;
  • the preset speed update time is greater than the preset location update time, and the first accumulation time of the system is recalculated after the client performs a speed update on the virtual object.
  • the second accumulation time of the system is recalculated after the client performs a location update for each virtual object.
  • the embodiment of the present application further provides a server, including:
  • a second detecting module configured to detect a system accumulated time after the last speed and position update from the virtual object
  • a second update module configured to update a speed and a location of the virtual object every time the system cumulative time is detected to reach a preset update time; wherein, the system accumulation time is performed by the server for each time of the virtual object and Recalculate after the location is updated.
  • the embodiment of the present application further provides a non-volatile storage medium, including processor-executable instructions, when the instructions are executed by the processor, causing the computer to perform the following operations:
  • the preset speed update time is greater than the preset location update time, and the first accumulation time of the system is recalculated after the client performs a speed update on the virtual object, and the system is second.
  • the accumulation time is recalculated after the client updates the location of the virtual object once.
  • the embodiment of the present application updates the speed and location of the virtual object by using different frequencies, that is, the speed of the virtual object is updated at the low frequency of the client and the server, and the location of the virtual object is updated by the server at the same low frequency.
  • the location of the virtual object is updated at the high frequency of the client, so that the update of the speed and location of the virtual object conforms to the actual virtual scene running requirement, and a highly accurate mobile synchronization effect is obtained, and the server performs the low frequency.
  • Speed updates and location updates greatly reduce server performance overhead. Visible, The embodiment of the present application can reduce the performance overhead of the server on the basis of ensuring high accuracy of the mobile synchronization effect.
  • FIG. 1 is a structural block diagram of a mobile object synchronization system according to an embodiment of the present application.
  • FIG. 2 is a signaling flowchart of a method for moving a virtual object according to an embodiment of the present disclosure
  • FIG. 3 is another signaling flowchart of a mobile object synchronization method according to an embodiment of the present disclosure
  • FIG. 4 is a flowchart of a method for moving a virtual object according to an embodiment of the present application
  • FIG. 5 is another flowchart of a method for moving a virtual object according to an embodiment of the present disclosure
  • FIG. 6 is still another flowchart of a method for moving a virtual object according to an embodiment of the present disclosure
  • FIG. 7 is still another flowchart of a method for moving a virtual object according to an embodiment of the present disclosure.
  • FIG. 8 is still another flowchart of a method for moving a virtual object according to an embodiment of the present disclosure.
  • FIG. 9 is still another flowchart of a method for moving a virtual object according to an embodiment of the present application.
  • FIG. 10 is still another flowchart of a method for moving a virtual object according to an embodiment of the present application.
  • FIG. 11 is a schematic diagram of a mobile update time axis of a client and a server according to an embodiment of the present disclosure
  • FIG. 12 is a schematic diagram of components of a game client and a game server according to an embodiment of the present application.
  • FIG. 14 is a schematic diagram of interaction between a scene editor, a game client, and a game server according to an embodiment of the present application;
  • 15 is a schematic diagram of physical collision data of a static object in a 3D scene according to an embodiment of the present application.
  • 16 is a schematic diagram of physical collision data of a dynamic object in a 3D scene according to an embodiment of the present application
  • FIG. 17 is a schematic diagram of terrain walking layer data in a 3D scene according to an embodiment of the present application.
  • FIG. 18 is a schematic diagram of a Character Controller-based mobility model according to an embodiment of the present application.
  • FIG. 19 is a schematic diagram of an infantry movement model provided by an embodiment of the present application.
  • 20 is a schematic diagram of a cavalry movement model provided by an embodiment of the present application.
  • FIG. 21 is a schematic diagram of a linear velocity simulated angular velocity according to an embodiment of the present application.
  • 22 is a schematic diagram of a variable circular motion provided by an embodiment of the present application.
  • FIG. 23 is another schematic diagram of a mobile update timeline of a client and a server according to an embodiment of the present disclosure.
  • 24 is a schematic diagram of a game effect provided by an embodiment of the present application.
  • FIG. 25 is a structural block diagram of a client provided by an embodiment of the present application.
  • FIG. 26 is a block diagram showing the hardware structure of a terminal device according to an embodiment of the present application.
  • FIG. 27 is a structural block diagram of a server according to an embodiment of the present application.
  • FIG. 1 is a structural block diagram of a mobile object synchronization system according to an embodiment of the present disclosure.
  • the virtual object mobile synchronization system includes a client 10 and a server 20.
  • the client 10 may be a game client
  • the server 20 may be a game server.
  • the client 10 may be an emulation client
  • the server 20 may be an emulation server.
  • the client 10 may be a client that is provided on the terminal device and provides a local service for a virtual scene such as a network game.
  • the server 20 may be a server on the network side that provides network services for virtual scenes such as network games.
  • the server can be a single server implementation or a server group consisting of multiple servers.
  • the mobile synchronization of the virtual object is divided into speed synchronization of the virtual object and location synchronization of the virtual object.
  • the client needs to update the speed and location of the virtual object separately.
  • the server needs to update the speed and location of the virtual object separately, and the speed of the virtual object updated by the client is consistent with the speed of the virtual object updated by the server.
  • Sex the location of the virtual object updated by the client needs to be consistent with the location of the virtual object updated by the server.
  • the frequency at which the client updates the speed of the virtual object can be based on the frequency at which the server updates the speed of the virtual object, and the frequency of the virtual object is updated by using the low frequency.
  • the embodiment of the present application can perform the speed update of the virtual object at a low frequency, and the client's performance overhead is considered.
  • the virtual object speed update frequency can be based on the server's virtual object speed update frequency. Such as the virtual object speed agreed by the client and the server is more What is the new frequency, the client uses the agreed frequency to update the speed of the virtual object.
  • the client can update the location of the virtual object at a high frequency.
  • the server can update the location of the virtual object at the same low frequency as the speed update frequency.
  • the embodiment of the present application divides the mobile synchronization of the virtual object into the speed synchronization of the virtual object and the location synchronization of the virtual object, allowing the client and the server to use different update frequencies to perform speed update and location update of the virtual object;
  • the setting is subject to the low frequency update, and the client updates the position with high frequency, and the server updates the position with the same low frequency.
  • the embodiment of the present application uses different frequencies for updating, so that the update of the speed and location of the virtual object conforms to the actual virtual scene running requirement, and the mobile with higher accuracy can be obtained. Synchronization effect, and the server performs speed update and location update at low frequency, which greatly reduces the performance overhead of the server.
  • FIG. 2 is a signaling flowchart of the mobile synchronization method of the virtual object provided by the embodiment of the present application. Referring to FIG. 2, the flow may include the following steps S10-S14.
  • Step S10 The client establishes a communication connection with the server.
  • the client can launch a network game, a simulation application, etc. to load a virtual scene and establish a communication connection with the server.
  • Step S11 The client detects the first accumulated time of the system after the last speed update of the virtual object, and the second accumulated time of the system after the last position update of the virtual object.
  • the virtual object may be a game character controlled by the client, or may be other game characters, logical objects, and the like in the game scene currently displayed by the client.
  • the virtual object may be a simulation object controlled by the client (such as a moving object, an animal, or the like).
  • the last speed update of the virtual object in the client is the latest speed update of the virtual object.
  • the most recent speed update of the virtual object may be the speed update performed at the low frequency by using the flow shown in FIG. 2; the latest speed of the virtual object
  • the update may also be a speed update made by the client's server-based mobile update sync package.
  • the last location update of the virtual object is the last location update of the virtual object.
  • the last location update of the virtual object may be the location update performed by the high frequency frequency using the process shown in FIG. 2; the last location update of the virtual object is also It may be the location update performed by the client based on the user's mobile control operation or the server's mobile update synchronization package.
  • the first accumulation time of the system may be recalculated after the client performs a speed update on the virtual object, and the second accumulation time of the system may be recalculated after the client updates the virtual object once.
  • the recalculation can be a clear recalculation, or it can be reset to a preset time value, and the time cumulative value is recalculated from the preset time value.
  • Step S12 The client updates the speed of the virtual object when the first accumulation time of the system reaches the preset speed update time; and when the second accumulation time of the system reaches the preset location update time, the server The location of the virtual object is updated.
  • the preset speed update time may be a frequency time corresponding to the set low frequency frequency
  • the preset position update time may be a frequency time corresponding to the set high frequency frequency.
  • the preset speed update time and the preset location update time may be set according to the performance of the terminal device where the client is located and the user's demand for the virtual scene, as long as the preset speed update time is greater than the preset location update time. That is, the client can perform speed update of the virtual object at a relatively large time interval, and update the location of the virtual object at a relatively small time interval.
  • the client can update the virtual object every time the first accumulated time of the system reaches the preset speed update time, and achieve the purpose of updating the virtual object speed at a low frequency, and the client can reach the preset position update every second accumulated time of the system.
  • the virtual object is updated in position to achieve the purpose of updating the virtual object position at a high frequency.
  • the client may detect the first accumulation time of the system and the second accumulation time of the system in real time or periodically, and perform a speed update when the detected first accumulated time reaches the preset speed update time. Performing a location update every time the second accumulated time of the system is detected reaches the preset location update time; and recalculating the first accumulation time of the system after each speed update is performed, and recalculating the system after each location update is performed Second cumulative time.
  • the client may detect the first accumulation time of the system and the second accumulation time of the system for each logical computing time (tick, where tick is the kernel timing unit of the operating system and one tick indicates a logical calculation time).
  • Step S13 The server detects the last speed from the virtual object and the system accumulation time after the location update.
  • the server updates the speed and position of the virtual object at the same low frequency, so the server can update the speed and position of the virtual object at the same time.
  • the embodiment of the present application can uniformly detect the last speed from the virtual object and the system accumulation time after the location update.
  • the last speed and location update of the virtual object in the server can be the last speed and location update of the virtual object.
  • the most recent speed and location update of the virtual object may be the speed and location update performed at the low frequency using the process shown in Figure 2; it may also be the speed and location update of the server based on the user's mobile control operation, or the server is based on The speed and position update of the virtual object's movement state in the virtual scene itself.
  • the movement state itself jumps, such as when the virtual object hits the obstacle in the movement, the speed suddenly drops to zero, or suddenly falls from a high altitude.
  • the system accumulation time may be recalculated after the server performs the speed and location update for each virtual object, such as clearing the recalculation, or resetting to the preset time value, and recalculating from the preset time value. Time accumulated value, etc.
  • Step S14 When the server detects that the system accumulation time reaches the preset update time, The speed and location of the virtual object are updated.
  • the preset update time can be the same as the preset speed update time set by the client, so that the client and the server can update the speed at the same low frequency, and the server performs location update at the same low frequency, reducing the performance overhead of the server. And keep the virtual object speed update between the client and the server synchronized; and the client uses the high frequency frequency for location update to ensure the smooth processing of the client.
  • the server may detect the system accumulation time in real time or periodically, and perform a speed and location update every time the detected system accumulation time reaches the preset update time, and each time the speed and location update is performed. After that, recalculate the system accumulation time.
  • the server can detect the system accumulation time per tick.
  • steps S11-S12 and steps S13-S14 there may be no obvious sequence between steps S11-S12 and steps S13-S14.
  • the client and the server may perform the speed and location update of the virtual object according to steps S11-S12 and S13-S14, respectively.
  • the embodiment of the present application updates the speed and location of the virtual object by using different frequencies, that is, the speed of the virtual object is updated at the low frequency of the client and the server, and the location of the virtual object is updated by the server at the same low frequency.
  • the location of the virtual object is updated at the high frequency of the client, so that the update of the speed and position of the virtual object conforms to the actual running requirement of the virtual scene, and the mobile synchronization effect with higher accuracy is obtained, and the server has the low frequency frequency.
  • Speed updates and location updates greatly reduce the performance overhead of the server. It can be seen that the embodiment of the present application can reduce the performance overhead of the server on the basis of ensuring high accuracy of the mobile synchronization effect.
  • the location update of the virtual object by the client may also be triggered based on the user's mobile control operation, or the speed update of the virtual object may be triggered based on the mobile update synchronization packet sent by the server.
  • the client detects the user's mobile control operation and determines the user's mobile control. After the operation control parameter of the virtual object indicated by the operation is performed, the location update may be performed at the current speed of the virtual object based on the movement control parameter, and the corresponding user's mobile control operation request is sent to the server.
  • the server may implement the location update and the speed update of the virtual object based on the mobile control parameter indicated by the user's mobile control operation request, and after the server updates the location and speed of the virtual object, the mobile update synchronization packet may be generated and sent to the client; the client The terminal can implement the speed update of the virtual object based on the mobile update synchronization package.
  • FIG. 3 shows another signaling flowchart of the mobile synchronization method of the virtual object provided by the embodiment of the present application.
  • the flow may include the following steps S20-S25.
  • Step S20 The client detects a movement control operation of the user, and determines a movement control parameter of the virtual object indicated by the movement control operation of the user.
  • the movement control parameters may include: position control parameters of the virtual object, orientation control parameters, speed control parameters, and the like.
  • Step S21 The client performs location update at the current speed of the virtual object according to the movement control parameter.
  • Step S22 The client sends a mobile control operation request carrying the mobile control parameter to the server.
  • Step S21 and step S22 can be performed simultaneously.
  • Step S23 The server updates the position and speed of the virtual object according to the movement control parameter.
  • Step S24 After the server updates the location and speed of the virtual object, the mobile update synchronization packet is generated, and the mobile update synchronization packet is sent to the client.
  • the mobile update synchronization package may include: synchronization data of the updated speed, location, orientation, time stamp of the server update, and the like of the virtual object.
  • Step S25 The client updates the virtual object according to the mobile update synchronization packet.
  • the client can update the speed using information such as the updated speed, location, orientation, time stamp of the server update, etc. of the virtual object indicated in the mobile update synchronization package.
  • the client performs a speed update of the virtual object every time the first accumulated time of the system reaches the preset speed update time, and can also receive the mobile update synchronization packet sent by the server. At the same time, the speed of the virtual object is updated on the fly.
  • the client performs a location update of the virtual object every time the second accumulated time of the system reaches the preset location update time, and may also be based on the user's movement when the user's mobile control operation is detected. Control the movement control parameters indicated by the operation, and actively update the position of the virtual object.
  • the client can actively update the speed of the virtual object when receiving the mobile update synchronization package, and the client does not need to update the synchronization package based on the mobile when the virtual object is actively updated.
  • the client and the server may have the same set of virtual object location update logic or algorithms, and the client and server may update the logic or algorithm based on the same virtual object location, and independently virtualize according to the mobile control parameters. The location of the object is updated; however, the client updates the speed of the virtual object and waits for the server to receive the mobile update synchronization packet before proceeding.
  • the server performs a mobile object control request and receives a user's mobile control operation request in addition to the speed and location update of the virtual object when the system accumulation time reaches the preset update time. Request the carried mobile control parameters to instantly and actively update the position and speed of the virtual object.
  • the first accumulation time of the system can be recalculated, and the client can recalculate after each time the location of the virtual object is updated by the method shown in FIG.
  • the second cumulative time of the system The server is passing through Figure 3.
  • the method shown can recalculate the system accumulation time after each time the virtual object's speed and position are updated.
  • the client may not perform location update on the virtual object directly based on the detected user's mobile control operation, but may wait for the mobile update synchronization packet sent by the server to receive the location and speed of the virtual object. Update.
  • the case where the server generates the mobile update synchronization packet is not limited to the case where the user's mobile control operation request is received, and may also be that when the virtual object detects the movement state in the virtual scene such as the game, the self-jump occurs.
  • the location and speed of the virtual object are updated, and a mobile update synchronization package is generated and sent to the client; at this time, the client can update the speed of the virtual object based on the mobile update synchronization package, or the speed and location are simultaneously updated.
  • FIG. 4 is a flowchart of a method for moving a virtual object according to an embodiment of the present application.
  • the method may be performed by a client, such as a game client.
  • the method may include the following steps S100-S110.
  • Step S100 detecting a first accumulated time of the system after the last speed update from the virtual object, and a second accumulated time of the system after updating from the last position of the virtual object.
  • Step S110 When the first accumulation time of the system reaches the preset speed update time, update the speed of the virtual object; and when the second accumulation time of the system reaches the preset location update time, the virtual The location of the object is updated.
  • the preset speed update time is greater than the preset location update time, and the first accumulation time of the system may be recalculated after the client performs a speed update on the virtual object, and the second cumulative time of the system may be performed on the virtual object by the client. Recalculate after a location update.
  • the client can speed update the virtual object with respect to the low frequency, and update the virtual object with a relatively high frequency.
  • FIG. 5 shows another flow of the mobile synchronization method of the virtual object provided by the embodiment of the present application. Figure, this method can be performed by the client. Referring to FIG. 5, the method may include the following steps S200-S250.
  • Step S200 a tick begins.
  • Step S210 detecting a first accumulation time of the system after the last speed update from the virtual object, and a second accumulation time of the system after updating from the last position of the virtual object.
  • Step S220 determining whether the first accumulation time of the system reaches the preset speed update time, if yes, executing step S230, and if no, returning to step S200.
  • Step S230 updating the speed of the virtual object, and recalculating the first accumulation time of the system, and returning to step S200.
  • Step S240 Determine whether the second accumulation time of the system reaches the preset position update time, and if yes, execute step S250, and if no, return to step S200.
  • Step S250 updating the location of the virtual object, and recalculating the second accumulation time of the system, and returning to step S200.
  • a tick is only an optional period for performing the method shown in FIG. 5.
  • the embodiment of the present application can also set n ticks to execute the period of the method shown in FIG. 5, that is, the client can detect the virtual distance every n tick.
  • the speed of the virtual object is updated, and the location of the virtual object is updated every time the second accumulated time of the system reaches the preset location update time.
  • n may be an integer not less than one.
  • the client can update the synchronization packet according to the last time the server sends the mobile device to determine the speed update trend of the virtual object (such as speed change).
  • the small or the speed becomes larger, and the acceleration value corresponding to the speed update trend (such as the acceleration value corresponding to the speed update in the latest set time period under the speed update trend), thereby updating the trend and the acceleration value according to the speed,
  • the speed update of the virtual object is performed every time the first accumulated time of the system reaches the preset speed update time.
  • the speed update trend of the virtual object indicated by the mobile update synchronization packet may be a speed increase
  • the corresponding acceleration value triggered by the acceleration operation of the user is, for example,
  • the client can update the speed of the virtual object by using the acceleration of 3 meters per second on the basis of the current speed of the virtual object when the first accumulated time of the system reaches the preset speed update time.
  • the client can determine the current position orientation of the virtual object and the current speed, so that the preset position update time is reached every second accumulation time of the system with the current position orientation and the current speed.
  • the location of the virtual object is updated.
  • the client can reach the preset position update time when the second accumulated time of the system reaches 5 in the case of no user intervention.
  • the speed of meters per second updates the position of the virtual object north.
  • the client may also actively update the virtual object location based on the user operation, or update the virtual package based on the mobile update synchronization packet of the server feedback.
  • Object speed In addition to periodically updating the virtual object speed and location through the methods shown in FIG. 4 and FIG. 5, the client may also actively update the virtual object location based on the user operation, or update the virtual package based on the mobile update synchronization packet of the server feedback. Object speed.
  • FIG. 6 is still another flowchart of a method for moving a virtual object according to an embodiment of the present application, which may be performed by a client.
  • the method may include the following steps S300-S340.
  • Step S300 detecting a movement control operation of the user, and determining a movement control parameter of the virtual object indicated by the movement control operation of the user.
  • the movement control parameters may include: position control parameters of the virtual object, orientation control parameters, speed control parameters, and the like.
  • Step S310 Perform location update at a current speed of the virtual object according to the motion control parameter.
  • the current speed of the virtual object may be the speed corresponding to the virtual object when the location of the virtual object is currently updated.
  • the client performs location update at the current speed of the virtual object according to the mobile control parameter, which can be considered as a form of location update of the virtual object by the client.
  • the client Based on the second accumulation time of the foregoing system, after the client recalculates each time the virtual object is updated, the client needs to recalculate the second after the location update of the virtual object according to the current control parameter. Accumulate time, such as clearing and recalculating the current system second accumulation time.
  • Step S320 Send a mobile control operation request carrying the mobile control parameter to the server.
  • Step S330 After the server updates the location and speed of the virtual object according to the mobility control parameter, the mobile update synchronization packet sent by the server is received.
  • the mobile update synchronization package may include: synchronization data of the virtual object after the update speed, location, orientation, time stamp of the server update, and the like.
  • Step S340 Perform speed update on the virtual object according to the mobile update synchronization package.
  • the client can use the update speed, location, orientation of the virtual object indicated in the mobile update synchronization package, and the time stamp of the server update to update the speed. If the client can compare the time difference between the time stamp of the server update and the current time, based on the updated speed, location, and orientation of the virtual object, determine a speed adjustment value corresponding to the virtual object under the time difference, thereby updating based on the mobile
  • the update speed indicated by the synchronization packet and the speed adjustment value update the speed of the virtual object on the client side.
  • the client when the network between the client and the server is good, for example, when the network delay is less than the predetermined delay, the client can update the update speed indicated in the synchronization package directly by the mobile. Speed updates to virtual objects.
  • the client updates the virtual object according to the mobile update synchronization package, which is considered as a form of speed update of the virtual object by the client.
  • the client needs to recalculate the first accumulation time of the system after the speed update of the virtual object according to the mobile update synchronization package. For example, the current system first accumulation time is cleared and recalculated.
  • FIG. 7 is still another flowchart of the mobile synchronization method of the virtual object provided by the embodiment of the present application, and the method may be performed by the client. Referring to FIG. 7, the method may include the following steps S400-S500.
  • Step S400 a tick begins.
  • Step S410 determining whether the user's mobile control operation is detected, or receiving the mobile update synchronization packet sent by the server; if the user's mobile control operation is detected, executing step S420, and if detecting the mobile update synchronization packet, performing step S440, if Neither the user's mobile control operation nor the mobile update synchronization packet is detected, and step S460 is performed.
  • Step S420 Perform location update according to the current control speed of the virtual object according to the mobile control parameter indicated by the user's mobile control operation, and send a mobile control operation request carrying the mobile control parameter to the server.
  • Step S430 recalculating the second accumulation time of the system, and returning to step S400.
  • Step S440 performing speed update on the virtual object according to the mobile update synchronization package.
  • Step S450 recalculating the first accumulation time of the system, and returning to step S400.
  • Step S460 detecting a first accumulation time of the system after the last speed update from the virtual object, and a second accumulation time of the system after the last position update from the virtual object.
  • Step S470 determining whether the first accumulation time of the system reaches the preset speed update time, if yes, executing step S480, and if not, returning to step S400.
  • Step S480 updating the speed of the virtual object, recalculating the first accumulation time of the system, and returning to step S400.
  • Step S490 determining whether the second accumulation time of the system reaches the preset position update time, if yes, executing step S500, and if not, returning to step S400.
  • Step S500 updating the location of the virtual object, recalculating the second accumulation time of the system, and returning to step S400.
  • the client may update the demand for different speeds and positions of the virtual object, and use different frequencies for updating;
  • the speed of the virtual object is The client updates with the low frequency indicated by the server, that is, the client updates the speed of the virtual object every time the first accumulated time of the system reaches the preset speed update time;
  • the position of the virtual object is updated at the high frequency of the client, that is, Each time the second accumulated time of the system reaches the preset position update time, the client updates the position of the virtual object once, and the preset position update time is less than the preset speed update time.
  • the client can actively and instantaneously update the speed and location of the virtual object to ensure the timeliness of the virtual object speed and location update.
  • the embodiment of the present application can make the update of the speed and position of the virtual object conform to the running requirement of the actual virtual scenario, obtain a highly accurate mobile synchronization effect, and greatly reduce the performance overhead of the server.
  • FIG. 8 shows still another flowchart of the mobile synchronization method of the virtual object provided by the embodiment of the present application, which may be performed by the client.
  • the method may include the following steps S600-S680.
  • Step S600 a tick begins.
  • Step S610 determining whether a mobile update synchronization packet sent by the server is received, and if so, Step S620 is performed, and if no, step S640 is performed.
  • the mobile update synchronization package may be generated based on the user's mobile control operation.
  • the client detects the user's mobile control operation
  • the corresponding mobile control operation request may be sent to the server, and the server updates the speed of the virtual object based on the mobile control operation request.
  • a mobile update synchronization packet indicating information such as the updated speed, location, orientation, timestamp of the server update, and the like of the virtual object may be generated and sent to the client.
  • the mobile update synchronization package may also generate a self-jump generation based on the movement state of the virtual object, and the server may update the speed and position of the virtual object after detecting the movement state of the virtual object in the virtual scene, and generate a mobile update synchronization.
  • the package is sent to the client.
  • Step S620 Perform speed and location update on the virtual object according to the mobile update synchronization package.
  • the client can perform speed and location update according to the updated speed, location, orientation, time stamp of the server update, and the like of the virtual object indicated in the mobile update synchronization package.
  • determining a time difference between the current time of the client and the timestamp of the server update determining a speed adjustment value corresponding to the virtual object under the time difference based on the updated speed, location, and orientation of the virtual object, thereby synchronizing based on the mobile update
  • the speed of the update indicated by the packet and the speed adjustment value are used to update the speed of the virtual object on the client side; meanwhile, based on the updated speed, position, and orientation of the virtual object, the corresponding position of the virtual object under the time difference is determined.
  • the value is adjusted such that the location of the virtual object is updated on the client side based on the updated location indicated by the mobile update synchronization packet and the location adjustment value.
  • the client may directly update the virtual object by using the update speed indicated in the mobile update synchronization package to move the update synchronization packet.
  • the updated location to update the location of the virtual object.
  • Step S630 recalculating the first accumulation time of the system and the second accumulation time of the system, and returning to step S600.
  • Step S640 detecting a first accumulation time of the system after the last speed update from the virtual object, and a second accumulation time of the system after the last position update of the virtual object.
  • step S650 it is determined whether the first accumulation time of the system reaches the preset speed update time. If yes, step S660 is performed, and if no, the process returns to step S600.
  • Step S660 updating the speed of the virtual object, recalculating the first accumulation time of the system, and returning to step S600.
  • step S670 it is determined whether the second accumulation time of the system reaches the preset position update time. If yes, step S680 is performed, and if no, the process returns to step S600.
  • Step S680 updating the speed of the virtual object, recalculating the second accumulation time of the system, and returning to step S600.
  • FIG. 9 shows still another flowchart of the virtual object mobile synchronization method provided by the embodiment of the present application, and the method can be executed by the server.
  • This server can be a game server.
  • the method may include the following steps S700-S710.
  • Step S700 Detecting the last speed from the virtual object and the system accumulation time after the location update.
  • the system accumulation time is recalculated after the server performs the speed and location update for each virtual object.
  • Step S710 The server updates the speed and location of the virtual object when detecting that the system accumulation time reaches the preset update time.
  • the preset update time may be consistent with the preset speed update time used by the client as described above, that is, the frequency of the speed and location update of the virtual object by the server is the same, and the low frequency is used, and the speed and location of the server are used.
  • the frequency of the update is consistent with the frequency of the update speed of the low frequency used by the client; and the system accumulation time is recalculated after the server performs a speed and location update for each virtual object.
  • the server may detect the system accumulation time every n tick, n being an integer of one or greater than one. Specifically, the server may detect the last speed from the virtual object and the system accumulation time after the location update every tick, and update the speed and location of the virtual object when the detected system accumulation time reaches the preset update time. And recalculate the system accumulation time.
  • the server can also actively and automatically update the speed and location of the virtual object based on the user's mobile control operation.
  • FIG. 10 is still another flowchart of the virtual object mobile synchronization method provided by the embodiment of the present application, which may be performed by a server.
  • the method may include the following steps S800-S850.
  • Step S800 a tick begins.
  • Step S810 determining whether a mobile control operation request sent by the client is received, the mobile control operation request carrying the mobile control parameter, if yes, executing step S820, and if no, executing step S840.
  • Step S820 Update the speed and location of the virtual object according to the mobility control parameter, generate a mobile update synchronization packet, and send the packet to the client.
  • Step S830 recalculating the system accumulation time, and returning to step S800.
  • step S840 it is determined whether the previous speed from the virtual object and the system accumulation time after the location update have reached the preset update time. If yes, step S850 is performed, and if no, the process returns to step S800.
  • Step S850 updating the speed and position of the virtual object, and recalculating the system accumulation time, and returning to step S800.
  • the server may also update the speed and location of the virtual object when detecting the movement state of the virtual object, and generate a mobile update synchronization packet to be sent to the client.
  • the server may detect whether the movement state of the virtual object has its own jump for each tick, and if so, update the speed and location of the virtual object, generate a mobile update synchronization packet, and send it to the client, and at the same time, re Calculating the system accumulation time, waiting for the next tick to arrive, if not, determining whether the system accumulation time reaches the preset update time; when the system accumulation time reaches the preset update time, updating the speed and position of the virtual object, And recalculate the system accumulation time, wait for the next tick to arrive; when the system accumulation time does not reach the preset update time, wait for the next tick to arrive.
  • the server may perform speed and location update on the virtual object at a relatively low frequency based on performance overhead, that is, each time
  • the server updates the speed and location of the virtual object; and the server updates the speed and location frequency of the virtual object, and the client synchronizes the packet with no user's mobile control operation and no mobile update.
  • the speed of updating the virtual object is the same.
  • the client can actively and instantaneously update the speed and location of the virtual object to ensure the timeliness of the virtual object speed and location update.
  • the embodiment of the present application can greatly reduce the performance overhead of the server on the basis of obtaining a highly accurate mobile synchronization effect.
  • FIG. 11 is a schematic diagram showing a mobile update time axis of a client and a server provided by an embodiment of the present application, in terms of a client and a server.
  • the black dot indicates the time when the client and the server actively update the speed and location, such as the time when the client and the server are based on the user's operation and the location update;
  • the white dot indicates that the client receives the mobile.
  • the black rectangle point indicates the time point of the client and the server for speed update at a low frequency;
  • the white rectangle point indicates the time point at which the client performs position update at a high frequency, and the server performs position update at a low frequency. Time point.
  • the server performs a speed update at time t1, which may be caused by a user operation, or may be caused by a self-jump of the movement state of the virtual object.
  • Server speed The update needs to be synchronized to the client, and the client can update the speed at the time t1' corresponding to the timeline.
  • the situation at time t2 is similar to the time at t1.
  • FIG. 12 is a schematic diagram of components of a game client and a game server provided by an embodiment of the present application.
  • DriveIn is used on the client side for calculating the first accumulation time and the preset speed update time of the system. If the first accumulation time reaches the preset speed update time, the speed update is performed, and at the same time, the DriveIn is still on the client side. For calculating the relationship between the second accumulation time of the system and the preset location update time, if the second accumulation time reaches the preset location update time, the location update is performed.
  • DriveEnd can be used for location updates on both the client side and the server side.
  • DriveBegin can be used for speed updates on both the client side and the server side.
  • the client and the server can use the same set of logic for speed update and location update. However, the frequency of the client update location is high frequency, and the frequency of the client update speed and the server update speed and location frequency are both The same low frequency.
  • DriveIn handles the position and speed update at the rectangular point (black or white); the client receives the server's mobile update sync packet at time t2', first calculating the displacement of t2' and the time after the last DriveIn And the speed changes, then use the mobile parameters in the mobile update sync package to calculate the latest moving speed, which is the work of DriveBegin.
  • the black dot and the black rectangle point in the figure are guaranteed, and the output result of the server and the client update are the same, then even if the update frequency of the location update of the client and the server is different at the white rectangle point, the client And the mobile performance of the server is also highly consistent, with better mobile synchronization effects, and can achieve higher accuracy of mobile synchronization.
  • the low frequency of the speed and location update of the virtual object by the server may be different from the high frequency of the location update of the server by the client, that is, the preset update time of the server for speed and location update, which may be the preset position of the client.
  • the predetermined multiple of the update time which may be defined according to the actual operation of the virtual scene such as a game, such as 3 to 8 times, and in one embodiment is 6 times. In the embodiment of the present application, the natural multiple of the predetermined multiple may be selected to be greater than 3. number.
  • the low frequency frequency is updated once in 100 ms (millisecond), and the high frequency frequency is updated in 16 ms as an example, that is, the preset speed update time and the preset update time are 100 ms, and the preset position update time is 16 ms. That is, the client can update the position of the virtual object every 16ms without the user's mobile control operation and no mobile synchronization packet, and update the speed of the virtual object every 100ms.
  • the location update frequency is 6 times of the speed update frequency. about.
  • the server can update the speed and position of the virtual object every 100 ms in the case where the user does not have a mobile control operation request and the virtual state of the virtual object does not automatically jump.
  • the server may specify the low frequency according to different requirements of the virtual object, for example, the corresponding low frequency of the game character controlled by the player is 50 ms, the low frequency of the logical object is 100 ms, and the low frequency of the AI object is 120 ms. .
  • the mobile synchronization method of the virtual object provided by the embodiment of the present application can be applied to a game scene, that is, the virtual scene can be a game scene, the virtual object is a game object, and the game is a 2D (two-dimensional) game, a 3D (three-dimensional) game, or the like.
  • the movement synchronization of the game object of the 3D game is mainly realized by the 2D mesh + height map.
  • Figure 13 illustrates a prior art mobile synchronization scheme based on 2D mesh simulation. As can be seen from FIG. 13, the prior art is to mesh a 3D scene 2D and calculate the mobility of the movement by the connectivity between the grids. This kind of simulation has limitations on complex 3D scenes, such as the inability to better achieve mobile synchronization of game objects in complex situations such as dynamic blocking.
  • the game client and the game server can use the Character Controller to implement the movement control of the game object in the 3D game scene, and implement the speed and position update of the game object based on the Character Controller.
  • the position and speed are updated at a low frequency.
  • the game server can also perform position and speed update based on the Character Controller when there is a mobile control operation request or a moving state of the game object.
  • the game client Based on the Character Controller, the position update is performed at a high frequency, and the speed is updated at a low frequency.
  • the game client can also perform speed and position update based on the Character Controller when there is a user's mobile control operation or a mobile update synchronization package.
  • the Character Controller is called a character controller and is a technique for simulating the collision and interaction of character poses in the 3D physical world.
  • the configuration and export of the scene resource can be implemented by the scene editor, and the scene editor is a virtual scene developed by the development device in the virtual scene development process such as a game. Tools, scene editors for artists and planners to edit to develop 3D scenes used in virtual scenes.
  • the 3D scene data exported in the scene editor will eventually be loaded by the client (such as the game client) and the server (such as the game server) while the virtual scene is running.
  • the terrain walking layer data of the same 3D scene may be exported to the client (such as the game client) and the server (such as the game server), and the static object in the 3D scene is Physical collision data, physical collision data of dynamic objects in a 3D scene, etc.
  • FIG. 14 is a schematic diagram showing the relationship between the scene editor and the game client and the game server.
  • the game client can receive the terrain walking layer data of the 3D scene received from the scene editor, the physical collision data of the static object in the 3D scene, and the dynamic object in the 3D scene.
  • the game server may receive the terrain walking layer data of the 3D scene received from the scene editor, the same as the game client, the physical collision data of the static object in the 3D scene, and the physical collision data of the dynamic object in the 3D scene.
  • Physical collision data refers to the model mesh of an object with collision properties from terrain or objects.
  • the data of the physical rigid body exported in the data.
  • a box whose model is a cuboid a physical rigid body generated by the cuboid as the data representing the movement of the box in the case of a mobile collision is the physical collision data.
  • FIG. 15 shows a schematic diagram of physical collision data of a static object in a 3D scene
  • FIG. 16 shows a schematic diagram of physical collision data of a dynamic object in a 3D scene
  • the static object is the object that is not moving in the scene, such as a stone.
  • the physical collision data of the static object is the physical collision data when the static object participates in the moving collision.
  • the left frame in Figure 15 is marked with a stone model.
  • the border on the right is the physical collision data for this stone.
  • the dynamic object is an object with logical behavior that moves compared to the static object.
  • the left frame in Figure 16 marks the model of the ladder, and the frame on the right is the physical collision data corresponding to the ladder.
  • the terrain walking layer data refers to physical rigid body data generated by the mesh data of the terrain, and represents the data when the ground participates in the moving collision.
  • Figure 17 shows a schematic diagram of terrain walking layer data in a 3D scene.
  • the left border is labeled with the terrain model, which is the performance of the terrain in the game, and the border on the right is the physical collision data corresponding to the terrain, that is, the physical model when the terrain participates in the moving collision.
  • the location and speed of the virtual object can be updated through the Character Controller, and the server and the client have the scenario.
  • the character controller is a virtual object of the underlying simulation moving in a 3D scene.
  • the client and server are using the same CharacterController.
  • the embodiment of the present application can define a movement model of the virtual object.
  • the movement model of the virtual object can be implemented by using a shape, that is, the movement of the virtual object is simulated by a shape.
  • the client or the server when the client or the server detects that a certain virtual object needs to be updated in speed or location (including the case of immediate active update, and the periodic update with low frequency or high frequency), the client or the server
  • the virtual object's Character Controller can calculate the new speed or position of the virtual object; in each speed or position update, the virtual object's movement model can be linear cast (linear projection) processing to actively query the virtual scene such as the game.
  • the speed or position of the virtual object of the physical world to update the speed or position of the virtual object; the state machine can also be used to maintain the movement state logic of the Character Controller.
  • Figure 18 shows a schematic diagram of a Character Controller based mobile model.
  • the embodiment of the present application can define the movement of the infantry and the cavalry based on the Havok engine using the expandable Character Controller. Model; to define different parameter combinations and settings through the movement model of infantry and cavalry, so that the infantry's moving model can support uniform or variable linear motion in any direction, and the cavalry's moving model can support circular motion or circular motion (through The angular velocity of the linear velocity simulation), and the defined motion model is an asymmetric mobile collision model.
  • Fig. 19 shows the defined infantry movement model
  • Fig. 20 shows the defined cavalry movement model
  • Fig. 21 shows a schematic diagram of the linear velocity simulated angular velocity
  • Fig. 22 shows a schematic diagram of the circular motion.
  • any new mobile requirement can select the required synchronization from the combined mobile parameters to the client based on the actual requirements without changing the underlying algorithm of the mobile synchronization of the client or server.
  • the movement parameters are as shown in the boxes in Figures 19 and 20.
  • the embodiment of the present application can set the buffer time on the client side to reduce the buffer time.
  • the movement of virtual objects between the client and the server is not synchronized due to network fluctuations.
  • the buffer time is the buffer time for the server and client to synchronize the movement of the virtual object;
  • the fixed time indicates the stable update time;
  • the notification delay time indicates the response delay from the client to the server (due to the complexity of the network, the response delay Dynamic unpredictable);
  • the service receiving time point indicates the point in time when the client receives the mobile update packet of the server.
  • the buffering time is greater than the notification delay time, so the client's service synchronization time point should be executed after the service receiving time point.
  • This situation is healthy, and the client and server synchronize the result for the virtual object. of.
  • the network environment is always complicated, and the performance of the client and the server are also very different. Therefore, it is very likely that the buffering time has no notification delay time, so that the client has passed the service synchronization time point when the service receiving time point is received.
  • the end needs to update the current system first time and the system second time, and recalculate the system first time and the system second time.
  • the client may determine a response delay between the client and the server, and if the preset buffer time is greater than the response delay, determine that the mobile object synchronization processing is normal. If the preset buffer time is less than the response delay, the client may recalculate the first time of the system and the second time of the system to ensure normal processing of subsequent mobile synchronization.
  • the client may locally differ between the first update location of the virtual object determined by the local device and the second update location of the virtual object notified by the mobile update synchronization packet of the server (eg, The position difference is greater than the predetermined position difference), and the client can linearly move the virtual object from the virtual object first update position to the virtual object second update position within the set multiframe.
  • the update position of the virtual object calculated by the client is x1
  • the update position of the virtual object notified by the mobile update package of the server is x2.
  • the position difference is greater than the pre-
  • the client can linearly move the virtual object from position x1 to position x2 in future multiple frames.
  • the embodiment of the present application may also adopt a manner in which the server believes the location calculation result of the client to a certain extent, to further reduce the server performance cost; correspondingly, the client may report the updated update location of the virtual object to the server, and the server may Determining the update location of the virtual object reported by the client, and the location difference of the virtual object in the recently determined location in the server. When the determined location difference is less than the predetermined location threshold, the server may trust the update of the virtual object reported by the client. Location, the server can update the location of the virtual object to the update location reported by the client.
  • FIG. 24 shows that after the virtual object mobile synchronization method provided by the embodiment of the present application is adopted, the game can support multiple objects because the performance overhead of the server is low and the mobile synchronization effect between the server and the client is high.
  • the client provided by the embodiment of the present application is introduced below, and the following description may refer to the corresponding method flow of the above method.
  • FIG. 25 is a structural block diagram of a client provided by an embodiment of the present application.
  • the client may include:
  • the first detecting module 100 is configured to detect a first accumulated time of the system after the last speed update from the virtual object, and a second accumulated time of the system after the last position update of the virtual object;
  • the first update module 110 is configured to: when the first accumulation time of the system reaches the preset speed update time, update the speed of the virtual object; and when the second accumulation time of the system reaches the preset location update time , updating the location of the virtual object.
  • the preset speed update time is greater than the preset location update time, and the first accumulation time of the system is recalculated after the client performs a speed update on the virtual object, and the second cumulative time of the system is performed on the virtual object by the client. Recalculate after a location update.
  • the first detecting module 100 may be specifically configured to: after every t tick, detect a first accumulated time of the system after the last speed update from the virtual object, and after updating from the last position of the virtual object
  • the second cumulative time of the system, n is an integer not less than one.
  • the client may be further configured to: detect a movement control operation of the user, determine a movement control parameter of the virtual object indicated by the movement control operation of the user; and use the virtual object according to the movement control parameter.
  • the current speed is updated by the location; and the mobile control operation request carrying the mobile control parameter is sent to the server; after the server updates the location and speed of the virtual object according to the mobile control parameter, the mobile update synchronization sent by the receiving server is received.
  • a package speed updates the virtual object according to the mobile update synchronization package.
  • the client may be further configured to: receive a mobile update synchronization packet sent by the server; and perform speed and location update on the virtual object according to the mobile update synchronization packet.
  • the first update module 110 is specifically configured to: determine a speed update trend of the virtual object according to the last time the mobile update synchronization packet sent by the server, and The acceleration value corresponding to the speed update trend; according to the speed update trend and the acceleration value, the speed update of the virtual object is performed.
  • the first update module 110 may be specifically configured to determine a current location orientation and a current speed of the virtual object; and the current location orientation and current speed. , to update the location of the virtual object.
  • the client can update the speed and/or location of the virtual object based on the Character Controller.
  • the client may be further configured to define a movement model of the virtual object based on the Character Controller; wherein the movement model of the virtual object is implemented by using a shape;
  • the client when updating the speed or position of the virtual object based on the Character Controller, the client may be specifically configured to linearly cast the moving model of the virtual object every time the speed or position update of the virtual object is performed. Processing to actively query the speed or position of the virtual object in the physical world of the game to update the speed or position of the virtual object.
  • the client can be used to define a mobile model of the virtual object in a specific Character Controller, using a scalable Character Controller to define a movement model for the infantry and cavalry to pass the movement model to the infantry and cavalry.
  • a specific Character Controller to define a movement model for the infantry and cavalry to pass the movement model to the infantry and cavalry.
  • Different parameter combinations and settings are defined so that the infantry's moving model supports uniform or variable linear motion in any direction, and the cavalry's moving model supports circular motion or circular motion.
  • the client may be further configured to receive the terrain walking layer data of the 3D scene received from the scene editor, the same as the server, the physical collision data of the static object in the 3D scene, and the dynamics in the 3D scene.
  • the physical collision data of the object may be further configured to receive the terrain walking layer data of the 3D scene received from the scene editor, the same as the server, the physical collision data of the static object in the 3D scene, and the dynamics in the 3D scene.
  • the physical collision data of the object may be further configured to receive the terrain walking layer data of the 3D scene received from the scene editor, the same as the server, the physical collision data of the static object in the 3D scene, and the dynamics in the 3D scene.
  • the client may be further configured to: determine a response delay between the client and the server; if the preset buffer time is greater than the response delay, determine that the virtual object synchronization processing is normal; if the preset buffer The time is less than the response delay, and the client recalculates the first time of the system and the second time of the system.
  • the client may be further configured to: when receiving the mobile update synchronization packet of the server, calculate a locally determined virtual object first update location, and synchronize the virtual object notification with the server's mobile update synchronization package. The positional difference of the position; if the calculated position difference is greater than the predetermined position difference, the virtual object is linearly moved from the virtual object first update position to the virtual object second update position within the set multiframe.
  • the client can be set on a mobile device, a tablet computer, a laptop computer, and the like.
  • Fig. 26 is a block diagram showing the hardware configuration of a terminal device provided with a client.
  • the terminal device may include a processor 1, a communication interface 2, a memory 3, and a communication bus 4.
  • the communication interface 2 can be an interface of a communication module, such as an interface of a GSM module.
  • the processor 1 is for executing a program.
  • the memory 3 is used to store a program; the program may have a client program.
  • the program can include program code, the program code including computer operating instructions.
  • the processor 1 may be a central processing unit CPU, or an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention.
  • CPU central processing unit
  • ASIC Application Specific Integrated Circuit
  • the memory 3 may include a high speed RAM memory and may also include a non-volatile memory such as at least one disk memory.
  • the program can be specifically used to:
  • the preset speed update time is greater than the preset location update time, and the first accumulation time of the system is recalculated after the client performs a speed update on the virtual object, and the second cumulative time of the system is performed on the virtual object by the client. Recalculate after a location update.
  • the client provided by the embodiment of the present application is introduced below, and the following description may refer to the corresponding method flow of the above method.
  • FIG. 27 is a structural block diagram of a server according to an embodiment of the present application.
  • the server may include:
  • the second detecting module 200 is configured to detect the last speed and position update from the virtual object System accumulation time
  • the second update module 210 is configured to update the speed and location of the virtual object when detecting that the system accumulation time reaches a preset update time; wherein the system accumulation time is performed by the server for each virtual object and the speed Recalculate after the location is updated.
  • the second detecting module 200 is specifically configured to detect, once every n tick times, the last speed from the virtual object and the system accumulation time after the position update, where n is an integer not less than 1.
  • the server is further configured to: receive a mobile control operation request sent by the client, where the mobile control operation request carries a mobile control parameter; update the speed and location of the virtual object according to the mobile control parameter, and generate a mobile Update the synchronization package and send it to the client.
  • the server may be further configured to: when detecting that the moving state of the virtual object occurs, jump the speed and location of the virtual object, generate a mobile update synchronization packet, and send the synchronization packet to the client.
  • the server may update the speed and/or location of the virtual object based on the character controller Character Controller;
  • the utility model is specifically configured to linearly shape the virtual object every time the speed or position update of the virtual object is performed.
  • the cast process is to actively query the speed or position of the virtual object in the physical world of the game to update the speed or position of the virtual object.
  • the server is further configured to receive the terrain walking layer data of the 3D scene received from the scene editor, the same as the client, the physical collision data of the static object in the 3D scene, and the dynamic in the 3D scene.
  • the physical collision data of the object is further configured to receive the terrain walking layer data of the 3D scene received from the scene editor, the same as the client, the physical collision data of the static object in the 3D scene, and the dynamic in the 3D scene. The physical collision data of the object.
  • the server may be further configured to determine a virtual object reported by the client.
  • the update location is different from the location of the virtual object in the recently determined location in the server; if the location difference is less than the predetermined location threshold, the location of the virtual object is updated to the updated location reported by the client.
  • the hardware structure of the server provided by the embodiment of the present application can be as shown in FIG. 26, and includes: a processor, a communication interface, a memory, and a communication bus.
  • the processor is used to execute the program.
  • Memory for storing programs.
  • the program can be used specifically for:
  • the speed and location of the virtual object are updated; wherein the system accumulation time is recalculated after the server performs the speed and location update for each virtual object.
  • RAM Random access memory
  • ROM read only memory
  • EEPROM electrically programmable ROM
  • EEPly erasable programmable ROM registers
  • hard disk hard disk
  • removable disk CD-ROM

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

本申请实施例提供的一种虚拟对象移动同步方法、客户端、服务器及存储介质。该方法包括:客户端检测距虚拟对象的上一次速度更新后的系统第一累积时间,及距虚拟对象的上一次位置更新后的系统第二累积时间;在系统第一累积时间达到预设速度更新时间时,对虚拟对象的速度进行更新;及在系统第二累积时间达到预设位置更新时间时,对虚拟对象的位置进行更新;其中,预设速度更新时间大于预设位置更新时间,且系统第一累积时间在客户端对虚拟对象每进行一次速度更新后重新计算,系统第二累积时间在客户端对虚拟对象每进行一次位置更新后重新计算。本申请实施例可具有较高精确性的移动同步效果,且可减小服务器的性能开销。

Description

虚拟对象的移动同步方法、客户端、服务器及存储介质
本申请要求于2016年08月08日提交中国专利局、申请号为201610643328.4、发明名称为“一种虚拟对象移动同步方法、客户端及服务器”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及数据处理技术领域,具体涉及一种虚拟对象的移动同步方法、客户端、服务器及存储介质。
背景技术
虚拟对象的移动同步是指,客户端中控制的虚拟对象的移动状态,需与服务器中控制的该虚拟对象的移动状态保持一致性,即客户端对虚拟对象的移动状态更新,需与服务器对该虚拟对象的移动状态更新保持一致性。虚拟对象一般应用在游戏、仿真等虚拟场景中。以游戏场景为例,虚拟对象如游戏用户控制的游戏角色,游戏中的逻辑物件(如怪物)等。如用户在游戏客户端侧执行针对游戏对象的移动控制操作,并控制游戏对象向前奔跑,则游戏客户端和游戏服务器需同步的控制该游戏对象向前奔跑,使得游戏客户端和游戏服务器对同一游戏对象的移动控制相一致。
虚拟对象的移动同步是保持客户端和服务器一致性处理同一虚拟对象的移动数据,保持游戏、仿真等虚拟场景稳定运行的基础。
发明内容
本申请实施例提供一种虚拟对象的移动同步方法、客户端、服务器 及存储介质。
一种虚拟对象的移动同步方法,由客户端执行,所述方法包括:
检测距虚拟对象的上一次速度更新后的系统第一累积时间,及距虚拟对象的上一次位置更新后的系统第二累积时间;
在所述系统第一累积时间达到预设速度更新时间时,对所述虚拟对象的速度进行更新;及在所述系统第二累积时间达到预设位置更新时间时,对所述虚拟对象的位置进行更新;
其中,所述预设速度更新时间大于所述预设位置更新时间,且系统第一累积时间在所述客户端对虚拟对象每进行一次速度更新后重新计算,系统第二累积时间在所述客户端对虚拟对象每进行一次位置更新后重新计算。
本申请实施例还提供一种虚拟对象的移动同步方法,由服务器执行,所述方法包括:
检测距虚拟对象的上一次速度及位置更新后的系统累积时间;
在检测到所述系统累积时间达到预设更新时间时,对所述虚拟对象的速度及位置进行更新;其中,系统累积时间在服务器对虚拟对象每进行一次速度及位置更新后重新计算。
本申请实施例还提供一种客户端,包括:
第一检测模块,用于检测距虚拟对象的上一次速度更新后的系统第一累积时间,及距虚拟对象的上一次位置更新后的系统第二累积时间;
第一更新模块,用于在所述系统第一累积时间达到预设速度更新时间时,对所述虚拟对象的速度进行更新;及在所述系统第二累积时间达到预设位置更新时间时,对所述虚拟对象的位置进行更新;
其中,所述预设速度更新时间大于所述预设位置更新时间,且系统第一累积时间在所述客户端对虚拟对象每进行一次速度更新后重新计算, 系统第二累积时间在所述客户端对虚拟对象每进行一次位置更新后重新计算。
本申请实施例还提供一种服务器,包括:
第二检测模块,用于检测距虚拟对象的上一次速度及位置更新后的系统累积时间;
第二更新模块,用于每在检测到所述系统累积时间达到预设更新时间时,对所述虚拟对象的速度及位置进行更新;其中,系统累积时间在服务器对虚拟对象每进行一次速度及位置更新后重新计算。
本申请实施例还提供一种非易失性存储介质,包括处理器可执行指令,当所述指令被处理器执行时,使计算机执行如下操作:
检测距虚拟对象的上一次速度更新后的系统第一累积时间,及距所述虚拟对象的上一次位置更新后的系统第二累积时间;
在所述系统第一累积时间达到预设速度更新时间时,对所述虚拟对象的速度进行更新;及在所述系统第二累积时间达到预设位置更新时间时,对所述虚拟对象的位置进行更新;
其中,所述预设速度更新时间大于所述预设位置更新时间,且所述系统第一累积时间在所述客户端对所述虚拟对象每进行一次速度更新后重新计算,所述系统第二累积时间在所述客户端对所述虚拟对象每进行一次位置更新后重新计算。
本申请实施例针对虚拟对象的速度和位置的不同更新需求,采用不同的频率进行更新,即虚拟对象的速度在客户端和服务器以低频频率更新,虚拟对象的位置在服务器以该相同低频频率更新,虚拟对象的位置在客户端以高频频率进行更新,可使得虚拟对象的速度和位置的更新符合实际的虚拟场景运行需求,得到较高精确性的移动同步效果,且服务器均以低频频率进行速度更新和位置更新,较大的减少了服务器的性能开销。可见, 本申请实施例可在保证移动同步效果具有较高精确性的基础上,减小服务器的性能开销。
附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。
图1为本申请实施例提供的虚拟对象的移动同步系统的结构框图;
图2为本申请实施例提供的虚拟对象的移动同步方法的信令流程图;
图3为本申请实施例提供的虚拟对象的移动同步方法的另一信令流程图;
图4为本申请实施例提供的虚拟对象的移动同步方法的流程图;
图5为本申请实施例提供的虚拟对象的移动同步方法的另一流程图;
图6为本申请实施例提供的虚拟对象的移动同步方法的再一流程图;
图7为本申请实施例提供的虚拟对象的移动同步方法的又一流程图;
图8为本申请实施例提供的虚拟对象的移动同步方法的又另一流程图;
图9为本申请实施例提供的虚拟对象的移动同步方法的又再一流程图;
图10为本申请实施例提供的虚拟对象的移动同步方法的另又一流程图;
图11为本申请实施例提供的客户端和服务器的移动更新时间轴的示意图;
图12为本申请实施例提供的游戏客户端与游戏服务器的组件示意 图;
图13为现有技术基于2D网格模拟的移动同步方案;
图14为本申请实施例提供的场景编辑器与游戏客户端和游戏服务器的交互示意图;
图15为本申请实施例提供的3D场景中静态物件的物理碰撞数据的示意图;
图16为本申请实施例提供的3D场景中动态物件的物理碰撞数据的示意图;
图17为本申请实施例提供的3D场景中地形行走层数据的示意图;
图18为本申请实施例提供的基于Character Controller的移动模型的示意图;
图19为本申请实施例提供的步兵移动模型的示意图;
图20为本申请实施例提供的骑兵移动模型的示意图;
图21为本申请实施例提供的线速度模拟角速度的示意图;
图22为本申请实施例提供的变圆周运动的示意图;
图23为本申请实施例提供的客户端和服务器的移动更新时间轴的另一示意图;
图24为本申请实施例提供的游戏效果示意图;
图25为本申请实施例提供的客户端的结构框图;
图26为本申请实施例提供的终端设备的硬件结构框图;
图27为本申请实施例提供的服务器的结构框图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施 例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
图1为本申请实施例提供的虚拟对象的移动同步系统的结构框图。参照图1,该虚拟对象移动同步系统包括客户端10和服务器20。以游戏虚拟场景为例,客户端10可以是游戏客户端,服务器20可以是游戏服务器。以仿真虚拟场景为例,客户端10可以是仿真客户端,服务器20可以是仿真服务器。
客户端10可以是设置于终端设备上的,为网络游戏等虚拟场景提供本地服务的客户端。
服务器20可以是网络侧的为网络游戏等虚拟场景提供网络服务的服务器。服务器可以是单台服务器实现,也可以是多台服务器组成的服务器群组。
在本申请实施例中,虚拟对象的移动同步分为了虚拟对象的速度同步和虚拟对象的位置同步。客户端需分别对虚拟对象的速度和位置进行更新,服务器需分别对虚拟对象的速度和位置进行更新,且客户端所更新的虚拟对象的速度,与服务器所更新的虚拟对象的速度需保持一致性,客户端所更新的虚拟对象的位置,与服务器所更新的虚拟对象的位置需保持一致性。
客户端对虚拟对象进行速度更新的频率,可以以服务器对虚拟对象进行速度更新的频率为准,且采取低频频率进行虚拟对象的速度更新。由于在没有用户干预的情况下,虚拟对象的速度在一定速度变化趋势内保持的连续性较强,本申请实施例可以低频频率进行虚拟对象的速度更新,且为考虑服务器的性能开销,客户端的虚拟对象速度更新频率可以以服务器的虚拟对象速度更新频率为准。如客户端与服务器约定的虚拟对象速度更 新频率是多少,则客户端采用约定的频率进行虚拟对象的速度更新。
在进行虚拟对象的位置更新时,为保证客户端的处理流畅性,客户端可以高频频率进行虚拟对象的位置更新。而为考虑服务器的性能开销,服务器可以以与速度更新频率相同的低频频率进行虚拟对象的位置更新。
本申请实施例将虚拟对象的移动同步分为虚拟对象的速度同步和虚拟对象的位置同步,允许客户端和服务器使用不同的更新频率来进行虚拟对象的速度更新和位置更新;速度更新频率以服务器的设置为准,采取低频频率更新,且客户端以高频频率进行位置更新,服务器以相同的低频频率进行位置更新。针对虚拟对象的速度和位置的不同更新需求,本申请实施例采用不同的频率进行更新,可使得虚拟对象的速度和位置的更新符合实际的虚拟场景的运行需求,能够得到较高精确性的移动同步效果,且服务器均以低频频率进行速度更新和位置更新,较大的减少了服务器的性能开销。
结合图1所示虚拟对象的移动同步系统,图2示出了本申请实施例提供的虚拟对象的移动同步方法的信令流程图。参照图2,该流程可以包括以下步骤S10-S14。
步骤S10、客户端与服务器建立通信连接。
客户端可启动网络游戏、仿真应用等,以加载虚拟场景,并与服务器建立通信连接。
步骤S11、客户端检测距虚拟对象的上一次速度更新后的系统第一累积时间,及距虚拟对象的上一次位置更新后的系统第二累积时间。
以游戏场景为例,虚拟对象可以是所述客户端控制的游戏角色,也可以是客户端当前展示的游戏场景中的其他游戏角色、逻辑物件等。以仿真虚拟场景为例,虚拟对象可以是所述客户端控制的仿真对象(如能够运动的人,动物等仿真物体)。
客户端中虚拟对象的上一次速度更新是虚拟对象最近一次的速度更新,虚拟对象最近一次的速度更新可以是采用图2所示流程,以低频频率所进行的速度更新;虚拟对象最近一次的速度更新也可能是客户端基于服务器的移动更新同步包所进行的速度更新。
虚拟对象的上一次位置更新是虚拟对象最近一次的位置更新,虚拟对象最近一次的位置更新可以是采用图2所示流程,以高频频率所进行的位置更新;虚拟对象最近一次的位置更新也可能是客户端基于用户的移动控制操作或服务器的移动更新同步包,所进行的位置更新。
在一种实现方式中,系统第一累积时间可以在客户端对虚拟对象每进行一次速度更新后重新计算,系统第二累积时间可以在客户端对虚拟对象每进行一次位置更新后重新计算。重新计算可以是清零重新计算,也可以是重置到预设时间值、由预设时间值开始重新计算时间累积值。
步骤S12、客户端在所述系统第一累积时间达到预设速度更新时间时,对所述虚拟对象的速度进行更新;及在所述系统第二累积时间达到预设位置更新时间时,对所述虚拟对象的位置进行更新。
在一种实现方式中,预设速度更新时间可以是所设置的低频频率对应的频率时间,预设位置更新时间可以是所设置的高频频率对应的频率时间。预设速度更新时间和预设位置更新时间可以根据客户端所在的终端设备的性能以及用户对虚拟场景的需求来设定,只要满足预设速度更新时间大于预设位置更新时间即可。即客户端可以相对较大的时间间隔进行虚拟对象的速度更新,以相对较小的时间间隔进行虚拟对象的位置更新。
客户端可每在系统第一累积时间达到预设速度更新时间时,对虚拟对象进行速度更新,达到低频频率更新虚拟对象速度的目的,客户端可每在系统第二累积时间达到预设位置更新时间时,对虚拟对象进行位置更新,达到高频频率更新虚拟对象位置的目的。
在本申请实施例中,客户端可实时或者定时的检测系统第一累积时间及系统第二累积时间,并在每检测到的第一累积时间达到预设速度更新时间时,进行一次速度更新,在每检测到系统第二累积时间达到预设位置更新时间时,进行一次位置更新;且每在进行一次速度更新后,重新计算系统第一累积时间,每在进行一次位置更新后,重新计算系统第二累积时间。
在一种实现方式中,客户端可每逻辑计算时间(tick,其中tick为操作系统的内核计时单位,一tick表示一次逻辑计算时间)检测一次系统第一累积时间及系统第二累积时间。
步骤S13、服务器检测距虚拟对象的上一次速度及位置更新后的系统累积时间。
服务器以相同的低频频率更新虚拟对象的速度及位置,因此服务器可同时对虚拟对象的速度及位置进行更新。本申请实施例可统一的检测距虚拟对象的上一次速度及位置更新后的系统累积时间。
服务器中虚拟对象的上一次速度及位置更新,可以是虚拟对象最近一次的速度及位置更新。虚拟对象最近一次的速度及位置更新可以是采用图2所示流程,以低频频率所进行的速度及位置更新;也可能是服务器基于用户的移动控制操作所进行的速度及位置更新,或者服务器基于虚拟对象在虚拟场景中的移动状态自身跳转所进行的速度及位置更新。移动状态自身跳转如虚拟对象在移动中撞到障碍物速度突减为零,或者从高空突然掉下等情况。
在本申请实施例中,系统累积时间可以在服务器对虚拟对象每进行一次速度及位置更新后重新计算,如清零重新计算,或重置到预设时间值、由预设时间值开始重新计算时间累积值等。
步骤S14、服务器在检测到所述系统累积时间达到预设更新时间时, 对所述虚拟对象的速度及位置进行更新。
预设更新时间可以与客户端所设置的预设速度更新时间相同,从而客户端和服务器可以相同的低频频率进行速度更新,且服务器以相同的低频频率进行位置更新,减小服务器的性能开销,且保持客户端与服务器间的虚拟对象速度更新同步;而客户端采用高频频率进行位置更新,可保证客户端的处理流畅性。
在本申请实施例中,服务器可实时或者定时的检测系统累积时间,并在每检测到的系统累积时间达到预设更新时间时,进行一次速度及位置更新,且每在进行一次速度及位置更新后,重新计算系统累积时间。在一种实现方式中,服务器可每tick检测一次系统累积时间。
图2所示流程中,步骤S11-S12,及,步骤S13-S14间可以没有明显先后顺序。网络游戏等虚拟场景启动后,客户端与服务器可分别依据步骤S11-S12,步骤S13-步骤S14进行虚拟对象的速度和位置更新。
本申请实施例针对虚拟对象的速度和位置的不同更新需求,采用不同的频率进行更新,即虚拟对象的速度在客户端和服务器以低频频率更新,虚拟对象的位置在服务器以该相同低频频率更新,虚拟对象的位置在客户端以高频频率进行更新,可使得虚拟对象的速度和位置的更新符合实际的虚拟场景的运行需求,得到较高精确性的移动同步效果,且服务器均以低频频率进行速度更新和位置更新,较大的减少了服务器的性能开销。可见,本申请实施例可在保证移动同步效果具有较高精确性的基础上,减小服务器的性能开销。
客户端对虚拟对象进行位置更新还可以是基于用户的移动控制操作触发,或者对虚拟对象进行速度更新还可以是基于服务器所发送的移动更新同步包触发。
相应的,客户端检测到用户的移动控制操作,并确定用户的移动控 制操作指示的虚拟对象的移动控制参数后,可基于该移动控制参数,以虚拟对象的当前速度进行位置更新,并将相应的用户的移动控制操作请求发送给服务器。
服务器可基于用户的移动控制操作请求指示的移动控制参数,实现虚拟对象的位置更新及速度更新,并且服务器进行虚拟对象的位置及速度更新后,可生成移动更新同步包并发送给客户端;客户端可基于移动更新同步包实现虚拟对象的速度更新。
在图2所示流程的基础上,图3示出了本申请实施例提供的虚拟对象的移动同步方法的另一信令流程图。参照图3,该流程可以包括以下步骤S20-S25。
步骤S20、客户端检测用户的移动控制操作,确定所述用户的移动控制操作指示的虚拟对象的移动控制参数。
移动控制参数可以包括:虚拟对象的位置控制参数、朝向控制参数、速度控制参数等。
步骤S21、客户端根据所述移动控制参数,以虚拟对象当前的速度进行位置更新。
步骤S22、客户端将携带有所述移动控制参数的移动控制操作请求发送给服务器。
步骤S21和步骤S22可同时执行。
步骤S23、服务器根据所述移动控制参数对虚拟对象进行位置及速度更新。
步骤S24、服务器对虚拟对象进行位置及速度更新后,生成移动更新同步包,将所述移动更新同步包发送给客户端。
移动更新同步包中可以包括:虚拟对象的更新后的速度、位置、朝向、服务器更新的时间戳等同步数据。
步骤S25、所述客户端根据所述移动更新同步包对虚拟对象进行速度更新。
客户端可使用移动更新同步包中指示的虚拟对象的更新后的速度、位置、朝向、服务器更新的时间戳等信息,进行速度更新。
可以看出,客户端除通过图2所示流程,每在系统第一累积时间达到预设速度更新时间时,进行一次虚拟对象的速度更新外,还可在接收到服务器发送的移动更新同步包时,即时主动的进行虚拟对象的速度更新。客户端除通过图2所示流程,每在系统第二累积时间达到预设位置更新时间时,进行一次虚拟对象的位置更新外,还可在检测到用户的移动控制操作时,基于用户的移动控制操作指示的移动控制参数,即时主动的进行虚拟对象的位置更新。
值得注意的是,客户端可在接收到移动更新同步包时,即时主动的进行虚拟对象的速度更新,而客户端在对虚拟对象的位置即时主动的进行更新时,可不需要基于移动更新同步包实现。在一种实现方式中,客户端和服务器可拥有一套相同的虚拟对象位置更新逻辑或算法,客户端和服务器可基于该相同的虚拟对象位置更新逻辑或算法,独自的根据移动控制参数进行虚拟对象的位置更新;但客户端对虚拟对象的速度更新,需等待接收到服务器的移动更新同步包后才主动进行。
服务器除通过图2所示流程,每在系统累积时间达到预设更新时间时,进行一次虚拟对象的速度及位置更新外,还可在接收到用户的移动控制操作请求,基于用户的移动控制操作请求所携带的移动控制参数,即时主动的对虚拟对象进行位置及速度更新。
客户端在通过图3所示方法每进行一次虚拟对象的速度更新后,可以重新计算系统第一累积时间,客户端在通过图3所示方法每进行一次虚拟对象的位置更新后,可以重新计算系统第二累积时间。服务器在通过图3 所示方法每进行一次虚拟对象的速度及位置更新后,可以重新计算系统累积时间。
作为一种替换方式,客户端也可不直接基于所检测的用户的移动控制操作对虚拟对象进行位置更新,而是可等待接收到服务器发送的移动更新同步包后,再进行虚拟对象的位置及速度更新。
作为一种替换方式,服务器生成移动更新同步包的情况并不限于接收到用户的移动控制操作请求的情况,还可能是检测到虚拟对象在游戏等虚拟场景中的移动状态发生自身跳转时,进行虚拟对象的位置及速度更新,并生成移动更新同步包发送给客户端;此时,客户端可基于移动更新同步包进行虚拟对象的速度更新,或者,速度和位置同时更新。
站在客户端的角度,图4示出了本申请实施例提供的虚拟对象的移动同步方法的流程图,该方法可由客户端执行,客户端如游戏客户端等。参照图4,该方法可以包括以下步骤S100-S110。
步骤S100、检测距虚拟对象的上一次速度更新后的系统第一累积时间,及距虚拟对象的上一次位置更新后的系统第二累积时间。
步骤S110、在所述系统第一累积时间达到预设速度更新时间时,对所述虚拟对象的速度进行更新;及在所述系统第二累积时间达到预设位置更新时间时,对所述虚拟对象的位置进行更新。
其中,预设速度更新时间大于预设位置更新时间,且系统第一累积时间可以在客户端对虚拟对象每进行一次速度更新后重新计算,系统第二累积时间可以在客户端对虚拟对象每进行一次位置更新后重新计算。
由于预设速度更新时间大于预设位置更新时间,因此客户端可以相对低频频率对虚拟对象进行速度更新,以相对高频频率对虚拟对象进行位置更新。
在一种实现方式中,客户端可每tick检测一次系统第一累积时间及系统第二累积时间,相应的,图5示出了本申请实施例提供的虚拟对象的移动同步方法的另一流程图,该方法可由客户端执行。参照图5,该方法可以包括以下步骤S200-S250。
步骤S200、一tick开始。
步骤S210、检测距虚拟对象的上一次速度更新后的系统第一累积时间,及距虚拟对象的上一次位置更新后的系统第二累积时间。
步骤S220、判断系统第一累积时间是否达到预设速度更新时间,若是,执行步骤S230,若否,返回步骤S200。
步骤S230、对所述虚拟对象的速度进行更新,并重新计算系统第一累积时间,返回步骤S200。
步骤S240、判断系统第二累积时间是否达到预设位置更新时间,若是,执行步骤S250,若否,返回步骤S200。
步骤S250、对所述虚拟对象的位置进行更新,并重新计算系统第二累积时间,返回步骤S200。
一tick仅是执行图5所示方法的一种可选周期,本申请实施例也可设定n个tick为执行图5所示方法的周期,即客户端可每n个tick检测一次距虚拟对象的上一次速度更新后的系统第一累积时间,及距虚拟对象的上一次位置更新后的系统第二累积时间;并每在所述系统第一累积时间达到预设速度更新时间时,对所述虚拟对象的速度进行更新,及每在所述系统第二累积时间达到预设位置更新时间时,对所述虚拟对象的位置进行更新。
n的取值可以是不小于1的整数。
图4所示方法对虚拟对象进行速度更新时,客户端可根据服务器最近一次发送的移动更新同步包,确定虚拟对象的速度更新趋势(如速度变 小或速度变大),及所述速度更新趋势对应的加速度值(如该速度更新趋势下,最近的设定时间段内速度更新对应的加速度值),从而根据该速度更新趋势及加速度值,每在系统第一累积时间达到预设速度更新时间时,进行虚拟对象的速度更新。
如最近一次服务器发送的移动更新同步包是基于用户的加速操作触发,则移动更新同步包所指示的虚拟对象的速度更新趋势可以是速度变大,且用户的加速操作触发的对应加速度值为例如3米每秒平方,则客户端可在系统第一累积时间达到预设速度更新时间时,在虚拟对象当前速度的基础上,以3米每秒平方作加速度运算,进行虚拟对象的速度更新。
图4所示方法对虚拟对象进行位置更新时,客户端可确定虚拟对象的当前位置朝向及当前速度,从而以该当前位置朝向及当前速度,每在系统第二累积时间达到预设位置更新时间时,进行虚拟对象的位置更新。
如虚拟对象的当前速度为例如5米每秒,当前位置朝向为朝北奔跑,则在无用户操作干预的情况下,客户端可在系统第二累积时间达到预设位置更新时间时,以5米每秒的速度朝北更新虚拟对象的位置。
客户端除通过图4、图5所示方法周期性的更新虚拟对象速度和位置外,还可基于用户操作即时主动的更新虚拟对象位置,或基于服务器反馈的移动更新同步包即时主动的更新虚拟对象速度。
图6示出了本申请实施例提供的虚拟对象的移动同步方法的再一流程图,该方法可由客户端执行。参照图6,该方法可以包括以下步骤S300-S340。
步骤S300、检测用户的移动控制操作,确定所述用户的移动控制操作指示的虚拟对象的移动控制参数。
移动控制参数可以包括:虚拟对象的位置控制参数、朝向控制参数、速度控制参数等。
步骤S310、根据所述移动控制参数,以虚拟对象的当前速度进行位置更新。
虚拟对象当前速度可以是当前进行虚拟对象的位置更新时,虚拟对象对应的速度。
客户端根据所述移动控制参数,以虚拟对象的当前速度进行位置更新,可以认为是客户端对虚拟对象进行位置更新的一种形式。基于前述系统第二累积时间在客户端对虚拟对象每进行一次位置更新后重新计算的思想,客户端根据所述移动控制参数,以虚拟对象的当前速度进行位置更新后,需重新计算系统第二累积时间,如将当前的系统第二累积时间进行清零并重新计算。
步骤S320、将携带有所述移动控制参数的移动控制操作请求发送给服务器。
步骤S330、在所述服务器根据所述移动控制参数更新虚拟对象的位置及速度后,接收服务器发送的移动更新同步包。
移动更新同步包中可以包括:虚拟对象的更新后速度、位置、朝向、服务器更新的时间戳等同步数据。
步骤S340、根据所述移动更新同步包对虚拟对象进行速度更新。
客户端可使用移动更新同步包中指示的虚拟对象的更新后的速度、位置、朝向,服务器更新的时间戳等信息,进行速度更新。如客户端可比对服务器更新的时间戳与当前时间的时间差值,基于虚拟对象的更新后速度、位置、朝向,确定虚拟对象在所述时间差值下对应的速度调整值,从而基于移动更新同步包指示的更新后速度与所述速度调整值,在客户端侧更新虚拟对象的速度。
在一种实现方式中,在客户端与服务器的网络情况良好,如网络延迟小于预定延迟时,客户端可直接以移动更新同步包中指示的更新后速度, 对虚拟对象进行速度更新。
客户端根据所述移动更新同步包对虚拟对象进行速度更新,认为是客户端对虚拟对象进行速度更新的一种形式。基于前述系统第一累积时间在客户端对虚拟对象每进行一次速度更新后重新计算的思想,客户端根据所述移动更新同步包对虚拟对象进行速度更新后,需重新计算系统第一累积时间,如将当前的系统第一累积时间进行清零并重新计算。
结合图5所示方法,客户端可每tick检测是否存在用户的移动控制操作。相应的,图7示出了本申请实施例提供的虚拟对象的移动同步方法的又一流程图,该方法可由客户端执行。参照图7,该方法可以包括以下步骤S400-S500。
步骤S400、一tick开始。
步骤S410、判断是否检测到用户的移动控制操作,或接收到服务器发送的移动更新同步包;若检测到用户的移动控制操作,执行步骤S420,若检测到移动更新同步包,执行步骤S440,若均未检测到用户的移动控制操作和移动更新同步包,执行步骤S460。
步骤S420、根据所述用户的移动控制操作指示的移动控制参数,以虚拟对象的当前速度进行位置更新,并将携带有所述移动控制参数的移动控制操作请求发送给服务器。
步骤S430、重新计算系统第二累积时间,返回步骤S400。
步骤S440、根据所述移动更新同步包对虚拟对象进行速度更新。
步骤S450、重新计算系统第一累积时间,返回步骤S400。
步骤S460、检测距虚拟对象的上一次速度更新后的系统第一累积时间,及距虚拟对象的上一次位置更新后的系统第二累积时间。
步骤S470、判断系统第一累积时间是否达到预设速度更新时间,若是,执行步骤S480,若否,返回步骤S400。
步骤S480、对所述虚拟对象的速度进行更新,重新计算系统第一累积时间,返回步骤S400。
步骤S490、判断系统第二累积时间是否达到预设位置更新时间,若是,执行步骤S500,若否,返回步骤S400。
步骤S500、对所述虚拟对象的位置进行更新,重新计算系统第二累积时间,返回步骤S400。
本申请实施例在无用户的移动控制操作和服务器发送的移动更新同步包的情况下,客户端可针对虚拟对象的速度和位置的不同更新需求,采用不同的频率进行更新;虚拟对象的速度在客户端以服务器指示的低频频率更新,即每在系统第一累积时间达到预设速度更新时间时,客户端更新一次虚拟对象的速度;虚拟对象的位置在客户端以高频频率进行更新,即每在系统第二累积时间达到预设位置更新时间时,客户端即更新一次虚拟对象的位置,且预设位置更新时间小于预设速度更新时间。
而在有用户的移动控制操作和服务器发送的移动更新同步包时,客户端可主动即时的对虚拟对象进行速度和位置更新,保证虚拟对象速度和位置更新的及时性。
本申请实施例可使得虚拟对象的速度和位置的更新符合实际的虚拟场景的运行需求,得到较高精确性的移动同步效果,且较大的减少了服务器的性能开销。
作为一种替换方式,客户端可在接收到服务器发送的移动更新同步包时,对虚拟对象进行速度和位置更新。相应的,图8示出了本申请实施例提供的虚拟对象的移动同步方法的又另一流程图,该方法可由客户端执行。参照图8,该方法可以包括以下步骤S600-S680。
步骤S600、一tick开始。
步骤S610、判断是否接收到服务器发送的移动更新同步包,若是, 执行步骤S620,若否,执行步骤S640。
移动更新同步包可基于用户的移动控制操作生成,如客户端检测到用户的移动控制操作后,可将相应的移动控制操作请求发送给服务器,服务器基于该移动控制操作请求更新虚拟对象的速度和位置后,可生成指示虚拟对象的更新后速度、位置、朝向、服务器更新的时间戳等信息的移动更新同步包,并发送给客户端。
移动更新同步包也可基于虚拟对象的移动状态发生自身跳转生成,服务器在虚拟场景中检测到虚拟对象的移动状态发生自身跳转后,可更新虚拟对象的速度和位置,并生成移动更新同步包发送给客户端。
步骤S620、根据所述移动更新同步包对虚拟对象进行速度及位置更新。
客户端可根据移动更新同步包中指示的虚拟对象的更新后速度、位置、朝向,服务器更新的时间戳等信息,进行速度及位置更新。
如确定客户端当前时间与服务器更新的时间戳的时间差值,基于虚拟对象的更新后速度、位置、朝向,确定虚拟对象在所述时间差值下对应的速度调整值,从而基于移动更新同步包指示的更新后速度与所述速度调整值,在客户端侧更新虚拟对象的速度;同时,基于虚拟对象的更新后速度、位置、朝向,确定虚拟对象在所述时间差值下对应的位置调整值,从而基于移动更新同步包指示的更新后位置与所述位置调整值,在客户端侧更新虚拟对象的位置。
在一种实现方式中,在客户端与服务器的网络情况良好时,客户端也可直接以移动更新同步包中指示的更新后速度,对虚拟对象进行速度更新,以移动更新同步包中指示的更新后位置,对虚拟对象进行位置更新。
步骤S630、重新计算系统第一累积时间及系统第二累积时间,返回步骤S600。
步骤S640、检测距虚拟对象的上一次速度更新后的系统第一累积时间,及距虚拟对象的上一次位置更新后的系统第二累积时间。
步骤S650、判断系统第一累积时间是否达到预设速度更新时间,若是,执行步骤S660,若否,返回步骤S600。
步骤S660、对所述虚拟对象的速度进行更新,重新计算系统第一累积时间,返回步骤S600。
步骤S670、判断系统第二累积时间是否达到预设位置更新时间,若是,执行步骤S680,若否,返回步骤S600。
步骤S680、对所述虚拟对象的速度进行更新,重新计算系统第二累积时间,返回步骤S600。
站在服务器的角度,图9示出了本申请实施例提供的虚拟对象移动同步方法的又再一流程图,该方法可由服务器执行。该服务器可以是游戏服务器。参照图9,该方法可以包括以下步骤S700-S710。
步骤S700、检测距虚拟对象的上一次速度及位置更新后的系统累积时间。
其中,系统累积时间在服务器对虚拟对象每进行一次速度及位置更新后重新计算。
步骤S710、服务器在检测到所述系统累积时间达到预设更新时间时,对所述虚拟对象的速度及位置进行更新。
其中,预设更新时间可与前文所述的客户端所使用的预设速度更新时间一致,即服务器对虚拟对象进行速度及位置更新的频率一致,可均使用低频频率,且服务器进行速度及位置更新的频率,与客户端所使用的低频的更新速度的频率一致;且系统累积时间在服务器对虚拟对象每进行一次速度及位置更新后重新计算。
在一种实现方式中,服务器可每n个tick检测一次系统累积时间,n为1或大于1的整数。具体的,服务器可每tick检测一次距虚拟对象的上一次速度及位置更新后的系统累积时间,当检测到的系统累积时间达到预设更新时间时,对所述虚拟对象的速度及位置进行更新,并重新计算系统累积时间。
服务器也可基于用户的移动控制操作,即时主动的进行虚拟对象的速度及位置更新。
图10示出了本申请实施例提供的虚拟对象移动同步方法的另又一流程图,该方法可由服务器执行。参照图10,该方法可以包括以下步骤S800-S850。
步骤S800、一tick开始。
步骤S810、判断是否接收到客户端发送的移动控制操作请求,所述移动控制操作请求携带有移动控制参数,若是,执行步骤S820,若否,执行步骤S840。
步骤S820、根据所述移动控制参数更新虚拟对象的速度和位置,生成移动更新同步包并发送给所述客户端。
步骤S830、重新计算系统累积时间,返回步骤S800。
步骤S840、判断距虚拟对象的上一次速度及位置更新后的系统累积时间,是否达到预设更新时间,若是,执行步骤S850,若否,返回步骤S800。
步骤S850、对所述虚拟对象的速度及位置进行更新,并重新计算系统累积时间,返回步骤S800。
服务器也可在检测到虚拟对象的移动状态发生自身跳转时,更新虚拟对象的速度及位置,并生成移动更新同步包发送给客户端。服务器可每一tick检测虚拟对象的移动状态是否发生自身跳转,若是,则更新虚拟对象的速度和位置,生成移动更新同步包并发送给所述客户端,同时,重新 计算系统累积时间,等待下一tick到来,若否,则判断系统累积时间是否达到预设更新时间;在系统累积时间达到预设更新时间时,则对所述虚拟对象的速度及位置进行更新,并重新计算系统累积时间,等待下一tick到来;在系统累积时间未达到预设更新时间时,则等待下一tick到来。
本申请实施例在无用户的移动控制操作请求,和无虚拟对象的移动状态发生自身跳转时,服务器可基于性能开销考虑,以相对低频的频率对虚拟对象进行速度和位置更新,即每在系统累积时间达到预设更新时间时,服务器更新一次虚拟对象的速度和位置;且服务器更新虚拟对象的速度和位置的频率,与客户端在无用户的移动控制操作和无移动更新同步包的情况下,更新虚拟对象速度的频率相同。
而在有用户的移动控制操作请求,或虚拟对象的移动状态发生自身跳转的情况下,客户端可主动即时的对虚拟对象进行速度和位置更新,保证虚拟对象速度和位置更新的及时性。
本申请实施例可在得到较高精确性的移动同步效果的基础上,较大的减少服务器的性能开销。
结合客户端和服务器的角度,图11示出了本申请实施例提供的客户端和服务器的移动更新时间轴的示意图。图11中,黑色圆点表示客户端、服务器主动即时更新速度及位置的时间点,如客户端、服务器基于用户操作所引起的速度及位置更新的时间点;白色圆点表示客户端接收到移动同步包的时间点;黑色矩形点表示客户端、服务器的以低频频率进行速度更新的时间点;白色矩形点表示客户端以高频频率进行位置更新的时间点,及服务器以低频频率进行位置更新的时间点。
在图11中,t1时刻服务器发生一次速度更新,这可能是用户操作引起的,也可能是虚拟对象的移动状态发生自身跳转引起的。服务器的速度 更新需要同步到客户端,客户端可在时间轴对应的t1’时刻进行速度更新。t2时刻的情况与t1时刻类似。
图12示出了本申请实施例提供的游戏客户端与游戏服务器的组件示意图。参照图12,DriveIn在客户端侧用于计算系统第一累积时间和预设速度更新时间,如满足第一累积时间达到预设速度更新时间,则进行速度更新,同时,DriveIn在客户端侧还用于计算系统第二累积时间和预设位置更新时间的关系,如第二累积时间达到预设位置更新时间,则进行位置更新。DriveEnd在客户端侧和服务器侧均可用于进行位置更新。DriveBegin在客户端侧和服务器侧均可用于速度更新。客户端和服务器在DriveIn满足时,可使用同一套逻辑进行速度更新和位置更新,只是,客户端更新位置的频率是高频,而客户端更新速度的频率与服务器更新速度及位置的频率均是相同的低频。
结合图11,DriveIn处理矩形点(黑色或白色)处的位置和速度更新;客户端在t2’时刻接收到服务器的移动更新同步包,首先计算t2’和上一次DriveIn后的这段时间的位移和速度变化,然后使用移动更新同步包中的移动参数计算最新的移动速度,这是DriveBegin的工作。在保证图中黑色圆点和黑色矩形点,服务器和客户端更新后的输出结果都是相同的情况下,那么即使白色矩形点处,客户端和服务器进行位置更新的更新频率不同,那么客户端和服务器的移动表现也是高度一致的,具有较好的移动同步效果,可得到较高精确性的移动同步效果。
服务器对虚拟对象进行速度及位置更新的低频频率,与客户端对服务器进行位置更新的高频频率可以相差预定倍数,即服务器进行速度和位置更新的预设更新时间,可以是客户端的预设位置更新时间的预定倍数,预定倍数可以根据游戏等虚拟场景的实际运行情况定义,如为3至8倍,在一种实施方式中为6倍。本申请实施例可选取预定倍数为大于3的自然 数。
以低频频率为100ms(毫秒)更新一次,高频频率为16ms更新一次为例,即预设速度更新时间与预设更新时间为100ms,预设位置更新时间为16ms。即客户端在无用户的移动控制操作和无移动同步包的情况下,可每隔16ms更新一次虚拟对象的位置,每隔100ms更新一次虚拟对象的速度,位置更新频率是速度更新频率的6倍左右。服务器在无用户的移动控制操作请求和无虚拟对象的移动状态发生自动跳转的情况下,可每隔100ms更新一次虚拟对象的速度和位置。
可选的,服务器可以根据虚拟对象的不同需求进行低频频率的指定,如玩家控制的游戏角色的对应的低频频率为50ms,逻辑物件对应的低频频率为100ms,AI对象对应的低频频率为120ms等。
值得注意的是,上述的具体数值仅为可选形式,并不能对本申请的保护范围造成限制。
本申请实施例提供的虚拟对象的移动同步方法可应用于游戏场景,即虚拟场景可以为游戏场景,虚拟对象为游戏对象,游戏如2D(二维)游戏,3D(三维)游戏等。现有技术中,3D游戏的游戏对象的移动同步,主要通过2D网格+高度图来模拟实现。图13示出了现有技术基于2D网格模拟的移动同步方案。从图13中可以看出,现有技术是将一个3D场景2D网格化,通过网格之间的连通性来计算移动的可通过性。这种模拟对复杂的3D场景有局限性,如并不能较好地实现游戏对象在动态阻挡等复杂情况下的移动同步。
本申请实施例中,游戏客户端和游戏服务器均可使用Character Controller(角色控制器)来实现游戏对象在3D游戏场景中移动控制,并基于Character Controller实现游戏对象的速度和位置更新。如游戏服务器可基 于Character Controller,以低频频率进行位置、速度更新,游戏服务器也可基于Character Controller,在存在移动控制操作请求或游戏对象的移动状态发生自身跳转时,进行位置、速度更新;同时,游戏客户端可基于Character Controller,以高频频率进行位置更新,并以低频频率进行的速度更新,游戏客户端也可基于Character Controller,在存在用户的移动控制操作或移动更新同步包时,进行速度、位置更新。Character Controller称为角色控制器,是一种用于3D物理世界中模拟角色体移动碰撞和交互的技术。
本申请实施例的3D形式的虚拟场景的创建中,场景资源的配置及导出均可通过场景编辑器实现,场景编辑器是游戏等虚拟场景开发流程中开发设备所开发的一个用来编辑虚拟场景的工具,场景编辑器可供美术人员和策划人员编辑,以开发虚拟场景中使用的3D场景。场景编辑器中导出的3D场景数据最终会由客户端(如游戏客户端)和服务器(如游戏服务器)在虚拟场景运行时加载使用。
本申请实施例中,场景编辑器的3D场景制作完成后,可向客户端(如游戏客户端)和服务器(如游戏服务器)导出相同的3D场景的地形行走层数据,3D场景中静态物件的物理碰撞数据,3D场景中动态物件的物理碰撞数据等,图14示出了场景编辑器与游戏客户端和游戏服务器的关系示意图。
以游戏虚拟场景为例,游戏客户端可接收从场景编辑器中导出的,与游戏服务器相同接收的3D场景的地形行走层数据,3D场景中静态对象的物理碰撞数据,和3D场景中动态对象的物理碰撞数据。游戏服务器可接收从场景编辑器中导出的,与游戏客户端相同接收的3D场景的地形行走层数据,3D场景中静态对象的物理碰撞数据,和3D场景中动态对象的物理碰撞数据。
物理碰撞数据是指从地形或者物件等有碰撞属性的对象的模型mesh 数据中导出的物理刚体的数据。举例来说,比如一个箱子,它的模型就是一个长方体,由这个长方体生成的一个物理刚体作为代表这个箱子参与移动碰撞时的数据,则是物理碰撞数据。
图15示出了3D场景中静态物件的物理碰撞数据的示意图,图16示出了3D场景中动态物件的物理碰撞数据的示意图。图15中,静态物件就是场景中不动的对象,如一块石头,静态物件的物理碰撞数据即这些静态物件参与移动碰撞时的物理碰撞数据,图15中左边的边框标了一块石头的模型,右边的边框则为这块石头对应的物理碰撞数据。图16中,动态物件即是相较静态物件会动的带有逻辑行为的对象,图16中左边的边框标了云梯的模型,右边的边框则是云梯对应的物理碰撞数据。
地形行走层数据是指,由地表(terrain)的mesh数据生成的物理刚体数据,代表地面参与移动碰撞时的数据。图17示出了3D场景中地形行走层数据的示意图。图17中,左边的边框标了地形模型,既游戏中地形的表现,右边的边框则是地形对应的物理碰撞数据,即地形参与移动碰撞时的物理模型。
本申请实施例在针对虚拟对象的速度和位置的不同更新需求,采用不同的频率进行速度及位置更新的基础上,可通过Character Controller进行虚拟对象的位置及速度更新,并且服务器和客户端具有场景编辑器编辑的相同的3D场景的地形行走层数据,3D场景中静态物件的物理碰撞数据,3D场景中动态物件的物理碰撞数据等。通过这样的设置,可使得本申请实施例保证移动同步效果具有较高精确性,减小服务器的性能开销,且可在3D场景中解决复杂情况下的移动同步需求,基于真实物理碰撞的3D场景实现虚拟对象的移动同步。
Character Controller在本申请实施例中,是底层模拟的虚拟对象在3D场景中移动模型。客户端和服务器是使用一样的CharacterController。基于 Character Controller,本申请实施例可定义虚拟对象的移动模型。在本申请实施例中,虚拟对象的移动模型可以使用shape(胶囊体)实现,即通过shape来模拟虚拟对象的移动。本申请实施例在客户端或服务器检测到需对某一虚拟对象进行速度或位置的更新时(包括即时主动更新的情况,和周期性以低频或高频更新的情况),客户端或服务器中该虚拟对象的Character Controller可计算该虚拟对象新的速度或者位置;在每一次的速度或者位置更新中,可对虚拟对象的移动模型作linear cast(线形投射)处理,以主动查询游戏等虚拟场景的物理世界的虚拟对象的速度或位置,来更新虚拟对象的速度或位置;同时还可用状态机来维护Character Controller的移动状态逻辑。图18示出了基于Character Controller的移动模型的示意图。
以骑砍类游戏为例,为了满足真实丰富的移动表现,同时保证整个移动模型的稳定性,本申请实施例可在Havok引擎的基础上,使用可扩展的Character Controller,对步兵和骑兵定义移动模型;以通过对步兵和骑兵的移动模型,定义不同的参数组合和设置,使得步兵的移动模型可以支持任意方向的匀速或变速直线运动,骑兵的移动模型可以支持圆周运动或变圆周运动(通过线速度模拟的角速度),并且所定义的移动模型是非对称的移动碰撞模型。图19示出了所定义的步兵移动模型,图20示出了所定义的骑兵移动模型,图21示出了线速度模拟角速度的示意图,图22示出了变圆周运动的示意图。
基于可扩展的Character Controller,任何新的移动需求都可以在不改动客户端或服务器的移动同步底层算法的基础上,根据实际需求从所组合的移动参数中选择需要的同步到客户端,组合的移动参数如图19和图20中的方框所示参数。
为克服复杂网络环境下,客户端与服务器间移动同步可能出现的虚拟对象移动拉拽问题,本申请实施例可在客户端侧设置缓冲时间,来降低 由于网络波动造成的客户端与服务器间虚拟对象的移动不同步。
如图23所示,缓冲时间是服务器和客户端进行虚拟对象的移动同步的缓冲时间;固定时间表示稳定更新时间;通知延迟时间表示客户端到服务器的响应延迟(由于网络情况的复杂,响应延迟动态不可预知);服务接收时间点表示客户端接收到服务器的移动更新同步包的时间点。
在正常情况下缓冲时间是大于通知延迟时间的,所以客户端的服务同步时间点应在服务接收时间点之后执行,这种情况是健康的,客户端与服务器针对虚拟对象的移动同步结果是最好的。但是网络环境总是复杂的,客户端与服务器的性能也千差万别,所以很有可能导致缓冲时间没有通知延迟时间大,使得客户端执行服务接收时间点时已经过了服务同步时间点,此时客户端需要将当前的系统第一时间和系统第二时间进行更新,重新计算系统第一时间和系统第二时间。
具体的,客户端可确定客户端与服务器间的响应延迟,如果预设的缓冲时间大于所述响应延迟,则确定虚拟对象的移动同步处理正常。如果预设的缓冲时间小于所述响应延迟,则客户端可重新计算系统第一时间和系统第二时间,保证后续移动同步的正常处理。
由于网络不稳定等因素的存在,以服务器计算的虚拟对象的移动状态更新结果为准的网络游戏,都不可避免的会产生虚拟对象的移动拉拽现象。在此情况下,为了保证客户端本地的平滑表现,客户端可在本地所确定的虚拟对象第一更新位置,与服务器的移动更新同步包通知的虚拟对象第二更新位置相差较大时(如位置差大于预定位置差值),客户端可在设定多帧内,线性地将该虚拟对象由虚拟对象第一更新位置移动到虚拟对象第二更新位置。
比如虚拟对象在客户端计算的更新位置为x1,服务器的移动更新同步包通知的该虚拟对象的更新位置为x2,当x2比x1大很多,位置差大于预 定位置差值时,为了保证客户端表现的平滑,客户端可在未来多帧里,线性地将虚拟对象由位置x1移动到位置x2。
本申请实施例也可采用服务器在一定程度上相信客户端的位置计算结果的方式,来进一步减小服务器性能开销;相应的,客户端可将所确定的虚拟对象的更新位置上报给服务器,服务器可确定客户端上报的虚拟对象的更新位置,与该虚拟对象在服务器中最近确定的位置的位置差,当所确定的位置差小于预定的位置阈值时,服务器可信任客户端上报的该虚拟对象的更新位置,服务器可将虚拟对象的位置更新为客户端上报的更新位置。
发明人进过实验发现,采用本申请实施例提供的虚拟对象的移动同步方法后,移动同步的开销在服务器端只占用CPU单核5%以下,单个地图服务器可以支持上千个玩家同时移动战斗。图24示出了采用本申请实施例提供的虚拟对象移动同步方法后,由于服务器的性能开销较低,且服务器与客户端间的移动同步效果的精确性较高,游戏可支持多个对象在3D场景中的移动模拟和移动同步的示意图,图中球体表示的是虚拟对象。
下面对本申请实施例提供的客户端进行介绍,下文描述内容可与上文方法流程内容相互对应参照。
图25为本申请实施例提供的客户端的结构框图。参照图25,该客户端可以包括:
第一检测模块100,用于检测距虚拟对象的上一次速度更新后的系统第一累积时间,及距虚拟对象的上一次位置更新后的系统第二累积时间;
第一更新模块110,用于在所述系统第一累积时间达到预设速度更新时间时,对所述虚拟对象的速度进行更新;及在所述系统第二累积时间达到预设位置更新时间时,对所述虚拟对象的位置进行更新。
其中,所述预设速度更新时间大于预设位置更新时间,且系统第一累积时间在客户端对虚拟对象每进行一次速度更新后重新计算,系统第二累积时间在客户端对虚拟对象每进行一次位置更新后重新计算。
在一种实现方式中,第一检测模块100可具体用于,每n个tick检测一次距虚拟对象的上一次速度更新后的系统第一累积时间,及距虚拟对象的上一次位置更新后的系统第二累积时间,n为不小于1的整数。
在一种实现方式中,所述客户端还可用于,检测用户的移动控制操作,确定所述用户的移动控制操作指示的虚拟对象的移动控制参数;根据所述移动控制参数,以虚拟对象的当前速度进行位置更新;及将携带有所述移动控制参数的移动控制操作请求发送给服务器;在所述服务器根据所述移动控制参数更新虚拟对象的位置及速度后,接收服务器发送的移动更新同步包;根据所述移动更新同步包对虚拟对象进行速度更新。
在一种实现方式中,所述客户端还可用于,接收服务器发送的移动更新同步包;根据所述移动更新同步包对虚拟对象进行速度及位置更新。
在一种实现方式中,第一更新模块110在对所述虚拟对象的速度进行更新时,具体可用于,根据服务器最近一次发送的移动更新同步包,确定虚拟对象的速度更新趋势,及所述速度更新趋势对应的加速度值;根据该速度更新趋势及加速度值,进行虚拟对象的速度更新。
在一种实现方式中,第一更新模块110在对所述虚拟对象的位置进行更新时,具体可用于,确定所述虚拟对象的当前位置朝向及当前速度;以所述当前位置朝向及当前速度,进行虚拟对象的位置更新。
在一种实现方式中,客户端可基于Character Controller更新所述虚拟对象的速度和/或位置。
在一种实现方式中,客户端还可用于,基于Character Controller,定义虚拟对象的移动模型;其中,虚拟对象的移动模型使用shape实现;
相应的,客户端在基于Character Controller更新所述虚拟对象的速度或位置时,具体可用于,在每一次对所述虚拟对象进行速度或者位置更新时,对所述虚拟对象的移动模型作linear cast处理,以主动查询游戏的物理世界中虚拟对象的速度或位置,实现更新所述虚拟对象的速度或位置。
在一种实现方式中,客户端在具体Character Controller,定义虚拟对象的移动模型时具体可用于,使用可扩展的Character Controller,对步兵和骑兵定义移动模型,以通过对步兵和骑兵的移动模型,定义不同的参数组合和设置,使得步兵的移动模型支持任意方向的匀速或变速直线运动,骑兵的移动模型支持圆周运动或变圆周运动。
在一种实现方式中,客户端还可用于,接收从场景编辑器中导出的,与服务器相同接收的3D场景的地形行走层数据,3D场景中静态对象的物理碰撞数据,和3D场景中动态对象的物理碰撞数据。
在一种实现方式中,客户端还可用于,确定客户端与服务器间的响应延迟;如果预设的缓冲时间大于所述响应延迟,则确定虚拟对象的移动同步处理正常;如果预设的缓冲时间小于所述响应延迟,则客户端重新计算系统第一时间和系统第二时间。
在一种实现方式中,客户端还可用于,在接收到服务器的移动更新同步包时,计算本地所确定的虚拟对象第一更新位置,与服务器的移动更新同步包通知的虚拟对象第二更新位置的位置差;如果所计算的位置差大于预定位置差值,在设定多帧内,线性地将所述虚拟对象由虚拟对象第一更新位置移动到虚拟对象第二更新位置。
客户端可设置于手机、平板电脑、笔记本电脑等终端设备上。图26示出了设置有客户端的终端设备的硬件结构框图。参照图26,该终端设备可以包括:处理器1,通信接口2,存储器3和通信总线4。
其中处理器1、通信接口2、存储器3通过通信总线4完成相互间的 通信。
通信接口2可以为通信模块的接口,如GSM模块的接口。
处理器1,用于执行程序。
存储器3,用于存放程序;程序中可具有客户端程序。
程序可以包括程序代码,所述程序代码包括计算机操作指令。
处理器1可能是一个中央处理器CPU,或者是特定集成电路ASIC(Application Specific Integrated Circuit),或者是被配置成实施本发明实施例的一个或多个集成电路。
存储器3可能包含高速RAM存储器,也可能还包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。
其中,程序可具体用于:
检测距虚拟对象的上一次速度更新后的系统第一累积时间,及距虚拟对象的上一次位置更新后的系统第二累积时间;
在所述系统第一累积时间达到预设速度更新时间时,对所述虚拟对象的速度进行更新;及在所述系统第二累积时间达到预设位置更新时间时,对所述虚拟对象的位置进行更新;
其中,所述预设速度更新时间大于预设位置更新时间,且系统第一累积时间在客户端对虚拟对象每进行一次速度更新后重新计算,系统第二累积时间在客户端对虚拟对象每进行一次位置更新后重新计算。
下面对本申请实施例提供的客户端进行介绍,下文描述内容可与上文方法流程内容相互对应参照。
图27为本申请实施例提供的服务器的结构框图。参照图27,该服务器可以包括:
第二检测模块200,用于检测距虚拟对象的上一次速度及位置更新后 的系统累积时间;
第二更新模块210,用于在检测到所述系统累积时间达到预设更新时间时,对所述虚拟对象的速度及位置进行更新;其中,系统累积时间在服务器对虚拟对象每进行一次速度及位置更新后重新计算。
在一种实现方式中,第二检测模块200具体可用于,每n个tick检测一次距虚拟对象的上一次速度及位置更新后的系统累积时间,n为不小于1的整数。
在一种实现方式中,服务器还可用于,接收客户端发送的移动控制操作请求,所述移动控制操作请求携带有移动控制参数;根据所述移动控制参数更新虚拟对象的速度和位置,生成移动更新同步包并发送给所述客户端。
在一种实现方式中,服务器还可用于,在检测到虚拟对象的移动状态发生自身跳转时,更新虚拟对象的速度和位置,生成移动更新同步包并发送给所述客户端。
在一种实现方式中,服务器可基于角色控制器Character Controller更新所述虚拟对象的速度和/或位置;
相应的,服务器在基于角色控制器Character Controller更新所述虚拟对象的速度或位置时,具体可用于,在每一次对所述虚拟对象进行速度或者位置更新时,对所述虚拟对象的shape作linear cast处理,以主动查询游戏的物理世界中虚拟对象的速度或位置,实现更新所述虚拟对象的速度或位置。
在一种实现方式中,服务器还可用于,接收从场景编辑器中导出的,与客户端相同接收的3D场景的地形行走层数据,3D场景中静态对象的物理碰撞数据,和3D场景中动态对象的物理碰撞数据。
在一种实现方式中,服务器还可用于,确定客户端上报的虚拟对象 的更新位置,与所述虚拟对象在服务器中最近确定的位置的位置差;如果所述位置差小于预定的位置阈值,将虚拟对象的位置更新为客户端上报的更新位置。
本申请实施例提供的服务器的硬件结构可如图26所示,包括:处理器,通信接口,存储器和通信总线。
其中处理器,用于执行程序。
存储器,用于存放程序。
程序可具体用于:
检测距虚拟对象的上一次速度及位置更新后的系统累积时间;
在检测到所述系统累积时间达到预设更新时间时,对所述虚拟对象的速度及位置进行更新;其中,系统累积时间在服务器对虚拟对象每进行一次速度及位置更新后重新计算。
本说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。对于实施例公开的装置而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。
专业人员还可以进一步意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。
结合本文中所公开的实施例描述的方法或算法的步骤可以直接用硬件、处理器执行的软件模块,或者二者的结合来实施。软件模块可以置于 随机存储器(RAM)、内存、只读存储器(ROM)、电可编程ROM、电可擦除可编程ROM、寄存器、硬盘、可移动磁盘、CD-ROM、或技术领域内所公知的任意其它形式的存储介质中。
对所公开的实施例的上述说明,使本领域专业技术人员能够实现或使用本发明。对这些实施例的多种修改对本领域的专业技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本发明的精神或范围的情况下,在其它实施例中实现。因此,本发明将不会被限制于本文所示的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。

Claims (21)

  1. 一种虚拟对象的移动同步方法,其特征在于,由客户端执行,所述方法包括:
    检测距所述虚拟对象的上一次速度更新后的系统第一累积时间,及距所述虚拟对象的上一次位置更新后的系统第二累积时间;
    在所述系统第一累积时间达到预设速度更新时间时,对所述虚拟对象的速度进行更新;及
    在所述系统第二累积时间达到预设位置更新时间时,对所述虚拟对象的位置进行更新;
    其中,所述预设速度更新时间大于所述预设位置更新时间,且所述系统第一累积时间在所述客户端对所述虚拟对象每进行一次速度更新后重新计算,所述系统第二累积时间在所述客户端对所述虚拟对象每进行一次位置更新后重新计算。
  2. 根据权利要求1所述的虚拟对象的移动同步方法,其特征在于,所述检测距所述虚拟对象的上一次速度更新后的系统第一累积时间,及距所述虚拟对象的上一次位置更新后的系统第二累积时间包括:
    每n个逻辑计算时间检测一次距所述虚拟对象的上一次速度更新后的系统第一累积时间,及距所述虚拟对象的上一次位置更新后的系统第二累积时间,n为不小于1的整数。
  3. 根据权利要求2所述的虚拟对象的移动同步方法,其特征在于,所述方法还包括:
    检测用户的移动控制操作,确定所述用户的移动控制操作指示的所述虚拟对象的移动控制参数;
    根据所述移动控制参数,以所述虚拟对象的当前速度进行位置更新;及将携带有所述移动控制参数的移动控制操作请求发送给服务器;
    在所述服务器根据所述移动控制参数更新所述虚拟对象的位置及速度后,接收服务器发送的移动更新同步包;
    根据所述移动更新同步包对所述虚拟对象进行速度更新。
  4. 根据权利要求2所述的虚拟对象的移动同步方法,其特征在于,所述方法还包括:
    接收服务器发送的移动更新同步包;
    根据所述移动更新同步包对所述虚拟对象进行速度及位置更新。
  5. 根据权利要求3或4所述的虚拟对象的移动同步方法,其特征在于,所述对所述虚拟对象进行速度更新包括:
    根据服务器最近一次发送的移动更新同步包,确定所述虚拟对象的速度更新趋势,及所述速度更新趋势对应的加速度值;
    根据该速度更新趋势及加速度值,进行所述虚拟对象的速度更新。
  6. 根据权利要求1所述的虚拟对象的移动同步方法,其特征在于,所述对所述虚拟对象的位置更新包括:
    确定所述虚拟对象的当前位置朝向及当前速度;
    以所述当前位置朝向及当前速度,进行所述虚拟对象的位置更新。
  7. 根据权利要求1所述的虚拟对象的移动同步方法,其特征在于,所述预设速度更新时间为所述预设位置更新时间的预定倍数,预定倍数为大于3的自然数。
  8. 根据权利要求1-4任一项所述的虚拟对象的移动同步方法,其特征在于,基于角色控制器更新所述虚拟对象的速度和/或位置。
  9. 根据权利要求8所述的虚拟对象的移动同步方法,其特征在于,所述方法还包括:
    基于角色控制器定义所述虚拟对象的移动模型;其中,所述虚拟对象的移动模型使用胶囊体实现;
    所述基于角色控制器更新所述虚拟对象的速度或位置包括:
    在每一次对所述虚拟对象进行速度或者位置更新时,对所述虚拟对象的移动模型作线形投射处理,以主动查询虚拟场景的物理世界中所述虚拟对象的速度或位置,实现更新所述虚拟对象的速度或位置。
  10. 根据权利9所述的虚拟对象的移动同步方法,其特征在于,所述基 于角色控制器定义所述虚拟对象的移动模型包括:
    使用可扩展的角色控制器,对虚拟游戏场景中的步兵和骑兵定义移动模型,以通过对步兵和骑兵的移动模型,定义不同的参数组合和设置,使得步兵的移动模型支持任意方向的匀速或变速直线运动,骑兵的移动模型支持圆周运动或变圆周运动。
  11. 根据权利要求8所述的虚拟对象的移动同步方法,其特征在于,所述方法还包括:
    接收从场景编辑器中导出的,与服务器接收的相同的三维场景的地形行走层数据,三维场景中静态对象的物理碰撞数据,和三维场景中动态对象的物理碰撞数据。
  12. 根据权利要求1所述的虚拟对象的移动同步方法,其特征在于,所述方法还包括:
    确定所述客户端与服务器间的响应延迟;
    如果预设的缓冲时间大于所述响应延迟,则确定所述虚拟对象的移动同步处理正常;
    如果预设的缓冲时间小于所述响应延迟,则所述客户端重新计算系统第一时间和系统第二时间。
  13. 根据权利要求1所述的虚拟对象的移动同步方法,其特征在于,所述方法还包括:
    在接收到服务器发送的移动更新同步包后,计算本地所确定的所述虚拟对象的第一更新位置,与根据服务器的移动更新同步包确定的所述虚拟对象的第二更新位置的位置差;
    如果所计算的位置差大于预定位置差值,在设定的多帧内线性地将所述虚拟对象由所述第一更新位置移动到所述第二更新位置。
  14. 一种虚拟对象的移动同步方法,其特征在于,由服务器执行,所述方法包括:
    检测距所述虚拟对象的上一次速度及位置更新后的系统累积时间;
    在检测到所述系统累积时间达到预设更新时间时,对所述虚拟对象的速 度及位置进行更新;其中,系统累积时间在服务器对所述虚拟对象每进行一次速度及位置更新后重新计算。
  15. 根据权利要求14所述的虚拟对象的移动同步方法,其特征在于,所述检测距所述虚拟对象的上一次速度及位置更新后的系统累积时间包括:
    每n个逻辑计算时间检测一次距所述虚拟对象的上一次速度及位置更新后的系统累积时间,n为不小于1的整数。
  16. 根据权利要求14所述的虚拟对象的移动同步方法,其特征在于,所述方法还包括:
    接收客户端发送的移动控制操作请求,所述移动控制操作请求携带有移动控制参数;根据所述移动控制参数更新所述虚拟对象的速度和位置,生成移动更新同步包并发送给所述客户端;
    或,在检测到所述虚拟对象的移动状态发生自身跳转时,更新所述虚拟对象的速度和位置,生成移动更新同步包并发送给所述客户端。
  17. 根据权利要求14所述的虚拟对象的移动同步方法,其特征在于,所述方法还包括:
    接收从场景编辑器中导出的,与客户端接收的相同的三维场景的地形行走层数据,三维场景中静态对象的物理碰撞数据,和三维场景中动态对象的物理碰撞数据。
  18. 根据权利要求14所述的虚拟对象的移动同步方法,其特征在于,所述方法还包括:
    确定客户端上报的所述虚拟对象的更新位置,与所述虚拟对象在服务器中最近确定的位置的位置差;
    如果所述位置差小于预定的位置阈值,将所述虚拟对象的位置更新为客户端上报的更新位置。
  19. 一种客户端,其特征在于,包括:
    第一检测模块,用于检测距虚拟对象的上一次速度更新后的系统第一累积时间,及距所述虚拟对象的上一次位置更新后的系统第二累积时间;
    第一更新模块,用于在所述系统第一累积时间达到预设速度更新时间时,对所述虚拟对象的速度进行更新;及在所述系统第二累积时间达到预设位置更新时间时,对所述虚拟对象的位置进行更新;
    其中,所述预设速度更新时间大于所述预设位置更新时间,且所述系统第一累积时间在所述客户端对所述虚拟对象每进行一次速度更新后重新计算,所述系统第二累积时间在所述客户端对所述虚拟对象每进行一次位置更新后重新计算。
  20. 一种服务器,其特征在于,包括:
    第二检测模块,用于检测距虚拟对象的上一次速度及位置更新后的系统累积时间;
    第二更新模块,用于在检测到所述系统累积时间达到预设更新时间时,对所述虚拟对象的速度及位置进行更新;其中,所述系统累积时间在所述服务器对所述虚拟对象每进行一次速度及位置更新后重新计算。
  21. 一种非易失性存储介质,包括处理器可执行指令,当所述指令被处理器执行时,使计算机执行如下操作:
    检测距虚拟对象的上一次速度更新后的系统第一累积时间,及距所述虚拟对象的上一次位置更新后的系统第二累积时间;
    在所述系统第一累积时间达到预设速度更新时间时,对所述虚拟对象的速度进行更新;及在所述系统第二累积时间达到预设位置更新时间时,对所述虚拟对象的位置进行更新;
    其中,所述预设速度更新时间大于所述预设位置更新时间,且所述系统第一累积时间在所述客户端对所述虚拟对象每进行一次速度更新后重新计算,所述系统第二累积时间在所述客户端对所述虚拟对象每进行一次位置更新后重新计算。
PCT/CN2017/096436 2016-08-08 2017-08-08 虚拟对象的移动同步方法、客户端、服务器及存储介质 WO2018028566A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP17838696.7A EP3499844B1 (en) 2016-08-08 2017-08-08 Method for synchronising movement of virtual object, client, server and storage medium
US16/206,717 US11235234B2 (en) 2016-08-08 2018-11-30 Method for movement synchronization of virtual object, client, server, and storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610643328.4 2016-08-08
CN201610643328.4A CN106302679B (zh) 2016-08-08 2016-08-08 一种虚拟对象移动同步方法、客户端及服务器

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US16/206,717 Continuation US11235234B2 (en) 2016-08-08 2018-11-30 Method for movement synchronization of virtual object, client, server, and storage medium

Publications (1)

Publication Number Publication Date
WO2018028566A1 true WO2018028566A1 (zh) 2018-02-15

Family

ID=57666729

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/096436 WO2018028566A1 (zh) 2016-08-08 2017-08-08 虚拟对象的移动同步方法、客户端、服务器及存储介质

Country Status (4)

Country Link
US (1) US11235234B2 (zh)
EP (1) EP3499844B1 (zh)
CN (1) CN106302679B (zh)
WO (1) WO2018028566A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110022363A (zh) * 2019-04-03 2019-07-16 腾讯科技(深圳)有限公司 虚拟对象的运动状态修正方法、装置、设备及存储介质
CN113398591A (zh) * 2021-06-18 2021-09-17 网易(杭州)网络有限公司 游戏控制的方法、装置、设备及存储介质

Families Citing this family (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106302679B (zh) 2016-08-08 2018-10-02 腾讯科技(深圳)有限公司 一种虚拟对象移动同步方法、客户端及服务器
CN107124416B (zh) * 2017-05-02 2020-10-16 阿里巴巴(中国)有限公司 多化身位置同步系统、方法、装置及电子设备和存储介质
CN107273008B (zh) * 2017-05-23 2019-11-12 武汉秀宝软件有限公司 一种虚拟环境中的碰撞处理方法、客户端、服务器及系统
CN107376351B (zh) * 2017-07-12 2019-02-26 腾讯科技(深圳)有限公司 对象的控制方法和装置
CN108022286B (zh) * 2017-11-30 2019-08-13 腾讯科技(深圳)有限公司 画面渲染方法、装置及存储介质
CN110102047B (zh) * 2018-02-01 2023-10-24 腾讯科技(上海)有限公司 游戏操作处理方法和装置、游戏效果展示方法和装置
CN108525296B (zh) * 2018-04-24 2019-12-06 网易(杭州)网络有限公司 虚拟现实游戏中的信息处理方法、装置及处理器
CN109224441B (zh) * 2018-08-03 2022-09-20 深圳市创梦天地科技有限公司 一种同步虚拟角色的位置的方法及装置
CN109381858B (zh) * 2018-10-22 2021-10-15 竞技世界(北京)网络技术有限公司 一种网络游戏中位置同步方法
CN109529332B (zh) * 2018-11-28 2021-09-17 珠海金山网络游戏科技有限公司 一种游戏场景运动状态切换方法、装置、服务器及终端
CN109550237A (zh) * 2018-11-28 2019-04-02 珠海金山网络游戏科技有限公司 一种游戏场景管理方法、装置、服务器及终端
CN109718543B (zh) * 2018-12-28 2022-07-12 北京像素软件科技股份有限公司 一种同屏处理方法及装置
CN109660559B (zh) * 2019-01-21 2021-05-04 竞技世界(北京)网络技术有限公司 一种基于时间戳的客户端与服务器端场景同步方法
CN110045827B (zh) 2019-04-11 2021-08-17 腾讯科技(深圳)有限公司 虚拟环境中虚拟物品的观察方法、装置及可读存储介质
CN110273550B (zh) * 2019-05-22 2020-10-27 中联重科股份有限公司 泵送设备的配对自控方法及控制装置
CN111013131B (zh) * 2019-10-31 2023-08-01 咪咕互动娱乐有限公司 延迟数据获取方法、电子设备及存储介质
CN111867042B (zh) * 2020-04-15 2022-11-04 北京云联慧通科技有限公司 具有时间差检测功能的mesh网络同步的方法
CN111921201B (zh) * 2020-09-21 2021-01-08 成都完美天智游科技有限公司 生成帧数据的方法及装置、存储介质、计算机设备
EP4207088A4 (en) * 2020-10-07 2024-03-06 Samsung Electronics Co Ltd AUGMENTED REALITY DISPLAY METHOD AND ELECTRONIC DEVICE FOR USING IT
CN116614676B (zh) * 2023-07-14 2023-09-12 南京维赛客网络科技有限公司 在消息同步中虚拟人物动画重播的方法、系统及存储介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH10272256A (ja) * 1997-03-31 1998-10-13 Nippon Telegr & Teleph Corp <Ntt> 対戦ゲームシステム構成方法
CN1941788A (zh) * 2005-09-26 2007-04-04 腾讯科技(深圳)有限公司 一种联网游戏中角色的移动方法
CN102769616A (zh) * 2012-07-04 2012-11-07 珠海金山网络游戏科技有限公司 一种基于游戏移动逻辑客户端与服务端同步的延迟计算方法
CN103701918A (zh) * 2013-12-31 2014-04-02 北京像素软件科技股份有限公司 客户端和服务器同步方法和装置
CN104954349A (zh) * 2014-03-31 2015-09-30 北京畅游天下网络技术有限公司 一种2d游戏中客户端的同步方法、装置和系统
CN106302679A (zh) * 2016-08-08 2017-01-04 腾讯科技(深圳)有限公司 一种虚拟对象移动同步方法、客户端及服务器

Family Cites Families (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB9817834D0 (en) * 1998-08-14 1998-10-14 British Telecomm Predicting avatar movement in a distributed virtual environment
JP2004105671A (ja) * 2002-09-16 2004-04-08 Genki Kk 空間位置共有システム、データ共有システム、ネットワークゲームシステム及びネットワークゲーム用クライアント
US9089771B2 (en) * 2006-02-17 2015-07-28 Alcatel Lucent Method and apparatus for synchronizing assets across distributed systems
US8109818B2 (en) * 2006-03-06 2012-02-07 Microsoft Corporation Home city for a real-time strategy video game
JP5051500B2 (ja) * 2006-05-17 2012-10-17 株式会社セガ 情報処理装置およびその装置におけるスキール音生成プログラムと生成方法
JP4399472B2 (ja) * 2007-03-13 2010-01-13 株式会社コナミデジタルエンタテインメント ゲーム装置、ゲーム装置の制御方法及びプログラム
JP4319233B2 (ja) * 2007-12-11 2009-08-26 株式会社コナミデジタルエンタテインメント 端末装置、ゲーム制御方法、ならびに、プログラム
CN101841538A (zh) * 2010-04-16 2010-09-22 上海亚图软件有限公司 Cs架构下的物理计算网络同步方法
CN103391300B (zh) * 2012-05-08 2014-11-05 腾讯科技(深圳)有限公司 远程控制中实现移动同步的方法和系统
US9446306B2 (en) * 2012-07-19 2016-09-20 The Regents Of The University Of California System and method for local multiplayer gaming
CN103854300B (zh) * 2012-12-07 2016-12-21 江苏省电力公司 多客户端联网控制下三维场景协作搬运的实现方法
US10217284B2 (en) * 2013-09-30 2019-02-26 Qualcomm Incorporated Augmented virtuality
US9192863B2 (en) * 2013-10-29 2015-11-24 Disney Enterprises, Inc. Selective caching of interactive objects
CN103561467B (zh) * 2013-11-05 2017-01-18 中国联合网络通信集团有限公司 移动用户的定位处理方法及装置
CN103957224B (zh) * 2014-05-21 2019-11-19 腾讯科技(深圳)有限公司 一种在线游戏中的人物移动方法和系统

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH10272256A (ja) * 1997-03-31 1998-10-13 Nippon Telegr & Teleph Corp <Ntt> 対戦ゲームシステム構成方法
CN1941788A (zh) * 2005-09-26 2007-04-04 腾讯科技(深圳)有限公司 一种联网游戏中角色的移动方法
CN102769616A (zh) * 2012-07-04 2012-11-07 珠海金山网络游戏科技有限公司 一种基于游戏移动逻辑客户端与服务端同步的延迟计算方法
CN103701918A (zh) * 2013-12-31 2014-04-02 北京像素软件科技股份有限公司 客户端和服务器同步方法和装置
CN104954349A (zh) * 2014-03-31 2015-09-30 北京畅游天下网络技术有限公司 一种2d游戏中客户端的同步方法、装置和系统
CN106302679A (zh) * 2016-08-08 2017-01-04 腾讯科技(深圳)有限公司 一种虚拟对象移动同步方法、客户端及服务器

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3499844A4 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110022363A (zh) * 2019-04-03 2019-07-16 腾讯科技(深圳)有限公司 虚拟对象的运动状态修正方法、装置、设备及存储介质
CN110022363B (zh) * 2019-04-03 2021-10-29 腾讯科技(深圳)有限公司 虚拟对象的运动状态修正方法、装置、设备及存储介质
CN113398591A (zh) * 2021-06-18 2021-09-17 网易(杭州)网络有限公司 游戏控制的方法、装置、设备及存储介质

Also Published As

Publication number Publication date
EP3499844A1 (en) 2019-06-19
US11235234B2 (en) 2022-02-01
CN106302679B (zh) 2018-10-02
CN106302679A (zh) 2017-01-04
EP3499844B1 (en) 2021-10-27
EP3499844A4 (en) 2020-03-04
US20190091569A1 (en) 2019-03-28

Similar Documents

Publication Publication Date Title
WO2018028566A1 (zh) 虚拟对象的移动同步方法、客户端、服务器及存储介质
CN111167116B (zh) 一种平滑显示的方法、终端和计算机存储介质
KR102370706B1 (ko) 게임 시스템들에서 디스플레이 랙의 검출 및 보상
WO2018201935A1 (zh) 多化身位置同步系统、方法、装置及电子设备和存储介质
CN108022286B (zh) 画面渲染方法、装置及存储介质
US9149724B2 (en) Network game system without dynamic obstructions and processing method thereof
WO2019105377A1 (zh) 一种业务处理方法、装置及存储介质
CN106817508B (zh) 一种同步对象确定方法、装置和系统
CN104954349B (zh) 一种2d游戏中客户端的同步方法、装置和系统
CN111265863B (zh) 一种目标对象的位置纠正方法、装置、设备及介质
EP3934775B1 (en) Peer-to-peer multiplayer cloud gaming architecture
US11543540B2 (en) Apparatus and method of selecting airborne position reference node
JP6748281B1 (ja) サーバ、処理システム、処理方法及びプログラム
CN111729312A (zh) 位置同步方法、装置及设备
JP2018133664A (ja) 配信装置およびプログラム
Li et al. Consistency-aware zone mapping and client assignment in multi-server distributed virtual environments
Brown et al. Aura projection for scalable real-time physics
CN113614683A (zh) 使用移动电子装置的布置的用于视觉媒体的虚拟播出屏幕
CN108984989A (zh) 基于dr平滑算法和dds-qos的仿真计算方法
KR102285090B1 (ko) 복수의 디바이스 각각에서 객체의 위치를 결정하기 위한 방법, 시스템 및 비일시성의 컴퓨터 판독 가능한 기록 매체
KR102125432B1 (ko) 피사체의 운동 궤적을 산출하기 위한 방법, 시스템 및 비일시성의 컴퓨터 판독 가능 기록 매체
CN115761092A (zh) 画面绘制方法及装置
CN114377382A (zh) 物理模拟同步方法、系统、介质和计算机程序产品
Yao et al. Research on Dynamic Synchronization of Multi Channel Three Dimensional Visual Simulation System
CN117679731A (zh) 基于虚拟场景的数据回放方法、相关设备及存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17838696

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2017838696

Country of ref document: EP

Effective date: 20190311