Method and apparatus for controlling non-player characters, as well as computer programs

By integrating group and individual control logic to modify state parameters, the method improves NPC interactions in virtual environments, providing more realistic and customizable actions.

JP2026509142APending Publication Date: 2026-03-17TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2024-03-14
Publication Date
2026-03-17

AI Technical Summary

Technical Problem

Conventional NPC action control logic is inadequate for complex scenarios in virtual environments, failing to support nuanced interactions and customization of NPC actions.

Method used

Implementing a method that combines group control logic with individual control logic to modify state parameters of NPCs, allowing for systematic and customizable NPC interactions based on influencing factors and state parameters.

Benefits of technology

Enhances the realism and richness of NPC interactions by enabling more systematic and customizable actions, making interactions between NPCs and virtual characters more engaging and realistic.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2026509142000001_ABST
    Figure 2026509142000001_ABST
Patent Text Reader

Abstract

This application provides a method for controlling non-player characters, and the apparatus, device, medium, and program product thereof, which belong to the computer technology field. The method includes the steps of: acquiring a group control logic and individual control logic for each of a plurality of NPCs (302); modifying state parameters corresponding to at least one NPC in the NPC group by the group control logic in response to influencing factors between a virtual character and a first NPC in the NPC group (304); and updating the interaction status between at least one NPC and the virtual character based on the modified state parameters of at least one NPC and the individual control logic of at least one NPC (306). This application provides an NPC communication scheme based on state parameters, in which NPC groups and individual NPCs communicate via state parameters, thereby more systematizing the action control logic of NPCs and enabling customization of individual control logic according to requirements.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] (Cross-reference to Related Applications) This application claims the priority of a Chinese patent application filed on May 16, 2023, with the application number 202310548686.7 and the title of the invention "Method and Apparatus, Device, Medium, and Program Product for Controlling Non-Player Characters", and all the contents of the Chinese patent application are incorporated herein by reference.

[0002] Embodiments of this application relate to the field of computer technology, and in particular, to a method and apparatus, device, medium, and program product for controlling non-player characters.

Background Art

[0003] In applications based on virtual environments, such as Massive Multi-player Online Games (MMOGs), users can control virtual characters to move within the virtual environment. Furthermore, within the virtual environment, there are also Non-Player Characters (NPCs), and NPCs can interact with the virtual characters controlled by users. For example, an NPC can attack the virtual character controlled by a user, or an NPC can advance the story associated with a quest or assist the user in achieving the quest.

[0004] In the prior art, the action control logic of NPCs is set within a group control logic. One group control logic corresponds to multiple NPCs, and the group control logic issues commands to the individuals of the multiple NPCs, and the multiple NPCs execute actions corresponding to the received commands respectively.

[0005] However, conventional technology is only suitable when the actions of individual NPCs and the conditions for determining those actions are relatively simple, such as the appearance of an NPC. Conventional technology cannot be applied when the actions of individual NPCs and the conditions for determining those actions are relatively complex, such as in a complex action game. [Overview of the project] [Problems that the invention aims to solve]

[0006] This application provides a method for controlling non-player characters, and the apparatus, device, medium, and program product thereof, the technical solution being as follows. [Means for solving the problem]

[0007] According to one aspect of the present application, a method for controlling a non-player character is provided, the method is: A step of obtaining a group control logic and individual control logic for each of several NPCs, wherein the group control logic is a control logic corresponding to an NPC group, and the NPC group includes multiple NPCs, The steps include: modifying a state parameter corresponding to at least one NPC in an NPC group by group control logic in response to influencing factors between a virtual character and the first NPC in the NPC group; The process includes the step of updating the interaction status between at least one NPC and a virtual character based on state parameters corresponding to at least one modified NPC and individual control logic for at least one NPC.

[0008] According to another aspect of the present application, a control device for a non-player character is provided, the device is An acquisition module configured to acquire group control logic and individual control logic for multiple NPCs, wherein the group control logic is control logic corresponding to an NPC group, and the NPC group includes multiple NPCs, and the acquisition module... A control module configured to modify state parameters corresponding to at least one NPC within an NPC group by group control logic in response to influencing factors between a virtual character and the first NPC within the NPC group, The system includes an update module configured to update the interaction status between at least one NPC and a virtual character based on state parameters corresponding to at least one modified NPC and individual control logic for at least one NPC.

[0009] According to another aspect of the present invention, a computer device is provided comprising a processor and memory, wherein the memory stores at least one computer program, and the processor loads and executes at least one computer program to realize the method for controlling a non-player character described in the above aspect.

[0010] According to another aspect of the present invention, a computer-readable storage medium is provided which stores at least one computer program that is loaded and executed by a processor to enable the processor to implement the control method for non-player characters described in the above aspect.

[0011] According to another aspect of the present application, a computer program product is provided, the computer program product includes a computer program stored in a computer-readable storage medium, the computer program is read from the computer-readable storage medium and executed by the processor of a computer device, causing the computer device to execute the non-player character control method described in the above aspect. [Effects of the Invention]

[0012] The technical solution provided in this application may include the following beneficial effects.

[0013] This invention modifies the state parameters of NPCs within a group using group control logic, and then updates the interaction status with the virtual character by combining these with the state parameters of each NPC using their own individual control logic. This invention provides an NPC communication scheme based on state parameters, where communication between NPC groups and individual NPCs occurs via state parameters. The NPC action control logic is mainly placed on the individual control logic, and only the switching of state parameters is performed by the group control logic, thus making the NPC action control logic more systematic. Furthermore, this invention supports customization of NPC actions in different states (state parameters), and since the individual control logic of each NPC can be customized as needed, the interaction activities between NPCs and virtual characters become richer and more realistic. [Brief explanation of the drawing]

[0014] [Figure 1] This is a schematic diagram of a method for controlling non-player characters according to one exemplary embodiment of the present invention. [Figure 2] This is a schematic diagram of the architecture of a computer system according to one exemplary embodiment of the present invention. [Figure 3] This is a flowchart of a method for controlling a non-player character according to one exemplary embodiment of the present invention. [Figure 4] This is a flowchart of a method for controlling a non-player character according to one exemplary embodiment of the present invention. [Figure 5] This is a schematic diagram illustrating the relationship between individual control logic and collective control logic according to one exemplary embodiment of the present invention. [Figure 6] This is a schematic diagram of virtual character and NPC interaction operation according to one exemplary embodiment of the present invention. [Figure 7] This is a flowchart of a method for controlling a non-player character according to one exemplary embodiment of the present invention. [Figure 8] This is a flowchart of a method for controlling a non-player character according to one exemplary embodiment of the present invention. [Figure 9] Schematic diagram of virtual character and NPC interaction operations according to one exemplary embodiment of the present application. [Figure 10] Flowchart of a method for controlling an NPC according to one exemplary embodiment of the present application. [Figure 11] Flowchart of a method for controlling an individual NPC according to one exemplary embodiment of the present application. [Figure 12] Flowchart of a method for controlling an NPC according to one exemplary embodiment of the present application. [Figure 13] Flowchart of a method for controlling an NPC according to one exemplary embodiment of the present application. [Figure 14] Block diagram of a control device for a non-player character according to one exemplary embodiment of the present application. [Figure 15] Exemplary structural diagram of a computer device according to an exemplary embodiment of the present application.

Modes for Carrying Out the Invention

[0016] A virtual character refers to an active character in a virtual environment, which may be a virtual person, virtual animal, anime character, etc. For example, it may be a person, animal, plant, wall, stone, pond, etc., displayed in the virtual environment. Virtual characters are controlled by the user, and may be classified by occupation such as pharmacist, magician, medical professional, etc., or by type such as human, beast, immortal human, etc. Each virtual character has its own shape and volume within the virtual environment and occupies a portion of the space within the virtual environment.

[0017] A multiplayer online game (MMOG) refers to a game where a large number of players can play online simultaneously on a game server. Also known as a Massive Multi-Player Online Role-Playing Game (MMORPG), MMOGs provide users with a virtual world in which they can create and control virtual characters to perform corresponding activities and complete quests. Virtual characters controlled by multiple users can form teams to complete the same quests together or compete against other teams.

[0018] Non-player characters (NPCs) refer to virtual characters in a game that are not controlled by the user. NPCs are virtual characters that have their own action patterns. Types of NPCs include story NPCs, combat NPCs, and service NPCs. Story NPCs are NPCs that provide storylines and information to the user-controlled virtual character. When the user-controlled virtual character performs a quest in the game, that quest is accompanied by a corresponding storyline. Optionally, depending on the user's interaction and actions with the story NPC, the NPC can provide different feedback, such as dropping virtual items, providing information, or issuing new quests. Combat NPCs are NPCs that can fight against the user-controlled virtual character. Combat NPCs may be virtual characters belonging to the same team as the user-controlled virtual character, or they may be NPCs that the user-controlled virtual character needs to attack (i.e., enemy NPCs). A service NPC refers to an NPC that provides services to a user-controlled virtual character. For example, service NPCs are merchant virtual characters, leader virtual characters, etc., within a virtual environment. Optionally, these types of NPCs perform fixed actions or issue fixed information, and the user-controlled virtual character receives the service from the service NPC to obtain corresponding information, items, or experience points.

[0019] Embodiments of the present invention provide schematic diagrams of a method for controlling non-player characters, which, as shown in Figure 1, may be performed by computer equipment, which may be a terminal or a server.

[0020] Exemplary, as shown in part (a) of Figure 1, the user interface displays a game interface, which includes a virtual character 10 and multiple NPCs. The computer device acquires group control logic and individual control logic for each of the multiple NPCs, where the group control logic is the control logic corresponding to the NPC group, the NPC group includes multiple NPCs, and the control logic refers to the code logic that controls the NPC's behavior. In response to an interaction operation between the virtual character 10 and the first NPC in the NPC group, the computer device modifies a state parameter corresponding to at least one NPC in the NPC group using the group control logic, and the computer device updates the interaction status between at least one NPC and the virtual character based on the modified state parameter corresponding to at least one NPC and the individual control logic of at least one NPC.

[0021] An NPC has a specific image, and may be an NPC with the image of a person, an NPC with the image of an animal, an NPC with the image of a mythical beast or a fairy, or an NPC with the image of a natural landscape, or an NPC with the image of an artificial landscape, but is not limited to these, and the embodiments of this application are not specifically limited to these. Multiple NPCs belong to the same NPC group.

[0022] Optionally, interaction operations include, but are not limited to, at least one of the following: general attack, defense, activation of special moves, text chat, voice chat, and gift giving. The embodiments of this application are not specifically limited to these.

[0023] State parameters are used to indicate the state of an NPC in its virtual environment. Optionally, state parameters include, but are not limited to, parameters for describing at least one state: active state, idle state, or other state. The embodiments of this application are not specifically limited to these.

[0024] In some embodiments, the active state refers to a state in which the NPC can actively interact with the virtual character 10. For example, the NPC can actively attack the virtual character 10. The idle state refers to a state in which the NPC cannot actively interact with the virtual character 10. For example, the NPC passes by the virtual character 10 but does not interact with it.

[0025] In some embodiments, the active state refers to the state when an NPC interacts with virtual character 10 by activating a special attack class skill. For example, an NPC can attack virtual character 10 by activating a special attack class skill. A special attack class skill refers to a skill with a higher attack value and a larger attack range. The idle state refers to the state when an NPC interacts with virtual character 10 by activating a general attack class skill.

[0026] Optionally, taking the state of an NPC during combat as an example, the active state includes the attacked state and the attacking state. The attacked state refers to the state when an NPC is hit by a special move-class skill activated by a virtual character, and the attacking state refers to the state when an NPC activates a special move-class skill against a virtual character.

[0027] For example, in response to the virtual character 10 and the first NPC entering an interactive scenario (also called an "interaction scenario" or "interaction situation"), the computer device modifies the initial state parameters corresponding to at least one NPC within the NPC group using group control logic.

[0028] Initial state parameters refer to the default state parameters that NPCs in an NPC group use when they start a match.

[0029] For example, as shown in part (a) of Figure 1, the multiple NPCs include NPC 1, NPC 2, and NPC 3, NPC 1, NPC 2, and NPC 3 belong to the same NPC group, and the default state of NPC 1, NPC 2, and NPC 3 at the start of a match is a waiting state, meaning that NPC 1, NPC 2, and NPC 3 do not actively attack the virtual character 10.

[0030] For example, if virtual character 10 attacks the first NPC, or if the virtual character enters the first NPC's line of sight, the computer equipment modifies the initial state parameters corresponding to at least one NPC within the NPC group using group control logic.

[0031] The field of view refers to, but is not limited to, a sector-shaped area with the NPC's position as its center, a circular area with the NPC's position as its center, a regular geometric area centered on the NPC's position, or an irregular geometric area centered on the NPC's position. The embodiments of this application are not specifically limited to these. The size of the field of view is not specifically limited.

[0032] As shown in part (b) of Figure 1, when the virtual character 10 enters the field of view of NPC 2, the computer device modifies the initial state parameters for NPC 1, NPC 2, and NPC 3 using collective control logic, changing NPC 2 from a standby state to an active state, while NPC 1 and NPC 3 remain in a standby state. Then, based on the state parameters and individual control logic corresponding to each of NPC 1, NPC 2, and NPC 3, the computer device updates the interaction status between NPC 1, NPC 2, and NPC 3 and the virtual character 10. Specifically, NPC 2 actively attacks the virtual character 10, and NPC 1 and NPC 3 walk away.

[0033] In some embodiments, the computer device, in response to the duration of the interaction between the virtual character 10 and the first NPC reaching a time threshold, modifies the state parameter of the first NPC from active to standby and modifies the state parameter of the second NPC from standby to active using collective control logic.

[0034] For example, if an NPC group includes NPC 1, NPC 2, and NPC 3, and the combat duration between virtual character 10 and NPC 2 reaches 20 seconds, the computer equipment modifies the state parameters of NPC 1, NPC 2, and NPC 3 according to the group control logic. For example, the state parameter of NPC 2 is changed from active to idle, and the state parameters of NPC 1 and NPC 3 are changed from idle to active. That is, after the combat duration between virtual character 10 and NPC 2 reaches 20 seconds, NPC 2 does not continue fighting virtual character 10, NPC 2 leaves virtual character 10, and instead NPC 1 and NPC 3 begin fighting virtual character 10.

[0035] In some embodiments, the computer device, in response to the sum of the operation scores of the interaction operations between the first NPC and the virtual character 10 reaching a score threshold, modifies the state parameter of the first NPC from the active state to the standby state and modifies the state parameter of the second NPC from the standby state to the active state using collective control logic.

[0036] For example, if an NPC group includes NPC 1, NPC 2, and NPC 3, and virtual character 10 is fighting NPC 1, then NPC 1's score increases by 5 each time NPC 1 uses a special move, and when the score reaches 15, the computer equipment modifies the state parameters of NPC 1, NPC 2, and NPC 3 according to the group control logic. This modifies NPC 1's state parameter from active to standby, and NPC 2 and NPC 3's state parameters from standby to active. In other words, after NPC 1 uses a special move three times during the fight between virtual character 10 and NPC 1, NPC 1 will not continue fighting virtual character 10, will leave virtual character 10, and instead NPC 2 and NPC 3 will begin fighting virtual character 10.

[0037] In some embodiments, the relationship between the first NPC and the third NPC within an NPC group is obtained. If the first NPC and the third NPC have a positive relationship, the group control logic corrects the state parameters of the first NPC and the third NPC to a matching state. If the first NPC and the third NPC have a negative relationship, the group control logic corrects the state parameters of the first NPC and the third NPC to a conflicting state.

[0038] A positive relationship refers to a relationship in which the actions of at least two NPCs within the same NPC group align. In short, a positive relationship is a relationship in which the actions of NPCs are aligned.

[0039] A negative relationship refers to a relationship in which the actions of at least two NPCs within the same NPC group are in opposition to each other. In short, a negative relationship is a relationship in which the actions of NPCs are in opposition to each other.

[0040] For example, a group of NPCs may include NPC 1, NPC 2, and NPC 3, with NPC 1 and NPC 2 having an active relationship, and NPC 2 and NPC 3 having a passive relationship. Assuming that NPC 1, NPC 2, and NPC 3 are all active, and virtual character 10 engages in combat with NPC 2, the computer system modifies the state parameters of NPC 1, NPC 2, and NPC 3 according to the group control logic. Because NPC 1 and NPC 2 have an active relationship, NPC 1's state is maintained in an active state, and NPC 1 also participates in the combat between virtual character 10 and NPC 2. Because NPC 2 and NPC 3 have a passive relationship, NPC 3's state is changed to a standby state, and NPC 3 leaves the combat area.

[0041] In summary, this invention modifies the state parameters of NPCs within a group using group control logic, and then updates the interaction status with the virtual character by combining these with the state parameters of each NPC using their own individual control logic. This invention provides an NPC communication scheme based on state parameters, where communication between NPC groups and individual NPCs occurs via state parameters. The NPC action control logic is primarily located on the individual control logic, and only the switching of state parameters is performed by the group control logic, thus making the NPC action control logic more systematic. Furthermore, this invention supports customization of NPC actions in different states (state parameters), and since the individual control logic of each NPC can be customized as needed, the interaction activities between NPCs and virtual characters become richer and more realistic.

[0042] Figure 2 shows a block diagram of the structure of a computer system according to one exemplary embodiment of the present application. The computer system 100 includes a first terminal 110, a server 120, and a second terminal 130.

[0043] The first terminal 110 has a client 111 installed and running that supports a virtual environment, and this client 111 may be a multiplayer online battle program. When the first terminal runs the client 111, the user interface of the client 111 is displayed on the screen of the first terminal 110. This client 111 may be any one of the following: MMOG, battle royale shooting game, virtual reality (VR) application, augmented reality (AR) program, 3D map program, virtual reality game, augmented reality game, first-person shooting game (FPS), third-person shooting game (TPS), multiplayer online battle arena game (MOBA), or simulation game (SLG). In this embodiment, the client 111 will be described as an MMOG game as an example. The first terminal 110 is a terminal used by the first user 112, and the first user 112 uses the first terminal 110 to control and make the first virtual character located in the virtual environment active, or to manipulate virtual items owned by the first virtual character, and the first virtual character may be referred to as the first user 112's virtual character. The first user 112 can perform operations such as assembling, disassembling, and unequipping on virtual items owned by the first virtual character, and the present invention is not limited to these. Exemplarily, the first virtual character is a first virtual character such as a simulation human character or an anime character.

[0044] The second terminal 130 has a client 131 installed and running that supports the virtual environment, and this client 131 may be a multiplayer online battle program. When the second terminal 130 runs the client 131, the user interface of the client 131 is displayed on the screen of the second terminal 130. This client may be any one of the following: MMOG, battle royale shooting game, VR application, AR program, 3D map program, virtual reality game, augmented reality game, FPS, TPS, MOBA, or SLG. In this embodiment, the client is described as an MMOG game as an example. The second terminal 130 is a terminal used by the second user 113, and the second user 113 uses the second terminal 130 to control and operate a second virtual character located in the virtual environment, and to manipulate virtual items owned by the second virtual character. The second virtual character may be referred to as the second user 113's virtual character. Exemplaryly, the second virtual character is a second virtual character such as a simulation character or an anime character.

[0045] Optionally, the first virtual character and the second virtual character may reside in the same virtual environment. Optionally, the first virtual character and the second virtual character may belong to the same faction, the same team, the same organization, be friends, or have primary communication rights with each other. Optionally, the first virtual character and the second virtual character may belong to different factions, different teams, different organizations, or be adversaries.

[0046] Optionally, the clients installed on the first terminal 110 and the second terminal 130 are the same, or the clients installed on the two terminals are the same type of client on different operating system platforms (Android or iOS). The first terminal 110 may generally refer to one of several terminals, and the second terminal 130 may generally refer to the other of several terminals; however, in this embodiment, only the first terminal 110 and the second terminal 130 will be given as examples. The device types of the first terminal 110 and the second terminal 130 may be the same or different, and such device types include at least one of the following: smartphone, tablet computer, e-reader, MP3 player, MP4 player, laptop computer, and desktop computer.

[0047] Although only two terminals are shown in Figure 2, in different embodiments, multiple other terminals 140 may exist that can access the server 120. Optionally, one or more additional terminals 140 may be terminals corresponding to developers, and these terminals 140 have a client development and editing platform that supports the virtual environment installed. Developers can edit and update clients on terminals 140 and transmit the updated client installation package to the server 120 via a wired or wireless network. The first terminal 110 and the second terminal 130 can download the client installation package from the server 120 to perform the client update.

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

[0049] 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 clients that support a 3D virtual environment. Optionally, Server 120 may handle the primary computing tasks and the terminals may handle auxiliary computing tasks, or Server 120 may handle auxiliary computing tasks and the terminals may handle primary computing tasks, or a distributed computing architecture may be used to facilitate collaborative computing between Server 120 and the terminals.

[0050] For example, server 120 includes a processor 122, a user account database 123, a battle service module 124, and a user-facing input / output interface (I / O interface) 125. Here, the processor 122 is configured to load instructions stored in server 120 and process data in the user account database 123 and the battle service module 124; the user account database 123 is configured to store user account data used by the first terminal 110, the second terminal 130, and other terminals 140, such as the user account avatar, the user account nickname, the user account combat power index, and the server to which the user account belongs; the battle service module 124 is configured to provide multiple battle rooms for users to play battles (e.g., 1v1 battles, 3v3 battles, 5v5 battles, etc.); and the user-facing I / O interface 125 is configured to establish communication with the first terminal 110 and / or the second terminal 130 via a wireless or wired network to exchange data.

[0051] Figure 3 is a flowchart of a method for controlling a non-player character according to one exemplary embodiment of the present application. The method may be performed by a computer device, which may be a terminal or a server. The method includes the following steps:

[0052] In step 302, the group control logic and the individual control logic for each of the multiple NPCs are obtained.

[0053] Group control logic is the control logic corresponding to an NPC group, where an NPC group contains multiple NPCs, and multiple NPCs belong to the same NPC group. Control logic refers to the code logic that controls the actions of NPCs. Individual control logic refers to the code logic that controls the actions of a single NPC. Group control logic refers to the code logic that controls the actions of multiple NPCs.

[0054] Optionally, NPCs may have a concrete image, or they may not have a concrete image.

[0055] Taking the example that NPCs do not have a concrete image, NPCs can converse with virtual characters in the form of dialog boxes, give gifts, and ask questions, but are not limited to these, and the embodiments of the present application are not specifically limited to these.

[0056] Taking the example of an NPC having a concrete image, an NPC may be an NPC with the image of a person, or an NPC with the image of an animal, or an NPC with the image of a mythical beast or a fairy, or an NPC with the image of a natural landscape, or an NPC with the image of an artificial landscape, but is not limited to these, and the embodiments of this application are not specifically limited to these.

[0057] In step 304, in response to the influence factors between the virtual character and the first NPC in the NPC group, the group control logic modifies the state parameters corresponding to at least one NPC in the NPC group.

[0058] An influencing factor refers to any factor that can trigger a modification of at least one NPC state parameter, such as an interaction between the NPC and the virtual character, or an action performed unilaterally by the NPC towards the virtual character (e.g., the NPC detecting the virtual character).

[0059] State parameters are used to indicate the state of an NPC in its virtual environment. Optionally, state parameters include, but are not limited to, parameters indicating at least one state, such as active or idle. The embodiments of this application are not specifically limited to these.

[0060] The "active state" refers to a state in which an NPC can actively interact with a virtual character. For example, an NPC can actively attack a virtual character. The "idle state" refers to a state in which an NPC cannot actively interact with a virtual character. For example, an NPC may pass by a virtual character but will not interact with it.

[0061] In one embodiment, the state parameter may also be a parameter for other customized states, for example, a variable A that customizes whether the NPC is in combat, where a value of 0 for variable A indicates that the NPC is not in combat, and a value of 1 for variable A indicates that the NPC is in combat. For example, a variable B that customizes whether the NPC is in idle state, where a value of 0 for variable B indicates that the NPC is not in idle state, and a value of 1 for variable B indicates that the NPC is in idle state.

[0062] In the following examples, the state parameters are mainly used as parameters for broad categories of states such as "active state" and "standby state." In reality, state parameters can also be set as parameters for more specific categories of states, and this invention is not limited to this.

[0063] In one embodiment, the individual control logic of the first NPC detects influencing factors between the virtual character and the first NPC. If the influencing factors meet the conditions, the individual control logic of the first NPC modifies the group state parameter (group state variable). After the group control logic detects the change in the group state parameter, it modifies the individual state parameter of at least one NPC within the NPC group.

[0064] In step 306, the interaction status between at least one NPC and the virtual character is updated based on the modified state parameters of at least one NPC and the individual control logic of at least one NPC.

[0065] For example, in the case of a single NPC, after obtaining its modified state parameters, it combines them with its own individual control logic to control its interaction with the virtual character.

[0066] In summary, this invention modifies the state parameters of NPCs within a group using group control logic, and then updates the interaction status with the virtual character by combining these with the state parameters of each NPC using their own individual control logic. This invention provides an NPC communication scheme based on state parameters, where communication between NPC groups and individual NPCs occurs via state parameters. The NPC action control logic is primarily located on the individual control logic, and only the switching of state parameters is performed by the group control logic, thus making the NPC action control logic more systematic. Furthermore, this invention supports customization of NPC actions in different states (state parameters), and since the individual control logic of each NPC can be customized as needed, the interaction activities between NPCs and virtual characters become richer and more realistic.

[0067] Figure 4 is a flowchart of a method for controlling a non-player character according to one exemplary embodiment of the present application. The method may be performed by a computer device, which may be a terminal or a server. The method includes the following steps:

[0068] In step 402, the group control logic and the individual control logic for each of the multiple NPCs are obtained.

[0069] Group control logic is the control logic corresponding to an NPC group, where an NPC group contains multiple NPCs, and multiple NPCs belong to the same NPC group. Control logic refers to the code logic that controls the actions of NPCs. Individual control logic refers to the code logic that controls the actions of a single NPC. Group control logic refers to the code logic that controls the actions of multiple NPCs.

[0070] In step 404, in response to the interaction between the virtual character and the first NPC in the NPC group satisfying the trigger condition, the group control logic modifies the state parameter corresponding to at least one NPC in the NPC group.

[0071] Interactions include, but are not limited to, at least one of the following: general attacks, defenses, special moves, text chats, voice chats, and gift-giving. The embodiments of this application are not specifically limited thereto.

[0072] State parameters are used to indicate the state of an NPC in its virtual environment. Optionally, state parameters include, but are not limited to, parameters indicating at least one state, such as active or idle. The embodiments of this application are not specifically limited to these.

[0073] The "active state" refers to a state in which an NPC can actively interact with a virtual character. For example, an NPC can actively attack a virtual character. The "idle state" refers to a state in which an NPC cannot actively interact with a virtual character. For example, an NPC may pass by a virtual character but will not interact with it.

[0074] For example, trigger conditions include, but are not limited to, at least one of the following: The duration of the interaction between the virtual character and the first NPC reaches a time threshold. The operation score of the interaction between the first NPC and the virtual character reaches the score threshold. The interaction event between the virtual character and the first NPC must match a predefined interaction event. The virtual character does not interact with the active first NPC, but actively interacts with the second NPC in the NPC group who is in a waiting state.

[0075] Exemplary, as shown in Figure 5, when a virtual character and an NPC enter an interactive scenario, the individual control logic 501 detects the interaction between the NPC and the virtual character in real time. When the interaction between the NPC and the virtual character satisfies a trigger condition, the individual control logic 501 notifies the group control logic 502 to modify the state parameter corresponding to at least one NPC in the NPC group. When the group control logic 502 modifies the state parameter of at least one NPC in the NPC group, it may do so based on the priority (activation priority) order of the NPCs. Factors influencing the priority of an NPC include, but are not limited to, at least one of the specified state parameter, the NPC's level, the distance between the NPC and the virtual character, and the angle between the NPC and the virtual character.

[0076] For example, if the user has not specified the activation order of NPCs, the system will perform sequential modifications based on the NPC levels. If the NPC levels are the same, the system will perform sequential modifications based on the distance between the NPC and the virtual character. If the NPC levels are the same and the distance between the NPC and the virtual character is the same, the system will perform sequential modifications based on the angle between the NPC and the virtual character.

[0077] In some embodiments, when the group control logic 502 modifies the state parameter of at least one NPC within the NPC group, it can do so based on a preset number of activations. For example, if the preset number of activations is infinite, it can activate as many NPCs as possible within the NPC group, without needing to make a decision based on the priority order of activations. For example, if the preset number of activations is three, it can activate three NPCs from the NPC group according to the priority order of activations.

[0078] If, at the discretion of the NPC organization, the number of NPCs that can be activated is less than the predetermined number of activations, then as many NPCs as possible within the NPC organization will be activated, and in this case, it is not necessary to make a decision based on the priority order of activation.

[0079] In some embodiments, the computer device modifies a state parameter corresponding to at least one NPC within the NPC group by group control logic in response to the duration of the interaction between the virtual character and the first NPC reaching a time threshold.

[0080] In response to the duration of the interaction between the virtual character and the first NPC reaching a time threshold, the computer equipment uses group control logic to change the state parameter of the first NPC from active to idle, and changes the state parameter of the second NPC within the NPC group from idle to active.

[0081] In the schematic diagram of the interaction between the virtual character and NPCs shown in Figure 6, section (a) of Figure 6 shows NPC-603, NPC-2602, and NPC-3604. NPC-603, NPC-2602, and NPC-3604 all belong to an NPC group. The time threshold is set to 20s, and when the duration of combat between virtual character 601 and NPC-2602 reaches 20s, the computer equipment modifies the state parameters of NPC-603, NPC-2602, and NPC-3604 using group control logic. For example, if the state parameter of NPC 602 is changed from active to standby, the state parameter of NPC 603 is changed from standby to active, and the state parameter of NPC 604 is kept in standby, that is, after the attack duration between virtual character 601 and NPC 602 reaches 20s, as shown in part (b) of Figure 6, NPC 602 does not continue fighting virtual character 601, NPC 602 moves away from virtual character 601, and instead NPC 603 starts fighting virtual character 601. The duration in the figure is the duration of interaction between virtual character 601 and NPC, and the duration in the figure may be visible or invisible, and the embodiments of the present application are not specifically limited thereto.

[0082] In some embodiments, the computer device modifies a state parameter corresponding to at least one NPC within the NPC group by group control logic in response to the operation score of an interaction operation between a first NPC and a virtual character reaching a score threshold.

[0083] The operation score refers to the score corresponding to each operation during the interaction process between the first NPC and the virtual character. Table 1 shows the correspondence table for operation scores. [Table 1]

[0084] In Table 1, assuming an NPC score threshold of 20, if the NPC uses Skill A while active, and it successfully hits the virtual character, the score increases by 5 points. Over time, the score increases by 1 point every second. After the total operation score reaches 20, the NPC changes from active to idle. After the state change, the score decreases by 5 points, and then, while in idle mode, the score decreases by 2 points every second until it reaches 0.

[0085] The computer device obtains a correspondence table of operation scores corresponding to interaction operations. In response to the sum of the operation scores for interaction operations between the first NPC and the virtual character reaching a score threshold, the computer device uses collective control logic to change the state parameter of the first NPC from active to standby, and the state parameter of the second NPC from standby to active.

[0086] For example, if an NPC group includes NPC 1, NPC 2, and NPC 3, and during combat between the virtual character and NPC 1, NPC 1 gains 5 points each time it uses a special move, and the total score reaches 15 points, the computer system modifies the status parameters of NPC 1, NPC 2, and NPC 3 according to the group control logic. This modifies NPC 1's status parameter from active to idle, and NPC 2 and NPC 3's status parameters from idle to active. In other words, during combat between the virtual character and NPC 1, after NPC 1 uses a special move three times, NPC 1 will not continue fighting the virtual character, will leave the virtual character, and instead NPC 2 and NPC 3 will begin fighting the virtual character.

[0087] In some embodiments, in response to the operation score of an interaction operation between the first NPC and the virtual character not reaching a score threshold, the computer device determines that the interaction event between the virtual character and the first NPC matches a predefined interaction event, and modifies the state parameter of the first NPC from a standby state to an active state using collective control logic.

[0088] For example, predefined interaction events are: 1. Virtual characters attacking NPCs. 2. The NPC's attack hits the monster. 3. This includes the condition that the virtual character is within a certain distance and angle from the NPC.

[0089] For example, if the interaction event between the first NPC and the virtual character is "the virtual character attacks the first NPC", the computer device determines that the interaction event between the virtual character and the first NPC matches a predefined interaction event, and the computer device modifies the state parameter of the first NPC from standby to active using collective control logic.

[0090] For example, if the interaction event between the first NPC and the virtual character is "the distance between the virtual character and the first NPC is less than 100m", the computer device determines that the interaction event between the virtual character and the first NPC matches a predefined interaction event, and the computer device modifies the state parameter of the first NPC from standby to active using collective control logic.

[0091] In some embodiments, if a virtual character does not interact with a first NPC that is in an active state, but does interact with a second NPC in a standby state within the NPC group, the group control logic modifies the state parameters of the first NPC from active to standby and modifies the state parameters of the second NPC from standby to active.

[0092] For example, in the process of a virtual character interacting with a first NPC that is in an active state, if the virtual character actively interacts with a second NPC that is in a standby state, the group control logic will change the state parameters of the first NPC from active to standby, and change the state parameters of the second NPC from standby to active.

[0093] For example, if the first NPC and the second NPC are in the same NPC group, and the first NPC is in an active state and fighting a virtual character, while the second NPC is in a standby state and walking around nearby, when the virtual character actively attacks the second NPC, the computer equipment will use group control logic to change the state parameter of the first NPC from active to standby, and change the state parameter of the second NPC from standby to active. In other words, the second NPC will start fighting the virtual character, while the first NPC will end the battle and move away from the virtual character.

[0094] In some embodiments, the computer device modifies a state parameter corresponding to at least one NPC within the NPC group by group control logic in response to the distance between the virtual character and the first NPC being less than a distance threshold.

[0095] For example, if the distance threshold is set to 3 meters and the distance between the virtual character and the first NPC is less than 3 meters, the virtual character and the NPC enter an interactive scenario, and the group control logic modifies the state parameter corresponding to at least one NPC in the NPC group, for example, by changing the state parameter of the first NPC to the active state, the first NPC unleashes a special move-class skill against the virtual character, while the other NPCs in the NPC group remain in a standby state and move away from the combat area between the first NPC and the virtual character.

[0096] In some embodiments, the computer device modifies state parameters corresponding to at least one NPC within the NPC group by group control logic in response to the virtual character and the first NPC being in the same location area.

[0097] The same location area may optionally include, but is not limited to, the same floor, the same vehicle, the same cave, or the same combat area, and the embodiments of the present application are not specifically limited thereto.

[0098] For example, if the same location area is on the same floor, and the virtual character and the first NPC are located on the same floor, the virtual character and the NPC enter an interactive scenario, and the group control logic modifies the state parameter corresponding to at least one NPC within the NPC group. For example, the state parameter of the first NPC is modified to an active state, causing the first NPC to actively attack the virtual character, or the first NPC to unleash a special attack-class skill on the virtual character, while the other NPCs within the NPC group remain in a standby state.

[0099] In some embodiments, the computer device modifies a state parameter corresponding to at least one NPC within the NPC group by group control logic in response to the time that a virtual character and a first NPC have been in the same location area reaching a threshold for the time spent in the same location.

[0100] For example, if the threshold for staying in the same location is set to one minute, and the same location area is defined as being on the same floor, then if the virtual character and the first NPC spend more than one minute on the same floor, the virtual character and the NPC enter an interactive scenario. The group control logic modifies the state parameters of at least one NPC within the NPC group. For example, the state parameter of the first NPC is changed from active to idle, while the second NPC within the NPC group is changed from idle to active. The second NPC then either actively attacks the virtual character or uses a special attack-class skill on the virtual character.

[0101] In step 406, the interaction status between at least one NPC and the virtual character is updated based on the modified state parameters of at least one NPC and the individual control logic of at least one NPC.

[0102] For example, in the case of a single NPC, after obtaining its modified state parameters, it combines them with its own individual control logic to control its interaction with the virtual character.

[0103] As described above, the method according to this embodiment triggers the group control logic using different trigger methods by detecting the operation duration, operation score, and whether or not a predetermined interaction event is met during an interaction operation between a virtual character and a first NPC. This modifies the state parameters corresponding to at least one NPC within the NPC group to which the first NPC belongs. Subsequently, each NPC updates the interaction status with the virtual character by combining its own state parameters with its individual control logic. This invention provides an NPC communication scheme based on state parameters, where an individual NPC detects the fulfillment of a condition, notifies the NPC group to modify the NPC's state parameters, and each individual NPC updates the interaction operation with the virtual character by combining its own individual control logic with the modified state parameters, thereby systematizing the NPC action control logic.

[0104] Figure 7 is a flowchart of a method for controlling a non-player character according to one exemplary embodiment of the present application. The method may be performed by a computer device, which may be a terminal or a server. The method includes the following steps:

[0105] In step 702, the group control logic and the individual control logic for each of the multiple NPCs are obtained.

[0106] Group control logic is the control logic corresponding to an NPC group, where an NPC group contains multiple NPCs, and multiple NPCs belong to the same NPC group. Control logic refers to the code logic that controls the actions of NPCs. Individual control logic refers to the code logic that controls the actions of a single NPC. Group control logic refers to the code logic that controls the actions of multiple NPCs.

[0107] In step 704, in response to the virtual character and the first NPC entering the interactive scenario, the group control logic modifies the initial state parameters corresponding to at least one NPC within the NPC group.

[0108] In some embodiments, NPCs within an NPC group each have corresponding default state parameters when a match begins. For example, NPCs within an NPC group are distributed to different locations, active NPCs can actively attack virtual characters, and idle NPCs are in a wandering state.

[0109] Initial state parameters refer to the default state parameters that NPCs in an NPC group use when they start a match.

[0110] For example, the NPCs include NPC1, NPC2, and NPC3, and NPC1, NPC2, and NPC3 belong to the same NPC group, and the default state of NPC1, NPC2, and NPC3 at the start of a match is a waiting state, meaning that NPC1, NPC2, and NPC3 do not actively attack the virtual character. Exemplaryly, in response to the virtual character attacking the first NPC, the computer equipment modifies the initial state parameters corresponding to at least one NPC within the NPC group by group control logic.

[0111] In some embodiments, the computer device modifies initial state parameters corresponding to at least one NPC within the NPC group by group control logic in response to a virtual character entering the field of view of a first NPC.

[0112] The field of view refers to the visible area directly in front of the NPC (Non-Primary Control) centered on the NPC. Examples include, but are not limited to, a sector-shaped area with the NPC's position as its center, a circular area with the NPC's position as its center, an annular area with the NPC's position as its center, a regular geometric area with the NPC's position as its center, or an irregular geometric area with the NPC's position as its center. The embodiments of this application are not specifically limited to these. The size of the field of view is not specifically limited.

[0113] For example, if the virtual character enters the field of view of NPC 2, the computer device modifies the initial state parameters for NPC 1, NPC 2, and NPC 3 using collective control logic, changing NPC 2 from a standby state to an active state, while NPC 1 and NPC 3 remain in a standby state. Then, based on the state parameters and individual control logic corresponding to each of NPC 1, NPC 2, and NPC 3, the computer device updates the interaction status between NPC 1, NPC 2, and NPC 3 and the virtual character. That is, NPC 2 actively attacks the virtual character, and NPC 1 and NPC 3 walk away.

[0114] In some embodiments, NPCs carry blind spot detection items, which are used to detect virtual characters within the NPC's blind spot range. The computer equipment modifies the initial state parameters corresponding to at least one NPC within the NPC group using group control logic in response to the virtual character entering the blind spot range of the first NPC, i.e., when the virtual character enters the detection range of the first NPC's blind spot detection item. The blind spot range refers to the invisible area behind the NPC.

[0115] In step 706, the interaction status between at least one NPC and the virtual character is updated based on the modified state parameters of at least one NPC and the individual control logic of at least one NPC.

[0116] For example, in the case of a single NPC, after obtaining its modified state parameters, it combines them with its own individual control logic to control its interaction with the virtual character.

[0117] As described above, the method according to this embodiment detects whether or not a virtual character has attacked an NPC or entered the NPC's line of sight, thereby triggering a group control logic to modify the initial state parameters corresponding to at least one NPC within the NPC group to which the first NPC belongs. Subsequently, each NPC's individual control logic combines its own modified initial state parameters to update the interaction status with the virtual character. This invention provides an NPC communication scheme based on state parameters, thereby further systematizing the NPC action control logic.

[0118] Figure 8 is a flowchart of a method for controlling a non-player character according to one exemplary embodiment of the present application. The method may be performed by a computer device, which may be a terminal or a server. The method includes the following steps:

[0119] In step 802, the group control logic and the individual control logic for each of the multiple NPCs are obtained.

[0120] Group control logic is the control logic corresponding to an NPC group, where an NPC group contains multiple NPCs, and multiple NPCs belong to the same NPC group. Control logic refers to the code logic that controls the actions of NPCs. Individual control logic refers to the code logic that controls the actions of a single NPC. Group control logic refers to the code logic that controls the actions of multiple NPCs.

[0121] In step 804, the relationship between the first NPC and the third NPC within the NPC group is obtained, and based on the relationship between the first NPC and the third NPC, the group control logic modifies the state parameter corresponding to the third NPC.

[0122] The relation may optionally include, but is not limited to, an active relation or a passive relation, and the embodiments of this application are not specifically limited to these.

[0123] A positive relationship refers to a relationship in which the actions of at least two NPCs within the same NPC group are aligned. For example, a positive relationship includes, but is not limited to, at least one of the following: a romantic relationship, a close friendship, a comradeship, or a teacher-student relationship, and the embodiments of this application are not specifically limited to these.

[0124] A negative relationship refers to a relationship in which the actions of at least two NPCs within the same NPC group are in opposition to each other. For example, a negative relationship includes, but is not limited to, at least one of the following: an adversarial relationship or a relationship of differing attributes, and the embodiments of this application are not specifically limited to these.

[0125] If the first NPC and the third NPC have a positive relationship, the group control logic corrects the state parameters of the first NPC and the third NPC to a matching state. If the first NPC and the third NPC have a negative relationship, the group control logic corrects the state parameters of the first NPC and the third NPC to a conflicting state.

[0126] As an example, Figure 9 shows a schematic diagram of interaction operations between a virtual character and an NPC, where the NPCs in the NPC group include NPC-902, NPC-2903, and NPC-3904, with NPC-902 and NPC-2903 having an active relationship, and NPC-2903 and NPC-3904 having a passive relationship. Assuming that NPC-902, NPC-2903, and NPC-3904 are all in an active state, when virtual character 901 engages in combat with NPC-2903, the computer equipment modifies the state parameters of NPC-902, NPC-2903, and NPC-3904 by group control logic. Since NPC 1902 and NPC 2903 have an active relationship, NPC 1902's state is kept active, and NPC 1902 also participates in the battle between virtual character 901 and NPC 2903. Since NPC 2903 and NPC 3904 have a passive relationship, NPC 3904's state is changed to a standby state, and NPC 3904 leaves the battlefield.

[0127] In some embodiments, the computer equipment obtains the relationship between the first NPC and the third NPC within the NPC group, and modifies the action parameters corresponding to the third NPC using group control logic based on the relationship between the first NPC and the third NPC.

[0128] If the first NPC and the third NPC have an active relationship, the group control logic modifies their action parameters to match, meaning that the first and third NPCs can perform an action simultaneously. For example, when the first NPC performs an attack action, the third NPC can also perform an attack action. If the first and third NPCs have a passive relationship, the group control logic modifies their action parameters to conflicting, meaning that the first and third NPCs cannot perform an action simultaneously. For example, when the first NPC performs an attack action, the third NPC cannot perform an attack action.

[0129] In step 806, the interaction status between at least one NPC and the virtual character is updated based on the modified state parameters of at least one NPC and the individual control logic of at least one NPC.

[0130] For example, in the case of a single NPC, after obtaining its modified state parameters, it combines them with its own individual control logic to control its interaction with the virtual character.

[0131] As described above, the method according to this embodiment triggers the group control logic by acquiring the relationship between different NPCs within the same group, modifying the state parameters of each NPC based on the relationship, and each NPC updates the interaction status with the virtual character by combining its individual control logic with its own modified state parameters. This application provides an NPC communication scheme based on state parameters and further systematizes the action control logic of NPCs.

[0132] Figure 10 is a flowchart of a method for controlling an NPC according to one exemplary embodiment of the present invention. The method may be performed by a computer device, which may be a terminal or a server. The method includes the following steps:

[0133] In step 1001, we begin.

[0134] In step 1002, entry into an interactive scenario is detected.

[0135] For example, a computer device can detect whether or not a virtual character and an NPC have entered an interactive scenario.

[0136] The method for optionally entering an interactive scenario includes, but is not limited to, at least one of the following: a virtual character attacking a first NPC, or a virtual character entering the first NPC's field of view. The embodiments of this application are not specifically limited to these.

[0137] In step 1003, the initial state parameters are modified.

[0138] For example, when a virtual character and an NPC enter an interactive scenario, the group control logic modifies the initial state parameters corresponding to at least one NPC within the NPC group.

[0139] For example, if the virtual character enters the field of view of NPC 2, the computer device modifies the initial state parameters for NPC 1, NPC 2, and NPC 3 using collective control logic, changing NPC 2 from a standby state to an active state, while NPC 1 and NPC 3 remain in a standby state. Then, based on the state parameters and individual control logic corresponding to each of NPC 1, NPC 2, and NPC 3, the computer device updates the interaction status between NPC 1, NPC 2, and NPC 3 and the virtual character. That is, NPC 2 actively attacks the virtual character, and NPC 1 and NPC 3 walk away.

[0140] In step 1004, the state parameters are set based on priority.

[0141] For example, when the group control logic modifies the initial state parameter corresponding to at least one NPC within an NPC group, the group control logic modifies it according to the NPC's priority.

[0142] The priority of an NPC includes, but is not limited to, at least one of the following: a specified state parameter, the NPC's level, the distance between the NPC and the virtual character, or the angle between the NPC and the virtual character.

[0143] For example, if the user has not specified the activation order of NPCs, the system will perform sequential modifications based on the NPC levels. If the NPC levels are the same, the system will perform sequential modifications based on the distance between the NPC and the virtual character. If the NPC levels are the same and the distance between the NPC and the virtual character is the same, the system will perform sequential modifications based on the angle between the NPC and the virtual character.

[0144] In step 1005, it is determined whether the state parameter is in an active state or not.

[0145] For example, after the group control logic modifies the state parameters of the NPCs within the NPC group, it determines whether the state parameters of the first NPC are in an active state. If the state parameters of the first NPC are in an active state, step 1007 is executed; otherwise, step 1006 is executed.

[0146] In step 1006, other logic is executed.

[0147] If the state parameter of the first NPC is not in an active state, other logic is executed, namely, the individual control logic for an inactive state is executed.

[0148] Optionally, the other logic may include, but is not limited to, at least one of the following: escape action logic, item acquisition action logic, or walking action logic.

[0149] In step 1007, the control logic for the active state of the individual is executed.

[0150] If the first NPC's status parameter indicates an active state, the active state individual control logic is executed, meaning the first NPC attacks the virtual character and initiates combat with the virtual character.

[0151] The process ends in step 1008.

[0152] As described above, the method according to this embodiment triggers group control logic by detecting whether or not a virtual character has attacked an NPC or entered the NPC's line of sight, thereby modifying the initial state parameters corresponding to at least one NPC within the NPC group to which the first NPC belongs. This makes the interaction activities between the NPC and the virtual character richer and more realistic, bringing the NPC's actions closer to those of a virtual character controlled by a real user, and improving the user experience.

[0153] Figure 11 is a flowchart of a method for controlling an individual NPC according to one exemplary embodiment of the present invention. The method may be performed by a computer device, which may be a terminal or a server. The method includes the following steps:

[0154] In step 1101, we begin.

[0155] In step 1102, it is determined whether the state parameter is in an active state or not.

[0156] For example, for an individual NPC, it is determined whether the NPC's state parameter is active or not. If the NPC is active, step 1103 is executed; if the NPC is inactive, step 1104 is executed.

[0157] In step 1103, the individual control logic for the active state is executed.

[0158] For example, if an individual NPC's state parameter is in the active state, the individual control logic for the active state is executed, meaning the first NPC attacks the virtual character and begins combat with the virtual character.

[0159] In step 1104, it is determined whether the state parameter is in another state.

[0160] For example, if an individual NPC is in an inactive state, it is determined whether the individual NPC's state parameter is in another state. If the individual NPC's state parameter is in another state, step 1105 is executed. If the individual NPC's state parameter is not in another state, step 1106 is executed.

[0161] Optionally, other states include, but are not limited to, at least one of the following: escape action logic, item acquisition action logic, or walking action logic.

[0162] In step 1105, the control logic for other individuals is executed.

[0163] For example, if an individual NPC's state parameter is in a different state, the individual NPC can be controlled to execute the control logic for that other state. For instance, the NPC can be controlled to pick up supplies.

[0164] In step 1106, the default individual control logic is executed.

[0165] For example, if an individual NPC's state parameter is neither active nor in any other state, the individual NPC is controlled to execute the default individual control logic.

[0166] The process ends at step 1107.

[0167] As described above, the method according to this embodiment improves the user experience by changing the actions of NPCs by altering the state of individual NPCs, thereby bringing the actions of NPCs closer to those of virtual characters controlled by actual users.

[0168] Figure 12 is a flowchart of a method for controlling an NPC according to one exemplary embodiment of the present application. The method may be performed by a computer device, which may be a terminal or a server. The method includes the following steps:

[0169] In step 1201, begin.

[0170] In step 1202, the operation score for the interaction operation is obtained.

[0171] The operation score refers to the score corresponding to each operation during the interaction process between the first NPC and the virtual character.

[0172] For example, the computer device obtains a correspondence table of operation scores corresponding to interaction operations, and based on the correspondence table of operation scores, determines the total operation score of the interaction operations between the first NPC and the virtual character.

[0173] In step 1203, it is determined whether the operation score reaches the score threshold.

[0174] For example, the computer device determines whether the sum of the operation scores for the interaction operations between the first NPC and the virtual character reaches a score threshold. If the sum of the operation scores for the interaction operations between the first NPC and the virtual character reaches the score threshold, it executes step 1205. If the sum of the operation scores for the interaction operations between the first NPC and the virtual character does not reach the score threshold, it executes step 1204.

[0175] In step 1204, it is determined whether or not an interaction operation was performed with the NPC in a waiting state.

[0176] For example, if the sum of the operation scores for interaction operations between the first NPC and the virtual character does not reach the score threshold, it is determined whether the virtual character has performed an interaction operation with an NPC in a waiting state. If the virtual character has performed an interaction operation with an NPC in a waiting state, step 1205 is executed; if the virtual character has not performed an interaction operation with an NPC in a waiting state, step 1206 is executed.

[0177] In step 1205, the group control logic modifies the state parameters corresponding to at least one NPC.

[0178] For example, if the sum of the operation scores from the interaction between the first NPC and the virtual character reaches a score threshold, the group control logic will change the state parameter of the first NPC from active to idle, and the state parameter of the second NPC from idle to active.

[0179] For example, in an NPC group, the NPCs include NPC1, NPC2, and NPC3. During combat between the virtual character and NPC1, NPC1's score increases by 5 each time it uses a special move. When the score reaches 15 points, the computer system modifies the status parameters of NPC1, NPC2, and NPC3 using group control logic. This modifies NPC1's status parameter from active to idle, and NPC2 and NPC3's status parameters from idle to active. In other words, during combat between the virtual character and NPC1, after NPC1 uses a special move three times, NPC1 will not continue fighting the virtual character. Instead, NPC1 will leave the virtual character, and NPC2 and NPC3 will begin fighting the virtual character.

[0180] In some embodiments, if the sum of the operation scores of interaction operations between the first NPC and the virtual character does not reach the score threshold, but the virtual character performs an interaction operation with an NPC in a standby state, the group control logic corrects the state parameter of the first NPC from active to standby and corrects the state parameter of the second NPC from standby to active.

[0181] The process ends at step 1206.

[0182] As described above, the method according to this embodiment detects the operation score of the interaction operation between the virtual character and the first NPC, thereby triggering the group control logic to modify the state parameters corresponding to at least one NPC within the NPC group to which the first NPC belongs, making the interaction between the virtual character and the NPC more coordinated, enriching and realizing the interaction activities between the NPC and the virtual character, bringing the NPC's actions closer to those of a virtual character controlled by a real user, and improving the user experience.

[0183] Figure 13 is a flowchart of a method for controlling an NPC according to one exemplary embodiment of the present invention. The method may be performed by a computer device, which may be a terminal or a server. The method includes the following steps:

[0184] In step 1301, we begin.

[0185] In step 1302, the status parameters of the first NPC are obtained.

[0186] For example, the computer equipment retrieves the state parameters of the first NPC and the relationship between the first NPC and the third NPC within the NPC organization.

[0187] The state parameters include active and idle states.

[0188] The relation may optionally include, but is not limited to, an active relation or a passive relation, and the embodiments of this application are not specifically limited to these.

[0189] A positive relationship refers to a relationship in which the actions of at least two NPCs within the same NPC group are aligned. For example, a positive relationship includes, but is not limited to, at least one of the following: a romantic relationship, a close friendship, a comradeship, or a teacher-student relationship, and the embodiments of this application are not specifically limited to these.

[0190] A negative relationship refers to a relationship in which the actions of at least two NPCs within the same NPC group are in opposition to each other. For example, a negative relationship includes, but is not limited to, at least one of the following: an adversarial relationship or a relationship of differing attributes, and the embodiments of this application are not specifically limited to these.

[0191] In step 1303, it is detected whether or not there is a third NPC that has an active relationship with the first NPC.

[0192] For example, after obtaining the state parameters of the first NPC, it is detected whether or not there is a third NPC that has a positive relationship with the first NPC. If there is a third NPC with a positive relationship with the first NPC within the NPC group, step 1305 is executed. If there is no third NPC with a positive relationship with the first NPC within the NPC group, step 1304 is executed.

[0193] In step 1304, it is determined whether the first NPC has performed the first operation.

[0194] For example, if there is no third NPC within the NPC organization that has an active relationship with the first NPC, it is determined whether the first NPC performed the first operation. If the first NPC performed the first operation, step 1306 is executed; if the first NPC did not perform the first operation, step 1307 is executed.

[0195] The first operation includes, but is not limited to, a running action, an attacking action, a flying action, or a climbing action, and the embodiments of the present application are not specifically limited thereto.

[0196] In step 1305, the state parameters of the first NPC and the third NPC are corrected to match.

[0197] For example, if a third NPC has an active relationship with the first NPC within an NPC group, the group control logic will correct the state parameters of the first and third NPCs to match.

[0198] For example, an NPC group includes NPC 1, NPC 2, and NPC 3, with NPC 1 and NPC 2 having an active relationship, and NPC 2 and NPC 3 having a passive relationship. Assuming that NPC 1, NPC 2, and NPC 3 are all active, and a virtual character engages in combat with NPC 2, the computer system modifies the state parameters of NPC 1, NPC 2, and NPC 3 according to the group control logic. Because NPC 1 and NPC 2 have an active relationship, NPC 1's state is maintained in an active state, and NPC 1 also participates in the combat between the virtual character and NPC 2. Because NPC 2 and NPC 3 have a passive relationship, NPC 3's state is changed to a standby state, and NPC 3 leaves the combat area.

[0199] In step 1306, it is detected whether or not there is a third NPC that has a negative relationship with the first NPC.

[0200] For example, when the first NPC performs the first operation, it is detected whether there is a third NPC that has a negative relationship with the first NPC. If there is a third NPC with a negative relationship with the first NPC within the NPC group, step 1308 is performed. If there is no third NPC with a negative relationship with the first NPC within the NPC group, step 1307 is performed.

[0201] In step 1307, other operations in the individual control logic are performed.

[0202] If there is no third NPC within the NPC group that has a relationship with the first NPC, the first and third NPCs are controlled, and their respective individual control logics are used to perform other operations within the individual control logic.

[0203] In step 1308, the third NPC cannot perform the first operation.

[0204] For example, if a third NPC has a negative relationship with the first NPC within an NPC group, the system will be controlled so that the third NPC cannot perform the first operation when the first NPC is performing the first operation.

[0205] For example, if the first NPC and the third NPC have a negative relationship, the group control logic will modify the action parameters of the first and third NPCs to be in conflicting states, meaning that the first and third NPCs cannot perform the same action simultaneously. For instance, when the first NPC performs an attack action, the third NPC cannot perform an attack action either.

[0206] The process ends at step 1309.

[0207] As described above, the method according to this embodiment enables NPCs within an NPC group to respond more intelligently by acquiring the relationships between different NPCs within the same group, making the interaction activities between NPCs and virtual characters richer and more realistic, bringing the actions of NPCs closer to those of virtual characters controlled by actual users, and improving the user experience.

[0208] Figure 14 shows an exemplary structural diagram of a non-player character control device according to one exemplary embodiment of the present application. The device can be implemented as all or part of a computer device by software, hardware, or a combination thereof, and the device is An acquisition module 1401 is configured to acquire group control logic and individual control logic for multiple NPCs, wherein the group control logic is control logic corresponding to an NPC group, and the NPC group includes multiple NPCs, and the acquisition module 1401 and A control module 1402 is configured to modify state parameters corresponding to at least one NPC in an NPC group by group control logic in response to influencing factors between a virtual character and the first NPC in the NPC group, The system includes an update module 1403 configured to update the interaction status between at least one NPC and a virtual character based on the modified state parameters of at least one NPC and the individual control logic of at least one NPC.

[0209] In some embodiments, the control module 1402 is configured to modify a state parameter corresponding to at least one NPC in the NPC group by group control logic in response to an interaction between a virtual character and a first NPC in the NPC group satisfying a trigger condition.

[0210] In some embodiments, the control module 1402 is configured to modify a state parameter corresponding to at least one NPC in the NPC group by group control logic in response to the duration of the interaction between the virtual character and the first NPC in the NPC group reaching a time threshold.

[0211] In some embodiments, the control module 1402 is configured to change the state parameter of the first NPC from an active state to a standby state by the group control logic in response to the duration of interaction between the virtual character and the first NPC in the NPC group reaching a time threshold, and to change the state parameter of the second NPC in the NPC group from a standby state to an active state by the group control logic, where the active state refers to a state in which the virtual character can actively interact, and the standby state refers to a state in which the virtual character cannot actively interact.

[0212] In some embodiments, the control module 1402 is configured to modify a state parameter corresponding to at least one NPC in the NPC group by group control logic in response to the operation score of an interaction operation between a first NPC in the NPC group and a virtual character reaching a score threshold.

[0213] In some embodiments, the acquisition module 1401 is configured to query an operation score correspondence table and obtain the sum of the operation scores for interaction operations between a first NPC in an NPC group and a virtual character, the operation score correspondence table containing the operation score corresponding to each interaction operation.

[0214] In some embodiments, the control module 1402 is configured to change the state parameter of the first NPC from an active state to a standby state by group control logic in response to the sum of the operation scores of interaction operations between the first NPC and the virtual character reaching a score threshold, and to change the state parameter of the second NPC in the NPC group from a standby state to an active state by group control logic, where the active state refers to a state in which the NPC can actively interact with the virtual character, and the standby state refers to a state in which the NPC cannot actively interact with the virtual character.

[0215] In some embodiments, the control module 1402 is configured to change the state parameter of the first NPC within the NPC group from a standby state to an active state by the group control logic in response to an interaction event between the virtual character and the first NPC within the NPC group matching a predefined interaction event, where the active state refers to a state in which the NPC can actively interact with the virtual character, and the standby state refers to a state in which the NPC cannot actively interact with the virtual character.

[0216] In some embodiments, the control module 1402 is configured such that, if a virtual character does not interact with a first NPC in an active NPC group but does interact with a second NPC in a standby state within the same NPC group, the group control logic modifies the state parameters of the first NPC from active to standby and modifies the state parameters of the second NPC from standby to active.

[0217] In some embodiments, the control module 1402 is configured to modify the initial state parameters corresponding to at least one NPC in the NPC group by group control logic in response to the virtual character and the first NPC in the NPC group entering an interactive scenario. Here, the initial state parameters refer to the default state parameters at the start of a game.

[0218] In some embodiments, the control module 1402 is configured to modify the initial state parameters corresponding to at least one NPC within the NPC group by group control logic in response to a virtual character attacking a first NPC.

[0219] In some embodiments, the control module 1402 is configured to modify the initial state parameters corresponding to at least one NPC within the NPC group by group control logic in response to a virtual character entering the field of view of a first NPC.

[0220] In some embodiments, the acquisition module 1401 is configured to acquire the relationship between a first NPC and a third NPC within an NPC organization.

[0221] In some embodiments, the control module 1402 is configured to modify the state parameters corresponding to the third NPC by collective control logic based on the relationship between the first NPC and the third NPC.

[0222] Related relationships include positive relationships, which refer to relationships that align the action directions of at least two NPCs within the same NPC group. In some embodiments, the control module 1402 is configured to correct the state parameters of the first and third NPCs to a matched state by group control logic when the first and third NPCs are in a positive relationship.

[0223] Related relationships include negative relationships, which refer to relationships in which the behavioral directions of at least two NPCs within the same NPC group are in opposition. In some embodiments, the control module 1402 is configured to correct the state parameters of the first NPC and the third NPC to an opposition state by group control logic if the first NPC and the third NPC are in a negative relationship.

[0224] In one embodiment, the control module 1402 is configured to modify state parameters corresponding to at least one NPC in the NPC group by group control logic in response to influencing factors between the virtual character and the first NPC in the NPC group, according to the priority order of activation.

[0225] In one embodiment, the control module 1402 is configured to modify a state parameter corresponding to at least one NPC in the NPC group by group control logic according to a preset number of activations, in response to influencing factors between the virtual character and the first NPC in the NPC group.

[0226] Figure 15 shows a block diagram of the structure of a computer device 1500 according to an exemplary embodiment of the present invention. The computer device 1500 may be a portable mobile terminal such as a smartphone, tablet computer, Moving Picture Experts Group Audio Layer III (MP3 player), or Moving Picture Experts Group Audio Layer IV (MP4 player). The computer device 1500 may also be referred to by other names such as user device or portable terminal.

[0227] Typically, computer equipment 1500 comprises a processor 1501 and memory 1502.

[0228] The processor 1501 may comprise one or more processing cores, such as a 4-core processor and an 8-core processor. The processor 1501 can be implemented in at least one hardware form from among a Digital Signal Processing (DSP), a Field Programmable Gate Array (FPGA), and a Programmable Logic Array (PLA). The processor 1501 may also comprise a main processor and a coprocessor, the main processor being a processor used to process data in the wake-up state and also called a Central Processing Unit (CPU). The coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 1501 may be integrated with a Graphics Processing Unit (GPU), which is used to render and draw content displayed on a screen. In some embodiments, the processor 1501 may further comprise an Artificial Intelligence (AI) processor, which is used to process computing operations related to machine learning.

[0229] The memory 1502 may include one or more computer-readable storage media, which may be tangible and non-temporary. The memory 1502 may also include one or more magnetic disk memories, high-speed random-access memories such as flash memory, and non-volatile memory. In some embodiments, the non-temporary computer-readable storage media in the memory 1502 are configured to store at least one instruction, and the at least one instruction is executed by the processor 1501 to realize the method for controlling a non-player character according to the embodiments of the present application.

[0230] In some embodiments, the computer device 1500 may further include a peripheral device interface 1503 and at least one peripheral device. Specifically, the peripheral device may include at least one of a radio frequency circuit, a touchscreen, a camera, an audio circuit, and a power supply.

[0231] As those skilled in the art will understand, the structure shown in Figure 15 does not constitute a limitation to computer equipment 1500, and may have more or fewer components than shown in the figure, or may combine some components or use a different component arrangement.

[0232] Embodiments of the present invention further provide a computer device comprising a processor and memory, wherein the memory stores at least one program, and the processor loads and executes the at least one computer program to realize the method for controlling a non-player character according to each embodiment of the above method.

[0233] Embodiments of the present invention further provide a computer-readable storage medium that stores at least one computer program for a processor to implement a method for controlling non-player characters according to each embodiment of the above-described method, when loaded and executed by the processor.

[0234] Embodiments of the present invention further provide a computer program product including a computer program, the computer program being stored in a computer-readable storage medium, the computer program being read from the computer-readable storage medium and executed by a processor of a computer device, and the computer device implementing a method for controlling non-player characters according to each embodiment of the above method.

[0235] It is understood that, while the specific embodiments of this application refer to relevant data such as user data processing related to the user's identity or characteristics, including data, historical data, and profiles, if the above embodiments of this application apply to a particular product or technology, user permission or consent is required, and the collection, use, and processing of relevant data should comply with the relevant laws, regulations, and standards of the relevant country or region.

Claims

1. A method for controlling a non-player character, which is performed by a terminal device, A step of obtaining a group control logic and individual control logic for each of multiple NPCs, wherein the group control logic is a control logic corresponding to an NPC group, and the NPC group includes the multiple NPCs, The steps include: modifying a state parameter corresponding to at least one NPC within the NPC group by the group control logic in response to an influencing factor between the virtual character and the first NPC within the NPC group; A method for controlling a non-player character, comprising the steps of updating the interaction status between the at least one NPC and the virtual character based on the modified state parameters of the at least one NPC and the individual control logic of the at least one NPC.

2. The step of modifying a state parameter corresponding to at least one NPC within the NPC group by the group control logic in response to an influencing factor between the virtual character and the first NPC within the NPC group is: A method for controlling a non-player character according to claim 1, comprising the step of modifying the state parameter corresponding to the at least one NPC in the NPC group by the group control logic in response to an interaction between the virtual character and the first NPC in the NPC group satisfying a trigger condition.

3. The step of modifying the state parameter corresponding to the at least one NPC in the NPC group by the group control logic in response to the interaction between the virtual character and the first NPC in the NPC group satisfying a trigger condition is: A method for controlling a non-player character according to claim 2, comprising the step of modifying the state parameter corresponding to the at least one NPC in the NPC group by the group control logic in response to the duration of the interaction between the virtual character and the first NPC in the NPC group reaching a time threshold.

4. The step of modifying the state parameter corresponding to the at least one NPC in the NPC group by the group control logic in response to the duration of the interaction between the virtual character and the first NPC in the NPC group reaching a time threshold is: The process includes the steps of: in response to the duration of the interaction between the virtual character and the first NPC within the NPC group reaching the time threshold, the group control logic modifies the state parameter of the first NPC from an active state to a standby state, and the group control logic modifies the state parameter of the second NPC within the NPC group from a standby state to an active state; The method for controlling a non-player character according to claim 3, wherein the active state refers to a state in which the virtual character can be actively interacted with, and the standby state refers to a state in which the virtual character cannot be actively interacted with.

5. The step of modifying the state parameter corresponding to the at least one NPC in the NPC group by the group control logic in response to the interaction between the virtual character and the first NPC in the NPC group satisfying a trigger condition is: A method for controlling a non-player character according to claim 2, comprising the step of modifying the state parameter corresponding to the at least one NPC in the NPC group by the group control logic in response to the operation score of an interaction operation between the first NPC in the NPC group and the virtual character reaching a score threshold.

6. The step of modifying the state parameter corresponding to the at least one NPC in the NPC group by the group control logic in response to the operation score of the interaction operation between the first NPC in the NPC group and the virtual character reaching a score threshold is: A step of querying a correspondence table of operation scores and obtaining the total operation score of the interaction operation between the first NPC and the virtual character within the NPC group, wherein the correspondence table of operation scores includes the operation score corresponding to each interaction operation. The process includes the steps of: in response to the sum of the operation scores of the interaction operations between the first NPC and the virtual character reaching the score threshold, the group control logic modifies the state parameter of the first NPC from an active state to a standby state, and the group control logic modifies the state parameter of the second NPC in the NPC group from a standby state to an active state; The method for controlling a non-player character according to claim 5, wherein the active state refers to a state in which the virtual character can be actively interacted with, and the standby state refers to a state in which the virtual character cannot be actively interacted with.

7. The step of modifying the state parameter corresponding to the at least one NPC in the NPC group by the group control logic in response to the interaction between the virtual character and the first NPC in the NPC group satisfying a trigger condition is: The process includes the step of modifying the state parameter of the first NPC from a standby state to an active state by the group control logic in response to an interaction event between the virtual character and the first NPC within the NPC group matching a predefined interaction event. The method for controlling a non-player character according to claim 2, wherein the active state refers to a state in which the virtual character can be actively interacted with, and the standby state refers to a state in which the virtual character cannot be actively interacted with.

8. The step of modifying a state parameter corresponding to at least one NPC within the NPC group by the group control logic in response to an influencing factor between the virtual character and the first NPC within the NPC group is: A method for controlling a non-player character according to claim 1, comprising the step of modifying an initial state parameter corresponding to the at least one NPC in the NPC group by the group control logic in response to the virtual character and the first NPC in the NPC group entering an interactive scenario, wherein the initial state parameter refers to a default state parameter at the start of a game.

9. In response to the virtual character and the first NPC within the NPC group entering an interactive scenario, the group control logic modifies the initial state parameters corresponding to the at least one NPC within the NPC group, In response to the virtual character and the first NPC within the NPC group entering an interactive scenario, the individual control logic of the first NPC modifies the group state parameter corresponding to the NPC group. A method for controlling a non-player character according to claim 8, comprising the step of modifying the initial state parameter corresponding to the at least one NPC in the NPC group by the group control logic in response to the group control logic detecting a change in the group state parameter.

10. In response to the virtual character and the first NPC within the NPC group entering an interactive scenario, the group control logic modifies the initial state parameters corresponding to the at least one NPC within the NPC group, A method for controlling a non-player character according to claim 8, comprising the step of modifying the initial state parameters corresponding to the at least one NPC in the NPC group by the group control logic in response to the virtual character attacking the first NPC in the NPC group.

11. In response to the virtual character and the first NPC within the NPC group entering an interactive scenario, the group control logic modifies the initial state parameters corresponding to the at least one NPC within the NPC group, A method for controlling a non-player character according to claim 8, comprising the step of modifying the initial state parameters corresponding to the at least one NPC in the NPC group by the group control logic in response to the virtual character entering the field of view of the first NPC in the NPC group.

12. The control method for non-player characters is as follows: The steps include obtaining the relationship between the first NPC and the third NPC within the aforementioned NPC organization, A method for controlling a non-player character according to any one of claims 1 to 11, further comprising the step of modifying a state parameter corresponding to the third NPC by the group control logic based on the association relationship between the first NPC and the third NPC.

13. The aforementioned relationship includes positive relationships, and these positive relationships refer to relationships in which the direction of action of NPCs coincides. The step of modifying the state parameters corresponding to the third NPC by the group control logic based on the relationship between the first NPC and the third NPC is: A method for controlling a non-player character according to claim 12, further comprising the step of correcting the state parameters of the first NPC and the third NPC to a matching state by the group control logic when the first NPC and the third NPC are in the positive relationship.

14. The aforementioned relationship includes a negative relationship, and the aforementioned negative relationship refers to a relationship in which the directions of action of the NPCs are in opposition. The step of modifying the state parameters corresponding to the third NPC by the group control logic based on the relationship between the first NPC and the third NPC is: A method for controlling a non-player character according to claim 12, further comprising the step of modifying the state parameters of the first NPC and the third NPC to a contradictory state by the group control logic when the first NPC and the third NPC are in the negative relationship.

15. The step of modifying a state parameter corresponding to at least one NPC within the NPC group by the group control logic in response to an influencing factor between the virtual character and the first NPC within the NPC group is: A method for controlling a non-player character according to claim 1, comprising the step of modifying the state parameter corresponding to the at least one NPC in the NPC group by the group control logic in order of activation priority, in response to influencing factors between the virtual character and the first NPC in the NPC group.

16. The step of modifying a state parameter corresponding to at least one NPC within the NPC group by the group control logic in response to an influencing factor between the virtual character and the first NPC within the NPC group is: A method for controlling a non-player character according to claim 1, comprising the step of modifying the state parameter corresponding to the at least one NPC in the NPC group by the group control logic in response to an influencing factor between the virtual character and the first NPC in the NPC group, according to a preset number of activations.

17. A control device for non-player characters, An acquisition module configured to acquire group control logic and individual control logic for each of multiple NPCs, wherein the group control logic is control logic corresponding to an NPC group, and the NPC group includes the multiple NPCs, and the acquisition module A control module configured to modify a state parameter corresponding to at least one NPC within the NPC group by the group control logic in response to influencing factors between a virtual character and a first NPC within the NPC group, A control device for a non-player character, comprising: an update module configured to update the interaction status between the at least one NPC and the virtual character based on the modified state parameters of the at least one NPC and the individual control logic of the at least one NPC.

18. A computer device comprising a processor and memory, A computer device wherein the memory stores at least one computer program, and the processor loads and executes the at least one computer program to realize the method for controlling a non-player character according to any one of claims 1 to 11, 15, and 16.

19. A computer program that causes a computer to perform a method for controlling a non-player character according to any one of claims 1 to 11, 15, and 16.