Method and apparatus for controlling non-player character, and device, storage medium and product

By adjusting the attack target in real time based on the damage value of the virtual character, the non-player character's reaction is adjusted, which solves the problem of the non-player character's rigid reaction in the existing technology, and realizes more vivid interaction and extended existence time.

WO2026138180A1PCT designated stage Publication Date: 2026-07-02TENCENT TECHNOLOGY (SHENZHEN) CO LTD

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
TENCENT TECHNOLOGY (SHENZHEN) CO LTD
Filing Date
2025-11-04
Publication Date
2026-07-02

AI Technical Summary

Technical Problem

In existing technologies, non-player characters will continue to attack a target after identifying it until the target's combat power is eliminated, resulting in a rigid and inflexible response when interacting with multiple virtual characters.

Method used

Non-player characters change their attack targets in real time based on the dynamic damage values ​​dealt to them by virtual characters. The server calculates information such as the virtual character's health changes, number of hits, and attributes within a preset period and dynamically adjusts the attack targets accordingly.

Benefits of technology

It improves the interaction flexibility of non-player characters, increases the fun and unpredictability of player-non-player character interactions, and extends the existence time of non-player characters.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025132376_02072026_PF_FP_ABST
    Figure CN2025132376_02072026_PF_FP_ABST
Patent Text Reader

Abstract

The present application belongs to the field of human-computer interaction. Disclosed are a method and apparatus for controlling a non-player character, and a device, a storage medium and a product. The method comprises: displaying a non-player character in a virtual world; displaying the non-player character attacking a first virtual character, wherein the first virtual character is one of at least two virtual characters located within an attack range of the non-player character; and on the basis of damage values dealt to the non-player character by the virtual characters, determining an attack target of the non-player character, wherein the attack target is at least one of the at least two virtual characters. On the basis of damage values dealt to a non-player character by at least one virtual character, an attack target of the non-player character is changed in real time, thereby improving the flexibility of the non-player character, and enabling the non-player character to exhibit more vivid and dynamic reactions when battling against multiple players.
Need to check novelty before this filing date? Find Prior Art

Description

Methods, devices, equipment, storage media, and products for controlling non-player characters.

[0001] This application claims priority to Chinese Patent Application No. 2024119818453, filed on December 26, 2024, entitled “Control method, apparatus, device, storage medium and product for non-player characters”, the entire contents of which are incorporated herein by reference. Technical Field

[0002] This application relates to the field of human-computer interaction, and in particular to a control method, device, equipment, storage medium, and product for a non-player character. Background Technology

[0003] In the game, players can control virtual characters to explore, fight, or engage in other activities in a virtual world. In one scenario, players can control their virtual characters to fight against non-player characters in the virtual world. For example, if the non-player character is a virtual monster, when multiple virtual characters fight the same virtual monster, the monster will prioritize targeting the virtual character with the highest combat power, thus interacting with the player controlling that target.

[0004] However, in related technologies, non-player characters will attack a target after identifying it, and then switch to a new target only after the target's combat power is completely eliminated. The above-mentioned attack mechanism of non-player characters is relatively rigid. How to improve the flexibility of non-player characters is a problem that needs to be solved. Summary of the Invention

[0005] This application provides a method, apparatus, device, storage medium, and product for controlling non-player characters, which can improve the flexibility of non-player characters. The technical solution is as follows.

[0006] According to one aspect of this application, a method for controlling a non-player character is provided, the method being executed by a first client, the method comprising:

[0007] Display non-player characters in the virtual world;

[0008] This indicates that a non-player character is attacking a first virtual character, which is one of at least two virtual characters within the non-player character's attack range;

[0009] Based on the damage value of the virtual character to the non-player character, determine the attack target of the non-player character. The attack target is at least one of the at least two virtual characters.

[0010] According to one aspect of this application, a method for controlling a non-player character is provided, the method being executed by a server, the method comprising:

[0011] Identify the first virtual character, which is one of at least two virtual characters in the virtual world that are within the attack range of a non-player character;

[0012] Control a non-player character to attack the first virtual character;

[0013] The attack target of the non-player character is determined based on the damage value of the virtual character to the non-player character. The attack target is at least one of the at least two virtual characters.

[0014] According to one aspect of this application, a control device for a non-player character is provided, the device comprising:

[0015] The display module is used to display non-player characters in the virtual world;

[0016] The display module is also used to display a non-player character attacking a first virtual character, where the first virtual character is one of at least two virtual characters located within the non-player character's attack range;

[0017] The modification module is used to determine the target of a non-player character's attack based on the damage value of the virtual character to the non-player character. The target of the attack is at least one of at least two virtual characters.

[0018] According to one aspect of this application, a control device for a non-player character is provided, the device comprising:

[0019] The determination module is used to determine the first virtual character, which is one of at least two virtual characters in the virtual world that are within the attack range of a non-player character;

[0020] The control module is used to control non-player characters to attack the first virtual character;

[0021] The control module is also used to determine the attack target of the non-player character based on the damage value of the first virtual character to the non-player character, wherein the attack target is at least one of the at least two virtual characters.

[0022] According to another aspect of this application, a client is provided for implementing the control method for non-player characters as described above.

[0023] According to another aspect of this application, a server is provided for implementing the control method for non-player characters as described above.

[0024] According to another aspect of this application, a computer storage medium is provided, wherein at least one computer program is stored in the computer-readable storage medium, and the at least one computer program is loaded and executed by a processor to implement the non-player character control method as described above.

[0025] According to another aspect of this application, a computer program product is provided, comprising a computer program stored in a computer-readable storage medium; the computer program is read from and executed by a processor of a computer device from the computer-readable storage medium, causing the computer device to perform the non-player character control method as described above.

[0026] The beneficial effects of the technical solutions provided in this application include at least the following:

[0027] When a non-player character interacts with virtual characters controlled by multiple players, the non-player character can change its current attack target in real time based on the dynamically changing damage values ​​inflicted by multiple players, rather than attacking a fixed target. This makes the non-player character's reactions more vivid and varied when fighting against multiple people, improves the non-player character's flexibility, and can also extend the non-player character's existence time in the virtual world to a certain extent.

[0028] Meanwhile, for players, the way non-player characters change their attack targets in real time makes it somewhat unpredictable for players to judge the attack methods and damage of non-player characters. This increases the interaction time between players and non-player characters and the randomness of the difficulty of defeating them, making human-computer interaction more interesting. Attached Figure Description

[0029] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0030] Figure 1 is a schematic diagram of the architecture of a computer system provided in an embodiment of this application;

[0031] Figure 2 is a schematic diagram of a scenario illustrating a control method for a non-player character provided in an embodiment of this application;

[0032] Figure 3 is a schematic diagram of a non-player character control method provided in an embodiment of this application;

[0033] Figure 4 is a schematic diagram of a non-player character control method provided in an embodiment of this application;

[0034] Figure 5 is a flowchart of a non-player character control method provided in an embodiment of this application;

[0035] Figure 6 is a flowchart of a non-player character control method provided in an embodiment of this application;

[0036] Figure 7 is a flowchart of a non-player character control method provided in an embodiment of this application;

[0037] Figure 8 is a flowchart of a non-player character control method provided in an embodiment of this application;

[0038] Figure 9 is a flowchart of a non-player character control method provided in an embodiment of this application;

[0039] Figure 10 is a flowchart of a non-player character control method provided in an embodiment of this application;

[0040] Figure 11 is a schematic diagram of a non-player character control method provided in an embodiment of this application;

[0041] Figure 12 is a flowchart of a non-player character control method provided in an embodiment of this application;

[0042] Figure 13 is a flowchart of a non-player character control method provided in an embodiment of this application;

[0043] Figure 14 is a structural block diagram of a control device for a non-player character provided in an embodiment of this application;

[0044] Figure 15 is a structural block diagram of a control device for a non-player character provided in an embodiment of this application;

[0045] Figure 16 is a schematic diagram of the structure of a computer device provided in one embodiment of this application. Detailed Implementation

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

[0047] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0048] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any and all possible combinations of one or more of the associated listed items.

[0049] It should be understood that although the terms first, second, etc., may be used in this application to describe various information, this information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, a first parameter may also be referred to as a second parameter, and similarly, a second parameter may also be referred to as a first parameter. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."

[0050] It should be noted that this application may display prompt interfaces, pop-ups, or output voice prompts before and during the collection of user data. These prompt interfaces, pop-ups, or voice prompts are used to inform the user that their data is being collected. This ensures that the application only begins the steps for collecting user data after receiving confirmation from the user regarding the prompt interface or pop-up; otherwise (i.e., without user confirmation), the steps for collecting user data end, meaning no user data is collected. In other words, all user data collected in this application is collected with the user's consent and authorization, and the collection, use, and processing of related user data must comply with the relevant laws, regulations, and standards of the relevant countries and regions.

[0051] First, let me introduce the relevant terms used in this application:

[0052] Virtual world: A virtual environment displayed (or provided) by an application when it runs on a terminal. The virtual world is implemented based on a virtual environment. This virtual world can be a simulation of the real world, a semi-simulated / semi-fictional three-dimensional world, or a purely fictional three-dimensional world. The virtual environment can be any of a two-dimensional, 2.5-dimensional, or three-dimensional virtual environment; this application does not limit it. The following embodiments illustrate this using a three-dimensional virtual environment.

[0053] For example, a virtual environment includes the sky, land, and ocean. The land includes environmental elements such as plants and houses, and users can control their virtual characters to move within this environment. This virtual environment also includes virtual objects, which can be interactive, such as virtual beds, chairs, lamps, and bathtubs, allowing users to control their virtual characters to lie on the virtual bed or sit in the virtual chair. These virtual objects can also be non-interactive, such as virtual trees, virtual rocks, and virtual house structures (which may include roofs, floors, pillars, doors, and windows). This virtual environment can also simulate real-world conditions under different weather conditions, such as sunny days, rainy days, foggy days, or nighttime. The diverse scene elements enhance the diversity and realism of the virtual environment.

[0054] Virtual character: A movable object in a virtual environment. This movable object can be at least one of a virtual person, a virtual animal, or an anime character. Optionally, when the virtual environment is a three-dimensional virtual environment, the virtual character can be a three-dimensional virtual model. Each virtual character has its own shape and volume in the three-dimensional virtual environment and occupies a portion of the space within the three-dimensional virtual environment. Optionally, the virtual character is a three-dimensional object constructed based on three-dimensional human skeleton technology, and the virtual character achieves different external appearances by wearing different skins. In some implementations, the virtual character can also be implemented using a 2.5D or 2D model; this application does not limit this aspect.

[0055] NPC (Non-Player Character): A character created specifically for the purpose of gameplay, typically playing a role in driving the plot forward. NPC characters are not controlled by players; examples include characters who give quests or trigger story events. In some embodiments, non-player characters can be virtual monsters. The movement path, attack methods, and attack power of these virtual monsters are pre-set by the server, and one or more players can control their respective virtual characters to fight against these monsters.

[0056] Figure 1 shows a schematic diagram of a computer system provided in an exemplary embodiment of this application. The computer system 100 may include: a first terminal device 110, a server 120, and a second terminal device 130.

[0057] The first terminal device 110 has a client 111 installed and running that supports a virtual environment. This client 111 can be a multiplayer online battle arena program. When the first terminal device 110 runs the client 111, the game interface of the client 111 is displayed on the screen of the first terminal device 110. The client 111 can be any of the following: a massively multiplayer online role-playing game (MMORPG), a battle royale shooting game, a virtual reality (VR) application, an augmented reality (AR) application, a 3D mapping application, a virtual reality game, an augmented reality game, a first-person shooter (FPS) game, a third-person shooter (TPS) game, a multiplayer online battle arena (MOBA) game, or a simulation game (SLG). The first terminal device 110 is the terminal used by the first user 112. The first user 112 uses the client 111 in the first terminal device 110 to control a first virtual character located in the virtual world to perform activities and operate the virtual items owned by the first virtual character. The first virtual character can be referred to as the virtual character of the first user 112, the virtual character controlled by the first user 112, etc. The first user 112 can perform operations such as assembling, disassembling, and unloading the virtual items owned by the first virtual character, which are not limited in this application. The activities of the first virtual character include, but are not limited to, at least one of the following: moving, jumping, teleporting, releasing skills, using props, adjusting body posture, crawling, walking, running, riding, flying, jumping, driving, picking up, shooting, attacking, and throwing.

[0058] The second terminal device 130 has a client 131 installed and running that supports a virtual environment. This client 131 can be a multiplayer online battle arena program. When the second terminal device 130 runs the client 131, the game interface of the client 131 is displayed on the screen of the second terminal device 130. The client 131 can be any of the following: MMORPG, MOBA, battle royale shooting game, VR application, AR program, 3D map program, virtual reality game, augmented reality game, FPS, TPS, SLG. The second terminal device 130 is the terminal used by the second user 132. The second user 132 uses the client 131 in the second terminal device 130 to control a second virtual character located in the virtual world to perform activities and operate the virtual items owned by the second virtual character. The second virtual character can be referred to as the virtual character of the second user 132, the virtual character controlled by the second user 132, etc. The activities of the second virtual character include, but are not limited to: moving, jumping, teleporting, releasing skills, using items, adjusting body posture, crawling, walking, running, riding, flying, jumping, driving, picking up, shooting, attacking, and throwing at least one of the following.

[0059] Optionally, users can choose to enter different virtual environments; or, users can choose to randomly enter different virtual environments; or, users will enter different virtual environments in a random order preset by the developer. The virtual environments are pre-designed by the developer; or, the virtual environments are created by users using a user-generated content (UGC) editor provided by the client.

[0060] Optionally, the first virtual character and the second virtual character are in the same virtual environment. Optionally, the first virtual character and the second virtual character can belong to the same faction, the same team, the same organization, have a friend relationship, or have temporary communication permissions.

[0061] Optionally, the clients installed on the first terminal device 110 and the second terminal device 130 are the same, or the clients installed on the two terminal devices are the same type of client on different operating system platforms (Android or iOS). The first terminal device 110 can refer to one of a plurality of terminals, and the second terminal device 130 can refer to another of a plurality of terminals. This embodiment only uses the first terminal device 110 and the second terminal device 130 as examples. The device types of the first terminal device 110 and the second terminal device 130 may be the same or different, and these device types include at least one of: smartphones, tablets, e-book readers, MP3 players, MP4 players, laptops, and desktop computers.

[0062] Figure 1 shows only two terminals, but in different embodiments, multiple other terminals 01 can access the server 120. Optionally, one or more terminals 01 are terminals corresponding to developers, on which a development and editing platform supporting a virtual environment client is installed. Developers can edit and update the client on terminal 01 and transmit the installation package in the updated client to the server 120 via wired or wireless network. The first terminal device 110 or the second terminal device 130 can download the client installation package from the server 120 to update the client.

[0063] Server 120 includes at least one of a single server, multiple servers, a cloud computing platform, and a virtualization center. Server 120 is used to provide backend services to client 111. Optionally, server 120 undertakes the primary computing work, and the first terminal device 110 undertakes the secondary computing work; or, server 120 undertakes the secondary computing work, and the first terminal device 110 undertakes the primary computing work; or, server 120 and the first terminal device 110 collaborate on computing using a distributed computing architecture.

[0064] Optionally, server 120 includes processor 121, user account database 122, battle service module 123, and user-facing input / output interface (I / O interface) 124. Processor 121 loads instructions stored in server 120 and processes data in user account database 122 and battle service module 123. User account database 122 stores data of user accounts logged in on clients of first terminal device 110, second terminal device 130, and other terminals 01, such as user account avatars, names, combat power indices, and service areas. Battle service module 123 provides multiple battle rooms for users to engage in battles, such as 1v1, 3v3, and 5v5 battles. User-facing I / O interface 124 establishes communication and exchanges data with first terminal device 110, second terminal device 130, and / or other terminals 01 via wireless or wired networks.

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

[0066] In some embodiments, the first terminal device 110 and the second terminal device 130 send user operation data during a game to the server 120. The server 120 receives the operation data, processes it to obtain a processing result, and sends the processing result to the first terminal device 110 and the second terminal device 130 respectively.

[0067] In this technology, players can control virtual characters to hunt in a virtual world. Players can hunt alone or in groups, exploring the virtual world and seeking out suitable non-player characters to attack and collect their corresponding virtual equipment. These non-player characters can be virtual monsters, such as virtual animals or plants. Within the same virtual species, there can be multiple virtual monsters with different attributes; for example, non-player characters can be implemented as multiple virtual dragons with different attributes.

[0068] Figure 2 is a schematic diagram of a scenario illustrating a control method for a non-player character provided in an embodiment of this application.

[0069] During a hunt, multiple players may control virtual characters to attack a single virtual monster. For example, referring to Figure 2, the virtual world display screen 200 contains a virtual monster 201 and multiple virtual characters (virtual characters 202, 203, and 204, controlled by player 1, player 2, and player 3 respectively). Optionally, the display screen 200 may also display a group information bar 205 showing the association information of the multiple virtual characters, such as their respective identity documents (IDs), avatars, and health bars. The association information of the virtual characters may also be displayed around them. Furthermore, players can control the virtual characters using one or more operation controls 206 on the display screen 200.

[0070] According to the relevant design in the related technology, the virtual monster 201 will select one of multiple virtual characters to attack. Referring to Figure 2, virtual characters 202 and 203 are both within the attack range of the virtual monster 201 (shown as black ellipses in the figure), while virtual character 204 is outside the attack range of the virtual monster 201. Therefore, the virtual monster 201 can identify one of virtual characters 202 and 203 as its attack target.

[0071] Subsequently, virtual monster 201 attacks its target until the target is completely incapacitated. Then, virtual monster 201 selects one of the remaining virtual characters to attack. For players other than the attacked player, virtual monster 201 is essentially in a static state for a period of time, significantly reducing the enjoyment of combat positioning (the actions taken by both sides before successfully attacking or defending against an opponent's attack, aimed at gaining an advantageous position or putting the opponent at a disadvantage) during that period.

[0072] It is evident that in related technologies, when non-player characters engage in combat with multiple virtual characters, they continuously attack the target after identifying it until the target's combat power is completely eliminated before switching to a new target. This makes the non-player character's reaction relatively rigid when fighting multiple virtual characters. Improving the flexibility of non-player characters is a problem that needs to be solved.

[0073] Based on this, and to address the problems existing in related technologies, embodiments of this application provide a method for controlling non-player characters. Figures 3 and 4 respectively illustrate schematic diagrams of a non-player character control method provided in an exemplary embodiment of this application. Due to the influence of the number of non-player characters, two optional implementation methods for the non-player character control method are given:

[0074] Implementation method 1: A non-player character interacts with at least two virtual characters.

[0075] Referring to Figure 3, taking a non-player character as an example, a virtual monster 10 is shown to be active in a virtual world. A first virtual character 20 and a second virtual character 30 are also shown in the virtual world. The first virtual character 20 is controlled by the first player through a first account logged in on the first client, and the second virtual character 30 is controlled by the second player through a second account logged in on the second client. The server provides background services for at least the first client and the second client of the application that supports the virtual environment.

[0076] In some embodiments, in response to a first player's control operation on a first virtual character 20, such as the first player controlling the first virtual character 20 to move towards the virtual monster 10, the first virtual character 20 enters the attack range of the virtual monster 10 (shown as a black ellipse in the figure). Alternatively, in other embodiments, the server pre-sets the movement route of the virtual monster 10, causing the virtual monster 10 to approach the first virtual character 20, resulting in the first virtual character 20 entering the attack range of the virtual monster 10. The second virtual character 30 is similarly able to enter the attack range of the virtual monster 10.

[0077] At this time, the server can control the virtual monster 10 to choose one of the first virtual character 20 and the second virtual character 30 to attack. The following example is virtual monster 10 attacking the first virtual character 20.

[0078] Subsequently, as the battle situation changes, the damage value of the first virtual character 20 to the virtual monster 10 changes. At the same time, multiple virtual characters will enter and exit around the virtual monster 10. There is a possibility that the first virtual character 20 and other virtual characters (the second virtual character 30 and the third virtual character 40) will attack the virtual monster 10 at the same time.

[0079] At this point, the server can determine whether to change the target of the virtual monster 10 based on the damage value of the first virtual character 20 to the virtual monster 10, thereby enabling interaction with multiple players.

[0080] The damage values ​​of different virtual characters to virtual monster 10 can be determined based on at least one of the following information:

[0081] • The change in a virtual character's health over a preset period;

[0082] • The number of times a virtual character is attacked by a non-player character within a preset period;

[0083] • The duration for which a virtual character remains outside the attack range of a non-player character within a preset period;

[0084] • Attributes of virtual characters.

[0085] The preset period can be set according to actual needs, such as 1 second, 5 seconds, 10 seconds, etc., which can be understood as iteratively calculating the damage value of the virtual character to the virtual monster 10 within the preset period. This application does not limit the specific value of the preset period; the change in health is used to indicate the increase or decrease of the virtual character's virtual health value within the preset period; the number of hits is used to indicate the number of times the virtual character is attacked by the virtual monster 10 within the preset period; the attributes of the virtual character are preset, and different attributes are set with different attribute values ​​and / or attribute calculation coefficients.

[0086] It is important to note that many of the above-mentioned pieces of information can be obtained from the interface changes shown in Figure 3. For example, changes in health can be determined based on the changes in the health bar in Figure 3; the number of hits can be calculated based on the attacks of the virtual monster 10 by the virtual character in Figure 3 within a preset period; the dwell time can be calculated based on the attack radius of the virtual monster 10 in Figure 3 and the time taken to analyze the interface changes; and the attributes of the virtual character can be determined based on the virtual character shown in Figure 3. In other words, the damage values ​​of different virtual characters to the virtual monster 10 can all be determined by directly or indirectly analyzing the interface changes in Figure 3.

[0087] This example illustrates how multiple damage values ​​can be sorted by magnitude to select the initial attack target of virtual monster 10 and / or determine whether to change the attack target of virtual monster 10. Two possible methods include:

[0088] • Change Method 1: Select and change based on the magnitude of the damage value.

[0089] Referring to Figure 3, there are a first virtual character 20 and a second virtual character 30 within the attack range of the virtual monster 10. After calculating the damage value of the two to the virtual monster 10 at the current moment, the virtual character corresponding to the maximum damage value is determined as the initial attack target of the virtual monster 10. In this embodiment, the virtual monster 10 determines the first virtual character 20 as the initial attack target as an example.

[0090] Subsequently, based on the real-time changes in the battle, the damage values ​​of multiple virtual characters to virtual monster 10 are calculated and sorted within a preset period. The virtual character with the highest damage value is then changed to the new target of virtual monster 10. Referring to Figure 3, the first virtual character 20 is attacked multiple times by virtual monster 10 in a short period of time, causing its health to drop sharply. At the same time, the third virtual character 40 enters the attack range of virtual monster 10, and the third virtual character 40 deals the highest damage to virtual monster 10. At this point, it can be determined that the threat of the first virtual character 20 to virtual monster 10 has decreased, while the threat of the third virtual character 40 to virtual monster 10 has increased (indicated by the distress message sent by player 1, who controls the first virtual character 20, highlighted in the dotted line in the figure). Therefore, the target of virtual monster 10 can be changed from the first virtual character 20 to the third virtual character 40. That is, the display interface shows that virtual monster 10 abandons attacking the first virtual character 20 and instead attacks the third virtual character 40.

[0091] In other embodiments, if the damage value of the first virtual character 20 to the virtual monster 10 is still the largest, then the virtual monster 10 continues to attack the first virtual character 20 until the damage value ranking changes within a certain preset period.

[0092] • Change method two: Select and change based on the difference between damage values.

[0093] In other embodiments, the attack target of the virtual monster 10 may be changed if the difference between the damage values ​​of multiple virtual characters to the virtual monster is less than a first threshold.

[0094] Referring to Figure 3, when virtual monster 10 attacks the third virtual character 40, the damage values ​​of the first virtual character 20, the second virtual character 30, the third virtual character 40, and the fourth virtual character 50, which enters the attack range in real time, to virtual monster 10 can be calculated in real time within a preset period. Then, the difference between the four damage values ​​is determined. If the difference between the four damage values ​​is less than a preset first threshold, it can be understood that the threat levels of the multiple virtual characters relative to virtual monster 10 are relatively similar. In this case, the attack target of virtual monster 10 can be changed from the third virtual character 40 to at least two of the aforementioned four virtual characters. That is, the display interface shows that virtual monster 10 abandons its attack on the third virtual character 40 and then launches a sweeping group attack, causing the second virtual character 30 to be knocked to the ground (player 2, whose health is depleted and is controlled by player 2, is highlighted in the dotted line in the figure).

[0095] In other embodiments, if the difference between the three damage values ​​exceeds a preset first threshold and the damage value of the first virtual character 20 to the virtual monster 10 is still the largest, then the virtual monster 10 is shown to continue attacking the first virtual character 20 until the difference between the damage values ​​changes.

[0096] Optionally, the two methods described above can be combined. Referring to Figure 3, after the virtual monster 10 launches a group attack, the damage values ​​of the first virtual character 20, the third virtual character 40, and the fourth virtual character 50 to the virtual monster 10 are updated in real time within this preset period. After sorting the damage values, it is found that the damage value corresponding to the first virtual character 20 is the largest. Therefore, the attack target of the virtual monster 10 is changed from multiple virtual characters to the first virtual character 20.

[0097] It should be understood that Figure 3 shows multiple virtual character health bars used to indicate the real-time changes in the virtual character's health. Although the health bar of the first virtual character 20 in the display interface is slightly shorter than that of the fourth virtual character 50, the first virtual character 20 is still identified as the new target of the virtual monster 10 based on the changes in the number of hits within a preset period and / or the percentage of time the virtual character spends outside the attack range. In other embodiments, the target of the virtual monster 10 can also be changed based solely on the length of the health bar; in this case, the determination of the damage value will be solely linked to the change in health. Therefore, this application does not limit the specific implementation method of damage value calculation; any display information observable on the display interface can be used as a calculation parameter for the damage value, and will not be elaborated further.

[0098] For example, the damage values ​​of multiple virtual characters to virtual monster 10 are updated in real time within a preset period, thereby facilitating the real-time determination of attack targets for virtual monster 10.

[0099] In addition to the two methods of changing the target of an attack mentioned above, at least the following methods also exist:

[0100] • Change method three: Based on the number of virtual characters within the attack range.

[0101] In some embodiments, when the number of virtual characters within the attack range of the virtual monster 10 exceeds a preset second threshold, the target of the virtual monster 10 is changed to at least two virtual characters. Simultaneously, if the number of virtual characters does not exceed the second threshold, the virtual monster 10 continuously attacks the target identified in the previous preset period. Both virtual characters with and without attack power can be included in the count of virtual characters; this application does not impose any limitation on this.

[0102] Referring to Figure 3, taking a second threshold of 5 as an example, when virtual monster 10 attacks the first virtual character 20, the number of virtual characters within the attack range of virtual monster 10 is calculated in real time. In the interface changes shown in Figure 3, the number of virtual characters appearing within the attack range of virtual monster 10 does not exceed 5, indicating that the target of virtual monster 10's attack has not changed according to this change method.

[0103] It should be understood that the above three modification methods can be used individually or in combination, sequentially or out of order, and any one of them is within the scope of protection of this application. Examples will not be given here.

[0104] The above describes a scenario where a non-player character battles against multiple virtual characters. In some embodiments, multiple non-player characters battle against multiple virtual characters. These multiple non-player characters can be implemented as a leader non-player character and at least one companion character, such as a virtual boar and multiple virtual baby boars following it; alternatively, they can be implemented as multiple independent non-player characters, such as a virtual Tyrannosaurus Rex and a virtual Pteranodon.

[0105] Method 2: Multiple non-player characters interact with at least two virtual characters.

[0106] Referring to Figure 4, taking the example of non-player characters being implemented as multiple virtual monsters, the following will describe in detail how to change the attack targets of non-player characters in this case:

[0107] In addition to the displayed virtual monster 10 (hereinafter referred to as the first virtual monster), multiple virtual characters (first virtual character 20, second virtual character 30 and third virtual character 40), the virtual world also displays an accompanying virtual monster 101 (considered as a companion character of virtual monster 10) and a second virtual monster 102 (considered as a non-player character independent of virtual monster 10).

[0108] For example, based on the damage value of the first virtual character 20 to the first virtual monster, the attack target of the first virtual monster and / or the second virtual monster is changed.

[0109] Referring to Figure 4, after the virtual monster 10 attacks the first virtual character 20, the damage values ​​of each of the multiple virtual characters, including the first virtual character 20, to the virtual monster 10 can be calculated in real time. The calculation of the damage values ​​is as described above and will not be repeated here.

[0110] Subsequently, the attack targets of virtual monster 10, accompanying virtual monster 101, and second virtual monster 102 can be changed based on the damage value. The change of attack target for virtual monster 10 can still refer to the three change methods in the previous embodiment, and this application does not limit this; this embodiment will not describe this situation in detail. Alternatively, after determining the initial attack target, virtual monster 10 may not change its attack target, but only change the attack targets of accompanying virtual monster 101 and / or second virtual monster 102; this embodiment will only describe this situation.

[0111] • The method for changing the attack targets of companion characters who are not player characters.

[0112] Among them, the companion character is used to refer to the non-player character that adapts to the activities of the non-player character, and can be implemented as a virtual follower and / or virtual partner of the non-player character.

[0113] In some embodiments, the target of the accompanying virtual monster 101 can be considered as the virtual character that poses the greatest threat to the virtual monster 10. If the damage value of the first virtual character 20 to the virtual monster 10 is not the greatest, the target of the accompanying virtual monster 101 is changed to the virtual character corresponding to the maximum damage value. Referring to Figure 4, within a certain preset period, the virtual monster 10 attacks the first virtual character 20, and at the same time, it is calculated that the third virtual character 40 has the greatest damage value to the virtual monster 10. Then, the target of the accompanying virtual monster 101 can be changed from the initial first virtual character 20 to the third virtual character 40. At this time, the target of the virtual monster 10 can still be the first virtual character 20. In order to protect the virtual monster 10, the accompanying virtual monster 101, as an accompanying character, can launch an attack on the third virtual character 40, which poses the greatest threat to the virtual monster 10, thereby reducing the pressure on the virtual monster 10.

[0114] In other embodiments, the attack target of the accompanying virtual monster 101 is changed based on the difference between the damage values ​​of multiple virtual characters to the virtual monster 10. If the difference between the damage values ​​is less than a third threshold, the attack target of the accompanying virtual monster 101 is changed from the first virtual character 20 to at least two virtual characters within the attack range of the virtual monster 10. Referring to Figure 4, if the difference between the damage values ​​of the first virtual character 20, the second virtual character 30, and the third virtual character 40 to the virtual monster 10 is small, it can be considered that the attack on the virtual monster 10 is relatively uniform. To protect the virtual monster 10, the accompanying virtual monster 101 can choose to disperse its attacks among multiple virtual characters. In this case, if there are multiple accompanying virtual monsters 101, the attack method can be set according to the number of accompanying virtual monsters 101 and virtual characters. It can be one-to-one, one-to-many, or set according to distance; this application does not limit this.

[0115] In other embodiments, the attack targets of the accompanying virtual monster 101 can be changed based on the number of virtual characters within the attack range of the virtual monster 10. If the number of virtual characters exceeds a fourth threshold, the attack targets of the accompanying virtual monster 101 can be changed from the first virtual character 20 to at least two virtual characters within the attack range of the virtual monster 10. For example, if the fourth threshold is 5, when the number of virtual characters within the attack range of the virtual monster 10 exceeds 5, it is considered that the virtual monster 10 has been subjected to a group attack. In this case, to protect the virtual monster 10, the accompanying virtual monster 101 can change to attacking multiple virtual characters in a dispersed manner. Specific attack methods can be found above and will not be repeated here.

[0116] • The method for changing the attack targets of a second independent non-player character.

[0117] For the second virtual monster 102, in addition to referring to the method of changing the target of attack as described for the companion virtual monster 101, it also includes at least one of the following methods of change:

[0118] (1) Change to the virtual character that poses the greatest threat to virtual monster 10.

[0119] In some embodiments, based on the calculation and sorting of the damage values ​​of multiple virtual characters to virtual monster 10, if the virtual character corresponding to the maximum damage value is no longer a virtual character in the previous preset period, and the virtual character corresponding to the maximum damage value is within the attack range of the second virtual monster 102, then the attack target of the second virtual monster 102 is changed. Referring to Figure 4, in a certain preset period, virtual monster 10 attacks the first virtual character 20, and at the same time, it is calculated that the third virtual character 40 has the maximum damage value to virtual monster 10, and the third virtual character 40 is located within the attack range of the second virtual monster 102.

[0120] At this point, the third virtual character 40 is considered the monster that poses the greatest threat to the virtual monster 10. In order to cooperate with the virtual monster 10, the second virtual monster 102 can change its target from the first virtual character 20 to the third virtual character 40, thereby reducing the pressure on the virtual monster 10.

[0121] (2) Exchange attack targets with virtual monster 10.

[0122] In other embodiments, based on the calculation and ranking of the damage values ​​of multiple virtual characters to virtual monster 10, if the combat power of the virtual character that causes the maximum damage value to virtual monster 10 and the two virtual monsters both change, the attack target of the second virtual monster 102 can be changed.

[0123] As can be seen in Figure 4, if the damage dealt by the first virtual character 20 to the virtual monster 10 is less than the damage dealt by the second virtual character 30 to the virtual monster 10, and the attack power of the second virtual monster 102 is greater than the attack power of the virtual monster 10, then the target of the second virtual monster 102 is changed from the first virtual character 20 to the second virtual character 30, thereby reducing the pressure on the virtual monster 10.

[0124] It should be understood that the various ways of changing the attack targets of non-player characters mentioned above can be implemented individually or in combination. Any combination is within the scope of protection of this application, and will not be listed one by one.

[0125] Figure 5 is a flowchart of a non-player character control method provided in an exemplary embodiment of this application. Taking the application of this method to the terminal device 110 shown in Figure 1 as an example, the terminal device 110 can be considered as a first client. The first client is used to support a first account controlling a first virtual character, or, a first terminal running the first client is used to control the first virtual character. The method includes:

[0126] Step 520: Display non-player characters in the virtual world.

[0127] For example, a terminal running a first client is a first terminal. The first terminal runs a first client that supports a virtual environment, and the display screen of the first terminal can display virtual scene images. The virtual scene images are scene images in the virtual environment captured by a camera model, and the virtual scene images can be regarded as all or part of the display images of the virtual world involved in this application.

[0128] In some embodiments, non-player characters are characters set up for gameplay and generally play a role in driving the plot forward. Optionally, non-player characters are characters that players cannot control, such as virtual characters controlled by artificial intelligence (AI), or virtual characters controlled by computer programs (on the terminal and / or the server).

[0129] For example, non-player characters can be implemented as virtual monsters. The movement path, attack methods, attack power, attack range, and other related information of the virtual monsters are pre-set by the server. One or more players can control their respective virtual characters to fight against the virtual monsters. To advance the game, non-player characters are displayed in the virtual world for interaction with the virtual characters controlled by one or more players.

[0130] Optionally, one or more virtual characters may be displayed in the virtual world. These virtual characters are controlled by different players through different clients to perform activities within the virtual world. Referring to Figure 3, the virtual world displays virtual monster 10, first virtual character 20, second virtual character 30, and third virtual character 40. Optionally, the virtual world may also display associated information for multiple virtual characters, such as identifiers, avatars, and health values.

[0131] Step 540: Display non-player character attacking the first virtual character.

[0132] In illustrative terms, the first virtual character is one of at least two virtual characters located within the attack range of the non-player character. The attack range of the non-player character is pre-defined, such as a circular area centered on the non-player character. The radius of this circular area can be set according to actual needs, and this application does not impose any limitations on it.

[0133] For the first client, the first virtual character, also known as the master virtual character, is a virtual character controlled by the first account. Users can control the activities of the first virtual character through interaction with the first client's display screen (which is a touch-enabled screen, also known as a touchscreen) or external interactive devices (such as a mouse, keyboard, stylus, game controller, etc.), such as interacting with non-player characters in the virtual world. This application embodiment uses the example of a player-controlled virtual character as the first example; the player's first account, logged in through the first client, has control over the first virtual character.

[0134] In some embodiments, the attack range of a non-player character may or may not be displayed in the virtual world. Referring to Figure 3, taking a non-player character implemented as a virtual monster 10 as an example, the attack range of the virtual monster 10 can be displayed as a black ellipse, and one or more notification effects may be attached to the black ellipse, such as displaying a glowing effect on the black ellipse. Optionally, when the non-player character does not interact with the virtual character, its attack range may not be displayed in the virtual world. At the same time, a first virtual character 20 and a second virtual character 30 exist within the attack range of the virtual monster 10, and optionally other virtual characters may also exist. This application does not limit the number of virtual characters within the attack range.

[0135] For example, after a first virtual character is identified, a non-player character can launch an attack on that first virtual character. There are several ways to determine the first virtual character. For instance, it can be determined based on the distance between multiple virtual characters and the non-player character, or based on the current attack power of multiple virtual characters, or based on the health points of multiple virtual characters, etc.

[0136] In some embodiments, the first virtual character may be determined based on the damage value of one or more candidate virtual characters to a non-player character, such as determining the candidate virtual character corresponding to the maximum damage value as the first virtual character.

[0137] Optionally, the damage value of a virtual character to a non-player character is determined based on at least one of the following:

[0138] • The change in a virtual character's health over a preset period;

[0139] • The number of times a virtual character is attacked by a non-player character within a preset period;

[0140] • The duration for which a virtual character remains outside the attack range of a non-player character within a preset period;

[0141] • Attributes of virtual characters.

[0142] The preset period can be set according to actual needs, such as 1 second, 5 seconds, 10 seconds, etc. It can be understood as iteratively calculating the damage value of the virtual character to the non-player character within the preset period. This application does not limit the specific value of the preset period. The change in health is used to indicate the increase or decrease of the virtual character's virtual health value within the preset period. The number of hits is used to indicate the number of times the virtual character is attacked by the non-player character within the preset period. The attributes of the virtual character are preset, and different attributes are set with different attribute values ​​and / or attribute calculation coefficients. For example, if the attribute of the virtual character is defense, then a defense value and a defense calculation coefficient are set accordingly. The value is set according to actual needs.

[0143] It's important to note that many of the above-mentioned pieces of information can be obtained through analysis of the display interface. For example, changes in health can be determined by the length changes of the health bar on the display interface; the number of hits taken can be calculated based on attacks received by the virtual character from non-player characters within a preset period on the display interface; the duration of dwell time can be calculated based on the radius of the attack range displayed on the display interface and the time taken to analyze interface changes; and the attributes of the virtual character can be determined based on the displayed virtual character. In other words, the damage values ​​of different virtual characters to non-player characters can be determined directly or indirectly through analysis of interface changes.

[0144] In some embodiments, multiple damage values ​​are schematically sorted by magnitude to select the attack target of a non-player character, such as a first virtual character, based on the damage value sorting. Then, the non-player character is shown attacking the first virtual character.

[0145] Step 560: Based on the damage value of the virtual character to the non-player character, determine the attack target of the non-player character.

[0146] Indicatively, the target of the attack is at least one of at least two virtual characters that are within the attack range of the non-player character.

[0147] The damage value indicates the damage inflicted by a virtual character on a non-player character. This damage can manifest in various ways, such as a decrease in the non-player character's combat power, reduced health, slower movement, smaller size, loss of virtual equipment, or reduced attack range. For example, the relevant content regarding damage values ​​is described above and will not be repeated here.

[0148] According to step 540, a non-player character attacks the first virtual character. Subsequently, the damage values ​​of multiple virtual characters on the non-player character are calculated in real time within a preset period, and the damage values ​​are used to determine whether to change the non-player character's attack target.

[0149] It should be understood that, at least the damage value of the first virtual character to the non-player character is calculated. Based on the non-player character's attack on the first virtual character and considering the factors affecting damage value, the damage value corresponding to the first virtual character will definitely change within the preset period. However, other virtual characters may not have interacted with the non-player character, and their damage value to the non-player character may not change. Therefore, the order and / or numerical differences of multiple damage values ​​will change.

[0150] In some embodiments, only one non-player character exists, and the virtual world displays one non-player character interacting with at least two virtual characters; in other embodiments, at least two non-player characters exist, and the virtual world displays multiple non-player characters interacting with at least two virtual characters. Therefore, the change in the attack target of a non-player character can occur in various ways, as detailed below:

[0151] • A non-player character interacts with at least two virtual characters.

[0152] Referring to Figure 3, taking a non-player character implemented as a virtual monster 10 as an example, the change of the attack target of the virtual monster 10 includes at least one of the following:

[0153] Change Method 1: Change based on damage value. Optionally, after calculating the damage values ​​of multiple virtual characters to virtual monster 10 in real time within a preset period, the virtual character corresponding to the highest damage value is changed to the new target of virtual monster 10. For example, if the third virtual character 40 enters the attack range of virtual monster 10 and the third virtual character 40 deals the highest damage to virtual monster 10, then the threat of the first virtual character 20 to virtual monster 10 can be considered reduced, while the threat of the third virtual character 40 to virtual monster 10 can be increased. Therefore, the target of virtual monster 10 can be changed from the first virtual character 20 to the third virtual character 40. That is, the display interface will show that virtual monster 10 abandons attacking the first virtual character 20 and instead attacks the third virtual character 40.

[0154] Method Two: Change based on the difference between damage values. Optionally, if the difference between multiple damage values ​​is less than a first threshold, change the attack target of virtual monster 10. For example, calculate the difference between the damage values ​​of the first virtual character 20, the second virtual character 30, the third virtual character 40, and the fourth virtual character 50 to virtual monster 10. If the difference between the four damage values ​​is less than a preset first threshold, it can be understood that the threat level of multiple virtual characters relative to virtual monster 10 is relatively small. In this case, change the attack target of virtual monster 10 from the third virtual character 40 to at least two of the above four virtual characters. That is, the display interface shows virtual monster 10 abandoning its attack on the third virtual character 40 and then launching a sweeping group attack, causing the second virtual character 30 to be knocked down.

[0155] Besides the two methods mentioned above, and disregarding the impact of damage values, the following modification methods also exist:

[0156] Method 3: Change based on the number of virtual characters within the attack range. Optionally, when the number of virtual characters within the attack range of virtual monster 10 exceeds a preset second threshold, the attack target of virtual monster 10 is changed to at least two virtual characters within the attack range. Both virtual characters with and without attack power can be included in the count of virtual characters; this application does not limit this. Referring to Figure 3, taking a second threshold of 5 as an example, when virtual monster 10 attacks the first virtual character 20, if the number of virtual characters within the attack range of virtual monster 10 is calculated in real-time and does not exceed 5, then the attack target of virtual monster 10 does not change according to this method.

[0157] It should be understood that the above three modification methods can be used individually or in combination, sequentially or out of order, and any one of them is within the scope of protection of this application. Examples will not be given here.

[0158] In some embodiments, there is a situation where a non-player character continuously attacks the first virtual character. Optionally, if the continuous attack condition is met, the continuous attack of the non-player character on the first virtual character is displayed. Referring to Figure 3 and the three aforementioned variations, the continuous attack condition can be implemented as follows: the damage value of the first virtual character 20 to the virtual monster 10 is still the highest; the difference between the damage values ​​of multiple virtual characters to the virtual monster 10 exceeds a preset first threshold, and the damage value of the first virtual character 20 to the virtual monster 10 is still the highest; the number of virtual characters within the attack range of the virtual monster 10 does not exceed a second threshold. In these three cases, the continuous attack of the virtual monster 10 on the first virtual character 20 is displayed until the damage value ranking changes within a certain preset period, and then the attack target of the virtual monster 10 is changed.

[0159] • Multiple non-player characters interact with at least two virtual characters.

[0160] Optionally, multiple non-player characters can be implemented as a leader non-player character and at least one companion character, such as a virtual boar and multiple virtual baby boars following the virtual boar; multiple non-player characters can also be implemented as multiple independent non-player characters, such as a virtual Tyrannosaurus Rex and a virtual Pteranodon.

[0161] Referring to Figure 4, taking a non-player character implemented as virtual monster 10 (considered the first non-player character), accompanying virtual monster 101 (considered the companion character of the first non-player character), and a second virtual monster 102 (considered the second non-player character distinct from the first non-player character) as an example, the attack targets of the first non-player character and / or the second non-player character are changed based on the damage value of the first virtual character 20 to the first non-player character. The damage value is referenced above and will not be repeated here.

[0162] The changes in the targets of the three virtual monsters mentioned above include at least one of the following:

[0163] Optionally, the change of the attack target of the virtual monster 10 can still refer to the three change methods in the previous embodiment, and this application does not limit it; or, after determining the initial attack target, the virtual monster 10 does not change the attack target, but only changes the attack target of the companion virtual monster 101 and / or the second virtual monster 102, specifically including:

[0164] • The method for changing the attack targets of companion characters who are not player characters.

[0165] In some embodiments, the target of the accompanying virtual monster 101 can be considered as the virtual character that poses the greatest threat to the virtual monster 10. If the damage value of the first virtual character 20 to the virtual monster 10 is not the highest, then the target of the accompanying virtual monster 101 is changed to the virtual character corresponding to the highest damage value. Referring to Figure 4, if the third virtual character 40 deals the highest damage to the virtual monster 10, then the target of the accompanying virtual monster 101 is changed from the initial first virtual character 20 to the third virtual character 40. At this time, the target of the virtual monster 10 can still be the first virtual character 20.

[0166] In other embodiments, the attack target of the accompanying virtual monster 101 is changed based on the difference between the damage values ​​of the multiple virtual characters to the virtual monster 10. If the difference between the damage values ​​of the multiple virtual characters to the virtual monster 10 is less than a third threshold, the attack target of the accompanying virtual monster 101 is changed from the first virtual character 20 to at least two virtual characters within the attack range of the virtual monster 10. Referring to Figure 4, if the difference between the damage values ​​of the first virtual character 20, the second virtual character 30, and the third virtual character 40 to the virtual monster 10 is small, it can be considered that the attack on the virtual monster 10 is relatively uniform. To protect the virtual monster 10, the accompanying virtual monster 101 can choose to disperse its attacks among multiple virtual characters.

[0167] In other embodiments, the target of the accompanying virtual monster 101 can be changed based on the number of virtual characters within the attack range of the virtual monster 10. If the number of virtual characters exceeds a fourth threshold, the target of the accompanying virtual monster 101 can be changed from the first virtual character 20 to at least two virtual characters within the attack range of the virtual monster 10.

[0168] • The method for changing the attack targets of a second independent non-player character.

[0169] For the second virtual monster 102, in addition to referring to the method of changing the target of attack as described for the companion virtual monster 101, it also includes at least one of the following methods of change:

[0170] The attack target of the second virtual monster 102 is changed to the virtual character that poses the greatest threat to the virtual monster 10. In some embodiments, based on the calculation and ranking of the damage values ​​of multiple virtual characters to the virtual monster 10, if the virtual character corresponding to the maximum damage value is no longer a virtual character in the previous preset period, and the virtual character corresponding to the maximum damage value is within the attack range of the second virtual monster 102, then the attack target of the second virtual monster 102 is changed. Referring to Figure 4, in a certain preset period, the virtual monster 10 attacks the first virtual character 20, and at the same time, it is calculated that the third virtual character 40 has the maximum damage value to the virtual monster 10, and the third virtual character 40 is within the attack range of the second virtual monster 102, then the attack target of the second virtual monster 102 is changed from the first virtual character 20 to the third virtual character 40.

[0171] The attack target of the second virtual monster 102 is swapped with that of the virtual monster 10. In other embodiments, based on the calculation and ranking of the damage values ​​of multiple virtual characters to the virtual monster 10, if the combat power of the virtual character that deals the maximum damage to the virtual monster 10 and the two virtual monsters changes, the attack target of the second virtual monster 102 can be changed. For example, if the damage value of the first virtual character 20 to the virtual monster 10 is less than the damage value of the second virtual character 30 to the virtual monster 10, and the attack power of the second virtual monster 102 is greater than the attack power of the virtual monster 10, then the attack target of the second virtual monster 102 is changed from the first virtual character 20 to the second virtual character 30, thereby reducing the pressure on the virtual monster 10.

[0172] It should be understood that the various ways of changing the attack target of one or more non-player characters mentioned above can be implemented individually or in combination. Any combination is within the scope of protection of this application, and will not be listed one by one.

[0173] For example, the damage values ​​of multiple virtual characters to one or more non-player characters will be updated in real time within a preset period, thereby facilitating the real-time identification of attack targets for one or more non-player characters.

[0174] In summary, the non-player character control method provided in this embodiment can change the non-player character's attack target in real time based on the damage values ​​of multiple virtual characters against the non-player character. For example, it can change the attack target to a single virtual character or switch to a group attack on multiple virtual characters, thereby improving the flexibility of the non-player character and making its reactions more vivid and varied during multi-player hunts, rather than always attacking a single target, which aligns with players' expectations of a realistic hunting experience. Simultaneously, the non-player character can also achieve more flexible real-time attacks during multi-player hunts, extending its existence time in the virtual world. For players, this also makes the non-player character's attack methods and damage intensity against different virtual characters unpredictable, increasing the interaction time and randomness of the difficulty of defeating the non-player character, making human-computer interaction more engaging.

[0175] In the presence of multiple non-player characters, the attack targets of these characters can be changed in real time based on the damage each character inflicts on other non-player characters. This allows multiple virtual monsters to form teams, essentially creating a cooperative fighting force. The reactions of multiple non-player characters during multi-player hunts are also more varied. For the player, this is equivalent to giving these non-player characters the ability to think, exhibiting cunning behaviors similar to real plants and animals, enabling a degree of strategic combat between the player and these characters. This increases the flexibility of each non-player character while providing the player with an immersive hunting experience in the virtual world.

[0176] Figure 6 is a flowchart of a non-player character control method provided in an exemplary embodiment of this application. Step 560 can optionally be implemented as step 561 or step 562. The method can also optionally include steps 570 and 580, as detailed below:

[0177] Step 561: Based on the fact that the first damage value is less than the second damage value, change the attack target of the non-player character from the first virtual character to the second virtual character.

[0178] The first damage value is the damage dealt by the first virtual character to a non-player character, and the second damage value is the damage dealt by the second virtual character to a non-player character. The second virtual character is the other virtual character that is distinct from the first virtual character among at least two virtual characters. Details regarding damage values ​​can be found above and will not be repeated here.

[0179] Referring to Figure 3, taking a non-player character as virtual monster 10 as an example, virtual monster 10 identifies the first virtual character 20 as its initial attack target. Based on real-time changes in the battle, the first damage value of the first virtual character 20 to virtual monster 10 and the second damage value of the third virtual character 40 to virtual monster 10 are calculated within a preset period. For example, if the first virtual character 20 is attacked multiple times by virtual monster 10 in a short period, causing its health to drop sharply, the calculated first damage value will decrease; simultaneously, the third virtual character 40 enters the attack range of virtual monster 10, and the second damage value of the third virtual character 40 to virtual monster 10 exceeds the first damage value. Subsequently, based on the second damage value exceeding the first damage value, the attack target of virtual monster 10 is changed from the first virtual character 20 to the third virtual character 40.

[0180] In this scenario, based on the change in the virtual character corresponding to the maximum damage value, it can be concluded that the threat posed by the first virtual character to the non-player character has decreased. Meanwhile, another virtual character within the non-player character's attack range poses a relatively increased threat, thus causing the non-player character's attack target to change in real time. This change method imbues the non-player character with anthropomorphic thinking, increasing the fun of the virtual game.

[0181] Step 562: Based on the fact that the difference between the first damage value and the third damage value is less than the first threshold, change the attack target of the non-player character from the first virtual character to both the first virtual character and the third virtual character.

[0182] The first damage value is the damage dealt by the first virtual character to a non-player character, and the third damage value is the damage dealt by the third virtual character to a non-player character. The third virtual character is one of at least two virtual characters that differ from the first virtual character. Details regarding damage values ​​are as described above and will not be repeated here. Optionally, the first threshold can be set according to actual needs; this application does not impose any limitations on it.

[0183] Referring to Figure 3, taking a non-player character as virtual monster 10 as an example, the damage values ​​of the first virtual character 20, the second virtual character 30, the third virtual character 40, and the fourth virtual character 50 (which enters the attack range in real time) to virtual monster 10 are calculated within a preset period based on the real-time changes in the battle. Then, the difference between the four damage values ​​is determined. If the difference between the four damage values ​​is less than a preset first threshold, the attack target of virtual monster 10 is changed to at least two of the four virtual characters. That is, the display interface shows virtual monster 10 abandoning its attack on a single virtual character and then launching a sweeping group attack, resulting in the second virtual character 30 being knocked down and the health of the other virtual characters decreasing accordingly.

[0184] In this scenario, since the difference between multiple damage values ​​is less than a first threshold, it can be concluded that the threat levels of multiple virtual characters within the non-player character's attack range are relatively similar. At this point, attacking a single virtual character would make the non-player character appear rather rigid. Changing the non-player character's attack method from a single attack to a group attack makes the non-player character more "intelligent," capable of randomly assessing the real-time situation of the battle, thus allowing multiple players to join the interaction with the non-player character.

[0185] In addition to the two methods of changing the target of an attack mentioned above, at least the following methods also exist:

[0186] Step 570: If the number of virtual characters appearing within the attack range of a non-player character exceeds the second threshold, change the attack target of the non-player character from the first virtual character to multiple virtual characters within the attack range of the non-player character.

[0187] Virtual characters, whether they possess attack power or not, can be included in the count of virtual characters, and this application does not impose any restrictions on this. For example, virtual characters with attack power displayed within the attack range can be included in the count of virtual characters, while virtual characters that have lost their attack power displayed within the attack range (such as virtual characters whose health bars are empty but have not yet been removed from the display) can also be included in the count of virtual characters.

[0188] Optionally, the second threshold can be set according to actual needs, and this application does not limit it. For example, if the number of virtual characters appearing within the attack range exceeds 5, the attack method of non-player characters can be changed to a group attack, that is, the attack on the first virtual character can be canceled and the attack on multiple virtual characters within its own attack range can be changed. The specific number of virtual characters that can be attacked may change depending on the control operations of multiple players on the virtual characters.

[0189] In this situation, based on the number of virtual characters appearing within the non-player character's attack range, it can be concluded that multiple virtual characters pose a threat to the non-player character, resulting in significant attack pressure. Alternatively, it can be concluded that there are many virtual characters within the attack range whose health bars are empty but have not yet been removed from the display, affecting the non-player character's choice of attack targets and also impacting the player's observation of the battle. In this case, if the non-player character continues to attack a single virtual character, they may be defeated by multiple other virtual characters in a short period, and the player controlling the other virtual characters will also lose much of the neutral game enjoyment. Changing the non-player character's attack method to group attacks can increase the sense of participation for multiple players, ensure a good neutral game experience for multiple players, and allow multiple players to interact simultaneously with the non-player character.

[0190] Step 580: If the continuous attack condition is met, display the non-player character continuously attacking the first virtual character.

[0191] The conditions for a sustained attack include one of the following:

[0192] • The first damage value is not less than the second damage value;

[0193] • The difference between the first damage value and the third damage value is not less than the first threshold, and the first damage value is greater than the third damage value;

[0194] • The number of virtual characters appearing within the attack range of non-player characters does not exceed the second threshold.

[0195] The details regarding damage values ​​are as described above and will not be repeated here.

[0196] According to steps 561, 562, and 570, there are three ways for a non-player character to change their attack target, which can be considered as the conditions for a non-player character to switch targets. In some embodiments, when the conditions for switching targets are not met (i.e., the conditions for continuous attack described above are met), the non-player character will continuously attack the same target. Therefore, it can be considered that any conditions that contradict the various ways of changing targets given in this application belong to the conditions for continuous attack involved in this application, and will not be elaborated further.

[0197] Referring to Figure 3, if the damage value of the first virtual character 20 to the virtual monster 10 is still the highest, then the virtual monster 10 will continue to attack the first virtual character 20 until the damage value ranking changes within a preset period. Alternatively, if the difference between the damage values ​​of multiple virtual characters to the virtual monster 10 exceeds a preset first threshold, and the damage value of the first virtual character 20 to the virtual monster 10 is still the highest, then the virtual monster 10 will continue to attack the first virtual character 20 until the difference between the damage values ​​changes.

[0198] In this scenario, providing continuous attack conditions for non-player characters, combined with the aforementioned various modification methods, makes the logic for non-player characters to determine their attack targets more comprehensive. For players, this means that the reactions of non-player characters during actual combat are more flexible and more consistent with real-world combat situations, resulting in a more realistic experience of interaction between non-player characters and multiple players.

[0199] It should be understood that steps 561, 562, 570 and 580 can be used individually or in combination, in sequence or out of order, and any method of use is within the protection scope of this application. Examples will not be given here.

[0200] Figure 7 is a flowchart of a non-player character control method provided in an exemplary embodiment of this application. The non-player character includes a first non-player character and a second non-player character. In this case, step 560 can optionally be implemented as step 563, as follows:

[0201] Step 563: Based on the damage value of the virtual character to the first non-player character, determine the attack target of the first non-player character and / or the second non-player character.

[0202] In some embodiments, there are multiple non-player characters battling against multiple virtual characters. These multiple non-player characters can be implemented as a leader non-player character and at least one companion character, such as a virtual boar and multiple virtual baby boars following it; alternatively, they can be implemented as multiple independent non-player characters, such as a virtual Tyrannosaurus Rex and a virtual Pteranodon.

[0203] Referring to Figure 4, the virtual world displays virtual monster 10 (considered as the first non-player character), companion virtual monster 101 (considered as a companion character of the non-player character), and second virtual monster 102 (considered as a second non-player character distinct from the first non-player character).

[0204] At this point, the change of the first non-player character's attack target can be referred to the aforementioned content and will not be repeated here; or the first non-player character will continue to attack after determining an attack target and will not change its attack target. Optionally, the change of the second non-player character's attack target can be determined based on the damage value received by the first non-player character from multiple virtual characters.

[0205] Referring to Figure 4, after the virtual monster 10 attacks the first virtual character 20, the damage values ​​of each of the multiple virtual characters, including the first virtual character 20, to the virtual monster 10 can be calculated in real time, with the calculation of the damage values ​​referring to the aforementioned content. Subsequently, based on the damage values, it can be determined whether to change the attack targets of the virtual monster 10, the accompanying virtual monster 101, and the second virtual monster 102.

[0206] In some embodiments, when the damage dealt to virtual monster 10 by a certain virtual character exceeds the damage dealt to the first virtual character 20, it is considered to pose the greatest threat to virtual monster 10, and the accompanying virtual monster 101 and / or the second virtual monster 102 can change it to a new attack target. In other embodiments, when the difference in damage dealt to virtual monster 10 by multiple virtual characters is small, or when there are many virtual characters within the attack range of virtual monster 10, virtual monster 10 is considered to be suffering more damage, and the accompanying virtual monster 101 and / or the second virtual monster 102 can change to a group attack mode, changing multiple virtual characters to new attack targets, thereby reducing the pressure on virtual monster 10.

[0207] In other words, when multiple non-player characters exist, the primary consideration is the damage dealt by each virtual character to the first non-player character, which is then used to change the targets of the other non-player characters. The first non-player character can be considered the leader of the multiple non-player characters, who need to protect it and extend its existence in the virtual world as much as possible, thereby enhancing the player's experience in the virtual game.

[0208] Referring to the foregoing, when there are multiple non-player characters, step 563 can be implemented in several ways, which will be described in detail below.

[0209] The second non-player character is a companion character to the first non-player character. Step 563 can be implemented as follows:

[0210] Based on the fact that the fourth damage value is less than the fifth damage value, the attack target of the second non-player character is changed from the first virtual character to the fourth virtual character;

[0211] Alternatively, based on the fact that the difference between the fourth and fifth damage values ​​is less than the third threshold, the attack target of the second non-player character is changed from the first virtual character to both the first and fourth virtual characters;

[0212] The fourth damage value is the damage value of the first virtual character to the first non-player character, and the fifth damage value is the damage value of the fourth virtual character to the first non-player character. The fourth virtual character is one or more other virtual characters that are different from the first virtual character.

[0213] In some embodiments, the companion character is a non-player character that adapts its activities to follow the activities of the first non-player character, and can be implemented as a virtual follower and / or virtual partner of the first non-player character. Taking the first virtual character as virtual character 1, the second virtual character as virtual character 2, the first non-player character as a virtual boar leader, and the second non-player character as a virtual piglet (which can be one or more, without limitation) as an example, the fourth damage value is the damage value of virtual character 1 to the virtual boar leader, the fifth damage value is the damage value of virtual character 2 to the virtual boar leader, and both virtual character 1 and virtual character 2 are within the attack range of the virtual boar leader.

[0214] First, the virtual boar leader identifies virtual character 1 as the initial attack target, and both the virtual boar leader and the virtual pig attack virtual character 1. Within a preset period, the fourth and fifth damage values ​​are calculated. If the fourth damage value is less than the fifth damage value, then virtual character 2 is considered to pose the greatest threat to the virtual boar leader. Subsequently, the virtual pig's attack target is changed from virtual character 1 to virtual character 2 to reduce the pressure on the virtual boar leader.

[0215] Alternatively, within a preset period, the fourth and fifth damage values ​​are calculated. If the difference between the fourth and fifth damage values ​​is less than a preset third threshold, the virtual pig's attack targets are changed from virtual character 1 to both virtual character 1 and virtual character 2, meaning the virtual pig changes from a single attack method to a group attack method. In this case, if there is only one virtual pig, a group attack skill can be used; if there are multiple virtual pigs, each virtual pig can attack one or more virtual characters. This application does not limit the specific attack method of the virtual pigs; it can be set according to the number of virtual pigs and the number of virtual characters waiting to be attacked, and can be one-to-one or one-to-many.

[0216] In some embodiments, there are other conditions under which the virtual pig can be converted into a group attack method.

[0217] Optionally, the non-player character control method provided in this application also includes:

[0218] If the number of virtual characters appearing within the attack range of the first non-player character exceeds the fourth threshold, the attack target of the second non-player character will be changed from the first virtual character to two or more virtual characters within the attack range of the second non-player character.

[0219] The descriptions regarding the number of virtual characters and the fourth threshold can be found above. Referring to the previous example, let's assume the virtual boar leader's attack range includes virtual characters 1 and 2, and the fourth threshold is 3. As the battle progresses, virtual characters 3 and 4 enter the virtual boar leader's attack range, and virtual character 1 is knocked down by the virtual boar leader but hasn't disappeared from the display. At this point, it can be considered that the number of virtual characters appearing within the virtual boar leader's attack range exceeds 3. Therefore, the virtual pig's attack target can be changed from virtual character 1 to at least two of virtual characters 2, 3, and 4.

[0220] In summary, when the second non-player character is an accompanying character of the first non-player character, the second non-player character can change its attack target in real time to protect the first non-player character, thereby reducing the pressure on the first non-player character and forming a team battle involving multiple non-player characters. For the player, this increases the randomness of interactions with multiple non-player characters and makes it more difficult for the player to defeat the first non-player character, thus providing more enjoyment in neutral gameplay.

[0221] Besides the accompanying character, the second non-player character can also be implemented as an independent character distinct from the first non-player character, such as a virtual Tyrannosaurus Rex and a virtual Pteranodon. Taking a virtual Tyrannosaurus Rex as the first non-player character and a virtual Pteranodon as the second, if the virtual Tyrannosaurus Rex's attack range includes virtual character 1 and virtual character 2, then the virtual Pteranodon's attack targets will be affected by the damage values ​​received by the virtual Tyrannosaurus Rex from multiple virtual characters, as detailed below:

[0222] Optionally, step 563 can be implemented as follows:

[0223] Based on the fact that the fourth damage value is less than the sixth damage value, the attack target of the second non-player character is changed from the first virtual character to the fifth virtual character;

[0224] The fourth damage value is the damage value of the first virtual character to the first non-player character, and the sixth damage value is the damage value of the fifth virtual character to the first non-player character. The fifth virtual character is a virtual character that is outside the attack range of the first non-player character but inside the attack range of the second non-player character, or the fifth virtual character is a virtual character that is outside the attack range of the first non-player character and whose distance from the second non-player character is less than a distance threshold.

[0225] Referring to the previous example, the fourth damage value is the damage dealt by virtual character 1 to the virtual Tyrannosaurus Rex, and the sixth damage value is the damage dealt by virtual character 3 to the virtual Tyrannosaurus Rex. Virtual character 3 is not within the attack range of the virtual Tyrannosaurus Rex, but is within the attack range of the virtual pterosaur, or the distance between them is less than a preset distance threshold. In this case, when the virtual Tyrannosaurus Rex and the virtual pterosaur attack virtual character 1, the damage values ​​of virtual character 1, virtual character 2, and virtual character 3 to the virtual Tyrannosaurus Rex are calculated within a preset period. It is found that the fourth damage value is less than the sixth damage value, meaning that virtual character 3 poses a greater threat to the virtual Tyrannosaurus Rex than virtual character 1. Therefore, to prevent virtual character 3 from attacking the virtual Tyrannosaurus Rex in advance, the virtual pterosaur can change its target from virtual character 1 to virtual character 3.

[0226] In this scenario, considering the first and second non-player characters in a group battle, there exists a virtual character that is not within the first non-player character's attack range but poses a significant threat. If this virtual character were within the second non-player character's attack range, the second non-player character could change its target to this virtual character, thus preemptively eliminating the combat threat to the first non-player character and extending its survival time in the virtual world.

[0227] Similarly, the first non-player character can also preemptively eliminate combat threats for the second non-player character. The implementation is similar to this embodiment and can be used as a reference, so it will not be described in detail here.

[0228] In addition to preemptively eliminating combat threats for the first non-player character, the second non-player character can also exchange attack targets with the first non-player character. Optionally, step 563 can be implemented as follows:

[0229] Based on the fact that the difference between the fourth and seventh damage values ​​is greater than the fifth threshold, and the difference between the attack power of the first non-player character and the second non-player character is greater than the sixth threshold, the attack target of the first non-player character is changed from the first virtual character to the sixth virtual character, and the attack target of the second non-player character is changed from the sixth virtual character to the first virtual character.

[0230] Among them, the fourth damage value is the damage value of the first virtual character to the first non-player character, the seventh damage value is the damage value of the sixth virtual character to the first non-player character, the fourth damage value is less than the seventh damage value, and the attack power of the second non-player character is greater than the attack power of the first non-player character.

[0231] Referring to the previous example, the fourth damage value is the damage dealt by virtual character 1 to the virtual Tyrannosaurus Rex, and the seventh damage value is the damage dealt by virtual character 4 to the virtual Tyrannosaurus Rex. In this case, when the virtual Tyrannosaurus Rex and the virtual pterosaur attack virtual character 1, the damage values ​​of virtual character 1 and virtual character 4 to the virtual Tyrannosaurus Rex are calculated separately within a preset period. It is found that the fourth damage value is less than the seventh damage value, and the difference between the two is greater than the preset fifth threshold. Simultaneously, the attack power of the virtual Tyrannosaurus Rex is less than that of the virtual pterosaur. That is, virtual character 4 poses a greater threat to the virtual Tyrannosaurus Rex than virtual character 1, meaning the less powerful virtual Tyrannosaurus Rex needs to fight against the more threatening virtual character 4. Therefore, to prevent the virtual Tyrannosaurus Rex from being defeated by virtual character 4, the attack target of the virtual pterosaur can be changed from virtual character 1 to virtual character 4.

[0232] In this scenario, as the first and second non-player characters in a group battle, there might be a situation where a non-player character with lower attack power is facing a more threatening virtual character. To make the interaction between multiple non-player characters and multiple virtual characters more "intelligent," the non-player character with higher attack power can be switched to fight the more threatening virtual character. From the player's perspective, this makes the team battles involving multiple non-player characters more rational and allows for a more human-like confrontation between two opposing factions.

[0233] It should be understood that the various ways of changing the attack targets of the aforementioned non-player characters can be implemented individually or in combination, sequentially or out of order. Any of these methods of use are within the protection scope of this application, and will not be listed in detail here.

[0234] Figure 8 is a flowchart of a non-player character control method provided in an exemplary embodiment of this application. Taking the application of this method to the server 120 shown in Figure 1 as an example, the method includes:

[0235] Step 820: Determine the first virtual character.

[0236] Indicatively, the first virtual character is one of at least two virtual characters in the virtual world that are within the attack range of a non-player character.

[0237] Referring to the foregoing, for non-player characters, it is necessary to first determine the initial target of the attack.

[0238] In some embodiments, the activities of multiple virtual characters and non-player characters in the virtual world will result in multiple virtual characters entering the attack range of the non-player characters. In this case, it is necessary to select one virtual character from among the multiple virtual characters as the initial attack target of the non-player characters.

[0239] Figure 9 is a flowchart of a control method for a non-player character provided in an exemplary embodiment of this application. Referring to Figure 9, step 820 can be implemented as follows:

[0240] Step 821: Determine the candidate list, where one or more candidate virtual characters are within the attack range of non-player characters;

[0241] Step 822: Calculate the damage value of one or more candidate virtual characters to non-player characters, and determine the candidate virtual character corresponding to the maximum damage value as the first virtual character.

[0242] In some embodiments, the candidate list may be determined by: determining an initial list, which includes all virtual characters existing in the virtual world; filtering an ignore list, identifying partner characters associated with the first virtual character as virtual characters in the ignore list; and determining a candidate list based on the initial list and the ignore list.

[0243] For example, the initial list includes Virtual Character 1, one or more companion characters of Virtual Character 1, Virtual Character 2, and one or more companion characters of Virtual Character 2. Companion characters are virtual characters that follow the activities of the corresponding virtual character and can be implemented as virtual followers and / or virtual pets of the corresponding virtual character. The ignore list includes one or more companion characters of Virtual Character 1 and one or more companion characters of Virtual Character 2. The ignore list can be considered a pre-defined list of virtual characters that will not enter the candidate list. Subsequently, the virtual characters included in the ignore list are removed from the initial list, resulting in the candidate list, which only includes Virtual Character 1 and Virtual Character 2. Among the one or more virtual characters in the candidate list, those within the attack range of non-player characters can be considered candidate virtual characters that may become the first virtual character.

[0244] After determining the candidate list, the damage values ​​of one or more candidate virtual characters to non-player characters can be calculated and sorted, and the candidate virtual character with the highest damage value is determined as the first virtual character. The specific calculation of the damage value will be explained below and will be omitted here.

[0245] It should be noted that in some embodiments, the initial list includes only one virtual character, and this virtual character is also in the ignore list; in this case, a candidate list cannot be generated. Optionally, in this situation, the method for determining the first virtual character further includes:

[0246] If there is a unique attackable target within the attack range of a non-player character, the unique attackable target will be identified as the first virtual character.

[0247] In this context, the "unique attackable target" can be understood as a unique virtual character. This virtual character can be one from the candidate list or a unique virtual character included in the initial list but belonging to the ignore list. For example, if the initial list contains only one virtual follower of virtual character 1, meaning virtual character 1's unique virtual follower appears within the non-player character's attack range, and there are no other virtual characters within the non-player character's attack range, then virtual character 1's unique virtual follower is determined as the non-player character's initial attack target, i.e., virtual character 1's unique virtual follower is designated as the first virtual character. At this point, an attack on the unique virtual follower may attract virtual character 1, thereby prompting virtual character 1 to interact with or avoid the non-player character.

[0248] Figure 10 is a schematic diagram of a non-player character control method provided in an exemplary embodiment of this application. Referring to Figure 10, only one virtual character 200 exists within the attack range of the non-player character 100, thereby the virtual character 200 can be identified as the initial attack target of the non-player character 100, that is, the virtual character 200 is identified as the first virtual character.

[0249] Based on this, the initial attack target of the non-player character, i.e., the first virtual character, can be determined. Specifically, if a candidate list exists, the first virtual character is determined based on the damage values ​​of multiple candidate virtual characters to the non-player character; if a candidate list cannot be generated, the only attackable target is determined as the first virtual character. This provides a backup plan for determining the initial attack target of the non-player character, increases the probability of human-computer interaction, and enhances the fun of interacting with both the virtual character and the non-player character.

[0250] Optionally, the damage value of a virtual character to a non-player character is determined based on at least one of the following:

[0251] • The change in a virtual character's health over a preset period;

[0252] • The number of times a virtual character is attacked by a non-player character within a preset period;

[0253] • The duration for which a virtual character remains outside the attack range of a non-player character within a preset period;

[0254] • Attributes of virtual characters.

[0255] The preset period can be set according to actual needs, such as 1 second, 5 seconds, 10 seconds, etc. It can be understood as iteratively calculating the damage value of the virtual character to the non-player character within the preset period. This application does not limit the specific value of the preset period. The change in health is used to indicate the increase or decrease of the virtual character's virtual health value within the preset period. The number of hits is used to indicate the number of times the virtual character is attacked by the non-player character within the preset period. The attributes of the virtual character are preset, and different attributes are set with different attribute values ​​and / or attribute calculation coefficients. For example, if the attribute of the virtual character is defense, then a defense value and a defense calculation coefficient are set accordingly. The value is set according to actual needs.

[0256] It's important to note that many of the above-mentioned pieces of information can be obtained through analysis of the display interface. For example, changes in health can be determined by the length changes of the health bar on the display interface; the number of hits taken can be calculated based on attacks received by the virtual character from non-player characters within a preset period on the display interface; the duration of dwell time can be calculated based on the radius of the attack range displayed on the display interface and the time taken to analyze interface changes; and the attributes of the virtual character can be determined based on the displayed virtual character. In other words, the damage values ​​of different virtual characters to non-player characters can be determined directly or indirectly through analysis of interface changes.

[0257] Figure 11 is a flowchart of a control method for a non-player character provided in an exemplary embodiment of this application. Optionally, the damage value of the virtual character to the non-player character is determined in the following manner:

[0258] Step 1520: Determine one or more damage change values, which are used to indicate the damage value of the virtual character to a non-player character within a preset period;

[0259] Step 1540: Determine the damage value of the virtual character to the non-player character within a preset period based on one or more damage change values ​​and the virtual character's initial damage value.

[0260] In some embodiments, the damage value may be calculated using one of the following methods:

[0261] Damage value within the preset period = initial damage value + one or more damage change values;

[0262] Damage value within the preset period = initial damage value × one or more damage change values.

[0263] The initial damage value is calculated based on the virtual character's attributes, such as the product of the attribute value and the attribute calculation coefficient; one or more damage change values ​​are used to indicate the damage value of the virtual character to non-player characters within a preset period.

[0264] Optionally, the damage change value may include one or more of the following: health change value, number of hits changed value, and percentage of time spent outside the arena changed value. The health change value is determined based on the health change coefficient and attribute value; the number of hits changed value is determined based on the number of hits coefficient and attribute value; and the percentage of time spent outside the arena changed value is determined based on the duration coefficient and attribute value. The three damage change values ​​can be calculated using the following formula:

[0265] Health change value = Health change coefficient × Attribute value matching character attributes;

[0266] Change in number of hits = Number of hits coefficient × Attribute value matching character attribute;

[0267] Change in the percentage of time spent outside the venue = Duration coefficient of stay × Attribute value matching the character attribute.

[0268] The coefficients for changes in health, number of hits, and duration of stay are determined based on the changes in the virtual character's health within a preset period, the number of times the virtual character is attacked by a non-player character within a preset period, and the duration of stay of the virtual character outside the attack range of a non-player character within a preset period, respectively.

[0269] In some embodiments, the above three coefficients can be determined using the following table:

[0270] The average health change percentage indicates the change in the virtual character's health value within a preset period. For example, if the health value drops from 100% to 50%, the health change coefficient is set to 0.5, corresponding to the value 6. If the virtual character is attacked 3 times by a non-player character within a preset period, the number of attacks coefficient is set to 3, corresponding to the value 4. The dwell time percentage indicates the proportion of the virtual character's time outside the attack range of a non-player character within the preset period. For example, if the percentage is 0.2, the dwell time coefficient is set to 0.2, corresponding to the value 3.

[0271] It should be understood that the coefficient can be set according to actual needs. The above is only an example and does not limit the scope of protection of this application. Other similar setting methods are all within the scope of protection of this application and will not be described in detail.

[0272] Taking a preset period of 5 seconds as an example, referring to Figure 3, the damage value of the first virtual character 20 to the virtual monster 10 is determined as follows: the blood volume change coefficient (denoted as coefficient 1) is determined based on the average percentage change in blood volume of the first virtual character 20 within 5 seconds; the number of times the first virtual character 20 is attacked by the virtual monster 10 within 5 seconds is determined based on the number of times the first virtual character 20 is attacked within 5 seconds (denoted as coefficient 2); and the dwell time coefficient (denoted as coefficient 3) is determined based on the attack range radius of the virtual monster 10 and the percentage of time the first virtual character 20 stays outside the attack range radius within 5 seconds. Based on this, the initial damage value of the first virtual character 20 to the virtual monster 10 = the attribute value of the first virtual character 20 × the attribute calculation coefficient; the damage value of the first virtual character 20 to the virtual monster 10 within 5 seconds = the initial damage value + coefficient 1 × the attribute value of the first virtual character 20 + coefficient 2 × the attribute value of the first virtual character 20 + coefficient 3 × the attribute value of the first virtual character 20, or the damage value of the first virtual character 20 to the virtual monster 10 within 5 seconds = the initial damage value × (coefficient 1 × the attribute value of the first virtual character 20) × (coefficient 2 × the attribute value of the first virtual character 20) × (coefficient 3 × the attribute value of the first virtual character 20).

[0273] Based on this, it is possible to determine the damage values ​​of multiple virtual characters to non-player characters, thereby enabling the determination of the initial attack target of non-player characters and / or the change of attack targets during subsequent battles. Simultaneously, linking damage values ​​to multiple parameters of the virtual characters makes the damage calculation more consistent with the actual combat situation, avoiding simplistic judgments caused by a single parameter, increasing the difficulty of interaction between multiple players and non-player characters, and thus indirectly enhancing the enjoyment of players participating in the virtual game.

[0274] Step 840: Control a non-player character to attack the first virtual character.

[0275] According to step 820, after determining the first virtual character, the server can control a non-player character to launch an attack. Based on this, a screen showing the non-player character attacking the first virtual character can be displayed on the first client.

[0276] Step 860: Based on the damage value of the virtual character to the non-player character, determine the non-player character to change its attack target.

[0277] The target of the attack is at least one of at least two virtual characters that are within the attack range of the non-player character.

[0278] The description of damage values ​​can be found in the preceding content and will not be repeated here.

[0279] In some embodiments, only one non-player character exists, and the virtual world displays one non-player character interacting with at least two virtual characters; in other embodiments, at least two non-player characters exist, and the virtual world displays multiple non-player characters interacting with at least two virtual characters. Therefore, there are multiple scenarios regarding the change of the non-player character's attack target.

[0280] When a non-player character interacts with at least two virtual characters:

[0281] Change Method 1: Change the target based on the damage value, changing the virtual character corresponding to the maximum damage value to a new non-player character's attack target.

[0282] Method 2: Change based on the difference between damage values. If the difference between the damage values ​​of multiple virtual characters to non-player characters is less than the first threshold, change the attack target of the non-player characters.

[0283] Change Method 3: Based on the number of virtual characters within the attack range, when the number of virtual characters within the attack range of a non-player character exceeds a preset second threshold, the change target of the non-player character will be changed to at least two virtual characters within the attack range.

[0284] When multiple non-player characters interact with at least two virtual characters:

[0285] Optionally, the attack target change for the first non-player character can still refer to the three change methods mentioned above; or, after determining the initial attack target, the first non-player character can continue to change the attack target, only changing the attack target of the second non-player character. The second non-player character can be implemented as a companion character to the first non-player character, or as an independent character distinct from the first non-player character.

[0286] When dealing with companion characters, the target of the second non-player character can still be determined based on the magnitude of the damage, the degree of difference in damage values, and the number of virtual characters within the attack range. However, when dealing with independent characters distinct from the first non-player character, a comprehensive judgment can be made by combining the damage values ​​and attack ranges of both non-player characters.

[0287] It should be noted that the various ways in which the attack targets of one or more non-player characters can be changed can be referred to the multiple embodiments given above, and will not be repeated here.

[0288] In summary, the non-player character control method provided in this embodiment enables the server to calculate the damage values ​​of multiple virtual characters to the non-player character, thereby changing the non-player character's attack target in real time. This improves the flexibility of the non-player character, allowing its reactions to multi-player hunts to be more dynamic and varied, rather than always attacking a single target, thus aligning with players' expectations of a realistic hunting experience.

[0289] Furthermore, the ability to form teams with multiple non-player characters creates a cooperative fighting force, and the varied reactions of these characters during multi-player hunts. For the player, this essentially grants these non-player characters strategic thinking abilities, increasing their flexibility and providing a more immersive hunting experience in the virtual world.

[0290] Figure 12 shows an overall flowchart of a non-player character control method provided in an exemplary embodiment of this application. The executing entities for each step of the method include at least the following in the computer system shown in Figure 1: a first terminal device 110 or a first client on the first terminal device 110, a server 120, and a second terminal device 130 or a second client on the second terminal device 130. The first account logged in on the first client is used to control the first virtual character, and the second account logged in on the second client is used to control the second virtual character. The steps of the method are as follows:

[0291] Step 1: Display non-player characters in the virtual world based on the displays of the first and second clients;

[0292] Step 2: The first client and the second client respectively report the association information of the virtual character to the server. The association information of the virtual character includes, but is not limited to, the location, ID, and faction identifier of the virtual character. The association information is used to determine the location of the virtual character in the virtual world and other related information.

[0293] Step 3: The server determines the initial attack target of the non-player character and controls the non-player character to launch an attack. The initial attack target is the first virtual character.

[0294] Step 4: The server sends attack instructions from non-player characters to the first client and the second client respectively, indicating the attack method and intensity of the non-player characters' attacks on the first virtual character.

[0295] Step 5: Display the attack on the first virtual character by a non-player character on the screens of the first and second clients;

[0296] Step 6: The first client and the second client respectively report the i-th control instruction to the server. The i-th control instruction is used to instruct the i-th client to control the i-th virtual character. i is 1 or 2. The control instruction is used to implement the operation control of the virtual character by different accounts.

[0297] Step 7: The server calculates the damage value of the i-th virtual character to the non-player character and determines whether to change the non-player character's attack target;

[0298] Step 8: The server sends the attack targets (non-player characters) to the first client and the second client respectively;

[0299] Step 9: Based on the displays of the first client and the second client, change the attack target of the non-player character, including two methods: cancel the non-player character's attack on the first virtual character and display the non-player character attacking the second virtual character; or, cancel the non-player character's attack on the first virtual character and display the non-player character attacking at least two virtual characters.

[0300] Step 10: The server, the first client, and the second client interact to update the damage value of each virtual character to non-player characters in real time, and cyclically determine whether to change the attack target of the non-player character based on the damage value.

[0301] The determination of the initial attack target of non-player characters, the calculation of damage value, and the method of changing the attack target of non-player characters can all be referred to in the previous text, and will not be repeated here.

[0302] Based on the multi-terminal interaction provided in this embodiment, the control method for non-player characters mentioned above can be implemented. The attack target of the non-player character can be changed in real time according to the damage values ​​inflicted by multiple virtual characters. This improves the flexibility of the non-player character, making their reactions more vivid and varied during multi-player hunts, rather than fixedly attacking a single target. This aligns with players' imagination of a realistic hunting experience and provides players with an immersive hunting experience in the virtual world.

[0303] Figure 13 shows a flowchart of a non-player character control method provided in an exemplary embodiment of this application. Taking the non-player character as a virtual monster as an example, the method includes the following steps:

[0304] Step 131: The virtual monster determines whether the characters within its attack range belong to the opposing faction.

[0305] It should be understood that, for virtual monsters, all existing virtual characters controlled by the player belong to the opposing faction of the virtual monsters. At this time, if there is a character belonging to the opposing faction (i.e., there is at least one virtual character), then step 132 is executed; if there is no virtual character that meets the judgment requirements, then the victory and / or taunt logic is executed, and step 131 is executed again.

[0306] Step 132: Add virtual characters belonging to the opposing faction to the initial list.

[0307] The initial list is in a loop, and steps 1321 and 1322 are executed in real time, as follows:

[0308] Step 1321: Update the list in real time;

[0309] Step 1322: Continuously calculate the damage value of each virtual character in the list to the virtual monster.

[0310] Step 1321 is equivalent to monitoring the addition and deletion of virtual characters in the initial list in real time, realizing the function of removing / adding virtual characters in the initial list in real time; Step 1322 can be implemented as calculating the damage value of virtual characters in the initial list cyclically within a preset period, which can be implemented as a real-time scoring system.

[0311] Step 133: Determine whether each virtual character in the initial list belongs to the ignore list.

[0312] The description of the ignore list can be found in the preceding content and will not be repeated here. At this point, if the item is not in the ignore list, proceed to step 134; if it is in the ignore list, proceed to step 136.

[0313] Step 134: Add virtual characters that are not in the ignore list to the cyclically updated candidate list.

[0314] Step 135: Select the virtual character corresponding to the maximum damage value from the candidate list.

[0315] Step 136: Determine whether the virtual character in the ignore list is the only attackable target within the attack range.

[0316] The description of the unique attackable target can be found in the previous content and will not be repeated here. At this point, if it is the unique attackable target, proceed to step 137; otherwise, return to step 133 to continue determining whether other virtual characters in the initial list belong to the ignore list.

[0317] Step 137: Set the virtual monster's attack target.

[0318] For example, according to steps 135 and 137, the virtual character corresponding to the unique attackable object or the maximum damage value can be identified as the attack target of the virtual monster.

[0319] Step 138: Determine if the conditions for switching targets to virtual monsters are met.

[0320] The target switching condition can be considered as one or more of the methods for changing the attack target of the virtual monster given in the aforementioned embodiments. At this time, if the target switching condition is met, step 139 is executed; if it is not met, the process returns to step 137 to wait for the selection of an attack target again.

[0321] Step 139: Modify the virtual monster's attack target.

[0322] In some embodiments, steps 131-139 above can also be implemented as follows:

[0323] 1: The virtual monster begins to determine which faction the characters on the field belong to;

[0324] 2: Add the target of hatred (which can be understood as a candidate target of virtual monsters) to the lock list (equivalent to the initial list mentioned above). The program provides the function of creating an independent list for each NPC and performing multi-period cumulative calculation of target values ​​(relative to the damage value mentioned above) for multiple target NPCs. The planner can perform operations such as registering / unregistering NPCs in this list, inputting NPC calculation values, and obtaining NPC target value results;

[0325] 3: The real-time scoring system continuously calculates the aggro values ​​of all targets in the locked list over a certain period of time;

[0326] 4. Monitor the increase in targets and add or remove relevant hate targets in real time;

[0327] 5: Hate targets refresh cyclically;

[0328] 6: Determine whether the target of hatred in the locked list belongs to the ignore list. If not, add it to the locked list 2 (relative to the candidate list mentioned above). Then, attack the target of hatred in the locked list 2.

[0329] 7: If it is in the ignore list, check if the list is unique; otherwise, list it as an attack target.

[0330] 8: The cycle of conditions and scores determines whether the virtual monster attacks other aggro targets based on whether the target-switching condition is activated;

[0331] 9: After a monster switches targets, the target value can be modified immediately for the target player / non-target player (which can be understood as multiple virtual characters existing in the virtual world);

[0332] 10: If a player who was the target of aggro before switching targets becomes a dying target, they will definitely not become the target of aggro again.

[0333] For example, the relevant program behavior requirements for modifying and calculating the target value are as follows:

[0334] (1) Create a hate calculation list (equivalent to the initial list mentioned above).

[0335] Parameter 1 int: The NPC ID to which the hatred list belongs;

[0336] Parameter 2 int2: The IDs of the hatred calculation list are stored in a dictionary.

[0337] Parameter 3 int: Target value calculation type 1: accumulation; Target value calculation type 2: multiplication;

[0338] Parameter 4float: Target value calculation interval.

[0339] (2) Add a hate calculation NPC.

[0340] Parameter 1 int: Parameter 2 type 1: NPC ID to which the aggro list belongs; 2: ID of the aggro calculation list;

[0341] Parameter 2 int: NPC ID to which the aggro list belongs / aggro calculation list ID;

[0342] Parameter 3 int2: NPCID;

[0343] Parameter 4 float: Initial value of the target (equivalent to the attribute value of the virtual character mentioned earlier);

[0344] Parameter 5 float: Target value calculation coefficient (equivalent to the attribute calculation coefficient of the virtual character mentioned above).

[0345] (3) Set up NPC aggro calculation (equivalent to the damage value calculation mentioned above).

[0346] Parameter 1 int: Parameter 2 type 1: NPC ID to which the aggro list belongs; 2: ID of the aggro calculation list;

[0347] Parameter 2 int: NPC ID to which the aggro list belongs / aggro calculation list ID;

[0348] Parameter 3 int2: NPCID;

[0349] Parameter 4 float: Target value calculation coefficient (-1 remains unchanged, which can be understood as one or more coefficients related to the damage change value mentioned above);

[0350] Parameter 5 float: Change in the target value calculation coefficient;

[0351] Parameter 6 float: Target value change (equivalent to the damage change value mentioned above).

[0352] (4) Obtain the target value of the NPC with hatred.

[0353] Parameter 1 int: Parameter 2 type 1: NPC ID to which the aggro list belongs; 2: ID of the aggro calculation list;

[0354] Parameter 2 int: NPC ID to which the aggro list belongs / aggro calculation list ID;

[0355] Parameter 3 int2: NPCID;

[0356] Parameter 4int2: The dictionary storing the current calculated coefficients of the target NPC.

[0357] Parameter 5 int2: Target NPC target value, current value stored in a dictionary.

[0358] (5) Support for splitting functional behavior types.

[0359] Optionally, all aggro targets (equivalent to the candidate virtual characters mentioned earlier) can be scored cumulatively, prioritizing attacks on players with worse battlefield performance. It's important to understand that in one possible scenario, the player with the worst battlefield performance might become the greatest threat to non-player characters, in which case the non-player characters will prioritize attacking that player.

[0360] In some embodiments, the base target value calculation parameters (equivalent to one or more coefficients related to the damage change value mentioned above) are determined with reference to the following table:

[0361] Calculation method: cumulative summation, minimum value is 0;

[0362] Initial value for target calculation: -5;

[0363] Target value calculation interval: 1 second.

[0364] Referring to the table above, please supplement the following functional behavior types:

[0365] A. NPC average health cycle variation coefficient (equivalent to the health variation coefficient mentioned above).

[0366] Parameter 1 (bool): 1: Returns success, 0: No return;

[0367] Parameter 2 int: Target NPCID;

[0368] Parameter 3 float: The time when the returned behavior tree begins;

[0369] Parameter 4int2: The dictionary value containing the change value between the current period and the previous week;

[0370] Parameter 5 string: Calculation formula (y: dependent variable -- returns the coefficient of change, x: independent variable -- the percentage change in average blood volume within the time period), for example: y = -1000*x + 110;

[0371] Parameter 6 float: Returns the time period (seconds);

[0372] Parameter 7 float: Calculation formula for sampling frequency (times / second).

[0373] B. NPC hit count period variation coefficient (equivalent to the hit count coefficient mentioned above).

[0374] Parameter 1 (bool): 1: Returns success, 0: No return;

[0375] Parameter 2 int: Target NPCID;

[0376] Parameter 3 float: The time when the returned behavior tree begins;

[0377] Parameter 4int2: The dictionary value containing the change value between the current period and the previous week;

[0378] Parameter 5 string: Calculation formula (y: dependent variable -- returns the coefficient of change, x: independent variable -- number of hits), for example: y = x + 1;

[0379] Parameter 6 float: Returns the time period (seconds).

[0380] C. NPC's dwell time outside attack range period variation coefficient (equivalent to the dwell time coefficient mentioned above).

[0381] Parameter 1 (bool): 1: Returns success, 0: No return;

[0382] Parameter 2 int: Target NPCID;

[0383] Parameter 3 float: The time when the returned behavior tree begins;

[0384] Parameter 4int2: The dictionary value containing the change value between the current period and the previous week;

[0385] Parameter 5 float: Range radius;

[0386] Parameter 5 string: Calculation formula (y: dependent variable -- returns the coefficient of change, x: independent variable -- the percentage of time spent outside the attack range within the time period), for example: y = 10x + 1;

[0387] Parameter 6 float: Returns the time period (seconds);

[0388] Parameter 7 float: Position sampling frequency (times / second).

[0389] It should be understood that the above content is only an exemplary example of this application and does not limit the scope of protection of this application. Other implementation methods that can determine whether to change the attack target of a non-player character by calculating the damage value of a virtual character to a non-player character are all within the scope of protection of this application, and will not be listed in detail.

[0390] Figure 14 shows a structural block diagram of a control device for a non-player character according to an embodiment of this application. The device has the function of implementing the above-described example of a control method for a non-player character; the function can be implemented by hardware or by hardware executing corresponding software. The device can be the first client described above, or it can be located within the first client. As shown in Figure 14, the device includes:

[0391] Display module 1420 is used to display non-player characters in a virtual world;

[0392] Display module 1420 is also used to display a non-player character attacking a first virtual character, the first virtual character being one of at least two virtual characters within the non-player character's attack range;

[0393] The determination module 1440 is used to determine the attack target of the non-player character based on the damage value of the virtual character to the non-player character. The attack target is at least one of at least two virtual characters.

[0394] In some embodiments, the determining module 1440 is used to change the attack target of a non-player character from a first virtual character to a second virtual character based on the first damage value being less than a second damage value; wherein the first damage value is the damage value of the first virtual character to the non-player character, the second damage value is the damage value of the second virtual character to the non-player character, and the second virtual character is another virtual character that is different from the first virtual character among at least two virtual characters.

[0395] In some embodiments, the determining module 1440 is used to change the attack target of the non-player character from the first virtual character to the first virtual character and the third virtual character based on the fact that the difference between the first damage value and the third damage value is less than a first threshold; wherein, the first damage value is the damage value of the first virtual character to the non-player character, the third damage value is the damage value of the third virtual character to the non-player character, and the third virtual character is a plurality of at least two virtual characters that are different from the first virtual character.

[0396] In some embodiments, the determining module 1440 is further configured to, when the number of virtual characters appearing within the attack range of a non-player character exceeds a second threshold, change the attack target of the non-player character from the first virtual character to multiple virtual characters within the attack range of the non-player character.

[0397] In some embodiments, the display module 1420 is further configured to display a non-player character continuously attacking a first virtual character when the continuous attack conditions are met. The continuous attack conditions include at least one of the following conditions: the first damage value is not less than the second damage value; the difference between the first damage value and the third damage value is not less than the first threshold, and the first damage value is greater than the third damage value; the number of virtual characters appearing within the attack range of the non-player character does not exceed the second threshold.

[0398] In some embodiments, the non-player character includes a first non-player character and a second non-player character. The determining module 1440 is used to determine the attack target of the first non-player character and / or the second non-player character based on the damage value of the virtual character to the first non-player character.

[0399] In some embodiments, the second non-player character is a companion character of the first non-player character. The determining module 1440 is used to change the attack target of the second non-player character from the first virtual character to the fourth virtual character based on the fourth damage value being less than the fifth damage value; or, based on the difference between the fourth damage value and the fifth damage value being less than a third threshold, change the attack target of the second non-player character from the first virtual character to both the first virtual character and the fourth virtual character; wherein, the fourth damage value is the damage value of the first virtual character to the first non-player character, the fifth damage value is the damage value of the fourth virtual character to the first non-player character, and the fourth virtual character is one or more other virtual characters that are different from the first virtual character among at least two virtual characters.

[0400] In some embodiments, the determining module 1440 is further configured to, if the number of virtual characters appearing within the attack range of the first non-player character exceeds a fourth threshold, change the attack target of the second non-player character from the first virtual character to two or more virtual characters within the attack range of the first non-player character.

[0401] In some embodiments, the determining module 1440 is configured to change the attack target of the second non-player character from the first virtual character to the fifth virtual character based on the fourth damage value being less than the sixth damage value; wherein the fourth damage value is the damage value of the first virtual character to the first non-player character, the sixth damage value is the damage value of the fifth virtual character to the first non-player character, and the fifth virtual character is a virtual character located outside the attack range of the first non-player character but within the attack range of the second non-player character, or the fifth virtual character is a virtual character located outside the attack range of the first non-player character and whose distance from the second non-player character is less than a distance threshold.

[0402] In some embodiments, the determining module 1440 is used to change the attack target of the second non-player character from the first virtual character to the sixth virtual character based on the fact that the difference between the fourth damage value and the seventh damage value is greater than a fifth threshold, and the difference between the attack power of the first non-player character and the second non-player character is greater than a sixth threshold; wherein the fourth damage value is the damage value of the first virtual character to the first non-player character, the seventh damage value is the damage value of the sixth virtual character to the first non-player character, the fourth damage value is less than the seventh damage value, and the attack power of the second non-player character is greater than the attack power of the first non-player character.

[0403] In some embodiments, the damage value is determined based on at least one of the following: the change in the virtual character's health over a preset period; the number of times the virtual character is attacked by a non-player character over a preset period; the duration the virtual character stays outside the attack range of a non-player character over a preset period; and the attributes of the virtual character.

[0404] Figure 15 shows a structural block diagram of a control device for a non-player character according to an embodiment of this application. This device has the function of implementing the above-described example of a control method for a non-player character; the function can be implemented by hardware or by hardware executing corresponding software. This device can be the server described above, or it can be located within a server. As shown in Figure 15, the device includes:

[0405] The determination module 1520 is used to determine the first virtual character, which is one of at least two virtual characters in the virtual world that are within the attack range of a non-player character;

[0406] Control module 1540 is used to control non-player characters to attack the first virtual character;

[0407] The control module 1540 is also used to determine the target of the non-player character's attack based on the damage value of the virtual character to the non-player character, wherein the target of the attack is at least one of at least two virtual characters.

[0408] In some embodiments, the determining module 1520 is used to determine a candidate list, wherein one or more candidate virtual characters in the candidate list are within the attack range of a non-player character; calculate the damage value of one or more candidate virtual characters to a non-player character, and determine the candidate virtual character corresponding to the maximum damage value as the first virtual character.

[0409] In some embodiments, the determining module 1520 is further configured to determine the unique attackable object as the first virtual character when there is a unique attackable object within the attack range of a non-player character.

[0410] In some embodiments, the determining module 1520 is further configured to determine the damage value of the virtual character to the non-player character, including: determining one or more damage change values, the one or more damage change values ​​being used to indicate the damage value of the virtual character to the non-player character within a preset period; and determining the damage value of the virtual character to the non-player character within a preset period based on the one or more damage change values ​​and the initial damage value of the virtual character.

[0411] It should be noted that the specific limitations of the embodiments of the control device for one or more non-player characters provided above can be found in the limitations of the control method for non-player characters above, and will not be repeated here. Each module of the above device can be implemented entirely or partially through software, hardware, or a combination thereof. Each module can be embedded in the processor of the computer device in hardware form or independent of the processor of the computer device, or it can be stored in the memory of the computer device in software form, so that the processor can call and execute the corresponding operations of each module.

[0412] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0413] Figure 16 shows a structural block diagram of a computer device 1600 provided in an exemplary embodiment of this application. The computer device 1600 may be a portable mobile terminal, such as a smartphone, tablet computer, MP3 player (Moving Picture Experts Group Audio Layer III), or MP4 player (Moving Picture Experts Group Audio Layer IV). The computer device 1600 may also be referred to as a user device, portable terminal, or other names. Typically, the computer device 1600 includes a processor 1601 and a memory 1602.

[0414] Processor 1601 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. Processor 1601 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field Programmable Gate Array), and PLA (Programmable Logic Array). Processor 1601 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 1601 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content required to be displayed on the screen. In some embodiments, processor 1601 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.

[0415] Memory 1602 may include one or more computer-readable storage media, which may be tangible and non-transitory. Memory 1602 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in memory 1602 is used to store at least one instruction, which is executed by processor 1601 to implement the non-player character control method provided in the embodiments of this application.

[0416] In some embodiments, the computer device 1600 may optionally include a peripheral device interface 1603 and at least one peripheral device. The processor 1601, memory 1602, and peripheral device interface 1603 can be connected via a bus or signal line. Each peripheral device can be connected to the peripheral device interface 1603 via a bus, signal line, or circuit board. Specifically, the peripheral device includes at least one of the following: a radio frequency circuit 1604, a touch display screen 1605, a camera assembly 1606, an audio circuit 1607, and a power supply 1608.

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

[0418] The radio frequency (RF) circuit 1604 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The RF circuit 1604 communicates with communication networks and other communication devices via electromagnetic signals. The RF circuit 1604 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals back into electrical signals. Optionally, the RF circuit 1604 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, etc. The RF circuit 1604 can communicate with other terminals through at least one wireless communication protocol. This wireless communication protocol includes, but is not limited to: the World Wide Web, metropolitan area networks, intranets, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and / or Wi-Fi (Wireless Fidelity) networks. In some embodiments, the RF circuit 1604 may also include circuitry related to NFC (Near Field Communication), which is not limited in this application.

[0419] The touch display screen 1605 is used to display a UI (User Interface). This UI may include graphics, text, icons, videos, and any combination thereof. The touch display screen 1605 also has the ability to collect touch signals on or above its surface. These touch signals can be input as control signals to the processor 1601 for processing. The touch display screen 1605 is used to provide virtual buttons and / or a virtual keyboard, also known as soft buttons and / or a soft keyboard. In some embodiments, there may be one touch display screen 1605, located on the front panel of the computer device 1600; in other embodiments, there may be at least two touch display screens, respectively located on different surfaces of the computer device 1600 or in a folded design; in some embodiments, the touch display screen 1605 may be a flexible display screen, located on a curved or folded surface of the computer device 1600. Furthermore, the touch display screen 1605 may be configured as a non-rectangular, irregular shape, i.e., a non-rectangular screen. The touch display screen 1605 may be made of materials such as LCD (Liquid Crystal Display) or OLED (Organic Light-Emitting Diode).

[0420] The camera assembly 1606 is used to acquire images or videos. Optionally, the camera assembly 1606 includes a front-facing camera and a rear-facing camera. Typically, the front-facing camera is used for video calls or selfies, and the rear-facing camera is used for taking photos or videos. In some embodiments, there are at least two rear-facing cameras, which are any one of a main camera, a depth-sensing camera, and a wide-angle camera, to achieve background blurring by fusion of the main camera and the depth-sensing camera, and panoramic shooting and VR shooting by fusion of the main camera and the wide-angle camera. In some embodiments, the camera assembly 1606 may also include a flash. The flash can be a single-color temperature flash or a dual-color temperature flash. A dual-color temperature flash is a combination of a warm-light flash and a cool-light flash, which can be used for light compensation at different color temperatures.

[0421] Audio circuitry 1607 provides an audio interface between the user and computer device 1600. Audio circuitry 1607 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, converting the sound waves into electrical signals that are input to processor 1601 for processing, or input to radio frequency circuitry 1604 for voice communication. For stereo sound acquisition or noise reduction purposes, multiple microphones may be used, each located at a different location on computer device 1600. The microphone may also be an array microphone or an omnidirectional microphone. The speaker is used to convert electrical signals from processor 1601 or radio frequency circuitry 1604 into sound waves. The speaker may be a conventional diaphragm speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can convert electrical signals not only into audible sound waves but also into inaudible sound waves for purposes such as distance measurement. In some embodiments, audio circuitry 1607 may also include a headphone jack.

[0422] Power supply 1608 is used to supply power to the various components in computer device 1600. Power supply 1608 can be AC ​​power, DC power, a disposable battery, or a rechargeable battery. When power supply 1608 includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery that is charged via a wired line, and a wireless rechargeable battery is a battery that is charged via a wireless coil. The rechargeable battery can also be used to support fast charging technology.

[0423] In some embodiments, the computer device 1600 further includes one or more sensors 1609. The one or more sensors 1609 include, but are not limited to, an accelerometer 1610, a gyroscope 1611, a pressure sensor 1612, an optical sensor 1613, and a proximity sensor 1614.

[0424] Accelerometer 1610 can detect the magnitude of acceleration on the three coordinate axes of a coordinate system established by computer device 1600. For example, accelerometer 1610 can be used to detect the components of gravitational acceleration on the three coordinate axes. Processor 1601 can control touch screen 1605 to display the user interface in landscape or portrait view based on the gravitational acceleration signal collected by accelerometer 1610. Accelerometer 1610 can also be used for games or to collect user motion data. Gyroscope 1611 can detect the orientation and rotation angle of computer device 1600. Gyroscope 1611 can work in conjunction with accelerometer 1610 to collect 3D movements of the user on computer device 1600. Based on the data collected by gyroscope 1611, processor 1601 can perform the following functions: motion sensing (e.g., changing the UI based on the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.

[0425] The pressure sensor 1612 can be disposed on the side bezel of the computer device 1600 and / or on the lower layer of the touch display screen 1605. When the pressure sensor 1612 is disposed on the side bezel of the computer device 1600, it can detect the user's grip signal on the computer device 1600 and perform left / right hand recognition or quick operation based on the grip signal. When the pressure sensor 1612 is disposed on the lower layer of the touch display screen 1605, it can control operable controls on the UI interface based on the user's pressure operation on the touch display screen 1605. Operable controls include at least one of button controls, scroll bar controls, icon controls, and menu controls.

[0426] Optical sensor 1613 is used to collect ambient light intensity. In one embodiment, processor 1601 can control the display brightness of touch display screen 1605 based on the ambient light intensity collected by optical sensor 1613. Specifically, when the ambient light intensity is high, the display brightness of touch display screen 1605 is increased; when the ambient light intensity is low, the display brightness of touch display screen 1605 is decreased. In another embodiment, processor 1601 can also dynamically adjust the shooting parameters of camera assembly 1606 based on the ambient light intensity collected by optical sensor 1613.

[0427] The proximity sensor 1614, also known as a distance sensor, is typically located on the front of the computer device 1600. The proximity sensor 1614 is used to detect the distance between the user and the front of the computer device 1600. In one embodiment, when the proximity sensor 1614 detects that the distance between the user and the front of the computer device 1600 is gradually decreasing, the processor 1601 controls the touchscreen display 1605 to switch from a screen-on state to a screen-off state; when the proximity sensor 1614 detects that the distance between the user and the front of the computer device 1600 is gradually increasing, the processor 1601 controls the touchscreen display 1605 to switch from a screen-off state to a screen-on state.

[0428] Those skilled in the art will understand that the above structure does not constitute a limitation on the computer device 1600, and may include more or fewer components than illustrated, or combine certain components, or employ different component arrangements.

[0429] This application also provides a client for implementing the control methods for non-player characters provided in the above-described method embodiments.

[0430] This application also provides a server for implementing the non-player character control methods provided in the above-described method embodiments.

[0431] This application also provides a computer-readable storage medium storing at least one computer program, which is loaded and executed by a processor to implement the non-player character control method provided in the above-described method embodiments.

[0432] This application also provides a computer program product, which includes at least one computer program stored in a computer-readable storage medium; the at least one computer program is read from and executed by a processor of a computer device from the computer-readable storage medium, causing the computer device to perform the non-player character control method provided in the above-described method embodiments.

[0433] It should be understood that "multiple" as used herein refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. Furthermore, the step numbers described herein are merely illustrative of one possible execution order. In some other embodiments, the steps may not be executed in numerical order, such as two steps with different numbers being executed simultaneously, or two steps with different numbers being executed in the reverse order of the illustration. This application does not limit this.

[0434] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.

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

Claims

1. A method for controlling a non-player character, the method being executed by a first client, the method comprising: Display non-player characters in the virtual world; The non-player character is shown attacking a first virtual character, which is one of at least two virtual characters within the non-player character's attack range; Based on the damage value of the virtual character to the non-player character, the attack target of the non-player character is determined, and the attack target is at least one of the at least two virtual characters.

2. The method according to claim 1, wherein, The step of determining the attack target of the non-player character based on the damage value of the virtual character to the non-player character includes: Based on the fact that the first damage value is less than the second damage value, the attack target of the non-player character is changed from the first virtual character to the second virtual character; Wherein, the first damage value is the damage value of the first virtual character to the non-player character, the second damage value is the damage value of the second virtual character to the non-player character, and the second virtual character is another virtual character that is different from the first virtual character among the at least two virtual characters.

3. The method according to claim 1 or 2, wherein, The step of determining the attack target of the non-player character based on the damage value of the virtual character to the non-player character includes: Based on the fact that the difference between the first damage value and the third damage value is less than the first threshold, the attack target of the non-player character is changed from the first virtual character to both the first virtual character and the third virtual character; Wherein, the first damage value is the damage value of the first virtual character to the non-player character, the third damage value is the damage value of the third virtual character to the non-player character, and the third virtual character is one of the at least two virtual characters that are different from the first virtual character.

4. The method according to any one of claims 1 to 3, wherein, The method further includes: If the number of virtual characters appearing within the attack range of the non-player character exceeds a second threshold, the attack target of the non-player character will be changed from the first virtual character to multiple virtual characters within the attack range of the non-player character.

5. The method according to any one of claims 1 to 4, wherein, The method further includes: Under the condition of continuous attack, the non-player character is shown to be continuously attacking the first virtual character. The continuous attack condition includes at least one of the following conditions: The first damage value is not less than the second damage value, the first damage value is the damage value of the first virtual character to the non-player character, the second damage value is the damage value of the second virtual character to the non-player character, and the second virtual character is another one of the at least two virtual characters that is different from the first virtual character; The difference between the first damage value and the third damage value is not less than the first threshold, and the first damage value is greater than the third damage value. The third damage value is the damage value of the third virtual character to the non-player character. The third virtual character is one of the at least two virtual characters that are different from the first virtual character. The number of virtual characters appearing within the attack range of the non-player character does not exceed the second threshold.

6. The method according to any one of claims 1 to 5, wherein, The non-player characters include a first non-player character and a second non-player character. Determining the attack target of the non-player character based on the damage value inflicted by the virtual character on the non-player character includes: Based on the damage value of the virtual character to the first non-player character, the attack targets of the first non-player character and / or the second non-player character are determined.

7. The method according to claim 6, wherein, The second non-player character is a companion character to the first non-player character. The step of determining the attack target of the first non-player character and / or the second non-player character based on the damage value inflicted on the first non-player character by the virtual character includes: Based on the fact that the fourth damage value is less than the fifth damage value, the attack target of the second non-player character is changed from the first virtual character to the fourth virtual character; Alternatively, based on the fact that the difference between the fourth damage value and the fifth damage value is less than the third threshold, the attack target of the second non-player character is changed from the first virtual character to both the first virtual character and the fourth virtual character; Wherein, the fourth damage value is the damage value of the first virtual character to the first non-player character, the fifth damage value is the damage value of the fourth virtual character to the first non-player character, and the fourth virtual character is one or more other virtual characters that are different from the first virtual character among the at least two virtual characters.

8. The method according to claim 6 or 7, wherein, The method further includes: If the number of virtual characters appearing within the attack range of the first non-player character exceeds the fourth threshold, the attack target of the second non-player character will be changed from the first virtual character to two or more virtual characters within the attack range of the first non-player character.

9. The method according to any one of claims 6 to 8, wherein, The step of determining the attack target of the first non-player character and / or the second non-player character based on the damage value of the virtual character to the first non-player character includes: Based on the fact that the fourth damage value is less than the sixth damage value, the attack target of the second non-player character is changed from the first virtual character to the fifth virtual character; Wherein, the fourth damage value is the damage value of the first virtual character to the first non-player character, the sixth damage value is the damage value of the fifth virtual character to the first non-player character, the fifth virtual character is a virtual character located outside the attack range of the first non-player character but within the attack range of the second non-player character, or the fifth virtual character is a virtual character located outside the attack range of the first non-player character and whose distance from the second non-player character is less than a distance threshold.

10. The method according to any one of claims 6 to 9, wherein, The step of determining the attack target of the first non-player character and / or the second non-player character based on the damage value of the virtual character to the first non-player character includes: Based on the fact that the difference between the fourth damage value and the seventh damage value is greater than the fifth threshold, and the difference between the attack power of the first non-player character and the second non-player character is greater than the sixth threshold, the attack target of the second non-player character is changed from the first virtual character to the sixth virtual character. Wherein, the fourth damage value is the damage value of the first virtual character to the first non-player character, the seventh damage value is the damage value of the sixth virtual character to the first non-player character, the fourth damage value is less than the seventh damage value, and the attack power of the second non-player character is greater than the attack power of the first non-player character.

11. The method according to any one of claims 1 to 10, wherein, The damage value is determined based on at least one of the following: The change in the virtual character's health within a preset period; The number of times the virtual character is attacked by the non-player character within the preset period; The duration during which the virtual character stays outside the attack range of the non-player character within the preset period; The attributes of the virtual character.

12. A method for controlling a non-player character, the method being executed by a server, the method comprising: Identify a first virtual character, which is one of at least two virtual characters in the virtual world that are within the attack range of a non-player character; Control the non-player character to attack the first virtual character; The attack target of the non-player character is determined based on the damage value of the virtual character to the non-player character, and the attack target is at least one of the at least two virtual characters.

13. The method according to claim 12, wherein, The process of determining the first virtual character includes: A candidate list is determined, wherein one or more candidate virtual characters in the candidate list are within the attack range of the non-player character; Calculate the damage value of the one or more candidate virtual characters to the non-player character, and determine the candidate virtual character corresponding to the maximum damage value as the first virtual character.

14. The method according to claim 12, wherein, The method for determining the first virtual character also includes: If there is a unique attackable target within the attack range of the non-player character, the unique attackable target is identified as the first virtual character.

15. The method according to any one of claims 12 to 14, wherein, The damage value of the virtual character to the non-player character is determined in the following way: Determine one or more damage change values, which are used to indicate the damage value of the virtual character to the non-player character within a preset period; Based on the one or more damage change values ​​and the initial damage value of the virtual character, determine the damage value of the virtual character to the non-player character within the preset period.

16. A control device for a non-player character, the device comprising: The display module is used to display non-player characters in the virtual world; The display module is also used to display the non-player character attacking the first virtual character, wherein the first virtual character is one of at least two virtual characters located within the attack range of the non-player character; The modification module is used to determine the attack target of the non-player character based on the damage value of the virtual character to the non-player character, wherein the attack target is at least one of the at least two virtual characters.

17. A control device for a non-player character, the device comprising: The determination module is used to determine a first virtual character, which is one of at least two virtual characters in the virtual world that are within the attack range of a non-player character; The control module is used to control the non-player character to attack the first virtual character; The control module is further configured to determine the attack target of the non-player character based on the damage value of the virtual character to the non-player character, wherein the attack target is at least one of the at least two virtual characters.

18. A client for implementing a control method for a non-player character as described in any one of claims 1 to 11.

19. A server for implementing a control method for a non-player character as described in any one of claims 12 to 15.

20. A computer storage medium storing at least one computer program, the at least one computer program being loaded and executed by a processor to implement the control method for a non-player character as described in any one of claims 1 to 15.

21. A computer program product comprising a computer program stored in a computer-readable storage medium; the computer program being read from and executed by a processor of a computer device, causing the computer device to perform a control method for a non-player character as described in any one of claims 1 to 15.