Non-player character control method and device, equipment, medium and program product
By responding to the interaction factors between virtual characters and NPCs and modifying the status parameters of NPCs, the problem of solidifying NPC control logic in the existing technology is solved, the interaction quality between NPCs and virtual characters is improved, and a more realistic and rich gaming experience is provided.
Patent Information
- Application Number
- CN202310548686.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-16
- Publication Date
- 2024-11-22
AI Technical Summary
The control logic of non-player characters (NPCs) in the prior art is too solidified, resulting in the state switching that is too frequent when the virtual character is moved, and the switching is too slow when it is not moved, with a low degree of intelligence, and cannot provide a rich and real interactive experience. .
By obtaining the control logic of multiple NPCs, responding to the influencing factors between the virtual role and the NPC, modifying the group control logic to update the state parameters of the NPC, thereby updating the interaction between the NPC and the virtual role based on the individual control logic, so that the NPC's Behavior is closer to virtual characters controlled by real users.
It realizes that the interaction between NPC and virtual characters is richer and more realistic, improves the user experience, enhances the intelligence of NPC, and makes the behavior of NPC more in line with user expectations.
Smart Images

Figure CN118987620A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a method, device, equipment, medium and program product for controlling a non-player character. Background Art
[0002] In applications based on virtual environments, such as Massive Multi-player Online Game (MMOG), users can control virtual characters to move in the virtual environment. In addition, there are non-player characters (NPC) in the virtual environment. NPCs can interact with the virtual characters controlled by users, for example, attacking the virtual characters controlled by users, or NPCs can promote the plot attached to the task or help users complete the task.
[0003] In the related art, the NPC is controlled to change its state through a preset control logic, thereby controlling the NPC to interact with the virtual character. For example, when the virtual character approaches the NPC, the NPC enters an active state, and the NPC in the active state can interact with the virtual character. When the virtual character moves away from the NPC, the NPC enters an idle state, and the NPC in the idle state does not interact with the virtual character.
[0004] However, in the related technology, the control logic of NPC is relatively rigid. When the virtual character moves, the state switching of NPC is too frequent. When the virtual character does not move, the state switching of NPC is too slow. During this period, NPC can only switch states according to the preset control logic, and the intelligence level of NPC is relatively low. Summary of the invention
[0005] The present application provides a control method, device, equipment, medium and program product for a non-player character, and the technical solution is as follows:
[0006] According to one aspect of the present application, a method for controlling a non-player character is provided, the method comprising:
[0007] Acquire control logic of multiple non-player characters NPCs, wherein the control logic refers to code logic that controls the actions of at least one NPC, and the control logic includes individual control logic corresponding to each NPC in an NPC group and group control logic corresponding to the NPC group, wherein the multiple NPCs include at least one NPC group, and the NPC group includes at least two NPCs;
[0008] In response to the influencing factors between the virtual character and the first NPC, controlling the group control logic to modify a state parameter corresponding to at least one NPC in the first NPC group where the first NPC is located;
[0009] Based on the modified state parameters and the individual control logic, the interaction between the NPCs in the first NPC group and the virtual character is updated.
[0010] According to one aspect of the present application, a control device for a non-player character is provided, the device comprising:
[0011] An acquisition module is used to acquire control logic of multiple non-player characters NPCs, wherein the control logic refers to code logic that controls the actions of at least one NPC, and the control logic includes individual control logic corresponding to each NPC in an NPC group and group control logic corresponding to the NPC group, wherein the multiple NPCs include at least one NPC group, and the NPC group includes at least two NPCs;
[0012] A control module, configured to control the group control logic to modify a state parameter corresponding to at least one NPC in a first NPC group to which the first NPC belongs in response to an influencing factor between the virtual character and the first NPC;
[0013] An updating module is used to update the interaction between the NPCs in the first NPC group and the virtual character based on the modified state parameters and the individual control logic.
[0014] According to another aspect of the present application, a computer device is provided, which includes: a processor and a memory, wherein at least one computer program is stored in the memory, and the at least one computer program is loaded and executed by the processor to implement the control method of the non-player character as described above.
[0015] According to another aspect of the present application, a computer storage medium is provided, wherein at least one computer program is stored in the computer-readable storage medium, and the at least one computer program is loaded and executed by a processor to implement the control method of the non-player character as described above.
[0016] According to another aspect of the present application, a computer program product is provided, which includes a computer program stored in a computer-readable storage medium; the computer program is read and executed from the computer-readable storage medium by a processor of a computer device, so that the computer device executes the control method of a non-player character as described above.
[0017] The beneficial effects of the technical solution provided by this application include at least:
[0018] The control logic of multiple NPCs is obtained, and in response to the influencing factors between the virtual character and the first NPC, the group control logic is controlled to modify the state parameters corresponding to at least one NPC in the first NPC group where the first NPC is located; based on the modified state parameters and the individual control logic, the interaction between the NPCs in the first NPC group and the virtual character is updated. This application uses the interaction between the virtual character and the individual NPC to link and influence the state parameters corresponding to the NPCs in the NPC group, thereby updating the interaction between the NPCs in the NPC group and the virtual character, making the interaction activities between the NPC and the virtual character richer and more realistic. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0020] Figure 1 is a schematic diagram of a control method for a non-player character provided by an exemplary embodiment of the present application;
[0021] Figure 2 is a schematic diagram of the architecture of a computer system provided by an exemplary embodiment of the present application;
[0022] Figure 3 is a flow chart of a method for controlling a non-player character provided by an exemplary embodiment of the present application;
[0023] Figure 4 is a flow chart of a method for controlling a non-player character provided by an exemplary embodiment of the present application;
[0024] Figure 5 is a schematic diagram of the association between individual control logic and group control logic provided by an exemplary embodiment of the present application;
[0025] Figure 6 is a schematic diagram of the interaction between a virtual character and an NPC provided by an exemplary embodiment of the present application;
[0026] Figure 7 is a schematic diagram of the interaction between a virtual character and an NPC provided by an exemplary embodiment of the present application;
[0027] Figure 8 is a flow chart of a method for controlling an NPC provided by an exemplary embodiment of the present application;
[0028] Fig. 9is a flow chart of a method for controlling an individual NPC provided by an exemplary embodiment of the present application;
[0029] Fig.10 is a flow chart of a method for controlling an NPC provided by an exemplary embodiment of the present application;
[0030] Fig.11 is a flow chart of a method for controlling an NPC provided by an exemplary embodiment of the present application;
[0031] Fig.12 is a block diagram of a control device for a non-player character provided by an exemplary embodiment of the present application;
[0032] Fig.13 It is a structural diagram of a computer device provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0033] In order to make the purpose, technical scheme and advantages of the present application clearer, the implementation mode of the present application will be further described in detail below in conjunction with the accompanying drawings. The exemplary embodiments will be described in detail here, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation modes described in the following exemplary embodiments do not represent all implementation modes consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims.
[0034] The terms used in this disclosure are for the purpose of describing specific embodiments only and are not intended to limit the disclosure. The singular forms of "a", "said" and "the" used in this disclosure and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0035] It should be understood that although the terms first, second, third, etc. may be used in the present disclosure to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other.
[0036] First, the nouns involved in the embodiments of the present application are introduced:
[0037] Virtual environment: is a virtual environment displayed (or provided) when an application is running on a terminal. The virtual environment can be a simulation of the real world, a semi-simulation and semi-fictitious environment, or a purely fictitious environment. The virtual environment can be any one of a two-dimensional virtual environment, a 2.5-dimensional virtual environment, and a three-dimensional virtual environment, and this application does not limit this. The following embodiments are illustrated by taking the virtual environment as a three-dimensional virtual environment.
[0038] Virtual character: refers to an active character in a virtual environment. The active character can be a virtual person, virtual animal, cartoon character, etc. For example, people, animals, plants, walls, stones, pools, etc. displayed in a virtual environment. The virtual character is controlled by the user. The virtual character can be classified by job, such as pharmacist, magician, medical practitioner, etc.; it can also be classified by category, such as humans, beasts, fairies, etc. Each virtual character has its own shape and volume in the virtual environment and occupies a part of the space in the virtual environment.
[0039] Multiplayer online games (MMOGs): refers to games whose servers can provide a large number of players online at the same time. They are also named Massive Multi-Player Online Role-Playing Games (MMORPGs). The game provides users with a virtual world. In the game, users can create virtual characters, control the virtual characters to carry out corresponding activities, and complete the corresponding tasks. Virtual characters controlled by multiple users can form a team to complete the same task together, or fight against other teams.
[0040] Non-player character NPC: refers to a virtual character that is not controlled by the user in the game. It is generally controlled by the computer's artificial intelligence and is a virtual character that can have its own behavior pattern. The types of NPC include: plot NPC, fighting NPC, service NPC, etc. Plot NPC refers to an NPC that provides story plots or information for the virtual character controlled by the user. When the virtual character controlled by the user performs a task in the game, the task is accompanied by a corresponding story plot. Optionally, according to the communication information or actions between the user and the plot NPC, the NPC can make different feedback, such as dropping virtual props, providing prompt information, issuing new tasks, etc.; fighting NPC refers to an NPC that can fight with the virtual character controlled by the user. The fighting NPC can be a virtual character belonging to the same team as the virtual character controlled by the user, or it is an NPC that the virtual character controlled by the user needs to attack (that is, an enemy NPC); service NPC refers to an NPC that provides services for the virtual character controlled by the user. For example, the service NPC is a merchant virtual character, a training virtual character, etc. in the virtual environment. Optionally, this type of NPC performs fixed actions or publishes fixed information. The virtual character controlled by the user receives the service of the service NPC and obtains corresponding information, props, experience points, etc.
[0041] The present application embodiment provides a schematic diagram of a control method for a non-player character, such as Figure 1 As shown, the method can be executed by a computer device, and the computer device can be a terminal or a server.
[0042] For example, Figure 1 As shown in Figure (a), a game interface is displayed on the user interface, and the game interface includes a virtual character 10 and multiple NPCs. The computer device obtains the control logic of the multiple NPCs, and the control logic refers to the code logic that controls the action of at least one NPC. The control logic includes the individual control logic corresponding to each NPC in the NPC group and the group control logic corresponding to the NPC group. The multiple NPCs include at least one NPC group, and the NPC group includes at least two NPCs; the computer device responds to the interactive operation between the virtual character 10 and the first NPC, and controls the group control logic to modify the state parameters corresponding to at least one NPC in the first NPC group where the first NPC is located; the computer device updates the interaction between the NPC in the first NPC group and the virtual character based on the modified state parameters and individual control logic.
[0043] The NPC has a specific image. The NPC can be an NPC with a human image, or an NPC with an animal image, or an NPC with an image of a mythical beast or a fairy, or an NPC with an image of a natural landscape, or an NPC with an image of an artificial landscape, but is not limited to this. The embodiments of the present application do not make specific limitations on this.
[0044] Multiple NPCs refer to all NPCs in this game, or some NPCs in this game, or NPCs displayed in the user interface, or NPCs within the field of vision of the virtual character, or NPCs in the first NPC group where the first NPC is located, but are not limited to this, and the embodiments of the present application do not make specific limitations on this.
[0045] Multiple NPCs can belong to the same group, or to multiple groups.
[0046] Optionally, the interactive operation includes at least one of normal attack, defense, releasing a big move, typing chat, voice chat, and giving gifts, but is not limited to this, and the embodiments of the present application do not make specific limitations on this.
[0047] State parameters refer to the state of the NPC in the virtual environment.
[0048] Optionally, the state parameter includes at least one of an activation state and an idle state, but is not limited thereto and is not specifically limited in the embodiments of the present application.
[0049] 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 walks past the virtual character 10 without interacting with the virtual character.
[0050] In some embodiments, the active state refers to the state when the NPC interacts with the virtual character 10 by releasing a special skill. For example, the NPC can attack the virtual character 10 by releasing a special skill. Special skills refer to skills with higher attack values and larger attack ranges. The idle state refers to the state when the NPC interacts with the virtual character 10 by releasing ordinary attack skills.
[0051] Optionally, taking the state of the NPC as an example, the activation state includes the hit state and the attack state. The hit state refers to the state when the NPC is subjected to a big move skill released by the virtual character; the attack state refers to the state when the NPC releases a big move skill to the virtual character.
[0052] Exemplarily, in response to the virtual character 10 and the first NPC entering into an interactive scenario, the computer device controls the group control logic to modify an initial state parameter corresponding to at least one NPC in the first NPC group.
[0053] The initial state parameters refer to the default state parameters of the NPCs in the first NPC group at the beginning of the game.
[0054] For example, Figure 1As shown in Figure (a), the NPCs include NPC 1, NPC 2 and NPC 3. NPC 1, NPC 2 and NPC 3 belong to the same NPC group (the first NPC group). The default state of NPC 1, NPC 2 and NPC 3 at the beginning of the game is idle, that is, NPC 1, NPC 2 and NPC 3 will not actively attack the virtual character 10.
[0055] Exemplarily, when the virtual character 10 attacks the first NPC or the virtual character enters the field of vision of the first NPC, the computer device controls the group control logic to modify the initial state parameters corresponding to at least one NPC in the first NPC group.
[0056] The field of view range refers to a fan-shaped range with the NPC as the center, or a circle center range with the NPC as the center, or a regular graphic range with the NPC as the center, or an irregular graphic range with the NPC as the center, but is not limited to this, and the embodiments of the present application do not make specific limitations on this.
[0057] The size range of the visual field is not specifically limited.
[0058] like Figure 1 As shown in Figure (b), when the virtual character 10 enters the field of vision of NPC Two, the computer device controls the group control logic to modify the initial state parameters corresponding to NPC One, NPC Two and NPC Three, and changes NPC Two from an idle state to an activated state, while keeping NPC One and NPC Three in an idle state. Then, the computer device updates the interaction between NPC One, NPC Two and NPC Three and the virtual character 10 based on the state parameters corresponding to NPC One, NPC Two and NPC Three and their respective individual control logics. That is, NPC Two actively attacks the virtual character 10, and NPC One and NPC Three walk away.
[0059] In some embodiments, in response to the duration of the interactive operation between the virtual character 101 and the first NPC reaching a time threshold, the computer device controls the group control logic to change the state parameters of the first NPC from an activated state to an idle state, and changes the state parameters of the second NPC from an idle state to an activated state.
[0060] The first NPC refers to an NPC in an activated state, and the second NPC refers to an NPC in an idle state.
[0061] For example, the NPCs in the first NPC group include NPC one, NPC two and NPC three. When the fighting duration between the virtual character 10 and NPC two reaches 20s, the computer device controls the group control logic to modify the state parameters of NPC one, NPC two and NPC three. For example, the state parameters of NPC two are modified from an activated state to an idle state, and the state parameters of NPC one and NPC three are modified from an idle state to an activated state. That is, after the attack duration between the virtual character 10 and NPC two reaches 20s, NPC two no longer continues to fight with the virtual character 10, NPC two moves away from the virtual character 10, and NPC one and NPC three start to fight with the virtual character 10.
[0062] In some embodiments, in response to the sum of the operation points of the interactive operations between the first NPC and the virtual character 10 reaching a point threshold, the computer device controls the group control logic to modify the state parameters of the first NPC from an activated state to an idle state, and to modify the state parameters of the second NPC from an idle state to an activated state.
[0063] For example, the NPCs in the first NPC group include NPC one, NPC two and NPC three. During the fight between the virtual character 10 and NPC one, each time NPC one releases a big move, 5 points are added. When the points reach 15 points, the computer device control group control logic modifies the state parameters of NPC one, NPC two and NPC three. For example, the state parameters of NPC one are modified from an activated state to an idle state, and the state parameters of NPC two and NPC three are modified from an idle state to an activated state. That is, during the fight between the virtual character 10 and NPC one, after NPC one releases three big moves, NPC one does not continue to fight with the virtual character 10, NPC one moves away from the virtual character 10, and NPC two and NPC three start fighting with the virtual character 10.
[0064] In some embodiments, the association relationship between the first NPC and the third NPC in the first NPC group is obtained; when the first NPC and the third NPC are in a positive relationship, the control group control logic modifies the state parameters of the first NPC and the third NPC to a consistent state; when the first NPC and the third NPC are in a negative relationship, the control group control logic modifies the state parameters of the first NPC and the third NPC to an opposite state.
[0065] A positive relationship refers to a relationship that makes the actions of at least two NPCs in the same NPC group consistent.
[0066] A negative relationship refers to a relationship that causes at least two NPCs in the same NPC group to act in opposite directions.
[0067] For example, the NPCs in the first NPC group include NPC 1, NPC 2 and NPC 3, NPC 1 and NPC 2 are in an active relationship, and NPC 2 and NPC 3 are in a negative relationship. Assuming that NPC 1, NPC 2 and NPC 3 are all in an activated state, when the virtual character 10 fights with NPC 2, the computer device controls the group control logic to modify the state parameters of NPC 1, NPC 2 and NPC 3. Since NPC 1 and NPC 2 are in an active relationship, the state of NPC 1 is maintained in an activated state, and NPC 1 also joins the fight between the virtual character 10 and NPC 2; since NPC 2 and NPC 3 are in a negative relationship, the state of NPC 3 is modified to an idle state, and NPC 3 stays away from the fight scene.
[0068] In summary, the method provided in this embodiment obtains the control logic of multiple NPCs, and in response to the influencing factors between the virtual character and the first NPC, controls the group control logic to modify the state parameters corresponding to at least one NPC in the first NPC group where the first NPC is located; based on the modified state parameters and the individual control logic, updates the interaction between the NPCs in the first NPC group and the virtual character. This application modifies the state parameters corresponding to the NPCs in the NPC group through the group control logic, and the NPC can update the interaction with the virtual character based on the modified state parameters and the individual control logic, thereby making the interactive activities between the NPC and the virtual character richer and more realistic, making the NPC's behavior closer to the virtual character controlled by the real user, and improving the user experience.
[0069] Figure 2 The following is a block diagram of a computer system according to an exemplary embodiment of the present application. The computer system 100 includes: a first terminal 110 , a server 120 , and a second terminal 130 .
[0070] The first terminal 110 is installed and runs a client 111 that supports a virtual environment, and the client 111 can 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. The client 111 can be any one of MMOG, battle royale shooting game, virtual reality (VR) application, augmented reality (AR) program, three-dimensional map program, virtual reality game, augmented reality game, first-person shooting game (First-Person Shooting Game, FPS), third-person shooting game (Third-Person Shooting Game, TPS), multiplayer online tactical competitive game (Multiplayer Online BattleArena Games, MOBA), and strategy game (Simulation Game, SLG). In this embodiment, the client 111 is an MMOG game for example. The first terminal 110 is a terminal used by the first user 112. The first user 112 uses the first terminal 110 to control the first virtual character in the virtual environment to perform activities, or to operate the virtual items owned by the second virtual character. The first virtual character can be referred to as the virtual character of the first user 112. The first user 112 can assemble, disassemble, and uninstall the virtual items owned by the first virtual character, and this application does not limit this. Schematically, the first virtual character is a first virtual character, such as a simulated human character or an animated human character.
[0071] The second terminal 130 is installed and runs a client 131 that supports a virtual environment, and the client 131 can 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. The client can be any one of MMOG, battle royale shooting game, VR application, AR program, three-dimensional map program, virtual reality game, augmented reality game, FPS, TPS, MOBA, SLG. In this embodiment, the client is an MMOG game for example. The second terminal 130 is a terminal used by the second user 113. The second user 113 uses the second terminal 130 to control the second virtual character in the virtual environment to carry out activities and operate the virtual items owned by the second virtual character. The second virtual character can be called the virtual character of the second user 113. Schematically, the second virtual character is a second virtual character, such as a simulated character or an anime character.
[0072] Optionally, the first virtual character and the second virtual character are in the same virtual environment. Optionally, the first virtual character and the second virtual character may belong to the same camp, the same team, the same organization, have a friend relationship, or have temporary communication permissions. Optionally, the first virtual character and the second virtual character may belong to different camps, different teams, different organizations, or have a hostile relationship.
[0073] Optionally, the client installed on the first terminal 110 and the second terminal 130 is the same, or the client installed on the two terminals is the same type of client on different operating system platforms (Android or IOS). The first terminal 110 may refer to one of a plurality of terminals, and the second terminal 130 may refer to another of a plurality of terminals. This embodiment is only illustrated by taking the first terminal 110 and the second terminal 130 as examples. The device types of the first terminal 110 and the second terminal 130 are the same or different, and the device type includes at least one of: a smart phone, a tablet computer, an e-book reader, an MP3 player, an MP4 player, a laptop portable computer, and a desktop computer.
[0074] Figure 2 Only two terminals are shown, but in different embodiments, there are multiple other terminals 140 that can access the server 120. Optionally, there are one or more terminals 140 corresponding to the developer, and a development and editing platform for the client supporting the virtual environment is installed on the terminal 140. The developer can edit and update the client on the terminal 140, and transmit the updated client installation package to the server 120 through 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 update the client.
[0075] The first terminal 110 , the second terminal 130 , and other terminals 140 are connected to the server 120 via a wireless network or a wired network.
[0076] The server 120 includes at least one of a single server, multiple servers, a cloud computing platform, and a virtualization center. The server 120 is used to provide background services for the client supporting the three-dimensional virtual environment. Optionally, the server 120 undertakes the main computing work, and the terminal undertakes the secondary computing work; or, the server 120 undertakes the secondary computing work, and the terminal undertakes the main computing work; or, the server 120 and the terminal adopt a distributed computing architecture for collaborative computing.
[0077] In an illustrative example, the server 120 includes a processor 122, a user account database 123, a battle service module 124, and a user-oriented input / output interface (I / O interface) 125. The processor 122 is used to load instructions stored in the server 120 and process data in the user account database 123 and the battle service module 124; the user account database 123 is used to store data of user accounts used by the first terminal 110, the second terminal 130, and other terminals 140, such as the user account's avatar, the user account's nickname, the user account's combat power index, and the service area where the user account is located; the battle service module 124 is used to provide multiple battle rooms for users to fight, such as 1V1 battle, 3V3 battle, 5V5 battle, etc.; the user-oriented I / O interface 125 is used to establish communication and exchange data with the first terminal 110 and / or the second terminal 130 through a wireless network or a wired network.
[0078] Figure 3 is a flowchart of a method for controlling a non-player character provided by an exemplary embodiment of the present application. The method may be executed by a computer device, which may be Figure 2 The method comprises:
[0079] Step 302: Obtain control logic of multiple non-player characters NPC.
[0080] Multiple NPCs refer to all NPCs in this game, or some NPCs in this game, or NPCs displayed in the user interface, or NPCs within the field of vision of the virtual character, or NPCs in the first NPC group where the first NPC is located, but are not limited to this, and the embodiments of the present application do not make specific limitations on this.
[0081] Multiple NPCs can belong to the same group, or to multiple groups.
[0082] Control logic refers to the code logic that controls the actions of at least one NPC.
[0083] The control logic includes individual control logic corresponding to each NPC in the NPC group and group control logic corresponding to the NPC group. The multiple NPCs include at least one NPC group, and the NPC group includes at least two NPCs.
[0084] Individual control logic refers to the code logic that controls a single NPC to perform activities.
[0085] Group control logic refers to the code logic that controls multiple NPCs to act together.
[0086] Optionally, the NPC has a specific image, or the NPC does not have a specific image.
[0087] Taking the example that the NPC does not have a specific image, the NPC can talk to the virtual character, give gifts or ask questions through a dialog box, but is not limited to this. The embodiments of the present application do not make specific limitations on this.
[0088] Taking the example of an NPC having a specific image, the NPC can be an NPC with a human image, or an NPC with an animal image, or an NPC with an image of a mythical beast or fairy, or an NPC with an image of a natural landscape, or an NPC with an image of an artificial landscape, but is not limited to this, and the embodiments of the present application do not make specific limitations on this.
[0089] Step 304: In response to the influencing factors between the virtual character and the first NPC, the group control logic is controlled to modify a state parameter corresponding to at least one NPC in the first NPC group to which the first NPC belongs.
[0090] An influencing factor refers to a factor that can trigger the modification of at least one NPC's status parameter, such as the interactive operation between the NPC and the virtual character, the position distance between the NPC and the virtual character, the interaction time between the NPC and the virtual character, and the time that the NPC and the virtual character are in the same location area, but is not limited to this. The embodiments of the present application do not make specific limitations on this.
[0091] State parameters refer to the state of the NPC in the virtual environment.
[0092] Optionally, the state parameter includes at least one of an activation state and an idle state, but is not limited thereto and is not specifically limited in the embodiments of the present application.
[0093] The activated state refers to the state when the NPC can actively interact with the virtual character. For example, the NPC can actively attack the virtual character.
[0094] The idle state refers to the state when the NPC cannot actively interact with the virtual character. For example, the NPC walks past the virtual character without interacting with it.
[0095] Step 306: Based on the modified state parameters and individual control logic, the interaction between the NPCs in the first NPC group and the virtual characters is updated.
[0096] Exemplarily, after obtaining the modified state parameters, the individual control logic controls the NPCs in the first NPC group to interact with the virtual character using the modified state parameters.
[0097] In summary, the method provided in this embodiment obtains the control logic of multiple NPCs, and in response to the influencing factors between the virtual character and the first NPC, controls the group control logic to modify the state parameters corresponding to at least one NPC in the first NPC group where the first NPC is located; based on the modified state parameters and the individual control logic, updates the interaction between the NPCs in the first NPC group and the virtual character. This application modifies the state parameters of the NPCs in the entire NPC group based on the state of the individual NPC, and updates the interaction between the NPCs in the entire NPC group and the virtual character based on the modified state parameters and the individual control logic, thereby making the interactive activities between the NPCs and the virtual characters richer and more realistic, making the behavior of the NPCs closer to the virtual characters controlled by real users, and improving the user experience.
[0098] Figure 4 is a flowchart of a method for controlling a non-player character provided by an exemplary embodiment of the present application. The method may be executed by a computer device, which may be Figure 2 The method comprises:
[0099] Step 402: Obtain control logic of multiple non-player characters NPC.
[0100] Multiple NPCs refer to all NPCs in this game, or some NPCs in this game, or NPCs displayed in the user interface, or NPCs within the field of vision of the virtual character, or NPCs in the first NPC group where the first NPC is located, but are not limited to this, and the embodiments of the present application do not make specific limitations on this.
[0101] Control logic refers to the code logic that controls the actions of at least one NPC.
[0102] The control logic includes individual control logic corresponding to each NPC in the NPC group and group control logic corresponding to the NPC group. The multiple NPCs include at least one NPC group, and the NPC group includes at least two NPCs.
[0103] Individual control logic refers to the code logic that controls a single NPC to perform activities.
[0104] Group control logic refers to the code logic that controls multiple NPCs to act together.
[0105] Optionally, the NPC has a specific image, or the NPC does not have a specific image.
[0106] Step 404: In response to the interactive operation between the virtual character and the first NPC satisfying the trigger condition, the group control logic is controlled to modify a state parameter corresponding to at least one NPC in the first NPC group.
[0107] The interactive operation includes at least one of normal attack, defense, releasing a big move, typing chat, voice chat, and gift giving, but is not limited to these. The embodiments of the present application do not make specific limitations on this.
[0108] State parameters refer to the state of the NPC in the virtual environment.
[0109] Optionally, the state parameter includes at least one of an activation state and an idle state, but is not limited thereto and is not specifically limited in the embodiments of the present application.
[0110] The activated state refers to the state when the NPC can actively interact with the virtual character. For example, the NPC can actively attack the virtual character.
[0111] The idle state refers to the state when the NPC cannot actively interact with the virtual character. For example, the NPC walks past the virtual character without interacting with it.
[0112] Exemplarily, the triggering condition includes at least one of the following, but is not limited thereto:
[0113] The duration of the interaction between the avatar and the first NPC reaches the time threshold;
[0114] The operation points of the interaction between the first NPC and the virtual character reach the points threshold;
[0115] The virtual character does not interact with the first NPC in the active state, but actively interacts with the second NPC in the first NPC group in the idle state.
[0116] For example, Figure 5 As shown, when the virtual character and the NPC enter into an interactive scene, the individual control logic 501 detects the interactive operations between the NPC and the virtual character in real time. When the interactive operations between the NPC and the virtual character meet the trigger conditions, the individual control logic 501 notifies the group control logic 502 to modify the status parameters corresponding to at least one NPC in the first NPC group. When modifying the status parameters of at least one NPC in the first NPC group, the group control logic 502 may modify the status parameters according to the priority of the NPC. The priority of the NPC includes: at least one of: a specified status parameter, the level of the NPC, the distance between the NPC and the virtual character, and the angle between the NPC and the virtual character, but is not limited thereto.
[0117] For example, if the user does not specify the NPC level, modifications are made in sequence according to the NPC level; if the NPC levels are the same, modifications are made in sequence according to 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, modifications are made in sequence according to the angle between the NPC and the virtual character.
[0118] In some embodiments, in response to the duration of the interactive operation between the virtual character and the first NPC reaching a time threshold, the computer device controls the group control logic to modify a state parameter corresponding to at least one NPC in the first NPC group.
[0119] In response to the duration of the interactive operation between the virtual character and the first NPC reaching a time threshold, the computer device controls the group control logic to change the state parameters of the first NPC from an activated state to an idle state, and changes the state parameters of the second NPC in the first NPC group from an idle state to an activated state.
[0120] The first NPC refers to an NPC in an activated state, and the second NPC refers to an NPC in an idle state.
[0121] like Figure 6 The schematic diagram of the interaction between the virtual character and the NPC is shown as follows: Figure 6 NPC 1 603, NPC 2 602 and NPC 3 604 are shown in FIG. (a). NPC 1 603, NPC 2 602 and NPC 3 604 all belong to the first NPC group. The time threshold is set to 20s. When the fighting time between the virtual character 601 and NPC 2 602 reaches 20s, the computer device controls the group control logic to modify the state parameters of NPC 1 603, NPC 2 602 and NPC 3 604. For example, the state parameters of NPC 2 602 are modified from the activated state to the idle state, the state parameters of NPC 1 603 are modified from the idle state to the activated state, and the state parameters of NPC 3 604 are kept in the idle state. That is, after the attack time between the virtual character 601 and NPC 2 602 reaches 20s, as shown in FIG. Figure 6 As shown in Figure (b), NPC 2 602 no longer continues to fight with the virtual character 601, NPC 2 602 moves away from the virtual character 601, and NPC 1 603 starts to fight with the virtual character 601. The duration in the figure is the interaction duration between the virtual character 601 and the NPC. The duration in the figure can be visible or invisible, and the embodiment of the present application does not make any specific limitation on this.
[0122] In some embodiments, in response to the operation score of the interactive operation between the first NPC and the virtual character reaching a score threshold, the computer device controls the group control logic to modify a state parameter corresponding to at least one NPC in the first NPC group.
[0123] The operation score refers to the score corresponding to each operation in the process of the first NPC interacting with the virtual character, as shown in Table 1.
[0124] Table 1 Operation points correspondence table
[0125]
[0126]
[0127] In the table, it is assumed that the NPC's operation points are 20. When the NPC is in an activated state and uses skill A, if it effectively hits the virtual player, 5 points will be added. As time goes by, 1 point will be added per second. When the total operation points reach 20, the NPC changes from an activated state to an idle state. After the state is switched, 5 points will be reduced. After that, in an idle state, the points will be reduced by 2 points per second as time goes by until it reaches 0.
[0128] The computer device obtains an operation score correspondence table corresponding to the interactive operations. In response to the sum of the operation scores of the interactive operations between the first NPC and the virtual character reaching a score threshold, the computer device controls the group control logic to change the state parameter of the first NPC from an activated state to an idle state, and changes the state parameter of the second NPC from an idle state to an activated state.
[0129] For example, the NPCs in the first NPC group include NPC one, NPC two and NPC three. During the fight between the virtual character and NPC one, each time NPC one releases a big move, 5 points are added. When the points reach 15 points, the computer device control group control logic modifies the state parameters of NPC one, NPC two and NPC three. For example, the state parameters of NPC one are changed from an activated state to an idle state, and the state parameters of NPC two and NPC three are changed from an idle state to an activated state. That is, during the fight between the virtual character and NPC one, after NPC one releases three big moves, NPC one does not continue to fight with the virtual character, NPC one moves away from the virtual character, and NPC two and NPC three start fighting with the virtual character.
[0130] In some embodiments, when the virtual character of the computer device does not interact with the first NPC in an activated state, but interacts with the second NPC in an idle state in the first NPC group, the control group control logic changes the state parameters of the first NPC from an activated state to an idle state, and changes the state parameters of the second NPC from an idle state to an activated state.
[0131] For example, during the process of the virtual character interacting with the first NPC in the activated state, when the virtual character actively interacts with the second NPC in the idle state, the control group control logic changes the state parameters of the first NPC from the activated state to the idle state, and changes the state parameters of the second NPC from the idle state to the activated state.
[0132] For example, the first NPC and the second NPC are in the same NPC team. The first NPC is in an activated state and is fighting with a virtual character, while the second NPC is in an idle state and is pacing nearby. When the virtual character actively attacks the second NPC, the computer device control group control logic changes the state parameter of the first NPC from an activated state to an idle state, and changes the state parameter of the second NPC from an idle state to an activated state, that is, the second NPC starts to fight with the virtual character, and the first NPC ends the fight and leaves the virtual character.
[0133] In some embodiments, in response to the distance between the virtual character and the first NPC being less than a distance threshold, the computer device controls the group control logic to modify a state parameter corresponding to at least one NPC in the first NPC group.
[0134] For example, the distance threshold is set to 3 meters. When 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 is controlled to modify the status parameters corresponding to at least one NPC in the first NPC group. For example, the status parameters of the first NPC are modified to an activated state, and the first NPC releases a big move skill to the virtual character, while other NPCs in the first NPC group remain idle, and other NPCs leave the fighting area between the first NPC and the virtual character.
[0135] In some embodiments, in response to the virtual character and the first NPC being in the same location area, the computer device controls the group control logic to modify a state parameter corresponding to at least one NPC in the first NPC group.
[0136] Optionally, the same location area includes at least one of the same floor, the same car, the same cave, and the same combat zone, but is not limited thereto and is not specifically limited to this in the embodiments of the present application.
[0137] For example, taking the same location area as the same floor, when the virtual character and the first NPC are on the same floor, the virtual character and the NPC enter an interactive scenario, and the control group control logic modifies the state parameters corresponding to at least one NPC in the first NPC group, for example, the state parameters of the first NPC are modified to an activated state, the first NPC actively attacks the virtual character, or the first NPC releases a big move skill to the virtual character, while other NPCs in the first NPC group remain idle.
[0138] In some embodiments, in response to the time that the virtual character and the first NPC are in the same location area reaching a co-location time threshold, the computer device controls the group control logic to modify a state parameter corresponding to at least one NPC in the first NPC group.
[0139] For example, the co-existence time threshold is set to one minute. Taking the same location area as the same floor as an example, when the virtual character and the first NPC are on the same floor for more than one minute, the virtual character and the NPC enter an interactive scenario, and the control group control logic modifies the status parameters corresponding to at least one NPC in the first NPC group. For example, the status parameters of the first NPC are changed from an activated state to an idle state, and the second NPC in the first NPC group is changed from an idle state to an activated state, the second NPC actively attacks the virtual character, or the second NPC releases a big move skill to the virtual character.
[0140] In some embodiments, the NPCs in the first NPC group all have corresponding default status parameters at the beginning of the game. For example, the NPCs in the first NPC group are dispersed in different locations, and the NPCs in the activated state can actively attack the virtual characters, and the NPCs in the idle state are in a wandering state.
[0141] In response to the virtual character and the first NPC entering into an interactive scenario, the computer device controls the group control logic to modify an initial state parameter corresponding to at least one NPC in the first NPC group.
[0142] The initial state parameters refer to the default state parameters of the NPCs in the first NPC group at the beginning of the game.
[0143] For example, the NPCs include NPC 1, NPC 2, and NPC 3, and NPC 1, NPC 2, and NPC 3 belong to the same NPC group (first NPC group). The default state of NPC 1, NPC 2, and NPC 3 at the beginning of the game is idle, that is, NPC 1, NPC 2, and NPC 3 will not actively attack the virtual character. Exemplarily, in response to the virtual character attacking the first NPC, the computer device controls the group control logic to modify the initial state parameter corresponding to at least one NPC in the first NPC group.
[0144] In some embodiments, in response to the virtual character entering the field of view of the first NPC, the computer device controls the group control logic to modify the initial state parameters corresponding to at least one NPC in the first NPC group.
[0145] The field of view range refers to the frontal visible range centered on the NPC.
[0146] For example, a fan-shaped range with the NPC as the center, or a circle center range with the NPC as the center, or a ring range with the NPC as the center, or a regular graphic range with the NPC as the center, or an irregular graphic range with the NPC as the center, but not limited to this, and the embodiments of the present application do not make specific limitations on this.
[0147] The size range of the visual field is not specifically limited.
[0148] For example, when the virtual character enters the field of vision of NPC Two, the computer device controls the group control logic to modify the initial state parameters corresponding to NPC One, NPC Two and NPC Three, changing NPC Two from an idle state to an activated state, and keeping NPC One and NPC Three in an idle state. Then, the computer device updates the interaction between NPC One, NPC Two and NPC Three and the virtual character based on the state parameters corresponding to NPC One, NPC Two and NPC Three and their respective individual control logics. That is, NPC Two actively attacks the virtual character, and NPC One and NPC Three walk away.
[0149] In some embodiments, the NPC carries a blind spot detection prop, which is used to detect virtual characters within the blind spot range of the NPC. The computer device responds to the virtual character entering the blind spot range of the first NPC's field of vision, that is, when the virtual character enters the detection range of the blind spot detection prop of the first NPC, the control group control logic modifies the initial state parameters corresponding to at least one NPC in the first NPC group.
[0150] Among them, the blind spot range refers to the invisible range on the back centered on the NPC.
[0151] In some embodiments, the computer device obtains the association relationship between the first NPC and the third NPC in the first NPC group; and controls the group control logic to modify the state parameter corresponding to the third NPC according to the association relationship between the first NPC and the third NPC.
[0152] Optionally, the association relationship includes at least one of a positive relationship and a negative relationship, but is not limited thereto, and the embodiments of the present application do not make specific limitations on this.
[0153] A positive relationship refers to a relationship that makes at least two NPCs in the same NPC group move in the same direction. For example, a positive relationship includes at least one of a couple relationship, a confidant relationship, a playmate relationship, and a mentor-apprentice relationship, but is not limited thereto, and the present application embodiment does not specifically limit this.
[0154] A negative relationship refers to a relationship that causes at least two NPCs in the same NPC group to act in opposite directions. For example, a negative relationship includes at least one of a hostile relationship and a relationship of different attributes, but is not limited thereto, and the present embodiment of the application does not specifically limit this.
[0155] When the first NPC and the third NPC are in a positive relationship, the control group control logic modifies the state parameters of the first NPC and the third NPC to a consistent state; when the first NPC and the third NPC are in a negative relationship, the control group control logic modifies the state parameters of the first NPC and the third NPC to an opposite state.
[0156] For example, Figure 7 The schematic diagram of the interaction between the virtual character and the NPC shown, the NPCs in the first NPC group include NPC 1 702, NPC 2 703 and NPC 3 704, NPC 1 702 and NPC 2 703 are in an active relationship, and NPC 2 703 and NPC 3 704 are in a negative relationship. Assuming that NPC 1 702, NPC 2 703 and NPC 3 704 are all in an activated state, when the virtual character 701 fights with NPC 2 703, the computer device controls the group control logic to modify the state parameters of NPC 1 702, NPC 2 703 and NPC 3 704. Since NPC 1 702 and NPC 2 703 are in an active relationship, the state of NPC 1 702 is maintained in an activated state, and NPC 1 702 also joins the fight between the virtual character 701 and NPC 2 703; since NPC 2 703 and NPC 3 704 are in a negative relationship, the state of NPC 3 704 is modified to an idle state, and NPC 3 704 stays away from the fighting scene.
[0157] In some embodiments, the computer device obtains the association relationship between the first NPC and the third NPC in the first NPC group; and controls the group control logic to modify the behavior parameters corresponding to the third NPC according to the association relationship between the first NPC and the third NPC.
[0158] When the first NPC and the third NPC are in a positive relationship, the control group control logic modifies the behavior parameters of the first NPC and the third NPC to a consistent state, that is, the first NPC and the third NPC can perform a certain behavior at the same time, for example, when the first NPC performs an attack behavior, the third NPC can also perform an attack behavior; when the first NPC and the third NPC are in a negative relationship, the control group control logic modifies the behavior parameters of the first NPC and the third NPC to an opposite state, that is, the first NPC and the third NPC cannot perform a certain behavior at the same time, for example, when the first NPC performs an attack behavior, the third NPC cannot also perform an attack behavior.
[0159] Step 406: Based on the modified state parameters and individual control logic, the interaction between the NPCs in the first NPC group and the virtual characters is updated.
[0160] Exemplarily, after obtaining the modified state parameters, the individual control logic controls the NPCs in the first NPC group to interact with the virtual character using the modified state parameters.
[0161] In summary, the method provided in this embodiment obtains the control logic of multiple NPCs, and in response to the influencing factors between the virtual character and the first NPC, controls the group control logic to modify the state parameters corresponding to at least one NPC in the first NPC group where the first NPC is located; based on the modified state parameters and the individual control logic, updates the interaction between the NPCs in the first NPC group and the virtual characters. This application modifies the state parameters of the NPCs in the entire NPC group based on the state of the individual NPC, and updates the interaction between the NPCs and the virtual characters in the entire NPC group based on the modified state parameters and the individual control logic, thereby making the interaction between the NPCs more linked, the interactive activities between the NPCs and the virtual characters richer and more realistic, and making the behavior of the NPCs closer to the virtual characters controlled by real users, thereby improving the user experience.
[0162] The method provided in this embodiment detects the operation duration and operation points of the interactive operation between the virtual character and the first NPC, and triggers the group control logic through different triggering methods to modify the state parameters corresponding to at least one NPC in the first NPC group to which the first NPC belongs, so that the interaction between the virtual character and the NPC is more linked, the interactive activities between the NPC and the virtual character are richer and more realistic, and the behavior of the NPC is closer to the virtual character controlled by a real user, thereby improving the user experience.
[0163] The method provided in this embodiment detects whether the virtual character attacks the NPC or enters the NPC's field of vision, thereby triggering the group control logic to modify the initial state parameters corresponding to at least one NPC in the first NPC group to which the first NPC belongs, thereby making the interactive activities between the NPC and the virtual character richer and more realistic, and making the NPC's behavior closer to the virtual character controlled by a real user, thereby improving the user experience.
[0164] The method provided in this embodiment obtains the association relationship between different NPCs in the same group, so that the NPCs in the NPC group can make more intelligent responses, make the interactive activities between the NPC and the virtual character richer and more realistic, and make the NPC's behavior closer to the virtual character controlled by the real user, thereby improving the user experience.
[0165] In addition, the method provided in this embodiment only requires very low-cost modifications to individual NPCs, that is, only by modifying the status parameters of individual NPCs, control over the NPC team can be achieved, rich linkage effects can be achieved, and a good combat experience can be brought to players.
[0166] Figure 8 is a flow chart of a method for controlling an NPC provided by an exemplary embodiment of the present application. The method can be executed by a computer device, which can be Figure 2 The method comprises:
[0167] Step 801: Start.
[0168] Step 802: Detect entry into an interactive scenario.
[0169] Exemplarily, the computer device determines whether the virtual character and the NPC enter into an interactive scenario.
[0170] Optionally, the way of entering the interactive scenario includes at least one of: the virtual character attacks the first NPC, and the virtual character enters the field of vision of the first NPC, but is not limited thereto and is not specifically limited in this embodiment of the present application.
[0171] Step 803: Modify the initial state parameters.
[0172] Exemplarily, when the virtual character and the NPC enter into an interactive scenario, the control group control logic modifies the initial state parameters corresponding to at least one NPC in the first NPC group.
[0173] For example, when the virtual character enters the field of vision of NPC Two, the computer device controls the group control logic to modify the initial state parameters corresponding to NPC One, NPC Two and NPC Three, changing NPC Two from an idle state to an activated state, and keeping NPC One and NPC Three in an idle state. Then, the computer device updates the interaction between NPC One, NPC Two and NPC Three and the virtual character based on the state parameters corresponding to NPC One, NPC Two and NPC Three and their respective individual control logics. That is, NPC Two actively attacks the virtual character, and NPC One and NPC Three walk away.
[0174] Step 804: Set the status parameters according to the priority.
[0175] Exemplarily, when the group control logic modifies the initial state parameters corresponding to at least one NPC in the first NPC group, the group control logic performs the modification according to the priority of the NPC.
[0176] The priority of the NPC includes at least one of: a specified state parameter, a level of the NPC, a distance between the NPC and the virtual character, and an angle between the NPC and the virtual character, but is not limited thereto.
[0177] For example, if the user does not specify the NPC level, modifications are made in sequence according to the NPC level; if the NPC levels are the same, modifications are made in sequence according to 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, modifications are made in sequence according to the angle between the NPC and the virtual character.
[0178] Step 805: Whether the state parameter is in the activated state.
[0179] Exemplarily, after the group control logic modifies the status parameters of the NPC in the first NPC group, it is determined whether the status parameters of the first NPC are in an activated state. If the status parameters of the first NPC are in an activated state, step 807 is executed; if the status parameters of the first NPC are not in an activated state, step 806 is executed.
[0180] Step 806: Execute other logics.
[0181] In the case where the state parameter of the first NPC is not the active state, other logics are executed, that is, the individual control logic in the inactive state is executed.
[0182] Optionally, other logics include at least one of escape behavior logic, item pickup behavior logic, and pacing behavior logic, but are not limited thereto.
[0183] Step 807: Execute the individual control logic in the activated state.
[0184] In the case where the state parameter of the first NPC is an activated state, the individual control logic in the activated state is executed, that is, the first NPC attacks the virtual character and starts a fight with the virtual character.
[0185] Step 808: End.
[0186] To sum up, the method provided in this embodiment detects whether the virtual character attacks the NPC or enters the NPC's field of vision, thereby triggering the group control logic to modify the initial state parameters corresponding to at least one NPC in the first NPC group to which the first NPC belongs, thereby making the interactive activities between the NPC and the virtual character richer and more realistic, and making the NPC's behavior closer to the virtual character controlled by a real user, thereby improving the user experience.
[0187] Fig. 9 is a flowchart of a method for controlling an individual NPC provided by an exemplary embodiment of the present application. The method can be executed by a computer device, which can be Figure 2 The method comprises:
[0188] Step 901: Start.
[0189] Step 902: Whether the state parameter is in the activated state.
[0190] Exemplarily, for an individual NPC, it is determined whether the state parameter of the individual NPC is in an activated state. If the individual NPC is in an activated state, step 903 is executed; if the individual NPC is in an inactivated state, step 904 is executed.
[0191] Step 903: Execute the individual control logic in the activated state.
[0192] Exemplarily, when the individual NPC is in an activated state, the individual control logic in the activated state is executed, that is, the first NPC attacks the virtual character and starts a fight with the virtual character.
[0193] Step 904: Whether the state parameter is other state.
[0194] Exemplarily, when the individual NPC is in an inactive state, determine whether the state parameters of the individual NPC are other states. If the state parameters of the individual NPC are other states, execute step 905; if the state parameters of the individual NPC are not other states, execute step 906.
[0195] Optionally, other states include at least one of escape behavior logic, item pickup behavior logic, and pacing behavior logic, but are not limited thereto.
[0196] Step 905: Execute individual control logic in other states.
[0197] For example, when the state parameter of the individual NPC is in other states, the individual NPC is controlled to execute the individual control logic in other states, for example, the NPC is controlled to pick up supplies.
[0198] Step 906: Execute the individual control logic in the default state.
[0199] Exemplarily, when the state parameter of the individual NPC is neither in the activation state nor in other states, the individual NPC is controlled to execute the individual control logic in the default state.
[0200] Step 907: End.
[0201] In summary, the method provided in this embodiment changes the behavior of the NPC by changing the state of the individual NPC, so that the behavior of the NPC is closer to the virtual character controlled by the real user, thereby improving the user experience.
[0202] Fig.10 is a flow chart of a method for controlling an NPC provided by an exemplary embodiment of the present application. The method can be executed by a computer device, which can be Figure 2The method comprises:
[0203] Step 1001: Start.
[0204] Step 1002: Obtain operation points for interactive operations.
[0205] Operation points refer to the points corresponding to each operation during the interaction between the first NPC and the virtual character.
[0206] Exemplarily, the computer device obtains an operation score correspondence table corresponding to interactive operations, and determines the sum of the operation scores of the interactive operations between the first NPC and the virtual character according to the operation score correspondence table.
[0207] Step 1003: Whether the operation score reaches the score threshold.
[0208] Exemplarily, the computer device determines whether the sum of the operation points of the interactive operations between the first NPC and the virtual character reaches the point threshold, and executes step 1005 if the sum of the operation points of the interactive operations between the first NPC and the virtual character reaches the point threshold; if the sum of the operation points of the interactive operations between the first NPC and the virtual character does not reach the point threshold, executes step 1004.
[0209] Step 1004: Whether to perform interactive operations with the NPC in the idle state.
[0210] Exemplarily, when the sum of the operation points of the interactive operations between the first NPC and the virtual character does not reach the point threshold, it is determined whether the virtual character performs interactive operations with the NPC in the idle state. When the virtual character performs interactive operations with the NPC in the idle state, step 1005 is executed; when the virtual character does not perform interactive operations with the NPC in the idle state, step 1006 is executed.
[0211] Step 1005: Control the group control logic to modify the state parameter corresponding to at least one NPC.
[0212] Exemplarily, when the sum of the operation points of the interactive operations between the first NPC and the virtual character reaches the point threshold, the control group control logic changes the state parameter of the first NPC from an activated state to an idle state, and changes the state parameter of the second NPC from an idle state to an activated state.
[0213] For example, the NPCs in the first NPC group include NPC one, NPC two and NPC three. During the fight between the virtual character and NPC one, each time NPC one releases a big move, 5 points are added. When the points reach 15 points, the computer device control group control logic modifies the state parameters of NPC one, NPC two and NPC three. For example, the state parameters of NPC one are changed from an activated state to an idle state, and the state parameters of NPC two and NPC three are changed from an idle state to an activated state. That is, during the fight between the virtual character and NPC one, after NPC one releases three big moves, NPC one does not continue to fight with the virtual character, NPC one moves away from the virtual character, and NPC two and NPC three start fighting with the virtual character.
[0214] In some embodiments, when the sum of the operation points of the interactive operations between the first NPC and the virtual character does not reach the point threshold, but the virtual character performs interactive operations with the NPC in an idle state, the control group control logic changes the state parameters of the first NPC from an activated state to an idle state, and changes the state parameters of the second NPC from an idle state to an activated state.
[0215] Step 1006: End.
[0216] To sum up, the method provided in this embodiment detects the operation points of the interactive operation between the virtual character and the first NPC, and triggers the group control logic to modify the status parameters corresponding to at least one NPC in the first NPC group to which the first NPC belongs, so that the interaction between the virtual character and the NPC is more linked, and the interactive activities between the NPC and the virtual character are richer and more realistic, so that the behavior of the NPC is closer to the virtual character controlled by a real user, thereby improving the user experience.
[0217] Fig.11 is a flow chart of a method for controlling an NPC provided by an exemplary embodiment of the present application. The method can be executed by a computer device, which can be Figure 2 The method comprises:
[0218] Step 1101: Start.
[0219] Step 1102: Obtain the status parameters of the first NPC.
[0220] Exemplarily, the computer device obtains the state parameter of the first NPC, and obtains the association relationship between the first NPC and the third NPC in the first NPC group.
[0221] The status parameters include active status and idle status.
[0222] Optionally, the association relationship includes at least one of a positive relationship and a negative relationship, but is not limited thereto, and the embodiments of the present application do not make specific limitations on this.
[0223] A positive relationship refers to a relationship that makes at least two NPCs in the same NPC group move in the same direction. For example, a positive relationship includes at least one of a couple relationship, a confidant relationship, a playmate relationship, and a mentor-apprentice relationship, but is not limited thereto, and the present application embodiment does not specifically limit this.
[0224] A negative relationship refers to a relationship that causes at least two NPCs in the same NPC group to act in opposite directions. For example, a negative relationship includes at least one of a hostile relationship and a relationship of different attributes, but is not limited thereto, and the present embodiment of the application does not specifically limit this.
[0225] Step 1103: Check whether there is a third NPC that has an active relationship with the first NPC.
[0226] Exemplarily, after obtaining the status parameters of the first NPC, it is detected whether there is a third NPC having a positive relationship with the first NPC. If there is a third NPC having a positive relationship with the first NPC in the first NPC group, step 1105 is executed; if there is no third NPC having a positive relationship with the first NPC in the first NPC group, step 1104 is executed.
[0227] Step 1104: Whether the first NPC performs the first operation.
[0228] Exemplarily, when there is no third NPC having an active relationship with the first NPC in the first NPC group, it is determined whether the first NPC performs the first operation. When the first NPC performs the first operation, step 1106 is executed; when the first NPC does not perform the first operation, step 1107 is executed.
[0229] The first operation includes at least one of running behavior, attacking behavior, flying behavior, and climbing behavior, but is not limited thereto, and the embodiments of the present application do not make specific limitations on this.
[0230] Step 1105: Modify the status parameters of the first NPC and the third NPC to be consistent.
[0231] Exemplarily, in the case where there is a third NPC having an active relationship with the first NPC in the first NPC group, the control group control logic modifies the state parameters of the first NPC and the third NPC to a consistent state.
[0232] For example, the NPCs in the first NPC group include NPC 1, NPC 2, and NPC 3. NPC 1 and NPC 2 are in an active relationship, and NPC 2 and NPC 3 are in a negative relationship. Assuming that NPC 1, NPC 2, and NPC 3 are all in an activated state, when the virtual character fights with NPC 2, the computer device controls the group control logic to modify the state parameters of NPC 1, NPC 2, and NPC 3. Since NPC 1 and NPC 2 are in an active relationship, the state of NPC 1 is maintained in an activated state, and NPC 1 also joins the fight between the virtual character and NPC 2; since NPC 2 and NPC 3 are in a negative relationship, the state of NPC 3 is modified to an idle state, and NPC 3 stays away from the fight scene.
[0233] Step 1106: Check whether there is a third NPC that has a negative relationship with the first NPC.
[0234] Exemplarily, when the first NPC performs the first operation, it is detected whether there is a third NPC having a negative relationship with the first NPC. If there is a third NPC having a negative relationship with the first NPC in the first NPC group, step 1108 is executed; if there is no third NPC having a negative relationship with the first NPC in the first NPC group, step 1107 is executed.
[0235] Step 1107: Execute other operations in the individual control logic.
[0236] In the case that there is no third NPC associated with the first NPC in the first NPC group, the first NPC and the third NPC are controlled to execute other operations in the individual control logics using their respective corresponding individual control logics.
[0237] Step 1108: The third NPC cannot perform the first operation.
[0238] For example, in a case where a third NPC having a negative relationship with the first NPC exists in the first NPC group, when the first NPC performs a first operation, the third NPC is controlled not to perform the first operation.
[0239] For example, when the first NPC and the third NPC have a negative relationship, the control group control logic modifies the behavior parameters of the first NPC and the third NPC to opposite states, that is, the first NPC and the third NPC cannot perform a certain behavior at the same time. For example, when the first NPC performs an attack behavior, the third NPC cannot perform an attack behavior either.
[0240] Step 1109: End.
[0241] To sum up, the method provided in this embodiment, by obtaining the association relationship between different NPCs in the same group, enables NPCs in the NPC group to make more intelligent responses, makes the interactive activities between NPCs and virtual characters richer and more realistic, and makes the behavior of NPCs closer to the virtual characters controlled by real users, thereby improving the user experience.
[0242] Fig.12 A schematic diagram of the structure of a control device for a non-player character provided by an exemplary embodiment of the present application is shown. The device can be implemented as all or part of a computer device through software, hardware, or a combination of both. The device includes:
[0243] An acquisition module 1201 is used to acquire control logic of multiple non-player characters NPCs, wherein the control logic refers to code logic that controls the actions of at least one NPC, and the control logic includes individual control logic corresponding to each NPC in an NPC group and group control logic corresponding to the NPC group, wherein the multiple NPCs include at least one NPC group, and the NPC group includes at least two NPCs;
[0244] A control module 1202, configured to control the group control logic to modify a state parameter corresponding to at least one NPC in the first NPC group to which the first NPC belongs in response to an influencing factor between the virtual character and the first NPC;
[0245] The updating module 1203 is used to update the interaction between the NPCs in the first NPC group and the virtual character based on the modified state parameters and the individual control logic.
[0246] In some embodiments, the control module 1202 is used to control the group control logic to modify the state parameter corresponding to at least one of the NPCs in the first NPC group in response to the interaction operation between the virtual character and the first NPC satisfying a trigger condition.
[0247] In some embodiments, the control module 1202 is used to control the group control logic to modify the state parameter corresponding to at least one of the NPCs in the first NPC group in response to the duration of the interaction operation between the virtual character and the first NPC reaching a time threshold.
[0248] In some embodiments, the control module 1202 is used to control the group control logic to change the state parameters of the first NPC from an activated state to an idle state, and to change the state parameters of the second NPC in the first NPC group from the idle state to the activated state in response to the duration of the interactive operation between the virtual character and the first NPC reaching the time threshold.
[0249] Among them, the first NPC refers to the NPC in the activated state, the second NPC refers to the NPC in the idle state, the activated state refers to the state when the NPC can actively interact with the virtual character, and the idle state refers to the state when the NPC cannot actively interact with the virtual character.
[0250] In some embodiments, the control module 1202 is used to control the group control logic to modify the state parameter corresponding to at least one of the NPCs in the first NPC group in response to the operation score of the interactive operation between the first NPC and the virtual character reaching a score threshold.
[0251] In some embodiments, the acquisition module 1201 is used to obtain an operation point correspondence table corresponding to the interactive operation, and the operation point correspondence table includes the operation points corresponding to each of the interactive operations.
[0252] In some embodiments, the control module 1202 is used to control the group control logic to change the state parameters of the first NPC from an activated state to an idle state, and to change the state parameters of the second NPC in the first NPC group from the idle state to the activated state in response to the sum of the operation points of the interactive operations between the first NPC and the virtual character reaching the point threshold.
[0253] In some embodiments, the control module 1202 is used to control the group control logic to change the state parameters of the first NPC from the activated state to the idle state, and to change the state parameters of the second NPC from the idle state to the activated state, when the virtual character does not perform the interactive operation with the first NPC in the activated state, but performs the interactive operation with the second NPC in the idle state in the first NPC group.
[0254] In some embodiments, the control module 1202 is used to control the group control logic to modify the initial state parameters corresponding to at least one NPC in the first NPC group in response to the virtual character and the first NPC entering into an interactive scenario.
[0255] The initial state parameters refer to the default state parameters of the NPCs in the first NPC group at the beginning of the game.
[0256] In some embodiments, the control module 1202 is used to control the group control logic to modify the initial state parameter corresponding to at least one NPC in the first NPC group in response to the virtual character attacking the first NPC.
[0257] In some embodiments, the control module 1202 is used to control the group control logic to modify the initial state parameter corresponding to at least one NPC in the first NPC group in response to the virtual character entering the field of view of the first NPC.
[0258] In some embodiments, the acquisition module 1201 is used to acquire the association relationship between the first NPC and the third NPC in the first NPC group.
[0259] In some embodiments, the control module 1202 is used to control the group control logic to modify the state parameter corresponding to the third NPC according to the association relationship between the first NPC and the third NPC.
[0260] The association relationship includes a positive relationship, and the positive relationship refers to a relationship that makes the action directions of at least two NPCs in the same NPC group consistent.
[0261] In some embodiments, the control module 1202 is used to control the group control logic to modify the state parameters of the first NPC and the third NPC to a consistent state when the first NPC and the third NPC are in the active relationship.
[0262] The association relationship includes a negative relationship, which refers to a relationship that causes at least two NPCs in the same NPC group to act in opposite directions.
[0263] In some embodiments, the control module 1202 is used to control the group control logic to modify the state parameters of the first NPC and the third NPC to opposite states when the first NPC and the third NPC are in the negative relationship.
[0264] Fig.13 The block diagram of the structure of a computer device 1300 provided by an exemplary embodiment of the present application is shown. The computer device 1300 may be a portable mobile terminal, such as a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 player (Moving Picture Experts Group Audio Layer IV). The computer device 1300 may also be called a user device, a portable terminal, or other names.
[0265] Typically, the computer device 1300 includes a processor 1301 and a memory 1302 .
[0266] The processor 1301 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 1301 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field Programmable Gate Array), and PLA (Programmable Logic Array). The processor 1301 may also include a main processor and a coprocessor. The main processor is a processor for processing data in an awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 1301 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 1301 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0267] The memory 1302 may include one or more computer-readable storage media, which may be tangible and non-transitory. The memory 1302 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 1302 is used to store at least one instruction, which is used to be executed by the processor 1301 to implement the control method of the non-player character provided in the embodiment of the present application.
[0268] In some embodiments, the computer device 1300 may further include: a peripheral device interface 1303 and at least one peripheral device. Specifically, the peripheral device includes: at least one of a radio frequency circuit 1304 , a touch display screen 1305 , a camera 1306 , an audio circuit 1307 and a power supply 1308 .
[0269] The peripheral device interface 1303 may be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 1301 and the memory 1302. In some embodiments, the processor 1301, the memory 1302, and the peripheral device interface 1303 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 1301, the memory 1302, and the peripheral device interface 1303 may be implemented on a separate chip or circuit board, which is not limited in this embodiment.
[0270] The radio frequency circuit 1304 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 1304 communicates with the communication network and other communication devices through electromagnetic signals. The radio frequency circuit 1304 converts the electrical signal into an electromagnetic signal for transmission, or converts the received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 1304 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, etc. The radio frequency circuit 1304 can communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes but is not limited to: the World Wide Web, a metropolitan area network, an intranet, various generations of mobile communication networks (2G, 3G, 4G and 5G), a wireless local area network and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 1304 may also include circuits related to NFC (Near Field Communication), which is not limited in this application.
[0271] The touch display screen 1305 is used to display a UI (User Interface). The UI may include graphics, text, icons, videos, and any combination thereof. The touch display screen 1305 also has the ability to collect touch signals on the surface or above the surface of the touch display screen 1305. The touch signal may be input to the processor 1301 as a control signal for processing. The touch display screen 1305 is used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments, the touch display screen 1305 may be one, and the front panel of the computer device 1300 is set; in other embodiments, the touch display screen 1305 may be at least two, which are respectively set on different surfaces of the computer device 1300 or are folded; in some embodiments, the touch display screen 1305 may be a flexible display screen, which is set on a curved surface or a folded surface of the computer device 1300. Even, the touch display screen 1305 can also be set to a non-rectangular irregular shape, that is, a special-shaped screen. The touch display screen 1305 can be made of materials such as LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode, organic light-emitting diode).
[0272] The camera assembly 1306 is used to capture images or videos. Optionally, the camera assembly 1306 includes a front camera and a rear camera. Typically, the front camera is used to realize video calls or selfies, and the rear camera is used to realize the shooting of photos or videos. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, and a wide-angle camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, and the fusion of the main camera and the wide-angle camera to realize panoramic shooting and VR (Virtual Reality) shooting functions. In some embodiments, the camera assembly 1306 may also include a flash. The flash can be a monochrome temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation at different color temperatures.
[0273] The audio circuit 1307 is used to provide an audio interface between the user and the computer device 1300. The audio circuit 1307 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals and input them into the processor 1301 for processing, or input them into the radio frequency circuit 1304 to achieve voice communication. For the purpose of stereo acquisition or noise reduction, there may be multiple microphones, which are respectively arranged at different parts of the computer device 1300. The microphone may also be an array microphone or an omnidirectional acquisition microphone. The speaker is used to convert the electrical signal from the processor 1301 or the radio frequency circuit 1304 into sound waves. The speaker may be a traditional film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert the electrical signal into sound waves audible to humans, but also convert the electrical signal into sound waves inaudible to humans for purposes such as distance measurement. In some embodiments, the audio circuit 1307 may also include a headphone jack.
[0274] The power supply 1308 is used to power various components in the computer device 1300. The power supply 1308 can be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 1308 includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery that is charged through a wired line, and a wireless rechargeable battery is a battery that is charged through a wireless coil. The rechargeable battery can also be used to support fast charging technology.
[0275] In some embodiments, the computer device 1300 further includes one or more sensors 1309 , including but not limited to: an acceleration sensor 1310 , a gyroscope sensor 1311 , a pressure sensor 1312 , an optical sensor 1313 , and a proximity sensor 1314 .
[0276] The acceleration sensor 1310 can detect the magnitude of acceleration on the three coordinate axes of the coordinate system established by the computer device 1300. For example, the acceleration sensor 1310 can be used to detect the components of gravity acceleration on the three coordinate axes. The processor 1301 can control the touch display screen 1305 to display the user interface in a horizontal view or a vertical view according to the gravity acceleration signal collected by the acceleration sensor 1310. The acceleration sensor 1310 can also be used to collect game or user motion data.
[0277] The gyro sensor 1311 can detect the body direction and rotation angle of the computer device 1300, and the gyro sensor 1311 can cooperate with the acceleration sensor 1310 to collect the user's 3D actions on the computer device 1300. The processor 1301 can implement the following functions based on the data collected by the gyro sensor 1311: motion sensing (such as changing the UI according to the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.
[0278] The pressure sensor 1312 can be set on the side frame of the computer device 1300 and / or the lower layer of the touch display screen 1305. When the pressure sensor 1312 is set on the side frame of the computer device 1300, it can detect the user's grip signal of the computer device 1300, and perform left and right hand recognition or shortcut operations according to the grip signal. When the pressure sensor 1312 is set on the lower layer of the touch display screen 1305, it can control the operability controls on the UI interface according to the user's pressure operation on the touch display screen 1305. The operability controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.
[0279] The optical sensor 1313 is used to collect the ambient light intensity. In one embodiment, the processor 1301 can control the display brightness of the touch display screen 1305 according to the ambient light intensity collected by the optical sensor 1313. Specifically, when the ambient light intensity is high, the display brightness of the touch display screen 1305 is increased; when the ambient light intensity is low, the display brightness of the touch display screen 1305 is reduced. In another embodiment, the processor 1301 can also dynamically adjust the shooting parameters of the camera assembly 1306 according to the ambient light intensity collected by the optical sensor 1313.
[0280] The proximity sensor 1314, also called a distance sensor, is usually arranged on the front of the computer device 1300. The proximity sensor 1314 is used to collect the distance between the user and the front of the computer device 1300. In one embodiment, when the proximity sensor 1314 detects that the distance between the user and the front of the computer device 1300 is gradually decreasing, the processor 1301 controls the touch display screen 1305 to switch from the screen-on state to the screen-off state; when the proximity sensor 1314 detects that the distance between the user and the front of the computer device 1300 is gradually increasing, the processor 1301 controls the touch display screen 1305 to switch from the screen-off state to the screen-on state.
[0281] Those skilled in the art will understand that Fig.13 The structure shown in the figure does not constitute a limitation on the computer device 1300, and the computer device 1300 may include more or less components than shown in the figure, or combine some components, or adopt a different component arrangement.
[0282] An embodiment of the present application also provides a computer device, which includes a processor and a memory, wherein at least one program is stored in the memory, and the at least one computer program is loaded and executed by the processor to implement the control method of the non-player character provided by the above-mentioned method embodiments.
[0283] An embodiment of the present application also provides a computer-readable storage medium, in which at least one computer program is stored. The at least one computer program is loaded and executed by a processor to implement the control method of the non-player character provided by the above-mentioned method embodiments.
[0284] An embodiment of the present application also provides a computer program product, which includes a computer program, and the computer program is stored in a computer-readable storage medium; the computer program is read and executed from the computer-readable storage medium by a processor of a computer device, so that the computer device executes to implement the control method of the non-player character provided by the above-mentioned method embodiments.
[0285] It will be understood that in the specific implementation of the present application, the data involved, historical data, and data related to user data processing such as portraits related to user identity or characteristics, when the above embodiments of the present application are applied to specific products or technologies, need to obtain user permission or consent, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0286] It should be understood that the "plurality" mentioned in this article refers to two or more. "And / or" describes the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects are in an "or" relationship.
[0287] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0288] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent switching, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method for controlling a non-player character, characterized in that: The method comprises: Acquire control logic of multiple non-player characters NPCs, wherein the control logic refers to code logic that controls the actions of at least one NPC, and the control logic includes individual control logic corresponding to each NPC in an NPC group and group control logic corresponding to the NPC group, wherein the multiple NPCs include at least one NPC group, and the NPC group includes at least two NPCs; In response to the influencing factors between the virtual character and the first NPC, controlling the group control logic to modify a state parameter corresponding to at least one NPC in the first NPC group where the first NPC is located; Based on the modified state parameters and the individual control logic, the interaction between the NPCs in the first NPC group and the virtual character is updated.
2. The method according to claim 1, characterized in that The step of controlling the group control logic to modify a state parameter corresponding to at least one NPC in the first NPC group to which the first NPC belongs in response to the influence factor between the virtual character and the first NPC includes: In response to the interactive operation between the virtual character and the first NPC satisfying a trigger condition, the group control logic is controlled to modify the state parameter corresponding to at least one of the NPCs in the first NPC group.
3. The method according to claim 2, characterized in that In response to the interactive operation between the virtual character and the first NPC satisfying a trigger condition, controlling the group control logic to modify the state parameter corresponding to at least one of the NPCs in the first NPC group includes: In response to the duration of the interactive operation between the virtual character and the first NPC reaching a time threshold, the group control logic is controlled to modify the state parameter corresponding to at least one of the NPCs in the first NPC group.
4. The method according to claim 3, characterized in that In response to the duration of the interactive operation between the virtual character and the first NPC reaching a time threshold, controlling the group control logic to modify the state parameter corresponding to at least one NPC in the first NPC group includes: In response to the duration of the interactive operation between the virtual character and the first NPC reaching the time threshold, controlling the group control logic to change the state parameter of the first NPC from an active state to an idle state, and to change the state parameter of a second NPC in the first NPC group from the idle state to the active state; Among them, the first NPC refers to the NPC in the activated state, the second NPC refers to the NPC in the idle state, the activated state refers to the state when the NPC can actively interact with the virtual character, and the idle state refers to the state when the NPC cannot actively interact with the virtual character.
5. The method according to claim 2, characterized in that: In response to the interactive operation between the virtual character and the first NPC satisfying a trigger condition, controlling the group control logic to modify the state parameter corresponding to at least one of the NPCs in the first NPC group includes: In response to the operation score of the interactive operation between the first NPC and the virtual character reaching a score threshold, the group control logic is controlled to modify the state parameter corresponding to at least one of the NPCs in the first NPC group.
6. The method according to claim 5, characterized in that In response to the operation score of the interactive operation between the first NPC and the virtual character reaching a score threshold, controlling the group control logic to modify the state parameter corresponding to at least one NPC in the first NPC group includes: Obtaining an operation score correspondence table corresponding to the interactive operation, wherein the operation score correspondence table includes an operation score corresponding to each interactive operation; In response to the sum of the operation points of the interactive operations between the first NPC and the virtual character reaching the point threshold, the group control logic is controlled to change the state parameter of the first NPC from an activated state to an idle state, and change the state parameter of the second NPC in the first NPC group from the idle state to the activated state.
7. The method according to claim 2, characterized in that In response to the interactive operation between the virtual character and the first NPC satisfying a trigger condition, controlling the group control logic to modify the state parameter corresponding to at least one of the NPCs in the first NPC group includes: When the virtual character does not perform the interactive operation with the first NPC in the activated state, but performs the interactive operation with the second NPC in the idle state in the first NPC group, the group control logic is controlled to change the state parameters of the first NPC from the activated state to the idle state, and change the state parameters of the second NPC from the idle state to the activated state.
8. The method according to any one of claims 1 to 7, characterized in that: The method further comprises: In response to the virtual character and the first NPC entering into an interactive scenario, controlling the group control logic to modify an initial state parameter corresponding to at least one NPC in the first NPC group; The initial state parameters refer to the default state parameters of the NPCs in the first NPC group at the beginning of the game.
9. The method according to claim 8, characterized in that In response to the virtual character and the first NPC entering into an interactive scenario, controlling the group control logic to modify an initial state parameter corresponding to at least one NPC in the first NPC group includes: In response to the virtual character attacking the first NPC, the group control logic is controlled to modify the initial state parameter corresponding to at least one NPC in the first NPC group.
10. The method according to claim 8, characterized in that In response to the virtual character and the first NPC entering into an interactive scenario, controlling the group control logic to modify an initial state parameter corresponding to at least one NPC in the first NPC group includes: In response to the virtual character entering the field of vision of the first NPC, the group control logic is controlled to modify the initial state parameter corresponding to at least one NPC in the first NPC group.
11. The method according to any one of claims 1 to 7, characterized in that: The method further comprises: Acquire an association relationship between the first NPC and a third NPC in the first NPC group; According to the association relationship between the first NPC and the third NPC, the group control logic is controlled to modify the state parameter corresponding to the third NPC.
12. The method according to claim 11, characterized in that The association relationship includes a positive relationship, which refers to a relationship that makes the action directions of at least two NPCs in the same NPC group consistent; The controlling the group control logic to modify the state parameter corresponding to the third NPC according to the association relationship between the first NPC and the third NPC includes: In the case that the first NPC and the third NPC are in the active relationship, the group control logic is controlled to modify the state parameters of the first NPC and the third NPC to a consistent state.
13. The method according to claim 11, characterized in that The association relationship includes a negative relationship, wherein the negative relationship refers to a relationship that causes at least two NPCs in the same NPC group to act in opposite directions; The controlling the group control logic to modify the state parameter corresponding to the third NPC according to the association relationship between the first NPC and the third NPC includes: In the case that the first NPC and the third NPC are in the negative relationship, the group control logic is controlled to modify the state parameters of the first NPC and the third NPC to opposite states.
14. A control device for a non-player character, characterized in that: The device comprises: An acquisition module is used to acquire control logic of multiple non-player characters NPCs, wherein the control logic refers to code logic that controls the actions of at least one NPC, and the control logic includes individual control logic corresponding to each NPC in an NPC group and group control logic corresponding to the NPC group, wherein the multiple NPCs include at least one NPC group, and the NPC group includes at least two NPCs; A control module, configured to control the group control logic to modify a state parameter corresponding to at least one NPC in a first NPC group to which the first NPC belongs in response to an influencing factor between the virtual character and the first NPC; An updating module is used to update the interaction between the NPCs in the first NPC group and the virtual character based on the modified state parameters and the individual control logic.
15. A computer device, characterized in that: The computer device comprises: a processor and a memory, wherein at least one computer program is stored in the memory, and the at least one computer program is loaded and executed by the processor to implement the control method of the non-player character according to any one of claims 1 to 13.
16. A computer storage medium, characterized in that: The computer-readable storage medium stores at least one computer program, and the at least one computer program is loaded and executed by the processor to implement the control method of the non-player character according to any one of claims 1 to 13.
17. A computer program product, characterized in that The computer program product comprises a computer program, which is stored in a computer-readable storage medium; the computer program is read and executed from the computer-readable storage medium by a processor of a computer device, so that the computer device executes the control method of a non-player character as claimed in any one of claims 1 to 13.
