Virtual object control method and apparatus, computer device, and storage medium
By predicting and correcting the display position of virtual objects at the terminal, the problems of virtual object movement latency and lag were solved, improving the game's response speed and user experience.
Patent Information
- Application Number
- PCT/CN2024/085566
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-05-31
- Filing Date
- 2024-04-02
- Publication Date
- 2024-12-05
AI Technical Summary
In massively multiplayer online role-playing games, when players control virtual objects to move, the terminal needs to wait for the movement command issued by the server, which causes response delays and screen stuttering, affecting the user experience.
The terminal predicts the movement position of virtual objects in the virtual scene and displays the virtual objects moving to the predicted position in the scene interface. At the same time, after receiving the movement command from the server, it compares the actual position and corrects the displayed position to ensure that the displayed position is synchronized with the actual position.
It reduces the latency of movement operations, avoids screen lag, improves the user experience, and ensures the accuracy of the display position of virtual objects in the scene interface.
Smart Images

Figure CN2024085566_05122024_PF_FP_ABST
Abstract
Description
Virtual object control method, device, computer equipment and storage medium
[0001] This application claims priority to Chinese patent application number 202310641508.9, filed on May 31, 2023, entitled “Virtual object control method, device, computer equipment and storage medium”, 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 computer technology, and in particular to a virtual object control method, apparatus, computer equipment, and storage medium. Background Art
[0003] With the development of computer technology, games are becoming more and more popular among users. In massively multiplayer online role-playing games, players can control virtual objects to move in virtual scenes.
[0004] Summary of the Invention
[0005] The embodiments of the present application provide a virtual object control method, apparatus, computer device, and storage medium, which can avoid movement operation delays, ensure data accuracy, and thus improve user experience. The technical solution is as follows:
[0006] In one aspect, a virtual object control method is provided, the method comprising:
[0007] In response to a first movement operation on a virtual object in a scene interface, displaying, in the scene interface, that the virtual object moves to a first predicted scene position, where the first predicted scene position is a position predicted by the local end based on the first movement operation;
[0008] When the first scene position is different from the first predicted scene position, the display position of the virtual object in the scene interface is corrected based on the first scene position, where the first scene position is the position determined by the local end based on the movement instruction returned by the server for the first movement operation.
[0009] In another aspect, a virtual object control device is provided, the device comprising:
[0010] a display module configured to, in response to a first movement operation on a virtual object in a scene interface, display in the scene interface that the virtual object moves to a first predicted scene position, where the first predicted scene position is a position predicted by the local terminal based on the first movement operation;
[0011] A correction module is used to correct the display position of the virtual object in the scene interface based on the first scene position when the first scene position is different from the first predicted scene position. The first scene position is the position determined by the local end based on the movement instruction returned by the server for the first movement operation.
[0012] On the other hand, a computer device is provided, comprising a processor and a memory, wherein the memory stores at least one computer program, and the at least one computer program is loaded and executed by the processor to implement the operations performed by the virtual object control method as described in the above aspects.
[0013] On the other hand, a computer-readable storage medium is provided, in which at least one computer program is stored. The at least one computer program is loaded and executed by a processor to implement the operations performed by the virtual object control method as described in the above aspects.
[0014] On the other hand, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the operations performed by the virtual object control method as described in the above aspects are implemented.
[0015] In an embodiment of the present application, in response to a first movement operation, the terminal predicts a first predicted scene position that the virtual object may reach in the virtual scene under the action of the first movement operation, and displays the virtual object moving toward the predicted first predicted scene position in the scene interface. Then, based on the movement instruction returned by the server, the first scene position of the virtual object in the virtual scene is determined, and the determined first scene position is compared with the first predicted scene position. If the predicted first predicted scene position is inaccurate, the display position of the virtual object in the scene interface is corrected so that the display position of the virtual object in the scene interface is synchronized as much as possible with the scene position that the virtual object should reach in the virtual scene, so as to ensure the accuracy of the display position of the virtual object in the scene interface, and enable the terminal to respond to the first movement operation in a timely manner without having to wait for a long time for the movement instruction issued by the server, thereby avoiding a delay in responding to the movement operation, so that the terminal can display the picture of the virtual object moving in the scene interface in a timely manner, avoiding the situation where the picture displayed by the terminal is stuck, and thus improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] FIG1 is a schematic diagram of a structure of an implementation environment provided by an embodiment of the present application;
[0017] FIG2 is a flow chart of a virtual object control method provided in an embodiment of the present application;
[0018] FIG3 is a flow chart of another virtual object control method provided in an embodiment of the present application;
[0019] FIG4 is a flowchart of another virtual object control method provided in an embodiment of the present application;
[0020] FIG5 is a flowchart of another virtual object control method provided in an embodiment of the present application;
[0021] FIG6 is a schematic diagram of a modified predicted scene position provided by an embodiment of the present application;
[0022] FIG7 is a flowchart of another virtual object control method provided in an embodiment of the present application;
[0023] FIG8 is a flowchart of another virtual object control method provided in an embodiment of the present application;
[0024] FIG9 is a flowchart of another virtual object control method provided in an embodiment of the present application;
[0025] FIG10 is a flowchart of another virtual object control method provided in an embodiment of the present application;
[0026] FIG11 is a schematic diagram of a moving feel index provided in an embodiment of the present application;
[0027] FIG12 is a flowchart of another virtual object control method provided in an embodiment of the present application;
[0028] FIG13 is a schematic structural diagram of a virtual object control device provided in an embodiment of the present application;
[0029] FIG14 is a schematic structural diagram of a terminal provided in an embodiment of the present application;
[0030] FIG15 is a schematic diagram of the structure of a server provided in an embodiment of the present application. DETAILED DESCRIPTION
[0031] As used herein, the terms "first," "second," "third," and the like may be used to describe various concepts herein, but unless otherwise specified, these concepts are not limited by these terms. These terms are used solely to distinguish one concept from another. For example, a first scene position may be referred to as a second scene position, and similarly, a second scene position may be referred to as a first scene position without departing from the scope of this application.
[0032] As used herein, the terms "at least one," "plurality," "each," and "any" include one, two, or more, "plurality" includes two or more, "each" refers to each of the corresponding plurality, and "any" refers to any one of the plurality. For example, if a plurality of terminals includes three terminals, "each" refers to each of the three terminals, and "any" refers to any one of the three terminals, which can be the first terminal, the second terminal, or the third terminal.
[0033] To facilitate understanding of the embodiments of the present application, some terms involved in the embodiments of the present application are first explained:
[0034] Multiplayer Online Battle Arena (MOBA): A multiplayer online battle arena game (MOBA) involves at least two factions interacting in the same virtual environment. For example, a multiplayer online battle arena game may involve two factions, with players controlling virtual objects through terminals to interact with virtual objects from the other faction within the virtual environment.
[0035] Virtual scene: It is a virtual scene displayed (or provided) when the application is running on the terminal, that is, the scene displayed when the terminal runs the game. For example, if the game is a shooting game, the virtual scene is the scene displayed when the terminal runs the game. The virtual scene is a simulation environment of the real world, or a semi-simulation and semi-fictitious virtual environment, or a purely fictitious virtual environment. The virtual scene is any one of a two-dimensional virtual scene, a 2.5-dimensional virtual scene or a three-dimensional virtual scene, and this application does not limit this. For example, the virtual scene includes the sky, land, ocean, etc., and the land includes environmental elements such as deserts and cities. The user can control virtual objects to move in the virtual scene. Of course, the virtual scene also includes virtual props, such as virtual throwing objects, virtual buildings, virtual machinery and other props. The virtual scene can also be used to simulate real environments under different weather conditions, such as sunny days, rainy days, foggy days or night weather. A variety of scene elements enhance the diversity and authenticity of the virtual scene. Taking the open virtual world provided by the virtual scene for the game as an example, the development of the virtual world indicates that the virtual scene in the game is completely free and open. Players can control virtual objects to move forward and explore freely in any direction. The distance between the boundaries of various directions is very large. At the same time, there are virtual objects of various shapes and sizes in the virtual scene, which can produce various physical collisions or interactions with entities such as virtual objects controlled by players and artificial intelligence (AI) objects.
[0036] Virtual object: refers to a virtual character that can move in a virtual scene. The movable object is a virtual person, virtual animal, cartoon character, etc. The virtual object is a virtual image in the virtual scene that is used to represent the user. The virtual scene includes multiple virtual objects, each of which has its own shape and volume in the virtual scene and occupies a part of the space in the virtual scene. The virtual object can crawl, walk, run, jump, drive, pick up, shoot, attack, throw, and other activities in the virtual scene. Optionally, the virtual object is a character controlled by operation on the client, or an artificial intelligence object set in the virtual environment through training, or a non-player character (NPC) set in the virtual scene. Optionally, the virtual object is a virtual character that competes in the virtual scene.
[0037] Virtual props: These are props that can be used with virtual objects in a virtual scene. Examples include virtual weapons and vehicles. In a virtual scene, virtual objects can interact with other virtual objects using virtual props.
[0038] It should be noted that the movement operations, release operations, and data involved in this application (including but not limited to game data used to render the scene interface, etc.) are all authorized by the user or fully authorized by all parties, and the collection, use, and processing of relevant data must comply with the relevant laws, regulations, and standards of the relevant countries and regions. For example, the game data used to render the scene interface involved in this application was obtained with full authorization.
[0039] Currently, when a player controls a virtual object's movement through a terminal, the terminal sends a movement request to the server. The server then sends movement instructions to multiple terminals participating in the game, allowing each terminal to display the virtual object's movement based on the movement instructions. However, this approach requires a long wait for the server's movement instructions, resulting in a delay in the response to the movement operation and, in turn, a lag in the displayed image.
[0040] The virtual object control method provided in the embodiment of the present application is executed by a computer device. Optionally, the computer device is a terminal or a server. Optionally, the server is an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Optionally, the terminal is a smart phone, tablet computer, laptop computer, desktop computer, smart speaker, smart watch, smart voice interaction device, smart home appliance and car terminal, etc., but is not limited to this.
[0041] In some embodiments, the computer program involved in the embodiments of the present application can be deployed and executed on a computer device, or on multiple computer devices located at one location, or on multiple computer devices distributed at multiple locations and interconnected through a communication network. Multiple computer devices distributed at multiple locations and interconnected through a communication network can constitute a blockchain system.
[0042] In some embodiments, a computer device is provided as a first terminal. Figure 1 is a schematic diagram of an implementation environment provided by an embodiment of the present application. Referring to Figure 1, the implementation environment includes a first terminal 101, a second terminal 102, and a server 103. The first terminal 101 and the second terminal 102 are both connected to the server 103 via a wireless or wired network. Applications provided by the server 103 are installed on both the first terminal 101 and the second terminal 102. The first terminal 101 and the second terminal 102 can use these applications to implement functions such as games and message exchange. Optionally, the application is an application in the operating system of the first terminal 101 or an application provided by a third party. For example, the application is a game application that has game functions. Of course, the game application can also have other functions, such as shopping functions and navigation functions. The first terminal 101 is the first terminal used by any user. The user can use the first terminal 101 to manipulate virtual objects in a virtual scene to perform activities, including at least one of crawling, walking, running, jumping, driving, picking up, shooting, attacking, and throwing. Optionally, different users use different first terminals to control virtual objects, and the virtual objects controlled by different first terminals are located in the same virtual scene. In this case, different virtual objects can move.
[0043] The first terminal 101 is used to log in to an application based on a user identifier and interact with the server 103 through the application to display a scene interface of a virtual scene. The first terminal 101 can respond to a move operation on a virtual object in the scene interface through the application and can display the movement of the virtual object in the scene interface in advance. The first terminal 101 also interacts with the server 103 through the application so that the server 103 sends a movement instruction for the move operation to the first terminal 101 and the second terminal 102 participating in the same game, so that the first terminal 101 can determine the scene position of the virtual object in the virtual scene based on the movement instruction to ensure that the scene position of the virtual object in the virtual scene is synchronized with the display position of the virtual object in the scene interface; and the second terminal 102 can determine the scene position of the virtual object in the virtual scene based on the movement instruction, and then display the virtual object in the scene interface according to the determined scene position to ensure that the scene position of the virtual object in the virtual scene in the first terminal 101 and the second terminal 102 are synchronized.
[0044] It should be noted that the embodiment of the present application is described using a second terminal 102 as an example. In another embodiment, the implementation environment can also include multiple second terminals 102, and can interact with the server 103 to display the scene interface of the virtual scene according to the above-mentioned second terminal 102.
[0045] FIG2 is a flow chart of a virtual object control method provided by an embodiment of the present application. Taking the method executed by a terminal as an example, as shown in FIG2 , the method includes:
[0046] 201. In response to a first movement operation on a virtual object in a scene interface, the terminal displays, in the scene interface, that the virtual object moves to a first predicted scene position, where the first predicted scene position is a position predicted by the terminal based on the first movement operation.
[0047] 202. When the first scene position is different from the first predicted scene position, the terminal corrects the display position of the virtual object in the scene interface based on the first scene position. The first scene position is the position determined by this terminal based on the movement instruction returned by the server for the first movement operation.
[0048] In an embodiment of the present application, the terminal responds to a first movement operation, predicts a first predicted scene position that the virtual object may reach based on the first movement operation, and displays the virtual object moving toward the predicted first predicted scene position in the scene interface, and then determines the scene position that the virtual object should actually reach based on the movement instruction returned by the server. When the first scene position is different from the first predicted scene position, it indicates that the predicted first predicted scene position is inaccurate. The display position of the virtual object in the scene interface is corrected to make the display position of the virtual object in the scene interface as accurate as possible, and enables the terminal to respond to the first movement operation in a timely manner without having to wait for a long time for the movement instruction issued by the server, thereby avoiding a delay in the response to the movement operation, and enables the terminal to display the picture of the virtual object movement in the scene interface in a timely manner, avoiding the situation where the picture displayed by the terminal is stuck, thereby improving the user experience.
[0049] FIG3 is a flow chart of a virtual object control method provided by an embodiment of the present application. Taking the method executed by a terminal as an example, as shown in FIG3 , the method includes:
[0050] 301. In response to a first movement operation on a virtual object in a scene interface, the terminal sends a first movement request to a server. The scene interface is an interface of a virtual scene. The first movement request carries a first movement direction, which is the movement direction of the first movement operation.
[0051] In an embodiment of the present application, a terminal displays a scene interface of a virtual scene, and a virtual object is displayed in the scene interface, and the virtual object is a virtual object controlled by the terminal. When the virtual object is displayed, the user can trigger a movement operation on the virtual object through the scene interface displayed by the terminal to control the movement of the virtual object in the virtual scene, and then the terminal can display the movement of the virtual object in the scene interface. The terminal detects a first movement operation on the virtual object based on the scene interface and sends a first movement request to the server, so that the server can respond to the first movement request and issue movement instructions to multiple terminals participating in the same game with the terminal to ensure synchronization of game data of multiple terminals.
[0052] The first movement operation is an arbitrary operation, for example, the first movement operation instructs the virtual object to move in the virtual scene, or to rotate the virtual object. For another example, the first movement operation instructs the virtual object to move in a first movement direction, where the first movement direction is an arbitrary direction, such as the first movement operation instructs the virtual object to move east or west. The scene interface of the virtual scene is used to display the content of the virtual scene, for example, the scene interface can display virtual objects, virtual buildings, virtual vehicles, etc. in the virtual scene.
[0053] 302. The terminal obtains a first predicted scene position based on the current display position of the virtual object in the scene interface and the first moving direction, and displays the virtual object moving toward the first predicted scene position in the scene interface. The first predicted scene position is the position that the virtual object is predicted to reach in the virtual scene under the action of the first moving operation.
[0054] In an embodiment of the present application, the terminal records the scene position of the virtual object in the virtual scene so that the virtual object can be displayed in the scene interface based on the recorded scene position. In the terminal, the current display position of the virtual object in the scene interface may be different from the scene position of the virtual object in the virtual scene currently recorded by the terminal, or it may be the same as the scene position recorded by the terminal. Therefore, in response to the movement operation of the virtual object, the terminal predicts the scene position that the virtual object may reach in the virtual scene under the action of the first movement operation, and then displays the virtual object in the scene interface moving to the predicted first predicted scene position, so that the terminal can respond to the first movement operation in a timely manner, and ensures as much as possible that the display position of the virtual object in the scene interface is the same as the scene position of the virtual object in the virtual scene recorded by the terminal, so as to ensure the accuracy of the movement of the virtual object displayed by the terminal. For multiple terminals participating in the same game with the terminal, the scene positions of the virtual object in the virtual scene recorded by the multiple terminals are the same.
[0055] The first predicted scene position is a position predicted by the local end based on the first movement operation, that is, the first predicted scene position is a position that the virtual object predicted by the local end may reach under the action of the first movement operation.
[0056] In an embodiment of the present application, after the terminal sends a first movement request to the server in response to the first movement operation, the scene position recorded by the terminal can be updated only after receiving the movement instruction returned by the server for the first movement operation. Since there may be network delays and the like during the interaction between the terminal and the server, the movement instruction received by the terminal will be delayed. Therefore, the terminal does not need to wait for the movement instruction returned by the server for the first movement operation, and can predict the position that the virtual object is about to reach in the virtual scene under the action of the first movement operation, that is, to obtain the first predicted scene position, and immediately control the virtual object to move to the first predicted scene position, so that the terminal responds to the first movement operation of the virtual object and displays the virtual movement picture in time, avoiding the delay in responding to the movement operation, so that the terminal can display the virtual object movement picture in time in the scene interface, avoiding the situation where the picture displayed by the terminal is stuck.
[0057] 303. The terminal determines a first scene position in response to the movement instruction returned by the server in response to the first movement request. The first scene position is a position reached by the virtual object in the virtual scene under the action of the first movement operation.
[0058] In an embodiment of the present application, after the server receives the first movement request sent by the terminal, it will return a movement instruction to the terminal. At the same time, it will also return the movement instruction to other terminals participating in the same game as the terminal, so that the terminal that receives the movement instruction updates the recorded scene position of the virtual object in the virtual scene based on the movement instruction, so as to ensure that the terminal can respond to the first movement operation and ensure that the scene positions recorded by the terminals participating in the same game are synchronized.
[0059] In the embodiment of the present application, the first scene position is the position that the virtual object should reach under the action of the first movement operation. After the terminal determines the scene position based on the movement instruction returned by the server, it records the determined scene position so that the next scene position can be determined based on the recorded scene position and the next movement instruction returned by the server.
[0060] In response to the movement instruction returned by the server, the terminal updates the scene position of the recorded virtual object in the virtual scene. The updated scene position is the first scene position, which is the scene position recorded in the terminal's logical layer. The movement instruction returned by the server in response to the first request is equivalent to the movement instruction returned by the server in response to the first movement operation. The first scene position is the position determined by the terminal based on the movement instruction returned by the server in response to the first movement operation.
[0061] 304. When the first scene position is different from the first predicted scene position, the terminal corrects the display position of the virtual object in the scene interface based on the first scene position.
[0062] In an embodiment of the present application, the first predicted scene position is the scene position that the terminal predicts the virtual object may reach in the virtual scene under the action of the first movement operation, and the first scene position is the scene position determined by the terminal in response to the movement instruction returned by the server. The first scene position is different from the first predicted scene position, indicating that the scene position predicted by the terminal is inaccurate. Therefore, based on the first scene position, the display position of the virtual object in the scene interface is corrected to synchronize the display position of the virtual object in the scene interface with the scene position that the virtual object should reach in the virtual scene as much as possible, so as to ensure the accuracy of the display position of the virtual object in the scene interface.
[0063] In an embodiment of the present application, in response to a first movement operation, the terminal predicts a first predicted scene position that the virtual object may reach in the virtual scene under the action of the first movement operation, and displays the virtual object moving toward the predicted first predicted scene position in the scene interface. Then, based on the movement instruction returned by the server, the first scene position of the virtual object in the virtual scene is determined, and the determined first scene position is compared with the first predicted scene position. If the predicted first predicted scene position is inaccurate, the display position of the virtual object in the scene interface is corrected so that the display position of the virtual object in the scene interface is synchronized as much as possible with the scene position that the virtual object should reach in the virtual scene, so as to ensure the accuracy of the display position of the virtual object in the scene interface, and enable the terminal to respond to the first movement operation in a timely manner without having to wait for a long time for the movement instruction issued by the server, thereby avoiding a delay in responding to the movement operation, so that the terminal can display the picture of the virtual object moving in the scene interface in a timely manner, avoiding the situation where the picture displayed by the terminal is stuck, and thus improving the user experience.
[0064] Based on the embodiment shown in Figure 3, in an embodiment of the present application, when the terminal receives the movement instruction returned by the server for the first movement operation, the terminal has responded to multiple movement operations of the virtual object in the scene interface and sent multiple movement requests to the server. The specific process is detailed in the following embodiment.
[0065] FIG4 is a flow chart of a virtual object control method provided by an embodiment of the present application. Taking the method executed by a terminal as an example, as shown in FIG4 , the method includes:
[0066] 401. In response to a first movement operation on a virtual object in a scene interface, the terminal sends a first movement request to a server. The scene interface is an interface of a virtual scene. The first movement request carries a first movement direction, which is the movement direction of the first movement operation.
[0067] In a possible implementation, the scene interface displayed by the terminal is the UI (User Interface) of the terminal.
[0068] In a possible implementation, a virtual joystick is displayed in the scene interface, and the terminal detects a triggering operation on the virtual joystick in the scene interface, which is equivalent to detecting a first movement operation on the virtual object.
[0069] The virtual joystick is used to control the movement of virtual objects in a virtual scene. Optionally, the virtual joystick includes a first area and a second area, the centers of which overlap. When a user presses the second area and drags in any direction, it is equivalent to detecting a first movement operation on the virtual object, and the dragging direction is the first movement direction of the first movement operation. In an embodiment of the present application, a user can control the movement of a virtual object in a scene interface by using the virtual joystick displayed by the terminal in the scene interface.
[0070] In one possible implementation, multiple movement options for a virtual object are displayed in a scene interface, and different movement options correspond to different movement directions. Detecting a trigger operation on any movement option is equivalent to detecting a first movement operation on the virtual object, and the movement direction corresponding to the triggered movement option is the first movement direction.
[0071] Optionally, detecting the triggering operation of multiple movement options at the same time is equivalent to detecting the first movement operation of the virtual object, and the movement directions corresponding to the multiple triggered movement options are merged, and the merged direction is the first movement direction.
[0072] For the method of merging the moving directions corresponding to multiple moving options, taking the current position of the virtual object as the starting point, the unit direction vectors of the moving directions corresponding to each triggered moving option are merged, and the direction indicated by the merged vector is the first moving direction.
[0073] 402. The terminal obtains a first predicted scene position based on the current display position of the virtual object in the scene interface and the first moving direction, and displays the virtual object moving toward the first predicted scene position in the scene interface. The first predicted scene position is the position that the virtual object is predicted to reach in the virtual scene under the action of the first moving operation.
[0074] In one possible implementation, the process of obtaining the first predicted scene position includes: determining the scene position corresponding to the display position of the virtual object in the scene interface based on the current display position of the virtual object in the virtual scene, where the scene position is the current position of the virtual object in the virtual scene; and obtaining the first predicted scene position based on the determined scene position, the first moving direction, the moving speed of the virtual object, and the operation duration of the first moving operation.
[0075] In an embodiment of the present application, the current display position of the virtual object in the scene interface may be the same as or different from the scene position of the current virtual object in the virtual scene. The scene position corresponding to the display position in the virtual scene is equivalent to the scene position of the virtual object in the virtual scene currently recorded by the terminal. Based on the scene position of the current virtual object in the virtual scene, the first movement direction, the movement speed of the virtual object, and the operation duration of the first movement operation, the scene position reached by the virtual object after moving at the movement speed and along the first movement direction for the operation duration can be determined, which is also the first predicted scene position.
[0076] In the case where the current display position of the virtual object in the scene interface is different from the scene position corresponding to the display position in the virtual scene, the scene position corresponding to the display position in the virtual scene lags behind the display position, that is, for the scene position of the virtual object in the virtual scene that has been recorded by the terminal, the scene position may not have been adjusted based on the movement operation before the first movement operation, while the display position is the position adjusted based on the movement operation before the first movement operation. In the related art, when the terminal detects a movement operation on the virtual object, it waits to receive a movement instruction returned by the server for the movement operation. In response to the movement instruction, the terminal adjusts the scene position of the virtual object in the virtual scene recorded by the terminal and the display position of the virtual object in the scene interface. Then, the scene position of the virtual object in the virtual scene recorded by the terminal and the display position of the virtual object in the scene interface remain synchronized. In the embodiment of the present application, when the terminal detects a movement operation on a virtual object, the terminal will give priority to displaying the movement of the virtual object in the scene interface so as to be able to promptly present the picture of the virtual object moving under the influence of the movement operation. At this time, the terminal has not yet received the movement instruction returned by the server for the movement operation, and the scene position of the virtual object recorded in the terminal in the virtual scene has not changed. The scene position of the virtual object recorded in the terminal in the virtual scene will lag behind the display position of the virtual object in the scene interface.
[0077] In an embodiment of the present application, the movement speed of the virtual object is related to the properties of the virtual object itself. For example, the movement speed of the virtual object is related to the virtual vehicle that the virtual object is currently riding, or the virtual equipment worn by the virtual object. The operation duration of the first movement operation is equivalent to the duration of controlling the movement of the virtual object under the action of the first movement operation. Optionally, the operation duration of the first movement operation is the triggering duration of the first movement operation. For example, if the first movement operation is a triggering operation for the movement option of the virtual object, the duration of pressing the movement option is the operation duration; or, if the first movement operation is triggered by a virtual joystick, the triggering duration of the virtual joystick is the operation duration.
[0078] In an embodiment of the present application, a first predicted scene position is obtained based on the scene position corresponding to the display position in the virtual scene, the first moving direction, the moving speed of the virtual object and the operation duration of the first moving operation, so that the first predicted scene position is the position that the virtual object may reach under the action of the first moving operation, so as to ensure the accuracy of the first predicted scene position, so as to ensure the accuracy of the subsequent control of the virtual object movement based on the first predicted scene position.
[0079] Optionally, the process of obtaining the first predicted scene position includes: multiplying the product of the moving speed of the virtual object and the operation duration as the displacement, and determining the position with the determined scene position as the starting point, along the first moving direction, and the distance from the starting point to the displacement as the first predicted scene position.
[0080] In an embodiment of the present application, the displacement is determined based on the movement speed and operation duration of the virtual object, and the first predicted scene position is determined based on the displacement, the scene position of the virtual object in the virtual scene currently recorded by the terminal, and the first movement direction to ensure the accuracy of the first predicted scene position.
[0081] In one possible implementation, the process of obtaining the first predicted scene position includes: performing collision detection on the current display position of the virtual object in the scene interface, the first moving direction, and the environmental parameters of the virtual scene to obtain a collision result, where the environmental parameters indicate obstacles in the virtual scene, and the collision result indicates a collision situation when the virtual object moves in the first moving direction in the virtual scene; based on the collision result, the current display position of the virtual object in the scene interface, and the first moving direction, obtaining the first predicted scene position.
[0082] In an embodiment of the present application, there are obstacles in the virtual scene. When a virtual object moves along a first moving direction in the virtual scene, there may be obstacles that affect the movement of the virtual object. For example, virtual buildings in the virtual scene or the boundaries of the virtual scene will affect the movement of the virtual object. Therefore, before predicting the first predicted scene position according to the current display position of the virtual object in the scene interface and the first moving direction, a collision detection is performed on the current display position of the virtual object in the scene interface, the first moving direction and the environmental parameters of the virtual scene, and the first predicted scene position is predicted based on the collision results to ensure that the obtained first predicted scene position is consistent with the environment of the virtual scene, thereby ensuring the accuracy of the determined first predicted scene position.
[0083] Optionally, the environmental parameters indicate the position of the obstacle in the virtual scene and the range of the obstacle, wherein the range of the obstacle represents the space occupied by the obstacle in the virtual scene, and the range occupied by the obstacle is the range within which the virtual object cannot move.
[0084] Optionally, the collision detection process includes: the terminal calls a collision detection function, performs collision detection on the current display position of the virtual object in the scene interface, the first moving direction and the environmental parameters of the virtual scene, and obtains a collision result.
[0085] The collision detection function is used to detect whether a collision occurs when a virtual object moves. Optionally, the collision detection function is equivalent to a mobile collision system. Optionally, the virtual object's current display position in the scene interface, the first movement direction, and the environmental parameters of the virtual scene are stored in a mobile data component. The terminal then calls the collision detection function, obtains the virtual object's current display position in the scene interface, the first movement direction, and the environmental parameters of the virtual scene from the mobile data component, and performs collision detection on the obtained data to obtain a collision result.
[0086] In an embodiment of the present application, a mobile collision system is called to obtain collision results, and the movement of the virtual object is determined based on the collision results. When the terminal obtains the predicted scene position, or when the terminal obtains the scene position based on the movement instruction returned by the server, it can call this mobile collision system to ensure the consistency of the determined collision results, and thus ensure the consistency of the displayed position of the virtual object with the scene position recorded by the terminal.
[0087] Optionally, the collision detection process includes: based on the obstacles indicated by the environmental parameters of the virtual scene, taking the current display position of the virtual object in the scene interface as the starting point, performing ray detection along the first moving direction, and obtaining a collision result, which indicates whether a collision will occur when the virtual object moves along the first moving direction, and indicates the position reached after the collision if a collision occurs.
[0088] Optionally, the process of obtaining the first predicted scene position based on the collision result includes: when the collision result indicates that no collision occurred, the product of the moving speed of the virtual object and the operation duration is determined as the displacement, and the position with the determined scene position as the starting point, along the first moving direction, and the distance from the starting point to the position by the displacement is determined as the first predicted scene position; when the collision result indicates that a collision occurred, the position where the collision occurred is determined as the first predicted scene position; or, when the collision result indicates that a collision occurred, the position after the collision and the direction after the collision, the position after the collision is used as the starting point and the position after moving in the first moving direction after the direction after the collision is determined as the first predicted scene position.
[0089] In the embodiment of the present application, based on the specific circumstances of the collision result, the first predicted scene position is determined in different ways to ensure the accuracy of the determined first predicted scene position as much as possible.
[0090] In one possible implementation, the process of displaying the movement of the virtual object includes: the terminal adopts an interpolation mechanism to display the virtual object gradually moving toward the first predicted scene position in the scene interface.
[0091] In an embodiment of the present application, the terminal adopts an interpolation mechanism to display the virtual object in the scene interface gradually moving toward the first predicted scene position to avoid the situation where the display position of the virtual object in the scene interface jumps, so that the picture of the virtual object moving toward the first predicted scene position in the scene interface is smooth.
[0092] For example, based on the current display position of the virtual object in the scene interface and the first predicted scene position, multiple positions between the display position and the first predicted scene position are determined. In the scene interface, the virtual object is displayed by moving from the current display position to each position in sequence according to the order of the multiple positions and the first predicted scene position to ensure the smoothness of the scene interface display.
[0093] In one possible implementation, the terminal responds to the first movement operation and displays the process of the virtual object moving to the first predicted scene position in the scene interface, which can reflect the idle / run (still / running) animation display of the virtual object. That is, the user triggers the first movement operation through the terminal, and the terminal can display the virtual object from a still state to a running state or a walking state in the scene interface, so that the terminal can display the animation of the virtual object running or walking in the scene interface.
[0094] 403. In response to the second movement operation on the virtual object, the terminal sends a second movement request to the server, where the second movement request carries a second movement direction, which is the movement direction of the second movement operation.
[0095] In an embodiment of the present application, the terminal can send a first movement request to the server in response to a first movement operation on the virtual object, and promptly display the movement of the virtual object in the scene interface. Then, regardless of whether the movement instruction returned by the server for the first movement request is received, once a second movement operation on the virtual object is detected, it can also send a second movement request to the server and promptly display the movement of the virtual object in the scene interface to ensure that the terminal can respond to the movement operation in a timely manner, so that the terminal can promptly display the picture of the virtual object movement in the scene interface, avoid screen freezes, ensure human-computer interaction efficiency, and thereby improve user experience.
[0096] The first movement operation is different from the second movement operation. For example, the first movement operation and the second movement operation are two movement operations. The first movement direction and the second movement direction may be the same or different. For example, the first movement operation controls the virtual object to move eastward, and the second movement operation also controls the virtual object to move eastward.
[0097] 404. The terminal obtains a second predicted scene position based on the current display position of the virtual object in the scene interface and the second moving direction, and displays the virtual object moving toward the second predicted scene position in the scene interface. The second predicted scene position is the position that the virtual object is predicted to reach in the virtual scene under the action of the second moving operation.
[0098] In an embodiment of the present application, when the terminal detects the second movement operation on the virtual object, the virtual object may have moved to the first predicted scene position, or it may be moving towards the first predicted scene position but has not yet reached the first predicted scene position. Therefore, when the terminal detects the second movement operation on the virtual object, the current display position of the virtual object in the scene interface may be the first predicted scene position, or it may not be the first predicted scene position. However, the first display position is different from the second display position. The first display position is the display position of the virtual object in the scene interface when the terminal detects the second movement operation on the virtual object, and the second display position is the display position of the virtual object in the scene interface when the terminal detects the first movement operation on the virtual object.
[0099] Among them, the second predicted scene position is the position predicted by this end based on the second movement operation, that is, the second predicted scene position is the position that the virtual object predicted by this end may reach under the action of the second movement operation.
[0100] It should be noted that the process of the terminal obtaining the second predicted scene position based on the current display position of the virtual object in the scene interface and the second moving direction is the same as the above step 402 and will not be repeated here.
[0101] It should be noted that the embodiment of the present application is described by taking the example of the terminal sending a movement request to the server in response to a movement operation. In another embodiment, there is no need to execute the above steps 403-404, and other methods can be adopted. The terminal responds to the second movement operation of the virtual object in the scene interface, and displays the virtual object moving to the second predicted scene position in the scene interface.
[0102] 405. The terminal determines a first scene position in response to the movement instruction returned by the server in response to the first movement request. The first scene position is a position reached by the virtual object in the virtual scene under the action of the first movement operation.
[0103] In one possible implementation, step 405 includes: the terminal responds to the movement instruction returned by the server for the first movement request, and determines the first scene position based on the scene position currently recorded by the terminal, the first movement direction carried by the movement instruction, and the movement speed of the virtual object.
[0104] In an embodiment of the present application, the movement instruction returned by the server in response to the first movement request carries a first movement direction. That is, after receiving the first movement request, the server returns the movement instruction to the terminal, so that the terminal can update the recorded scene position of the virtual object in the virtual scene in response to the movement instruction to achieve control of the virtual object. The scene position currently recorded by the terminal is the scene position of the virtual object in the virtual scene, and the currently recorded scene position may be out of sync with the current display position of the virtual object in the scene interface.
[0105] In an embodiment of the present application, after the terminal responds to a movement instruction returned by the server for any movement request, it determines the new scene position of the virtual object in the virtual scene and records it to ensure the accuracy of the recorded scene position. Because when controlling the movement of the virtual object, the virtual object moves with its current position in the virtual scene as the starting point and at the virtual object's movement speed along a first movement direction, the first scene position is determined based on the scene position currently recorded by the terminal, the first movement direction carried in the movement instruction, and the virtual object's movement speed to ensure the accuracy of the determined first scene position.
[0106] 406. When the virtual object moves toward the second predicted scene position and the first scene position is different from the first predicted scene position, the terminal corrects the second predicted scene position based on the difference between the first scene position and the first predicted scene position, and displays the virtual object moving toward the corrected second predicted scene position in the scene interface.
[0107] In an embodiment of the present application, when the terminal detects a movement operation on a virtual object, it can promptly display the picture of the movement of the virtual object in the scene interface. Moreover, after receiving the movement instruction returned by the server, the scene position recorded by the terminal is updated. When the movement of the virtual object has been displayed in the scene interface, the second predicted scene position is corrected based on the difference between the first scene position and the first predicted scene position, so that the virtual object can offset the difference between the first scene position and the first predicted scene position in the process of moving to the corrected second predicted scene position, so as to ensure that the scene position recorded by the terminal and the display position of the virtual object in the scene interface are synchronized as much as possible to ensure the accuracy of the game data.
[0108] In one possible implementation, the process of correcting the second predicted scene position includes: determining a position offset vector based on the difference between the first scene position and the second predicted scene position, and offsetting the second predicted scene position based on the position offset vector to obtain a corrected second predicted scene position.
[0109] It should be noted that in an embodiment of the present application, before the terminal receives the movement instruction returned by the server for the first movement operation, the terminal has already displayed the movement of the virtual object in the scene interface in response to the second movement operation. In another embodiment, before the terminal receives the movement instruction returned by the server for the first movement operation, in addition to displaying the movement of the virtual object in the scene interface in response to the second movement operation, the terminal can also display the movement of the virtual object in the scene interface in response to other movement operations. This application does not limit this.
[0110] It should be noted that in an embodiment of the present application, before the terminal receives the movement instruction returned by the server for the first movement operation, the terminal has already displayed the movement of the virtual object in the scene interface in response to the second movement operation. In another embodiment, there is no need to execute the above steps 403-404 and step 406. Instead, other methods are adopted. When the first scene position is different from the first predicted scene position, the display position of the virtual object in the scene interface is corrected based on the first scene position.
[0111] In an embodiment of the present application, in response to a first movement operation, the terminal predicts a first predicted scene position that the virtual object may reach in the virtual scene under the action of the first movement operation, and displays the virtual object moving toward the predicted first predicted scene position in the scene interface. Then, based on the movement instruction returned by the server, the first scene position of the virtual object in the virtual scene is determined, and the determined first scene position is compared with the first predicted scene position. If the predicted first predicted scene position is inaccurate, the display position of the virtual object in the scene interface is corrected so that the display position of the virtual object in the scene interface is synchronized as much as possible with the scene position that the virtual object should reach in the virtual scene, so as to ensure the accuracy of the display position of the virtual object in the scene interface, and enable the terminal to respond to the first movement operation in a timely manner without having to wait for a long time for the movement instruction issued by the server, thereby avoiding a delay in responding to the movement operation, so that the terminal can display the picture of the virtual object moving in the scene interface in a timely manner, avoiding the situation where the picture displayed by the terminal is stuck, and thus improving the user experience.
[0112] Furthermore, the embodiments of the present application utilize a pre-display mechanism. Each time the terminal detects a move operation on a virtual object, it can promptly display the virtual object's movement in the scene interface to facilitate local game play on the terminal and enable the terminal to promptly respond to the move operation. Subsequently, upon receiving the corresponding instruction returned by the server for the move operation, the display position of the virtual object is corrected, implementing a pre-display method. The scene position recorded by the terminal lags behind the display position of the virtual object in the scene interface. This ensures that the terminal can respond promptly, mitigates the negative impact of network latency, and improves the response speed of the move operation. It also optimizes the control feel in high-latency network environments, enhancing the user's gaming experience in poor network conditions. Furthermore, upon receiving a move instruction from the server, the display position of the virtual object in the scene interface can be corrected using a rollback or interpolation method to ensure the accuracy of the game data.
[0113] It should be noted that, in the embodiment shown in FIG4 above, when the terminal detects the second movement operation, it is equivalent to the terminal no longer detecting the first movement operation, that is, there is no need to control the virtual object to move in the first movement direction. In another embodiment, when the terminal detects the first movement operation, in response to detecting the stop operation, it sends a displacement stop notification to the server and displays the virtual object stopped moving in the scene interface. Based on the displacement stop notification, the server sends the displacement stop notification to each terminal participating in the same game. The terminal receives the displacement stop notification sent by the server and determines the first scene position based on the movement instruction and the displacement stop notification returned for the first movement operation. For example, the terminal determines the operation duration corresponding to the first movement operation based on the difference between the time of receiving the movement instruction and the time of receiving the displacement stop notification, and determines the first scene position based on the operation duration, the first movement direction, and the movement speed of the virtual object, wherein the movement instruction is returned by the server for the first movement operation.
[0114] Based on the embodiments shown in Figures 3 to 4 above, in the embodiments of the present application, if the duration of the first movement operation is long, the terminal can respond to the first movement operation, predict a first predicted scene position at each time step, and display the virtual object moving to the predicted scene position, that is, the process of obtaining the first predicted scene position and displaying the virtual object moving to the first predicted scene position in the scene interface includes: obtaining the i-th first predicted scene position based on the scene position corresponding to the display position in the virtual scene, the first moving direction and the time step; displaying the virtual object moving to the i-th first predicted scene in the scene interface, where i is an integer greater than 0; obtaining the i+1-th first predicted scene position based on the i-th first predicted scene position, the first moving direction and the time step; and when the virtual object moves to the i-th first predicted scene position, displaying the virtual object moving to the i+1-th first predicted scene position in the scene interface.
[0115] The time step is any length of time, for example, the time step is 5 seconds or 2 seconds.
[0116] In an embodiment of the present application, since the first movement operation is a long-term movement operation, for example, the first movement operation is a long-term movement operation to the east triggered by the user, a first predicted scene position is predicted at each time step in units of time steps, and the virtual object is displayed in the scene interface moving to the first predicted position, and then the next first predicted scene position is predicted, so that under the influence of the first movement operation, the virtual object gradually moves along the first movement direction, so that when the first movement operation is continuously detected, it can respond in time, avoiding the phenomenon of screen freeze caused by displaying the movement of the virtual object until the first movement operation is no longer detected, thereby ensuring the continuity of the movement of the virtual object and the accuracy of the movement of the virtual object along the first movement direction.
[0117] Following the above process, the first predicted scene position is predicted multiple times, and the virtual object is displayed moving toward the predicted scene position until the first movement operation is no longer detected. The first movement operation is no longer detected, which means that a movement operation other than the first movement direction is detected, or the movement operation is no longer detected, or a skill release operation of the virtual object is detected.
[0118] In the above process, if the first movement operation is no longer detected and the remaining operation duration is less than the time step, the nth first predicted scene position is obtained based on the n-1th first predicted scene position, the first movement direction, and the remaining operation duration; if the virtual object moves to the n-1th first predicted scene position, the scene interface displays the virtual object moving toward the nth first predicted scene position, where n is an integer greater than 1. For example, the operation duration of the first moving operation is greater than n-1 times the time step but less than n times the time step, that is, in the process of detecting the first moving operation, the first first predicted scene position is determined according to the above method, and the virtual object is displayed in the scene interface as moving to the first first predicted scene position; based on the second first predicted scene position, the first moving direction and the time step, the second first predicted scene position is obtained; when the virtual object moves to the first first predicted scene position, the virtual object is displayed in the scene interface as moving to the second first predicted scene position; repeating the above steps can obtain the n-1th first predicted scene position; in the scene interface, the virtual object is displayed as moving to the n-1th first predicted scene position; at this time, the remaining operation duration is the difference between the operation duration of the first moving operation and n-1 times the time step, and based on the n-1th first predicted scene position, the first moving direction and the remaining operation duration, the nth first predicted scene position is obtained; when the virtual object moves to the n-1th first predicted scene position, the virtual object is displayed as moving to the nth first predicted scene position in the scene interface.
[0119] In an embodiment of the present application, when the terminal displays the movement of a virtual object on the scene interface in response to a first movement operation, it can predict n first predicted scene positions and display the virtual object gradually moving in the scene interface. The first scene position is the scene position that the terminal determines in response to the movement instruction and needs to record, and there is no need to determine the scene position according to the time step. When the embodiment of the present application is combined with the embodiment shown in Figure 3 or Figure 4 above, taking the acquisition of n first predicted scene positions as an example, after obtaining the first scene position, the first scene position is compared with the nth first predicted scene position. If the first scene position is different from the first predicted scene position, the display position of the virtual object in the scene interface is corrected based on the first scene position.
[0120] On the basis of the embodiments shown in Figures 3 to 4 above, in the embodiments of the present application, if the duration of the first movement operation is long, the terminal will send a movement request to the server at each time step in response to the first movement operation, and after each movement request is sent to the server, the predicted scene position will be predicted, and the virtual object will be displayed in the scene interface moving to the predicted scene position, that is, the terminal sends movement requests to the server multiple times in response to the first movement operation, and the process of displaying the movement of the virtual object includes: the terminal sends a first movement request to the server at each time step in response to the first movement operation, and the terminal sends the first movement request to the server. After the first movement request, the first first predicted scene position is obtained based on the scene position, the first movement direction and the time step corresponding to the current display position of the virtual object in the scene interface in the virtual scene; in the scene interface, the virtual object is displayed moving to the first first predicted scene; after the terminal sends the jth first movement request to the server, the jth first predicted scene position is obtained based on the j-1th first predicted scene position, the first movement direction and the time step; when the virtual object moves to the j-1th first predicted scene position, in the scene interface, the virtual object is displayed moving to the jth first predicted scene position, where j is an integer greater than 1.
[0121] In an embodiment of the present application, each time the terminal sends a movement request to the server, it predicts the predicted scene position and displays the process of the virtual object moving toward the predicted scene position in the scene interface. This is similar to the above-mentioned terminal responding to the first movement operation, predicting a first predicted scene position at each interval time step, and displaying the process of the virtual object moving toward the predicted scene position, and will not be repeated here.
[0122] In an embodiment of the present application, since the first movement operation is a long-term movement operation, the terminal responds to the first movement operation and sends a movement request to the server at each time step. After each movement request is sent to the server, the terminal predicts the predicted scene position and displays the virtual object moving toward the predicted scene position in the scene interface, so that under the influence of the first movement operation, the virtual object gradually moves along the first movement direction, so that when the first movement operation is continuously detected, it can respond in time, avoiding the phenomenon of screen freeze caused by displaying the virtual object movement until the first movement operation is no longer detected, thereby ensuring the continuity of the virtual object movement and the accuracy of the virtual object movement along the first movement direction.
[0123] Based on the embodiment shown in Figure 3, in an embodiment of the present application, when the terminal receives the movement instruction returned by the server for the first movement operation, the terminal has responded to multiple movement operations of the virtual object in the scene interface, sent multiple movement requests to the server, and controlled the movement of the virtual object. The specific process is detailed in the following embodiment.
[0124] FIG5 is a flow chart of a virtual object control method provided by an embodiment of the present application. Taking the method executed by a terminal as an example, as shown in FIG5 , the method includes:
[0125] 501. In response to a first movement operation on a virtual object in a scene interface, the terminal sends a first movement request to a server. The scene interface is an interface of a virtual scene. The first movement request carries a first movement direction, which is the movement direction of the first movement operation.
[0126] 502. The terminal obtains a first predicted scene position based on the current display position of the virtual object in the scene interface and the first moving direction, and displays the virtual object moving toward the first predicted scene position in the scene interface. The first predicted scene position is the position that the virtual object is predicted to reach in the virtual scene under the action of the first moving operation.
[0127] Steps 501-502 are similar to the above steps 401-402 and will not be described again here.
[0128] 503. In response to the third movement operation on the virtual object, the terminal sends a third movement request to the server. The third movement request carries a third movement direction, which is the movement direction of the third movement operation.
[0129] The step 503 is similar to the above step 403 and will not be described again here.
[0130] 504. The terminal obtains a third predicted scene position based on the current display position of the virtual object in the scene interface and the third moving direction, and displays the virtual object moving toward the third predicted scene position in the scene interface. The third predicted scene position is the position that the virtual object is predicted to reach in the virtual scene under the action of the third moving operation.
[0131] In an embodiment of the present application, when the terminal detects the third movement operation on the virtual object, the virtual object may have moved to the first predicted scene position, or it may be moving towards the first predicted scene position but has not yet reached the first predicted scene position. Therefore, when the terminal detects the third movement operation on the virtual object, the current display position of the virtual object in the scene interface may be the first predicted scene position, or it may not be the first predicted scene position. However, the second display position is different from the third display position. The third display position is the display position of the virtual object in the scene interface when the terminal detects the third movement operation on the virtual object, and the second display position is the display position of the virtual object in the scene interface when the terminal detects the first movement operation on the virtual object.
[0132] Among them, the third predicted scene position is the position predicted by this end based on the third movement operation, that is, the third predicted scene position is the position that the virtual object predicted by this end may reach under the action of the third movement operation.
[0133] It should be noted that the process of the terminal obtaining the third predicted scene position based on the current display position of the virtual object in the scene interface and the third moving direction is the same as the above step 402 and will not be repeated here.
[0134] It should be noted that the embodiment of the present application is described by taking the example of the terminal sending a movement request to the server in response to a movement operation. In another embodiment, there is no need to execute the above steps 503-504, and other methods can be adopted. The terminal responds to the third movement operation of the virtual object in the scene interface, and displays the virtual object moving to the third predicted scene position in the scene interface.
[0135] 505. In response to the second movement operation on the virtual object, the terminal sends a second movement request to the server. The second movement request carries a second movement direction, which is the movement direction of the second movement operation.
[0136] 506. The terminal obtains a second predicted scene position based on the current display position of the virtual object in the scene interface and the second moving direction, and displays the virtual object moving toward the second predicted scene position in the scene interface. The second predicted scene position is the position that the virtual object is predicted to reach in the virtual scene under the action of the second moving operation.
[0137] Steps 505-506 are similar to the above steps 403-404 and are not described again here.
[0138] 507. The terminal determines a first scene position in response to the movement instruction returned by the server in response to the first movement request. The first scene position is a position reached by the virtual object in the virtual scene under the action of the first movement operation.
[0139] The step 507 is similar to the above step 405 and will not be described again here.
[0140] 508. When the virtual object moves toward the second predicted scene position and the first scene position is different from the first predicted scene position, the terminal corrects the second predicted scene position and the third predicted scene position based on the difference between the first scene position and the first predicted scene position, and displays the virtual object moving toward the corrected second predicted scene position in the scene interface.
[0141] In an embodiment of the present application, when the terminal detects a movement operation on a virtual object, it can promptly display the movement of the virtual object in the scene interface. Moreover, after receiving the movement instruction returned by the server, the scene position recorded by the terminal is updated. When the movement of the virtual object has been displayed in the scene interface, the second predicted scene position and the third predicted scene position are corrected based on the difference between the first scene position and the first predicted scene position, so that the virtual object can offset the difference between the first scene position and the first predicted scene position in the process of moving to the corrected second predicted scene position, and ensure that the corrected third predicted scene position offsets the difference between the first scene position and the first predicted scene position, so as to ensure that the scene position recorded by the terminal and the display position of the virtual object in the scene interface are synchronized as much as possible, and also ensure the accuracy of the predicted scene position, so as to ensure the accuracy of the game data.
[0142] The process of correcting the second predicted scene position and the third predicted scene position is the same as the process of correcting the second predicted scene position in step 406, and will not be repeated here.
[0143] In one possible implementation, the terminal will store the predicted scene position, that is, the terminal will store the first predicted scene position, the second predicted scene position and the third predicted scene position. The method also includes: when the virtual object moves toward the second predicted scene position and the first scene position is different from the first predicted scene position, the terminal corrects the second predicted scene position and the third predicted scene position based on the difference between the first scene position and the first predicted scene position, and stores the corrected second predicted scene position and the corrected third predicted scene position.
[0144] In an embodiment of the present application, the terminal stores the predicted scene position obtained by prediction, so as to subsequently compare the stored predicted scene position with the scene position obtained by the terminal based on the movement instruction, so as to correct the display position of the virtual object in the scene interface when the predicted scene position is different from the scene position obtained by the terminal based on the movement instruction. Moreover, when the stored predicted scene position is corrected, the corrected predicted scene position is stored to ensure the accuracy of the stored predicted scene position, so as to ensure that after the server returns the movement instruction corresponding to the movement request of the modified predicted scene position, the terminal obtains a new scene position based on the movement instruction, compares the corrected predicted scene position with the new scene position, and thus ensures the accuracy of the display position of the virtual object.
[0145] Optionally, the terminal stores the first predicted scene position, the second predicted scene position and the third predicted scene position in a predicted scene position queue. When the second predicted scene position and the third predicted scene position are corrected, the corrected second predicted scene position and the corrected third predicted scene position are stored in the predicted scene position queue.
[0146] Optionally, when the corrected second predicted scene position and the corrected third predicted scene position are stored, the first predicted scene position, the second predicted scene position and the third predicted scene position are deleted.
[0147] In an embodiment of the present application, after the predicted scene position obtained later is corrected based on the first predicted scene position, the first predicted scene position is no longer needed, and the second predicted scene position and the third scene position have been corrected. Therefore, the first predicted scene position, the second predicted scene position and the third predicted scene position are deleted to save storage space.
[0148] It should be noted that in an embodiment of the present application, before the terminal receives the movement instruction returned by the server for the first movement operation, the terminal has already displayed the movement of the virtual object in the scene interface in response to the third movement operation and the second movement operation. In another embodiment, there is no need to execute the above steps 503-506 and step 508. Instead, other methods are adopted. When the first scene position is different from the first predicted scene position, the display position of the virtual object in the scene interface is corrected based on the first scene position.
[0149] 509. The terminal determines a second scene position in response to the movement instruction returned by the server in response to the third movement request. The second scene position is a position reached by the virtual object in the virtual scene under the action of the third movement operation.
[0150] The step 509 is similar to the above step 405 and will not be described again here.
[0151] 510. When the virtual object moves toward the corrected second predicted scene position and the second scene position is different from the corrected third predicted scene position, the terminal corrects the corrected second predicted scene position again based on the difference between the second scene position and the corrected third predicted scene position, and displays the virtual object moving toward the corrected second predicted scene position in the scene interface.
[0152] In an embodiment of the present application, the third predicted scene position is predicted based on the first predicted scene position. The revised third predicted scene position has offset the difference between the first scene position and the first predicted scene position. Therefore, by comparing the second scene position with the revised third predicted scene position, it can be determined whether the display position of the virtual object in the scene interface still needs to be corrected. When the virtual object moves toward the revised second predicted scene position and the second scene position is different from the revised third predicted scene position, the revised second predicted scene position is further corrected based on the difference between the second scene position and the revised third predicted scene position. This allows the virtual object to offset the difference between the first scene position and the first predicted scene position, as well as the difference between the second scene position and the revised third predicted scene position, during its movement toward the revised second predicted scene position. This ensures that the revised second predicted scene position offsets the difference between the first scene position and the first predicted scene position, and the difference between the second scene position and the revised third predicted scene position. This ensures that the scene position recorded by the terminal and the display position of the virtual object in the scene interface are synchronized as much as possible, and also ensures the accuracy of the predicted scene position, thereby ensuring the accuracy of the game data.
[0153] As shown in Figure 6, the terminal displays the movement of the virtual object in the scene interface in response to the first movement operation, two third movement operations and the second movement operation. At this time, the predicted scene positions in the predicted scene position queue include S1, S2, S3 and S4, S1 is the first predicted scene position, S2 and S3 are two third predicted scene positions obtained by two third movement operations, and S4 is the second predicted scene position. The terminal responds to the movement instruction returned by the server for the first movement request, and determines that the first scene position is L1. Based on the difference between L1 and S1, S2, S3 and S4 are corrected to obtain S2', S3' and S4', and S2', S3' and S4' are stored in the predicted scene position queue. After the terminal determines the second scene position in response to the movement instruction returned by the server for the third movement request, S3' and S4' are corrected based on the difference between the second scene position and S2', and the corrected S3' and S4' are stored in the predicted scene position queue.
[0154] It should be noted that in the embodiment of the present application, the movement instruction returned by the server for the third movement request is received during the process of the virtual object moving toward the corrected second predicted scene position. In another embodiment, there is no need to execute the above steps 509-510, and only the movement of the virtual object toward the corrected second predicted scene position is displayed in the scene interface.
[0155] In an embodiment of the present application, in response to a first movement operation, the terminal predicts a first predicted scene position that the virtual object may reach in the virtual scene under the action of the first movement operation, and displays the virtual object moving toward the predicted first predicted scene position in the scene interface. Then, based on the movement instruction returned by the server, the first scene position of the virtual object in the virtual scene is determined, and the determined first scene position is compared with the first predicted scene position. If the predicted first predicted scene position is inaccurate, the display position of the virtual object in the scene interface is corrected so that the display position of the virtual object in the scene interface is synchronized as much as possible with the scene position that the virtual object should reach in the virtual scene, so as to ensure the accuracy of the display position of the virtual object in the scene interface, and enable the terminal to respond to the first movement operation in a timely manner without having to wait for a long time for the movement instruction issued by the server, thereby avoiding a delay in responding to the movement operation, so that the terminal can display the picture of the virtual object moving in the scene interface in a timely manner, avoiding the situation where the picture displayed by the terminal is stuck, and thus improving the user experience.
[0156] In an embodiment of the present application, when the terminal detects a movement operation on a virtual object, it can promptly display the movement of the virtual object in the scene interface. Moreover, after receiving the movement instruction returned by the server, the scene position recorded by the terminal is updated. When the movement of the virtual object has been displayed in the scene interface, the second predicted scene position and the third predicted scene position are corrected based on the difference between the first scene position and the first predicted scene position, so that the virtual object can offset the difference between the first scene position and the first predicted scene position in the process of moving to the corrected second predicted scene position, and ensure that the corrected third predicted scene position offsets the difference between the first scene position and the first predicted scene position, so as to ensure that the scene position recorded by the terminal and the display position of the virtual object in the scene interface are synchronized as much as possible, and also ensure the accuracy of the predicted scene position, so as to ensure the accuracy of the game data.
[0157] Based on the embodiment shown in Figure 2, in an embodiment of the present application, when the terminal receives the movement instruction returned by the server for the first movement operation, in the scene interface, the virtual object may be moving toward the first predicted scene position, or the virtual object has moved to the first predicted scene position and is in a stationary state, then the virtual object is controlled to move toward the first scene position to ensure that the display position is synchronized with the scene position. The specific process is detailed in the following embodiment.
[0158] FIG7 is a flowchart of a virtual object control method provided by an embodiment of the present application. Taking the method executed by a terminal as an example, as shown in FIG7 , the method includes:
[0159] 701. In response to a first movement operation on a virtual object in a scene interface, the terminal sends a first movement request to a server. The scene interface is an interface of a virtual scene. The first movement request carries a first movement direction, which is the movement direction of the first movement operation.
[0160] 702. The terminal obtains a first predicted scene position based on the current display position of the virtual object in the scene interface and the first moving direction, and displays the virtual object moving toward the first predicted scene position in the scene interface. The first predicted scene position is the position that the virtual object is predicted to reach in the virtual scene under the action of the first moving operation.
[0161] 703. The terminal determines a first scene position in response to the movement instruction returned by the server in response to the first movement request. The first scene position is a position reached by the virtual object in the virtual scene under the action of the first movement operation.
[0162] Steps 701-703 are similar to the above steps 301-303 and will not be repeated here.
[0163] 704. When the virtual object moves toward the first predicted scene position and the first scene position is different from the first predicted scene position, or when the virtual object has moved to the first predicted scene position and is in a stationary state and the first scene position is different from the first predicted scene position, the terminal displays in the scene interface that the virtual object moves toward the first scene position.
[0164] In an embodiment of the present application, when the terminal receives the movement instruction returned by the server in response to the first movement request, the virtual object is moving toward the first predicted scene position but has not yet moved to the first predicted scene position, indicating that the terminal displays in the scene interface that the virtual movement is responding to the first movement operation but has not yet completed the response; or, the virtual object has moved to the first predicted scene position and is in a stationary state, indicating that the terminal has responded to and completed the first movement operation. Therefore, once it is determined that the first scene position is different from the first predicted scene position, it means that the first predicted scene position to which the virtual object is heading is inaccurate, or the first predicted scene position where the virtual object is currently located is inaccurate. Therefore, the first scene position is directly used as the position that the virtual object needs to reach, and the virtual object is displayed moving to the first scene position to ensure that the display position of the virtual object in the scene interface is as consistent as possible with the scene position, thereby ensuring the accuracy of the game data.
[0165] It should be noted that the embodiment of the present application is described by taking the example of the terminal only detecting the first movement operation, while in another embodiment, there is no need to execute the above step 704, but other methods are adopted. When the first scene position is different from the first predicted scene position, the display position of the virtual object in the scene interface is corrected based on the first scene position.
[0166] In an embodiment of the present application, in response to a first movement operation, the terminal predicts a first predicted scene position that the virtual object may reach in the virtual scene under the action of the first movement operation, and displays the virtual object moving toward the predicted first predicted scene position in the scene interface. Then, based on the movement instruction returned by the server, the first scene position of the virtual object in the virtual scene is determined, and the determined first scene position is compared with the first predicted scene position. If the predicted first predicted scene position is inaccurate, the display position of the virtual object in the scene interface is corrected so that the display position of the virtual object in the scene interface is synchronized as much as possible with the scene position that the virtual object should reach in the virtual scene, so as to ensure the accuracy of the display position of the virtual object in the scene interface, and enable the terminal to respond to the first movement operation in a timely manner without having to wait for a long time for the movement instruction issued by the server, thereby avoiding a delay in responding to the movement operation, so that the terminal can display the picture of the virtual object moving in the scene interface in a timely manner, avoiding the situation where the picture displayed by the terminal is stuck, and thus improving the user experience.
[0167] In an embodiment of the present application, once it is determined that the first scene position is different from the first predicted scene position, it means that the first predicted scene position to which the virtual object is heading is inaccurate, or the first predicted scene position where the virtual object is currently located is inaccurate. Therefore, the first scene position is directly used as the position to which the virtual object needs to reach, and the virtual object is displayed moving to the first scene position to ensure that the display position of the virtual object in the scene interface is as consistent as possible with the scene position, thereby ensuring the accuracy of the game data.
[0168] Based on the embodiments shown in Figures 2 to 7 above, the terminal includes a presentation layer and a logic layer. The terminal displays virtual objects in the scene interface through the presentation layer and can display the movement of virtual objects in the scene interface; the terminal can record the scene position of the virtual object in the virtual scene through the logic layer. The scene position is equivalent to the logical position recorded by the logic layer, so that the terminal uses the scene position to correct the display position of the virtual object in the scene interface through the presentation layer. The display position is equivalent to the presentation position of the virtual object presented by the presentation layer. When the terminal displays the scene interface, the user can trigger the movement operation of the virtual object through the scene interface displayed by the terminal. After the terminal detects the movement operation, it not only sends a movement request to the server, but also obtains the predicted scene position through the presentation layer as shown in the above embodiment, and displays the virtual object moving to the predicted scene position in the scene interface based on the movement direction and the movement speed of the virtual object. Then, the terminal determines the scene position of the virtual scene in the virtual scene in response to the movement instruction returned by the server for the movement request through the logic layer. When the scene position is different from the predicted scene position, the display position of the virtual object in the scene interface is corrected based on the scene position through the presentation layer, so that the display position of the virtual object in the scene interface in the presentation layer is the same as the scene position of the virtual object in the virtual scene in the logic layer.
[0169] Ideally, a user triggers a movement operation through a terminal to control the movement of a virtual object in a virtual scene. No packet loss occurs during the interaction between the terminal and the server, and the terminal's presentation layer frame rate is the same as the logical layer frame rate. The terminal then executes the same movement instructions through both the logical and presentation layers. Network latency alone causes the logical layer's movement to lag behind the presentation layer's. Ultimately, the scene position obtained through the logical layer is the same as the display position obtained through the presentation layer, thereby ensuring the accuracy of the virtual object's display position in the scene interface and the accuracy of the game data. In this application example, for the same virtual object, multiple terminals participating in the same game record the same scene position of the virtual object in the virtual scene.
[0170] In actual situations, the scene location determined by the terminal may differ from the predicted scene location. The reasons include the following three:
[0171] The first reason is the connection between movement operations and skill release operations. In games, there may be situations where the movement of a virtual object is prohibited when the virtual object releases a skill. In an embodiment of the present application, the terminal responds to the movement operation through the presentation layer to control the movement of the virtual object in the virtual scene; the terminal responds to the movement instruction returned by the server through the logic layer to update the display position of the virtual object. Since there is no pre-performance mechanism for the release of virtual object skills, but a pre-performance mechanism is adopted for the movement operation of the virtual object, therefore, in the process of displaying the movement of the virtual object on the scene interface using the pre-performance mechanism, in response to the release operation of the virtual object skill, a skill release request is sent to the server; if the terminal has not yet received the skill release instruction returned by the server in response to the skill release request, the terminal detects the movement operation of the virtual object through the presentation layer and displays the movement of the virtual object in the scene interface in the above manner; if the terminal receives the skill release instruction returned by the server in response to the skill release request through the logic layer, the virtual object is in a prohibited movement state, and the virtual object skill release is displayed in the scene interface. While a virtual object is in a prohibited movement state, the terminal only sends a movement request to the server in response to a move operation on the virtual object in the scene interface, and no longer controls the movement of the virtual object based on the movement operation. Furthermore, because the movement instructions returned by the server in response to a move request may lag, while the virtual object is in a prohibited movement state, the terminal may receive a movement instruction returned by the server in response to a target move request. However, the terminal will not respond to the movement instruction corresponding to the target move request through the logic layer. The target move request is a move request sent to the server before the release operation of the virtual object's skill is triggered, but the terminal has already responded to the movement operation corresponding to the target move request through the presentation layer. Therefore, while the virtual object is in a "prohibited movement state," the movement operations prohibited from responding to the presentation layer and the logic layer may be different. Throughout the entire movement and skill connection process, the movement operations pre-performed and executed by the logic layer are also different, resulting in a difference between the scene position determined by the logic layer and the predicted scene position determined by the presentation layer.
[0172] The second reason is the difference between the presentation layer frame rate and the logic layer frame rate. For frame-synchronized games, the server only forwards movement requests sent by terminals to terminals participating in the same game, which then perform the calculations involved in the game. The logical frame update interval is fixed. Assuming the logical frame rate is 15 frames, regardless of how the terminal's presentation frame rate fluctuates, the logical update interval remains fixed. However, the presentation frame rate fluctuates across different game scenes and at different times. Even if the user doesn't trigger any actions through the terminal, the presentation frame rate will fluctuate. Furthermore, due to network fluctuations, the number of presentation frame updates corresponding to each logical frame is also not fixed. This results in different cumulative update intervals for all presentation frames corresponding to the same logical frame. At the same movement speed, the character's displacement distance in the presentation layer and the logic layer is different. In the embodiments of the present application, both the presentation layer and the logic layer determine the position of the virtual object in each frame on a frame-by-frame basis. Since the frame rate of the presentation layer and the frame rate of the logic layer are different, each frame corresponding to the presentation layer does not correspond one-to-one with each frame corresponding to the logic layer. That is, the game moments corresponding to the frames corresponding to the presentation layer and the frames corresponding to the logic layer are inconsistent. For the same moving operation, at the end of the moving operation, the display position of the virtual object determined by the presentation layer is different from the scene position of the virtual object determined by the logic layer, which may cause a difference between the scene position determined by the terminal and the predicted scene position.
[0173] The third cause is network packet loss. Network packet loss is a common problem in network communications. For frame-synchronized games, to ensure consistency in server frame commands received by different clients, a retransmission mechanism is typically implemented to ensure reliable downlink transmission from the server to the client. Because network packet loss can occur during terminal-server interaction, if the server doesn't receive the first move request sent by the terminal, indicating packet loss, this can lead to a discrepancy between the first scene position determined by the terminal and the first predicted scene position.
[0174] Therefore, according to the solution provided in the embodiment of the present application, not only can a pre-performance mechanism be adopted so that the terminal can display the movement of virtual objects in the scene interface in advance, but also the display position of the virtual object in the scene interface can be corrected after the scene position is determined, which not only ensures the accuracy of the game data, but also enables the terminal to respond to the first movement operation in a timely manner without having to wait for a long time for the movement instruction issued by the server, thereby avoiding a delay in the response to the movement operation, and enabling the terminal to display the picture of the virtual object movement in the scene interface in a timely manner, avoiding the situation where the picture displayed by the terminal is stuck, thereby improving the user experience.
[0175] Based on the embodiments shown in Figures 2 to 7 above, the embodiments of the present application can also trigger the release operation of the virtual object's displacement skill to display the virtual object moving to the landing point of the displacement skill in the scene interface. The specific process is detailed in the following embodiments.
[0176] FIG8 is a flow chart of a virtual object control method provided in an embodiment of the present application. Taking the method executed by a terminal as an example, as shown in FIG8 , the method includes:
[0177] 801. In response to a release operation of a displacement skill of a virtual object, the terminal sends a skill release request to a server. The skill release request carries the displacement skill and the displacement direction of the displacement skill.
[0178] In an embodiment of the present application, the user can not only trigger the movement operation of the virtual object through the scene interface displayed by the terminal, but also trigger the release operation of the displacement skill of the virtual object, thereby controlling the movement of the virtual object.
[0179] A displacement skill is a skill that can cause a virtual object to move. For example, any displacement skill can cause a virtual object to jump forward a first distance, sprint forward a first distance, or roll leftward a second distance, where the first and second distances are arbitrary. Releasing a displacement skill indicates that the user intends to control the virtual object to release the displacement skill in the virtual scene through the scene interface displayed on the terminal.
[0180] In one possible implementation, the displacement direction of the displacement skill is a fixed direction relative to the virtual object, or is determined by a triggered release operation.
[0181] In the embodiments of the present application, the displacement direction of a displacement skill is a fixed direction relative to the virtual object, such as the displacement direction of the displacement skill is directly in front of the virtual object, or to the left of the virtual object, etc. Where the direction of virtual displacement is determined by a release operation, the displacement direction of the displacement skill is the direction selected by the user when triggering the release operation of the displacement skill through the scene interface displayed on the terminal, that is, the direction in which the user wants the virtual object to move when the displacement skill is released.
[0182] In one possible implementation, an option for a displacement skill of a virtual object is displayed in a scene interface, and the terminal detects a triggering operation on the option for the displacement skill, which is equivalent to detecting a release operation on the displacement skill.
[0183] Optionally, step 801 includes: in response to a pressing operation on the displacement skill option, displaying a direction guidance mark in the scene interface, the direction guidance mark indicating the displacement direction of the displacement skill; in response to a release operation on the displacement skill option, sending a skill release request to the server, the skill release request carries the displacement skill and the displacement direction indicated by the direction guidance mark displayed when the release operation is detected.
[0184] 802. The terminal responds to the skill release instruction returned by the server in response to the skill release request, and determines a third scene position based on the scene position of the virtual object when the displacement skill is released, the displacement skill and the displacement direction in the skill release instruction. The third scene position is the position reached by the virtual object after releasing the displacement skill in the virtual scene.
[0185] In an embodiment of the present application, the scene position of the virtual object when the displacement skill is released is the scene position of the virtual object in the virtual scene recorded by the terminal. The displacement skill in the skill release instruction can be expressed in any form. For example, the skill release instruction carries a skill identifier, and the terminal can determine the corresponding displacement skill based on the skill identifier. Based on the displacement skill in the skill release instruction, the displacement generated when the virtual object releases the displacement skill in the virtual scene can be determined. Taking the scene position of the virtual object when the displacement skill is released as the starting point, the position after the displacement generated by the displacement skill is moved along the displacement direction is the third scene position. The terminal will record the scene displacement.
[0186] 803. The terminal displays the virtual object in the scene interface, moving from the current display position to the third scene position.
[0187] In an embodiment of the present application, since the user controls the virtual object through the terminal to release the displacement skill in the virtual scene, the position reached by the virtual object after the displacement skill is released is required to be high in order to ensure the accuracy of the skill release, and the virtual object releases the displacement skill and reaches the third scene position. Therefore, regardless of whether the virtual object is currently in a stationary state or heading towards a predicted scene position, when the third scene position is determined, the virtual object is immediately controlled to gradually move from the current display position to the third scene position, so that the virtual object moves to the third scene position, thereby ensuring the accuracy of the skill release.
[0188] 804. When the virtual object moves toward the third scene position, the terminal displays a special effect of the virtual object releasing a displacement skill.
[0189] In an embodiment of the present application, as the virtual object moves toward the third scene location, the terminal displays a special effect of the virtual object releasing a displacement skill on the scene interface, thereby enriching the content displayed in the scene interface and improving the display effect of the scene interface. The special effect of releasing a displacement skill can be any form of special effect. For example, if the displacement skill instructs the virtual object to sprint forward, then as the virtual object moves to the third scene location, a special effect of the virtual object sprinting forward is displayed on the scene interface, and a sprinting light wave special effect is displayed around the virtual object.
[0190] It should be noted that the embodiment of the present application is described by taking the display of special effects as an example, but in another embodiment, there is no need to execute the above step 804 and the special effects are no longer displayed.
[0191] In an embodiment of the present application, the third scene position reached by the virtual object after releasing the displacement skill is used as the skill landing point. Since the skill landing point is the position that the user expects the virtual object to reach, no matter whether the virtual object is currently in a stationary state or heading towards a predicted scene position, when the third scene position is determined, the virtual object is immediately controlled to gradually move from the current display position to the third scene position, so that the virtual object moves to the third scene position, thereby ensuring the accuracy of the skill release, and avoiding the virtual object from teleporting or jittering in the scene screen, ensuring that the movement of the virtual object is displayed smoothly and continuously.
[0192] It should be noted that the embodiment shown in FIG8 above is described by taking the release of displacement skills as an example. In another embodiment, the terminal responds to the release operation of other skills of the virtual object and implements the display position correction of the virtual object in the scene interface according to the embodiment shown in FIG8 above.
[0193] As shown in Figure 9, if the terminal does not receive the skill release instruction returned by the server for the skill release request, the virtual object moves from the current display position in the scene interface according to the original interpolation vector of the presentation layer. When the terminal receives the skill release instruction returned by the server for the skill release request and does not display the movement of the virtual object according to the embodiment shown in Figure 8 above, the terminal determines the third scene position through the logic layer according to the logic layer movement vector. The virtual object moves from the current display position in the scene interface according to the original interpolation vector of the presentation layer, and then teleports and jitters, and is displayed at the third scene position. This will cause the virtual object in the scene interface to teleport and jitter. Therefore, according to the embodiment shown in Figure 8 above, when the terminal receives the skill release instruction returned by the server for the skill release request, the third scene position is determined, and the virtual object is displayed moving from the current display position to the third scene position, that is, moving along the dotted line direction in Figure 9.
[0194] In addition, when the user controls the virtual object to release a skill through the scene interface displayed by the terminal, the terminal will display an animation of the virtual object releasing the skill to indicate that the virtual object is preparing to release the skill. At this time, the terminal detects the movement operation of the virtual object and controls the movement of the virtual object, thereby interrupting the release of the skill by the virtual object. When the terminal detects that the release of the virtual object's skill is interrupted, it displays the movement of the virtual object in the scene interface.
[0195] Optionally, in response to the skill release operation of the virtual object, the terminal controls the virtual object to release the skill in the virtual scene through the logic layer, and in response to detecting through the presentation layer that the skill release of the virtual object is interrupted, the terminal displays the movement of the virtual object in the scene interface.
[0196] In games, virtual objects may be prohibited from moving when releasing skills. Since there's no pre-rendering mechanism for releasing skills, while a pre-rendering mechanism is implemented for virtual object movement, when the pre-rendering mechanism is used to display virtual object movement on the scene interface, a skill release request is sent to the server in response to the skill release operation. The virtual object's skill release is then displayed on the scene interface only after the terminal receives the skill release instruction returned by the server in response to the skill release request. Therefore, the skill release process is executed after network latency. Therefore, in a skill's "prohibited movement state," the movement operations prohibited from responding to them may be different between the presentation layer and the logic layer. Throughout the entire movement and skill connection process, the movement operations executed by the pre-rendering and the movement operations executed by the logic layer are also different.
[0197] Based on the embodiments shown in Figures 2 to 8 above, when a virtual object releases a skill in a virtual scene, the virtual object may be in a prohibited movement state. That is, the virtual object may not be able to move during the process of releasing the skill in the virtual scene. The skill may be a displacement skill or other skill. In addition, the embodiments of the present application only apply a pre-display mechanism to the movement operation of the virtual object, and there is no pre-display mechanism for the release of the virtual object's skill. Therefore, the terminal's display of the virtual object's skill release in the scene interface may lag behind the skill release operation triggered by the user through the terminal. That is, the skill release process will not be executed until the network delay time. When the user triggers the release operation of the virtual object's skill through the scene interface displayed by the terminal, the terminal will send a skill release request to the server. If the terminal has not yet received the skill release instruction returned by the server, the terminal will detect the movement operation of the virtual object and display the virtual object movement in the scene interface in the manner described above. When the terminal receives the skill release instruction returned by the server in response to the skill release request, it will display the virtual object's skill release in the scene interface. At this time, the virtual object is in a prohibited movement state. While the virtual object is in a prohibited movement state, the terminal may receive a movement instruction returned by the server in response to a target movement request. However, the terminal will not respond to the movement instruction corresponding to the target movement request through the logic layer. The target movement request refers to a movement request sent to the server before the release operation of the virtual object's skill is triggered, but the terminal has already responded to the movement operation corresponding to the target movement request through the presentation layer. In addition, while the virtual object is in a prohibited movement state, the terminal only sends a movement request to the server in response to a movement operation on the virtual object in the scene interface, but the movement of the virtual object is not displayed in the scene interface. When the state of the virtual object is updated to a movable state, the terminal sends a movement request to the server in response to a movement operation on the virtual object in the scene interface, determines a predicted scene position based on the movement operation, and displays the virtual object moving to the predicted scene position in the scene interface. Afterwards, when the terminal receives the movement instruction returned by the server in response to the movement request, it will determine whether to execute the movement instruction based on the length of time the virtual object is in the prohibited movement state and the operation duration of the movement operation corresponding to the movement request. The terminal will not execute the movement instruction received during the process of the virtual object being in the prohibited movement state. In addition, the terminal will also correct the predicted scene position when the virtual object ends the prohibited movement state, so as to eliminate the impact of the terminal not executing the movement instruction received during the process of the virtual object being in the prohibited movement state. When the virtual object ends the prohibited movement state, the terminal can control the movement of the virtual object based on the corrected predicted scene position, so that the display position of the virtual object in the scene interface is as consistent as possible with the scene position of the virtual object in the virtual scene recorded in the terminal.
[0198] In one possible implementation, the process of correcting the predicted scene position of a virtual object when it ends a prohibited movement state includes: when the virtual object is in the prohibited movement state, the terminal responds to a movement operation of the virtual object in a scene interface, determines a first displacement corresponding to the movement operation, determines a second displacement corresponding to an unexecuted movement instruction, and determines a new predicted scene position based on the predicted scene position, the first displacement, the second displacement, and the skill position when the virtual object begins to be in the prohibited movement state. When the virtual object ends the prohibited movement state, the terminal displays in the scene interface that the virtual object moves to the new predicted scene position.
[0199] The unexecuted movement instructions are movement instructions received by the terminal from the server in response to a movement request sent by the terminal, and the corresponding movement time period falls within the time period when the virtual object is in a prohibited movement state. When the terminal receives a skill release instruction returned by the server in response to a skill release request, the predicted scene position to which the virtual object in the scene interface moves is the predicted scene position when the virtual object was initially in a prohibited movement state.
[0200] Optionally, based on the predicted scene position, first displacement, second displacement and skill position when the virtual object starts to be in the prohibited movement state, a new predicted scene position is determined, satisfying the following relationship: L_end=R_start+R_forbid-L_forbid+L_skill L_end=L_start+L_skill+L_undone L_start+L_forbid+L_undone=R_start+R_forbid
[0201] Among them, L_end is the new predicted scene position, that is, when the virtual object ends the prohibited movement state, the virtual object is displayed in the scene interface moving to L_end to correct the display position of the virtual object; R_start represents the predicted scene position when the virtual object starts to be in the prohibited movement state, that is, the predicted scene position of the terminal at the beginning of the "prohibited movement state" through the presentation layer, R_start is a known variable; and R_forbid is the first displacement, that is, the presentation layer fails to perform the displacement corresponding to the movement operation due to the virtual object being in the prohibited movement state, L_forbid is the second displacement, that is, the logical The logic layer is unable to execute the displacement corresponding to the movement operation because the virtual object is in a prohibited movement state. The first displacement and the second displacement can be calculated and updated according to their respective movement directions when the logic frame and the presentation frame are updated; L_skill is the displacement generated by the released skill itself in the logic layer, that is, when the skill is a displacement skill, the displacement generated by the displacement skill, and L_skill is a known variable; L_start represents the scene position of the terminal at the beginning of the "prohibited movement state" through the logic layer, and L_start is a known variable; L_undone represents the displacement corresponding to the movement instruction that has not been executed through the logic layer after the skill "prohibited movement state" ends.
[0202] As shown in Figure 10, each arrow in Figure 10 represents a move operation. Each arrow in the UI layer represents a user-triggered move operation, and the box in the UI layer represents a skill release operation. Each arrow in the presentation layer represents the terminal's response to each move operation through the presentation layer. Specifically, for each move operation, the terminal obtains a predicted scene position and displays the virtual object moving toward the predicted scene position in the scene interface. Each arrow in the logic layer represents the terminal's response to each move operation through the logic layer. During the process of the terminal responding to a move operation in the UI layer through the presentation layer, if the terminal receives a release instruction returned by the server for a skill release operation and determines that the virtual object is in a prohibited movement state, the terminal, through the presentation layer, will not execute the move operation represented by the seven leftward move operation arrows. During the process of the terminal responding to a move operation in the UI layer through the logic layer, if the terminal determines that the virtual object is in a prohibited movement state, the terminal, through the logic layer, will not execute the move operation represented by the two rightward move operation arrows and the five leftward move operation arrows. When the state of the virtual object is updated to a movable state, that is, when the virtual object ends the prohibited movement state, the new predicted scene position is determined in accordance with the above method, and the virtual object is controlled to move to the new predicted scene position through the presentation layer.
[0203] Based on the embodiments shown in Figures 2 to 10 above, the terminal can use frame synchronization technology to display the scene interface. For example, the terminal divides the game process according to a fixed time. At the beginning of each frame, multiple terminals participating in the same game have the same game data. When receiving the movement command returned by the server, each terminal will determine the game data for the next frame according to the fixed time and use the game data of the next frame as the initial state of the next frame. This has the advantages of high real-time performance and small amount of synchronized data, which is more suitable for online games such as MOBA with frequent operations and fast response times.
[0204] Based on the embodiments shown in Figures 2 to 10 above, the embodiments of the present application also provide an indicator based on movement and operation vectors as a standard for quantifying the feel of mobile control. This standard can be applied to various types of games and can be used to detect the feel of mobile control in games. Let the unit vector of the movement direction be J_dir, the movement speed be v, and the time interval between each presentation layer update of the presentation frame be t. That is, when the scene interface is displayed through the presentation layer, the interval between two adjacent presentation frames is t. Then, when the user triggers a movement operation through the terminal to control the movement of the virtual object, the expected presentation layer displacement vector is: J_delta = J_dir*v*t. After each presentation layer update, based on the position of the virtual object in the two presentation frames before and after the update, the displacement vector of the presentation layer position is determined to be V_delta. As shown in Figure 11, the mobile feel index is defined as: diff = |J_delta-V_delta|. Diff represents the modulus of the difference between the expected presentation layer displacement vector and the actual presentation layer displacement when a user triggers a movement operation to control a virtual object through a terminal. The smaller the diff, the closer the presentation layer movement is to the user-triggered movement operation, and the better the feel. This metric is applicable to games that use common joysticks to drive character movement.
[0205] Based on the embodiments shown in FIG. 2 to FIG. 11 above, the present application further provides a flowchart of another virtual object control method, as shown in FIG. 12 , the method includes:
[0206] Step 1: The player moves the virtual joystick through the terminal. The terminal sends a movement request to the server to wait for the server to issue a movement instruction. In addition, when it is determined that the presentation layer needs to respond in time, the presentation layer predicts the scene position and adopts the interpolation movement method to display the virtual object in the scene interface moving to the predicted scene position.
[0207] Step 2. When the terminal receives the movement instruction returned by the server in response to the movement request, the terminal determines the scene position by determining that the logical layer can move, and corrects the predicted scene position through the presentation layer when the scene position is different from the predicted scene position, and displays the virtual object moving to the corrected predicted scene position.
[0208] Step 3: The player triggers the skill button through the terminal, and the terminal sends a skill release request to the server to wait for the server to issue a skill release instruction.
[0209] Step 4. The terminal receives the skill release instruction returned by the server, executes the skill through the logic layer, waits for the skill afterswing to end, that is, waits for the skill release to end, displays the virtual object releasing the skill in the scene interface through the presentation layer, and updates the predicted scene position to show that the virtual object moves to the updated predicted scene position.
[0210] Step 5. The terminal determines whether the movement of the virtual object is prohibited when the skill is executed. If the movement of the virtual object is prohibited when the skill is executed, the terminal displays the virtual object stopping movement in the scene interface through the presentation layer; determines whether the skill is a displacement skill. If the skill is a displacement skill, the terminal determines the third scene position through the presentation layer according to the embodiment shown in Figure 8 above, and displays the virtual object moving from the current display position to the third scene position.
[0211] FIG13 is a schematic diagram of the structure of a virtual object control device provided in an embodiment of the present application. As shown in FIG13 , the device includes:
[0212] Display module 1301, configured to, in response to a first movement operation on a virtual object in a scene interface, display, in the scene interface, that the virtual object moves to a first predicted scene position, where the first predicted scene position is a position predicted by the local terminal based on the first movement operation;
[0213] Correction module 1302 is used to correct the display position of the virtual object in the scene interface based on the first scene position when the first scene position is different from the first predicted scene position. The first scene position is the position determined by this end based on the movement instruction returned by the server for the first movement operation.
[0214] In one possible implementation, the device further includes: a sending module 1303, configured to send a first movement request to a server in response to a first movement operation on a virtual object in a scene interface, where the scene interface is an interface of a virtual scene, and the first movement request carries a first movement direction, where the first movement direction is a movement direction of the first movement operation;
[0215] The display module 1302 is configured to obtain a first predicted scene position based on the current display position of the virtual object in the scene interface and the first moving direction, and display the virtual object moving toward the first predicted scene position in the scene interface;
[0216] The determination module 1304 is configured to determine a first scene position in response to the movement instruction returned by the server for the first movement request, where the first scene position is the position reached by the virtual object in the virtual scene under the action of the first movement operation.
[0217] In another possible implementation, the display module 1301 is used to determine the scene position corresponding to the display position in the virtual scene, where the scene position is the current position of the virtual object in the virtual scene; based on the determined scene position, the first moving direction, the moving speed of the virtual object and the operation duration of the first moving operation, the first predicted scene position is obtained.
[0218] In another possible implementation, the correction module 1302 is configured to display, in the scene interface, the virtual object moving toward the first predicted scene position when the virtual object moves toward the first predicted scene position and the first scene position is different from the first predicted scene position.
[0219] In another possible implementation, the correction module 1302 is used to display, in the scene interface, the virtual object moving toward the first scene position when the virtual object has moved to the first predicted scene position and is stationary and the first scene position is different from the first predicted scene position.
[0220] In another possible implementation, the display module 1301, in response to the second movement operation on the virtual object, displays the virtual object moving to the second predicted scene position in the scene interface, where the second predicted scene position is the position predicted by this end based on the second movement operation.
[0221] In another possible implementation, the sending module 1303 is further configured to send a second movement request to the server in response to a second movement operation on the virtual object, where the second movement request carries a second movement direction, and the second movement direction is a movement direction of the second movement operation;
[0222] The display module 1301 is also used to obtain a second predicted scene position based on the current display position of the virtual object in the scene interface and the second moving direction, and display the virtual object moving to the second predicted scene position in the scene interface. The second predicted scene position is the position that the virtual object is predicted to reach in the virtual scene under the action of the second moving operation.
[0223] In another possible implementation, the correction module 1302 is used to correct the second predicted scene position based on the difference between the first scene position and the first predicted scene position when the virtual object moves to the second predicted scene position and the first scene position is different from the first predicted scene position, and display the virtual object moving to the corrected second predicted scene position in the scene interface.
[0224] In another possible implementation, the display module 1301 is further configured to, in response to a third movement operation on the virtual object, display, in the scene interface, that the virtual object moves to a third predicted scene position, where the third predicted scene position is a position predicted by the local end based on the third movement operation.
[0225] Correction module 1302 is used to correct the second predicted scene position and the third predicted scene position based on the difference between the first scene position and the first predicted scene position when the virtual object moves to the second predicted scene position and the first scene position is different from the first predicted scene position, and display the virtual object moving to the corrected second predicted scene position in the scene interface.
[0226] In another possible implementation, the sending module 1303 is further configured to send a third movement request to the server in response to a third movement operation on the virtual object, where the third movement request carries a third movement direction, and the third movement direction is a movement direction of the third movement operation;
[0227] The display module 1301 is further used to obtain a third predicted scene position based on the current display position of the virtual object in the scene interface and the third moving direction, and display the virtual object moving toward the third predicted scene position in the scene interface.
[0228] In another possible implementation, the correction module 1302 is also used to correct the corrected second predicted scene position again based on the difference between the second scene position and the corrected third predicted scene position when the virtual object moves to the corrected second predicted scene position and the second scene position is different from the corrected third predicted scene position. In the scene interface, the virtual object is displayed moving to the second-corrected second predicted scene position, and the first scene position is the position determined by this end based on the movement instruction returned by the server for the third movement operation.
[0229] In another possible implementation, the display module 1301 is used to perform collision detection on the current display position of the virtual object in the scene interface, the first moving direction and the environmental parameters of the virtual scene to obtain a collision result, where the environmental parameters indicate obstacles in the virtual scene, and the collision result indicates the collision situation when the virtual object moves in the first moving direction in the virtual scene; based on the collision result, the current display position of the virtual object in the scene interface and the first moving direction, the first predicted scene position is obtained.
[0230] In another possible implementation, the sending module 1303 is further configured to send a skill release request to the server in response to a release operation of a displacement skill of the virtual object, where the skill release request carries the displacement skill and the displacement direction of the displacement skill;
[0231] The determining module 1304 is further configured to respond to the skill release instruction returned by the server in response to the skill release request, and determine a third scene position based on the scene position of the virtual object when the displacement skill is released, the displacement skill and the displacement direction in the skill release instruction, where the third scene position is the position reached by the virtual object in the virtual scene after the displacement skill is released;
[0232] The display module 1301 is further configured to display, in the scene interface, the movement of the virtual object from the current display position to the third scene position.
[0233] In another possible implementation, the display module 1301 is further configured to display a special effect of the virtual object releasing a displacement skill while the virtual object is moving toward the third scene position.
[0234] In another possible implementation, the display module 1301 is used to obtain the i-th first predicted scene position based on the scene position, the first moving direction and the time step corresponding to the display position in the virtual scene; in the scene interface, display the virtual object moving toward the i-th first predicted scene, where i is an integer greater than 0; based on the i-th first predicted scene position, the first moving direction and the time step, obtain the i+1-th first predicted scene position; when the virtual object moves to the i-th first predicted scene position, in the scene interface, display the virtual object moving toward the i+1-th first predicted scene position.
[0235] It should be noted that the virtual object control device provided in the above embodiment is merely an example of the division of the aforementioned functional modules. In actual applications, the aforementioned functions can be assigned to different functional modules as needed, that is, the internal structure of the computer device can be divided into different functional modules to complete all or part of the functions described above. Furthermore, the virtual object control device provided in the above embodiment and the virtual object control method embodiment are based on the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0236] An embodiment of the present application further provides a computer device, which includes a processor and a memory, wherein the memory stores at least one computer program, which is loaded and executed by the processor to implement the operations performed by the virtual object control method of the above embodiment.
[0237] Optionally, the computer device is provided as a terminal. Figure 14 shows a block diagram of a terminal 1400 provided in an exemplary embodiment of the present application. Terminal 1400 may be a smartphone, tablet computer, laptop computer, desktop computer, smart speaker, smartwatch, intelligent voice interaction device, smart home appliance, or vehicle-mounted terminal. Terminal 1400 may also be referred to as user equipment, portable terminal, laptop terminal, desktop terminal, or other names.
[0238] The terminal 1400 includes a processor 1401 and a memory 1402 .
[0239] The processor 1401 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 1401 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 1401 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 1401 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 1401 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0240] Memory 1402 may include one or more computer-readable storage media, which may be non-transitory. Memory 1402 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 1402 is used to store at least one computer program, which is executed by processor 1401 to implement the virtual object control method provided in the method embodiment of the present application.
[0241] In some embodiments, terminal 1400 may optionally include a peripheral device interface 1403 and at least one peripheral device. Processor 1401, memory 1402, and peripheral device interface 1403 may be connected via a bus or signal lines. Each peripheral device may be connected to peripheral device interface 1403 via a bus, signal lines, or circuit boards. Specifically, the peripheral device may include at least one of a radio frequency circuit 1404, a display screen 1405, a camera assembly 1406, an audio circuit 1407, and a power supply 1408.
[0242] The peripheral device interface 1403 can be used to connect at least one I / O (Input / Output)-related peripheral device to the processor 1401 and the memory 1402. In some embodiments, the processor 1401, the memory 1402, and the peripheral device interface 1403 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 1401, the memory 1402, and the peripheral device interface 1403 can be implemented on separate chips or circuit boards, which is not limited in this embodiment.
[0243] RF circuit 1404 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. RF circuit 1404 communicates with communication networks and other communication devices via electromagnetic signals. RF circuit 1404 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals. RF circuit 1404 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 1404 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 1404 may also include circuitry related to Near Field Communication (NFC), although this application does not limit this.
[0244] The display screen 1405 is used to display a UI (User Interface). The UI may include graphics, text, icons, videos, and any combination thereof. When the display screen 1405 is a touch screen display, the display screen 1405 also has the ability to collect touch signals on the surface or above the surface of the display screen 1405. The touch signal can be input as a control signal to the processor 1401 for processing. At this time, the display screen 1405 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 1405, which is set on the front panel of the terminal 1400; in other embodiments, there can be at least two display screens 1405, which are respectively set on different surfaces of the terminal 1400 or in a folding design; in other embodiments, the display screen 1405 can be a flexible display screen, which is set on the curved surface or folding surface of the terminal 1400. Even more, the display screen 1405 can be set to a non-rectangular irregular shape, that is, a special-shaped screen. The display screen 1405 can be made of materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).
[0245] The camera assembly 1406 is used to capture images or videos. Optionally, the camera assembly 1406 includes a front camera and a rear camera. 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 1406 may also include a flash. The flash can be a monochrome temperature flash or a dual-color temperature flash. The 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.
[0246] The audio circuit 1407 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 1401 for processing, or input into the radio frequency circuit 1404 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 1400. The microphone may also be an array microphone or an omnidirectional collection microphone. The speaker is used to convert electrical signals from the processor 1401 or the radio frequency circuit 1404 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 1407 may also include a headphone jack.
[0247] Power supply 1408 is used to power various components in terminal 1400. Power supply 1408 can be AC power, DC power, a disposable battery, or a rechargeable battery. When power supply 1408 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.
[0248] Those skilled in the art will understand that the structure shown in FIG14 does not constitute a limitation on the terminal 1400 , and may include more or fewer components than shown in the figure, or combine certain components, or adopt a different component arrangement.
[0249] Optionally, the computer device is provided as a server. Figure 15 is a structural diagram of a server provided in an embodiment of the present application. The server 1500 may have relatively large differences due to different configurations or performances, and may include one or more processors (Central Processing Units, CPU) 1501 and one or more memories 1502, wherein at least one computer program is stored in the memory 1502, and at least one computer program is loaded and executed by the processor 1501 to implement the methods provided in the above-mentioned various method embodiments. Of course, the server may also have components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output. The server may also include other components for implementing device functions, which will not be described in detail here.
[0250] An embodiment of the present application further provides a computer-readable storage medium, in which at least one computer program is stored. The at least one computer program is loaded and executed by a processor to implement the operations performed by the virtual object control method of the above embodiment.
[0251] An embodiment of the present application further provides a computer program product, including a computer program, which, when executed by a processor, implements the operations performed by the virtual object control method of the above embodiment.
[0252] The above description is merely an optional embodiment of the embodiments of the present application and is not intended to limit the embodiments of the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the embodiments of the present application shall be included in the scope of protection of the present application.
Claims
1. A virtual object control method, executed by a computer device, the method comprising: In response to a first movement operation on a virtual object in a scene interface, displaying in the scene interface that the virtual object moves to a first predicted scene position, where the first predicted scene position is a position predicted by the local end based on the first movement operation; When the first scene position is different from the first predicted scene position, the display position of the virtual object in the scene interface is corrected based on the first scene position, where the first scene position is the position determined by the local end based on the movement instruction returned by the server for the first movement operation.
2. The method according to claim 1, wherein: In response to a first movement operation on a virtual object in a scene interface, displaying, in the scene interface, that the virtual object moves toward a first predicted scene position includes: In response to the first movement operation, sending a first movement request to the server, where the first movement request carries a first movement direction, and the first movement direction is a movement direction of the first movement operation; Based on the current display position of the virtual object in the scene interface and the first moving direction, acquiring the first predicted scene position, and displaying the virtual object moving toward the first predicted scene position in the scene interface; In the case where the first scene position is different from the first predicted scene position, before correcting the display position of the virtual object in the scene interface based on the first scene position, the method further includes: The first scene position is determined in response to the movement instruction returned by the server in response to the first movement request.
3. The method according to claim 2, wherein: The acquiring the first predicted scene position based on the current display position of the virtual object in the scene interface and the first moving direction includes: Determine a scene position corresponding to the display position in the virtual scene, the scene position being the current position of the virtual object in the virtual scene; The first predicted scene position is acquired based on the determined scene position, the first moving direction, the moving speed of the virtual object, and the operation duration of the first moving operation.
4. The method according to claim 1, wherein: When the first scene position is different from the first predicted scene position, based on the first scene position, correcting the display position of the virtual object in the scene interface includes: In the case where the virtual object moves toward the first predicted scene position and the first scene position is different from the first predicted scene position, the scene interface displays the virtual object moving toward the first scene position.
5. The method according to claim 1, wherein: When the first scene position is different from the first predicted scene position, based on the first scene position, correcting the display position of the virtual object in the scene interface includes: When the virtual object has moved to the first predicted scene position and is in a stationary state, and the first scene position is different from the first predicted scene position, the scene interface displays the virtual object moving toward the first scene position.
6. The method according to claim 1, wherein: In the case where the first scene position is different from the first predicted scene position, before correcting the display position of the virtual object in the scene interface based on the first scene position, the method further includes: In response to a second movement operation on the virtual object, in the scene interface, the virtual object is displayed moving to a second predicted scene position, where the second predicted scene position is a position predicted by the local end based on the second movement operation.
7. The method according to claim 6, wherein: In response to the second movement operation on the virtual object, displaying, in the scene interface, that the virtual object moves to the second predicted scene position includes: In response to the second movement operation, a second movement request is sent to the server, wherein the second movement request carries the a second moving direction, the second moving direction being the moving direction of the second moving operation; Based on the current display position of the virtual object in the scene interface and the second moving direction, the second predicted scene position is acquired, and in the scene interface, the virtual object is displayed moving toward the second predicted scene position.
8. The method according to claim 6, wherein: When the first scene position is different from the first predicted scene position, based on the first scene position, correcting the display position of the virtual object in the scene interface includes: When the virtual object moves to the second predicted scene position and the first scene position is different from the first predicted scene position, the second predicted scene position is corrected based on the difference between the first scene position and the first predicted scene position, and the virtual object is displayed in the scene interface as moving to the corrected second predicted scene position.
9. The method according to claim 6, wherein: In response to the second movement operation on the virtual object, before displaying in the scene interface that the virtual object moves to the second predicted scene position, the method further includes: In response to a third movement operation on the virtual object, displaying, in the scene interface, that the virtual object moves to a third predicted scene position, where the third predicted scene position is a position predicted by the local end based on the third movement operation; When the first scene position is different from the first predicted scene position, based on the first scene position, correcting the display position of the virtual object in the scene interface includes: When the virtual object moves to the second predicted scene position and the first scene position is different from the first predicted scene position, the second predicted scene position and the third predicted scene position are corrected based on the difference between the first scene position and the first predicted scene position, and the virtual object is displayed in the scene interface as moving to the corrected second predicted scene position.
10. The method according to claim 9, wherein: In response to the third movement operation on the virtual object, displaying, in the scene interface, that the virtual object moves to a third predicted scene position includes: In response to the third movement operation, sending a third movement request to the server, wherein the third movement request carries a third movement direction, and the third movement direction is a movement direction of the third movement operation; Based on the current display position of the virtual object in the scene interface and the third moving direction, the third predicted scene position is acquired, and in the scene interface, the virtual object is displayed moving toward the third predicted scene position.
11. The method according to claim 9, wherein: After displaying in the scene interface that the virtual object moves to the corrected second predicted scene position, the method further includes: When the virtual object moves to the corrected second predicted scene position and the second scene position is different from the corrected third predicted scene position, the corrected second predicted scene position is corrected again based on the difference between the second scene position and the corrected third predicted scene position, and the virtual object is displayed in the scene interface as moving to the corrected second predicted scene position, and the first scene position is the position determined by the local end based on the movement instruction returned by the server for the third movement operation.
12. The method according to claim 2, wherein: The acquiring the first predicted scene position based on the current display position of the virtual object in the scene interface and the first moving direction includes: Performing collision detection on the current display position of the virtual object in the scene interface, the first moving direction, and the environmental parameters of the virtual scene to obtain a collision result, wherein the environmental parameters indicate obstacles in the virtual scene, and the collision result indicates a collision situation when the virtual object moves in the first moving direction in the virtual scene; The first predicted scene position is obtained based on the collision result, the current display position of the virtual object in the scene interface, and the first moving direction.
13. The method according to any one of claims 1 to 11, wherein: The method further comprises: In response to a release operation of a displacement skill of the virtual object, sending a skill release request to the server, wherein the skill release request carries the displacement skill and the displacement direction of the displacement skill; In response to the skill release instruction returned by the server in response to the skill release request, based on releasing the displacement skill The scene position of the virtual object, the displacement skill and the displacement direction in the skill release instruction are used to determine a third scene position, where the third scene position is the position reached by the virtual object after releasing the displacement skill in the virtual scene; In the scene interface, the virtual object is displayed moving from a current display position to the third scene position.
14. The method according to claim 13, wherein: The method further comprises: During the process of the virtual object moving to the third scene position, a special effect of the virtual object releasing the displacement skill is displayed.
15. The method according to claim 2, wherein: The acquiring the first predicted scene position based on the current display position of the virtual object in the scene interface and the first moving direction, and displaying the virtual object moving toward the first predicted scene position in the scene interface, comprises: Based on the scene position corresponding to the display position in the virtual scene, the first moving direction and the time step, obtaining the i-th first predicted scene position; in the scene interface, displaying the virtual object moving toward the i-th first predicted scene, where i is an integer greater than 0; Based on the i-th first predicted scene position, the first moving direction and the time step, the i+1-th first predicted scene position is obtained; when the virtual object moves to the i-th first predicted scene position, in the scene interface, the virtual object is displayed moving to the i+1-th first predicted scene position.
16. A virtual object control device, the device comprising: A display module, configured to, in response to a first movement operation on a virtual object in a scene interface, display in the scene interface that the virtual object moves to a first predicted scene position, where the first predicted scene position is a position predicted by the local end based on the first movement operation; A correction module is used to correct the display position of the virtual object in the scene interface based on the first scene position when the first scene position is different from the first predicted scene position. The first scene position is the position determined by the local end based on the movement instruction returned by the server for the first movement operation.
17. A computer device, comprising a processor and a memory, wherein the memory stores at least one computer program, and the at least one computer program is loaded and executed by the processor to implement the operations performed by the virtual object control method according to any one of claims 1 to 15.
18. A computer-readable storage medium, wherein at least one computer program is stored in the computer-readable storage medium, and the at least one computer program is loaded and executed by a processor to implement the operations performed by the virtual object control method according to any one of claims 1 to 15.
19. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the operations performed by the virtual object control method according to any one of claims 1 to 15.
Citation Information
Patent Citations
Synchronization method and device of motion states, storage medium and electronic device
CN109847361A
Virtual object control method, device and equipment and storage medium
CN112245921A
Collision detection method and device in virtual environment, equipment, medium and program
CN115430153A
Virtual character control method and device, equipment and storage medium
CN116059640A
Virtual object control method and device, computer equipment and storage medium
CN116943209A
