Method, device, equipment and storage medium for mobile synchronization of virtual characters
By providing specific synchronization calculation parameters and interpolation algorithms for different moving modes, the lag problem in the synchronization process of virtual characters is solved, and a smoother display effect is achieved.
Patent Information
- Application Number
- CN202111617082.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2021-09-07
- Filing Date
- 2021-12-27
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2041-12-27
AI Technical Summary
In large-scale multiplayer online role-playing games, the virtual role synchronization process between clients can easily lead to lag and affect the display effect.
By providing different synchronous calculation parameters for different moving modes, different interpolation algorithms and delay compensation methods are used to ensure smoothness of rendering positions.
Reduce or avoid lag in virtual role display, and improves the smoothness and fluency of the synchronization process.
Smart Images

Figure CN115770389B_ABST
Abstract
Description
[0001] This application claims priority to Chinese patent application No. 202111044497.3 filed on September 7, 2021, entitled “Mobile synchronization method, device, equipment and storage medium for virtual characters,” the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The embodiments of the present application relate to the field of data synchronization, and in particular to a method, apparatus, device, and storage medium for mobile synchronization of a virtual character. Background Art
[0003] In a Massive Multiplayer Online Role-Playing Game (MMORPG), players can control virtual characters to move around in the virtual world.
[0004] Suppose that in a game, client A controls virtual character A in the virtual world, and client B controls virtual character B in the virtual world. Virtual character A is a non-master virtual character of client B, and client A needs to synchronize the position of virtual character A with client B for display. In related art, client A sends a movement data packet to client B at predetermined intervals. This movement data packet carries the position of virtual character A.
[0005] However, the synchronization process is affected by many factors, and the above synchronization solution may easily cause client B to experience lag when displaying virtual character A. Summary of the Invention
[0006] This application provides a method, apparatus, device, and storage medium for synchronizing the movement of a virtual character. Different synchronization calculation parameters can be used in different movement modes to achieve better display effects when displaying a non-master virtual character on a client. The technical solution is as follows:
[0007] According to one aspect of the present application, a method for synchronizing movement of a virtual character is provided, the method comprising:
[0008] receiving a movement data packet of a first virtual character, the movement data packet including a movement pattern and a logical position of the first virtual character, the logical position being used to indicate a position of the first virtual character in a virtual world;
[0009] determining synchronization calculation parameters corresponding to the movement pattern;
[0010] When the rendering position of the first virtual character does not reach the logical position, performing synchronization calculation on the logical position based on the synchronization calculation parameter to obtain the rendering position of the first virtual character;
[0011] The first virtual character is displayed on a user interface according to the rendering position.
[0012] According to another aspect of the present application, a device for synchronizing movement of a virtual character is provided, the device comprising:
[0013] a receiving module, configured to receive a movement data packet of a first virtual character, wherein the movement data packet includes a movement mode and a logical position of the first virtual character, wherein the logical position is used to indicate a position of the first virtual character in the virtual world;
[0014] a determination module, configured to determine synchronization calculation parameters corresponding to the movement pattern;
[0015] a playback module, configured to perform synchronous calculation on the logical position based on the synchronous calculation parameters to obtain a rendering position of the first virtual character;
[0016] A display module is configured to display the first virtual character on a user interface according to the rendering position.
[0017] According to another aspect of the present application, a computer device is provided, comprising a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set, or an instruction set, and the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by the processor to implement the virtual character movement synchronization method as described above.
[0018] According to another aspect of the present application, a computer-readable storage medium is provided, in which at least one instruction, at least one program, code set or instruction set is stored. The at least one instruction, the at least one program, the code set or instruction set is loaded and executed by the processor to implement the virtual character movement synchronization method as described above.
[0019] The beneficial effects of the technical solution provided by this application include at least:
[0020] By providing different synchronization calculation parameters for different mobile modes and performing synchronous calculation on different types of mobile data packets according to different synchronization calculation parameters, the smoothness of the rendering positions calculated under different mobile modes can be ensured, reducing or avoiding the occurrence of lag. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0022] Figure 1 is a structural block diagram of a computer system provided by an exemplary embodiment of the present application;
[0023] Figure 2 is a flow chart of a method for synchronizing movement of a virtual character provided by an exemplary embodiment of the present application;
[0024] Figure 3 This is a schematic diagram of an interface for synchronizing movement of a virtual character in a walking or running mode, provided by an exemplary embodiment of the present application;
[0025] Figure 4 is a schematic diagram of spline interpolation as an interpolation algorithm provided by an exemplary embodiment of the present application;
[0026] Figure 5 is a flow chart of a method for synchronizing movement of a virtual character provided by an exemplary embodiment of the present application;
[0027] Figure 6 is a schematic diagram of the effect of delay compensation on logic position provided by an exemplary embodiment of the present application;
[0028] Figure 7 This is a schematic diagram of an interface for synchronizing movement of a virtual character in an aerial mode provided by an exemplary embodiment of the present application;
[0029] Figure 8 is a schematic diagram of cubic spline interpolation provided by an exemplary embodiment of the present application;
[0030] Figure 9 This is a schematic diagram of using a matrix to calculate cubic spline interpolation provided by an exemplary embodiment of the present application;
[0031] Figure 10 is a schematic diagram of linear interpolation as an extrapolation method provided by an exemplary embodiment of the present application;
[0032] Figure 11 is a schematic diagram of sweep detection provided by an exemplary embodiment of the present application;
[0033] Figure 12 is a flow chart of a method for synchronizing movement of a virtual character provided by an exemplary embodiment of the present application;
[0034] Figure 13is a flow chart of a method for synchronizing movement of a virtual character provided by an exemplary embodiment of the present application;
[0035] Figure 14 is a configuration diagram of parameters corresponding to a mobile mode provided by an exemplary embodiment of the present application;
[0036] Figure 15 is a structural block diagram of a terminal provided by an exemplary embodiment of the present application;
[0037] Figure 16 It is a structural diagram of a server provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0038] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.
[0039] First, the nouns involved in the embodiments of this application are introduced:
[0040] Massive Multiplayer Online Role-Playing Game (MMORPG): In an MMORPG, each player can assume the role of one or more virtual characters and control their movements and behaviors within a virtual environment. In an MMORPG battle, Player A controls Virtual Character A in the virtual world, while Player B controls Virtual Character B in the virtual world. Player A's client sends movement data packets to Player B's client at predetermined intervals. These movement data packets carry the location of Virtual Character A, which is then displayed on Player B's client.
[0041] A virtual environment is the virtual environment displayed (or provided) when an application is running on a terminal. This virtual environment can be a simulation of the real world, a three-dimensional world that is partially simulated and partially fictional, or a purely fictional three-dimensional world. It can be any of a two-dimensional, a 2.5-dimensional, or a three-dimensional virtual environment. Optionally, this virtual environment is also used for virtual environment battles between at least two virtual characters, and the virtual environment contains virtual resources available to the at least two virtual characters.
[0042] A virtual character refers to an active object in a virtual world. This active object can be a simulated human or an animated character in the virtual world. A virtual character is an individual in the virtual world that independently produces distinct sounds. Optionally, in the embodiments of this application, this includes both master characters and non-master characters. A master character refers to a virtual character controlled by the client where the current user is located. A non-master character refers to a virtual character that appears on the client where the current user is located and is controlled by other users.
[0043] Movement Mode: This refers to the movement mode used by the first avatar in the virtual world. These modes include standing, walking, running, swimming, aerial, art movement, free movement, and path movement. Different movement modes require different synchronization parameters for the corresponding avatar, resulting in different physical calculations, position calculations, and interactions with the environment.
[0044] Standing mode: It is a different movement mode when the first virtual character stands in the virtual world.
[0045] Walking and running mode: a movement mode in which the first virtual character moves in the virtual world in the form of walking or running.
[0046] Swimming mode: a movement mode in which the first virtual character moves in the virtual world in the form of swimming.
[0047] Aerial mode: a movement mode in which the first virtual character moves after jumping into the air in the virtual world.
[0048] Artistic Displacement Mode: This is a motion mode where the first avatar moves in the virtual world according to a preset animation pattern. In this mode, the master client only needs to send an initial movement packet to other clients for position synchronization.
[0049] Free displacement mode: This is a movement mode in which the first virtual character moves in an irregular manner in the virtual world. For example, scenes such as climbing, climbing stairs, and interacting with virtual objects.
[0050] Path displacement mode: a movement mode in which the first virtual character moves along a preset path in the virtual world.
[0051] Figure 1 The following is a block diagram of a computer system according to an exemplary embodiment of the present application: The computer system 100 includes a first terminal 110 , a server 120 , and a second terminal 130 .
[0052] A first terminal 110 has a client 111 installed and running that supports a virtual environment. This client 111 can be a multiplayer online battle program. When the first terminal runs client 111, the user interface of client 111 is displayed on the screen of the first terminal 110. Client 111 can be any of a battle royale shooting game, a virtual reality (VR) application, an augmented reality (AR) program, a three-dimensional map program, a virtual reality game, an augmented reality game, a first-person shooter (FPS), a third-person shooter (TPS), a multiplayer online battle arena (MOBA), or a simulation game (SLG). In this embodiment, a MOBA game is used as an example. The first terminal 110 is used by a first user 112. The first user 112 uses the first terminal 110 to control a first virtual character in the virtual environment to perform activities. The first virtual character can be referred to as the first user 112's main virtual character. The activities of the first virtual character include, but are not limited to, at least one of: moving, jumping, teleporting, releasing skills, adjusting body posture, crawling, walking, running, riding, flying, jumping, driving, picking up, shooting, attacking, and throwing. Illustratively, the first virtual character is a first virtual character, such as a simulated human character or an animated character.
[0053] The second terminal 130 has a client 131 installed and running that supports a virtual environment. The client 131 can be a multiplayer online battle program. When the second terminal 130 runs the client 131, the user interface of the client 131 is displayed on the screen of the second terminal 130. The client can be any of a battle royale shooting game, a VR application, an AR program, a three-dimensional map program, a virtual reality game, an augmented reality game, an FPS, a TPS, a MOBA, and a SLG. In this embodiment, the client is a MOBA game as an example. The second terminal 130 is the terminal used by the second user 113. The second user 113 uses the second terminal 130 to control a second virtual character in the virtual environment to perform activities. The second virtual character can be referred to as the master virtual character of the second user 113. Schematically, the second virtual character is a second virtual character, such as a simulated human character or an anime character.
[0054] Optionally, the first virtual character and the second virtual character are in the same virtual environment. Optionally, the first virtual character and the second virtual character may belong to the same camp, the same team, the same organization, have a friendship relationship, or have temporary communication permissions. Optionally, the first virtual character and the second virtual character may belong to different camps, different teams, different organizations, or have a hostile relationship.
[0055] Optionally, the client installed on the first terminal 110 and the second terminal 130 is the same, or the client installed on the two terminals is the same type of client on different operating system platforms (Android or iOS). The first terminal 110 can generally refer to one of multiple terminals, and the second terminal 130 can generally refer to another of the multiple terminals. This embodiment only uses the first terminal 110 and the second terminal 130 as an example. The first terminal 110 and the second terminal 130 can be of the same or different device types, including at least one of a smartphone, a tablet computer, an e-book reader, an MP3 player, an MP4 player, a laptop computer, and a desktop computer.
[0056] Figure 1 Only two terminals are shown, but in different embodiments, multiple other terminals 140 can access the server 120. Optionally, one or more terminals 140 are terminals corresponding to developers. A development and editing platform for a client that supports a virtual environment is installed on the terminal 140. The developer can edit and update the client on the terminal 140 and transmit the updated client installation package to the server 120 via a wired or wireless network. The first terminal 110 and the second terminal 130 can download the client installation package from the server 120 to update the client.
[0057] The first terminal 110 , the second terminal 130 , and the other terminals 140 are connected to the server 120 via a wireless network or a wired network.
[0058] Server 120 includes at least one of a single server, multiple servers, a cloud computing platform, and a virtualization center. Server 120 provides backend services for clients supporting a 3D virtual environment. Optionally, server 120 performs primary computing tasks, while the client performs secondary computing tasks; alternatively, server 120 performs secondary computing tasks, while the client performs primary computing tasks; alternatively, server 120 and the client utilize a distributed computing architecture for collaborative computing.
[0059] In an illustrative example, the server 120 includes a processor 122, a user account database 123, a battle service module 124, and a user-facing input / output interface (I / O interface) 125. The processor 122 is configured to load instructions stored in the server 121 and process data in the user account database 123 and the battle service module 124. The user account database 123 is configured to store user account data used by the first terminal 110, the second terminal 130, and other terminals 140, such as user account avatars, user account nicknames, user account combat power indexes, and the service areas where the user accounts are located. The battle service module 124 is configured to provide multiple battle rooms for users to engage in battles, such as 1v1 battles, 3v3 battles, 5v5 battles, etc. The user-facing I / O interface 125 is configured to establish communication and exchange data with the first terminal 110 and / or the second terminal 130 via a wireless network or a wired network.
[0060] Figure 2 A flowchart of a method for synchronizing the movement of a virtual character provided by an exemplary embodiment of the present application is shown. Figure 1 The terminal 120 or the terminal 140 shown is executed, and the method includes the following steps:
[0061] Step 202: receiving a movement data packet of a first virtual character, the movement data packet including a movement mode and a logical position of the first virtual character, the logical position being used to indicate the position of the first virtual character in the virtual world;
[0062] The mobile data packet is a data packet that carries the synchronization data information of the first virtual character. When the first virtual character is controlled by the first client, the mobile data packet is sent by the first client to the second client. The first client is the client that controls the first virtual character, and the second client is the client that controls the second virtual character. For the second client, the first virtual character is a non-master virtual character, that is, a virtual character that cannot be controlled by the second client. The second client needs to receive the mobile data packet from the first client in order to synchronously display the real-time position of the first virtual character in the virtual world. When the first virtual character is a neutral virtual character, the mobile data packet is sent by the server to the second client.
[0063] Exemplarily, the movement data packet includes: a movement pattern and a logical position of the first virtual character.
[0064] The movement mode is the mode in which the first avatar moves in the virtual world. Exemplarily, the movement modes include standing mode, walking / running mode, swimming mode, aerial mode, art displacement mode, free displacement mode, and path movement mode. Different actions performed by the first avatar in the virtual environment are associated with corresponding movement modes. For example, jumping and mid-air falling by the first avatar belong to the aerial mode, rolling, sliding, and vaulting belong to the art displacement mode, climbing ladders belong to the free displacement mode, and monster patrols belong to the path movement mode.
[0065] The logical position is used to indicate the position of the first virtual character in the virtual world. For example, in the virtual environment, when the second virtual character performs a shooting operation on the first virtual character, the shooting decision needs to be made based on the logical position of the first virtual character.
[0066] Taking the first virtual character controlled by the first client as an example, the first virtual character moves in the virtual environment. The first client generates a movement data packet according to the movement pattern and logical position of the first virtual character, and sends the movement data packet to the second client through the server.
[0067] The first client sends a mobile data packet to the second client at a preset synchronization frequency. Different mobile modes correspond to the same or different synchronization frequencies. Optionally, the first client also sends a mobile data packet to the second client when a trigger condition is met, the trigger condition including but not limited to: the mobile mode is switched, the change in the current logical position compared to the logical position at the last synchronization reaches a first threshold, the change in the current moving speed compared to the moving speed at the last synchronization reaches a second threshold, and the change in the current moving direction compared to the moving direction at the last synchronization reaches a third threshold.
[0068] Step 204: Determine synchronization calculation parameters corresponding to the movement mode;
[0069] Pre-configure corresponding synchronization calculation parameters for different mobile modes. The second client stores different synchronization calculation parameters corresponding to different mobile modes. The synchronization calculation parameters under each mobile mode include at least one of the following:
[0070] Whether the current mobile mode is configured with delay compensation;
[0071] Delay compensation means that when the second client receives a mobile packet, it lags behind the server by half a round-trip time (RTT) when it forwards the packet. Therefore, this half RTT must be accounted for to estimate the first avatar's latest logical position. This compensated position is then used as the logical position to catch up. The RTT value can be estimated using the timing protocol.
[0072] Whether the current mobile mode is configured with pre-performance;
[0073] Pre-performance means that the actions of the first virtual character can be displayed in advance without the server sending a movement data packet or a confirmation instruction.
[0074] The interpolation algorithm for the current movement mode;
[0075] An interpolation algorithm is used to interpolate the current rendering position to the logical position when the current rendering position of the first virtual character does not reach the logical position in the movement data packet.
[0076] The extrapolation algorithm for the current movement mode.
[0077] When the current rendering position of the first virtual character reaches the logical position in the most recent movement data packet and no subsequent movement data packet has been received, an interpolation algorithm is used to interpolate and predict the current rendering position forward according to the current movement direction.
[0078] The client determines synchronization calculation parameters corresponding to the movement mode according to the movement mode carried in the received movement data packet.
[0079] For example, when the second client receives a mobile data packet carrying "walking and running mode" from the first client, spline interpolation is determined as the interpolation algorithm of the walking and running mode, and linear interpolation is determined as the external interpolation algorithm and orientation interpolation algorithm of the walking and running mode.
[0080] Step 206: performing synchronous calculation on the logical position based on the synchronous calculation parameters to obtain a rendering position of the first virtual character;
[0081] The rendering position is the position of the first virtual character displayed in the user interface. Exemplarily, to determine the rendering position of the first virtual character in a certain movement mode, the method described in step 206 is repeated.
[0082] Illustratively, if the current rendering position of the first virtual character has not yet reached the logical position, the current rendering position is continuously moved closer to the logical position based on the synchronization calculation parameters corresponding to the determined movement pattern of the first virtual character, thereby obtaining the first rendering position, second rendering position, third rendering position, and so on, corresponding to the movement pattern, thereby forming a visible movement trajectory path of the first virtual character on the user interface, and displaying the first virtual character at each rendering position on the user interface. Optionally, the current rendering position is the last rendering position of the first virtual character that has been calculated.
[0083] Optionally, when the current rendering position of the first virtual character does not reach the logical position and the logical position is reachable, the subsequent rendering position of the first virtual character is calculated according to an interpolation algorithm corresponding to the movement mode.
[0084] Exemplary references Figure 3 The second client displays a user interface 30, which includes a first virtual character 31 and a second virtual character 32, as well as a logical position 33 and a rendering position (indicated by an arrow) 34 corresponding to a certain moment of the first virtual character 31 walking or running. When the first virtual character's rendering position 34 does not reach the logical position 33, the spline interpolation algorithm corresponding to the walking or running mode is used as the interpolation algorithm to continuously interpolate from the current rendering position to the logical position. This process is repeated continuously, resulting in user interface 30 displaying the position trajectory of the first virtual character during the walking or running.
[0085] Exemplary references Figure 4 A world coordinate system is established with the ground in the virtual environment as the reference plane and the current rendering position of the first virtual character as the center. A rectangular icon 42a represents the current rendering position of the first virtual character, and a circular icon 41a represents the logical position of the first virtual character in the movement data packet. When the current rendering position 42a of the first virtual character has not reached the logical position 41a, the spline interpolation algorithm corresponding to the walking and running mode is used as the interpolation algorithm to interpolate from the current rendering position 42a to the logical position 41a, resulting in a first rendering position 42b, a second rendering position 42c, and a third rendering position 42d, forming the movement trajectory of the first virtual character visible on the user interface. When the next movement data packet carries the logical position 41b, a new interpolation algorithm is executed toward the logical position 41b, resulting in a fourth rendering position 42e, a fifth rendering position 42f, and a sixth rendering position 42g, forming the movement trajectory visible on the user interface. This process repeats when a new movement data packet is received.
[0086] For example, there are at least two movement modes with different interpolation algorithms, so each movement mode can use its own more suitable interpolation algorithm to calculate a smoother rendering position, presenting a smoother motion trajectory display on the user interface.
[0087] Step 208: Display the first virtual character on the user interface according to the rendering position.
[0088] Since the logical position is continuously updated synchronously, the rendering position of the first virtual character is also continuously updated.
[0089] For example, Figure 3 As shown, the current rendering position of the first virtual character 31 is indicated by arrow 34. Based on the logical position 33 carried in the mobile data packet, a synchronization calculation is performed from the current rendering position 34 to the logical position 33, and the resulting arrow 35 is the next rendering position. The client of the second virtual character displays the first virtual character on the user interface based on the next rendering position 35.
[0090] To sum up, the method provided in this embodiment provides different synchronization calculation parameters for different mobile modes, and performs synchronization calculation on different types of mobile data packets according to different synchronization calculation parameters, thereby ensuring the smoothness of the rendering positions calculated under different mobile modes and reducing or avoiding the occurrence of lag.
[0091] Figure 5 A flowchart of a method for synchronizing the movement of a virtual character provided by an exemplary embodiment of the present application is shown. Figure 1 The terminal 120 or the terminal 140 shown is executed, and the method includes the following steps:
[0092] Step 502: receiving a movement data packet of a first virtual character, the movement data packet including a movement mode and a logical position of the first virtual character, the logical position being used to indicate the position of the first virtual character in the virtual world;
[0093] Refer to step 202 and no further details will be given.
[0094] Optionally, the mobile data packet further carries at least one of: a synchronization timestamp, a current moving speed, a current moving direction, and a current facing direction. The current moving direction and the current facing direction are usually the same, but may be different.
[0095] Step 504: Determine synchronization calculation parameters corresponding to the movement mode, the synchronization calculation parameters including: delay compensation parameters, pre-rendering parameters, interpolation algorithm, and extrapolation algorithm;
[0096] The client determines synchronization calculation parameters corresponding to the movement mode according to the movement mode carried in the received movement data packet.
[0097] Pre-configure corresponding synchronization calculation parameters for different mobile modes. The second client stores different synchronization calculation parameters corresponding to different mobile modes. The synchronization calculation parameters under each mobile mode include at least one of the following:
[0098] Synchronization frequency;
[0099] The synchronization frequency refers to the number of mobile data packets sent by the first client per second in the current mobile mode. For example, in standing mode, at least 1 mobile data packet is sent per second, and in air mode, at least 6 mobile data packets are sent per second.
[0100] Whether the current mobile mode is configured with delay compensation;
[0101] Delay compensation means that when the second client receives a mobile packet, it lags behind the server by half a round-trip time (RTT) when it forwards the packet. Therefore, this half RTT must be accounted for to estimate the first avatar's latest logical position. This compensated position is then used as the logical position to catch up. The RTT value can be estimated using the timing protocol.
[0102] Whether the current mobile mode is configured with pre-performance;
[0103] Pre-performance means that the actions of the first virtual character can be displayed in advance without the server sending a movement data packet or a confirmation instruction.
[0104] The interpolation algorithm for the current movement mode;
[0105] An interpolation algorithm is used to interpolate the current rendering position to the logical position when the current rendering position of the first virtual character does not reach the logical position in the movement data packet.
[0106] Exemplarily, when the movement mode is the standing mode, the interpolation algorithm corresponding to the standing mode is determined to be the linear interpolation algorithm; when the movement mode is the walking and running mode, the interpolation algorithm corresponding to the walking and running mode is determined to be the spline interpolation algorithm; when the movement mode is the swimming mode, the interpolation algorithm corresponding to the swimming mode is determined to be the spline interpolation algorithm; when the movement mode is the aerial mode, the interpolation algorithm corresponding to the aerial mode is determined to be the cubic spline interpolation algorithm; when the movement mode is the art displacement mode, the interpolation algorithm corresponding to the art displacement mode is determined to be the custom curve algorithm; when the movement mode is the free displacement mode, the interpolation algorithm corresponding to the free displacement mode is determined to be the linear interpolation algorithm; when the movement mode is the path movement mode, the interpolation algorithm corresponding to the path movement mode is determined to be the linear interpolation algorithm.
[0107] The extrapolation algorithm for the current movement mode;
[0108] Exemplarily, when the current rendering position of the first virtual character reaches the logical position in the most recent movement data packet and no subsequent movement data packet has been received, the interpolation algorithm interpolates and predicts the current rendering position forward according to the current movement direction. When the movement mode is the standing mode, the interpolation algorithm corresponding to the standing mode is determined to be the linear interpolation algorithm; when the movement mode is the walking and running mode, the interpolation algorithm corresponding to the walking and running mode is determined to be the spline interpolation algorithm; when the movement mode is the swimming mode, the interpolation algorithm corresponding to the swimming mode is determined to be the spline interpolation algorithm; when the movement mode is the aerial mode, the interpolation algorithm corresponding to the aerial mode is determined to be the linear interpolation algorithm; when the movement mode is the art displacement mode, the interpolation algorithm corresponding to the art displacement mode is determined to be the custom curve algorithm; when the movement mode is the free displacement mode, the interpolation algorithm corresponding to the free displacement mode is determined to be the linear interpolation algorithm; when the movement mode is the path movement mode, the interpolation algorithm corresponding to the path movement mode is determined to be the linear interpolation algorithm.
[0109] The orientation interpolation algorithm for the current movement mode;
[0110] The orientation interpolation refers to an interpolation algorithm for the facing direction of the first virtual character.
[0111] Physical inspection.
[0112] In the process of predicting the rendering position based on the extrapolation algorithm, the second client performs ray detection or collision detection in the virtual world to correct the erroneous rendering position.
[0113] The client determines synchronization calculation parameters corresponding to the movement mode according to the movement mode carried in the received movement data packet.
[0114] Exemplary references Figure 14 When the second client receives a mobile data packet carrying a walking and running mode from the first client, it is determined that the walking and running mode has the characteristics of pre-expression and delay compensation, and the interpolation algorithm corresponding to the walking and running mode is the cubic spline interpolation algorithm, and the extrapolation algorithm is the linear interpolation algorithm.
[0115] Step 506: When the mobility mode is configured with delay compensation, the logical position is compensated based on the RTT time to obtain a compensated logical position;
[0116] Delay compensation means that the second client receives a mobile data packet that lags behind the server by half a round-trip time (RTT), so the second client needs to compensate for the half RTT time that lags behind, and interpolate the logical position after delay compensation as the logical position of the first virtual character. For example, the distance corresponding to the lag of half an RTT can be estimated by multiplying the current moving speed v of the first virtual character by half the RTT time. That is, the compensated logical position is equal to the sum of the logical position and the compensation distance. The compensation distance is equal to the product of the moving speed v and half the RTT time. The compensation direction is the current moving direction of the first virtual character.
[0117] Schematic reference Figure 6 Using the ground in the virtual environment as the reference plane, rectangular icon 42a represents the current rendering position of the first avatar, circular icon 41c represents the logical position of the first avatar as received by the second client, and the distance of compensation path 43 is estimated by multiplying the first avatar's current speed by half the RTT time t. The compensation direction is estimated based on the first avatar's current movement direction, and circular icon 41d represents the logical position after delay compensation. Therefore, interpolation from current rendering position 42a to compensated logical position 41d yields first rendering position 42b and second rendering position 42c, which are the movement paths displayed in the user interface.
[0118] Illustratively, when the mobile mode is not configured with delay compensation, no delay compensation is required, and step 508 is executed.
[0119] Step 508: Determine whether the current rendering position of the first virtual character reaches the (compensated) logical position;
[0120] The rendering position is the position of the first virtual character displayed in the user interface. The rendering position is determined based on the logical position. There may be differences between the rendering position and the logical position, and they are not necessarily exactly the same. Exemplarily, when the current rendering position of the first virtual character has not reached the logical position, the current rendering position is continuously moved closer to the logical position according to the synchronization calculation parameters corresponding to the determined movement mode of the first virtual character, and the first rendering position, second rendering position, third rendering position, etc. corresponding to the movement mode are obtained, thereby forming a movement trajectory path of the first virtual character visible on the user interface.
[0121] The client obtains the logical position (or the compensated logical position) of the first virtual character based on the received mobile data packet, and determines whether the current rendering position of the first virtual character has reached the logical position (or the compensated logical position). If the current rendering position of the first virtual character has not reached the logical position, step 512 is executed; if the current rendering position of the first virtual character has reached the logical position, step 510 is executed.
[0122] Step 510: Calculating the next rendering position of the first virtual character based on an interpolation algorithm corresponding to the movement mode, where the interpolation algorithm is an algorithm that interpolates the current rendering position to a logical position;
[0123] When the current rendering position of the first virtual character has not reached the logical position and the logical position is reachable, the next rendering position (or subsequent rendering position) of the first virtual character is calculated according to an interpolation algorithm corresponding to the movement mode. Exemplarily, the interpolation algorithm is to interpolate from the current rendering position to the logical position based on the known current rendering position and the logical position to obtain the next rendering position, thereby obtaining a series of approximate values that approximate the logical position, thereby obtaining a movement trajectory in which the current rendering position continuously approaches the logical position.
[0124] For example, Figure 7 As shown, the user interface 30 includes a first virtual character 31, a second virtual character 32, and a logical position 33 and a current rendering position 34 corresponding to a certain moment of the first virtual character's jump. At this time, the first virtual character is in aerial mode. When the current rendering position 34 of the first virtual character has not reached the logical position 33, the interpolation algorithm corresponding to the aerial mode is used to continuously interpolate from the current rendering position to the logical position. This process is repeated continuously to obtain the position trajectory of the first virtual character's jump displayed on the user interface 30.
[0125] The interpolation method used in the air mode is the cubic spline interpolation algorithm. The cubic spline interpolation curve is a cubic polynomial and second-order differentiable, so the position and speed changes based on the cubic spline interpolation curve are relatively smooth. Figure 8 , taking the ground in the virtual environment as the reference plane, assuming the starting time is 0, the position, velocity, and acceleration of the logical position 41 are p0, v0, and a respectively; the position and velocity of the rendering position 42 are p1 and v1 respectively. Given the interpolation time T, the position and velocity of the confluence position 44 of the logical position and the rendering position can be estimated to be p2 and v2 respectively. The curve between the rendering position 42 and the confluence position 44 is the cubic spline interpolation curve p(t) = at 3 +bt 2 +ct+d, the cubic spline interpolation curve is also the movement trajectory of the first virtual character displayed on the user interface. Figure 9 According to the rendering position 42, the rendering position 42 speed, the confluence position 44, and the confluence position 44 speed, we list the equations and use the matrix to solve the coefficients a, b, c, and d of the cubic spline interpolation curve, and then get our cubic spline interpolation curve equation.
[0126] Step 512: Displaying the first virtual character on the user interface according to the next rendering position;
[0127] The second client displays the first virtual character on the user interface based on the next rendering position of the first virtual character calculated by the interpolation algorithm. The next rendering position refers to the next position of the first virtual character displayed on the user interface calculated by the interpolation algorithm corresponding to the movement mode if the rendering position of the first virtual character has not reached the logical position.
[0128] Since the logical position is constantly updated, the next rendering position is obtained by interpolating the current rendering position to the logical position, and the next rendering position is also constantly updated.
[0129] When the current rendering position of the first virtual character has reached the logical position, step 514 is executed.
[0130] Step 514: Determine whether the movement mode of the first virtual character is configured with a pre-performance;
[0131] Pre-rendering parameters allow the second client to execute predictive movement even if it has not yet received the latest movement data packet from the server. A movement mode with pre-rendering characteristics allows the second client to continue moving forward predictively based on the current movement mode even if the first avatar's current rendering position has reached its logical location but no new movement data packet has been received.
[0132] When the current rendering position of the first avatar has reached the logical position, it is necessary to determine whether the movement mode of the first avatar is configured with a pre-rendering. If the movement mode of the first avatar requires a pre-rendering, step 516 is executed; if the movement mode of the first avatar does not require a pre-rendering, step 522 is executed.
[0133] Step 516: Determine whether the current rendering position reaches the predicted limit position;
[0134] The predicted limit position refers to the limit of further forward movement that can be achieved during the pre-rendering process based on the current movement mode and movement speed. For example, the predicted limit position can be limited in time or distance. If the movement mode of the first avatar is configured with a pre-rendering feature and the current rendering position has reached the predicted limit position, the prediction execution needs to be stopped.
[0135] If the current rendering position of the first avatar has reached the logical position and the movement pattern of the first avatar requires pre-rendering, it is determined whether the current rendering position has reached the predicted limit position. If the current rendering position has not reached the predicted limit position, step 518 is executed; if the current rendering position has reached the predicted limit position, step 522 is executed.
[0136] Step 518: Calculate the next rendering position of the first virtual character based on an extrapolation algorithm corresponding to the movement mode, where the extrapolation algorithm is an algorithm that interpolates the rendering position along the current movement direction;
[0137] When the current rendering position of the first virtual character has reached the logical position and the next logical position has not been received, the next rendering position of the first virtual character is calculated according to an extrapolation algorithm corresponding to the movement mode. Exemplarily, the extrapolation algorithm is an algorithm that interpolates the current rendering position according to the current movement mode and the current movement speed along the current movement direction.
[0138] Schematic reference Figure 10 The first virtual character's current movement mode is walking and running. A world coordinate system is established with the ground in the virtual environment as the reference plane and the first virtual character's current rendering position as the center. A rectangular icon 42d represents the first virtual character's current rendering position, and a circular icon 41d represents the first virtual character's logical position. When the first virtual character's current rendering position 42d has reached logical position 41d but no new logical position has been received, linear interpolation corresponding to the walking and running mode is used as an extrapolation algorithm. Current rendering position 42d is interpolated forward in the current movement direction based on the current walking and running mode and the single-sign movement speed, resulting in first rendering position 42e, second rendering position 42f, and third rendering position 42g. The predicted movement trajectory is then displayed on the user interface.
[0139] In some embodiments, when the rendering position of the first avatar has reached a logical position, the next logical position has not been received, the current movement mode is configured with a pre-rendering, and the current rendering position has not reached the predicted limit position, the next rendering position of the first avatar is calculated using an extrapolation algorithm corresponding to the current movement mode. Exemplarily, the extrapolation algorithm is an algorithm that interpolates the rendering position along the current movement direction based on the current movement mode and movement speed.
[0140] In some embodiments, when there is an obstacle before the next rendering position predicted by the extrapolation algorithm, the sweep detection can detect that the next rendering position is unreachable, and the next rendering position is corrected, and the position of the next rendering position before the correction is determined at the obstacle as the corrected rendering position.
[0141] Schematic reference Figure 11 The current movement mode of the first virtual character is walking and running mode. The ground in the virtual environment is used as the reference plane. When the sweep detection 45a is turned on for the rendering position 41, it is detected that there is an obstacle wall 46 before the next rendering position 41h predicted by the extrapolation algorithm. According to the sweep detection 45b, it is detected that the position 41m is reachable, and the position 41m is used as the corrected next rendering position.
[0142] Step 520: Displaying the first virtual character on the user interface according to the next rendering position;
[0143] The second client calculates the next rendering position of the first virtual character according to the extrapolation algorithm, and displays the first virtual character on the user interface based on the next rendering position.
[0144] Step 522: End the playback of the current mobile data packet.
[0145] In some embodiments, after the second client displays the first virtual character on the user interface according to the next rendering position, the playback of the current mobile data packet ends.
[0146] In some embodiments, when the rendering position of the first virtual character has reached the logical position, the next logical position has not been received, the movement mode is configured with a pre-rendering, and the rendering position has reached the predicted limit position, the playback of the current movement data packet is terminated.
[0147] In some embodiments, the rendering position of the first virtual character has reached the logical position, the next logical position has not been received, and the movement mode is not configured with pre-rendering, and the playback of the current movement data packet is ended.
[0148] When the next mobile data packet is received or the next mobile data packet that has not been played is buffered, the process is circulated again starting from step 502 .
[0149] To sum up, the method provided in this embodiment provides different synchronization calculation parameters for different mobile modes, and performs synchronization calculation on different types of mobile data packets according to different synchronization calculation parameters, thereby ensuring the smoothness of the rendering positions calculated under different mobile modes and reducing or avoiding the occurrence of lag.
[0150] The method provided in this embodiment also determines whether the rendering position of the first virtual character reaches the logical position, and interpolates the position of the first virtual character according to the interpolation and extrapolation algorithms corresponding to the movement mode. Different interpolation methods are selected according to different situations corresponding to different movement modes, thereby improving the accuracy of the virtual character movement synchronization.
[0151] The method provided in this embodiment also determines whether the mobile mode is configured with delay compensation, compensates the logical position according to the RTT time, and interpolates the position after delay compensation as the logical position of the first virtual character, thereby avoiding the error influence of the RTT time on the logical position, and making the screen synchronization of the first virtual character displayed by the first client and the second client stronger.
[0152] The method provided in this embodiment also determines whether the movement mode is configured with pre-performance, so that when the rendering position of the first virtual character has reached the logical position and the next logical position has not been received, or the movement mode is configured with pre-performance and the rendering position has not reached the predicted limit position, the next rendering position of the first virtual character is calculated according to the interpolation algorithm corresponding to the current movement mode, thereby avoiding the phenomenon that the rendering is stopped before the next logical position is received due to network jitter, resulting in unsmooth and discontinuous movement of the virtual character.
[0153] The following combination Figure 12 and Figure 13 The second client is provided with a play queue for caching mobile data packets. Figure 12 The process of storing the received mobile data packets into the play queue is shown. Figure 13 It shows the process of removing mobile data packets from the play queue.
[0154] Schematic reference Figure 14 For different mobility modes, the synchronization calculation parameters can be configured, and the synchronization calculation parameters include: synchronization frequency, pre-performance, interpolation, extrapolation, orientation interpolation, delay compensation, physical detection and server verification.
[0155] The synchronization frequency refers to the number of synchronization data packets sent by the first client per second. The basic synchronization frequency of the corresponding movement mode is determined based on the movement mode carried by the received synchronization data packet. For example, when the first virtual character is in a walking or running mode, the basic synchronization frequency is 2 frame rates. When the first virtual character is moving in a straight line at a constant speed, the basic synchronization frequency is used to receive synchronization data packets, and synchronization calculation parameters are performed at a speed of two synchronization data packets per second; when the first virtual character is performing a walking or running movement with variable speed or turning, the synchronization frequency will be increased.
[0156] The synchronization frequency is related to the movement mode's speed and the degree of position change. For example, the standing mode, art displacement mode, and path movement mode correspond to slow and steady movement, corresponding to a synchronization frequency of 1 frame rate; the walking, running, swimming, and free movement modes have relatively small speed changes, corresponding to a synchronization rate of 2 frames rate; the aerial mode, including jumping and falling, has fast speed changes and an arc-shaped movement path, corresponding to a synchronization frequency of 6 frames rate.
[0157] The first client will send synchronization data packets to the second client at the basic synchronization frequency. Optionally, when certain indicators of the movement mode change cumulatively reach a certain threshold, the client will also be triggered to send synchronization data packets. For example, for walking and running mode, when the speed change or direction change of the first virtual character cumulatively reaches a certain threshold, the first client will be triggered to send the current movement data packet.
[0158] Physical detection on the second virtual character client refers to ray detection and collision detection in the physical world after receiving the movement data packet to correct the logical position. For example, the path movement mode refers to the synchronization method of the monster virtual character's movement path sent by the server to the client. The server and client move according to the path movement mode, which can reduce the synchronization frequency with the monster virtual character. However, the accuracy of the virtual world on the server and client is different, and there will be different terrain fluctuations between the rendering positions, requiring the second client to correct the logical position to the ground.
[0159] In some embodiments, the first virtual character is in aerial mode. When there is an obstacle in front of the next logical position predicted by the interpolation algorithm, the sweep detection can detect that the next logical position is unreachable. In this case, the logical position is corrected, and the position of the next logical position before correction at the obstacle is used as the corrected logical position. The interpolation algorithm is continued to be used to calculate the next rendering position of the first virtual character.
[0160] The server verification includes checking whether the virtual character's position has changed, as well as at least one of movement accessibility, speed, and frequency, and detecting according to a custom curve. For example, when the first virtual character is in a free movement mode, where the free movement mode includes at least one of climbing a ladder, climbing, and object interaction, the server verification only checks speed and whether the current virtual environment allows free movement.
[0161] Figure 12 A flowchart of a method for synchronizing the movement of a virtual character provided by an exemplary embodiment of the present application is shown. Figure 1 The terminal 120 or the terminal 140 shown is executed, and the method includes the following steps:
[0162] Exemplarily, the second client includes a receiving module for receiving mobile data packets and a playing module for playing mobile data packets. The receiving module executes steps 1202 to 1224, and the playing module executes steps 1224 to 1254.
[0163] Step 1202: Determine whether a new mobile data packet is received;
[0164] The receiving module determines whether a new mobile data packet from the first client is received. If a new mobile data packet is received, step 1204 is executed; if no mobile data packet is received, step 1224 is executed.
[0165] A mobility data packet carries the mobility mode and logical location. Optionally, the mobility data packet also carries at least one of a synchronization timestamp, current speed, current direction, current facing direction, whether it is a correction data packet, and whether it is a critical data packet. The current direction and current facing direction are typically the same, but may be different.
[0166] Step 1204: Determine whether the mobile packet data is a correction data packet;
[0167] A correction packet is a packet sent by the server to the receiving module when the server discovers an error in the logical position reported by the first client. This correction packet is used to adjust the logical position back to the corrected position. The receiving module determines whether the received movement packet is a correction packet. If the movement packet is a correction packet, step 1206 is executed; otherwise, step 1210 is executed.
[0168] Step 1206: Clear the play queue of the mobile data packet;
[0169] Once the receiving module identifies that the received new mobile data packet is a correction data packet, it will clear the mobile data packets currently stored in the play queue and give priority to playing the current correction data packet.
[0170] Step 1208: Pull the logical position back to the corrected position according to the correction data packet;
[0171] The receiving module will pull the current logical position back to the corrected position according to the corrected position carried in the correction data packet to avoid errors in the rendering position on the user interface.
[0172] Step 1210: Determine whether the mobile data packet is configured with delay compensation;
[0173] Delay compensation means that when the receiving module receives a mobile data packet, it lags behind the server by half a round-trip time (RTT). Therefore, the receiving module needs to compensate for the half RTT lag and use the compensated logical position as the logical position of the first virtual character. For example, the compensated path corresponding to the half RTT lag can be estimated by multiplying the current movement speed v of the first virtual character by half the RTT time t.
[0174] If the receiving module determines that the received mobile data packet is not a correction data packet, it determines whether the mobile mode carried in the mobile data packet is configured with delay compensation. If the mobile mode is configured with delay compensation, step 1212 is executed; if the mobile mode is not configured with delay compensation, step 1214 is executed.
[0175] Step 1212: Correct the logical position using delay compensation to obtain a compensated logical position;
[0176] If the receiving module determines that the mobility pattern carried by the mobile data packet is configured with delay compensation, it is necessary to compensate for the delay of half a RTT and use the compensated position as the logical position of the first avatar for interpolation. For example, the compensated path corresponding to the delay of half a RTT can be estimated by multiplying the current movement speed v of the first avatar by the half RTT time t.
[0177] Step 1214: Determine whether the mobile data packet is the same as the current mobile mode;
[0178] The receiving module determines whether the mobility mode carried by the mobile data packet is the same as the current mobility mode of the receiving module (i.e., the mobility mode of the previous mobile data packet). If the mobility mode carried by the mobile data packet is the same as the current mobility mode, step 1218 is executed; if the mobility mode carried by the mobile data packet is different from the current mobility mode, step 1216 is executed.
[0179] Step 1216: Switch to a new movement mode;
[0180] In a case where the mobility mode carried by the mobility data packet is different from the current mobility mode, the mobility mode of the receiving module is switched to the mobility mode carried by the mobility data packet.
[0181] Step 1218: Determine whether the mobile data packet is a key packet;
[0182] The logical location carried by the key package is the logical location that the virtual character will inevitably pass through when moving in the virtual environment.
[0183] The receiving module determines whether the received mobile data packet is a key packet. If the received mobile data packet is a key packet, step 1222 is executed; if the received mobile data packet is not a key packet, step 1220 is executed.
[0184] Step 1220: Merge consecutive non-critical packets;
[0185] When the mobile data packet received by the receiving module is not a critical packet, the continuous non-critical packets in the play queue are merged. Exemplarily, merging continuous non-critical packets means replacing the previous non-critical packet in the play queue with the newly received non-critical packet.
[0186] Step 1222: Add the mobile data packet to the play queue;
[0187] The mobile data packets that are key packets are added to the play queue for caching. The play module will play the mobile data packets in sequence according to the order in which the mobile data packets in the play queue are arranged.
[0188] Step 1224: Play the mobile data packet;
[0189] The play module plays the mobile data packets in the play queue. Figure 13 The specific playback process is as follows:
[0190] Step 1226: Determine whether there is a mobile data packet being played;
[0191] The playing module determines whether there is a mobile data packet being played currently. If there is a mobile data packet being played currently, step 1236 is executed; if there is no mobile data packet being played currently, step 1228 is executed.
[0192] Step 1228: Determine whether there is a mobile data packet in the play queue;
[0193] When there is no mobile data packet currently being played, the playing module will determine whether there is a mobile data packet in the playing queue. If there is a mobile data packet in the current playing queue, step 1230 is executed; if there is no mobile data packet in the current playing queue, step 1252 is executed.
[0194] Step 1230: Take a mobile data packet from the play queue as the current mobile data packet;
[0195] In the case that there is no mobile data packet currently being played and there is a mobile data packet in the play queue, a mobile data packet is taken out from the play queue as the current mobile data packet.
[0196] Step 1232: Determine whether the mobile data packet is the same as the current mobile mode;
[0197] The playback module determines whether the mobile mode carried in the mobile data packet is the same as the current mobile mode of the receiving module (i.e., the mobile mode of the previous mobile data packet). If the mobile mode carried in the mobile data packet is the same as the current mobile mode, step 1236 is executed; if the mobile mode carried in the mobile data packet is different from the current mobile mode, step 1234 is executed.
[0198] Step 1234: Switching the mobile mode;
[0199] In a case where the mobile mode carried in the mobile data packet is different from the current mobile mode, the playing module switches the received mobile mode to the mobile mode carried in the mobile data packet.
[0200] Step 1236: Play the current mobile data packet;
[0201] The playback module starts playing the current mobile data packet.
[0202] Step 1238: Determine whether the current rendering position reaches the logical position;
[0203] The rendering position is the position of the first virtual character displayed in the user interface. The rendering position is determined based on the logical position. There may be differences between the rendering position and the logical position, and they are not necessarily exactly the same. Exemplarily, when the current rendering position of the first virtual character has not reached the logical position, the current rendering position is continuously moved closer to the logical position according to the synchronization calculation parameters corresponding to the determined movement mode of the first virtual character, and the first rendering position, second rendering position, third rendering position, etc. corresponding to the movement mode are obtained, thereby forming a movement trajectory path of the first virtual character visible on the user interface.
[0204] The second client obtains the logical position (or the compensated logical position) of the first virtual character based on the received mobile data packet, and determines whether the current rendering position of the first virtual character has reached the logical position (or the compensated logical position). If the current rendering position of the first virtual character has not reached the logical position, step 1240 is executed; if the current rendering position of the first virtual character has reached the logical position, step 1242 is executed.
[0205] Step 1240: Calculate the moving speed and moving direction using an interpolation algorithm, and then calculate the next rendering position;
[0206] When the current rendering position of the first virtual character has not reached the logical position and the logical position is reachable, the next rendering position (or subsequent rendering position) of the first virtual character is calculated according to the interpolation algorithm corresponding to the movement mode. Exemplarily, the interpolation algorithm refers to interpolating the next rendering position, the movement speed, and the movement direction from the current rendering position to the logical position based on the known current rendering position and the logical position, thereby obtaining a series of approximate values close to the logical position, thereby obtaining a movement trajectory in which the current rendering position continuously approaches the logical position.
[0207] Step 1242: Determine whether the mobile mode is configured with a pre-performance;
[0208] Pre-rendering parameters allow the second client to execute predictive movement even if it has not yet received the latest movement data packet from the server. A movement mode with pre-rendering characteristics allows the second client to continue moving forward predictively based on the current movement mode even if the first avatar's current rendering position has reached its logical location but no new movement data packet has been received.
[0209] The second client obtains the logical position of the first virtual character based on the received movement data packet. If the current rendering position of the first virtual character has reached the logical position, it is necessary to determine whether the movement mode of the first virtual character requires pre-rendering. If the movement mode of the first virtual character is configured to be pre-rendered, step 1244 is executed; if the movement mode of the first virtual character does not require pre-rendering, step 1248 is executed.
[0210] Step 1244: Determine whether the current logical position has reached the prediction limit;
[0211] The prediction limit refers to the limit at which the first avatar's rendering position, when reaching a logical position and not receiving a new movement data packet, can continue to move forward based on the current movement pattern and speed. For example, the prediction limit can be defined in terms of time or distance. If the movement pattern of the first avatar has the pre-rendered characteristics but the current movement position exceeds the prediction limit, the predicted forward movement needs to be stopped.
[0212] If the rendering position of the first avatar has reached the logical position and the movement pattern of the first avatar requires pre-rendering, it is determined whether the rendering position has reached the predicted limit position. If the rendering position has not reached the predicted limit position, step 1246 is executed; if the rendering position has reached the predicted limit position, step 1248 is executed.
[0213] Step 1246: Use an extrapolation algorithm to calculate the movement speed and movement direction, and then calculate the next rendering position;
[0214] When the current rendering position of the first virtual character has reached the logical position and the next logical position has not been received, the next rendering position of the first virtual character is calculated according to an extrapolation algorithm corresponding to the movement mode. Exemplarily, the extrapolation algorithm is an algorithm that interpolates the current rendering position according to the current movement mode and the current movement speed along the current movement direction.
[0215] Schematic reference Figure 10 The first virtual character's current movement mode is walking and running. A world coordinate system is established with the ground in the virtual environment as the reference plane and the first virtual character's current rendering position as the center. A rectangular icon 42d represents the first virtual character's current rendering position, and a circular icon 41d represents the first virtual character's logical position. When the first virtual character's current rendering position 42d has reached logical position 41d but no new logical position has been received, linear interpolation corresponding to the walking and running mode is used as an extrapolation algorithm. Current rendering position 42d is interpolated forward in the current movement direction based on the current walking and running mode and the single-sign movement speed, resulting in first rendering position 42e, second rendering position 42f, and third rendering position 42g. The predicted movement trajectory is then displayed on the user interface.
[0216] In some embodiments, when the rendering position of the first avatar has reached a logical position, the next logical position has not been received, the current movement mode is configured with a pre-rendering, and the current rendering position has not reached the predicted limit position, the next rendering position of the first avatar is calculated using an extrapolation algorithm corresponding to the current movement mode. Exemplarily, the extrapolation algorithm is an algorithm that interpolates the rendering position along the current movement direction based on the current movement mode and movement speed.
[0217] In some embodiments, when there is an obstacle before the next rendering position predicted by the extrapolation algorithm, the sweep detection can detect that the next rendering position is unreachable, and the next rendering position is corrected, and the position of the next rendering position before the correction is determined at the obstacle as the corrected rendering position.
[0218] Step 1248: Mark the current mobile data packet as finished playing;
[0219] In some embodiments, when the rendering position of the first virtual character has reached the logical position, the next logical position has not been received, the movement mode is configured with pre-performance, and the rendering position has reached the predicted limit position, the current movement data packet is marked as finished.
[0220] In some embodiments, the rendering position of the first virtual character has reached the logical position, the next logical position has not been received, and the movement mode is not configured with pre-performance, marking that the current movement data packet has been played.
[0221] Step 1250: Calculate the position of the current frame based on the moving speed and moving direction;
[0222] The rendering position of the first virtual character in the user interface is obtained according to the moving speed and moving direction obtained by the interpolation algorithm or the extrapolation algorithm.
[0223] Step 1252: Stop moving the logical position of the first virtual character;
[0224] When there is no mobile data packet being played and there is no mobile data packet in the current play queue, the second client stops moving the logical position of the first virtual character.
[0225] Step 1254: The current frame ends.
[0226] The playback of the mobile data packet of the current frame is completed, and the reception and playback of the mobile data packet of a new frame begins, and steps 1202 to 1254 are repeated.
[0227] To sum up, the method provided in this embodiment provides different synchronization calculation parameters for different mobile modes, and performs synchronization calculation on different types of mobile data packets according to different synchronization calculation parameters, thereby ensuring the smoothness of the rendering positions calculated under different mobile modes and reducing or avoiding the occurrence of lag.
[0228] The method provided in this embodiment also determines whether the received mobile data packet is the same as the current mobile mode, and switches the received mobile data packet to a new mobile mode if they are not the same, thereby avoiding errors caused by matching the mobile data packet with parameters that are different from the current mobile mode, and improving the accuracy of the virtual character movement synchronization.
[0229] Figure 15 A schematic diagram of the structure of a mobile synchronization device for a virtual character provided by an exemplary embodiment of the present application is shown. The device can be implemented as all or part of a computer device through software, hardware, or a combination of both. The device 1500 includes:
[0230] A receiving module 1510 is configured to receive a movement data packet of a first virtual character, wherein the movement data packet includes a movement pattern and a logical position of the first virtual character, wherein the logical position is used to indicate the position of the first virtual character in the virtual world;
[0231] a determination module 1520, configured to determine synchronization calculation parameters corresponding to the movement pattern;
[0232] The playback module 1530 is configured to perform synchronization calculation on the logical position based on the synchronization calculation parameters to obtain a rendering position of the first virtual character;
[0233] The display module 1540 is configured to display the first virtual character on a user interface according to the rendering position.
[0234] In an optional design of this embodiment, the playback module 1530 is also used to calculate the next rendering position of the first virtual character based on an interpolation algorithm corresponding to the movement mode when the current rendering position of the first virtual character has not reached the logical position; wherein the interpolation algorithm is an algorithm for interpolating the current rendering position to the logical position.
[0235] In an optional design of this embodiment, the determining module 1520 is further configured to, when the movement mode is the standing mode, determine that the interpolation algorithm corresponding to the standing mode is the linear interpolation algorithm;
[0236] The determining module 1520 is further configured to, when the movement mode is the walking-running mode, determine that the interpolation algorithm corresponding to the walking-running mode is a spline interpolation algorithm;
[0237] The determining module 1520 is further configured to, when the movement mode is the swimming mode, determine that the interpolation algorithm corresponding to the swimming mode is the spline interpolation algorithm;
[0238] The determining module 1520 is further configured to, when the movement mode is the aerial mode, determine that the interpolation algorithm corresponding to the aerial mode is a cubic spline interpolation algorithm;
[0239] The determining module 1520 is further configured to determine, when the movement mode is the art displacement mode, that the interpolation algorithm corresponding to the art displacement mode is a custom curve algorithm;
[0240] The determining module 1520 is further configured to, when the movement mode is the free displacement mode, determine that the interpolation algorithm corresponding to the free displacement mode is the linear interpolation algorithm;
[0241] The determining module 1520 is further configured to determine, when the movement mode is the path movement mode, that the interpolation algorithm corresponding to the path movement mode is the linear interpolation algorithm.
[0242] In an optional design of this embodiment, the playback module 1530 is also used to predict the next rendering position of the first virtual character based on an interpolation algorithm corresponding to the movement mode when the current rendering position of the first virtual character reaches the logical position and the next logical position is not received; wherein the interpolation algorithm is an algorithm that interpolates the current rendering position along the current moving direction.
[0243] In an optional design of this embodiment, the determining module 1520 is further configured to, when the movement mode is the standing mode, determine that the extrapolation algorithm corresponding to the standing mode is the linear interpolation algorithm;
[0244] The determining module 1520 is further configured to, when the movement mode is the walking-running mode, determine that the extrapolation algorithm corresponding to the walking-running mode is a spline interpolation algorithm;
[0245] The determining module 1520 is further configured to, when the movement mode is the swimming mode, determine that the extrapolation algorithm corresponding to the swimming mode is the spline interpolation algorithm;
[0246] The determining module 1520 is further configured to, when the movement mode is the air mode, determine that the extrapolation algorithm corresponding to the air mode is a linear interpolation algorithm;
[0247] The determining module 1520 is further configured to determine, when the movement mode is the art displacement mode, that the extrapolation algorithm corresponding to the art displacement mode is a custom curve algorithm;
[0248] The determining module 1520 is further configured to, when the movement mode is the free displacement mode, determine that the extrapolation algorithm corresponding to the free displacement mode is the linear interpolation algorithm;
[0249] The determining module 1520 is further configured to determine, when the movement mode is the path movement mode, that the extrapolation algorithm corresponding to the path movement mode is the linear interpolation algorithm.
[0250] In an optional design of this embodiment, the playback module 1530 is also used to calculate the next rendering position of the first virtual character based on the interpolation algorithm corresponding to the movement mode when the current rendering position of the first virtual character reaches the logical position, the next logical position is not received, the movement mode is configured with a pre-performance and the rendering position has not reached the predicted limit position.
[0251] In an optional design of this embodiment, the determination module 1520 is further used to determine a corrected next rendering position when there is an obstacle before the next rendering position predicted by the interpolation algorithm; the modified next rendering position is a position determined at the obstacle based on the next rendering position before correction.
[0252] In an optional design of this embodiment, the determination module 1520 is further used to compensate the logical position based on the round-trip time RTT when the mobile mode is configured with delay compensation, so as to obtain the compensated logical position.
[0253] Figure 16 The following is a block diagram of a terminal 1600 according to an exemplary embodiment of the present application. Terminal 1600 may be a smartphone, tablet computer, MP3 player (Moving Picture Experts Group Audio Layer III), MP4 player (Moving Picture Experts Group Audio Layer IV), laptop computer, or desktop computer. Terminal 1600 may also be referred to as user equipment, portable terminal, laptop terminal, desktop terminal, or other similar names.
[0254] Typically, the terminal 1600 includes a processor 1601 and a memory 1602 .
[0255] The processor 1601 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 1601 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), or PLA (Programmable Logic Array). The processor 1601 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 1601 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 1601 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0256] Memory 1602 may include one or more computer-readable storage media, which may be non-transitory. Memory 1602 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices and flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in memory 1602 is used to store at least one instruction, which is executed by processor 1601 to implement the virtual world screen display method provided in the method embodiment of the present application.
[0257] In some embodiments, terminal 1600 may optionally include a peripheral device interface 1603 and at least one peripheral device. The processor 1601, memory 1602, and peripheral device interface 1603 may be connected via a bus or signal lines. Each peripheral device may be connected to peripheral device interface 1603 via a bus, signal lines, or circuit boards. Specifically, the peripheral device may include at least one of a radio frequency circuit 1604, a touchscreen display 1605, a camera 1606, an audio circuit 1607, and a power supply 1608.
[0258] The peripheral device interface 1603 can be used to connect at least one I / O (Input / Output)-related peripheral device to the processor 1601 and the memory 1602. In some embodiments, the processor 1601, the memory 1602, and the peripheral device interface 1603 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 1601, the memory 1602, and the peripheral device interface 1603 can be implemented on separate chips or circuit boards, which is not limited in this embodiment.
[0259] RF circuit 1604 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. RF circuit 1604 communicates with communication networks and other communication devices via electromagnetic signals. RF circuit 1604 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals. RF circuit 1604 may optionally include an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, and the like. RF circuit 1604 may communicate with other terminals via at least one wireless communication protocol. Such wireless communication protocols include, but are not limited to, the World Wide Web, metropolitan area networks, intranets, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and / or WiFi (Wireless Fidelity) networks. In some embodiments, RF circuit 1604 may also include circuitry related to Near Field Communication (NFC), although this application does not limit this.
[0260] The display screen 1605 is used to display a UI (User Interface). The UI may include graphics, text, icons, videos, and any combination thereof. When the display screen 1605 is a touch screen display, the display screen 1605 also has the ability to collect touch signals on the surface or above the surface of the display screen 1605. The touch signal can be input as a control signal to the processor 1601 for processing. At this time, the display screen 1605 can also be used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments, there can be one display screen 1605, which is set on the front panel of the terminal 1600; in other embodiments, there can be at least two display screens 1605, which are respectively set on different surfaces of the terminal 1600 or in a folding design; in still other embodiments, the display screen 1605 can be a flexible display screen, which is set on the curved surface or folding surface of the terminal 1600. Even more, the display screen 1605 can be set into a non-rectangular irregular shape, that is, a special-shaped screen. The display screen 1605 can be made of materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).
[0261] The camera assembly 1606 is used to capture images or videos. Optionally, the camera assembly 1606 includes a front camera and a rear camera. Typically, the front camera is arranged on the front panel of the terminal, and the rear camera is arranged on the back of the terminal. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize panoramic shooting and VR (Virtual Reality) shooting function or other fusion shooting functions. In some embodiments, the camera assembly 1606 may also include a flash. The flash can be a single-color temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation at different color temperatures.
[0262] The audio circuit 1607 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals that are input into the processor 1601 for processing, or input into the radio frequency circuit 1604 to achieve voice communication. For the purpose of stereo sound collection or noise reduction, there may be multiple microphones, each located in different parts of the terminal 1600. The microphone may also be an array microphone or an omnidirectional collection microphone. The speaker is used to convert electrical signals from the processor 1601 or the radio frequency circuit 1604 into sound waves. The speaker may be a traditional thin film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert electrical signals into sound waves audible to humans, but also convert electrical signals into sound waves inaudible to humans for purposes such as ranging. In some embodiments, the audio circuit 1607 may also include a headphone jack.
[0263] Power supply 1608 is used to power various components in terminal 1600. Power supply 1608 can be AC power, DC power, a disposable battery, or a rechargeable battery. When power supply 1608 includes a rechargeable battery, the rechargeable battery can be wired or wirelessly rechargeable. A wired rechargeable battery is charged via a wired line, while a wireless rechargeable battery is charged via a wireless coil. The rechargeable battery can also support fast charging technology.
[0264] In some embodiments, the terminal 1600 further includes one or more sensors 1609 , including but not limited to: an acceleration sensor 1610 , a gyroscope sensor 1611 , a pressure sensor 1612 , an optical sensor 1613 , and a proximity sensor 1614 .
[0265] The accelerometer 1610 can detect the magnitude of acceleration along the three coordinate axes of the coordinate system established by the terminal 1600. For example, the accelerometer 1610 can be used to detect the components of gravity acceleration along the three coordinate axes. The processor 1601 can control the touch screen display 1605 to display the user interface in a landscape or portrait view based on the gravity acceleration signal collected by the accelerometer 1610. The accelerometer 1610 can also be used to collect game or user motion data.
[0266] The gyroscope sensor 1611 can detect the orientation and rotation angle of the terminal 1600. It can also work with the accelerometer 1610 to collect the user's 3D movements on the terminal 1600. Based on the data collected by the gyroscope sensor 1611, the processor 1601 can implement the following functions: motion sensing (for example, changing the UI based on the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.
[0267] The pressure sensor 1612 can be located on the side frame of the terminal 1600 and / or below the touchscreen display 1605. When the pressure sensor 1612 is located on the side frame of the terminal 1600, it can detect the user's gripping signal of the terminal 1600. The processor 1601 then performs left-hand or right-hand identification or shortcut operations based on the gripping signal collected by the pressure sensor 1612. When the pressure sensor 1612 is located below the touchscreen display 1605, the processor 1601 controls the operable controls on the UI based on the user's pressure on the touchscreen display 1605. Operable controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.
[0268] Optical sensor 1613 is used to detect ambient light intensity. In one embodiment, processor 1601 can control the display brightness of touchscreen display 1605 based on the ambient light intensity detected by optical sensor 1613. Specifically, when the ambient light intensity is high, the display brightness of touchscreen display 1605 is increased; when the ambient light intensity is low, the display brightness of touchscreen display 1605 is decreased. In another embodiment, processor 1601 can also dynamically adjust the shooting parameters of camera assembly 1606 based on the ambient light intensity detected by optical sensor 1613.
[0269] Proximity sensor 1614, also known as a distance sensor, is typically located on the front panel of terminal 1600. Proximity sensor 1614 is used to detect the distance between the user and the front of terminal 1600. In one embodiment, when proximity sensor 1614 detects that the distance between the user and the front of terminal 1600 is gradually decreasing, processor 1601 controls touchscreen display 1605 to switch from the screen-on state to the screen-off state. When proximity sensor 1614 detects that the distance between the user and the front of terminal 1600 is gradually increasing, processor 1601 controls touchscreen display 1605 to switch from the screen-off state to the screen-on state.
[0270] Those skilled in the art will understand that Figure 16 The structure shown in the figure does not constitute a limitation on the terminal 1600, and the terminal 1600 may include more or fewer components than shown in the figure, or combine certain components, or adopt a different component arrangement.
[0271] According to another aspect of the present application, a computer storage medium is provided. The computer-readable storage medium stores at least one program code. The program code is loaded and executed by a processor to implement the above-mentioned sound prompt method in the virtual world.
[0272] According to another aspect of the present application, a computer program product or computer program is provided. The computer program product or computer program includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the aforementioned method for providing a sound prompt in a virtual world.
[0273] It should be understood that the term "plurality" used herein refers to two or more. "And / or" describes a relationship between associated objects, indicating that three possible relationships exist. For example, "A and / or B" can mean: A exists alone, A and B exist simultaneously, or B exists alone. The character " / " generally indicates an "or" relationship between the associated objects.
[0274] Those skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware, or by a program to instruct the relevant hardware, and the program may be stored in a computer-readable storage medium, which may be a read-only memory, a disk, or an optical disk, etc.
[0275] The above description is merely an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A method for synchronizing movement of a virtual character, characterized in that: The method comprises: receiving a movement data packet of a first virtual character, the movement data packet including a movement pattern and a logical position of the first virtual character, the logical position being used to indicate a position of the first virtual character in a virtual world; Determining synchronization calculation parameters corresponding to the movement mode, the synchronization calculation parameters including a delay compensation parameter, a pre-rendering parameter, an interpolation algorithm, and an extrapolation algorithm. The delay compensation parameter represents a time compensation compared to when the server forwards the mobile data packet. The pre-rendering parameter indicates that the action of the first virtual character should be displayed in advance without the server sending a latest mobile data packet or a confirmation instruction. The interpolation algorithm is an interpolation algorithm that interpolates the current rendering position of the first virtual character toward the logical position if the current rendering position has not reached the logical position. The extrapolation algorithm is an interpolation algorithm that interpolates the current rendering position forward according to the current movement direction if the current rendering position reaches the logical position and no subsequent mobile data packet has been received. Performing synchronous calculation on the logical position based on the synchronous calculation parameters to obtain a rendering position of the first virtual character; The first virtual character is displayed on a user interface according to the rendering position.
2. The method according to claim 1, characterized in that The synchronously calculating the logical position based on the synchronous calculation parameters to obtain the next rendering position of the first virtual character includes: If the current rendering position of the first virtual character has not reached the logical position, calculating the next rendering position of the first virtual character based on an interpolation algorithm corresponding to the movement mode; The interpolation algorithm is an algorithm for interpolating the current rendering position to the logical position.
3. The method according to claim 2, characterized in that The determining of the synchronization calculation parameters corresponding to the movement mode comprises at least one of the following steps: In a case where the movement mode is a standing mode, determining that the interpolation algorithm corresponding to the standing mode is a linear interpolation algorithm; In a case where the movement mode is a walking-running mode, determining that the interpolation algorithm corresponding to the walking-running mode is a spline interpolation algorithm; In a case where the movement mode is a swimming mode, determining that the interpolation algorithm corresponding to the swimming mode is the spline interpolation algorithm; When the movement mode is an aerial mode, determining that the interpolation algorithm corresponding to the aerial mode is a cubic spline interpolation algorithm; In a case where the movement mode is an art displacement mode, determining that the interpolation algorithm corresponding to the art displacement mode is a custom curve algorithm; In a case where the movement mode is a free displacement mode, determining that the interpolation algorithm corresponding to the free displacement mode is the linear interpolation algorithm; In a case where the movement mode is a path movement mode, it is determined that the interpolation algorithm corresponding to the path movement mode is the linear interpolation algorithm.
4. The method according to any one of claims 1 to 3, characterized in that: The synchronously calculating the logical position based on the synchronous calculation parameters to obtain the next rendering position of the first virtual character includes: When the current rendering position of the first virtual character reaches the logical position and the next logical position has not been received, predicting the next rendering position of the first virtual character based on an extrapolation algorithm corresponding to the movement pattern; The extrapolation algorithm is an algorithm for interpolating the current rendering position along the current moving direction.
5. The method according to claim 4, characterized in that The determining of the synchronization calculation parameters corresponding to the movement mode comprises at least one of the following steps: In a case where the movement mode is a standing mode, determining that an extrapolation algorithm corresponding to the standing mode is a linear interpolation algorithm; In a case where the movement mode is a walking-running mode, determining that an extrapolation algorithm corresponding to the walking-running mode is a spline interpolation algorithm; When the movement mode is a swimming mode, determining that the extrapolation algorithm corresponding to the swimming mode is the spline interpolation algorithm; In a case where the movement mode is an aerial mode, determining that an extrapolation algorithm corresponding to the aerial mode is a linear interpolation algorithm; In a case where the movement mode is an art displacement mode, determining that the extrapolation algorithm corresponding to the art displacement mode is a custom curve algorithm; In a case where the movement mode is a free displacement mode, determining that an extrapolation algorithm corresponding to the free displacement mode is the linear interpolation algorithm; In a case where the movement mode is a path movement mode, it is determined that the extrapolation algorithm corresponding to the path movement mode is the linear interpolation algorithm.
6. The method according to claim 4, characterized in that The method further comprises: When the current rendering position of the first virtual character reaches the logical position, the next logical position is not received, the movement mode is configured with pre-performance and the rendering position does not reach the predicted limit position, the next rendering position of the first virtual character is calculated based on the interpolation algorithm corresponding to the movement mode.
7. The method according to claim 4, characterized in that The method further comprises: In the case where an obstacle exists before the next rendering position predicted by the extrapolation algorithm, a revised next rendering position is determined; the revised next rendering position is a position determined at the obstacle based on the next rendering position before revision.
8. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: In a case where the mobility mode is configured with delay compensation, the logical position is compensated based on a round trip time (RTT) to obtain a compensated logical position.
9. A mobile synchronization device for a virtual character, characterized in that: The device comprises: a receiving module, configured to receive a movement data packet of a first virtual character, wherein the movement data packet includes a movement mode and a logical position of the first virtual character, wherein the logical position is used to indicate a position of the first virtual character in the virtual world; a determination module, configured to determine synchronization calculation parameters corresponding to the movement mode, the synchronization calculation parameters including a delay compensation parameter, a pre-rendering parameter, an interpolation algorithm, and an extrapolation algorithm; the delay compensation parameter represents a time compensation compared to when the server forwards the movement data packet; the pre-rendering parameter indicates that the action of the first virtual character should be displayed in advance without the server sending a latest movement data packet or a confirmation instruction; the interpolation algorithm is an interpolation algorithm that interpolates the current rendering position of the first virtual character toward the logical position if the current rendering position has not reached the logical position; and the extrapolation algorithm is an interpolation algorithm that interpolates the current rendering position forward according to the current movement direction if the current rendering position reaches the logical position and no subsequent movement data packet has been received; a calculation module, configured to perform synchronous calculation on the logical position based on the synchronous calculation parameters to obtain a rendering position of the first virtual character; A display module is configured to display the first virtual character on a user interface according to the rendering position.
10. The device according to claim 9, characterized in that The calculation module is configured to calculate a next rendering position of the first virtual character based on an interpolation algorithm corresponding to the movement mode when the current rendering position of the first virtual character has not reached the logical position; The interpolation algorithm is an algorithm for interpolating the rendering position to the logical position.
11. The device according to claim 10, characterized in that The determining module is configured to perform at least one of the following steps: In a case where the movement mode is a standing mode, determining that the interpolation algorithm corresponding to the standing mode is a linear interpolation algorithm; In a case where the movement mode is a walking-running mode, determining that the interpolation algorithm corresponding to the walking-running mode is a spline interpolation algorithm; In a case where the movement mode is a swimming mode, determining that the interpolation algorithm corresponding to the swimming mode is the spline interpolation algorithm; When the movement mode is an aerial mode, determining that the interpolation algorithm corresponding to the aerial mode is a cubic spline interpolation algorithm; In a case where the movement mode is an art displacement mode, determining that the interpolation algorithm corresponding to the art displacement mode is a custom curve algorithm; In a case where the movement mode is a free displacement mode, determining that the interpolation algorithm corresponding to the free displacement mode is the linear interpolation algorithm; In a case where the movement mode is a path movement mode, it is determined that the interpolation algorithm corresponding to the path movement mode is the linear interpolation algorithm.
12. The device according to claim 9, characterized in that the calculation module is configured to predict a next rendering position of the first virtual character based on an extrapolation algorithm corresponding to the movement mode when the current rendering position of the first virtual character reaches the logical position and the next logical position has not been received; The extrapolation algorithm is an algorithm for interpolating the rendering position along the current moving direction.
13. The device according to claim 12, characterized in that The determining module is configured to perform at least one of the following steps: In a case where the movement mode is a standing mode, determining that an extrapolation algorithm corresponding to the standing mode is a linear interpolation algorithm; In a case where the movement mode is a walking-running mode, determining that an extrapolation algorithm corresponding to the walking-running mode is a spline interpolation algorithm; When the movement mode is a swimming mode, determining that the extrapolation algorithm corresponding to the swimming mode is the spline interpolation algorithm; In a case where the movement mode is an aerial mode, determining that an extrapolation algorithm corresponding to the aerial mode is a linear interpolation algorithm; In a case where the movement mode is an art displacement mode, determining that the extrapolation algorithm corresponding to the art displacement mode is a custom curve algorithm; In a case where the movement mode is a free displacement mode, determining that an extrapolation algorithm corresponding to the free displacement mode is the linear interpolation algorithm; In a case where the movement mode is a path movement mode, it is determined that the extrapolation algorithm corresponding to the path movement mode is the linear interpolation algorithm.
14. A computer device, characterized in that: The computer device includes a processor and a memory, wherein the memory stores at least one program; the at least one program is loaded and executed by the processor to implement the virtual character movement synchronization method according to any one of claims 1 to 8.
15. A computer-readable storage medium, characterized in that The readable storage medium stores at least one instruction, at least one program, code set or instruction set, and the at least one instruction, the at least one program, the code set or instruction set is loaded and executed by the processor to implement the virtual character movement synchronization method as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Game synchronization method, device and equipment
CN107837530A