Control method, device, terminal, storage medium and program product of virtual object

By selecting and updating the target position within the area in front of the virtual object, the problem of mechanical and stiff movement trajectory during virtual object following is solved, achieving a more natural following effect and improving the realism of the game.

CN122183158APending Publication Date: 2026-06-12TENCENT TECHNOLOGY (SHENZHEN) CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
TENCENT TECHNOLOGY (SHENZHEN) CO LTD
Filing Date
2022-01-28
Publication Date
2026-06-12

AI Technical Summary

Technical Problem

In existing technologies, the movement trajectory of a virtual object is the same as that of the target virtual object during automatic following, resulting in a mechanical and stiff movement process with poor realism.

Method used

By controlling the virtual object to determine the area in front with the orientation of the target virtual object as the center line, and selecting the target position within this area, the target position is updated at regular intervals, causing the virtual object to move towards the target position in front, thus avoiding directly following the real-time position of the target virtual object.

Benefits of technology

It enhances the anthropomorphism of virtual objects, improves the realism of the game, and makes the following behavior of virtual objects more natural.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122183158A_ABST
    Figure CN122183158A_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a virtual object control method and device, a terminal, a storage medium and a program product, and belong to the technical field of computers. The method comprises: displaying a first virtual object and a second virtual object, the second virtual object being a virtual object that automatically follows the first virtual object to move; controlling the first virtual object to move in a virtual environment; and in the case that the first virtual object moves, controlling the second virtual object to move to a target position in the virtual environment, the target position being located in a front region of the first virtual object in the moving process. The method provided by the embodiments of the present application can automatically move the second virtual object to a front position of the first virtual object, and the second virtual object no longer needs to move based on a real-time position of the first virtual object, so that the following performance of the second virtual object is more natural, which helps to improve the personification of the virtual object in the automatic following state, thereby improving the authenticity of the game.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of application number 2022101082179, filed on January 28, 2022, entitled "Control Method, Apparatus, Terminal, Storage Medium and Program Product for Virtual Objects". Technical Field

[0002] This application relates to the field of computer technology, and in particular to a method, apparatus, terminal, storage medium, and program product for controlling virtual objects. Background Technology

[0003] Currently, games have an auto-follow function that allows virtual objects controlled by other players or artificial intelligence (AI) virtual objects to automatically follow the target virtual object.

[0004] In related technologies, when controlling other virtual objects to follow the target virtual object, the movement of other virtual objects is controlled based on the movement trajectory of the target virtual object.

[0005] However, when using this method to control the movement of other virtual objects, the movement trajectory of the other virtual objects always remains the same as that of the target virtual object, making the movement process rather mechanical and rigid, resulting in poor realism in the following process. Summary of the Invention

[0006] This application provides a method, device, terminal, storage medium, and program product for controlling virtual objects, which can improve the anthropomorphism of virtual objects in an automatically following state, thus helping to enhance the realism of games. The technical solution is as follows: On one hand, embodiments of this application provide a method for controlling a virtual object, the method comprising: Display a first virtual object and a second virtual object, wherein the second virtual object is a virtual object that automatically moves with the first virtual object; Control the movement of the first virtual object in the virtual environment; When the first virtual object moves, the area in front of the first virtual object is determined with the orientation of the first virtual object as the center line; Select a target location from the front area, and reselect the target location from the front area at regular intervals to update the selected target location; Control the second virtual object to move towards the newly selected target location.

[0007] On the other hand, embodiments of this application provide a control device for a virtual object, the device comprising: The first display module is used to display a first virtual object and a second virtual object, wherein the second virtual object is a virtual object that automatically moves with the first virtual object; The first control module is used to control the movement of the first virtual object in the virtual environment; The second control module is configured to, when the first virtual object moves, determine the area in front of the first virtual object with the orientation of the first virtual object as the center line; select a target position from the area in front, and reselect the target position from the area in front at regular intervals to update the selected target position; and control the second virtual object to move towards the latest selected target position.

[0008] On the other hand, embodiments of this application provide a terminal, the terminal including a processor and a memory, the memory storing at least one instruction, at least one program, code set or instruction set, the at least one instruction, the at least one program, the code set or instruction set being loaded and executed by the processor to implement the virtual object control method as described above.

[0009] On the other hand, embodiments of this application provide a computer-readable storage medium storing at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by a processor to implement the virtual object control method as described above.

[0010] On the other hand, embodiments of this application provide a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. The processor of a terminal reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the terminal to perform the control method for providing virtual objects in various optional implementations of the above aspects.

[0011] The beneficial effects of the technical solutions provided in this application include at least the following: In this embodiment, when the second virtual object is in a state of automatically following the movement of the first virtual object, it is controlled to move towards the target position in the area in front of the first virtual object. Compared to the automatic following method based on the movement path of the target in related technologies, the method provided in this embodiment allows the second virtual object to move automatically towards the position in front of the first virtual object without needing to move based on the real-time position of the first virtual object. This means the movement path of the second virtual object is different from that of the first virtual object, making the following behavior of the second virtual object more natural and improving the anthropomorphism of the virtual object in the automatic following state, thereby enhancing the realism of the game. Attached Figure Description

[0012] 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 this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0013] Figure 1 A schematic diagram of an implementation environment provided by an exemplary embodiment of this application is shown; Figure 2 A flowchart illustrating a method for controlling a virtual object provided in an exemplary embodiment of this application is shown. Figure 3 A schematic diagram of the interface illustrating the control process of a virtual object in an exemplary embodiment of this application is shown. Figure 4 A flowchart illustrating a method for controlling a virtual object provided in another exemplary embodiment of this application is shown; Figure 5 A schematic diagram illustrating the target location selection process in an exemplary embodiment of this application is shown; Figure 6 A schematic diagram illustrating the target location selection process is shown in another exemplary embodiment of this application; Figure 7 A flowchart illustrating the process of controlling the movement of a second virtual object, provided in an exemplary embodiment of this application, is shown. Figure 8 A flowchart illustrating a method for controlling a virtual object provided in another exemplary embodiment of this application is shown; Figure 9 A flowchart illustrating the process of controlling the movement of a second virtual object, provided in an exemplary embodiment of this application, is shown. Figure 10 This is a structural block diagram of a virtual object control device provided in an exemplary embodiment of this application; Figure 11 A structural block diagram of a terminal provided in an exemplary embodiment of this application is shown. Detailed Implementation

[0014] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0015] In this article, "multiple" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.

[0016] First, let's introduce the terms used in the embodiments of this application: Virtual environment: This refers to the virtual environment displayed (or provided) by an application when it runs on a terminal. This virtual environment can be a simulation of the real world, a semi-simulated / semi-fictional environment, or a purely fictional environment. The virtual environment can be any of a two-dimensional, 2.5-dimensional, or three-dimensional virtual environment; this application does not limit it to any particular type. The following embodiments use a three-dimensional virtual environment as an example for illustration.

[0017] Virtual objects refer to movable objects in a virtual environment. These movable objects can be virtual characters, virtual animals, anime characters, etc., such as people and animals displayed in a 3D virtual environment. Optionally, virtual objects are 3D models created based on animation skeletal technology. Each virtual object has its own shape and volume in the 3D virtual environment and occupies a portion of the space in the 3D virtual environment.

[0018] Virtual items: These are items that virtual objects can use in a virtual environment. They include virtual items that can alter the attribute values ​​of other virtual objects, supply items, defensive items, virtual items displayed through the hands when a virtual object uses a skill, and parts of a virtual object's body, such as hands and legs. Virtual items that can alter the attribute values ​​of other virtual objects include long-range virtual items, short-range virtual items, and throwable virtual items.

[0019] Please refer to Figure 1 The diagram illustrates an implementation environment provided in one embodiment of this application. This implementation environment may include: a first terminal 110, a server 120, and a second terminal 130.

[0020] The first terminal 110 runs an application 111 that supports a virtual environment. This application 111 can be a multiplayer online battle arena (MOBA) game, a battle royale shooting game, or a simulation game (SLG). In this embodiment, the application 111 is used as an example of a first-person shooter (FPS) game. The first terminal 110 is the terminal used by the first user 112. The first user 112 uses the first terminal 110 to control a first virtual object located in the virtual environment. This first virtual object can be referred to as the master virtual object controlled by the first user 112. The activities of the first virtual object include, but are not limited to, adjusting body posture, crawling, walking, running, riding, flying, jumping, driving, picking up, shooting, attacking, throwing, and releasing skills at least one of these. Schematic, the first virtual object is a first virtual character, such as a realistic or anime character.

[0021] The second terminal 130 runs an application 131 that supports a virtual environment. This application 131 can be a multiplayer online battle arena (MOBA) program. When the second terminal 130 runs the application 131, the user interface of the application 131 is displayed on the screen of the second terminal 130. This client can be any of the following: MOBA game, battle royale shooting game, or SLG game. In this embodiment, the application 131 is an FPS game as an example. The second terminal 130 is the terminal used by the second user 132. The second user 132 uses the second terminal 130 to control a second virtual object located in the virtual environment. The second virtual object can be referred to as the main virtual character controlled by the second user 132. Illustratively, the second virtual object is a second virtual character, such as a lifelike character or an anime character.

[0022] Optionally, the first virtual object and the second virtual object reside in the same virtual world. Optionally, the first virtual object and the second virtual object may belong to the same faction, the same team, the same organization, have a friend relationship, or have temporary communication permissions. Optionally, the first virtual object and the second virtual object may belong to different factions, different teams, different organizations, or have an adversarial relationship.

[0023] Optionally, the applications running on the first terminal 110 and the second terminal 130 are the same, or the applications running on the two terminals are the same type of application on different operating system platforms (Android or iOS). The first terminal 110 can refer to one of a plurality of terminals, and the second terminal 130 can refer to another of a plurality of terminals. This embodiment only uses the first terminal 110 and the second terminal 130 as examples. The device types of the first terminal 110 and the second terminal 130 may be the same or different, and the device types include at least one of the following: smartphones, tablets, e-book readers, Moving Picture Experts Group Audio Layer III (MP3) players, Moving Picture Experts Group Audio Layer IV (MP4) players, laptops, and desktop computers.

[0024] It should be noted that the first or second terminal includes, but is not limited to, mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle terminals, aircraft, etc.

[0025] Figure 1 Only two terminals are shown in the diagram, but in different embodiments, multiple other terminals can access the server 120. Optionally, one or more terminals may also be terminals corresponding to developers, on which a development and editing platform for applications supporting virtual environments is installed. Developers can edit and update applications on these terminals and transmit the updated application installation packages to the server 120 via wired or wireless networks. The first terminal 110 and the second terminal 130 can download the application installation packages from the server 120 to update the applications.

[0026] The first terminal 110, the second terminal 130, and other terminals are connected to the server 120 via a wireless network or a wired network.

[0027] Server 120 includes at least one of the following: a single server, a server cluster consisting of multiple servers, a cloud computing platform, and a virtualization center. Server 120 is used to provide background services for applications that support virtual environments. Optionally, server 120 undertakes the primary computing work, and the terminal undertakes the secondary computing work; or, server 120 undertakes the secondary computing work, and the terminal undertakes the primary computing work; or, server 120 and the terminal use a distributed computing architecture for collaborative computing.

[0028] In an illustrative example, server 120 includes memory 121, processor 122, user account database 123, battle service module 124, and user-facing input / output interface (I / O interface) 125. The processor 122 loads instructions stored in server 120 and processes data in user account database 123 and battle service module 124. User account database 123 stores data about user accounts used by the first terminal 110, second terminal 130, and other terminals, such as user account avatars, nicknames, combat power indices, and the service area where the user account is located. Battle service module 124 provides multiple battle rooms for users to play, such as 1v1, 3v3, and 5v5 battles. User-facing I / O interface 125 establishes communication and exchanges data with the first terminal 110 and / or second terminal 130 via wireless or wired network.

[0029] Please refer to Figure 2 This document illustrates a flowchart of a virtual object control method provided in an exemplary embodiment of this application. This embodiment uses this method for... Figure 1 Taking the first terminal 110 or the second terminal 130, or other terminals in the implementation environment shown, as an example, the method includes the following steps: Step 201: Display the first virtual object and the second virtual object, where the second virtual object is a virtual object that automatically moves with the first virtual object.

[0030] In one possible implementation, the first virtual object is the target to be followed, and the second virtual object is a virtual object in an automatic following state that moves with the first virtual object.

[0031] The first virtual object can be a virtual object controlled by a real player or an AI virtual object, while the second virtual object follows a virtual object controlled by a real player that is in a moving state or follows an AI virtual object that is in a moving state.

[0032] Optionally, the second virtual object is at least one of the following: an AI virtual object assigned in the game, a virtual object set to auto-follow mode, and a virtual object owned by the first virtual object.

[0033] The second virtual object can be either a virtual object controlled by a real player or an AI virtual object. When the second virtual object is controlled by a real player, it is set to auto-follow mode and moves with the first virtual object. When the second virtual object is an AI virtual object, it can be a virtual object automatically assigned to the same faction as the first virtual object in the game, or it can be a virtual object owned by the first virtual object, such as a virtual pet, thus automatically following the first virtual object in the game.

[0034] It should be noted that the second virtual object can be multiple virtual objects in an automatic following state.

[0035] Step 202: Control the first virtual object to move within the virtual environment.

[0036] Optionally, during the process of controlling the movement of the first virtual object, the terminal displays the movement screen of the first virtual object.

[0037] The movement of the first virtual object can be controlled by either the terminal or the server. When the first virtual object is a player-controlled virtual object, after receiving a control operation, the terminal can either control the movement of the first virtual object based on the control operation, or send the control operation to the server, which will then control the movement of the first virtual object and display it on the terminal.

[0038] When the first virtual object is an AI virtual object, the server can control the movement of the first virtual object, and the terminal can display it.

[0039] Step 203: While the first virtual object is moving, control the second virtual object to move towards the target location in the virtual environment. The target location is located in the area in front of the first virtual object during its movement.

[0040] During the movement of the first virtual object, it is necessary to control the second virtual object to follow the movement of the first virtual object. In this embodiment, when controlling the second virtual object to follow the movement of the first virtual object, the second virtual object is controlled to move towards a target position in the area in front of the first virtual object.

[0041] The area in front of the first virtual object is a target range centered on the orientation of the first virtual object. When the orientation of the first virtual object changes, its area in front changes accordingly. Optionally, the area in front of the first virtual object can be a fan-shaped area, a square area, a cone-shaped area, etc., centered on the orientation of the first virtual object; this embodiment does not limit this.

[0042] The target location can be any point in the area in front. As the area in front changes, the target location can change accordingly, and its position in the area in front can be different each time it changes.

[0043] Furthermore, when the second virtual object contains multiple virtual objects, the target positions corresponding to each virtual object may be different.

[0044] Indicative, such as Figure 3 As shown, when the first virtual object moves toward 301, the area in front can be as shown in area 302, and the second virtual object 303 moves toward the target position 304.

[0045] The movement of the second virtual object to the target location can be controlled by either the terminal or the server. When the second virtual object is controlled by a real player and set to automatic mode, determining the target location and controlling its movement can be done by the terminal, or the terminal can determine the target location, send it to the server, and the server can then control the second virtual object to move there, which is then displayed on the terminal. When the second virtual object is an AI-generated object, the server can determine the target location in the foreground area and control its movement.

[0046] Specifically, when controlling the movement of the second virtual object, the target node in the behavior tree can be called, and the target node's follow target parameter can be configured as the first virtual object. Thus, during the process of the target node being called, the target position can be determined in the area in front of the first virtual object, thereby controlling the second virtual object to move towards the target position.

[0047] For example, a Dogmove node can be invoked in the behavior tree, and the target parameter of the node can be configured as the first virtual object. When the Dogmove node is invoked, the target position can be determined in the area in front of the first virtual object during its movement, and used as the movement target of the second virtual object, thereby controlling the second virtual object to move towards the target position.

[0048] Compared to the method of following the movement trajectory of the first virtual object in related technologies, in the embodiments of this application, the second virtual object can automatically move to the target position in the area in front of the first virtual object. Even if the second virtual object moves automatically in the direction of the first virtual object, it does not need to move according to the position of the first virtual object. Since it does not need to move according to the position of the first virtual object, the second virtual object can move around and in front of the first virtual object, thereby improving the anthropomorphism of the second virtual object's automatic following.

[0049] In summary, in this embodiment, when the second virtual object is in a state of automatically following the movement of the first virtual object, it is controlled to move towards the target position in the area in front of the first virtual object. Compared to the automatic following method based on the movement path of the target in related technologies, the method provided in this embodiment allows the second virtual object to move automatically towards the position in front of the first virtual object without needing to move based on the real-time position of the first virtual object. This means the movement path of the second virtual object is different from that of the first virtual object, making the following behavior of the second virtual object more natural and improving the anthropomorphism of the virtual object in the automatic following state, thereby enhancing the realism of the game.

[0050] The movement of the first and second virtual objects is controlled by a terminal or server. For ease of description, the following embodiments will use terminal control as an example, but this is not intended to limit the scope. Furthermore, to further improve the human-like automatic following of the second virtual object, the target position is updated periodically, allowing the second virtual object to move to different locations at different times. An exemplary embodiment will be described below.

[0051] Please refer to Figure 4 This document illustrates a flowchart of a virtual object control method provided in an exemplary embodiment of this application. This embodiment uses this method for... Figure 1 Taking the first terminal 110 or the second terminal 130, or other terminals in the implementation environment shown, as an example, the method includes the following steps: Step 401: Display the first virtual object and the second virtual object.

[0052] Step 402: Control the first virtual object to move in the virtual environment.

[0053] The implementation methods of steps 401 and 402 can refer to steps 201 and 202 above, and will not be repeated in this embodiment.

[0054] Step 403: Determine the front area of ​​the first virtual object.

[0055] When the second virtual object starts to be in automatic following mode and the first virtual object starts to move, the terminal can determine the area in front of the first virtual object based on the orientation of the first virtual object. The area in front can be a pre-set area of ​​a fixed size located in front of the first virtual object with the orientation of the first virtual object as the center line.

[0056] Step 404: Select the target location from the area in front.

[0057] Once the area in front of the first virtual object is determined, a target position is selected within that area, thereby controlling the second virtual object to move toward the target position.

[0058] Indicative, such as Figure 5 As shown, the area in front of the first virtual object 501 is area 502.

[0059] Since the area in front of the first virtual object may change, if the second virtual object needs to follow the first virtual object, the target position needs to be updated.

[0060] In one possible implementation, a target location is selected from the front region at target time intervals, wherein the target location selected each time is different.

[0061] Indicatively, the target time interval can be 2 seconds. Every 2 seconds, a new target position is selected in the area in front of the first virtual object. However, if the distance between two adjacent target positions is large, it will cause the second virtual object to shake significantly during the following process, resulting in poor human-like following. Therefore, in one possible implementation, the target position can be selected based on the previously selected target position each time. This method may include the following steps: Step 1: Based on the target location selected in the previous step, determine the target range within the area in front, with the target range centered on the target location selected in the previous step.

[0062] Optionally, during each selection of a target location, the target location obtained in the previous selection is used as the center, and a range with a radius equal to the target length is determined. The intersection of this range and the area in front is then defined as the target range within the area in front.

[0063] Indicative, such as Figure 5 As shown, after selecting the first target position 503 in the front area 502 of the first virtual object 501, after 2 seconds, the target position is selected again in the front area 504 of the first virtual object 501. In this selection process, the target range 505 in the front area 504 is first determined based on the first target position 503, and the updated second target position 506 is selected in the target range 505.

[0064] Since the target position is reselected within the target area in front of the target at every target time interval, in one possible scenario, the orientation of the first virtual object may change significantly during the interval between two target position selections. In this case, the area centered on the previously selected target position and with a radius equal to the target length may not intersect with the front area, meaning the target range within the front area cannot be determined. Therefore, when determining the target range within the front area based on the previously selected target position, the changes in the front area of ​​the first virtual object can be determined first.

[0065] Optionally, if the orientation change value is less than the orientation threshold, the target range in the area in front is determined based on the target position obtained in the previous selection. The orientation change value is the difference between the real-time orientation of the first virtual object and the orientation of the first virtual object when the target position was selected in the previous selection.

[0066] The orientation threshold can be a preset threshold, for example, 90°.

[0067] Indicative, such as Figure 5 As shown, when a target position is selected again in the front area 504 of the first virtual object 501, the orientation of the first virtual object changes less than the orientation threshold when the first target position 503 is selected. Therefore, the target range 505 of the front area 504 can be determined, and the second target position 506 can be selected within the target range 505.

[0068] Step 2: Select the target location from the target range.

[0069] In one possible implementation, the target location can be randomly selected within the target range.

[0070] Alternatively, in another possible implementation, each candidate position in the foreground area can be determined according to a pre-set interval, so that after the target range is determined, the target position can be randomly selected from the candidate positions within the target range.

[0071] Optionally, different interval parameters can be preset for front areas of different shapes. For example, for a square area, the distance interval between two candidate positions can be preset to determine each candidate position in the square area; while for a fan-shaped area, the distance interval and angle interval can be preset to determine each candidate position in the fan-shaped area.

[0072] If the change in orientation is less than the orientation threshold, a target location can be randomly selected within the target area in front. However, if the change in orientation exceeds the orientation threshold, selecting a target location may involve the following steps: Step 1: When the orientation change value is greater than the orientation threshold, determine the extraction priority of each candidate position in the front area. The extraction priority is negatively correlated with the position distance, which is the distance between the candidate position and the target position selected in the last time.

[0073] When the orientation change value is greater than the orientation threshold, the selection priority of each candidate position in the foreground area is determined based on the distance between the candidate position and the previously selected target position. The candidate positions can be any position in the foreground area, or they can be candidate positions determined according to a pre-set interval parameter.

[0074] Selection priority is used to indicate the priority at which a candidate position is selected as the target position. The smaller the distance between the candidate position and the previously selected target position, the higher the selection priority.

[0075] Step 2: Based on the extraction priority, select the target position from each candidate position. The extraction priority of the target position is higher than that of other candidate positions.

[0076] In one possible implementation, after determining the selection priority of each candidate position, the target position is selected from the candidate positions corresponding to the highest priority. Specifically, if the candidate positions corresponding to the highest priority contain only one position, that candidate position can be directly determined as the target position; if the candidate positions corresponding to the highest priority contain multiple positions, the target position can be randomly selected from among the multiple candidate positions corresponding to the highest priority.

[0077] In another possible implementation, to further enhance the anthropomorphism of the second virtual object, when there are multiple candidate positions corresponding to the highest priority, the target position can be further determined based on the distance to the first virtual object. This approach may include the following steps: Step 1: If there are at least two alternative positions among the candidate positions, determine the distance between at least two alternative positions and the second virtual object. The extraction priority corresponding to the alternative positions is the highest priority.

[0078] When there are at least two candidate positions with the highest priority (i.e., at least two alternative positions), the distance between the at least two alternative positions and the second virtual object can be determined first. When the distance between the alternative positions and the second virtual object is large, if the second virtual object is controlled to move towards an alternative position, the second virtual object will move in the direction that is farther away from the first virtual object.

[0079] Indicative, such as Figure 6 As shown, when the first virtual object is at position 601, the area in front is determined to be area 602. After selecting the first target position 603 in the area in front 602, when the target time interval is reached, the first virtual object is at position 604. At this time, the area in front is determined to be area 605. Since the orientation change value of the first virtual object at position 604 compared to when it is at position 601 is greater than the orientation threshold of 90°, the distance between each candidate position in the area in front 605 and the first target position 603 is determined, resulting in the first candidate position 606 and the second candidate position 607. Both positions are selected with the highest priority. At this time, since the first virtual object is at position 604 and moves to the left and rear, while the second virtual object is at position 608 and is closer to the second candidate position 607, moving to the second candidate position 607 is closer to the movement direction of the first virtual object.

[0080] Step 2: Determine the candidate location corresponding to the shortest distance as the target location.

[0081] After determining the distance between each candidate position and the second virtual object, the candidate position with the closest distance to the second virtual object is selected as the target position, so that the following state of the second virtual object is more in line with the actual following state and the anthropomorphism of the following is improved.

[0082] Combining the examples above, such as Figure 6 As shown, since the second alternative position 607 is closer to the second virtual object 608, the second alternative position 607 is determined as the second target position.

[0083] Step 405: Control the second virtual object to move towards the target location.

[0084] After each target location is selected, the second virtual object is controlled to move towards that location. This movement can be controlled to be either a straight line or a curve; this embodiment does not limit the movement. Furthermore, if virtual obstacles exist along the path during the movement, the second virtual object can be controlled to bypass them and continue moving towards the target location.

[0085] In one possible implementation, the process of controlling the movement of the second virtual object based on the target location may include the following steps: Step 701: Determine the first virtual object; Step 702: Determine the front area of ​​the first virtual object; Step 703: Determine whether to select a target location. If yes, proceed to step 705; otherwise, proceed to step 704. Step 704: Randomly select a target location in the area ahead; Step 705: Using the target location as the center, determine the target range in the area in front, and reselect the target location within the target range; Step 706: Control the second virtual object to move towards the target location; Step 707: Determine whether the target time interval has been reached. If yes, proceed to step 703; otherwise, proceed to step 706.

[0086] In this embodiment, the target position is reselected at every target time interval, so that the second virtual object moves to a different position in front of the first virtual object, making the following behavior of the second virtual object more natural and helping to improve the anthropomorphism of the automatic following of the second virtual object.

[0087] Furthermore, in this embodiment, when selecting a target location, if the orientation of the first virtual object changes little compared to the orientation of the first virtual object when the target location was selected last time, the target range in the front area can be determined based on the target location obtained from the last selection, and the target location can be selected within the target range. This makes the change between two adjacent selections of the target location small, making the following state of the second virtual object more stable, avoiding continuous shaking, and helping to improve the anthropomorphism of the automatic following of the second virtual object.

[0088] Furthermore, when the orientation of the first virtual object changes significantly, the selection priority can be determined based on the target position obtained in the previous selection. After obtaining multiple candidate positions based on the selection priority, the final target position can be determined based on the distance between the virtual object and the second virtual object, so that the orientation change of the second virtual object is closer to the orientation change of the first virtual object, thereby improving the naturalness of the automatic following of the second virtual object.

[0089] In one possible implementation, during the process of controlling the second virtual object to move towards the target location, the second virtual object can be controlled to move at different speeds, thereby further improving the anthropomorphic nature of the second virtual object's automatic following. An exemplary embodiment will be described below.

[0090] Step 801: Display the first virtual object and the second virtual object.

[0091] Step 802: Control the first virtual object to move in the virtual environment.

[0092] The implementation methods of steps 801 and 802 can refer to steps 201 and 202 above, and will not be repeated in this embodiment.

[0093] Step 803: Determine the front area of ​​the first virtual object.

[0094] Step 803 can be referred to step 403 above, and will not be repeated in this embodiment.

[0095] Step 804: Select a target location from the area in front, and determine the movement speed of the second virtual object based on the distance between the second virtual object and the target location.

[0096] In this embodiment, the moving speed of the second virtual object can be determined based on the distance between the target position and the second virtual object, so that the second virtual object moves at different speeds while following the first virtual object.

[0097] Optionally, if the interval distance is greater than the first distance threshold, the movement speed of the second virtual object is determined as the first speed, and the first speed is greater than the movement speed of the first virtual object.

[0098] The first distance threshold can be a preset threshold. When it is determined that the distance between the second virtual object and the target position is greater than the first distance threshold, it is determined that the second virtual object is far away from the first virtual object. At this time, the second virtual object can be controlled to speed up to catch up with the first virtual object, so that the following state of the second virtual object is more natural.

[0099] That is, when the interval distance is greater than the first distance threshold, the second virtual object moves at a first speed that is greater than the current moving speed of the first virtual object.

[0100] It should be noted that when the target position changes, the distance between the second virtual object and the updated target position is redefined, and the movement speed of the second virtual object is determined based on the redefined distance.

[0101] Optionally, if the interval distance is less than the first distance threshold but greater than the second distance threshold, the movement speed of the second virtual object is determined as the second speed, which is the same as the movement speed of the first virtual object.

[0102] If the second distance threshold is less than the first distance threshold, and the distance between the two objects is less than the first distance threshold but greater than the second distance threshold, it can be determined that the first virtual object and the second virtual object are close. In this case, the second virtual object and the first virtual object can be controlled to move at the same speed.

[0103] Optionally, if the interval distance is less than the second distance threshold, the movement speed of the second virtual object is determined as the third speed, and the third speed is less than the movement speed of the first virtual object.

[0104] When the distance between the second virtual object and the target position is less than the second distance threshold, the second virtual object will be in front of the first virtual object. When the second virtual object is far in front of the first virtual object, it is necessary to control the second virtual object to reduce its speed, thereby reducing the distance between it and the first virtual object.

[0105] That is, if the interval distance is less than the second distance threshold, the movement speed of the second virtual object is determined to be the third speed, which is less than the current movement speed of the first virtual object.

[0106] Optionally, the following speed of the second virtual object can be controlled by the relationship between the interval distance and the first and second distance thresholds, thereby controlling the distance between the second and first virtual objects. The required distance between the second and first virtual objects differs depending on the movement state of the first virtual object. For example, when the first virtual object is running, a greater distance can be maintained between the first and second virtual objects, while when the first virtual object is crawling, a closer distance is needed. Therefore, in one possible implementation, the first and second distance thresholds are determined based on the movement state of the first virtual object.

[0107] Optionally, the correspondence between the movement state of the first virtual object and the first and second distance thresholds can be preset, with different movement states corresponding to different distance thresholds.

[0108] Optionally, when the first virtual object is in a first moving state, the first distance threshold is a first threshold and the second distance threshold is a second threshold, wherein the moving speed of the first virtual object in the first moving state is greater than the moving speed of the first virtual object when walking upright.

[0109] The first movement state can be a running state. When the first virtual object is in a running state, the first distance threshold can be determined as the first threshold, and the second distance threshold can be determined as the second threshold.

[0110] Optionally, when the second virtual object is in the second movement state, the first distance threshold is the third threshold and the second distance threshold is the fourth threshold, wherein the movement speed of the first virtual object in the second movement state is less than the movement speed of the first virtual object when walking upright.

[0111] The second movement state can be a crawling state, a crouching walking state, or a walking state while holding a prop. When the first virtual object is in the second movement state, the first distance threshold can be determined as the third threshold, and the second distance threshold can be determined as the fourth threshold.

[0112] Among them, the first threshold is greater than the third threshold, and the second threshold is less than the fourth threshold.

[0113] That is, the first distance threshold when the first virtual object is in the first movement state is larger than the first distance threshold when the first virtual object is in the second movement state. This causes the second virtual object to increase its movement speed to catch up with the first virtual object when the first virtual object is in the first movement state and is far away from the first virtual object. And when the second virtual object is in the second movement state and is relatively close to the first virtual object, it needs to increase its movement speed to catch up with the first virtual object and avoid being too far away from the first virtual object.

[0114] In addition, the second distance threshold can be adjusted according to the movement state. That is, the second distance threshold when the first virtual object is in the first movement state is smaller than the second distance threshold when it is in the second movement state. This allows the second virtual object to reduce its movement speed and shorten the distance to the first virtual object when it is in the first movement state and has passed the first virtual object by a relatively large distance. Conversely, when the second virtual object is in the second movement state and has passed the first virtual object by a relatively small distance, it should reduce its movement speed to shorten the distance to the first virtual object and avoid becoming too far away from it.

[0115] Step 805: Based on the movement speed of the second virtual object, control the second virtual object to move towards the target position.

[0116] Once the movement speed of the second virtual object is determined, the second virtual object can be controlled to move towards the target location based on the movement speed.

[0117] When the second virtual object moves at the first speed, it will accelerate to catch up with the first virtual object. To enable the second virtual object to catch up with the first virtual object as quickly as possible, it can be controlled to perform acceleration actions while accelerating, thereby reducing the distance between the first and second virtual objects as quickly as possible and improving the anthropomorphism of the second virtual object's automatic following.

[0118] That is, when the movement speed is the first speed, control the second virtual object to move towards the target position at the first speed, and control the second virtual object to perform an acceleration action.

[0119] The acceleration action may include at least one of the following: jumping forward, gliding, and using virtual props to accelerate. In one possible implementation, since the acceleration action can further increase the speed of the second virtual object, when the distance between the first and second virtual objects is large, the second virtual object is controlled to move at a first speed, and during this process, the second virtual object is controlled to perform the acceleration action. When the distance between the first and second virtual objects is relatively small, it is sufficient to control the second virtual object to move only at the first speed.

[0120] Optionally, if the distance between the second virtual object and the target location is greater than a fourth distance threshold, the second virtual object is controlled to move towards the target location at a first speed, and the second virtual object is controlled to perform an acceleration action. The fourth distance threshold is greater than the first distance threshold.

[0121] When the movement speed is the second speed, control the second virtual object to maintain the second speed and move towards the target position.

[0122] When the second virtual object moves at the third speed, its speed is less than that of the first virtual object. In this case, the distance between the first and second virtual objects will decrease. Accordingly, in order to reduce the distance as quickly as possible, the second virtual object can be controlled to decelerate, thereby reducing the distance between the first and second virtual objects as quickly as possible and further improving the anthropomorphism of the second virtual object's automatic following.

[0123] That is, when the movement speed is the third speed, control the second virtual object to move towards the target position at the third speed, and control the second virtual object to perform a deceleration action.

[0124] The deceleration action may include at least one of the following: the virtual object turning around, moving backward, or using a virtual prop to decelerate. In one possible implementation, since the deceleration action can accelerate the shortening of the distance between the first and second virtual objects, when the second virtual object is significantly ahead of the first virtual object, the second virtual object is controlled to move at a third speed, and during this process, the second virtual object performs a deceleration action. When the distance between the first and second virtual objects is relatively close, only the third speed is needed to control the movement of the second virtual object.

[0125] Optionally, if the distance between the second virtual object and the target position is less than a fifth distance threshold, the second virtual object is controlled to move towards the target position at a third speed, and the second virtual object is controlled to perform a deceleration action. The fifth distance threshold is less than the second distance threshold and greater than the third distance threshold.

[0126] Step 806: If the interval distance is less than the third distance threshold, control the second virtual object to stop moving, wherein the third distance threshold is less than the second distance threshold.

[0127] In one possible implementation, a third distance threshold is preset, and based on the relationship between the interval distance and the third distance threshold, it is determined whether to control the second virtual object to stop moving.

[0128] When the interval distance is less than the second distance threshold, the movement speed is less than the movement speed of the first virtual object. When the interval distance is less than the third distance threshold, it indicates that the distance between the second virtual object and the target position is close, and the first virtual object stops moving. At this time, the second virtual object is controlled to stop moving. In this case, the second virtual object is controlled to stop moving only when the interval distance is less than the third distance threshold, and the second virtual object stops immediately after the first virtual object stops, which makes the following state more natural.

[0129] Furthermore, after controlling the second virtual object to stop moving, since the first virtual object may only temporarily stop moving, after the target time interval is reached, the target position can be reselected, and the distance between the second virtual object and the target position can be determined. If the distance between the two virtual objects is greater than the third distance threshold, the second virtual object can be controlled to continue moving towards the target position.

[0130] In one possible implementation, controlling the movement of the second virtual object may include the following steps: Step 901: Is the interval distance less than or equal to the third distance threshold? If yes, proceed to step 910; otherwise, proceed to step 902. Step 902: Determine whether the second virtual object is moving. If yes, proceed to step 904; otherwise, proceed to step 903. Step 903: Control the movement of the second virtual object; Step 904: Is the interval greater than the first distance threshold? If yes, proceed to step 905; otherwise, proceed to step 906. Step 905: Control the second virtual object to move at the first speed; Step 906: Is the interval distance less than the first distance threshold and greater than the second distance threshold? If yes, proceed to step 907; otherwise, proceed to step 908. Step 907: Control the second virtual object to move at the second speed; Step 908: Is the interval distance less than the second distance threshold? If yes, proceed to step 909. Step 909: Control the second virtual object to move at the third speed; Step 910: Control the second virtual object to stop moving; Step 911: Determine whether the target time interval has been reached. If yes, proceed to step 901; otherwise, proceed to step 910.

[0131] In this embodiment, the speed of the second virtual object moving towards the target position is determined based on the distance between the second virtual object and the target position, so that the second virtual object moves towards the target position at different speeds at different times, making the following state of the second virtual object more natural and helping to improve the anthropomorphism of the automatic following of the second virtual object.

[0132] Furthermore, in this embodiment, during the acceleration or deceleration of the second virtual object, the second virtual object can be controlled to perform acceleration or deceleration actions respectively, thereby further improving the anthropomorphism of the second virtual object's automatic following.

[0133] Figure 10 This is a structural block diagram of a virtual object control device provided in an exemplary embodiment of this application. The device includes: The first display module 1001 is used to display a first virtual object and a second virtual object, wherein the second virtual object is a virtual object that automatically moves with the first virtual object; The first control module 1002 is used to control the movement of the first virtual object in the virtual environment; The second control module 1003 is used to control the second virtual object to move toward a target position in the virtual environment when the first virtual object moves, the target position being located in the area in front of the first virtual object during its movement.

[0134] Optionally, the second control module 1003 includes: A determining unit is used to determine the front region of the first virtual object; A selection unit is used to select the target location from the front region; A first control unit is used to control the second virtual object to move toward the target location.

[0135] Optionally, the selection unit is further configured to: At each target time interval, the target location is selected from the front region, wherein the target location selected each time is different.

[0136] Optionally, the selection unit is further configured to: Based on the target location obtained in the previous selection, the target range in the front area is determined, with the target range centered on the target location obtained in the previous selection. Select the target location from the target range.

[0137] Optionally, the selection unit is further configured to: If the orientation change value is less than the orientation threshold, the target range in the front area is determined based on the target position obtained in the previous selection. The orientation change value is the difference between the real-time orientation of the first virtual object and the orientation of the first virtual object when the target position was selected in the previous selection. The device further includes: The determination module is used to determine the extraction priority of each candidate position in the front area when the orientation change value is greater than the orientation threshold. The extraction priority is negatively correlated with the position distance, and the position distance is the distance between the candidate position and the previously selected target position. The selection module is used to select the target position from each of the candidate positions based on the extraction priority, wherein the extraction priority of the target position is higher than the extraction priority of other candidate positions.

[0138] Optionally, the selection module includes: The second determining unit is used to determine the distance between at least two of the candidate positions and the second virtual object when there are at least two alternative positions among the candidate positions, wherein the extraction priority corresponding to the alternative positions is the highest priority; The third determining unit is used to determine the candidate position corresponding to the shortest distance as the target position.

[0139] Optionally, the second control module 1003 further includes: The fourth determining unit is used to determine the moving speed of the second virtual object based on the distance between the second virtual object and the target position; The second control unit is used to control the second virtual object to move toward the target position based on the movement speed of the second virtual object.

[0140] Optionally, the second control unit is further configured to: If the interval distance is greater than a first distance threshold, the movement speed of the second virtual object is determined to be a first speed, and the first speed is greater than the movement speed of the first virtual object; If the interval distance is less than the first distance threshold and greater than the second distance threshold, the movement speed of the second virtual object is determined to be the second speed, and the second speed is the same as the movement speed of the first virtual object; If the interval distance is less than the second distance threshold, the movement speed of the second virtual object is determined to be the third speed, which is less than the movement speed of the first virtual object.

[0141] Optionally, the device further includes: A stop module is used to control the second virtual object to stop moving when the interval distance is less than a third distance threshold, wherein the third distance threshold is less than the second distance threshold.

[0142] Optionally, when the first virtual object is in a first moving state, the first distance threshold is a first threshold and the second distance threshold is a second threshold, wherein the moving speed of the first virtual object in the first moving state is greater than the moving speed of the first virtual object when walking upright; When the second virtual object is in the second movement state, the first distance threshold is the third threshold, and the second distance threshold is the fourth threshold, wherein the movement speed of the first virtual object in the second movement state is less than the movement speed of the first virtual object walking upright; Wherein, the first threshold is greater than the third threshold, and the second threshold is less than the fourth threshold.

[0143] Optionally, the second control unit is further configured to: When the movement speed is the first speed, control the second virtual object to move towards the target position at the first speed, and control the second virtual object to perform an acceleration action; When the moving speed is the third speed, control the second virtual object to move towards the target position at the third speed, and control the second virtual object to perform a deceleration action.

[0144] Optionally, the second virtual object is at least one of the following: an AI virtual object assigned during the game, a virtual object set to auto-follow mode, and a virtual object owned by the first virtual object.

[0145] In summary, in this embodiment, when the second virtual object is in a state of automatically following the movement of the first virtual object, it is controlled to move towards the target position in the area in front of the first virtual object. Compared to the automatic following method based on the movement path of the target in related technologies, the method provided in this embodiment allows the second virtual object to move automatically towards the position in front of the first virtual object without needing to move based on the real-time position of the first virtual object. This means the movement path of the second virtual object is different from that of the first virtual object, making the following behavior of the second virtual object more natural and improving the anthropomorphism of the virtual object in the automatic following state, thereby enhancing the realism of the game.

[0146] Please refer to Figure 11 This diagram illustrates a structural block diagram of a terminal 1100 provided in an exemplary embodiment of this application. The terminal 1100 may be a portable mobile terminal, such as a smartphone, tablet computer, Moving Picture Experts Group Audio Layer III (MP3) player, or Moving Picture Experts Group Audio Layer IV (MP4) player. The terminal 1100 may also be referred to as a user device, portable terminal, or other names.

[0147] Typically, terminal 1100 includes a processor 1101 and a memory 1102.

[0148] Processor 1101 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. Processor 1101 may be implemented using at least one hardware form selected from Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). Processor 1101 may also include a main processor and a coprocessor. The main processor, also known as the Central Processing Unit (CPU), 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 1101 may integrate a Graphics Processing Unit (GPU), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, processor 1101 may also include an Artificial Intelligence (AI) processor, which is used to handle computational operations related to machine learning.

[0149] The memory 1102 may include one or more computer-readable storage media, which may be tangible and non-transitory. The memory 1102 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 1102 are used to store at least one instruction, which is executed by the processor 1101 to implement the method provided in the embodiments of this application.

[0150] In some embodiments, terminal 1100 may also optionally include: peripheral device interface 1103 and at least one peripheral device.

[0151] Peripheral interface 1103 can be used to connect at least one input / output (I / O) related peripheral device to processor 1101 and memory 1102. In some embodiments, processor 1101, memory 1102 and peripheral interface 1103 are integrated on the same chip or circuit board; in some other embodiments, any one or two of processor 1101, memory 1102 and peripheral interface 1103 can be implemented on separate chips or circuit boards, which is not limited in this embodiment.

[0152] Those skilled in the art will understand that Figure 11The structure shown does not constitute a limitation on terminal 1100 and may include more or fewer components than shown, or combine certain components, or use different component arrangements.

[0153] This application also provides a computer-readable storage medium storing at least one instruction, which is loaded and executed by the processor to implement the virtual object control method described in the above embodiments.

[0154] According to one aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A terminal's processor reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the terminal to perform the control method for the virtual object provided in various alternative implementations of the above aspect.

[0155] Those skilled in the art will recognize that the functions described in the embodiments of this application in one or more of the above examples can be implemented using hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable storage medium or transmitted as one or more instructions or code on a computer-readable storage medium. Computer-readable storage media include computer storage media and communication media, wherein communication media include any medium that facilitates the transmission of a computer program from one place to another. Storage media can be any available medium accessible to a general-purpose or special-purpose computer.

[0156] The above description is merely an optional embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A method for controlling a virtual object, characterized in that, The method includes: Display a first virtual object and a second virtual object, wherein the second virtual object is a virtual object that automatically moves with the first virtual object; Control the movement of the first virtual object in the virtual environment; When the first virtual object moves, the area in front of the first virtual object is determined with the orientation of the first virtual object as the center line; Select a target location from the front area, and reselect the target location from the front area at regular intervals to update the selected target location; Control the second virtual object to move towards the newly selected target location.

2. The method according to claim 1, characterized in that, The target location is different each time.

3. The method according to claim 1, characterized in that, Selecting the target location from the forward region includes: Based on the target location obtained in the previous selection, the target range in the front area is determined, with the target range centered on the target location obtained in the previous selection. Select the target location from the target range.

4. The method according to claim 3, characterized in that, Determining the target range within the foreground area based on the previously selected target location includes: If the orientation change value is less than the orientation threshold, the target range in the front area is determined based on the target position obtained in the previous selection. The orientation change value is the difference between the real-time orientation of the first virtual object and the orientation of the first virtual object when the target position was selected in the previous selection.

5. The method according to claim 3, characterized in that, Determining the target range within the foreground area based on the previously selected target location includes: If the orientation change value is greater than the orientation threshold, the extraction priority of each candidate position in the front area is determined. The extraction priority is negatively correlated with the position distance, which is the distance between the candidate position and the previously selected target position. The orientation change value is the difference between the real-time orientation of the first virtual object and the orientation of the first virtual object when the target position was last selected. Based on the extraction priority, the target position is selected from each of the candidate positions, and the extraction priority of the target position is higher than that of other candidate positions.

6. The method according to claim 5, characterized in that, The step of selecting the target position from the candidate positions based on the extraction priority includes: If there are at least two alternative positions among the candidate positions, determine the distance between at least two alternative positions and the second virtual object, and the extraction priority corresponding to the alternative positions is the highest priority; The candidate location corresponding to the shortest distance is determined as the target location.

7. The method according to any one of claims 1 to 6, characterized in that, The step of controlling the second virtual object to move to the latest selected target location includes: The movement speed of the second virtual object is determined based on the distance between the second virtual object and the target location; Based on the movement speed of the second virtual object, control the second virtual object to move towards the target location.

8. The method according to claim 7, characterized in that, Determining the movement speed of the second virtual object based on the movement distance between the second virtual object and the target location includes: If the interval distance is greater than a first distance threshold, the movement speed of the second virtual object is determined to be a first speed, and the first speed is greater than the movement speed of the first virtual object; If the interval distance is less than the first distance threshold and greater than the second distance threshold, the movement speed of the second virtual object is determined to be the second speed, and the second speed is the same as the movement speed of the first virtual object; If the interval distance is less than the second distance threshold, the movement speed of the second virtual object is determined to be the third speed, which is less than the movement speed of the first virtual object.

9. The method according to claim 8, characterized in that, After controlling the second virtual object to move to the target location in the virtual environment, the method further includes: If the interval distance is less than a third distance threshold, the second virtual object is controlled to stop moving, wherein the third distance threshold is less than the second distance threshold.

10. The method according to claim 8, characterized in that, When the first virtual object is in a first moving state, the first distance threshold is a first threshold, and the second distance threshold is a second threshold, wherein the moving speed of the first virtual object in the first moving state is greater than the moving speed of the first virtual object walking upright; When the second virtual object is in the second movement state, the first distance threshold is the third threshold, and the second distance threshold is the fourth threshold, wherein the movement speed of the first virtual object in the second movement state is less than the movement speed of the first virtual object walking upright; Wherein, the first threshold is greater than the third threshold, and the second threshold is less than the fourth threshold.

11. The method according to claim 8, characterized in that, The step of controlling the second virtual object to move towards the target location based on the movement speed of the second virtual object includes: When the movement speed is the first speed, control the second virtual object to move towards the target position at the first speed, and control the second virtual object to perform an acceleration action; When the moving speed is the third speed, control the second virtual object to move towards the target position at the third speed, and control the second virtual object to perform a deceleration action.

12. The method according to any one of claims 1 to 6, characterized in that, The second virtual object is at least one of the following: an AI virtual object assigned during the game, a virtual object set to auto-follow mode, and a virtual object owned by the first virtual object.

13. A control device for a virtual object, characterized in that, The device includes: The first display module is used to display a first virtual object and a second virtual object, wherein the second virtual object is a virtual object that automatically moves with the first virtual object; The first control module is used to control the movement of the first virtual object in the virtual environment; The second control module is configured to, when the first virtual object moves, determine the area in front of the first virtual object with the orientation of the first virtual object as the center line; select a target position from the area in front, and reselect the target position from the area in front at regular intervals to update the selected target position; and control the second virtual object to move towards the latest selected target position.

14. A terminal, characterized in that, The terminal includes a processor and a memory, the memory storing at least one instruction, at least one program, code set, or instruction set, the at least one instruction, the at least one program, the code set, or the instruction set being loaded and executed by the processor to implement the virtual object control method as described in any one of claims 1 to 12.

15. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by a processor to implement the control method for the virtual object as described in any one of claims 1 to 12.

16. A computer program product, characterized in that, The computer program product includes computer instructions stored in a computer-readable storage medium, a terminal processor reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to implement the virtual object control method as described in any one of claims 1 to 12.