Virtual object control method, device, terminal, storage medium and program product
By identifying the leader object in the PVE game and leading non-leader objects to move in groups, the problem of AI objects gradually becoming separated is solved, and the position controllability and player experience during the pursuit process are improved.
Patent Information
- Application Number
- CN202210185345.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-28
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2042-02-28
AI Technical Summary
In PVE games, AI objects gradually become separated due to different initial positions, different pathfinding paths, and uncontrollable factors. The position controllability is not high, which affects the player experience.
By identifying the leader object in the virtual environment and leading non-leader objects to move in groups, group control of AI objects is achieved, avoiding the problem of gradually falling out of combat or being dispersed.
It improves the position controllability of AI objects in the pursuit process, enhances the regularity of pursuit scenes, allows players to perform targeted operations based on regular distribution, and improves player experience.
Smart Images

Figure CN116688503B
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer and Internet technology, and in particular to a method, device, terminal, storage medium and program product for controlling a virtual object. Background Art
[0002] At present, in game applications, the control of AI (Artificial Intelligence) objects has an important impact on the player experience. Among them, AI objects can refer to virtual characters that are not controlled by players, such as virtual characters controlled by terminals.
[0003] Taking PVE (Player versus Environment) games as an example, the related technology is provided with a common logic template, that is, each AI object executes the common logic template. For example, in a battle scene of a PVE game, each AI object that attacks a virtual object controlled by a player executes a mutually independent common logic template to chase the virtual object controlled by the player.
[0004] However, during the pursuit process, due to uncontrollable factors such as different initial positions of AI objects, different pathfinding paths, and mutual collision and squeezing between AI objects, the AI objects may gradually become separated in the game level or even lose the battle, resulting in low controllability of the positions of the AI objects during the pursuit process. Summary of the invention
[0005] The embodiments of the present application provide a control method, device, terminal, storage medium and program product for a virtual object, which can improve the position controllability of an AI object during pursuit. The technical solution is as follows:
[0006] According to one aspect of an embodiment of the present application, a method for controlling a virtual object is provided, the method comprising:
[0007] Displaying a user interface, wherein the user interface displays a virtual environment screen, wherein the virtual environment screen is a screen in which the virtual environment is observed from the perspective of the first virtual object;
[0008] In response to the first virtual object moving into the attack range of at least two second virtual objects, a leader object is determined from the at least two second virtual objects, and non-leader objects in the at least two second virtual objects gather toward the leader object;
[0009] In the virtual environment screen, the leader object is shown leading the non-leader objects to move in a group toward the first virtual object.
[0010] According to one aspect of an embodiment of the present application, a control device for a virtual object is provided, the device comprising:
[0011] An interface display module, used to display a user interface, wherein the user interface displays a virtual environment screen, wherein the virtual environment screen is a screen in which the virtual environment is observed from the perspective of the first virtual object;
[0012] a leader determination module, configured to determine a leader object from among the at least two second virtual objects in response to the first virtual object moving into an attack range of at least two second virtual objects, toward which non-leader objects among the at least two second virtual objects gather;
[0013] The screen display module is used to display, in the virtual environment screen, the leader object leading the non-leader objects to move in a group toward the first virtual object.
[0014] According to one aspect of an embodiment of the present application, a terminal is provided, comprising a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set are loaded and executed by the processor to implement the above-mentioned virtual object control method.
[0015] According to one aspect of an embodiment of the present application, a computer-readable storage medium is provided, in which at least one instruction, at least one program, a code set or an instruction set is stored, and 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 above-mentioned virtual object control method.
[0016] According to one aspect of an embodiment of the present application, a computer program product or a computer program is provided, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a terminal reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the terminal executes the above-mentioned virtual object control method.
[0017] The technical solution provided by the embodiments of the present application may have the following beneficial effects:
[0018] By acquiring at least two second virtual objects that target the first virtual object, supporting a leader object among the at least two second virtual objects, and leading non-leader objects among the at least two second virtual objects to move in a group toward the first virtual object, group control of the second virtual objects that target the first virtual object is achieved, thereby avoiding the problem that the second virtual object (i.e., AI object) gradually loses combat or becomes dispersed in its movement during the pursuit of the first virtual object due to the execution of an independent general logic template, thereby improving the position controllability of the second virtual object during the pursuit.
[0019] In addition, by dividing the second virtual objects into groups based on the first virtual objects, the distribution of the second virtual objects in the pursuit scene is more regular, so that players can perform targeted operations based on the regular distribution of the first virtual objects, thereby improving the player experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0021] Figure 1 It is a schematic diagram of an implementation environment of a solution provided by an embodiment of the present application;
[0022] Figure 2 is a flow chart of a method for controlling a virtual object provided by an embodiment of the present application;
[0023] Figure 3 is a schematic diagram of the basic logic of the second virtual object provided by an embodiment of the present application;
[0024] Figure 4 It is a schematic diagram of non-leader objects gathering toward a leader object provided by an embodiment of the present application;
[0025] Figure 5 is a schematic diagram of a method for determining a leader object provided by an embodiment of the present application;
[0026] Figure 6 is a schematic diagram of multiple leader objects provided by an embodiment of the present application;
[0027] Figure 7 is a schematic diagram of an aggregation point provided by an embodiment of the present application;
[0028] Figure 8 is a schematic diagram of a group management method provided by an embodiment of the present application;
[0029] Fig. 9 is a flow chart of a method for controlling a virtual object provided by another embodiment of the present application;
[0030] Fig.10 is a flow chart of a method for controlling a virtual object provided by another embodiment of the present application;
[0031] Fig.11 is a block diagram of a control device for a virtual object provided by an embodiment of the present application;
[0032] Fig.12 is a block diagram of a control device for a virtual object provided by another embodiment of the present application;
[0033] Fig.13 It is a block diagram of a terminal provided by an embodiment of the present application. DETAILED DESCRIPTION
[0034] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below in conjunction with the accompanying drawings.
[0035] Please refer to Figure 1 , which shows a schematic diagram of an implementation environment of a solution provided by an embodiment of the present application. The implementation environment may include: a terminal 10 and a server 20.
[0036] The terminal 10 may be an electronic device such as a mobile phone, a tablet computer, a game console, a multimedia player, a PC (Personal Computer), etc. The terminal 10 may be installed with a client of a target application, such as a client of a game application, a simulation learning application, etc.
[0037] The server 20 is used to provide background services for the client of the target application (such as a game application) in the terminal 10. For example, the server 20 can be a background server of the above application (such as a game application). The server 20 can be a single server, a server cluster composed of multiple servers, or a cloud computing service center.
[0038] The terminal 10 and the server 20 can communicate with each other via a network 30. The network 30 can be a wired network or a wireless network.
[0039] For example, taking a client that uses a game application as an example, when a second virtual object (i.e., an AI object) is chasing a first virtual object (a virtual object controlled by a player), the client obtains in real time at least two second virtual objects that have the first virtual object as their attack target, and controls the non-leader objects among the at least two second virtual objects to gather toward the leader object among the at least two second virtual objects, and controls the leader object to lead the non-leader objects to move in a group toward the first virtual object, thereby achieving group control of the second virtual objects that have the first virtual object as their attack target.
[0040] Please refer to Figure 2 , which shows a flowchart of a method for controlling a virtual object provided by an embodiment of the present application. The execution subject of each step of the method may be Figure 1 In the terminal 10 (such as the client of the target application in the terminal 10) in the implementation environment of the solution shown, the method may include the following steps (steps 201 to 203):
[0041] Step 201 : displaying a user interface, wherein a virtual environment screen is displayed in the user interface. The virtual environment screen is a screen for observing the virtual environment from the perspective of a first virtual object.
[0042] The user interface refers to the display interface of an application, such as the display interface of the above-mentioned target application. Exemplarily, in a PVE game application, the user interface may be the display interface of a game level, which is used to present the virtual environment corresponding to the game level to the user. In a simulation learning application, the user interface may be the display interface of a learning scene, which is used to present the simulated environment in the learning scene to the user. Optionally, the user interface includes a display layer and a control layer. Among them, the display level of the control layer is higher than the display level of the display layer. The display layer is used to display screen information (such as pursuit screen, battle screen, group movement screen, etc.), and the control layer is used to display UI (User Interface) controls (such as mobile controls, attack controls, etc.).
[0043] In the embodiment of the present application, the first virtual object may refer to a virtual character controlled by a player account in an application, that is, the first virtual object is a virtual character controlled by the player. Taking a shooting game application as an example, the first virtual object refers to a game character controlled by a player account in a shooting game application. The first virtual object may be in the form of a person, an animal, a cartoon or other forms, which is not limited in the embodiment of the present application. The first virtual object may be displayed in a 3D form or a 2D form, which is not limited in the embodiment of the present application.
[0044] The above-mentioned virtual environment is an environment displayed (or provided) when the client of an application (such as a game application) runs on a terminal. The virtual environment refers to an environment created for virtual objects to carry out activities (such as conquering game levels), such as a virtual house, a virtual island, a virtual sky, a virtual land, etc. The virtual environment can be a simulation of the real world, a semi-simulation and semi-fictional environment, or a purely fictional environment, which is not limited in the embodiments of the present application.
[0045] Optionally, the virtual environment picture may refer to a picture obtained by the first virtual object observing the virtual environment from a perspective such as a first person perspective, a third person perspective, etc.
[0046] Step 202: In response to a first virtual object moving into an attack range of at least two second virtual objects, a leader object is determined from the at least two second virtual objects, and non-leader objects in the at least two second virtual objects gather toward the leader object.
[0047] The second virtual object refers to a virtual character (not a virtual character controlled by a player) that runs according to a certain logic in the application, that is, the above-mentioned AI object. For example, taking a PVE game application as an example, the second virtual object can refer to a combat unit that runs according to a certain logic in the PVE game application, such as a hostile virtual character, a wild monster in a game level, an elite monster, etc.
[0048] The attack range can be set and adjusted according to actual usage requirements. Exemplarily, for different types of second virtual objects, the corresponding attack ranges may be of different sizes and shapes. For example, the attack range of a second virtual object of a long-range attack type is greater than the attack range of a second virtual object of a close-range attack type. When the first virtual object moves into the attack range of the second virtual object, the second virtual object can then use the first virtual object as an attack target to attack, follow the movement, and other behaviors. Optionally, when the first virtual object moves into the attack range of the second virtual object, if the second virtual object has an attack target, the second virtual object does not switch the attack target to the first virtual object. Otherwise, the second virtual object switches the attack target to the first virtual object.
[0049] In some embodiments, the process of determining the second virtual object corresponding to the first virtual object may also be as follows:
[0050] refer to Figure 3, the second virtual object is set to have three states: idle state 301, alert state 302 and attack state 303. In the initial state, the second virtual object is in idle state 301. In idle state 301, the second virtual object can have behaviors such as gathering and patrolling. When the second virtual object finds the first virtual object by means such as vision and hearing, the second virtual object enters alert state 302, starts to move in the direction of the first virtual object, and searches for the first virtual object. When the second virtual object in alert state 302 sees the first virtual object, or is attacked by the first virtual object, or receives a broadcast from other second virtual objects (such as a signal indicating the location of the first virtual object), the second virtual object switches from alert state 302 to attack state 303, and starts to move toward the first virtual object, that is, the first virtual object is used as the attack target. When the second virtual object moves to a position where the distance between it and the first virtual object is less than or equal to the set distance, the second virtual object starts to attack the first virtual object. When the client detects that the distance between the second virtual object and the first virtual object is greater than or equal to the set threshold (i.e., the first virtual object's field of view is lost), or the first virtual object has died, or the first virtual object exits the application, the client controls the second virtual object to change the attack target according to the battlefield situation. If there is no suitable attack target, the second virtual object returns to the idle state 301 or the alert state 302.
[0051] In the embodiment of the present application, the leader object may refer to a second virtual object that has both aggregation and guiding functions. For example, the leader object may serve as an aggregation point to achieve the gathering of non-leader objects. The leader object may also serve as a guide to lead non-leader objects to move in groups toward the first virtual object. The non-leader object refers to a second virtual object excluding the leader object from at least two second virtual objects.
[0052] For example, reference Figure 4 In the user interface 400, the first virtual object 401 moves to the Figure 4 The plurality of second virtual objects are within the attack range of the first virtual object 401, and the plurality of second virtual objects all take the first virtual object 401 as the attack target. The plurality of second virtual objects gather around the first virtual object 402 (i.e., the leader object). The first virtual object 401 is a virtual character controlled by the player, and the second virtual objects are AI objects.
[0053] Optionally, there may be multiple first virtual objects in the virtual environment, and each first virtual object may correspond to a leader object and a non-leader object, respectively. The non-leader objects corresponding to each first virtual object gather toward the leader object corresponding to each first virtual object.
[0054] In one example, the process of determining the leader object may be as follows:
[0055] Obtain leader priorities corresponding to at least two second virtual objects respectively, where the leader priorities are used to indicate the priority of the second virtual object being determined as the leader object; obtain distances between at least two second virtual objects and the first virtual object respectively; and determine the leader object from the at least two second virtual objects based on the leader priorities corresponding to the at least two second virtual objects respectively, and the distances between the at least two second virtual objects and the first virtual object respectively.
[0056] Among them, the leader priority can be determined based on the level of the second virtual object. For example, the higher the level of the second virtual object, the higher the leader priority of the second virtual object. The leader priority can also be determined based on the type of the second virtual object. For example, in a PVE game application, AI objects may include ordinary AI objects, elite AI objects, and BOOSAI objects, wherein the leader priority of the BOOS AI object is higher than the leader priority of the elite AI object, and the leader priority of the elite AI object is higher than the leader priority of the ordinary AI object. The embodiment of the present application does not limit the method for determining the leader priority.
[0057] Optionally, at least two second virtual objects may be sorted in ascending order of leader priority to obtain a first sequence; at least two second virtual objects may be sorted in descending order of distance to obtain a second sequence; based on the positions of the second virtual objects in the first sequence and the second sequence, leader scores corresponding to the at least two second virtual objects are determined, respectively, and the leader scores are used to indicate the possibility of the second virtual objects being set as leader objects; and second virtual objects whose leader scores are greater than or equal to a score threshold are determined as leader objects. Second virtual objects with a set number (such as 1) before the leader score may also be determined as leader objects.
[0058] Exemplarily, the position of the second virtual object in the first sequence (such as the serial number) and the position of the second virtual object in the second sequence are summed (or weighted summation, etc.) to obtain the leader score of the second virtual object. If the leader score of the second virtual object is greater than or equal to the scoring threshold, the second virtual object can be determined as the leader object, otherwise the second virtual object can be determined as a non-leader object. Among them, the scoring threshold can be set and adjusted according to actual usage requirements, so that there is at least one second virtual object whose leader score is greater than or equal to the scoring threshold, that is, at least one leader object can be determined. And the second virtual objects within the set range corresponding to each leader are determined as non-leader objects corresponding to each leader object. The non-leader objects corresponding to each leader object gather towards each leader object.
[0059] In another example, the second virtual object includes a first-class second virtual object and a second-class second virtual object; wherein the leader priority of the first-class second virtual object is higher than the leader priority of the second-class second virtual object, and the leader priority is used to indicate the priority of the second virtual object to be determined as the leader object. For example, in a PVE game application, the first-class second virtual object may be an elite monster (i.e., an AI object), a BOSS monster, etc., and the second-class second virtual object may be an ordinary monster, a wild monster, etc.
[0060] Optionally, the process of determining the leader object can also be as follows: when the at least two second virtual objects include a first-category second virtual object, the first-category second virtual object with the smallest distance to the first virtual object among the at least two second virtual objects is determined as the leader object; when the at least two second virtual objects do not include the first-category second virtual object, the second-category second virtual object with the smallest distance to the first virtual object among the at least two second virtual objects is determined as the leader object.
[0061] For example, refer to Figure 5 , the second virtual object 502, the second virtual object 503, the second virtual object 504, the second virtual object 505, the second virtual object 506, and the second virtual object 507 all take the first virtual object 501 as the attack target. Among the second virtual objects 502 to 507, if the second virtual object 504 and the second virtual object 506 are both first-class second virtual objects, the second virtual object 504 that is closest to the first virtual object 501 is determined as the leader object. If there is no first-class second virtual object, the second virtual object 502 that is closest to the first virtual object 501 is determined as the leader object.
[0062] In a feasible example, when the at least two second virtual objects include a first-type second virtual object, all the first-type second virtual objects may be determined as leader objects.
[0063] Optionally, during the process of non-leader objects gathering toward the leader object, the client obtains the position information of the non-leader objects and the leader object in real time, and dynamically adjusts the direction and gathering movement speed of the non-leader objects according to the position information of the non-leader objects and the leader object.
[0064] Exemplarily, in the process of non-leader objects gathering toward the leader object, the direction of the non-leader objects is pointing to the leader object, and the non-leader objects move around the leader object (i.e., move in eight directions), and the gathering movement speed of the non-leader objects is negatively correlated with the distance between the non-leader objects and the leader object. Optionally, the gathering movement speed can also be set to a step configuration according to the distance between the non-leader objects and the leader object. For example, 0.5-10 meters corresponds to the first gathering movement speed, 10-30 meters corresponds to the second gathering movement speed, and more than 30 meters is the third gathering movement speed, the third gathering movement speed is greater than the second gathering movement speed, and the second gathering movement speed is greater than the first gathering movement speed. Among them, a minimum distance is set between the second virtual objects, such as 0.2 meters, 0.5 meters, 1 meter, etc., to prevent collision and extrusion between the second virtual objects. Optionally, the movement direction of the non-leader objects is pointing to the leader object.
[0065] Step 203: In the virtual environment screen, the leader object is shown leading the non-leader objects to move in a group toward the first virtual object.
[0066] In the case where only one leader object is determined from the at least two second virtual objects, all non-leader objects in the at least two second virtual objects gather toward the leader object, and the leader object leads all non-leader objects in the at least two second virtual objects to move in a group toward the first virtual object. Figure 4 In the user interface 400, the leader object 402 leads the non-leader objects to move in a group toward the first virtual object 401. Figure 4 The second virtual object other than the leader object 402 is removed.
[0067] When multiple leader objects are determined from at least two second virtual objects, non-leader objects corresponding to each leader object gather toward each leader object, and each leader object leads the non-leader objects corresponding to each leader object to move in groups toward the first virtual object. Figure 6 , Figure 6 The ordinary monsters (i.e., the second virtual objects of the second type) and the elite monsters (i.e., the second virtual objects of the first type) in the game all take the first virtual object 601 as their attack target. Figure 6 There are three leader objects: leader object 602 , leader object 603 and leader object 604 . Leader object 602 , leader object 603 and leader object 604 lead their corresponding non-leader objects to move in groups toward the first virtual object 601 .
[0068] When the leader object leads the non-leader objects to move in a group toward the first virtual object, the client obtains the position information of the first virtual object and the leader object in real time, and dynamically adjusts the movement direction and speed of the leader object according to the position information of the first virtual object and the leader object.
[0069] Optionally, in the process where the leader object leads the non-leader objects to move in a group toward the first virtual object, the leader object may be replaced according to the actual scenario, and the specific content may be as follows:
[0070] In one example, when the leader object is killed, a new leader object is determined from the remaining second virtual objects corresponding to at least two second virtual objects. For example, when the leader object is killed by the first virtual object, the method provided in the above embodiment is used to determine a new leader object from the non-leader objects in the at least two second virtual objects.
[0071] Alternatively, when the leader object is out of combat, a new leader object is determined from the remaining second virtual objects corresponding to at least two second virtual objects. For example, when the leader object is trapped (such as the first virtual object releases a skill, etc.), resulting in the loss of the first virtual object, the method provided in the above embodiment is used to determine a new leader object from the non-leader objects in the at least two second virtual objects.
[0072] In another example, at least two second virtual objects are determined as group members of the object group corresponding to the first virtual object; in response to the first virtual object moving into the attack range of the new second virtual object, the new second virtual object is added to the object group to obtain an updated object group; and a new leader object is determined from the updated object group. For example, the object group corresponding to the first virtual object includes the second virtual object A, the second virtual object B, and the second virtual object C. When the first virtual object moves into the attack range of the second virtual object D, the second virtual object D is added to the object group corresponding to the first virtual object to obtain an updated object group corresponding to the first virtual object, and then the method provided in the above embodiment is used to determine a new leader object from the updated object group. Optionally, the leader object corresponding to the first virtual object may be retained without redetermining the leader object.
[0073] Optionally, in the process of the leader object leading the non-leader objects to move in a group toward the first virtual object, the leader object will also stay and wait for the non-leader objects, and the specific content may be as follows:
[0074] When the difference between the maximum distance between at least two second virtual objects and the first virtual object and the minimum distance between at least two second virtual objects and the first virtual object is greater than a fourth distance threshold, the leader object stops moving, and non-leader objects among the at least two second virtual objects continue to gather toward the leader object; when the difference between the maximum distance between at least two second virtual objects and the first virtual object and the minimum distance between at least two second virtual objects and the first virtual object is less than or equal to a fifth distance threshold, the leader object continues to lead the non-leader objects to move in a group toward the first virtual object.
[0075] The fourth distance threshold and the fifth distance threshold can be set and adjusted according to actual needs, and the fourth distance threshold is greater than the fifth distance threshold. The fourth distance threshold is used to prevent non-leader objects from being too dispersed, and the fifth distance threshold is used to indicate that non-leader objects are relatively concentrated, that is, the degree of aggregation is relatively high.
[0076] Optionally, while the leader object is waiting for the non-leader objects to gather, the leader object can wave or shout to the non-leader objects. Non-leader objects that are closer to the leader object also stop moving with the leader object to wait for non-leader objects that are farther away from the leader object. When the gathering degree of the non-leader objects is restored to a relatively high level, the leader object continues to lead the non-leader objects to move in a group toward the first virtual object. Optionally, when the distance between the non-leader object and the leader object is large enough, the leader object does not need to stop and wait for the non-leader object.
[0077] The embodiment of the present application prevents non-leader objects from being too dispersed by supporting a waiting aggregation mechanism, avoids scene confusion, and is beneficial to group control of the second virtual object.
[0078] In one example, a cluster point is further provided in the virtual environment, and the cluster point is used to cluster the second virtual objects. The cluster point has a higher cluster priority than the leader object. The application method of the cluster point can be as follows: obtaining the cluster point in the virtual environment; if the cluster point exists, displaying at least two second virtual objects clustering toward the cluster point; if the cluster point does not exist, displaying non-leader objects among the at least two second virtual objects clustering toward the leader object.
[0079] Optionally, the aggregation point can be a target location point in the virtual environment, such as a door, fence, building exit, etc., and the target setting point can be different in different applications or different stages in the application. The aggregation point can be triggered at a specific moment, or a specific scene, or a specific stage.
[0080] For example, reference Figure 7When the first virtual object 701 enters the virtual warehouse, the client activates the aggregation point 702, and at least two second virtual objects move toward the aggregation point 702 instead of moving toward the leader object.
[0081] In one example, at least two second virtual objects can be determined as group members of a first object group corresponding to a first virtual object; in the event that a group member of the first object group loses the first virtual object, if there are other second virtual objects within the attack range of the group member of the first object group, the group member of the first object group is added to the object group corresponding to the other second virtual objects.
[0082] Exemplarily, the first virtual object A corresponds to a first object group, which includes at least two second virtual objects, and the first virtual object B corresponds to a second object group, which also includes at least two second virtual objects. In the event that the first virtual object dies, leaves the battle, or exits the application, the group members in the first object group lose the first virtual object. If the first virtual object B is within the attack range of the group members of the first object group, the group members of the first object group are added to the second object group. For example, if the first virtual object B is within the attack range of the leader object in the first object group, the group members of the first object group are added to the second object group. For another example, if the first virtual object B is within the attack range of a set number of second virtual objects in the first object group, the group members of the first object group are added to the second object group.
[0083] Optionally, in the case where there are multiple second virtual objects B within the attack range of group members of the first object group, the group members of the first object group can be dispersed into object groups corresponding to the multiple second virtual objects B, or the group members of the first object group can be added to the object group of the second virtual object B that is closest to the first object group. This embodiment of the present application is not limited to this.
[0084] In one example, when a leader object leads non-leader objects to move in a group toward a first virtual object, in response to an attack instruction issued by the leader object, a joint attack signal is sent to each non-leader object after an interval; when each non-leader object receives the joint attack signal, each non-leader object is marked and displayed, and a screen is displayed in which at least two second virtual objects jointly attack the first virtual object; wherein, when the leader object sends an attack instruction, the leader object stops moving, and when the non-leader objects receive the joint attack signal, the non-leader objects gather toward the leader object.
[0085] The attack instruction is used to indicate that at least two second virtual objects are about to launch a joint attack on the first virtual object. In the process of issuing the attack instruction, the leader object can be specially marked, such as displaying a progress bar, bubble, air mass or other special mark directly above the leader object. The attack instruction can be the leader object jumping, shouting, waving and other actions, which are not limited in the embodiments of the present application.
[0086] The interval time can be set to be greater than or equal to the display time of the attack indication, so as to leave enough observation time and reaction time for the player. Optionally, when each non-leader object receives a joint attack signal, each non-leader object can be marked and displayed. For example, certain special effects or UI can be performed on the non-leader object. By marking and displaying each non-leader object, it is indicated that each non-leader object has received the joint attack signal and can start a joint attack on the first virtual object.
[0087] The joint attack may include the same joint attack action or a combination attack action. The joint attack action may include simultaneous charge, simultaneous high jump, simultaneous swing of props, simultaneous shooting, etc. The combination attack action may include a battle group charge, a combination attack skill, etc.
[0088] Optionally, the triggering condition of the attack indication may include at least one of the following:
[0089] 1. When the number corresponding to at least two second virtual objects is greater than or equal to the fifth threshold value, the leader object issues an attack instruction.
[0090] The fifth threshold value is used to represent the number corresponding to at least two second virtual objects, which is sufficient to launch an attack. The fifth threshold value can be set and adjusted according to actual usage requirements.
[0091] 2. When the difference between the maximum distance between at least two second virtual objects and the first virtual object and the minimum distance between at least two second virtual objects and the first virtual object is less than or equal to the second distance threshold, the leader object issues an attack instruction.
[0092] The second distance threshold is used to indicate a degree of closeness of at least two second virtual objects, which is high enough to launch an attack.
[0093] 3. When the distance between the leader object and the first virtual object is less than or equal to a third distance threshold, the leader object issues an attack instruction.
[0094] The third distance threshold is used to indicate the distance between the leader object and the first virtual object, which is close enough to launch an attack. The third distance threshold can be set and adjusted according to actual usage requirements.
[0095] 4. When the first virtual object triggers the scene setting, the leader object issues an attack instruction.
[0096] Optionally, the scene setting may be that the first virtual object reaches a set position point, or the first virtual object completes a set task (such as the number of kills is greater than a threshold), etc.
[0097] Optionally, for the target non-leader object that is close enough to the first virtual object among the at least two second virtual objects, the target non-leader object may not be led by the leader object, that is, the target non-leader object may follow, attack, etc. the first virtual object on its own.
[0098] For example, refer to Figure 8 In the user interface 801, the first virtual object 801 corresponds to multiple second virtual objects. If the distance between the non-leader object 803 in the multiple second virtual objects and the first virtual object 801 is close enough, the non-leader object 803 can follow, attack, etc. the first virtual object 801 on its own and is no longer controlled by the leader object.
[0099] To summarize, the technical solution provided in the embodiment of the present application realizes group control of the second virtual objects that have the first virtual object as the attack target by acquiring at least two second virtual objects that have the first virtual object as the attack target, and supporting the leader object among the at least two second virtual objects to lead the non-leader objects among the at least two second virtual objects to move in a group toward the first virtual object, thereby avoiding the problem that the second virtual object (i.e., the AI object) gradually loses combat or gradually disperses its position in the process of chasing the first virtual object due to the execution of an independent general logic template, thereby improving the position controllability of the second virtual object during the pursuit.
[0100] In addition, by dividing the second virtual objects into groups based on the first virtual objects, the distribution of the second virtual objects in the pursuit scene is more regular and the attack targets of the second virtual objects are clearer, so that players can perform targeted operations based on the regular distribution and attack targets of the first virtual objects, thereby improving the player experience.
[0101] In addition, by adopting the technical solution provided by the present application, the attack and movement rhythm of the second virtual object is clarified, thereby clarifying the defense or movement rhythm of the player, further improving the player experience.
[0102] In addition, since the movement and attack of the non-leader object are under the command of the leader object, the linkage movement or attack of the second virtual object is realized, so that the display of the virtual environment screen is clearer and more regular.
[0103] In an exemplary embodiment, when at least two second virtual objects are divided into a plurality of group objects, referring to Fig. 9 , the control method of the virtual object can also be as follows:
[0104] Step 901: display a user interface, wherein a virtual environment screen is displayed in the user interface. The virtual environment screen is a screen for observing the virtual environment from the perspective of a first virtual object.
[0105] Step 901 is the same as that described in the above embodiment. For the contents not described in the embodiment of the present application, reference can be made to the above embodiment and will not be repeated here.
[0106] Step 902 : In response to the first virtual object moving into the attack range of at least two second virtual objects, the at least two second virtual objects are divided to obtain a plurality of object groups.
[0107] The second virtual object refers to a virtual character (not a virtual character controlled by a player) running according to a certain logic in the application, that is, the above-mentioned AI object. The above-mentioned at least two second virtual objects all take the first virtual object as an attack target.
[0108] Optionally, for a target object group in each object group, non-leader objects in the target object group gather toward a leader object corresponding to the target object group. The target object group is any object group in the plurality of object groups. The leader object may refer to a second virtual object that combines aggregation and guidance functions. For example, the leader object may serve as an aggregation point to achieve aggregation of non-leader objects. The leader object may also serve as a guide to lead non-leader objects to move in groups toward the first virtual object. Non-leader objects refer to second virtual objects excluding the leader object from at least two second virtual objects.
[0109] In one example, a method for dividing object groups may be as follows: based on the distance between each of the at least two second virtual objects, at least two second virtual objects are divided to obtain multiple object groups; wherein, for a first object group and a second object group in the multiple object groups, the distance between group members of the first object group and group members of the second object group is greater than a first distance threshold, and the distance between each group member of the first object group or the second object group is less than or equal to the first distance threshold.
[0110] The first distance threshold is used to indicate the position distribution of each second virtual object in the virtual environment. By using the first distance threshold, second virtual objects that are close to each other can be divided into the same object group, and second virtual objects that are relatively far away can be divided into different object groups. In this way, by using the existing position distribution of the second virtual objects, the second virtual objects can be divided into blocks, so that multiple group objects can be obtained more reasonably and conveniently.
[0111] For example, refer to Figure 6 ,right Figure 6 The plurality of second virtual objects in the object group 606 are divided into object group 605, object group 606 and object group 607. For object group 605, the distance between each group member in object group 605 is less than or equal to the first distance threshold, and the distance between the group members of object group 605 and the group members of object group 606 (or object group 607) is greater than the first distance threshold.
[0112] Step 903: determine the leader objects corresponding to each object group.
[0113] Optionally, the two methods for determining the leader object described in the above embodiments may be used to determine the leader object of each object group. Exemplarily, for a target object group, when the target object group includes a first-class second virtual object, the first-class second virtual object with the smallest distance to the first virtual object is determined as the leader object of the target object group. When the target object group does not include the first-class second virtual object, the second-class second virtual object with the smallest distance to the first virtual object is determined as the leader object of the target object group.
[0114] For example, refer to Figure 6 Since there is only one first-class second virtual object in object group 605 (or object group 603), the first-class second virtual object can be directly determined as the leader object of object group 605 (or object group 603). Leader object 602 is the leader object of object group 605, and leader object 603 is the leader object of object group 607. Since there is no first-class second virtual object in object group 606, the second virtual object (i.e., leader object 604) with the smallest distance to first virtual object 601 can be determined as the leader object of object group 606.
[0115] Step 904: In the virtual environment screen, each leader object is shown leading non-leader objects in their respective object groups to move in a group toward the first virtual object.
[0116] For example, refer to Figure 6, the leader object 602 leads the non-leader objects in the object group 605 to move toward the first virtual object 601 in a group, the leader object 603 leads the non-leader objects in the object group 607 to move toward the first virtual object 601 in a group, and the leader object 604 leads the non-leader objects in the object group 606 to move toward the first virtual object 601 in a group.
[0117] Optionally, in the process where the leader object leads the non-leader objects to move in a group toward the first virtual object, the object groups may be merged according to the actual scenario, and the specific contents may be as follows:
[0118] In one example, for a target object group among multiple object groups, when the number of group members of the target object group is less than or equal to a first threshold value, the group members of the target object group are added to an object group adjacent to the target object group; and the leader object of the object group adjacent to the target object group is re-determined.
[0119] The first threshold value is used to indicate that the group members in the object group are too sparse. The first threshold value can be set and adjusted according to actual use requirements, such as 3, 4, 5, etc. The object group adjacent to the target object group may refer to an object group whose distance from the target object group is less than a set distance. In the case that there are multiple object groups adjacent to the target object group, the group members of the target object group may be dispersed into multiple object groups adjacent to the target object group.
[0120] For example, reference Figure 6 , assuming that the first threshold is 6, object group 606 is adjacent to object group 605. Since the number of group members in object group 606 is 5, which is less than the first threshold, the group members in object group 606 can be incorporated into object group 605. Then, the leader object of object group 605 is re-determined, and the leader object 602 of object group 605 can also be retained.
[0121] Optionally, when the number of group members of the target object group is less than or equal to the first threshold value, the group members of the target object group may also be added to the object group with the smallest distance from the target object group.
[0122] In another example, when the number of object groups is greater than a second threshold value, a target number of object groups are selected from multiple object groups, where the target number is the difference between the number of object groups and the second threshold value; group members of the target number of object groups are dispersed to other object groups among the multiple object groups; and leader objects of other object groups are re-determined.
[0123] The second threshold value is used to indicate that the number of object groups is too large. The second threshold value can be set and adjusted according to actual use requirements, such as 4, 5, 6, etc. Optionally, a target number of object groups can be randomly selected from multiple object groups, an object group with a target number of group members can be selected from multiple object groups, or an object group with a target number of group members can be selected from multiple object groups, and this embodiment of the application does not limit this.
[0124] Optionally, the target number of group members of the object group may be added to other object groups closest to them respectively.
[0125] The embodiment of the present application supports the merging of object groups, thereby reducing the complexity of group management and further alleviating the pressure of group management.
[0126] Optionally, in the process where the leader object leads the non-leader objects to move in a group toward the first virtual object, the object group may be split according to the actual scene, and the specific content may be as follows:
[0127] In one example, for a target object group among the multiple object groups, when the number of group members in the target object group is greater than a third threshold value, the target object group is split to obtain at least two new object groups.
[0128] The third threshold value is used to indicate that there are too many group members in the target object group. The third threshold value can be set and adjusted according to actual use requirements. For the new object groups obtained by splitting, the method provided in the above embodiment can be used to determine their respective leader objects.
[0129] In another example, for a target object group among multiple object groups, when the dispersion degree of group members of the target object group is greater than a fourth threshold value, the target object group is split to obtain at least two new object groups.
[0130] The fourth threshold value is used to indicate that the group members of the target object group are too dispersed. The fourth threshold value can be set and adjusted according to actual use requirements. For the new object groups obtained by splitting, the method provided in the above embodiment can be used to determine their respective leader objects.
[0131] To summarize, the technical solution provided in the embodiment of the present application realizes group control of the second virtual objects that have the first virtual object as the attack target by acquiring at least two second virtual objects that have the first virtual object as the attack target, and supporting the leader object among the at least two second virtual objects to lead the non-leader objects among the at least two second virtual objects to move in a group toward the first virtual object, thereby avoiding the problem that the second virtual object (i.e., the AI object) gradually loses combat or gradually disperses its position in the process of chasing the first virtual object due to the execution of an independent general logic template, thereby improving the position controllability of the second virtual object during the pursuit.
[0132] In addition, by dividing the second virtual objects into groups based on the first virtual objects, the distribution of the second virtual objects in the pursuit scene is more regular, so that players can perform targeted operations based on the regular distribution of the first virtual objects, thereby improving the player experience.
[0133] In an exemplary embodiment, reference Fig.10 Taking a PVE game as an example, the control method of a virtual object provided in an embodiment of the present application may be as follows:
[0134] The client obtains multiple AI objects (hereinafter referred to as the first AI object) that use the player object as an attack target. The player object is the first virtual object mentioned above, and the AI object is the second virtual object mentioned above. For example, if the player object moves into the attack range of the target AI object, the attack target of the target AI object is determined to be the player object.
[0135] The client obtains the position information of the player object and the position information of the first AI objects respectively corresponding to the player object, and calculates the distances between the first AI objects and the player object respectively according to the position information of the player object and the position information of the first AI objects respectively corresponding to the player object.
[0136] For a target first AI object among multiple first AI objects, if the distance between the target first AI object and the player object is less than or equal to the first threshold, the client controls the target first AI object to attack the player object. Optionally, if the target first AI object belongs to the first object group corresponding to the player character, the target first AI object is removed from the first object group. After the attack of the target first AI object is completed, the distance between the target first AI object and the player object continues to be obtained, and continues to be compared with the first threshold.
[0137] If the distance between the target first AI object and the player object is greater than a first threshold, the client classifies the target first AI object into a first object group corresponding to the player object.
[0138] The client performs the above comparison on the multiple first AI objects respectively to obtain the first object group corresponding to the player character.
[0139] The client determines a leader object in the first object group. The leader object and the method for determining the leader object are the same as those described in the above embodiment and will not be described again.
[0140] For any group member in the first object group, the identity of the group member is compared, and if the group member is the leader object, the non-leader objects in the first object group are waited for to gather. When the gathering degree of the non-leader objects is high enough, the leader object issues an attack instruction and sends a joint attack signal to each non-leader object.
[0141] If the group member is not the leader object, the client controls the group member to gather towards the leader object. If the group member receives a joint attack signal from the leader object, the client marks and displays the group member. If the group member does not receive a joint attack signal from the leader object, the client continues to obtain the position information of the group member and determines whether to directly attack the first virtual object.
[0142] When all non-leader objects in the first object group receive the joint attack signal from the leader object, the client controls the non-leader objects and the leader object in the first object group to jointly attack the player character.
[0143] To summarize, the technical solution provided in the embodiment of the present application realizes group control of the second virtual objects that have the first virtual object as the attack target by acquiring at least two second virtual objects that have the first virtual object as the attack target, and supporting the leader object among the at least two second virtual objects to lead the non-leader objects among the at least two second virtual objects to move in a group toward the first virtual object, thereby avoiding the problem that the second virtual object (i.e., the AI object) gradually loses combat or gradually disperses its position in the process of chasing the first virtual object due to the execution of an independent general logic template, thereby improving the position controllability of the second virtual object during the pursuit.
[0144] In addition, by dividing the second virtual objects into groups based on the first virtual objects, the distribution of the second virtual objects in the pursuit scene is more regular, so that players can perform targeted operations based on the regular distribution of the first virtual objects, thereby improving the player experience.
[0145] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.
[0146] Please refer to Fig.11 , which shows a block diagram of a virtual object control device provided by an embodiment of the present application. The device has the function of implementing the above method example, and the function can be implemented by hardware or by hardware executing corresponding software. The device can be the terminal introduced above, or it can be set in the terminal. Fig.11 As shown, the device 1100 includes: an interface display module 1101 , a leader determination module 1102 and a screen display module 1103 .
[0147] The interface display module 1101 is used to display a user interface, in which a virtual environment picture is displayed. The virtual environment picture is a picture of observing the virtual environment from the perspective of the first virtual object.
[0148] The leader determination module 1102 is configured to determine a leader object from the at least two second virtual objects in response to the first virtual object moving into the attack range of at least two second virtual objects, and non-leader objects in the at least two second virtual objects gather towards the leader object.
[0149] The screen display module 1103 is used to display, in the virtual environment screen, the leader object leading the non-leader objects to move in a group toward the first virtual object.
[0150] In an exemplary embodiment, Fig.12 As shown, the leader determination module 1102 includes: a priority acquisition submodule 1102a, a distance acquisition submodule 1102b and a leader determination submodule 1102c.
[0151] The priority acquisition submodule 1102a is used to acquire the leader priorities respectively corresponding to the at least two second virtual objects, where the leader priority is used to indicate the priority of the second virtual object being determined as the leader object.
[0152] The distance acquisition submodule 1102b is configured to acquire the distances between the at least two second virtual objects and the first virtual object respectively.
[0153] The leader determination submodule 1102c is configured to determine the leader object from the at least two second virtual objects based on the leader priorities respectively corresponding to the at least two second virtual objects and the distances respectively between the at least two second virtual objects and the first virtual object.
[0154] In an exemplary embodiment, the leader determination submodule 1102c is used to:
[0155] Sorting the at least two second virtual objects in ascending order of the leader priority to obtain a first sequence;
[0156] Sorting the at least two second virtual objects in descending order of the distances to obtain a second sequence;
[0157] Determining, based on the positions of the second virtual objects in the first sequence and the second sequence, leader scores corresponding to the at least two second virtual objects, respectively, the leader scores being used to indicate the possibility that the second virtual objects are set as the leader objects;
[0158] The second virtual object whose leader score is greater than or equal to the score threshold is determined as the leader object.
[0159] In an exemplary embodiment, the second virtual object includes a first-category second virtual object and a second-category second virtual object; wherein the leader priority of the first-category second virtual object is higher than the leader priority of the second-category second virtual object, and the leader priority is used to indicate the priority of the second virtual object being determined as the leader object; the leader determination module 1102 is further used to:
[0160] In a case where the at least two second virtual objects include the first-type second virtual object, determining the first-type second virtual object that has the smallest distance to the first virtual object among the at least two second virtual objects as the leader object;
[0161] In a case where the at least two second virtual objects do not include the first-type second virtual object, the second-type second virtual object that is at the shortest distance from the first virtual object among the at least two second virtual objects is determined as the leader object.
[0162] In an exemplary embodiment, the leader determination module 1102 is further configured to:
[0163] In the case where the leader object is killed, determining a new leader object from the remaining second virtual objects corresponding to the at least two second virtual objects;
[0164] Alternatively, when the leader object is out of the battle, a new leader object is determined from the remaining second virtual objects corresponding to the at least two second virtual objects.
[0165] In an exemplary embodiment, Fig.12 As shown, the leader determination module 1102 further includes: a group determination submodule 1102d.
[0166] The group determination submodule 1102d is used to determine the at least two second virtual objects as group members of the object group corresponding to the first virtual object.
[0167] The group determination submodule 1102d is further configured to, in response to the first virtual object moving into the attack range of a new second virtual object, add the new second virtual object to the object group to obtain an updated object group.
[0168] The leader determination submodule 1102c is further configured to determine a new leader object from the updated object group.
[0169] In an exemplary embodiment, the group determination submodule 1102d is further configured to divide the at least two second virtual objects into multiple object groups.
[0170] The leader determination submodule 1102c is further configured to determine a leader object corresponding to each object group; wherein, for a target object group in each object group, non-leader objects in the target object group gather toward the leader object corresponding to the target object group.
[0171] In an exemplary embodiment, the group determination submodule 1102d is further configured to:
[0172] Based on the distance between each of the at least two second virtual objects, the at least two second virtual objects are divided to obtain the multiple object groups; wherein, for a first object group and a second object group among the multiple object groups, the distance between group members of the first object group and group members of the second object group is greater than a first distance threshold, and the distance between each group member of the first object group or the second object group is less than or equal to the first distance threshold.
[0173] In an exemplary embodiment, the group determination submodule 1102d is further used to, for a target object group among the multiple object groups, add group members of the target object group to an object group adjacent to the target object group when the number of group members of the target object group is less than or equal to a first threshold value.
[0174] The leader determination submodule 1102c is further configured to re-determine a leader object of an object group adjacent to the target object group.
[0175] In an exemplary embodiment, the group determination submodule 1102d is further configured to select a target number of object groups from the multiple object groups when the number of object groups is greater than a second threshold value, wherein the target number is the difference between the number of object groups and the second threshold value.
[0176] The group determination submodule 1102d is further configured to distribute the target number of group members of the target group to other target groups among the plurality of target groups.
[0177] The leader determination submodule 1102c is further configured to re-determine the leader object of the other object groups.
[0178] In an exemplary embodiment, the group determination submodule 1102d is further configured to:
[0179] For a target object group among the multiple object groups, when the number of group members in the target object group is greater than a third threshold value, splitting the target object group to obtain at least two new object groups;
[0180] Alternatively, for a target object group among the multiple object groups, when the dispersion degree of group members of the target object group is greater than a fourth threshold value, the target object group is split to obtain at least two new object groups.
[0181] In an exemplary embodiment, the group determination submodule 1102d is further configured to:
[0182] Determine the at least two second virtual objects as group members of the first object group corresponding to the first virtual object;
[0183] In the case that a group member of the first object group loses the first virtual object, if there are other second virtual objects within the attack range of the group member of the first object group, the group member of the first object group is added to the object group corresponding to the other second virtual objects.
[0184] In an exemplary embodiment, the screen display module 1103 is used to:
[0185] In response to the attack instruction sent by the leader object, sending a joint attack signal to each non-leader object after an interval;
[0186] When the non-leader objects receive the joint attack signal, the marks are displayed on the non-leader objects, and a screen is displayed showing the at least two second virtual objects making a joint attack on the first virtual object; wherein, during the process of the leader object issuing the attack instruction, the leader object stops moving, and when the non-leader objects receive the joint attack signal, the non-leader objects gather toward the leader object.
[0187] In an exemplary embodiment, when the number corresponding to the at least two second virtual objects is greater than or equal to a fifth threshold value, the leader object issues the attack instruction;
[0188] Alternatively, the leader object issues the attack instruction when the difference between the maximum distance between the at least two second virtual objects and the first virtual object and the minimum distance between the at least two second virtual objects and the first virtual object is less than or equal to a second distance threshold;
[0189] Alternatively, when the distance between the leader object and the first virtual object is less than or equal to a third distance threshold, the leader object issues the attack instruction;
[0190] Alternatively, when the first virtual object triggers the scene setting, the leader object issues the attack instruction.
[0191] In an exemplary embodiment, when the difference between the maximum distance between the at least two second virtual objects and the first virtual object and the minimum distance between the at least two second virtual objects and the first virtual object is greater than a fourth distance threshold, the leader object stops moving, and non-leader objects among the at least two second virtual objects continue to gather toward the leader object;
[0192] When the difference between the maximum distance between the at least two second virtual objects and the first virtual object and the minimum distance between the at least two second virtual objects and the first virtual object is less than or equal to a fifth distance threshold, the leader object continues to lead the non-leader objects to move in a group toward the first virtual object.
[0193] In an exemplary embodiment, Fig.12 As shown, the device 1100 also includes: an aggregation point acquisition module 1104.
[0194] The aggregation point acquisition module 1104 is used to acquire the aggregation point in the virtual environment; wherein the aggregation priority of the aggregation point is higher than the aggregation priority of the leader object.
[0195] The screen display module 1103 is further used to display the at least two second virtual objects converging toward the aggregation point when the aggregation point exists.
[0196] The screen display module 1103 is further used to display the non-leader objects among the at least two second virtual objects gathering toward the leader object when the aggregation point does not exist.
[0197] To summarize, the technical solution provided in the embodiment of the present application realizes group control of the second virtual objects that have the first virtual object as the attack target by acquiring at least two second virtual objects that have the first virtual object as the attack target, and supporting the leader object among the at least two second virtual objects to lead the non-leader objects among the at least two second virtual objects to move in a group toward the first virtual object, thereby avoiding the problem that the second virtual object (i.e., the AI object) gradually loses combat or gradually disperses its position in the process of chasing the first virtual object due to the execution of an independent general logic template, thereby improving the position controllability of the second virtual object during the pursuit.
[0198] In addition, by dividing the second virtual objects into groups based on the first virtual objects, the distribution of the second virtual objects in the pursuit scene is more regular, so that players can perform targeted operations based on the regular distribution of the first virtual objects, thereby improving the player experience.
[0199] It should be noted that the device provided in the above embodiment, when implementing its functions, is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0200] Please refer to Fig.13 , which shows a block diagram of a terminal 1300 provided in one embodiment of the present application. The terminal is used to implement the control method of the virtual object provided in the above embodiment. The terminal may be Figure 1 The terminal 10 in the implementation environment shown. Specifically:
[0201] Typically, the terminal 1300 includes a processor 1301 and a memory 1302 .
[0202] Optionally, the processor 1301 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 1301 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field Programmable Gate Array), and PLA (Programmable Logic Array). The processor 1301 may also include a main processor and a coprocessor. The main processor is a processor for processing data in an awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 1301 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 1301 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0203] Optionally, the memory 1302 may include one or more computer-readable storage media, which may be non-transitory. The memory 1302 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 1302 is used to store at least one instruction, at least one program, code set or instruction set, and the at least one instruction, at least one program, code set or instruction set is configured to be executed by one or more processors to implement the above-mentioned virtual object control method.
[0204] In some embodiments, the terminal 1300 may further optionally include: a peripheral device interface 1303 and at least one peripheral device. The processor 1301, the memory 1302 and the peripheral device interface 1303 may be connected via a bus or a signal line. Each peripheral device may be connected to the peripheral device interface 1303 via a bus, a signal line or a circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 1304, a display screen 1305, an audio circuit 1306 and a power supply 1307.
[0205] Those skilled in the art will understand that Fig.13 The structure shown in the figure does not constitute a limitation on the terminal 1300, and the terminal 1300 may include more or less components than those shown in the figure, or combine some components, or adopt a different component arrangement.
[0206] In an exemplary embodiment, a computer-readable storage medium is also provided, in which at least one instruction, at least one program, a code set or an instruction set is stored, and when the at least one instruction, the at least one program, the code set or the instruction set is executed by a processor, the control method of the virtual object described above is implemented.
[0207] Optionally, the computer readable storage medium may include: ROM (Read-Only Memory), RAM (Random-Access Memory), SSD (Solid State Drives) or optical disks, etc. Among them, the random access memory may include ReRAM (Resistance Random Access Memory) and DRAM (Dynamic Random Access Memory).
[0208] In an exemplary embodiment, a computer program product or a computer program is also provided, wherein the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a terminal reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the terminal executes the above-mentioned virtual object control method.
[0209] It should be noted that the information (including but not limited to the subject's device information, subject's personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals involved in this application are all authorized by the subject or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions. For example, the player operation data involved in this application are all obtained with full authorization.
[0210] It should be understood that the "multiple" mentioned in this article refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. In addition, the step numbers described in this article only illustrate a possible execution sequence between the steps. In some other embodiments, the above steps may not be executed in the order of the numbers, such as two steps with different numbers are executed at the same time, or two steps with different numbers are executed in the opposite order to the diagram. The embodiments of the present application are not limited to this.
[0211] The above description is only an exemplary 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 shall be included in the protection scope of the present application.
Claims
1. A method for controlling a virtual object, characterized in that: The method comprises: Displaying a user interface, wherein the user interface displays a virtual environment screen, wherein the virtual environment screen is a screen in which the virtual environment is observed from the perspective of the first virtual object; In response to the first virtual object moving into the attack range of at least two second virtual objects, a leader object is determined from the at least two second virtual objects, and non-leader objects in the at least two second virtual objects gather toward the leader object; the non-leader object is a second virtual object in the at least two second virtual objects excluding the leader object, and the at least two second virtual objects all take the first virtual object as an attack target; In the virtual environment screen, the leader object is shown leading the non-leader objects to move in a group toward the first virtual object; Among them, the target non-leader object whose distance to the first virtual object meets the preset condition among the at least two second virtual objects is not led and controlled by the leader object and can perform operations on the first virtual object on its own.
2. The method according to claim 1, characterized in that The step of determining a leader object from the at least two second virtual objects comprises: Acquire leader priorities respectively corresponding to the at least two second virtual objects, where the leader priorities are used to indicate the priorities of the second virtual objects determined as the leader objects; Acquire the distances between the at least two second virtual objects and the first virtual object respectively; The leader object is determined from the at least two second virtual objects based on the leader priorities respectively corresponding to the at least two second virtual objects and the distances respectively between the at least two second virtual objects and the first virtual object.
3. The method according to claim 2, characterized in that The determining the leader object from the at least two second virtual objects based on the leader priorities respectively corresponding to the at least two second virtual objects and the distances respectively between the at least two second virtual objects and the first virtual object comprises: Sorting the at least two second virtual objects in ascending order of the leader priority to obtain a first sequence; Sorting the at least two second virtual objects in descending order of the distances to obtain a second sequence; Determining, based on the positions of the second virtual objects in the first sequence and the second sequence, leader scores corresponding to the at least two second virtual objects, respectively, the leader scores being used to indicate the possibility that the second virtual object is set as the leader object; The second virtual object whose leader score is greater than or equal to the score threshold is determined as the leader object.
4. The method according to claim 1, characterized in that: The second virtual object includes a first-category second virtual object and a second-category second virtual object; wherein the leader priority of the first-category second virtual object is higher than the leader priority of the second-category second virtual object, and the leader priority is used to indicate the priority of the second virtual object being determined as the leader object; The step of determining a leader object from the at least two second virtual objects comprises: In a case where the at least two second virtual objects include the first-type second virtual object, determining the first-type second virtual object that has the smallest distance to the first virtual object among the at least two second virtual objects as the leader object; In a case where the at least two second virtual objects do not include the first-type second virtual object, the second-type second virtual object that is at the smallest distance from the first virtual object among the at least two second virtual objects is determined as the leader object.
5. The method according to claim 1, characterized in that After determining the leader object from the at least two second virtual objects, the method further includes: In the case where the leader object is killed, determining a new leader object from the remaining second virtual objects corresponding to the at least two second virtual objects; or, When the leader object is out of the battle, a new leader object is determined from the remaining second virtual objects corresponding to the at least two second virtual objects.
6. The method according to claim 1, characterized in that After determining the leader object from the at least two second virtual objects, the method further includes: Determine the at least two second virtual objects as group members of the object group corresponding to the first virtual object; In response to the first virtual object moving into the attack range of a new second virtual object, adding the new second virtual object to the object group to obtain an updated object group; A new leader object is determined from the updated group of objects.
7. The method according to claim 1, characterized in that The step of determining a leader object from the at least two second virtual objects comprises: Dividing the at least two second virtual objects to obtain a plurality of object groups; Determine the leader object corresponding to each object group; For a target object group in each of the object groups, non-leader objects in the target object group gather toward a leader object corresponding to the target object group.
8. The method according to claim 7, characterized in that The dividing the at least two second virtual objects to obtain a plurality of object groups includes: Dividing the at least two second virtual objects based on the distance between each of the at least two second virtual objects to obtain the plurality of object groups; Among them, for the first object group and the second object group among the multiple object groups, the distance between the group members of the first object group and the group members of the second object group is greater than a first distance threshold, and the distance between each group member of the first object group or the second object group is less than or equal to the first distance threshold.
9. The method according to claim 7, characterized in that: After dividing the at least two second virtual objects to obtain a plurality of object groups, the method further includes: For a target object group among the multiple object groups, when the number of group members of the target object group is less than or equal to a first threshold value, adding the group members of the target object group to an object group adjacent to the target object group; A leader object of an object group adjacent to the target object group is re-determined.
10. The method according to claim 7, characterized in that After dividing the at least two second virtual objects to obtain a plurality of object groups, the method further includes: In a case where the number of the subject groups is greater than a second threshold value, selecting a target number of subject groups from the multiple subject groups, the target number being a difference between the number of the subject groups and the second threshold value; Dispersing the target number of group members of the target group to other target groups among the multiple target groups; The leader object of the other object groups is re-determined.
11. The method according to claim 7, characterized in that After dividing the at least two second virtual objects to obtain a plurality of object groups, the method further includes: For a target object group among the multiple object groups, when the number of group members in the target object group is greater than a third threshold value, splitting the target object group to obtain at least two new object groups; or, For a target object group among the multiple object groups, when the dispersion degree of group members of the target object group is greater than a fourth threshold value, the target object group is split to obtain at least two new object groups.
12. The method according to claim 1, characterized in that The method further comprises: Determine the at least two second virtual objects as group members of the first object group corresponding to the first virtual object; In the case that a group member of the first object group loses the first virtual object, if there are other second virtual objects within the attack range of the group member of the first object group, the group member of the first object group is added to the object group corresponding to the other second virtual objects.
13. The method according to claim 1, characterized in that After the leader object is shown in the virtual environment screen leading the non-leader objects to move in a group toward the first virtual object, the method further includes: In response to the attack instruction sent by the leader object, sending a joint attack signal to each non-leader object after an interval; In the case where each non-leader object receives the joint attack signal, marking and displaying each non-leader object, and displaying a screen in which the at least two second virtual objects jointly attack the first virtual object; Wherein, in the process of the leader object sending out the attack instruction, the leader object stops moving, and when the non-leader objects receive the joint attack signal, the non-leader objects gather toward the leader object.
14. The method according to claim 13, characterized in that In the case where the number corresponding to the at least two second virtual objects is greater than or equal to a fifth threshold value, the leader object issues the attack instruction; or, In the case where the difference between the maximum distance between the at least two second virtual objects and the first virtual object and the minimum distance between the at least two second virtual objects and the first virtual object is less than or equal to a second distance threshold, the leader object issues the attack instruction; or, When the distance between the leader object and the first virtual object is less than or equal to a third distance threshold, the leader object issues the attack instruction; or, In the case where the first virtual object triggers the scene setting, the leader object issues the attack instruction.
15. The method according to any one of claims 1 to 14, characterized in that When the difference between the maximum distance between the at least two second virtual objects and the first virtual object and the minimum distance between the at least two second virtual objects and the first virtual object is greater than a fourth distance threshold, the leader object stops moving, and non-leader objects among the at least two second virtual objects continue to gather toward the leader object; When the difference between the maximum distance between the at least two second virtual objects and the first virtual object and the minimum distance between the at least two second virtual objects and the first virtual object is less than or equal to a fifth distance threshold, the leader object continues to lead the non-leader objects to move in a group toward the first virtual object.
16. The method according to any one of claims 1 to 14, characterized in that The method further comprises: Acquire an aggregation point in the virtual environment; wherein the aggregation priority of the aggregation point is higher than the aggregation priority of the leader object; In the case where the aggregation point exists, displaying the at least two second virtual objects converging toward the aggregation point; In the absence of the aggregation point, non-leader objects among the at least two second virtual objects are displayed to converge toward the leader object.
17. A control device for a virtual object, characterized in that: The device comprises: An interface display module, used to display a user interface, wherein the user interface displays a virtual environment screen, wherein the virtual environment screen is a screen in which the virtual environment is observed from the perspective of the first virtual object; a leader determination module, configured to determine a leader object from the at least two second virtual objects in response to the first virtual object moving into the attack range of at least two second virtual objects, wherein non-leader objects in the at least two second virtual objects gather toward the leader object; the non-leader object is a second virtual object in the at least two second virtual objects excluding the leader object, and the at least two second virtual objects all take the first virtual object as an attack target; A screen display module, used for displaying, in the virtual environment screen, that the leader object leads the non-leader objects to move in a group toward the first virtual object; Among them, the target non-leader object whose distance to the first virtual object meets the preset condition among the at least two second virtual objects is not led and controlled by the leader object and can perform operations on the first virtual object on its own.
18. The device according to claim 17, characterized in that The leader determination module includes a priority acquisition submodule, a distance acquisition submodule and a leader determination submodule; The priority acquisition submodule is used to acquire the leader priorities respectively corresponding to the at least two second virtual objects, wherein the leader priority is used to indicate the priority of the second virtual object being determined as the leader object; The distance acquisition submodule is used to acquire the distances between the at least two second virtual objects and the first virtual object respectively; The leader determination submodule is used to determine the leader object from the at least two second virtual objects based on the leader priorities respectively corresponding to the at least two second virtual objects and the distances between the at least two second virtual objects and the first virtual object.
19. The device according to claim 18, characterized in that The leader determination submodule is used to: Sorting the at least two second virtual objects in ascending order of the leader priority to obtain a first sequence; Sorting the at least two second virtual objects in descending order of the distances to obtain a second sequence; Determining, based on the positions of the second virtual objects in the first sequence and the second sequence, respectively, leader scores corresponding to the at least two second virtual objects, the leader scores being used to indicate the possibility that the second virtual object is set as the leader object; The second virtual object whose leader score is greater than or equal to the score threshold is determined as the leader object.
20. The device according to claim 17, characterized in that The second virtual object includes a first-category second virtual object and a second-category second virtual object; wherein the leader priority of the first-category second virtual object is higher than the leader priority of the second-category second virtual object, and the leader priority is used to indicate the priority of the second virtual object being determined as the leader object; The leader determination module is further used for: In a case where the at least two second virtual objects include the first-type second virtual object, determining the first-type second virtual object that has the smallest distance to the first virtual object among the at least two second virtual objects as the leader object; In a case where the at least two second virtual objects do not include the first-type second virtual object, the second-type second virtual object that is at the shortest distance from the first virtual object among the at least two second virtual objects is determined as the leader object.
21. The device according to claim 17, characterized in that The leader determination module is further used for: In the case where the leader object is killed, determining a new leader object from the remaining second virtual objects corresponding to the at least two second virtual objects; or, When the leader object is out of the battle, a new leader object is determined from the remaining second virtual objects corresponding to the at least two second virtual objects.
22. The device according to claim 17, characterized in that The leader determination module includes a group determination submodule and a leader determination submodule; The group determination submodule is used to determine the at least two second virtual objects as group members of the object group corresponding to the first virtual object; The group determination submodule is further configured to, in response to the first virtual object moving into the attack range of the new second virtual object, add the new second virtual object to the object group to obtain an updated object group; The leader determination submodule is used to determine a new leader object from the updated object group.
23. The device according to claim 17, characterized in that The leader determination module includes a group determination submodule and a leader determination submodule; The group determination submodule is used to divide the at least two second virtual objects to obtain a plurality of object groups; The leader determination submodule is used to determine the leader objects corresponding to each object group; For a target object group in each of the object groups, non-leader objects in the target object group gather toward a leader object corresponding to the target object group.
24. The device according to claim 23, characterized in that The group determination submodule is further used for: Dividing the at least two second virtual objects based on the distance between each of the at least two second virtual objects to obtain the plurality of object groups; Among them, for the first object group and the second object group among the multiple object groups, the distance between the group members of the first object group and the group members of the second object group is greater than a first distance threshold, and the distance between each group member of the first object group or the second object group is less than or equal to the first distance threshold.
25. The device according to claim 23, characterized in that The group determination submodule is further configured to, for a target object group among the multiple object groups, add the group members of the target object group to an object group adjacent to the target object group when the number of group members of the target object group is less than or equal to a first threshold value; The leader determination submodule is further used to re-determine the leader object of the object group adjacent to the target object group.
26. The device according to claim 23, characterized in that The group determination submodule is further configured to select a target number of subject groups from the plurality of subject groups when the number of the subject groups is greater than a second threshold value, wherein the target number is a difference between the number of the subject groups and the second threshold value; The group determination submodule is further used to disperse the group members of the target number of object groups to other object groups among the multiple object groups; The leader determination submodule is further used to re-determine the leader object of the other object groups.
27. The device according to claim 23, characterized in that The group determination submodule is further used for: For a target object group among the multiple object groups, when the number of group members in the target object group is greater than a third threshold value, splitting the target object group to obtain at least two new object groups; or, For a target object group among the multiple object groups, when the dispersion degree of group members of the target object group is greater than a fourth threshold value, the target object group is split to obtain at least two new object groups.
28. The device according to claim 17, characterized in that The leader determination module includes a group determination submodule; the group determination submodule is used to: Determine the at least two second virtual objects as group members of the first object group corresponding to the first virtual object; In the case that a group member of the first object group loses the first virtual object, if there are other second virtual objects within the attack range of the group member of the first object group, the group member of the first object group is added to the object group corresponding to the other second virtual objects.
29. The device according to claim 17, characterized in that The screen display module is used for: In response to the attack instruction sent by the leader object, sending a joint attack signal to each non-leader object after an interval; In the case where each non-leader object receives the joint attack signal, marking and displaying each non-leader object, and displaying a screen in which the at least two second virtual objects jointly attack the first virtual object; Wherein, in the process of the leader object sending out the attack instruction, the leader object stops moving, and when the non-leader objects receive the joint attack signal, the non-leader objects gather toward the leader object.
30. The device according to claim 29, characterized in that In the case where the number corresponding to the at least two second virtual objects is greater than or equal to a fifth threshold value, the leader object issues the attack instruction; or, In the case where the difference between the maximum distance between the at least two second virtual objects and the first virtual object and the minimum distance between the at least two second virtual objects and the first virtual object is less than or equal to a second distance threshold, the leader object issues the attack instruction; or, When the distance between the leader object and the first virtual object is less than or equal to a third distance threshold, the leader object issues the attack instruction; or, In the case where the first virtual object triggers the scene setting, the leader object issues the attack instruction.
31. The device according to any one of claims 17 to 30, characterized in that When the difference between the maximum distance between the at least two second virtual objects and the first virtual object and the minimum distance between the at least two second virtual objects and the first virtual object is greater than a fourth distance threshold, the leader object stops moving, and non-leader objects among the at least two second virtual objects continue to gather toward the leader object; When the difference between the maximum distance between the at least two second virtual objects and the first virtual object and the minimum distance between the at least two second virtual objects and the first virtual object is less than or equal to a fifth distance threshold, the leader object continues to lead the non-leader objects to move in a group toward the first virtual object.
32. The device according to any one of claims 17 to 30, characterized in that The device also includes an aggregation point acquisition module; The aggregation point acquisition module is used to acquire the aggregation point in the virtual environment; wherein the aggregation priority of the aggregation point is higher than the aggregation priority of the leader object; The screen display module is further used to display the at least two second virtual objects gathering toward the aggregation point when the aggregation point exists; The screen display module is further used to display the non-leader objects among the at least two second virtual objects gathering toward the leader object when the aggregation point does not exist.
33. A terminal, characterized in that: The terminal includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the control method of the virtual object as described in any one of claims 1 to 16.
34. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the control method of the virtual object as described in any one of claims 1 to 16.
35. A computer program product, characterized in that The computer program product includes computer instructions, which are stored in a computer-readable storage medium. A processor reads and executes the computer instructions from the computer-readable storage medium to implement the virtual object control method according to any one of claims 1 to 16.
