Virtual object control method and apparatus, computer device, and storage medium
Patent Information
- Application Number
- CN202310641508.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-31
- Publication Date
- 2026-10-30
- Estimated Expiration
- 2043-05-31
AI Technical Summary
但是这种方式,需长时间等待服务器下发的移动指令,从而会出现移动操作延迟的情况,导致显示的画面卡顿
[0033]在本申请实施例中,终端响应于第一移动操作,会预测在第一移动操作的作用下,虚拟对象在虚拟场景中可能会到达的第一预测场景位置,并在场景界面中显示虚拟对象向预测出的第一预测场景位置移动,而后基于服务器返回移动指令,确定出虚拟对象在虚拟场景中的第一场景位置,并将确定出的第一场景位置与第一预测场景位置进行对比,在预测出的第一预测场景位置不准确的情况下,对虚拟对象在场景界面中的显示位置进行修正,以使虚拟对象在场景界面中的显示位置与虚拟对象在虚拟场景中的场景位置尽可能同步,以保证虚拟对象在场景界面中的显示位置的准确性,且能够使得终端能够及时响应第一移动操作,无需长时间等待服务器下发的移动指令,从而避免出现移动操作延迟的情况,避免了显示的画面卡顿,进而能够提升用户体验。
Smart Images

Figure CN116943209B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a virtual object control method, apparatus, computer device, and storage medium. Background Technology
[0002] With the development of computer technology, games are becoming increasingly popular. In massively multiplayer online role-playing games (MMORPGs), players can control virtual objects to move within a virtual environment. When players control virtual objects to move within a virtual environment via a terminal, the terminal sends a movement request to the server. The server then sends movement commands to multiple terminals participating in the game, allowing each terminal to display the virtual object moving within the virtual environment based on these commands. However, this method requires a long wait for the server to send movement commands, resulting in movement delays and screen stuttering. Summary of the Invention
[0003] This application provides 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:
[0004] On the one hand, a method for controlling virtual objects is provided, the method comprising:
[0005] In response to a first movement operation on a virtual object in the scene interface of a virtual scene, a first movement request is sent to the server. The first movement request carries a first movement direction, which is the movement direction of the first movement operation.
[0006] Based on the current display position of the virtual object in the scene interface and the first movement direction, a first predicted scene position is obtained. In the scene interface, the virtual object is displayed moving towards the first predicted scene position. The first predicted scene position is the position that the virtual object is about to reach in the virtual scene under the action of the first movement operation.
[0007] In response to the movement instruction returned by the server for the first movement request, a first scene location is determined, wherein the first scene location is the position reached by the virtual object in the virtual scene under the action of the first movement operation;
[0008] If the first scene location is different from the first predicted scene location, the display position of the virtual object in the scene interface is corrected based on the first scene location.
[0009] On the other hand, a virtual object control device is provided, the device comprising:
[0010] The sending module is used to send a first movement request to the server in response to a first movement operation on a virtual object in the scene interface of the virtual scene. The first movement request carries a first movement direction, which is the movement direction of the first movement operation.
[0011] The display module is used to obtain a first predicted scene position based on the current display position of the virtual object in the scene interface and the first movement direction, and to display 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 about to reach in the virtual scene under the action of the first movement operation.
[0012] The determination module is used to determine a first scene location in response to a movement instruction returned by the server for the first movement request. The first scene location is the position reached by the virtual object in the virtual scene under the action of the first movement operation.
[0013] The 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.
[0014] In one possible implementation, the display module is configured to determine the scene position corresponding to the display position in the virtual scene, wherein the scene position is the current position of the virtual object in the virtual scene; and to obtain the first predicted scene position based on the determined scene position, the first movement direction, the movement speed of the virtual object, and the operation duration of the first movement operation.
[0015] In another possible implementation, the correction module is used to display, in the scene interface, that the virtual object moves 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, or 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.
[0016] In another possible implementation, the sending module is further configured to send a second movement request to the server in response to a second movement operation on the virtual object, the second movement request carrying a second movement direction, the second movement direction being the movement direction of the second movement operation;
[0017] The display module is further configured to obtain a second predicted scene position based on the current display position of the virtual object in the scene interface and the second movement direction, and display the virtual object moving toward the second predicted scene position in the scene interface. The second predicted scene position is the predicted position that the virtual object will reach in the virtual scene under the action of the second movement operation.
[0018] In another possible implementation, the correction module 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 to display the virtual object moving to the corrected second predicted scene position in the scene interface.
[0019] In another possible implementation, the sending module is further configured to send a third movement request to the server in response to a third movement operation on the virtual object, the third movement request carrying a third movement direction, the third movement direction being the movement direction of the third movement operation;
[0020] The display module is further configured to obtain a third predicted scene position based on the current display position of the virtual object in the scene interface and the third movement direction, and display 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 about to reach in the virtual scene under the action of the third movement operation.
[0021] The correction module 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. The correction module displays the virtual object moving to the corrected second predicted scene position in the scene interface.
[0022] In another possible implementation, the determining module is further configured to determine a second scene position in response to a movement instruction returned by the server in response to the third movement request, wherein the second scene position is the position reached by the virtual object in the virtual scene under the action of the third movement operation;
[0023] The correction module is further configured to, 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, correct the corrected second predicted scene position again based on the difference between the second scene position and the corrected third predicted scene position, and display the virtual object moving to the corrected second predicted scene position in the scene interface.
[0024] In another possible implementation, the display module is configured to perform collision detection on the current display position of the virtual object in the scene interface, the first movement direction, and the environmental parameters of the virtual scene to obtain a collision result. 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 movement 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 movement direction, the first predicted scene position is obtained.
[0025] In another possible implementation, the sending module is further configured to send a skill release request to the server in response to a release operation of the displacement skill of the virtual object, the skill release request carrying the displacement skill and the displacement direction of the displacement skill;
[0026] The determining module 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 in the skill release instruction and the displacement direction, wherein the third scene position is the position reached by the virtual object after releasing the displacement skill in the virtual scene;
[0027] The display module is also used to display, in the scene interface, the virtual object moving from its current display position to the third scene position.
[0028] In another possible implementation, the display module is also used to display the special effect of the virtual object releasing the displacement skill as the virtual object moves toward the third scene position.
[0029] In another possible implementation, the display module is configured to: obtain the i-th first predicted scene position based on the scene position corresponding to the display position in the virtual scene, the first movement direction, and the time step; display the virtual object moving towards the i-th first predicted scene position in the scene interface, where i is an integer greater than 0; obtain the (i+1)-th first predicted scene position based on the i-th first predicted scene position, the first movement direction, and the time step; and display the virtual object moving towards the (i+1)-th first predicted scene position in the scene interface when the virtual object moves to the i-th first predicted scene position.
[0030] On the other hand, a computer device is provided, the computer device including a processor and a memory, the memory storing at least one computer program, the at least one computer program being loaded and executed by the processor to perform the operations performed by the virtual object control method as described above.
[0031] On the other hand, a computer-readable storage medium is provided that stores at least one computer program, which is loaded and executed by a processor to perform the operations performed by the virtual object control method as described above.
[0032] In another aspect, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the operations performed by the virtual object control method as described above.
[0033] In this embodiment, in response to the first movement operation, the terminal predicts the 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 towards the predicted first predicted scene position in the scene interface. Then, based on the movement instruction returned by the server, the terminal determines the first scene position of the virtual object in the virtual scene and compares the determined first scene position with the first predicted scene position. If the predicted first 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 synchronized as possible with the scene position of the virtual object in the virtual scene. This ensures the accuracy of the display position of the virtual object in the scene interface and enables the terminal to respond to the first movement operation in a timely manner without waiting for a long time for the movement instruction issued by the server, thereby avoiding movement operation delays, avoiding screen lag, and improving the user experience. Attached Figure Description
[0034] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0035] Figure 1 This is a schematic diagram of the structure of an implementation environment provided in an embodiment of this application;
[0036] Figure 2 This is a flowchart of a virtual object control method provided in an embodiment of this application;
[0037] Figure 3 This is a flowchart of another virtual object control method provided in the embodiments of this application;
[0038] Figure 4 This is a flowchart of another virtual object control method provided in the embodiments of this application;
[0039] Figure 5 This is a schematic diagram illustrating a method for correcting and predicting scene location according to an embodiment of this application;
[0040] Figure 6 This is a flowchart of another virtual object control method provided in the embodiments of this application;
[0041] Figure 7 This is a flowchart of another virtual object control method provided in the embodiments of this application;
[0042] Figure 8 This is a flowchart of another virtual object control method provided in the embodiments of this application;
[0043] Figure 9 This is a flowchart of another virtual object control method provided in the embodiments of this application;
[0044] Figure 10 This is a schematic diagram of a mobile tactile index provided in an embodiment of this application;
[0045] Figure 11 This is a flowchart of another virtual object control method provided in the embodiments of this application;
[0046] Figure 12 This is a schematic diagram of the structure of a virtual object control device provided in an embodiment of this application;
[0047] Figure 13 This is a schematic diagram of the structure of a terminal provided in an embodiment of this application;
[0048] Figure 14This is a schematic diagram of the structure of a server provided in an embodiment of this application. Detailed Implementation
[0049] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.
[0050] The terms “first,” “second,” “third,” etc., used in this application may be used to describe various concepts, but unless otherwise stated, these concepts are not limited by these terms. These terms are used only to distinguish one concept from another. For example, without departing from the scope of this application, a first scene location may be referred to as a second scene location, and similarly, a second scene location may be referred to as a first scene location.
[0051] As used in this application, the terms "at least one," "multiple," "each," and "any" mean that at least one includes one, two, or more; multiple includes two or more; each refers to each of the corresponding multiple; and any means refers to any one of the multiple. For example, multiple terminals include three terminals, where each refers to each of the three terminals, and any means refers to any one of the three terminals, which could be the first terminal, the second terminal, or the third terminal.
[0052] To facilitate understanding of the embodiments of this application, some terms involved in the embodiments of this application will be explained first:
[0053] Multiplayer Online Battle Arena (MOBA) games involve at least two factions interacting within the same virtual environment. For example, a MOBA game might have two factions where players control virtual objects via a terminal to interact with virtual objects from other factions within the same virtual environment.
[0054] Virtual scene: A virtual scene is a scene displayed (or provided) when an application runs on a terminal, that is, the scene displayed when the terminal runs a game. For example, if the game is a shooting game, the virtual scene is the scene displayed when the terminal runs the game. This virtual scene is a simulation environment of the real world, or a semi-simulated, semi-fictional virtual environment, or a purely fictional virtual environment. A virtual scene can be any of a two-dimensional, 2.5-dimensional, or three-dimensional virtual scene; this application does not limit this. For example, a virtual scene includes the sky, land, and ocean, and the land includes environmental elements such as deserts and cities. Users can control virtual objects to move within the virtual scene. Of course, the virtual scene also includes virtual props, such as virtual projectiles, virtual buildings, and virtual machinery. This virtual scene can also be used to simulate real environments under different weather conditions, such as sunny days, rainy days, foggy days, or nighttime. A variety of scene elements enhances the diversity and realism of the virtual scene. Taking the open virtual world provided by this virtual scene for the game as an example, the development of the virtual world means that the virtual scene in the game is completely free and open. Players can control virtual objects to move and explore freely in any direction. The distance between the boundaries of each direction is very large. At the same time, there are also virtual objects of various shapes and sizes in the virtual scene, which can have various physical collisions or interactions with virtual objects controlled by players, artificial intelligence (AI) objects and other entities.
[0055] Virtual Object: This refers to an active virtual character within a virtual scene. Such an active object can be a virtual person, virtual animal, anime character, etc. The virtual object is a virtual representation of the user within the virtual scene. A virtual scene includes multiple virtual objects, each with its own shape and volume, occupying a portion of the virtual scene's space. Virtual objects can perform activities such as crawling, walking, running, jumping, driving, picking up items, shooting, attacking, and throwing within the virtual scene. Optionally, the virtual object can be a character controlled through client-side operations, an artificial intelligence object trained and set up in the virtual environment, or a non-player character (NPC) within the virtual scene. Optionally, the virtual object can also be a virtual character competing within the virtual scene.
[0056] Virtual props are items that can be used with virtual objects in a virtual environment. Examples include virtual weapons and virtual vehicles. In a virtual environment, virtual objects can interact with other virtual objects by using these virtual props.
[0057] It should be noted that all movement operations, release operations, and data (including but not limited to game data used for rendering scene interfaces) involved in this application have been authorized by the user or by all parties in full, and the collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant countries and regions. For example, the game data used for rendering scene interfaces involved in this application was obtained under full authorization.
[0058] The virtual object control method provided in this 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 communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Optionally, the terminal is a smartphone, tablet computer, laptop computer, desktop computer, smart speaker, smartwatch, smart voice interaction device, smart home appliance, and vehicle terminal, etc., but is not limited to these.
[0059] In some embodiments, the computer program involved in the present application embodiments may be deployed and executed on a computer device, or executed on multiple computer devices located in one location, or executed on multiple computer devices distributed in multiple locations and interconnected through a communication network. Multiple computer devices distributed in multiple locations and interconnected through a communication network can form a blockchain system.
[0060] In some embodiments, the computer device is provided as a first terminal. Figure 1 This is a schematic diagram of an implementation environment provided in an embodiment of this application. See also... Figure 1The implementation environment includes a first terminal 101, a second terminal 102, and a server 103. Both the first terminal 101 and the second terminal 102 are 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, enabling them to perform functions such as games and message interaction. Optionally, the application is an application within the operating system of the first terminal 101, or an application provided by a third party. For example, the application is a game application with game functionality; it may also have other functions, such as shopping or navigation. The first terminal 101 is the first terminal used by any user, who can manipulate virtual objects in a virtual scene through the first terminal 101. These activities include at least one of crawling, walking, running, jumping, driving, picking up, shooting, attacking, and throwing. Optionally, different users can 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 perform activities.
[0061] The first terminal 101 is used to log in to the application based on a user identifier. It interacts with the server 103 through the application to display the scene interface of the virtual scene. The first terminal 101 responds to the movement operation of objects in the scene interface through the application. It can pre-display the movement of virtual objects in the scene interface and interact with the server 103 through the application so that the server 103 sends movement instructions for the movement operation to the first terminal 101 and the second terminal 102 participating in the same game. This allows the first terminal 101 to determine the scene position of the virtual object in the virtual scene based on the movement instructions, so as to ensure that the scene position is synchronized with the display position of the virtual object in the scene interface. Similarly, the second terminal 102 can determine the scene position of the virtual object in the virtual scene based on the movement instructions, and then display the virtual object in the scene interface according to the determined scene position, so as to ensure that the scene positions of the virtual objects in the first terminal 101 and the second terminal 102 are synchronized in the virtual scene.
[0062] It should be noted that this application embodiment is described using a second terminal 102 as an example. In another embodiment, the implementation environment may also include multiple second terminals 102, which can interact with the server 103 and display the scene interface of the virtual scene according to the second terminal 102.
[0063] Figure 2 This is a flowchart of a virtual object control method provided in an embodiment of this application. Taking the method executed by a terminal as an example, as follows... Figure 2 As shown, the method includes:
[0064] 201. In response to the first movement operation of the virtual object in the scene interface of the virtual scene, the terminal sends a first movement request to the server. The first movement request carries a first movement direction, which is the movement direction of the first movement operation.
[0065] In this embodiment, the terminal displays a scene interface of a virtual scene, which displays virtual objects controlled by the terminal. When virtual objects are displayed, the user can trigger movement operations on these objects through the scene interface displayed on the terminal, controlling their movement within the virtual scene. The terminal can then display the movement of the virtual objects on the scene interface. Based on the first movement operation detected by the scene interface, the terminal sends a first movement request to the server. This allows the server to respond to the first movement request and issue movement commands to multiple terminals participating in the same game as the terminal, ensuring game data synchronization across multiple terminals.
[0066] The first movement operation can be any operation, such as instructing the virtual object to move its position within the virtual scene, or to rotate its orientation. For example, the first movement operation can instruct the virtual object to move in a first movement direction, which can be any direction, such as instructing the virtual object to move east or west.
[0067] 202. The terminal obtains the first predicted scene position based on the current display position of the virtual object in the scene interface and the first movement direction. In the scene interface, the terminal displays the virtual object moving towards the first predicted scene position. The first predicted scene position is the position that the virtual object is about to reach in the virtual scene under the action of the first movement operation.
[0068] In this embodiment, the terminal records the scene position of a virtual object within the virtual scene so that it can display the virtual object on the scene interface based on the recorded scene position. The current display position of the virtual object on the scene interface may differ from, or may be the same as, the scene position currently recorded by the terminal. Therefore, in response to a movement operation on the virtual object, the terminal predicts the scene position the virtual object might reach under the first movement operation, and then displays the virtual object on the scene interface moving towards the predicted first scene position. This allows the terminal to respond promptly to the first movement operation and, as far as possible, ensures that the display position of the virtual object on the scene interface is the same as the scene position recorded by the terminal, thus guaranteeing the accuracy of the virtual object movement displayed by the terminal. For multiple terminals participating in the same game with this terminal, the scene positions of the virtual object recorded by the multiple terminals are the same.
[0069] In this embodiment, after the terminal sends a first movement request to the server in response to the first movement operation, it can only update the scene location recorded by the terminal in response to the movement instruction returned by the server in response to the first movement operation. Since there may be network delays or other issues during the interaction between the terminal and the server, the terminal may experience a delay in receiving the movement instruction. Therefore, the terminal predicts the scene location that will be obtained in response to the movement instruction returned by the server in response to the first movement operation, that is, obtains the first predicted scene location, and immediately controls the virtual object to move to the first predicted scene location. This allows the terminal to respond to the first movement operation on the virtual object and display the virtual movement screen in a timely manner, avoiding movement operation delays and screen stuttering.
[0070] 203. The terminal responds to the movement instruction returned by the server in response to the first movement request, and determines the first scene position. The first scene position is the position reached by the virtual object in the virtual scene under the action of the first movement operation.
[0071] In this embodiment of the application, after the server receives the first move request sent by the terminal, it will return a move instruction to the terminal. At the same time, it will also return the move instruction to other terminals participating in the same game with the terminal, so that the terminals that receive the move instruction can update the recorded scene position of the virtual object in the virtual scene based on the move instruction, so as to ensure that the terminal can respond to the first move operation and ensure that the scene positions recorded by the terminals participating in the same game are synchronized.
[0072] The first scene location is the scene location updated by the terminal in response to the movement command returned by the server, based on the recorded scene location. In other words, it is the scene location that the virtual object can reach in the virtual scene under the action of the first movement operation. This first scene location is equivalent to the terminal's logical layer recording the scene location of the virtual object in the virtual scene. The terminal will record this first scene location.
[0073] 204. When the terminal's position in the first scene differs from the position in the first predicted scene, the terminal corrects the display position of the virtual object in the scene interface based on the position in the first scene.
[0074] In this embodiment, the first predicted scene position is the scene position that the virtual object may reach in the virtual scene under the action of the first movement operation. The first scene position is the scene position determined by the terminal in response to the movement command returned by the server. If the first scene position is different from the first predicted scene position, it means 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 so that the display position of the virtual object in the scene interface is as synchronized as possible with the scene position of the virtual object in the virtual scene, so as to ensure the accuracy of the display position of the virtual object in the scene interface.
[0075] In this embodiment, in response to the first movement operation, the terminal predicts the 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 towards the predicted first predicted scene position in the scene interface. Then, based on the movement instruction returned by the server, the terminal determines the first scene position of the virtual object in the virtual scene and compares the determined first scene position with the first predicted scene position. If the predicted first 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 synchronized as possible with the scene position of the virtual object in the virtual scene. This ensures the accuracy of the display position of the virtual object in the scene interface and enables the terminal to respond to the first movement operation in a timely manner without waiting for a long time for the movement instruction issued by the server, thereby avoiding movement operation delays, avoiding screen lag, and improving the user experience.
[0076] exist Figure 2 Based on the illustrated embodiment, in this embodiment of the application, when the terminal receives the movement instruction returned by the server for the first movement operation, the terminal has already responded to multiple movement operations on the virtual object in the scene interface and sent multiple movement requests to the server. For details of the process, please refer to the following embodiment.
[0077] Figure 3 This is a flowchart of a virtual object control method provided in an embodiment of this application. Taking the method executed by a terminal as an example, as follows... Figure 3 As shown, the method includes:
[0078] 301. In response to the first movement operation of a virtual object in the scene interface of the virtual scene, the terminal sends a first movement request to the server. The first movement request carries a first movement direction, which is the movement direction of the first movement operation.
[0079] In one possible implementation, the scene interface displayed on the terminal is the terminal's UI (User Interface).
[0080] In one possible implementation, a virtual joystick is displayed in the scene interface, and the terminal detects a trigger operation on the virtual joystick in the scene interface, which is equivalent to detecting the first movement operation on the virtual object.
[0081] The virtual joystick is used to control the movement of virtual objects within a virtual scene. Optionally, the virtual joystick includes a first area and a second area, with their centers overlapping. When a user presses the second area and drags it 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 this embodiment, the user can control the movement of virtual objects within the scene interface through the virtual joystick displayed on the terminal.
[0082] In one possible implementation, the scene interface displays multiple movement options for virtual objects. Different movement options correspond to different movement directions. Detecting a trigger operation on any movement option is equivalent to detecting the first movement operation on the virtual object, and the movement direction corresponding to the triggered movement option is the first movement direction.
[0083] Optionally, detecting simultaneous triggering of multiple movement options is equivalent to detecting the first movement operation on the virtual object, and the direction of the combined movement directions of the multiple triggered movement options is the first movement direction.
[0084] For the method of merging the movement directions corresponding to multiple movement options that will be triggered, the direction indicated by the vector after merging the unit direction vectors of the movement directions corresponding to each movement option that will be triggered, starting from the current position of the virtual object, is the first movement direction.
[0085] 302. The terminal obtains the first predicted scene position based on the current display position of the virtual object in the scene interface and the first movement direction. In the scene interface, the virtual object is displayed moving towards the first predicted scene position. The first predicted scene position is the position that the virtual object is about to reach in the virtual scene under the action of the first movement operation.
[0086] In one possible implementation, the process of obtaining the first predicted scene position includes: determining the scene position in the virtual scene corresponding to the current display position of the virtual object in the scene interface, wherein 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 movement direction, the movement speed of the virtual object, and the operation duration of the first movement operation.
[0087] In this embodiment, the current display position of the virtual object in the scene interface may be the same as or different from the current scene position of the virtual object in the virtual scene. The scene position corresponding to this display position in the virtual scene is equivalent to the scene position of the virtual object currently recorded by the terminal. Based on the current scene position of the 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 that the virtual object will reach after moving along the first movement direction at the movement speed for the operation duration can be determined, which is the first predicted scene position.
[0088] When the current display position of a virtual object in the scene interface is different from its corresponding scene position in the virtual scene, the scene position corresponding to the virtual scene is lagging behind the display position. That is, the scene position of the virtual object currently recorded by the terminal in the virtual scene may not have been adjusted based on the movement operation before the first movement operation, while the display position is already the position adjusted based on the movement operation before the first movement operation.
[0089] In this embodiment, the movement speed of the virtual object is related to its own attributes. For example, the movement speed of the virtual object is related to the virtual vehicle it is currently riding in or the virtual equipment it is wearing. The operation duration of the first movement operation is equivalent to the duration for which the virtual object moves under the action of the first movement operation. Optionally, the operation duration of the first movement operation is the trigger duration of the first movement operation. For example, if the first movement operation triggers the movement option of the virtual object, then the duration for pressing the movement option is the operation duration; or, if the first movement operation is triggered by a virtual joystick, then the trigger duration of the virtual joystick is the operation duration.
[0090] In this embodiment of the application, a first predicted scene position is obtained based on the scene position corresponding to the current display position of the virtual object in the scene interface, the first movement direction, the movement speed of the virtual object, and the operation duration of the first movement operation. This first predicted scene position is the position that the virtual object may reach under the action of the first movement operation, so as to ensure the accuracy of the first predicted scene position and the accuracy of subsequent control of the virtual object movement based on the first predicted scene position.
[0091] Optionally, the process of obtaining the first predicted scene position includes: determining the displacement by multiplying the movement speed of the virtual object by the operation time, and determining the position of the first predicted scene position as the starting point, along the first movement direction, and at a distance of the displacement from the starting point.
[0092] In this embodiment, the displacement is determined based on the movement speed and operation duration of the virtual object. Based on the displacement, the scene position in the virtual scene of the virtual object currently recorded by the terminal, and the first movement direction, the first predicted scene position is determined to ensure the accuracy of the first predicted scene position.
[0093] 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 movement 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 the collision situation when the virtual object moves in the first movement direction in the virtual scene; and obtaining the first predicted scene position based on the collision result, the current display position of the virtual object in the scene interface, and the first movement direction.
[0094] In this embodiment, obstacles exist in the virtual scene. When a virtual object moves along the first movement direction in the virtual scene, obstacles may affect its movement. For example, virtual buildings or the boundaries of the virtual scene can affect the movement of the virtual object. Therefore, before predicting the first predicted scene position based on the virtual object's current display position in the scene interface and the first movement direction, collision detection is performed on the virtual object's current display position in the scene interface, the first movement direction, and the environmental parameters of the virtual scene. The collision results are then used to predict the first predicted scene position to ensure that the obtained first predicted scene position matches the environment of the virtual scene and to ensure the accuracy of the determined first predicted scene position.
[0095] Optionally, environmental parameters indicate the location and extent of obstacles in the virtual scene. The extent of an obstacle represents the space it occupies in the virtual scene; the area occupied by the obstacle is the area where the virtual object cannot move.
[0096] Optionally, the collision detection process includes: the terminal calling a collision detection function to perform collision detection on the current display position of the virtual object in the scene interface, the first movement direction, and the environmental parameters of the virtual scene, and obtain the collision result.
[0097] 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 motion collision system. Optionally, the current display position of the virtual object in the scene interface, the first movement direction, and the environmental parameters of the virtual scene are stored in the motion data component. Then, the terminal calls the collision detection function to obtain the current display position of the virtual object in the scene interface, the first movement direction, and the environmental parameters of the virtual scene from the motion data component, and performs collision detection on the obtained data to obtain the collision result.
[0098] In this embodiment, a motion collision system is invoked to obtain collision results, and the movement of the virtual object is determined based on the collision results. The terminal can invoke this motion collision system when obtaining the predicted scene location, or when obtaining the scene location based on the movement instructions returned by the server, to ensure the consistency of the determined collision results, thereby ensuring the consistency between the displayed position of the virtual object and the scene location recorded by the terminal.
[0099] 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 movement direction to obtain a collision result. The collision result indicates whether a collision will occur when the virtual object moves along the first movement direction, and indicates the position reached after the collision if a collision occurs.
[0100] Optionally, the process of obtaining the first predicted scene position based on the collision result includes: if the collision result indicates that no collision has occurred, determining the product of the virtual object's movement speed and the operation time as the displacement, and determining the position of the determined scene position as the starting point, along the first movement direction, and at a distance of the displacement from the starting point as the first predicted scene position; if the collision result indicates that a collision has occurred, determining the position where the collision occurred as the first predicted scene position; or, if the collision result indicates that a collision has occurred, the position after the collision, and the orientation after the collision, determining the position after moving along the first movement direction after the orientation after the collision as the first predicted scene position.
[0101] In this embodiment of the application, the location of the first predicted scene is determined in different ways based on the specific circumstances of the collision result, so as to ensure the accuracy of the determined location of the first predicted scene as much as possible.
[0102] In one possible implementation, the process of displaying the movement of a virtual object includes: the terminal using an interpolation mechanism to display the virtual object gradually moving towards the first predicted scene position in the scene interface.
[0103] In this embodiment of the application, the terminal adopts an interpolation mechanism to display virtual objects in the scene interface gradually moving towards the first predicted scene position, so as to avoid the situation where the display position of the virtual objects in the scene interface jumps, thus making the screen displaying the virtual objects moving towards the first predicted scene position in the scene interface smooth.
[0104] 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. The virtual object is then displayed in the scene interface and moves sequentially from the current display position to each of the multiple positions and the first predicted scene position to ensure the smoothness of the scene interface display.
[0105] In one possible implementation, the terminal responds to the first movement operation by displaying the process of the virtual object moving towards the first predicted scene position in the scene interface, which can reflect the idle / run (still / running) animation of the virtual object. That is, when the user triggers the first movement operation through the terminal, the terminal can display the virtual object entering the running state or entering the walking state in the scene interface, so that the terminal can display the running or walking animation of the virtual object in the scene interface.
[0106] 303. 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.
[0107] In this embodiment, in response to a first movement operation on a virtual object, the terminal can send a first movement request to the server and promptly display the movement of the virtual object in the scene interface. Subsequently, regardless of whether it receives a movement instruction from the server in response to the first movement request, 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. This ensures that the terminal can respond to movement operations in a timely manner to display the movement of the virtual object in the scene interface, thereby ensuring timely response, avoiding screen lag, ensuring human-computer interaction efficiency, and improving user experience.
[0108] The first move operation differs from the second move operation; for example, the first move operation and the second move operation are two separate move operations. The first move direction and the second move direction may be the same or different. For example, the first move operation controls the virtual object to move eastward, and the second move operation also controls the virtual object to move eastward.
[0109] 304. The terminal obtains the second predicted scene position based on the current display position of the virtual object in the scene interface and the second movement direction. In the scene interface, the virtual object is displayed moving towards the second predicted scene position. The second predicted scene position is the position that the virtual object is about to reach in the virtual scene under the action of the second movement operation.
[0110] In this embodiment of the application, when the terminal detects a second movement operation on a virtual object, the virtual object may have already moved to the first predicted scene position, or it may be moving towards the first predicted scene position but has not yet reached it. Therefore, when the terminal detects a second movement operation on a 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, but it is different from the display position of the virtual object in the scene interface when the terminal detects the first movement operation on the virtual object.
[0111] It should be noted that the process by which the terminal obtains the second predicted scene position based on the current display position of the virtual object in the scene interface and the second movement direction is the same as step 302 above, and will not be repeated here.
[0112] 305. The terminal responds to the movement instruction returned by the server in response to the first movement request, and determines the first scene position, which is the position reached by the virtual object in the virtual scene under the action of the first movement operation.
[0113] In one possible implementation, step 305 includes: the terminal responding to a movement instruction returned by the server in response to the first movement request, and determining the first scene location based on the scene location currently recorded by the terminal, the first movement direction carried by the movement instruction, and the movement speed of the virtual object.
[0114] In this embodiment, the server returns a movement instruction carrying a first movement direction in response to the first movement request. That is, after receiving the first movement request, the server returns a movement instruction to the terminal, enabling the terminal to update and record the scene position of the virtual object in the virtual scene in response to the movement instruction, thereby achieving control over the virtual object. The scene position currently recorded by the terminal is the scene position of the virtual object in the virtual scene. The currently recorded scene position may not be synchronized with the current display position of the virtual object on the scene interface.
[0115] In this embodiment, after the terminal responds to the server's return of a movement command for any movement request, it determines and records the new scene position of the virtual object in the virtual scene to ensure the accuracy of the recorded scene position. Since the virtual object moves from its current position in the virtual scene along a first movement direction at its current speed, the first scene position is determined based on the scene position currently recorded by the terminal, the first movement direction carried by the movement command, and the movement speed of the virtual object, thus ensuring the accuracy of the determined first scene position.
[0116] 306. 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 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 to the corrected second predicted scene position in the scene interface.
[0117] In this embodiment, 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, it updates the scene position recorded by the terminal. When the movement of the virtual object is already 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. This is to ensure that the difference between the first scene position and the first predicted scene position is offset during the virtual object's movement towards the corrected second predicted scene position, thereby maximizing the synchronization between the scene position recorded by the terminal and the display position of the virtual object in the scene interface and ensuring the accuracy of the game data.
[0118] 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 first predicted scene position; and offsetting the second predicted scene position based on the position offset vector to obtain the corrected second predicted scene position.
[0119] It should be noted that in this embodiment, the terminal has already responded to the second movement operation and displayed the movement of virtual objects in the scene interface before receiving the movement instruction returned by the server for the first movement operation. In another embodiment, before receiving the movement instruction returned by the server for the first movement operation, the terminal can not only respond to the second movement operation and display the movement of virtual objects in the scene interface, but also respond to other movement operations and display the movement of virtual objects in the scene interface. This application does not limit this.
[0120] It should be noted that in this embodiment, the terminal has already responded to the second movement operation by displaying the virtual object moving in the scene interface before receiving the movement instruction returned by the server for the first movement operation. In another embodiment, it is not necessary to execute the above steps 303-304 and 306. Instead, other methods are adopted 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.
[0121] In this embodiment, in response to the first movement operation, the terminal predicts the 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 towards the predicted first predicted scene position in the scene interface. Then, based on the movement instruction returned by the server, the terminal determines the first scene position of the virtual object in the virtual scene and compares the determined first scene position with the first predicted scene position. If the predicted first 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 synchronized as possible with the scene position of the virtual object in the virtual scene. This ensures the accuracy of the display position of the virtual object in the scene interface and enables the terminal to respond to the first movement operation in a timely manner without waiting for a long time for the movement instruction issued by the server, thereby avoiding movement operation delays, avoiding screen lag, and improving the user experience.
[0122] Furthermore, this embodiment employs a pre-display mechanism. Each time the terminal detects a movement operation on a virtual object, it promptly displays the virtual object's movement in the scene interface to drive the local game on the terminal, achieving timely response to movement operations. Then, after receiving the corresponding instruction from the server in response to the movement operation, the display position of the virtual object is corrected. This pre-display method ensures that the scene position recorded by the terminal lags behind the virtual object's display position in the scene interface. This not only guarantees timely terminal response, mitigating the negative impact of network latency and improving the response speed of movement operations, but also optimizes the control feel in high-latency network environments, enhancing the user's gaming experience in poor network conditions. Moreover, upon receiving a movement instruction from the server, rollback or interpolation methods can be used to correct the display position of the virtual object in the scene interface to ensure the accuracy of game data.
[0123] It should be noted that, in the above Figure 3In the illustrated embodiment, the terminal detects the second movement operation, which 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 a stop operation, it sends a displacement stop notification to the server and displays that the virtual object has stopped moving in the scene interface. Based on this displacement stop notification, the server sends the same notification to all terminals participating in the same game. The terminal receives the displacement stop notification from the server and determines the first scene position based on the movement command returned for the first movement operation and the displacement stop notification. For example, the terminal determines the operation duration corresponding to the first movement operation based on the difference between the time it receives the movement command returned by the server for the first movement operation and the time it receives the displacement stop notification. Based on this operation duration, the first movement direction, and the movement speed of the virtual object, the first scene position is determined.
[0124] In the above Figures 2 to 3 Based on the illustrated embodiment, in this application embodiment, the duration of the first movement operation is long, so the terminal can respond to the first movement operation by predicting a first predicted scene position at each time interval and displaying the virtual object moving towards the predicted scene position. That is, the process of obtaining the first predicted scene position and displaying the virtual object moving towards 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 displayed position in the virtual scene, the first movement direction, and the time step; displaying the virtual object moving towards 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 movement direction, and the time step; and displaying the virtual object moving towards the (i+1)-th first predicted scene position in the scene interface when the virtual object moves to the i-th first predicted scene position.
[0125] The time step can be any duration, for example, a time step of 5 seconds or 2 seconds.
[0126] In this embodiment, since the first movement operation is a long-term movement operation, for example, a user-triggered long-term eastward movement operation, a first predicted scene position is predicted at each time step interval, and the virtual object is displayed in the scene interface moving towards the first predicted position. Then, the next first predicted scene position is predicted. This ensures that the virtual object gradually moves along the first movement direction under the influence of the first movement operation, so that it can respond in a timely manner when the first movement operation is continuously detected. This avoids the phenomenon of screen lag caused by only displaying the movement of the virtual object when the first movement operation is no longer detected, thus ensuring the continuity of the virtual object's movement and the accuracy of the virtual object's movement along the first movement direction.
[0127] Following the above process, the first predicted scene position is predicted multiple times, and the virtual object is displayed moving towards the predicted scene position until the first movement operation is no longer detected. Here, "no longer detected" means that other movement operations different from the first movement direction are detected, or that no movement operation is detected at all, or that a skill release operation of the virtual object is detected, etc.
[0128] In the above process, if no further movement operation is detected, and the remaining operation time is less than the time step, then the nth first predicted scene position is obtained based on the (n-1)th first predicted scene position, the first movement direction, and the remaining operation time. If the virtual object moves to the (n-1)th first predicted scene position, the scene interface will display that the virtual object has moved to the nth first predicted scene position. Here, n is an integer greater than 1. For example, if the operation duration of the first movement operation is greater than n-1 times the time step but less than n times the time step, that is, during the detection of the first movement operation, the first predicted scene position is determined in the manner described above, and the virtual object is displayed moving towards the first predicted scene position in the scene interface; based on the second predicted scene position, the first movement direction, and the time step, the second predicted scene position is obtained; if the virtual object moves to the first predicted scene position, the virtual object is displayed moving towards the second predicted scene position in the scene interface; repeating the above steps, the (n-1)th predicted scene position can be obtained; the virtual object is displayed moving towards the (n-1)th predicted scene position in the scene interface; at this time, the remaining operation duration is the difference between the operation duration of the first movement operation and n-1 times the time step, and the nth predicted scene position is obtained based on the (n-1)th predicted scene position, the first movement direction, and the remaining operation duration; if the virtual object moves to the (n-1)th predicted scene position, the virtual object is displayed moving towards the nth predicted scene position in the scene interface.
[0129] In this embodiment, when the terminal responds to the first movement operation and displays the virtual object moving on the scene interface, it can predict n first predicted scene positions to gradually move the virtual object on the scene interface. The first scene position determined by the terminal in response to the movement instruction returned by the server in response to the first movement request is the scene position that the terminal needs to record, and it is not necessary to determine the scene position according to the time step. Therefore, this embodiment is similar to the one described above. Figure 2 or Figure 3 When the illustrated embodiment is combined, taking the acquisition of n first predicted scene positions as an example, after the first scene position is obtained, 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.
[0130] In the above Figures 2 to 3 Based on the illustrated embodiment, in this application embodiment, the duration of the first movement operation is long. Therefore, in response to the first movement operation, the terminal sends a movement request to the server at regular time intervals. After each movement request is sent to the server, the terminal predicts the predicted scene location and displays the virtual object moving towards that location in the scene interface. That is, the process of the terminal responding to the first movement operation by sending multiple movement requests to the server and displaying the virtual object's movement includes: the terminal responding to the first movement operation by sending a first movement request to the server at regular time intervals; the terminal sending the first first movement request to the server... After the request, based on the virtual object's current display position in the scene interface, its corresponding scene position in the virtual scene, its first movement direction, and its time step, the first predicted scene position is obtained. In the scene interface, the virtual object is displayed moving towards the first predicted scene. After the terminal sends the j-th first movement request to the server, the j-th predicted scene position is obtained based on the (j-1)-th predicted scene position, its first movement direction, and its time step. If the virtual object moves to the (j-1)-th predicted scene position, the virtual object is displayed moving towards the j-th predicted scene position in the scene interface, where j is an integer greater than 1.
[0131] In this embodiment of the application, after the terminal sends a movement request to the server, it will predict the predicted scene location and display the process of the virtual object moving towards the predicted scene location in the scene interface. This is similar to the process described above where the terminal responds to the first movement operation, predicts a first predicted scene location at each time interval, and displays the process of the virtual object moving towards the predicted scene location. It will not be described again here.
[0132] In this embodiment, since the first movement operation is a long-duration movement operation, the terminal responds to the first movement operation by sending a movement request to the server at regular intervals. After each movement request is sent to the server, the terminal predicts the predicted scene position and displays a virtual object moving towards the predicted scene position in the scene interface. This ensures that the virtual object gradually moves along the first movement direction under the influence of the first movement operation, so that it can respond in a timely manner when the first movement operation is continuously detected. This avoids the phenomenon of screen stuttering caused by displaying the virtual object's movement only when the first movement operation is no longer detected, thus ensuring the continuity of the virtual object's movement and the accuracy of the virtual object's movement along the first movement direction.
[0133] exist Figure 2 Based on the illustrated embodiment, in this embodiment of the application, when the terminal receives the movement instruction returned by the server for the first movement operation, the terminal has responded to the multiple movement operations on the virtual object in the scene interface by sending multiple movement requests to the server and controlling the movement of the virtual object. For details of the process, please refer to the following embodiment.
[0134] Figure 4 This is a flowchart of a virtual object control method provided in an embodiment of this application. Taking the method executed by a terminal as an example, as follows... Figure 4 As shown, the method includes:
[0135] 401. In response to the first movement operation of a virtual object in the scene interface of the virtual scene, the terminal sends a first movement request to the server. The first movement request carries a first movement direction, which is the movement direction of the first movement operation.
[0136] 402. The terminal obtains the first predicted scene position based on the current display position of the virtual object in the scene interface and the first movement direction. In the scene interface, the virtual object is displayed moving towards the first predicted scene position. The first predicted scene position is the position that the virtual object is about to reach in the virtual scene under the action of the first movement operation.
[0137] Steps 401-402 are the same as steps 301-302 above, and will not be repeated here.
[0138] 403. In response to a third movement operation on a virtual object, the terminal sends a third movement request to the server. The third movement request carries the third movement direction, which is the movement direction of the third movement operation.
[0139] Step 403 is the same as step 303 above, and will not be repeated here.
[0140] 404. The terminal obtains the third predicted scene position based on the current display position of the virtual object in the scene interface and the third movement direction. In the scene interface, the virtual object is displayed moving towards the third predicted scene position. The third predicted scene position is the position that the virtual object is about to reach in the virtual scene under the action of the third movement operation.
[0141] In this embodiment of the application, when the terminal detects a third movement operation on a virtual object, the virtual object may have already moved to the first predicted scene position, or it may be moving towards the first predicted scene position but has not yet reached it. Therefore, when the terminal detects a third movement operation on a 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, but it is different from the display position of the virtual object in the scene interface when the terminal detects the first movement operation on the virtual object.
[0142] It should be noted that the process by which the terminal obtains the third predicted scene position based on the current display position of the virtual object in the scene interface and the third movement direction is the same as step 302 above, and will not be repeated here.
[0143] 405. 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.
[0144] 406. The terminal obtains the second predicted scene position based on the current display position of the virtual object in the scene interface and the second movement direction. In the scene interface, the virtual object is displayed moving towards the second predicted scene position. The second predicted scene position is the position that the virtual object is about to reach in the virtual scene under the action of the second movement operation.
[0145] Steps 405-406 are the same as steps 303-304 above, and will not be repeated here.
[0146] 407. The terminal responds to the movement instruction returned by the server in response to the first movement request, and determines the first scene position, which is the position reached by the virtual object in the virtual scene under the action of the first movement operation.
[0147] Step 407 is the same as step 305 above, and will not be repeated here.
[0148] 408. 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 terminal corrects the second and third predicted scene positions based on the difference between the first scene position and the first predicted scene position, and displays the virtual object moving to the corrected second predicted scene position in the scene interface.
[0149] In this embodiment, 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, it updates the scene position recorded by the terminal. When the movement of the virtual object is already displayed in the scene interface, based on the difference between the first scene position and the first predicted scene position, the second and third predicted scene positions are corrected. This is to ensure that the difference between the first scene position and the first predicted scene position is offset as the virtual object moves towards the corrected second predicted scene position, and to ensure that the corrected third predicted scene position offsets the difference between the first scene position and the first predicted scene position. This is 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 to ensure the accuracy of the predicted scene position, thereby ensuring the accuracy of the game data.
[0150] The process of correcting the positions of the second and third predicted scenes is the same as the process of correcting the position of the second predicted scene in step 306 above, and will not be repeated here.
[0151] In one possible implementation, the terminal stores the predicted scene location, that is, the terminal stores the first predicted scene location, the second predicted scene location, and the third predicted scene location. The method further includes: when the virtual object moves to the second predicted scene location and the first scene location is different from the first predicted scene location, the terminal corrects the second predicted scene location and the third predicted scene location based on the difference between the first scene location and the first predicted scene location, and stores the corrected second predicted scene location and the corrected third predicted scene location.
[0152] In this embodiment, the terminal stores the predicted scene location so that it can be compared with the scene location obtained by the terminal based on the movement command returned by the server. This allows for correction of the virtual object's display position in the scene interface should the predicted scene location differ from the scene location obtained by the terminal based on the movement command. Furthermore, if the stored predicted scene location is corrected, the corrected predicted scene location is stored to ensure its accuracy. This ensures that when the server returns a movement command for a movement request corresponding to the modified predicted scene location, the terminal obtains a new scene location based on the movement command, compares the corrected predicted scene location with the new scene location, and thus guarantees the accuracy of the virtual object's display position.
[0153] Optionally, if the terminal stores the first predicted scene location, the second predicted scene location, and the third predicted scene location in the predicted scene location queue, then when the second predicted scene location and the third predicted scene location are corrected, the corrected second predicted scene location and the corrected third predicted scene location are stored in the predicted scene location queue.
[0154] Optionally, if 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.
[0155] In this embodiment of the application, the predicted scene position obtained afterward has been corrected based on the first predicted scene position, so the first predicted scene position is no longer needed, and the second and third predicted scene positions have been corrected. Therefore, the first, second, and third predicted scene positions are deleted to save storage space.
[0156] It should be noted that in this embodiment, before the terminal receives the movement instruction returned by the server for the first movement operation, the terminal has already responded to the third and second movement operations by displaying the movement of the virtual object in the scene interface. In another embodiment, it is not necessary to execute the above steps 403-406 and 408. Instead, other methods are adopted 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.
[0157] 409. The terminal responds to the movement instruction returned by the server in response to the third movement request, and determines the second scene position, which is the position reached by the virtual object in the virtual scene under the action of the third movement operation.
[0158] Step 409 is the same as step 305 above, and will not be repeated here.
[0159] 410. When the virtual object moves to the corrected second predicted scene position, or when 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 to the corrected second predicted scene position in the scene interface.
[0160] In this embodiment, the third predicted scene position is predicted based on the first predicted scene position. The corrected third predicted scene position has already offset the difference between the first scene position and the first predicted scene position. Therefore, by comparing the second scene position with the corrected 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. If the virtual object moves towards the corrected second predicted scene position, or if the second scene position differs 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. This ensures that as the virtual object moves towards the corrected second predicted scene position, 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 corrected third predicted scene position, is offset. This guarantees that the corrected second predicted scene position offsets the differences between the first scene position and the first predicted scene position, and the difference between the second scene position and the corrected 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.
[0161] like Figure 5 As shown, in response to the first movement operation, two third movement operations, and the second movement operation, the terminal displays the movement of virtual objects in the scene interface. 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 the two third predicted scene positions obtained from the two third movement operations, and S4 is the second predicted scene position. In response to the movement instruction returned by the server for the first movement request, the terminal determines the first scene position as L1. Based on the difference between L1 and S1, S2, S3, and S4 are corrected to obtain S2', S3', and S4'. 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, based on the difference between the second scene position and S2', S3' and S4' are corrected, and the corrected S3' and S4' are stored in the predicted scene position queue.
[0162] It should be noted that in this embodiment, the virtual object receives the movement instruction returned by the server in response to the third movement request during the movement of the virtual object to the corrected second predicted scene position. In another embodiment, steps 409-410 above do not need to be executed, and the movement of the virtual object to the corrected second predicted scene position is only displayed in the scene interface.
[0163] In this embodiment, in response to the first movement operation, the terminal predicts the 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 towards the predicted first predicted scene position in the scene interface. Then, based on the movement instruction returned by the server, the terminal determines the first scene position of the virtual object in the virtual scene and compares the determined first scene position with the first predicted scene position. If the predicted first 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 synchronized as possible with the scene position of the virtual object in the virtual scene. This ensures the accuracy of the display position of the virtual object in the scene interface and enables the terminal to respond to the first movement operation in a timely manner without waiting for a long time for the movement instruction issued by the server, thereby avoiding movement operation delays, avoiding screen lag, and improving the user experience.
[0164] In this embodiment, 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, it updates the scene position recorded by the terminal. When the movement of the virtual object is already displayed in the scene interface, based on the difference between the first scene position and the first predicted scene position, the second and third predicted scene positions are corrected. This is to ensure that the difference between the first scene position and the first predicted scene position is offset as the virtual object moves towards the corrected second predicted scene position, and to ensure that the corrected third predicted scene position offsets the difference between the first scene position and the first predicted scene position. This is 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 to ensure the accuracy of the predicted scene position, thereby ensuring the accuracy of the game data.
[0165] exist Figure 2 Based on the illustrated embodiment, in this embodiment of the application, when the terminal receives the movement instruction returned by the server for the first movement operation, the virtual object in the scene interface may be moving towards the first predicted scene position, or the virtual object may have moved to the first predicted scene position and be stationary. Then, the virtual object is controlled to move towards the first scene position to ensure that the display position is synchronized with the scene position. For details of the process, please refer to the following embodiments.
[0166] Figure 6 This is a flowchart of a virtual object control method provided in an embodiment of this application. Taking the method executed by a terminal as an example, as follows... Figure 6 As shown, the method includes:
[0167] 601. In response to the first movement operation of a virtual object in the scene interface of the virtual scene, the terminal sends a first movement request to the server. The first movement request carries a first movement direction, which is the movement direction of the first movement operation.
[0168] 602. The terminal obtains the first predicted scene position based on the current display position of the virtual object in the scene interface and the first movement direction. In the scene interface, the virtual object is displayed moving towards the first predicted scene position. The first predicted scene position is the position that the virtual object is about to reach in the virtual scene under the action of the first movement operation.
[0169] 603. The terminal responds to the movement instruction returned by the server in response to the first movement request, and determines the first scene position, which is the position reached by the virtual object in the virtual scene under the action of the first movement operation.
[0170] Steps 601-603 are the same as steps 201-203 above, and will not be repeated here.
[0171] 604. When the terminal displays the virtual object moving toward the first predicted scene position, or when 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 stationary, or when the first scene position is different from the first predicted scene position, the terminal displays the virtual object moving toward the first scene position in the scene interface.
[0172] In this embodiment, when the terminal receives the movement instruction returned by the server in response to the first movement request, the virtual object is moving towards the first predicted scene location but has not yet reached it. This indicates that the terminal displays the virtual movement in the scene interface as responding to the first movement operation but not yet completing the response. Alternatively, the virtual object has moved to the first predicted scene location and is stationary, indicating that the terminal has completed the first movement operation. Therefore, once it is determined that the first scene location is different from the first predicted scene location, it indicates that the first predicted scene location that the virtual object is heading to is inaccurate, or the first predicted scene location that the virtual object is currently in is inaccurate. Therefore, the first scene location is directly used as the location that the virtual object needs to reach, and the virtual object is displayed as moving towards the first scene location. This ensures that the displayed position of the virtual object in the scene interface is as consistent as possible with the scene location, thereby ensuring the accuracy of the game data.
[0173] It should be noted that the embodiments of this application are described with the example of the terminal only detecting the first movement operation. In another embodiment, it is not necessary to perform the above step 604. Instead, other methods are adopted 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.
[0174] In this embodiment, in response to the first movement operation, the terminal predicts the 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 towards the predicted first predicted scene position in the scene interface. Then, based on the movement instruction returned by the server, the terminal determines the first scene position of the virtual object in the virtual scene and compares the determined first scene position with the first predicted scene position. If the predicted first 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 synchronized as possible with the scene position of the virtual object in the virtual scene. This ensures the accuracy of the display position of the virtual object in the scene interface and enables the terminal to respond to the first movement operation in a timely manner without waiting for a long time for the movement instruction issued by the server, thereby avoiding movement operation delays, avoiding screen lag, and improving the user experience.
[0175] In this embodiment of the application, once it is determined that the first scene location is different from the first predicted scene location, it means that the first predicted scene location that the virtual object is heading to is inaccurate, or the first predicted scene location that the virtual object is currently in is inaccurate. Therefore, the first scene location is directly used as the location that the virtual object needs to reach, and the virtual object is displayed moving towards the first scene location to ensure that the display position of the virtual object in the scene interface is as consistent as possible with the scene location, thereby ensuring the accuracy of the game data.
[0176] In the above Figures 2 to 6 Based on the illustrated embodiment, the terminal displays virtual objects in the scene interface through the presentation layer and can display the movement of virtual objects within the scene interface. The terminal can record the scene position of the virtual object in the virtual scene through the logic layer; this scene position is equivalent to the logical position recorded by the logic layer. This allows the terminal to use the scene position to correct the display position of the virtual object in the scene interface through the presentation layer. This display position is equivalent to the position of the virtual object as presented by the presentation layer. When the terminal displays the scene interface, the user can trigger a movement operation on the virtual object through the scene interface displayed by the terminal. After detecting this movement operation, the terminal not only sends a movement request to the server but also obtains a predicted scene position through the presentation layer, as shown in the above embodiment. Based on the movement direction and the movement speed of the virtual object, the terminal displays the virtual object moving towards the predicted scene position in the scene interface. Then, the terminal, through the logic layer, responds to the movement command returned by the server in response to the movement request to determine the scene position of the virtual object in the virtual scene. If the scene position differs from the predicted scene position, the terminal corrects the display position of the virtual object in the scene interface based on the scene position through the presentation layer.
[0177] Ideally, when a user triggers a movement operation via a terminal to control the movement of a virtual object within a virtual scene, and no packet loss occurs during the interaction between the terminal and the server, the terminal will execute the same movement command through both the logic layer and the presentation layer. The only difference is that network latency causes the logic layer's movement to lag behind the presentation layer's movement, but the final scene position obtained through the logic layer is the same as the display position obtained through the presentation layer. This ensures the accuracy of the virtual object's display position in the scene interface and guarantees 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 for that virtual object within the virtual scene.
[0178] In reality, the scene location determined by the terminal may differ from the predicted scene location for the following three reasons:
[0179] The first reason is the coordination between movement and skill release operations. In games, there are situations where virtual objects are prohibited from moving when releasing skills. Because there's no pre-presentation mechanism for skill release, but a pre-presentation mechanism is used for movement, during the process of displaying the virtual object's movement on the scene interface using this pre-presentation mechanism, a skill release request is sent to the server in response to the skill release operation. Only when the terminal receives the skill release instruction from the server in response to the request will the virtual object's skill release be displayed on the scene interface. Therefore, the skill release process involves network latency. Consequently, in the "movement prohibited" state of a skill, the movement operations prohibited from responding to at the presentation layer and the logic layer may be different. Throughout the entire movement and skill coordination process, the movement operations executed by the pre-presentation layer and the movement operations executed by the logic layer are also different.
[0180] The second reason is the difference between the presentation layer frame rate and the logic layer frame rate. For frame-synchronized games, the update interval of the logic frame is fixed. Assuming a logic frame rate of 15 frames per second, regardless of changes in the terminal's presentation frame rate, the logical update interval remains constant. However, the presentation frame rate is variable across different game scenarios and at different times. Even without any user interaction, the presentation frame rate will fluctuate. Furthermore, due to network fluctuations, the number of presentation frame updates corresponding to each logic frame is also variable. This results in different cumulative update intervals for all presentation frames corresponding to the same logic frame. Consequently, at the same movement speed, the character's displacement distance in the presentation layer and the logic layer will differ.
[0181] The third reason is network packet loss. Network packet loss is a common problem in network communication. For frame-synchronized games, in order to ensure the consistency of server frame commands received by different clients, there is usually a retransmission mechanism to ensure that the downlink transmission from the server to the client is always reliable. Because network packet loss can occur during the interaction between the terminal and the server, if the server does not receive the first movement request sent by the terminal, it means that the first movement request packet was lost, which will cause a difference between the first scene position determined by the terminal and the first predicted scene position.
[0182] Therefore, the solution provided in the embodiments of this application can not only adopt a pre-presentation mechanism so that the terminal can display the movement of virtual objects in the scene interface in advance, but also correct the display position of virtual objects in the scene interface after determining the scene position. This not only ensures the accuracy of game data, but also enables the terminal to respond to the first movement operation in a timely manner without having to wait for the movement command issued by the server for a long time, thereby avoiding movement operation delays and avoiding screen lag, thus improving the user experience.
[0183] In the above Figures 2 to 6 Based on the embodiments shown, the embodiments of this application can also display the virtual object moving towards the landing point of the displacement skill in the scene interface by triggering the release operation of the virtual object's displacement skill. For details of the process, please refer to the following embodiments.
[0184] Figure 7 This is a flowchart of a virtual object control method provided in an embodiment of this application. Taking the method executed by a terminal as an example, as follows... Figure 7 As shown, the method includes:
[0185] 701. In response to the release operation of the displacement skill of the virtual object, the terminal sends a skill release request to the server. The skill release request carries the displacement skill and the displacement direction of the displacement skill.
[0186] In this embodiment of the application, the user can not only trigger the movement operation of the virtual object through the scene interface displayed on the terminal, but also trigger the release operation of the displacement skill of the virtual object, thereby controlling the movement of the virtual object.
[0187] Among them, displacement skills are skills that can cause virtual objects to move. For example, any displacement skill can cause a virtual object to jump forward a first distance, or dash forward a first distance, or roll to the left a second distance, etc., where the first and second distances are arbitrary distances. Releasing a displacement skill means that the user wants to control the virtual object to release the displacement skill in the virtual scene through the scene interface displayed on the terminal.
[0188] In one possible implementation, the displacement direction of a displacement skill is a fixed direction relative to a virtual object, or it is determined by a triggered release operation.
[0189] In this embodiment, the displacement direction of the displacement skill is a fixed direction relative to the virtual object, such as the displacement direction being directly in front of the virtual object, or to the left of the virtual object. When the direction of virtual displacement is determined by a release operation, the displacement direction of the displacement skill is 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 the user wants the virtual object to move in when releasing the displacement skill.
[0190] In one possible implementation, the scene interface displays options for the virtual object's displacement skills. When the terminal detects a trigger operation on the displacement skill option, it is equivalent to detecting a release operation on the displacement skill.
[0191] Optionally, step 701 includes: in response to pressing an option for a displacement skill, displaying a direction indicator in the scene interface, the direction indicator indicating the displacement direction of the displacement skill; and in response to releasing an option for a displacement skill, sending a skill release request to the server, the skill release request carrying the displacement skill and the displacement direction indicated by the direction indicator displayed when the release operation is detected.
[0192] 702. The terminal responds to the skill release command returned by the server in response to the skill release request. Based on the scene position of the virtual object when the displacement skill is released, the displacement skill in the skill release command and the displacement direction, the terminal determines the third scene position. The third scene position is the position reached by the virtual object after releasing the displacement skill in the virtual scene.
[0193] In this embodiment, 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 command can be represented in any form. For example, the skill release command 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 command, the displacement generated by the virtual object when the displacement skill is released in the virtual scene can be determined. Then, taking the scene position of the virtual object when the displacement skill is released as the starting point, the position after moving along the displacement direction to the displacement generated by the displacement skill is the third scene position. The terminal records this scene displacement.
[0194] 703. In the scene interface, the terminal displays a virtual object moving from its current display position to a third scene position.
[0195] In this embodiment, since the user controls the virtual object to release a displacement skill in the virtual scene through the terminal, the position reached by the virtual object after releasing the displacement skill is highly required to ensure the accuracy of the skill release. Moreover, 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 is heading to a predicted scene position, once 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.
[0196] 704. During the process of the virtual object moving to the third scene location, the terminal displays the special effect of the virtual object releasing the displacement skill.
[0197] In this embodiment, as the virtual object moves to the third scene location, the terminal displays a special effect of the virtual object releasing a displacement skill in the scene interface to enrich the content displayed in the scene interface and improve the display effect. The special effect of releasing the displacement skill can be any form of effect. For example, if the displacement skill instructs the virtual object to dash forward, then as the virtual object moves to the third scene location, a dashing effect is displayed in the scene interface, along with dash light wave effects around the virtual object.
[0198] It should be noted that the embodiments in this application are illustrated using the display of special effects as an example. In another embodiment, step 704 above is not required, and the special effects are no longer displayed.
[0199] In this embodiment, the third scene position reached by the virtual object after releasing the displacement skill is taken as the skill landing point. Since the skill landing point is the position that the user wants to control the virtual object to reach, regardless of whether the virtual object is currently stationary or moving to a predicted scene position, once 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 skill release and avoiding the virtual object from instantaneously shifting or jittering in the scene screen, ensuring that the movement of the displayed virtual object is smooth and continuous.
[0200] It should be noted that the above Figure 7 The illustrated embodiment uses the release of a displacement skill as an example for explanation. In another embodiment, the terminal responds to the release operation of other skills on a virtual object, according to the above... Figure 7 The illustrated embodiment is used to correct the display position of virtual objects in the scene interface.
[0201] like Figure 8As shown, if the terminal does not receive a skill release instruction from the server in response to the skill release request, the virtual object moves from its current display position in the scene interface according to the original interpolation vector of the presentation layer. However, if the terminal receives a skill release instruction from the server in response to the skill release request, and does not move according to the above... Figure 7 In the illustrated embodiment, when displaying the movement of a virtual object, the terminal determines the third scene position through the logic layer according to the logic layer's movement vector. The virtual object, after being moved from its current display position in the scene interface according to the original interpolation vector of the presentation layer, experiences a momentary jitter before being displayed in the third scene position. This causes the virtual object in the scene interface to experience momentary jitter. Therefore, according to the above... Figure 7 In the illustrated embodiment, when the terminal receives a skill release instruction from the server in response to the skill release request, the location of the third scene is determined, and the virtual object is shown to move from its current display position to the third scene position, that is, along... Figure 8 The dashed line in the middle moves in the direction of the dashed line.
[0202] In addition, when a user controls a virtual object to release a skill through the scene interface displayed on 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, if the terminal detects a movement operation on the virtual object, it will control the virtual object to move, thereby interrupting the virtual object's skill release. When the terminal detects that the virtual object's skill release has been interrupted, it will display the virtual object moving in the scene interface.
[0203] Optionally, in response to the virtual object's skill release operation, the terminal controls the virtual object to release skills in the virtual scene through the logic layer; in response to the detection through the presentation layer that the virtual object's skill release is interrupted, the virtual object's movement is displayed in the scene interface.
[0204] In games, there are situations where virtual objects are prohibited from moving when releasing skills. Because there's no pre-presentation mechanism for skill release, but a pre-presentation mechanism is used for movement operations, during the process of displaying virtual object movement on the scene interface using this pre-presentation mechanism, a skill release request is sent to the server in response to the skill release operation. Only after the terminal receives the skill release command from the server in response to the request will the skill release be displayed on the scene interface. Therefore, the skill release process involves network latency. Consequently, in the "movement prohibited state" of a skill, the movement operations prohibited from responding to at the presentation layer and the logic layer may be different. Furthermore, throughout the entire movement and skill transition process, the movement operations executed by the pre-presentation layer and the movement operations executed by the logic layer are also different.
[0205] In the above Figures 2 to 7Based on the illustrated embodiment, when a virtual object releases a skill in a virtual scene, the virtual object may be in a state where movement is prohibited. That is, the virtual object may not be able to move during the process of releasing a skill in the virtual scene. This skill may be a displacement skill or another type of skill. Furthermore, this embodiment only applies a pre-presentation mechanism to the movement operation of the virtual object; there is no pre-presentation mechanism for the release of a skill. Therefore, the display of the virtual object releasing a skill on the scene interface may lag behind the skill release operation triggered by the user through the terminal. In other words, the skill release process will be executed after a network delay. When a user triggers a skill release operation on a virtual object through the scene interface displayed on the terminal, the terminal sends a skill release request to the server. Before the terminal receives a skill release instruction from the server in response to the request, if the terminal detects a movement operation on the virtual object, it will display the virtual object moving in the scene interface as described above. When the terminal receives the skill release instruction from the server in response to the request, it will display the virtual object releasing the skill 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, if the terminal responds to the movement operation on the virtual object in the scene interface by sending a movement request to the server, it will not display the virtual object moving in the scene interface. Later, when the terminal receives the movement instruction from the server in response to the movement request, it will determine whether to execute the movement instruction based on the duration of the prohibited movement state and the duration of the movement operation corresponding to the movement request. It will not execute the movement instruction during the period when the virtual object is in a prohibited movement state, and it will also correct the predicted scene position when the virtual object ends its prohibited movement state.
[0206] In one possible implementation, the process of correcting the predicted scene position when the virtual object ends the prohibited movement state includes: while the virtual object is in the prohibited movement state, the terminal responds to the movement operation on the virtual object in the scene interface, determines the first displacement corresponding to the movement operation, determines the second displacement corresponding to the unexecuted movement command, determines the predicted scene position based on the predicted scene position when the virtual object starts to be in the prohibited movement state, the first displacement, the second displacement and the skill position, and the terminal displays the virtual object moving towards the predicted scene position in the scene interface when the virtual object ends the prohibited movement state.
[0207] Among them, the unexecuted movement instructions are those movement instructions returned by the server to the terminal in response to the movement request sent to the terminal, and the corresponding movement time period is within the time period when the virtual object is in a prohibited movement state.
[0208] Optionally, based on the predicted scene position, first displacement, second displacement, and skill position when the virtual object initially enters a state where movement is prohibited, the predicted scene position is determined, satisfying the following relationship:
[0209] L_end=R_start+R_forbid-L_forbid+L_skill
[0210] L_end=L_start+L_skill+L_undone
[0211] L_start+L_forbid+L_undone=R_start+R_forbid
[0212] Where L_end is the predicted scene position, that is, when the virtual object ends its immobility state, the virtual object is displayed in the scene interface moving towards L_end to correct its display position; R_start represents the predicted scene position when the virtual object begins to be in the immobility state, that is, the terminal obtains the predicted scene position from the presentation layer at the start of the "immobility state", and R_start is a known variable; and L_forbid is the first displacement, that is, the displacement corresponding to the position where the presentation layer could not perform the movement operation because the virtual object was in the immobility state, and L_forbid is the second displacement, that is, the logical... The layer was unable to execute the displacement corresponding to the movement operation because the virtual object was in a prohibited movement state. The first and second displacements 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 is known. L_skill is a known variable. L_start represents the scene position of the terminal through the logic layer at the beginning of the "prohibited movement state". L_start is a known variable. L_undone represents the displacement corresponding to the movement command that has not yet been executed through the logic layer after the skill ends the "prohibited movement state".
[0213] like Figure 9 As shown, Figure 9Each arrow in the UI layer represents a movement operation. Each arrow in the UI layer represents a user-triggered movement operation, and each box in the UI layer represents a skill release operation. Each arrow in the presentation layer represents the terminal's response to each movement operation; that is, the predicted scene position obtained for each movement operation, and the display of the virtual object moving towards the predicted scene position in the scene interface. Each arrow in the logic layer represents the terminal's response to each movement operation. During the terminal's response from the presentation layer to the UI layer's movement operations, if it is determined that the virtual object is in a prohibited movement state, the corresponding 7 left-pointing movement arrows are not executed. Similarly, during the terminal's response from the logic layer to the UI layer's movement operations, if it is determined that the virtual object is in a prohibited movement state, the corresponding 2 right-pointing movement arrows and 5 left-pointing movement arrows are not executed.
[0214] In the above Figures 2 to 9 Based on the illustrated embodiment, the terminal can employ frame synchronization technology to display the scene interface. For example, the terminal divides the game progress according to fixed time intervals. At the beginning of each frame, multiple terminals participating in the same game have the same game data. Upon receiving a movement command from the server, each terminal determines the game data for the next frame according to fixed time intervals and uses the game data of the next frame as the initial state for the next frame. Its advantages are high real-time performance and small amount of synchronized data, making it suitable for online games like MOBAs that require frequent operations and fast responses.
[0215] Based on the above Figures 2 to 9 The embodiment shown in this application also provides an index based on movement and operation vectors as a standard for quantifying the feel of movement control. This standard is applicable to various types of games and can be used to detect the movement feel of games. Let the unit vector of movement direction be J_dir, the movement speed be v, and the time interval between each update of the presentation layer frame be t, that is, the interval between two adjacent presentation frames when the scene interface is displayed through the presentation layer is t. Then, when the user triggers a movement operation through the terminal to control the movement of the virtual object, the expected displacement vector of the presentation layer is: J_delta = J_dir * v * t. After each update of the presentation layer, 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 as V_delta. Figure 10 As shown, the motion feel index is defined as: diff = |J_delta - V_delta|. Here, diff represents the magnitude of the difference between the expected displacement vector and the actual displacement of the display layer when the user triggers a movement operation to control the virtual object's movement via the terminal. The smaller the diff, the closer the movement of the display layer is to the user's movement operation triggered by the terminal, resulting in a better feel. This index calculation is applicable to common games where character movement is driven by a joystick.
[0216] In the above Figures 2 to 10 Based on the embodiments shown, this application also provides a flowchart of another virtual object control method, such as... Figure 11 As shown, the method includes:
[0217] Step 1: The player moves the virtual joystick through the terminal. The terminal sends a movement request to the server and waits for the server to issue a movement command. Furthermore, if it is determined that the presentation layer should respond in a timely manner, the presentation layer predicts the scene position and uses interpolation to move the virtual object in the scene interface to the predicted scene position.
[0218] 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 confirming that the logic layer can move, and corrects the predicted scene position by 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.
[0219] 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 the skill release command.
[0220] Step 4: The terminal receives the skill release instruction returned by the server, executes the skill through the logic layer, waits for the skill's aftercast to end (i.e., waits for the skill release to end), and then displays the virtual object releasing the skill in the scene interface through the presentation layer. The terminal also updates the predicted scene position and shows the virtual object moving to the updated predicted scene position.
[0221] Step 5: The terminal determines whether virtual object movement is prohibited when executing a skill. If virtual object movement is prohibited, the presentation layer displays that the virtual object has stopped moving in the scene interface. It then determines whether the skill is a movement skill. If it is, the presentation layer follows the steps described above. Figure 7 In the illustrated embodiment, the location of the third scene is determined, and the virtual object is shown to move from the current display location to the location of the third scene.
[0222] Figure 12 This is a schematic diagram of the structure of a virtual object control device provided in an embodiment of this application, as shown below. Figure 12 As shown, the device includes:
[0223] The sending module 1201 is used to send a first movement request to the server in response to a first movement operation on a virtual object in the scene interface of the virtual scene. The first movement request carries a first movement direction, which is the movement direction of the first movement operation.
[0224] The display module 1202 is used to obtain a first predicted scene position based on the current display position of the virtual object in the scene interface and the first movement direction, and to display the virtual object moving towards the first predicted scene position in the scene interface. The first predicted scene position is the position that the virtual object is about to reach in the virtual scene under the action of the first movement operation.
[0225] The determination module 1203 is used to determine the 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 the position reached by the virtual object in the virtual scene under the action of the first movement operation.
[0226] The correction module 1204 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.
[0227] In one possible implementation, the display module 1202 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; and to obtain the first predicted scene position based on the determined scene position, the first movement direction, the movement speed of the virtual object, and the operation duration of the first movement operation.
[0228] In another possible implementation, the correction module 1204 is used to display in the scene interface that the virtual object has moved to the first predicted scene position when the virtual object moves to the first predicted scene position, 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 stationary, the first scene position is different from the first predicted scene position.
[0229] In another possible implementation, the sending module 1201 is further configured to send a second movement request to the server in response to a second movement operation on the virtual object. The second movement request carries a second movement direction, which is the movement direction of the second movement operation.
[0230] The display module 1202 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 movement direction, and to display the virtual object moving towards the second predicted scene position in the scene interface. The second predicted scene position is the position that the virtual object is about to reach in the virtual scene under the action of the second movement operation.
[0231] In another possible implementation, the correction module 1204 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. The scene interface displays the virtual object moving to the corrected second predicted scene position.
[0232] In another possible implementation, the sending module 1201 is also configured to send a third movement request to the server in response to a third movement operation on the virtual object. The third movement request carries a third movement direction, which is the movement direction of the third movement operation.
[0233] The display module 1202 is also used to obtain the third predicted scene position based on the current display position of the virtual object in the scene interface and the third movement direction, and to display the virtual object moving towards the third predicted scene position in the scene interface. The third predicted scene position is the position that the virtual object is about to reach in the virtual scene under the action of the third movement operation.
[0234] The correction module 1204 is used to correct the second and third predicted scene positions 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. The scene interface displays the virtual object moving to the corrected second predicted scene position.
[0235] In another possible implementation, the determining module 1203 is also used to determine the 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 the position reached by the virtual object in the virtual scene under the action of the third movement operation.
[0236] The correction module 1204 is also used to further correct the second predicted scene position based on the difference between the second predicted scene position and the third predicted scene position when the virtual object moves to the corrected second predicted scene position or when 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 predicted scene position after the correction.
[0237] In another possible implementation, the display module 1202 is used to perform collision detection on the current display position of the virtual object in the scene interface, the first movement direction, and the environmental parameters of the virtual scene to obtain the collision result. 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 movement 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 movement direction, the first predicted scene position is obtained.
[0238] In another possible implementation, the sending module 1201 is also used to send a skill release request to the server in response to the release operation of the displacement skill of the virtual object. The skill release request carries the displacement skill and the displacement direction of the displacement skill.
[0239] The determination module 1203 is also used to respond to the skill release instruction returned by the server in response to the skill release request, and determine the third scene position based on the scene position of the virtual object when the displacement skill is released, the displacement skill in the skill release instruction and the displacement direction. The third scene position is the position reached by the virtual object after releasing the displacement skill in the virtual scene.
[0240] The display module 1202 is also used to display virtual objects moving from their current display position to a third scene position in the scene interface.
[0241] In another possible implementation, the display module 1202 is also used to display the special effects of the virtual object releasing displacement skills as the virtual object moves to the third scene position.
[0242] In another possible implementation, the display module 1202 is used to obtain the i-th first predicted scene position based on the scene position corresponding to the display position in the virtual scene, the first movement direction, and the time step; in the scene interface, display the virtual object moving towards the i-th first predicted scene, where i is an integer greater than 0; obtain the (i+1)-th first predicted scene position based on the i-th first predicted scene position, the first movement direction, and the time step; and when the virtual object moves to the i-th first predicted scene position, display the virtual object moving towards the (i+1)-th first predicted scene position in the scene interface.
[0243] It should be noted that the virtual object control device provided in the above embodiments is only an example of the division of the above functional modules. In practical applications, the above 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. In addition, the virtual object control device and the virtual object control method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.
[0244] This application also provides a computer device, which includes a processor and a memory. 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 embodiments.
[0245] Optionally, the computer device is provided as a terminal. Figure 13 This illustration shows a structural block diagram of a terminal 1300 provided in an exemplary embodiment of this application. The terminal 1300 may be a smartphone, tablet computer, laptop computer, desktop computer, smart speaker, smartwatch, smart voice interaction device, smart home appliance, or in-vehicle terminal, etc. The terminal 1300 may also be referred to as user equipment, portable terminal, laptop terminal, desktop terminal, or other names.
[0246] Terminal 1300 includes a processor 1301 and a memory 1302.
[0247] Processor 1301 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. Processor 1301 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). Processor 1301 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 1301 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content required to be displayed on the screen. In some embodiments, processor 1301 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.
[0248] The memory 1302 may include one or more computer-readable storage media, which may be non-transitory. The memory 1302 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 1302 are used to store at least one computer program, which is executed by the processor 1301 to implement the virtual object control method provided in the method embodiments of this application.
[0249] In some embodiments, the terminal 1300 may also optionally include a peripheral device interface 1303 and at least one peripheral device. The processor 1301, memory 1302, and peripheral device interface 1303 can be connected via a bus or signal line. Each peripheral device can be connected to the peripheral device interface 1303 via a bus, signal line, or circuit board. Specifically, the peripheral device includes at least one of the following: a radio frequency circuit 1304, a display screen 1305, a camera assembly 1306, an audio circuit 1307, and a power supply 1308.
[0250] Peripheral device interface 1303 can be used to connect at least one I / O (Input / Output) related peripheral device to processor 1301 and memory 1302. In some embodiments, processor 1301, memory 1302 and peripheral device interface 1303 are integrated on the same chip or circuit board; in some other embodiments, any one or two of processor 1301, memory 1302 and peripheral device interface 1303 can be implemented on separate chips or circuit boards, which is not limited in this embodiment.
[0251] The radio frequency (RF) circuit 1304 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The RF circuit 1304 communicates with communication networks and other communication devices via electromagnetic signals. The RF circuit 1304 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals back into electrical signals. Optionally, the RF circuit 1304 includes: 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, etc. The RF circuit 1304 can communicate with other terminals through at least one wireless communication protocol. This wireless communication protocol includes, but is 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, the RF circuit 1304 may also include circuitry related to NFC (Near Field Communication), which is not limited in this application.
[0252] Display screen 1305 is used to display a UI (User Interface). This UI may include graphics, text, icons, videos, and any combination thereof. When display screen 1305 is a touch display screen, it also has the ability to collect touch signals on or above its surface. These touch signals can be input as control signals to processor 1301 for processing. In this case, display screen 1305 can also be used to provide virtual buttons and / or a virtual keyboard, also known as soft buttons and / or a soft keyboard. In some embodiments, there may be one display screen 1305, disposed on the front panel of terminal 1300; in other embodiments, there may be at least two display screens, disposed on different surfaces of terminal 1300 or in a folded design; in still other embodiments, display screen 1305 may be a flexible display screen, disposed on a curved or folded surface of terminal 1300. Furthermore, display screen 1305 may be configured as a non-rectangular, irregular shape, i.e., a non-rectangular screen. The display screen 1305 can be made of materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).
[0253] The camera assembly 1306 is used to acquire images or videos. Optionally, the camera assembly 1306 includes a front-facing camera and a rear-facing camera. The front-facing camera is disposed on the front panel of the terminal, and the rear-facing camera is disposed on the back of the terminal. In some embodiments, there are at least two rear-facing cameras, which are any one of a main camera, a depth-sensing camera, a wide-angle camera, and a telephoto camera, to achieve background blurring by fusion of the main camera and the depth-sensing camera, panoramic shooting by fusion of the main camera and the wide-angle camera, VR (Virtual Reality) shooting, or other fusion shooting functions. In some embodiments, the camera assembly 1306 may also include a flash. The flash may be a single-color temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cool light flash, which can be used for light compensation at different color temperatures.
[0254] The audio circuit 1307 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, converting the sound waves into electrical signals that are input to the processor 1301 for processing, or input to the radio frequency circuit 1304 for voice communication. For stereo sound acquisition or noise reduction purposes, multiple microphones may be used, each located at a different part of the terminal 1300. The microphone may also be an array microphone or an omnidirectional microphone. The speaker is used to convert electrical signals from the processor 1301 or the radio frequency circuit 1304 into sound waves. The speaker may be a conventional diaphragm speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can convert electrical signals not only into audible sound waves but also into inaudible sound waves for purposes such as distance measurement. In some embodiments, the audio circuit 1307 may also include a headphone jack.
[0255] Power supply 1308 is used to power the various components in terminal 1300. Power supply 1308 can be AC power, DC power, a disposable battery, or a rechargeable battery. When power supply 1308 includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery that is charged via a wired line, and a wireless rechargeable battery is a battery that is charged via a wireless coil. The rechargeable battery can also be used to support fast charging technology.
[0256] Those skilled in the art will understand that Figure 13 The structure shown does not constitute a limitation on terminal 1300 and may include more or fewer components than shown, or combine certain components, or use different component arrangements.
[0257] Optionally, the computer equipment is provided as a server. Figure 14This is a schematic diagram of a server structure provided in an embodiment of this application. The server 1400 can vary significantly due to different configurations or performance. It may include one or more Central Processing Units (CPUs) 1401 and one or more memories 1402. The memories 1402 store at least one computer program, which is loaded and executed by the processor 1401 to implement the methods provided in the above-described method embodiments. Of course, the server may also have wired or wireless network interfaces, a keyboard, and input / output interfaces for input and output. The server may also include other components for implementing device functions, which will not be elaborated upon here.
[0258] This application also provides a computer-readable storage medium storing at least one computer program, which is loaded and executed by a processor to implement the operations performed by the virtual object control method of the above embodiments.
[0259] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the operations performed by the virtual object control method as described in the above embodiments.
[0260] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
[0261] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present application should be included within the protection scope of the present application.
Claims
1. A method for controlling virtual objects, characterized in that, The method includes: In response to a first movement operation on a virtual object in the scene interface of a virtual scene, a first movement request is sent to the server. The first movement request carries a first movement direction, which is the movement direction of the first movement operation. Based on the current display position of the virtual object in the scene interface and the first movement direction, a first predicted scene position is obtained. In the scene interface, the virtual object is displayed moving towards the first predicted scene position. The first predicted scene position is the predicted position that the virtual object will reach in the virtual scene under the action of the first movement operation. In response to a second movement operation on the virtual object, a second movement request is sent to the server, the second movement request carrying a second movement direction, the second movement direction being the movement direction of the second movement operation; Based on the current display position of the virtual object in the scene interface and the second movement direction, a second predicted scene position is obtained. In the scene interface, the virtual object is displayed moving towards the second predicted scene position. The second predicted scene position is the predicted position that the virtual object will reach in the virtual scene under the action of the second movement operation. In response to the movement instruction returned by the server for the first movement request, a first scene location is determined, wherein the first scene location is the position reached by the virtual object in the virtual scene under the action of the first movement operation; If the first scene location is different from the first predicted scene location, the display position of the virtual object in the scene interface is corrected based on the first scene location; Wherein, when the first scene location differs from the first predicted scene location, correcting the display position of the virtual object in the scene interface based on the first scene location 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 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 toward the corrected second predicted scene position.
2. The method according to claim 1, characterized in that, The step of obtaining the first predicted scene position based on the current display position of the virtual object in the scene interface and the first movement direction includes: 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; The first predicted scene location is obtained based on the determined scene location, the first movement direction, the movement speed of the virtual object, and the operation duration of the first movement operation.
3. The method according to claim 1, characterized in that, When the first scene location differs from the first predicted scene location, the step of correcting the display position of the virtual object in the scene interface based on the first scene location includes: When the virtual object moves toward the first predicted scene position, or when 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 stationary, or when the first scene position is different from the first predicted scene position, the virtual object is displayed moving toward the first scene position in the scene interface.
4. The method according to claim 1, characterized in that, Before sending a second movement request to the server in response to a second movement operation on the virtual object, the method further includes: In response to a third movement operation on the virtual object, a third movement request is sent to the server, the third movement request carrying a third movement direction, the third movement direction being the movement direction of the third movement operation; Based on the current display position of the virtual object in the scene interface and the third movement direction, a third predicted scene position is obtained. In the scene interface, the virtual object is displayed moving towards the third predicted scene position. The third predicted scene position is the position that the virtual object is about to reach in the virtual scene under the action of the third movement operation. When the first scene location differs from the first predicted scene location, the step of correcting the display position of the virtual object in the scene interface based on the first scene location 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 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. In the scene interface, the virtual object is displayed moving toward the corrected second predicted scene position.
5. The method according to claim 4, characterized in that, After displaying the virtual object moving to the corrected second predicted scene position in the scene interface, the method further includes: In response to the movement instruction returned by the server for the third movement request, a second scene position is determined, wherein the second scene position is the position reached by the virtual object in the virtual scene under the action of the third movement operation; If 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 moves to the corrected second predicted scene position in the scene interface.
6. The method according to any one of claims 1-5, characterized in that, The step of obtaining the first predicted scene position based on the current display position of the virtual object in the scene interface and the first movement direction includes: Collision detection is performed on the current display position of the virtual object in the scene interface, the first movement direction, and the environmental parameters of the virtual scene to obtain a collision result. The environmental parameters indicate obstacles in the virtual scene, and the collision result indicates the collision situation of the virtual object when it moves in the first movement 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 movement direction, the first predicted scene position is obtained.
7. The method according to any one of claims 1-5, characterized in that, The method further includes: In response to the release operation of the displacement skill of the virtual object, a skill release request is sent to the server, the skill release request carrying the displacement skill and the displacement direction of the displacement skill; In response to the skill release instruction returned by the server for the skill release request, a third scene position is determined based on the scene position of the virtual object when the displacement skill is released, the displacement skill in the skill release instruction, and the displacement direction. 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 shown moving from its current display position to the third scene position.
8. The method according to claim 7, characterized in that, The method further includes: As the virtual object moves toward the third scene location, a special effect is displayed showing the virtual object releasing the displacement skill.
9. The method according to any one of claims 1-5, characterized in that, The step of obtaining a first predicted scene position based on the current display position of the virtual object in the scene interface and the first movement direction, and displaying the virtual object moving towards the first predicted scene position in the scene interface, includes: Based on the scene position corresponding to the display position in the virtual scene, the first movement direction, and the time step, the i-th first predicted scene position is obtained; in the scene interface, the virtual object is displayed moving towards the i-th first predicted scene position, where i is an integer greater than 0; Based on the i-th first predicted scene position, the first movement 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, the scene interface displays that the virtual object has moved to the (i+1)-th first predicted scene position.
10. A virtual object control device, characterized in that, The device includes: The sending module is used to send a first movement request to the server in response to a first movement operation on a virtual object in the scene interface of the virtual scene. The first movement request carries a first movement direction, which is the movement direction of the first movement operation. The display module is used to obtain a first predicted scene position based on the current display position of the virtual object in the scene interface and the first movement direction, and to display 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 about to reach in the virtual scene under the action of the first movement operation. The sending module is further configured to send a second movement request to the server in response to a second movement operation on the virtual object, the second movement request carrying a second movement direction, the second movement direction being the movement direction of the second movement operation; The display module is further configured to obtain a second predicted scene position based on the current display position of the virtual object in the scene interface and the second movement direction, and display the virtual object moving toward the second predicted scene position in the scene interface. The second predicted scene position is the predicted position that the virtual object will reach in the virtual scene under the action of the second movement operation. The determination module is used to determine a first scene location in response to a movement instruction returned by the server for the first movement request. The first scene location is the position reached by the virtual object in the virtual scene under the action of the first movement operation. The 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 correction module 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. The correction module is used to display the virtual object moving to the corrected second predicted scene position in the scene interface.
11. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing at least one computer program, which is loaded and executed by the processor to perform the operations performed by the virtual object control method as described in any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one computer program, which is loaded and executed by a processor to perform the operations performed by the virtual object control method as described in any one of claims 1 to 9.
13. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it performs the operations performed by the virtual object control method as described in any one of claims 1 to 9.
Citation Information
Patent Citations
Virtual character control method and device, equipment and storage medium
CN116059640A
