Npc control method and device, equipment and storage medium

CN122955202APending Publication Date: 2026-10-23SAROS NETWORK TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510494932.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-18
Publication Date
2026-10-23

AI Technical Summary

Benefits of technology

[0017]本申请实施例中,通过决策系统、决策调度器以及行为系统三个部分之间的数据交互来实现对NPC行为的控制。首先,由决策系统基于触发事件生成决策任务对应的任务执行请求,并将任务执行请求发送给支持执行决策任务的NPC对应的决策调度器,其次,由决策调度器在确定满足决策任务的任务执行条件的情况下,调用NPC对应的行为系统,从而实现控制NPC执行决策任务。采用本申请实施例提供的方案,通过将NPC的控制管理框架模块化,使得决策系统与决策任务对应,决策调度器与NPC对应,从而由决策系统生成决策任务的任务执行请求,由决策调度器管理NPC的决策任务执行情况,降低了对NPC控制的开发和维护难度,并在提高开发效率的同时保证了决策系统的可扩展性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122955202A_ABST
    Figure CN122955202A_ABST
Patent Text Reader

Abstract

The embodiment of the application discloses a kind of NPC control method, device, equipment and storage medium, belong to man-machine interaction technical field.The method comprises: in the case where there is first trigger event, the first decision task corresponding first task execution request of first decision system is generated, and the first task execution request is sent to the first decision dispatcher corresponding to first NPC, the first trigger event triggers the first decision task, and the first NPC supports executing the first decision task;In the case where it is determined that the task execution condition of the first decision task is satisfied by the first decision dispatcher, the first behavior system corresponding to the first NPC is called by the first decision dispatcher, to control the first NPC to execute the first decision task;In the case where the first decision task is executed, the first decision dispatcher returns task execution completion notification to the first decision system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of human-computer interaction technology, and in particular to an NPC control method, device, equipment and storage medium. Background Technology

[0002] NPCs (Non-Player Characters) are computer-controlled characters in virtual games, distinct from player-controlled characters. NPCs are an important component of virtual games, enriching the storyline and increasing the interactivity and diversity of the matches.

[0003] In related technologies, a behavior tree consisting of conditional judgments and execution nodes is constructed to control NPCs to execute each node sequentially to reach the final character state. Alternatively, a state machine is used to define and switch different character states to achieve control over NPCs.

[0004] However, as planning requirements continue to increase, the complexity of NPC control gradually increases, which in turn requires building large-scale behavior trees or complex state machines, leading to a decrease in the readability of NPC control data and increasing the difficulty of development and maintenance. Summary of the Invention

[0005] This application provides an NPC control method, apparatus, device, and storage medium, the technical solution of which is as follows:

[0006] On one hand, embodiments of this application provide an NPC control method, the method comprising:

[0007] In the presence of a first triggering event, a first task execution request corresponding to a first decision task is generated by the first decision system, and the first task execution request is sent to the first decision scheduler corresponding to the first NPC. The first triggering event triggers the first decision task, and the first NPC supports the execution of the first decision task.

[0008] If the first decision scheduler determines that the task execution conditions of the first decision task are met, the first decision scheduler calls the first behavior system corresponding to the first NPC to control the first NPC to execute the first decision task.

[0009] Upon completion of the first decision task, the first decision scheduler returns a task completion notification to the first decision system.

[0010] On the other hand, embodiments of this application provide an NPC control device, the device comprising:

[0011] The decision module is used to generate a first task execution request corresponding to a first decision task through a first decision system when a first triggering event occurs, and send the first task execution request to the first decision scheduler corresponding to the first NPC. The first triggering event triggers the first decision task, and the first NPC supports the execution of the first decision task.

[0012] The scheduling module is used to control the first NPC to execute the first decision task by calling the first behavior system corresponding to the first NPC through the first decision scheduler when the task execution conditions of the first decision task are determined to be met by the first decision scheduler.

[0013] The scheduling module is used to return a task completion notification to the first decision system through the first decision scheduler when the first decision task is completed.

[0014] On the other hand, embodiments of this application provide a computer device including a processor and a memory, wherein the memory stores at least one instruction, which is loaded and executed by the processor to implement the NPC control method as described above.

[0015] On the other hand, embodiments of this application provide a computer-readable storage medium storing at least one instruction, which is loaded and executed by a processor to implement the NPC control method as described above.

[0016] On the other hand, embodiments of this application provide a computer program product including at least one instruction stored in a computer-readable storage medium. A processor of a computer device reads the at least one instruction from the computer-readable storage medium and executes the at least one instruction, causing the computer device to perform the NPC control method described above.

[0017] In this embodiment, NPC behavior is controlled through data interaction between three parts: a decision-making system, a decision scheduler, and a behavior system. First, the decision-making system generates a task execution request corresponding to a decision task based on a triggering event and sends the request to the decision scheduler corresponding to the NPC that supports the task execution. Second, the decision scheduler, upon determining that the task execution conditions are met, invokes the behavior system corresponding to the NPC, thereby controlling the NPC to execute the decision task. By modularizing the NPC control and management framework, the decision-making system corresponds to the decision task, and the decision scheduler corresponds to the NPC. The decision-making system generates the task execution request, and the decision scheduler manages the execution of the NPC's decision task, reducing the development and maintenance difficulty of NPC control and ensuring the scalability of the decision-making system while improving development efficiency. Attached Figure Description

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

[0019] Figure 1 This application shows a structural block diagram of a computer system provided in an exemplary embodiment;

[0020] Figure 2 A flowchart of an exemplary embodiment of the NPC control method provided in this application is shown;

[0021] Figure 3 A flowchart of an NPC control method provided in another exemplary embodiment of this application is shown;

[0022] Figure 4 A schematic diagram illustrating the configuration of an NPC capability set provided in an exemplary embodiment of this application is shown;

[0023] Figure 5 A schematic diagram of a task execution chain provided in an exemplary embodiment of this application is shown;

[0024] Figure 6 This application illustrates a lifecycle flow diagram of a decision-making task provided in an exemplary embodiment.

[0025] Figure 7 A timing diagram illustrating the control of an NPC to perform actions to maintain a task is shown in an exemplary embodiment of this application;

[0026] Figure 8A flowchart of an NPC control method provided in another exemplary embodiment of this application is shown;

[0027] Figure 9 This invention illustrates a schematic diagram of a decision system partitioning provided in an exemplary embodiment of this application;

[0028] Figure 10 This application illustrates an exemplary embodiment of the execution flowchart of each decision task in the task execution chain when a system call exists;

[0029] Figure 11 This application illustrates a timing interaction diagram between a decision system and a decision scheduler when a system call exists, provided by an exemplary embodiment of this application.

[0030] Figure 12 A flowchart of an NPC control method provided in another exemplary embodiment of this application is shown;

[0031] Figure 13 A flowchart of an NPC control method provided in another exemplary embodiment of this application is shown;

[0032] Figure 14 This invention illustrates a schematic diagram of the deployment configuration of a decision system provided in an exemplary embodiment of this application.

[0033] Figure 15 This illustration shows a schematic diagram of decision system data synchronization between a terminal and a server provided in an exemplary embodiment of this application;

[0034] Figure 16 This illustration shows an interaction diagram between a decision system and a decision scheduler provided in an exemplary embodiment of this application;

[0035] Figure 17 A schematic diagram of an NPC control framework provided in an exemplary embodiment of this application is shown;

[0036] Figure 18 This invention provides a structural block diagram of an NPC control device according to an exemplary embodiment of the present application.

[0037] Figure 19 A schematic diagram of the structure of a computer device provided in an exemplary embodiment of this application is shown. Detailed Implementation

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

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

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

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

[0042] First, a brief introduction to the terms used in the embodiments of this application:

[0043] Decision-making tasks: These refer to the tasks that players control NPCs to perform in virtual matches, such as escape missions, dialogue missions, and attack missions. Controlling NPCs to perform different decision-making tasks in virtual matches enriches the game's storyline and world-building, increasing player interactivity and immersion.

[0044] Decision-making system: Used to generate task execution requests corresponding to decision-making tasks. Each decision-making system corresponds to a specific type of decision-making task; that is, different decision-making systems are used to generate task execution requests for different decision-making tasks. Optionally, each decision-making system defines its own interface functions, thereby enabling data reading and inter-system calls through the corresponding interface functions.

[0045] Decision Scheduler: Used to schedule the various decision tasks that NPCs need to execute. Optionally, the decision scheduler is used to schedule the execution order and progress of different decision tasks. For example, if there are decision tasks A and B, the decision scheduler needs to determine whether the NPC should execute decision task A first or decision task B first. Furthermore, during the execution of decision task A by the NPC, the decision scheduler needs to determine the execution progress of decision task A, including execution, interruption, abandonment, and resumption.

[0046] Behavior System: Used to control NPCs to execute decision-making tasks through system interfaces. Optionally, the behavior system controls NPCs to execute corresponding decision-making tasks based on the decision-making task data sent by the decision scheduler, and notifies the decision scheduler through system callbacks after the decision-making task is completed.

[0047] Please refer to Figure 1 This illustration shows a structural block diagram of a computer system provided in an exemplary embodiment of this application. The computer system 100 may include a terminal 110 and a server 120. The terminal 110 and the server 120 communicate via a communication network. Optionally, the communication network may be a wired network or a wireless network, and may be at least one of a local area network (LAN), a metropolitan area network (MAN), and a wide area network (WAN).

[0048] Optionally, terminal 110 runs an application that supports a virtual environment. This application can be a multiplayer online battle arena (MOBA) program. When the terminal runs the application, the user interface of the application is displayed on the screen of terminal 110. This application can be any of the following: a multiplayer online battle arena (MOBA) game, a simulation game (SLG), a massively multiplayer online role-playing game (MMORPG), or a first-person shooter (FPS) game. In this embodiment, a massively multiplayer online role-playing game is used as an example. Terminal 110 is the terminal used by the user. The user uses terminal 110 to control a first virtual character located in the virtual environment. This first virtual character can be referred to as the user's main virtual character. The activities of the first virtual character include, but are not limited to: adjusting body posture, crawling, walking, running, riding, flying, jumping, driving, picking up, shooting, attacking, throwing, and releasing skills at least one of these. Illustratively, the first virtual character is a first virtual persona, such as a realistic or anime character.

[0049] Optionally, server 120 includes at least one of the following: a single server, a server cluster consisting of multiple servers, a cloud computing platform, and a virtualization center. The server provides backend services for applications supporting the 3D virtual environment. Optionally, the server undertakes the primary computational work, and the terminal undertakes the secondary computational work; or, the server undertakes the secondary computational work, and the terminal undertakes the primary computational work; or, the server and the terminal collaborate on computation using a distributed computing architecture.

[0050] Optionally, the NPC control and management framework can be deployed separately on terminal 110, on server 120, or on both terminal 110 and server 120. The NPC control and management framework includes multiple decision systems for triggering decision tasks, a decision scheduler for calling NPCs to execute decision tasks, and a behavior system for controlling NPCs to execute decision tasks.

[0051] In one possible implementation, the NPC control and management framework is deployed on terminal 110. Upon the presence of a first triggering event, terminal 110 generates a first task execution request corresponding to a first decision task through a first decision system and sends the request to the first decision scheduler corresponding to the first NPC. Then, if the first decision scheduler determines that the task execution conditions for the first decision task are met, terminal 110 invokes the first behavior system corresponding to the first NPC through the first decision scheduler to control the first NPC to execute the first decision task. Finally, upon completion of the first decision task, terminal 110 returns a task completion notification to the first decision system through the first decision scheduler.

[0052] In another possible implementation, the NPC control and management framework is deployed on terminal 110 and server 120. Upon the presence of a first triggering event, terminal 110 sends the first triggering event to server 120, which then generates a first task execution request corresponding to a first decision task through a first decision system. Server 120 then sends the first task execution request to terminal 110. Terminal 110 responds to the first task execution request through a first decision scheduler, and if the task execution conditions of the first decision task are met, it invokes the first behavior system corresponding to the first NPC through the first decision scheduler to control the first NPC to execute the first decision task. Finally, upon completion of the first decision task, terminal 110 generates a task completion notification through the first decision scheduler and sends this notification to server 120.

[0053] Based on the above introduction, the NPC control method provided in this application will be described. This method can be executed by a server or a terminal, or by both a server and a terminal.

[0054] Please refer to Figure 2 This document illustrates a flowchart of an NPC control method provided in an exemplary embodiment of this application. This embodiment uses the method applied to a computer device (including a terminal and / or a server) as an example for illustration. The method includes the following steps:

[0055] Step 210: In the presence of a first triggering event, a first task execution request corresponding to the first decision task is generated through the first decision system, and the first task execution request is sent to the first decision scheduler corresponding to the first NPC. The first triggering event triggers the first decision task, and the first NPC supports the execution of the first decision task.

[0056] Optionally, decision-making tasks refer to the tasks that NPCs are controlled to perform in virtual matches, such as escape missions, dialogue missions, and attack missions. In virtual matches, controlling NPCs to perform different decision-making tasks can enrich the game's storyline and world view, and increase player interactivity and immersion.

[0057] Optionally, the decision system generates task execution requests corresponding to the decision tasks. Each decision system corresponds to a specific type of decision task; that is, different decision systems generate task execution requests for different decision tasks. Optionally, each decision system defines its own interface functions, thereby enabling data reading and inter-system calls through the corresponding interface functions.

[0058] Optionally, to ensure the orderly and rational execution of NPC tasks in virtual matches, different decision tasks also correspond to their own trigger events. That is, the decision system will only generate a task execution request corresponding to the decision task when a specific trigger event exists, thereby controlling the NPC to execute the corresponding decision task. For example, when there is an interaction event between the player character and the player character, the dialogue decision system can generate a task execution request corresponding to the dialogue task, thus controlling the NPC to execute the dialogue task. Similarly, when the player character initiates a trade request to the NPC, the trade decision system can generate a task execution request corresponding to the trade task, thus controlling the NPC to execute the trade task. Furthermore, when the NPC is in a combat scenario, the combat decision system can generate a task execution request corresponding to the combat task, thus controlling the NPC to execute the combat task.

[0059] Therefore, during a game, different decision-making systems need to determine in real time whether a corresponding triggering event exists. In one possible implementation, the decision-making system obtains game data in real time through a system interface, determines whether a corresponding triggering event exists based on the game data, and generates a task execution request corresponding to the decision-making task if a triggering event exists.

[0060] The task execution request includes the NPC identifier for executing the decision task and the task execution parameters. Optionally, different decision tasks correspond to their own task execution parameters. For example, the task execution parameters for a movement task may include parameters such as target movement location, movement type, movement direction, and movement speed. Similarly, the task execution parameters for a dialogue task may include parameters such as dialogue speed, dialogue tone, and dialogue text.

[0061] Considering that virtual games typically involve multiple NPCs, each with its own game design and capabilities, and that different decision tasks may have different execution requirements, when the decision system generates a task execution request for a decision task, it is also necessary to determine the NPC that supports the execution of that decision task and then send the task execution request to the decision scheduler corresponding to that NPC.

[0062] Optionally, each NPC corresponds to its own decision scheduler, which is used to schedule the various decision tasks that the NPC needs to execute. Optionally, the decision scheduler is used to schedule the execution order and progress of different decision tasks. For example, if there are decision task A and decision task B, the decision scheduler needs to determine whether the NPC should execute decision task A first or decision task B first. Furthermore, during the execution of decision task A by the NPC, the decision scheduler needs to determine the execution progress of decision task A, including execution, interruption, discarding, and resumption.

[0063] Optionally, the first decision system is used to generate a first task execution request corresponding to the first decision task based on the first triggering event. Therefore, in some embodiments, when the first triggering event exists, the computer device first determines the first NPC that supports the execution of the first decision task through the first decision system, thereby generating the first task execution request corresponding to the first decision task, and sending the first task execution request to the first decision scheduler corresponding to the first NPC.

[0064] For example, in the event of a player character's combat event, the escape decision system first identifies the first NPC within the player character's combat range and generates an escape mission execution request corresponding to the escape mission. The escape mission execution request is then sent to the first decision scheduler corresponding to the first NPC to trigger the control of the first NPC to execute the escape mission.

[0065] Step 220: If the task execution conditions of the first decision task are met as determined by the first decision scheduler, the first behavior system corresponding to the first NPC is invoked by the first decision scheduler to control the first NPC to execute the first decision task.

[0066] Optionally, in order to improve the behavioral control of NPCs in performing decision-making tasks, each NPC also has its own behavior system, which is used to control the NPCs in performing decision-making tasks through the system interface.

[0067] Optionally, the decision scheduler is used to schedule the execution order and progress of various decision tasks by NPCs. Therefore, when the decision scheduler determines that an NPC should execute a certain decision task, it needs to send a call request to the corresponding behavior system of the NPC, so that the behavior system can control the NPC to execute the decision task. Then, the behavior system, based on the decision task data sent by the decision scheduler, controls the NPC to execute the corresponding decision task, and notifies the decision scheduler via a system callback upon completion of the decision task.

[0068] In some embodiments, when the first decision scheduler receives a first task execution request and determines that the task execution conditions of the first decision task are met, the computer device can call the first behavior system corresponding to the first NPC through the first decision scheduler, thereby controlling the first NPC to execute the first decision task through the first behavior system.

[0069] The execution conditions for the first decision task include scenario conditions, time conditions, and task execution order conditions. Optionally, the task execution order condition can be that there are no other decision tasks that the first NPC needs to execute before the execution of the first decision task, that is, there are no other decision tasks in the sequence of tasks to be executed that are executed before the first decision task.

[0070] For example, the first NPC has decision task A, decision task B and decision task C to be executed, and the first decision scheduler determines the execution order of the tasks as decision task A, decision task B and decision task C. Therefore, when decision task A is completed, that is, when the task execution conditions of decision task B are met, the first NPC can execute decision task B.

[0071] Step 230: If the first decision task is completed, return a task completion notification to the first decision system through the first decision scheduler.

[0072] Optionally, in order to facilitate the first decision system in determining the task execution status of the first decision task and improve the request generation efficiency of the first decision system, the computer device can also return a task execution completion notification to the first decision system through the first decision scheduler when it is determined that the first NPC has completed the first decision task.

[0073] Optionally, the task completion notification may include the NPC identifier of the first NPC and the execution result of the first NPC in executing the first decision task, and may also include the time data of the first NPC in executing the first decision task, etc., which are not limited in this embodiment of the application.

[0074] In summary, this embodiment of the application achieves NPC behavior control through data interaction between three parts: a decision-making system, a decision scheduler, and a behavior system. First, the decision-making system generates a task execution request corresponding to a decision task based on a triggering event and sends the task execution request to the decision scheduler corresponding to the NPC that supports the execution of the decision task. Second, the decision scheduler, upon determining that the task execution conditions of the decision task are met, invokes the behavior system corresponding to the NPC, thereby controlling the NPC to execute the decision task. By modularizing the NPC control and management framework, the decision-making system corresponds to the decision task, and the decision scheduler corresponds to the NPC. Thus, the decision-making system generates the task execution request for the decision task, and the decision scheduler manages the execution status of the NPC's decision task, reducing the development and maintenance difficulty of NPC control and ensuring the scalability of the decision-making system while improving development efficiency.

[0075] In some embodiments, considering that a single NPC in a virtual game may have multiple decision tasks to be performed, in order to improve the effective management of the execution order of NPC decision tasks, the computer device can manage and maintain the task execution chain corresponding to the NPC through a decision scheduler.

[0076] Please refer to Figure 3 This document illustrates a flowchart of an NPC control method provided in another exemplary embodiment of this application. This embodiment uses the method applied to a computer device (including a terminal and / or a server) as an example for illustration. The method includes the following steps:

[0077] Step 211: In the presence of a first triggering event, the first decision system determines the first NPC based on the NPC ability set corresponding to each NPC in the game. The first NPC's first NPC ability set instructs the first NPC to support the execution of the first decision task.

[0078] Considering that virtual games usually have a large number of NPCs, and different NPCs often have different abilities, meaning that not all NPCs can perform any decision task, the decision system also needs to combine the NPCs' abilities to determine which NPCs can perform the current decision task.

[0079] For example, child NPCs lack combat abilities, so when a combat quest exists, the quest execution request corresponding to the combat quest cannot be sent to the decision scheduler corresponding to the child NPC. Similarly, an angry NPC lacks interactive abilities, so when a dialogue interaction quest exists, the quest execution request corresponding to the dialogue interaction quest cannot be sent to the decision scheduler corresponding to the angry NPC.

[0080] Therefore, when generating task execution requests corresponding to decision tasks in various decision systems, it is necessary to first determine the NPCs in the virtual game that support the execution of the decision task.

[0081] Optionally, different NPCs have their own set of NPC abilities. The NPC ability set includes all the behavioral entry points that the NPC can perform, including combat, vigilance, being attracted by items placed by the player character, reacting to the player character's words, and choosing to call the police, run away or attack when the player character's threat level is too high.

[0082] In some embodiments, considering that NPC abilities may vary due to differences in character settings, mission scenarios and current states, i.e., different NPCs may have different NPC abilities, and the same NPC in different mission scenarios may also have different NPC abilities, in order to improve the efficiency of configuring the NPC abilities of each NPC, a basic NPC ability set and an NPC stacked ability set can be set for each NPC.

[0083] The NPC basic ability set includes NPC abilities pre-configured before the match, while the NPC stacked ability set includes NPC abilities granted during the match. That is, different NPC abilities can be granted to NPCs depending on the task scenario or NPC state during the match. For example, for a certain NPC, there may be interactive abilities that are pre-configured in the NPC basic ability set and are in an active state. However, if the NPC enters an angry state during the match, its interactive abilities can be temporarily deactivated.

[0084] Optionally, based on the modifiability of NPC abilities, NPC abilities can be divided into unchangeable NPC abilities and changeable NPC abilities. Among them, unchangeable NPC abilities only belong to the NPC's basic ability set, that is, once pre-configured before the game, they remain fixed. For example, for a child NPC, its basic ability set includes combat abilities that are pre-configured and turned off before the game, and the child NPC's combat abilities remain turned off throughout the game.

[0085] It should be noted that for NPC basic abilities that are not modifiable, their immutability means that they are not affected by changes in the NPC character's state or the game scene during the virtual match. However, if a quest blueprint is configured in the virtual match, the NPC basic ability can be modified based on the configuration requirements of the quest blueprint.

[0086] Optionally, modifiable NPC abilities can belong to both the NPC basic ability set and the NPC stacked ability set, or only to the NPC stacked ability set. For example, the NPC basic ability set includes interactive abilities that are active, but if an NPC enters an angry state during a match, that NPC is given interactive abilities that are deactivated. As another example, for adult NPCs, the NPC basic ability set does not include combat abilities, but when that NPC enters a combat scenario, combat abilities can be temporarily granted to that NPC.

[0087] Indicative, such as Figure 4 As shown, for a single NPC, it is necessary to configure NPC basic ability set 401 and NPC stacked ability set 402. Both NPC basic ability and NPC stacked ability can be changed based on the task blueprint node.

[0088] Regarding configuring NPC basic abilities, setting an NPC basic ability to True will enable that NPC's basic ability; setting it to False will disable that NPC's basic ability; if not configured, the NPC's basic ability will be enabled by default.

[0089] Regarding configuring NPC stacking abilities, setting the NPC stacking ability to True enables the NPC stacking ability; setting it to False disables the NPC stacking ability; if not configured, the NPC stacking ability is not processed by default.

[0090] Optionally, to improve the efficiency of configuring and developing NPC abilities, the configuration of NPC abilities can be divided into two stages: development and planning. In the development stage, the basic abilities of NPCs and some superimposed abilities of NPCs are mainly configured, while in the planning stage, only superimposed abilities of NPCs can be configured. This allows planners of different NPCs to focus on the specific needs of NPC ability configuration and improve the efficiency of NPC ability configuration.

[0091] Based on the above configuration method for NPC capabilities, in order to determine the NPC that supports the execution of the current decision task, the decision system needs to accurately determine the NPC capabilities that the NPC currently possesses. For NPC capabilities that cannot be changed, the decision system can directly read the configuration status (on or off) of the NPC capability from the NPC capability set; for NPC capabilities that can be changed, as the status of the NPC capability changes continuously, the decision system needs to read the latest configuration status of the NPC capability from the NPC capability set in real time.

[0092] In one possible implementation, upon the presence of a first triggering event, the computer device can first determine, through a first decision system, the first NPC supporting the execution of the first decision task. Optionally, the computer device can read the NPC ability sets corresponding to each NPC in the virtual game through the first decision system, thereby determining the first NPC supporting the execution of the first decision task based on the NPC ability sets corresponding to each NPC. The first NPC ability set indicates that the first NPC supports the execution of the first decision task.

[0093] Optionally, the first NPC's ability set includes the first NPC's basic ability set and the first NPC's stacked ability set. The first NPC's basic ability set includes NPC abilities pre-configured before the game, and the first NPC's stacked ability set includes NPC abilities assigned to the first NPC during the game.

[0094] Optionally, in order to improve the efficiency and effectiveness of NPC determination, considering that only NPCs displayed in the game interface need to have game performance, the computer device can also use the first decision system to read only the NPC ability set corresponding to each NPC displayed in the game interface, thereby determining the first NPC that supports the execution of the first decision task from the NPCs displayed in the game interface.

[0095] To illustrate, the first decision task is a combat task, and the first NPC's ability set includes combat abilities that are enabled. The first NPC is displayed on the game interface, so the computer device can determine through the first decision system that the first NPC supports the execution of the first decision task.

[0096] Step 212: The first decision system generates a first task execution request corresponding to the first decision task based on the NPC identifier of the first NPC.

[0097] Optionally, to facilitate management and identification of any NPC in the game, a corresponding NPC identifier, such as an NPC number, can be set for each NPC, thus making each NPC unique.

[0098] In one possible implementation, the computer device can generate a first task execution request corresponding to the first decision task based on the NPC identifier of the first NPC through the first decision system, so that the first decision scheduler can determine the accuracy of request sending and receiving based on the NPC identifier in the first task execution request.

[0099] Step 213: Send the first task execution request to the first decision scheduler corresponding to the first NPC through the first decision system.

[0100] Furthermore, after generating the first task execution request, the computer device sends the first task execution request to the first decision scheduler corresponding to the first NPC through the first decision system. Thus, when the first decision scheduler receives the first task execution request and determines that the first task execution request includes the NPC identifier of the first NPC, it can determine that the first task execution request was sent correctly.

[0101] Step 221: Upon receiving the first task execution request and with the first NPC in a task execution state, the first task execution chain corresponding to the first NPC is obtained through the first decision scheduler. The first task execution chain includes the second decision task currently being executed by the first NPC and the third decision task to be executed.

[0102] Optionally, to improve the scheduling efficiency of NPCs executing various decision-making tasks, a corresponding task execution chain can be configured for each NPC. This task execution chain maintains the decision-making tasks received by the decision scheduler. That is, the task execution chain includes the decision-making tasks currently being executed by the NPC and the decision-making tasks yet to be executed.

[0103] Optionally, the decision tasks in the task execution chain are sorted according to their priority. The higher the task priority, the earlier the decision task is executed. That is, the task priority is used to indicate the importance of the decision task. The task priority of the currently executing decision task is usually higher than the task priority of the decision task to be executed.

[0104] Optionally, the computer device can maintain each decision task in the task execution chain through a decision scheduler, based on a scheduling algorithm that performs task insertion, deletion, and querying with constant time complexity. Optionally, the computer device configures corresponding doubly linked lists for different task priorities, and the doubly linked lists record the most recently added decision tasks in chronological order. Furthermore, the computer device also maintains a global record of the highest priority through the decision scheduler. When adding a decision task to the task execution chain, it needs to determine whether the task priority of the decision task is higher than the current highest priority. When a decision task is completed and deleted, the computer device needs to re-traverse the task execution chain through the decision scheduler to determine the new highest priority task and retrieve the decision task from the doubly linked list corresponding to that highest priority.

[0105] The task execution chain consists of a task priority table and a doubly linked list corresponding to each task priority. The task priority table contains the priorities of each task, and the doubly linked list corresponding to each task priority stores the decision task for that priority.

[0106] Indicative, such as Figure 5As shown, the task execution chain includes a task priority table 501, which contains task priorities 1000, 2000, and 3000. Currently, only the decision-making task with task priority 1000 is included. Therefore, the computer device only needs to query the doubly linked list 502 corresponding to task priority 1000 through the decision scheduler to determine the decision-making task to be executed by the NPC.

[0107] In one possible implementation, when a first task execution request is received and the first NPC is not in a task execution state, i.e., the first task execution chain corresponding to the first NPC is empty, the computer device can directly add the first decision task to the first task execution chain through the first decision scheduler, thereby calling the first behavior system to control the first NPC to execute the first decision task.

[0108] In another possible implementation, when a first task execution request is received and the first NPC is in a task execution state, in order to determine the storage location of the first decision task in the first task execution chain, the computer device needs to obtain the first task execution chain corresponding to the first NPC through the first decision scheduler.

[0109] Optionally, the first task execution chain includes the second decision task currently being executed by the first NPC and the third decision task to be executed. If the second decision task does not have a specific task attribute, the priority of the second task of the second decision task is higher than the priority of the third task of the third decision task. Here, a specific task attribute refers to an attribute with a lower priority but still requiring priority execution. This attribute can be configured by the developer for a specific task; generally, decision tasks do not possess this specific task attribute.

[0110] Step 222: The first decision task is added to the first task execution chain by the first decision scheduler based on the first task priority of the first decision task, the second task priority of the second decision task, and the third task priority of the third decision task.

[0111] Optionally, after obtaining the first task execution chain corresponding to the first NPC, the computer device compares the first task priority of the first decision task, the second task priority of the second decision task, and the third task priority of the third decision task through the first decision scheduler, and adds the first decision task to the first task execution chain according to the comparison result.

[0112] Optionally, the first task execution chain includes a priority table and a doubly linked list corresponding to each task priority. Based on this, the computer device can directly add the first decision task to the doubly linked list corresponding to the first task priority based on the first task priority of the first decision task through the first decision scheduler.

[0113] In one possible implementation, if the priority of the first task is higher than that of the second task, it is necessary to interrupt the currently executing second decision task in order to control the first NPC to immediately execute the first decision task. Thus, the computer device adds the first decision task to the first task execution chain before the second decision task through the first decision scheduler.

[0114] In other words, if the priority of the first decision task is higher than the highest priority of the current task in the first task execution chain, the computer device stores the first decision task in the doubly linked list corresponding to the first task priority through the first decision scheduler. For example, if the priority of the second decision task is 1000 and the priority of the first decision task is 2000, the first task priority is obviously higher than the second task priority. The second decision task is interrupted by the first decision task, and the computer device can add the first decision task to the doubly linked list corresponding to task priority 2000 through the first decision scheduler.

[0115] In another possible implementation, if the priority of the first task is lower than that of the second task but higher than that of the third task, then it is necessary to control the first NPC to complete the second decision task, execute the first decision task first and then the third decision task. Thus, the computer device adds the first decision task to the first task execution chain after the second decision task and before the third decision task through the first decision scheduler.

[0116] For example, the priority of the second decision task is 2000, the priority of the first decision task is 1000, and the priority of the third decision task is 500. Obviously, the priority of the first task is lower than the priority of the second task but higher than the priority of the third task. Therefore, the second decision task is not interrupted, and the computer device adds the first decision task to the doubly linked list corresponding to the priority of 1000.

[0117] In another possible implementation, if the priority of the first task is lower than that of the second task and lower than that of the third task, then the first NPC needs to be controlled to complete the second decision task first, then the third decision task, and then the first decision task. In this way, the computer device adds the first decision task to the first task execution chain after the third decision task through the first decision scheduler.

[0118] For example, the priority of the second decision task is 2000, the priority of the first decision task is 500, and the priority of the third decision task is 1000. Obviously, the priority of the first task is lower than the priority of the second task and lower than the priority of the third task. Therefore, the second decision task is not interrupted, and the computer device adds the first decision task to the doubly linked list corresponding to the priority of 500.

[0119] In another possible implementation, when the priority of the first task is higher than that of the second task, and the second decision task is a highly interactive task, that is, although the priority of the first task is higher, the second decision task currently being executed has specific task attributes, so the second decision task cannot be interrupted. The computer device can only add the first decision task to the first task execution chain after the second decision task and before the third decision task through the first decision scheduler.

[0120] By comparing the priorities of each decision task in the task execution chain, and adding the first decision task to the task execution chain according to different comparison results, it is possible to avoid NPC task execution disorder and improve the orderliness and logic of NPC task execution.

[0121] In the aforementioned scenarios of adding a first decision task to the first task execution chain, the second decision task currently being executed by the first NPC has two possible states: uninterrupted and interrupted. If the second decision task is interrupted, it may enter one of two different task states depending on whether it supports suspension.

[0122] In one possible implementation, if the second decision task is not a task that supports suspension, and before the first decision task is added to the second decision task, the computer device can discard the second decision task in the first task execution chain through the first decision scheduler.

[0123] In other words, if the second decision task is interrupted by the first decision task, and the second decision task does not support suspending, the computer device will directly delete the second decision task from the doubly linked list through the first decision scheduler, and will not query or execute the second decision task again.

[0124] For example, for tasks requiring immediate feedback, NPCs typically need to process the action immediately to avoid delays that could confuse or mislead players. For instance, when a player attacks an NPC, the NPC should either immediately become angry or ignore the attack, rather than showing anger several minutes later. Therefore, tasks requiring immediate feedback are usually configured to not support suspension.

[0125] In another possible implementation, before adding the first decision task to the second decision task, and if the second decision task supports suspension, the computer device can suspend the second decision task currently being executed by the first NPC through the first decision scheduler. After the first NPC completes the first decision task and the task execution conditions of the second decision task are met, the computer device can call the first behavior system corresponding to the first NPC through the first decision scheduler to control the first NPC to continue executing the second decision task. That is, the second decision task can be resumed even after being interrupted.

[0126] That is, if the second decision task is interrupted by the first decision task, and the second decision task is a task that supports suspension, the computer device sets the second decision task to a suspended state, and after the first NPC completes the first decision task, it calls the first behavior system through the first decision scheduler to control the first NPC to resume the execution of the second decision task.

[0127] For example, for patrol missions, if a player character interacts with an NPC while the NPC is performing a patrol mission, the NPC will prioritize the interaction mission, which will be interrupted by the patrol mission. After the interaction ends, the NPC should continue performing the patrol mission from its current location. Therefore, patrol missions can be configured to support suspending missions.

[0128] Optionally, for decision-making tasks that support suspension, in a multi-tasking environment, the decision-making task may also be interrupted due to insufficient computing resources. For example, in the case of low level of detail (LOD), if the distance between the NPC and the main virtual character on the terminal is too far, the decision-making task executed by the NPC may temporarily enter a suspended state even if the NPC is located on the game interface.

[0129] By configuring the task suspension attribute for decision-making tasks, the continuity and logic of the game experience can be ensured, making NPC behavior consistent with player expectations and reasonable. Furthermore, by providing suspension and resumption functions, the flexibility of NPC behavior management can be improved, meeting diverse game design needs.

[0130] Based on the various task states of the first and second decision tasks described above, the task states of each decision task in the task execution chain can include: newly created, executed, completed, suspended after being interrupted, resumed execution, and discarded. Optionally, the task state can also include stopped, meaning that the decision scheduler can put the currently executing decision task into a stopped state when it receives a task termination request sent by the decision system.

[0131] Indicative, such as Figure 6As shown, it illustrates the lifecycle flow diagram of a decision-making task provided in an exemplary embodiment of this application.

[0132] New: For any decision task, when the decision scheduler adds it to the task execution chain, the decision task enters the new state and waits for execution.

[0133] Create → Discard: While a task is waiting to be executed, the decision-making system can determine the task execution conditions in real time. If the conditions are not met, the system sends a task discard command to the decision scheduler via an interface callback, causing the scheduler to discard the task. This transitions the task from the created state to the discarded state. The task execution conditions can include scene conditions, time conditions, etc. For example, if the task is a combat task, and the NPC has combat capabilities and is in a combat scene, the decision-making system can determine that the task execution conditions are met. However, if the NPC leaves the combat scene while waiting to execute the task, the system determines that the task execution conditions are no longer met and the task can be discarded from the task execution chain.

[0134] New → Execute: When the priority of the decision task is the highest priority in the task execution chain, i.e., the waiting is completed, the decision scheduler retrieves the decision task from the doubly linked list and calls the behavior system to control the NPC to execute the decision task. That is, the decision task enters the execution state from the new state.

[0135] Execution → Completion: During the execution of a task, if the task is not interrupted and the execution conditions are not changed, the NPC successfully executes the decision-making task, that is, the decision-making task changes from the execution state to the completion state.

[0136] Execution → Stop: If the task execution conditions change and are no longer met, the decision system can send a task termination request to the decision scheduler through an interface callback. This allows the decision scheduler to stop calling the behavior system and actively control the NPC to stop executing the decision task, thus changing the decision task from the execution state to the stop state.

[0137] Execution → Suspension: If a task is interrupted and it is a task that supports suspension, the decision scheduler can suspend the decision task, that is, the decision task changes from the execution state to the suspension state.

[0138] Suspend → Resume Execution: After a task is suspended, and the NPC completes other decision-making tasks that are currently being executed, the decision scheduler can resume the execution of the suspended decision-making task, that is, the decision-making task moves from the suspended state to the resumed execution state.

[0139] Optionally, other states of a decision-making task can also transition between each other, such as directly entering the suspended state from the new state, entering the discard state from the execution state, or entering the discard state from the suspended state.

[0140] Optionally, different decision-making tasks have their own task state switching configurations, and the switching of task states is related to the task attributes of the decision-making task. Furthermore, the switching between different task states can be adjusted based on development needs, and this embodiment does not limit this.

[0141] By configuring different states for decision-making tasks, the interface callbacks of the decision-making system to which the task belongs can be triggered as the task switches between different states. This enables the expansion of various functions, improves the flexibility of the decision-making system, and facilitates developers to extend the system's functionality to adapt to complex game requirements. Furthermore, through the interface callbacks of the decision-making system, NPCs can dynamically respond to and execute specific decision-making tasks when the task state changes, further enhancing the scalability and adaptability of the decision-making system.

[0142] Step 223: If the task execution conditions of the first decision task are met, the first decision scheduler calls the first behavior system corresponding to the first NPC to control the first NPC to execute the first decision task.

[0143] In some embodiments, after the first decision task is added to the first task execution chain, the computer device can determine the task execution conditions of the first decision task in real time through the first decision scheduler. If the task execution conditions of the first decision task are met, the computer device can call the first behavior system corresponding to the first NPC through the first decision scheduler to control the first NPC to execute the first decision task.

[0144] Optionally, the task execution conditions for the first decision task include at least a task execution order condition, which is the order of the decision tasks in the first task execution chain. Optionally, the computer device can only control the first NPC to execute the first decision task if the first decision task is in the first task execution chain and there are no other decision tasks preceding the first decision task in the first task execution chain.

[0145] In the first task execution chain, if the first task priority of the first decision task is the highest task priority at present, and there are no other decision tasks preceding the first decision task in the doubly linked list corresponding to this task priority, the computer device can retrieve the first decision task from the doubly linked list through the first decision scheduler and call the first behavior system corresponding to the first NPC to control the first NPC to execute the first decision task.

[0146] By retrieving decision-making tasks sequentially according to their priority within the task execution chain and then invoking the corresponding behavior system of the NPC to control the NPC in executing these decision-making tasks, the orderly execution of NPC tasks can be guaranteed.

[0147] Based on the above example where the priority of the first decision task is higher than the priority of the second decision task, and the second decision task is interrupted, it can be seen that when the decision scheduler receives a task execution request for an interaction task during the NPC's performance task, the performance task will be interrupted because the interaction task has a higher priority than the performance task. Furthermore, even if the performance task is suspended after the interaction task is completed, and the decision scheduler then calls the behavior system to control the NPC to continue performing the performance task, from the perspective of task execution rationality and logic, the interruption of the performance task is clearly unnecessary. Configuring the NPC's task execution flow to perform the performance task while simultaneously performing the interaction task with the player character is clearly more in line with player expectations and is more reasonable.

[0148] Based on this, in one possible implementation, before adding the first decision task to the second decision task, i.e. when the second decision task is interrupted, the computer device can first determine whether there is a conflict between the first decision task and the second decision task. If it is determined that there is no conflict between the first decision task and the second decision task, the computer device can control the first NPC to continue executing the second decision task by calling the first behavior system corresponding to the first NPC.

[0149] For example, taking the second decision task as the cooking task, if the cooking task is interrupted by the interactive task, since there is no conflict between the cooking task and the interactive task, the computer device can call the first behavior system of the first NPC through the decision scheduler, thereby controlling the first NPC to execute the interactive task while continuing to execute the cooking task.

[0150] Optionally, the computer device can also determine whether to continue executing the second decision task if it is interrupted by the first decision task by judging the task attributes of the decision task. In one possible implementation, before adding the first decision task to the second decision task, and if the first decision task does not have an action retention attribute while the second decision task does, the computer device can add the second decision task to the task retention list through the first decision scheduler. Then, the computer device queries the first task execution chain through the first decision scheduler and finds that the first task priority of the first decision task is the highest priority currently in the first task execution chain. Therefore, it retrieves the first decision task from the first task execution chain and calls the first behavior system corresponding to the first NPC to control the first NPC to execute the first decision task. Simultaneously, since the second decision task exists in the task retention list, the computer device also needs to call the first behavior system corresponding to the first NPC through the first decision scheduler to control the first NPC to continue executing the second decision task.

[0151] The task hold list is used to maintain decision tasks with action hold attributes. That is, if the currently executing decision task is interrupted, and the decision task has the action hold attribute, the computer device can add the decision task to the task hold list through the decision scheduler. Thus, while controlling the NPC to execute subsequent decision tasks, and provided that the subsequent decision tasks do not conflict with the decision tasks in the task hold list, the computer device can simultaneously control the NPC to execute action hold tasks.

[0152] By configuring a task retention list to maintain decision-making tasks with action retention attributes, the management efficiency of decision-making tasks with action retention attributes can be improved, ensuring the effective execution of decision-making tasks with action retention attributes by NPCs, thereby improving the logic of NPC task execution.

[0153] Indicative, such as Figure 7 The diagram illustrates a timing diagram of controlling an NPC to perform an action-holding task according to an exemplary embodiment of this application. For example, a standalone performance system is used to trigger a decision task with action-holding attributes. When the standalone performance system executes a performance start decision task, the decision scheduler needs to read the interaction-holding node configured in the TimeLine when scheduling the performance decision task, and the behavior system needs to record the performance behavior as an interaction-holding. Furthermore, when performing interactive / other tasks that support action-holding, the computer device can invoke a decision task with action-holding attributes through the decision scheduler. Moreover, if a performance decision task is suspended, the decision scheduler may not immediately stop executing the performance decision task, but instead add the performance decision task to the action-holding list (the list to be stopped).

[0154] Step 230: If the first decision task is completed, return a task completion notification to the first decision system through the first decision scheduler.

[0155] The implementation method of this step will not be described in detail here, but can be referred to the above embodiments.

[0156] In the above embodiments, by configuring the task execution chain corresponding to the NPC and storing each decision task to be executed by the NPC in a doubly linked list according to the task priority, the decision scheduler queries and retrieves the decision task with the highest current task priority based on the task priority, so as to control the NPC to execute the decision task, ensuring the orderliness and logic of the NPC task execution and optimizing the control effect of the NPC.

[0157] Furthermore, by configuring corresponding NPC ability sets for each NPC, the decision system can read the NPC ability sets to determine which NPCs support the execution of the current decision task, and then send task execution requests to the decision scheduler corresponding to the NPC. This ensures the effectiveness of task execution request sending and improves the accuracy of NPC control.

[0158] Meanwhile, by configuring decision-making tasks that support suspension, the task can be resumed after being interrupted, ensuring the continuity and logic of task execution. Furthermore, by configuring decision-making tasks with action persistence attributes, the task can continue to execute while controlling NPCs to perform other tasks, making NPC control more reasonable, meeting player expectations, and optimizing the player experience.

[0159] In some embodiments, to control NPCs to perform movement tasks, a movement decision system needs to be configured to generate task execution requests corresponding to the movement tasks. For escape tasks, which can be divided into movement tasks and emotional tasks (making a frightened expression), an escape decision system needs to be configured to generate two task execution requests corresponding to each of the movement and emotional tasks.

[0160] The process of generating a task execution request for a mobile task needs to be deployed in both the mobile decision system and the escape decision system. Obviously, this will lead to a waste of computing resources and redundancy. Therefore, in order to reduce the complexity of the NPC control and management framework and improve data processing efficiency, calls between decision systems can be added.

[0161] Please refer to Figure 8This document illustrates a flowchart of an NPC control method provided in another exemplary embodiment of this application. This embodiment uses the method applied to a computer device (including a terminal and / or a server) as an example for illustration. The method includes the following steps:

[0162] Step 810: In the presence of the second triggering event, the second decision system generates a system call request corresponding to the fourth decision task and sends the system call request to the third decision system. The second triggering event triggers the fourth decision task.

[0163] Optionally, different decision-making systems are used to respond to different triggering events, thereby generating task execution requests for their respective decision tasks. Optionally, the second decision-making system is used to generate the task execution request corresponding to the fourth decision task, and the second triggering event triggers the fourth decision task, which is the root decision task, meaning that the fourth decision task includes at least two sub-decision tasks. For example, the fourth decision task is an escape task, which includes a movement task and an emotion task.

[0164] In one possible implementation, during the game, the computer device uses a second decision system to detect in real time whether a second triggering event exists based on the game data. If a second triggering event exists, the computer device uses the second decision system to generate a system call request corresponding to a fourth decision task and sends the system call request to the third decision system.

[0165] Optionally, developers can configure system call interfaces for each decision system. In the event of a second triggering event, the second decision system can send a system call request to the third decision system through the system call interface.

[0166] Optionally, the calling relationships between various decision-making systems can be implemented through pre-configuration. For example, a root decision-making system, intermediate decision-making systems, and leaf decision-making systems can be pre-configured. The root decision-making system serves as the task triggering entry point, typically generated by an event. The intermediate decision-making systems encapsulate complete task execution logic, while the leaf decision-making systems implement the underlying logic for NPC atomic behaviors. Both the intermediate and leaf decision-making systems can be called by the root decision-making system, thereby improving the modular development of the decision-making system.

[0167] Indicative, such as Figure 9 As shown, this illustrates a schematic diagram of a decision system partitioning provided in an exemplary embodiment of this application. For example, the root decision system 901 can be used to trigger behaviors such as ecological behavior, regression, coordinated entry into battle, interaction, and friendly fire; the intermediate decision system 902 can be used to trigger behaviors such as following, strong interaction, task points, and ensemble points; and the leaf decision system 903 can be used to trigger behaviors such as movement, individual performance, teleportation, and begging for mercy. It should be noted that... Figure 9 This example only illustrates a possible configuration of the decision-making system. In actual development, developers can configure different decision-making systems to trigger different decision-making tasks and configure the calling relationships between different decision-making systems according to specific business needs. This application does not limit this aspect.

[0168] Step 820: When the third decision system receives a system call request, it generates a fifth task execution request corresponding to the fifth decision task and sends the fifth task execution request to the second decision scheduler corresponding to the second NPC. The fifth decision task is a subtask of the fourth decision task, and the second NPC supports the execution of the fourth decision task.

[0169] In one possible implementation, when the third decision system receives a system call request, the computer device generates a fifth task execution request corresponding to the fifth decision task through the third decision system, and sends the fifth task execution request to the second decision scheduler corresponding to the second NPC. The fifth decision task is a subtask of the fourth decision task.

[0170] The second NPC supports the execution of the fourth decision task. Specifically, in the presence of the second triggering event, the second decision system first identifies the second NPC that supports the execution of the fourth decision task and obtains the NPC identifier corresponding to the second NPC, thereby generating a system call request based on the NPC identifier. Then, after the third decision system receives this system call request, it can determine, based on the NPC identifier in the request, to send the fifth task execution request to the second decision scheduler corresponding to the second NPC.

[0171] In some embodiments, to facilitate the decision scheduler's acquisition of call information between decision systems, when the second decision system sends a system call request to the third decision system, it also simultaneously sends a task execution request corresponding to the fourth decision task to the second decision scheduler corresponding to the second NPC. The second decision scheduler then adds the fourth decision task to the second task execution chain corresponding to the second NPC based on its priority. Subsequently, when the second decision scheduler receives a fifth task execution request from the third decision system, it adds the fifth decision task as a subtask of the fourth decision task to the second task execution chain.

[0172] Optionally, the fifth decision task, as a subtask of the fourth decision task, may have the same or different priority as the fourth task. Optionally, for decision tasks triggered by the root decision system, the corresponding task priority is pre-configured by the developers; while for decision tasks triggered by intermediate or leaf decision systems, the corresponding task priority may be pre-configured by the developers or determined based on system call relationships.

[0173] Optionally, the second decision system can add the fourth task priority of the fourth decision task to the system call request for transmission to the third decision system. In one possible implementation, when the third decision system receives the system call request and the fifth decision task does not have a preset task priority, the task priority of the fifth decision task is consistent with the task priority of its parent task, and the computer device determines the fourth task priority of the fourth decision task as the fifth task priority of the fifth decision task through the third decision system. In another possible implementation, when the third decision system receives the system call request and the fifth decision task has a preset task priority, the task priority of the fifth decision task is not determined based on the task priority of its parent task, and the computer device can directly determine the preset task priority as the task priority of the fifth decision task through the third decision system.

[0174] For example, if the priority of the fourth decision task is 1000, then the priority of the fifth decision task is 1000 if the developer has not pre-configured the priority of the fifth decision task; if the developer has pre-configured the priority of the fifth decision task to be 1500, then the priority of the fifth decision task is 1500.

[0175] In the presence of system calls, two methods are provided to determine the task priority of subtasks based on whether the subtasks have pre-configured task priorities. This ensures that each decision task added to the task execution chain is executed in order of task priority, thereby guaranteeing the orderly execution of NPC tasks.

[0176] Indicative, such as Figure 10The diagram illustrates the execution flowchart of each decision task in the task execution chain when a system call exists, as provided in an exemplary embodiment of this application. Taking decision task B as a subtask of decision task A as an example, at time T0, the decision scheduler adds task A and task C to start; at time T1, subtask B of task A is triggered, so the decision scheduler adds task AB to start and executes task AB; at time T2, when the execution request of task X is received, since the priority of task X is higher than the current highest priority in the execution chain, task AB is interrupted, and task C no longer meets the task execution conditions, so task C is removed from the task execution chain; at time T3, the NPC executes task X and suspends task A; at time T4, the NPC completes task X, so "complete task X" is added; at time T5, "complete task X" is executed.

[0177] Step 830: If the task execution conditions for the fifth decision task are met as determined by the second decision scheduler, the second decision scheduler calls the second behavior system corresponding to the second NPC to control the second NPC to execute the fifth decision task.

[0178] Optionally, after adding the fourth and fifth decision tasks to the second task execution chain corresponding to the second NPC, the computer device can query the second task execution chain through the second decision scheduler and call the second behavior system corresponding to the second NPC according to the task priority of each decision task, so as to control the second NPC to execute each decision task in sequence.

[0179] In one possible implementation, if the second decision scheduler determines that the task execution conditions for the fifth decision task are met, the computer device can call the second behavior system corresponding to the second NPC through the second decision scheduler to control the second NPC to execute the fifth decision task.

[0180] The execution conditions for the fifth decision task can be that the priority of the fifth decision task in the second task execution chain is the highest priority of the current task, and there are no other decision tasks preceding the fifth decision task in the doubly linked list where the fifth decision task is located.

[0181] Indicative, such as Figure 11 As shown, it illustrates a timing interaction diagram between the decision system and the decision scheduler when a system call exists, provided by an exemplary embodiment of this application.

[0182] like Figure 11As shown, after triggering a decision task, the decision system 1101 can send the task execution instruction to the decision scheduler 1102. While waiting for task execution, it may send a task stop execution instruction to the decision scheduler 1102 if the task execution conditions are judged in real time. Furthermore, to ensure efficient execution of each decision task, the decision scheduler 1102 processes each decision task asynchronously and promptly returns a task notification to the decision system 1101 when there are situations such as task execution / interruption / suspend / resumption / termination.

[0183] When the decision system 1101 needs to call other decision systems, the decision system 1101 also needs to send the task execution instruction of the decision task to the decision scheduler 1102. While waiting for the task to be executed, the decision system 1101 may send the task stop execution instruction to the decision scheduler 1102 by judging the task execution conditions in real time.

[0184] In the above embodiments, by configuring the system call relationship between different decision systems, it is possible to avoid configuring data that triggers the same decision task in multiple decision systems, thereby reducing the waste of computing resources, reducing the complexity of the NPC control management framework, and improving data processing efficiency.

[0185] In some embodiments, for multi-NPC tasks in virtual games, i.e. decision-making tasks performed jointly by multiple NPCs, a separate multi-NPC decision-making system can be configured to improve the control efficiency of multiple NPCs and optimize the execution effect of multi-NPC decision-making tasks.

[0186] Please refer to Figure 12 This document illustrates a flowchart of an NPC control method provided in another exemplary embodiment of this application. This embodiment uses the method applied to a computer device (including a terminal and / or a server) as an example for illustration. The method includes the following steps:

[0187] Step 1210: In the presence of a third triggering event, n sixth task execution requests corresponding to the sixth decision task are generated through the fourth decision system, and n sixth task execution requests are sent to the third decision schedulers corresponding to the n third NPCs respectively. The third NPCs support the execution of the sixth decision task. The n sixth task execution requests include task association identifiers. The task association identifiers are used to indicate that the sixth decision task is a multi-NPC decision task. n is a positive integer and n is greater than or equal to 2.

[0188] Optionally, the developers configure a third triggering event to trigger the fourth decision system to generate a sixth decision task, whereby the sixth decision task is a multi-NPC decision task. In one possible implementation, when the third triggering event is present, the computer device can determine n third NPCs that support the execution of the sixth decision task through the fourth decision system, and generate n sixth task execution requests corresponding to the sixth decision task based on the NPC identifiers corresponding to the n third NPCs, thereby sending the n sixth task execution requests to the third decision schedulers corresponding to the n third NPCs respectively.

[0189] To ensure the correlation between the n sixth task execution requests, the computer device can set a task association identifier through the fourth decision system and add the task association identifier to the n sixth task execution requests. This task association identifier indicates that the sixth decision task is a multi-NPC decision task. Furthermore, during the data interaction between the fourth decision system and the third decision scheduler, this task association identifier is always carried, so that the fourth decision system can determine the task execution status of each third NPC.

[0190] Optionally, the sixth decision task corresponding to the n third NPCs can be a task with the same action parameters or a task with different action parameters. For example, if the sixth decision task is a group dance task, the n third NPCs can perform the same dance action or different dance actions. This embodiment of the application does not limit this.

[0191] In one possible implementation, to ensure the consistency of actions among the n third NPCs when executing the sixth decision task, the sixth decision task can be configured as a phased task, comprising a first phase task and a second phase task. The first phase task is a preparation phase task, used to determine that the n third NPCs are in the preparation phase for task execution; the second phase task is a synchronous execution phase task, used to control the n third NPCs to synchronously execute the sixth decision task.

[0192] Optionally, for phased tasks, to ensure the execution of each phase, the corresponding task execution requests can also be sent to the decision scheduler in stages, thereby ensuring the accuracy of task execution. In one possible implementation, in the presence of a third triggering event, the fourth decision system needs to generate n first-phase task execution requests and n second-phase task execution requests corresponding to the sixth decision task, and send the task execution requests to the third decision scheduler in stages.

[0193] Step 1220: If the task execution conditions for the sixth decision task are met as determined by the third decision scheduler, the third decision scheduler calls the third behavior system corresponding to the third NPC to control the third NPC to execute the sixth decision task.

[0194] In one possible implementation, in the presence of a third triggering event, the computer device can generate n first-stage task execution requests corresponding to the sixth decision task through the fourth decision system, and send the n first-stage task execution requests to the third decision schedulers corresponding to the n third NPCs, so as to control the n third NPCs to execute the first-stage tasks in the sixth decision task first.

[0195] Furthermore, the third decision schedulers corresponding to the n third NPCs, following the task execution scheduling method of the first decision scheduler in the above embodiment, call the third behavior systems corresponding to the n third NPCs respectively, under the condition that the task execution conditions of the sixth decision task are met, to control the third NPCs to execute the first stage task. When the third NPCs complete the first stage task, the computer device returns a task stage completion notification to the fourth decision system through the third decision scheduler.

[0196] Optionally, the task phase completion notification also includes a task association identifier. In one possible implementation, when the fourth decision system receives task phase completion notifications from each of the third decision schedulers, it indicates that all n third NPCs are in the task execution preparation phase of the sixth decision task. The computer device can then further generate n second-stage task execution requests corresponding to the sixth decision task through the fourth decision system and send these n requests to the third decision schedulers corresponding to the n third NPCs. This allows the third decision schedulers to control the n third NPCs to jointly execute the second-stage task of the sixth decision task, thereby achieving multi-NPC decision control.

[0197] Optionally, considering that during the execution of the sixth decision task, each third NPC may be interrupted by other decision systems triggering the third NPC to execute other decision tasks, in order to ensure the synchronization and consistency of the actions among the n third NPCs, it is necessary to synchronously control the n NPCs to pause the execution of the sixth decision task.

[0198] In one possible implementation, if the sixth decision task is interrupted, the computer device can send a stage task interruption notification to the fourth decision system via the third decision scheduler. This stage task interruption notification also includes a task association identifier. Upon receiving the stage task interruption notification from the third decision scheduler, the computer device can update the sixth decision task based on the task association identifier via the fourth decision system, regenerate n first-stage task execution requests corresponding to the sixth decision task, and resend the n first-stage task execution requests to the third decision schedulers corresponding to the n third NPCs. Then, when the n third decision schedulers receive the first-stage task execution requests, they delete the original sixth decision task from the third task execution chain and regain control of the third NPCs to execute the first-stage task of the sixth decision task.

[0199] In other words, if the sixth decision task being performed by any third NPC is interrupted, all n third NPCs will re-execute the first phase task and return to the task preparation phase, thereby ensuring that all n third NPCs can re-synchronize and execute the second phase task, and avoiding the impact on the overall performance due to the interruption of the task of an individual third NPC.

[0200] In the above embodiments, for multi-NPC decision-making tasks, the fourth decision-making system generates multiple task execution requests and sends them to the decision schedulers corresponding to each NPC, thereby controlling multiple NPCs to jointly execute the multi-NPC decision-making task. Furthermore, by dividing the multi-NPC decision-making task into phased tasks, it is possible to control NPCs to first enter the preparation phase before executing the task, ensuring synchronization and consistency of actions among multiple NPCs.

[0201] Furthermore, if any NPC's task is interrupted, controlling all NPCs to return to the preparation phase can further ensure the consistency of group actions and optimize the execution effect of multi-NPC decision-making tasks.

[0202] In some embodiments, considering that deploying the decision-making system directly on the terminal may lead to players tampering with the decision-making system configuration data on the terminal, causing cheating issues, while configuring the decision-making system on the server requires constant data transmission between the terminal and the server during the game, which may increase the data transmission pressure and reduce the response speed of the game on the terminal side.

[0203] Based on this, in the embodiments of this application, for general decision-making systems, i.e. decision-making systems with low risk of cheating, the system operation data of the decision-making system is deployed directly on the terminal; for decision-making systems with cheating risk, the system operation data of the decision-making system is deployed on the terminal and the server respectively, so as to ensure that important operations are processed by the server.

[0204] Please refer to Figure 13This document illustrates a flowchart of an NPC control method provided in another exemplary embodiment of this application. This embodiment uses the method applied to a terminal as an example for illustration. The method includes the following steps:

[0205] Step 1310: If the existence of the fourth triggering event is determined by the fifth decision system, the fourth triggering event is sent to the server so that the server generates the seventh task execution request corresponding to the seventh decision task through the fifth decision system. The fifth decision system is deployed on the terminal and the server.

[0206] Optionally, the decision-making tasks triggered by the fifth decision-making system may involve modifying NPC data, teleporting NPCs, or changing important NPC attributes. Therefore, to ensure game security, data involving important operations in the fifth decision-making system can be deployed on the server, while other processing data can be deployed on the terminal to ensure game response speed on the terminal side. In other words, the fifth decision-making system is deployed in blocks on both the terminal and the server.

[0207] Optionally, the fourth triggering event triggers the seventh decision task. In one possible implementation, the fifth decision system deployed on the terminal side is responsible for determining in real time whether a fourth triggering event exists in the game. If the existence of a fourth triggering event is determined, the terminal can send the fourth triggering event to the server, so that the server can generate a seventh task execution request corresponding to the seventh decision task through the fifth decision system.

[0208] For example, if the seventh decision task involves important system operations in the fifth decision system, such as modifying NPC data, then the seventh task execution request would include the modified NPC data processed by the server.

[0209] In some embodiments, the terminal may generate a seventh task execution request corresponding to the seventh decision task, and only some important system operations involved in the request generation process may be executed by the server. That is, in the case of a fourth triggering event, the terminal synchronizes event information with the server, and the server processes important system operations based on the event information. The server then returns the data processing results to the terminal, and the terminal generates a seventh task execution request corresponding to the seventh decision task based on the data processing results.

[0210] For example, if the seventh decision task is a dialogue interaction task, then the execution request of the seventh task needs to include NPC interaction action parameters and NPC dialogue text. However, the NPC dialogue text may be tampered with by the player. Therefore, the NPC dialogue text generation process in the fifth decision system can be deployed on the server, and the server can process it. After the server generates the NPC dialogue text through the fifth decision system, it returns the NPC dialogue text to the terminal. The terminal combines the NPC interaction action parameters generated by the fifth decision system deployed on the terminal with the received NPC dialogue text to generate the execution request of the seventh task.

[0211] Indicative, such as Figure 14 As shown, it illustrates a schematic diagram of the deployment configuration of a decision system provided in an exemplary embodiment of this application. Figure 14 As shown, if the decision-making system does not require server-side data storage / verification, does not involve modification of critical data, or does not require server-side anti-fraud measures, it can be configured on the client side. If the decision-making system requires server-side data storage / verification, involves modification of critical data, or requires server-side anti-fraud measures, it can be configured on both the server and client sides. Furthermore, when configuring the decision-making system on both the server and client sides, it is possible to determine whether the decision-making task should be initiated on the client or the server side based on whether the client needs to respond to the event first.

[0212] Step 1320: Upon receiving the seventh task execution request from the server, the seventh task execution request is sent to the fourth decision scheduler corresponding to the fourth NPC through the fifth decision system. The fourth NPC supports the execution of the seventh decision task.

[0213] Optionally, the process of data interaction between the terminal side and the fourth decision scheduler corresponding to the fourth NPC through the fifth decision system can refer to the interaction process between the decision system and the decision scheduler in the above embodiment, which will not be described in detail here.

[0214] Step 1330: If the task execution conditions for the seventh decision task are met as determined by the fourth decision scheduler, the fourth decision scheduler calls the fourth behavior system corresponding to the fourth NPC to control the fourth NPC to execute the seventh decision task.

[0215] Optionally, the process of data interaction between the terminal side and the fourth behavior system through the fourth decision scheduler can refer to the interaction process between the decision scheduler and the behavior system in the above embodiment, which will not be described in detail here.

[0216] Step 1340: If the seventh decision task is completed, return a task completion notification to the fifth decision system through the fourth decision scheduler, and synchronize the task completion notification to the server.

[0217] In one possible implementation, upon completion of the seventh decision task, in order to achieve data synchronization and consistency between the server and the terminal, the terminal can also synchronize the task completion notification to the server so that the server can record the call information of the decision system for subsequent verification of whether the NPC execution meets expectations and to detect whether there are other cheating behaviors.

[0218] Indicative, such as Figure 15 As shown, this illustration depicts a schematic diagram of decision system data synchronization between a terminal and a server provided in an exemplary embodiment of this application. Figure 15 As shown, when the decision-making system is configured on both the server and client sides, an RPC (Remote Procedure Call) can be established between the client and server. Therefore, regardless of whether the decision-making task is initiated on the client or the server, data synchronization between the client and server can be achieved.

[0219] In the above embodiments, for decision-making tasks with a risk of cheating, deploying important system data in the decision-making system on a server allows the server-side decision-making system to execute critical system operations, ensuring the security of the decision-making system. Furthermore, deploying other system data in the decision-making system on the terminal ensures that the decision-making system can respond promptly to game events. This achieves the goal of ensuring fairness in the game without affecting the terminal's game response speed, increasing the reliability of the decision-making system, and effectively preventing player cheating.

[0220] Please refer to Figure 16 This illustrates a schematic diagram of the interaction between a decision system and a decision scheduler provided in an exemplary embodiment of this application. Figure 16 As shown, multiple decision-making systems can be configured to trigger different decision-making tasks according to the game requirements, and different decision-making tasks are triggered based on different triggering events. For example, triggering event 1 is used to trigger decision-making system 1 to generate a task execution request corresponding to decision-making task 1, and triggering event 2 is used to trigger decision-making system 2 to generate a task execution request corresponding to decision-making task 2. When corresponding triggering events exist, the computer device generates the task execution request corresponding to the decision-making task through the decision-making system and sends it to the decision scheduler corresponding to the NPC, thus enabling the decision scheduler to manage and schedule the execution of each decision-making task.

[0221] Please refer to Figure 17 This illustrates a schematic diagram of an NPC control framework provided in an exemplary embodiment of this application. Figure 17As shown, in the NPC control and management framework, for each decision-making task, it is necessary to configure the task priority, whether the decision-making task can be suspended and resumed after being interrupted, whether there are high-priority decision-making tasks that are not executed immediately, whether other suspended decision-making tasks can be interrupted during task execution, and whether there are dependencies between decision-making tasks. For the decision-making system, it is necessary to configure the system call relationships between decision-making systems.

[0222] It should be noted that, Figure 17 The examples provided are only for a few possible configuration scenarios. In actual applications, developers can add, modify, or delete the corresponding decision-making tasks or decision-making system configurations according to the needs of the game. This application does not limit this.

[0223] Please refer to Figure 18 The diagram illustrates a structural block diagram of an NPC control device provided in an exemplary embodiment of this application, the device comprising:

[0224] Decision module 1801 is used to generate a first task execution request corresponding to a first decision task through a first decision system when a first triggering event occurs, and send the first task execution request to the first decision scheduler corresponding to the first NPC. The first triggering event triggers the first decision task, and the first NPC supports the execution of the first decision task.

[0225] The scheduling module 1802 is used to control the first NPC to execute the first decision task by calling the first behavior system corresponding to the first NPC through the first decision scheduler when the task execution conditions of the first decision task are determined to be met by the first decision scheduler.

[0226] The scheduling module 1802 is used to return a task completion notification to the first decision system through the first decision scheduler when the first decision task is completed.

[0227] Optionally, the scheduling module 1802 includes:

[0228] The execution chain acquisition unit is used to acquire the first task execution chain corresponding to the first NPC through the first decision scheduler when the first task execution request is received and the first NPC is in the task execution state. The first task execution chain includes the second decision task currently being executed by the first NPC and the third decision task to be executed.

[0229] The task adding unit is used to add the first decision task to the first task execution chain by the first decision scheduler based on the first task priority of the first decision task, the second task priority of the second decision task, and the third task priority of the third decision task;

[0230] The system call unit is used to call the first behavior system corresponding to the first NPC through the first decision scheduler when the task execution conditions of the first decision task are met, so as to control the first NPC to execute the first decision task.

[0231] Optionally, the task adding unit is used for:

[0232] The first decision scheduler compares the first task priority of the first decision task, the second task priority of the second decision task, and the third task priority of the third decision task.

[0233] If the priority of the first task is higher than the priority of the second task, the first decision task is added to the first task execution chain before the second decision task by the first decision scheduler.

[0234] If the priority of the first task is lower than the priority of the second task but higher than the priority of the third task, the first decision task is added to the first task execution chain after the second decision task by the first decision scheduler.

[0235] When the priority of the first task is higher than that of the second task, and the second decision task is a highly interactive task, the first decision task is added to the first task execution chain after the second decision task by the first decision scheduler.

[0236] Optionally, the device further includes:

[0237] The scheduling module 1802 is used to suspend the second decision task currently being executed by the first NPC through the first decision scheduler when the first decision task is added to the second decision task and the second decision task is a task that supports suspension; and when the first NPC completes the execution of the first decision task and meets the task execution conditions of the second decision task, the first decision scheduler calls the first behavior system corresponding to the first NPC to control the first NPC to continue executing the second decision task.

[0238] The scheduling module 1802 is used to discard the second decision task in the first task execution chain by the first decision scheduler before adding the first decision task to the second decision task, and when the second decision task is a task that does not support suspension.

[0239] Optionally, the system call unit is used for:

[0240] If there are no other decision tasks preceding the first decision task in the first task execution chain, the first decision scheduler calls the first behavior system corresponding to the first NPC to control the first NPC to execute the first decision task.

[0241] Optionally, the device further includes:

[0242] The scheduling module 1802 is used to control the first NPC to continue executing the second decision task by calling the first behavior system corresponding to the first NPC through the first decision scheduler before adding the first decision task to the second decision task and when there is no conflict between the first decision task and the second decision task.

[0243] Optionally, the scheduling module 1802 is used for:

[0244] Before adding the first decision task to the second decision task, and when the first decision task does not have the action retention attribute, and the second decision task has the action retention attribute, the second decision task is added to the task retention list by the first decision scheduler. The task retention list is used to maintain decision tasks with the action retention attribute.

[0245] The first decision scheduler invokes the first behavior system corresponding to the first NPC to control the first NPC to continue executing the second decision task.

[0246] Optionally, the decision module 1801 is used for:

[0247] In the presence of the first triggering event, the first decision system determines the first NPC based on the NPC ability set corresponding to each NPC in the game, and the first NPC's first NPC ability set indicates that the first NPC supports the execution of the first decision task.

[0248] The first decision system generates the first task execution request corresponding to the first decision task based on the NPC identifier of the first NPC.

[0249] The first decision system sends the first task execution request to the first decision scheduler corresponding to the first NPC.

[0250] Optionally, the first NPC's first NPC ability set includes a first NPC basic ability set and a first NPC superimposed ability set; wherein, the first NPC basic ability set includes NPC abilities pre-configured before the game; and the first NPC superimposed ability set includes NPC abilities assigned to the first NPC during the game.

[0251] Optionally, the device further includes:

[0252] The decision module 1801 is used to generate a system call request corresponding to the fourth decision task through the second decision system when a second triggering event exists, and send the system call request to the third decision system, wherein the second triggering event triggers the fourth decision task.

[0253] The decision module 1801 is used to generate a fifth task execution request corresponding to a fifth decision task through the third decision system when the third decision system receives the system call request, and send the fifth task execution request to the second decision scheduler corresponding to the second NPC. The fifth decision task is a subtask of the fourth decision task, and the second NPC supports the execution of the fourth decision task.

[0254] The scheduling module 1802 is used to control the second NPC to execute the fifth decision task by calling the second behavior system corresponding to the second NPC through the second decision scheduler when the task execution conditions of the fifth decision task are determined by the second decision scheduler.

[0255] Optionally, the device further includes:

[0256] The decision module 1801 is used to determine the fourth task priority of the fourth decision task as the fifth task priority of the fifth decision task through the third decision system when the third decision system receives the system call request and the fifth decision task does not have a preset task priority.

[0257] The decision module 1801 is used to determine the preset task priority as the fifth task priority of the fifth decision task through the third decision system when the third decision system receives the system call request and the fifth decision task has the preset task priority.

[0258] Optionally, the device further includes:

[0259] The decision module 1801 is used to generate n sixth task execution requests corresponding to the sixth decision task through the fourth decision system when a third triggering event exists, and send the n sixth task execution requests to the third decision schedulers corresponding to the n third NPCs respectively. The third NPCs support the execution of the sixth decision task. The n sixth task execution requests include a task association identifier, which is used to indicate that the sixth decision task is a multi-NPC decision task, where n is a positive integer and n is greater than or equal to 2.

[0260] The scheduling module 1802 is used to control the third NPC to execute the sixth decision task by calling the third behavior system corresponding to the third NPC through the third decision scheduler when the task execution conditions of the sixth decision task are determined by the third decision scheduler.

[0261] Optionally, the sixth decision task includes a first-stage task and a second-stage task, and the decision module 1801 is used for:

[0262] In the presence of the third triggering event, the fourth decision system generates n first-stage task execution requests corresponding to the sixth decision task and sends the n first-stage task execution requests to the third decision scheduler corresponding to the n third NPCs.

[0263] The device further includes:

[0264] The scheduling module 1802 is used to return a task phase completion notification to the fourth decision system through the third decision scheduler when the third NPC completes the first phase task.

[0265] The decision module 1801 is used to generate n second-stage task execution requests corresponding to the sixth decision task through the fourth decision system when receiving the task phase completion notification returned by each third decision scheduler, and send the n second-stage task execution requests to the third decision schedulers corresponding to the n third NPCs.

[0266] Optionally, the device further includes:

[0267] The decision module 1801 is used to update the sixth decision task based on the task association identifier through the fourth decision system when it receives a stage task interruption notification sent by the third decision scheduler.

[0268] The decision module 1801 is used to regenerate the n first-stage task execution requests corresponding to the sixth decision task through the fourth decision system, and send the n first-stage task execution requests to the third decision scheduler corresponding to the n third NPCs.

[0269] Optionally, the device further includes:

[0270] An event sending module is used to send the fourth triggering event to the server when the existence of the fourth triggering event is determined by the fifth decision system, so that the server generates a seventh task execution request corresponding to the seventh decision task through the fifth decision system, wherein the fifth decision system is deployed on the terminal and the server;

[0271] The decision module 1801 is used to send the seventh task execution request to the fourth decision scheduler corresponding to the fourth NPC through the fifth decision system when it receives the seventh task execution request sent by the server, wherein the fourth NPC supports the execution of the seventh decision task;

[0272] The scheduling module 1802 is used to, when the task execution conditions of the seventh decision task are determined by the fourth decision scheduler, call the fourth behavior system corresponding to the fourth NPC through the fourth decision scheduler to control the fourth NPC to execute the seventh decision task.

[0273] The notification synchronization module is used to return a task completion notification to the fifth decision system through the fourth decision scheduler when the seventh decision task is completed, and to synchronize the task completion notification to the server.

[0274] In summary, this embodiment of the application achieves NPC behavior control through data interaction between three parts: a decision-making system, a decision scheduler, and a behavior system. First, the decision-making system generates a task execution request corresponding to a decision task based on a triggering event and sends the task execution request to the decision scheduler corresponding to the NPC that supports the execution of the decision task. Second, the decision scheduler, upon determining that the task execution conditions of the decision task are met, invokes the behavior system corresponding to the NPC, thereby controlling the NPC to execute the decision task. By modularizing the NPC control and management framework, the decision-making system corresponds to the decision task, and the decision scheduler corresponds to the NPC. Thus, the decision-making system generates the task execution request for the decision task, and the decision scheduler manages the execution status of the NPC's decision task, reducing the development and maintenance difficulty of NPC control and ensuring the scalability of the decision-making system while improving development efficiency.

[0275] It should be noted that the apparatus provided in the above embodiments is only an example of the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the apparatus can be divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus and method embodiments provided in the above embodiments belong to the same concept, and their implementation process can be found in the method embodiments, which will not be repeated here.

[0276] Please refer to Figure 19 This illustration shows a schematic diagram of a computer device provided in an exemplary embodiment of this application. Specifically, the computer device 1900 includes a Central Processing Unit (CPU) 1901, a system memory 1904 including a random access memory 1902 and a read-only memory 1903, and a system bus 1905 connecting the system memory 1904 and the CPU 1901. The computer device 1900 may also include a basic input / output system (I / O system) 1906 to facilitate the transfer of information between various devices within the computer, and a mass storage device 1907 for storing the operating system 1913, application programs 1914, and other program modules 1915.

[0277] In some embodiments, the basic input / output system 1906 includes a display 1908 for displaying information and an input device 1909 for user input of information, such as a mouse or keyboard. Both the display 1908 and the input device 1909 are connected to the central processing unit 1901 via an input / output controller 1910 connected to a system bus 1905. The basic input / output system 1906 may also include the input / output controller 1910 for receiving and processing input from multiple other devices such as a keyboard, mouse, or electronic stylus. Similarly, the input / output controller 1910 also provides output to a display screen, printer, or other types of output devices.

[0278] The mass storage device 1907 is connected to the central processing unit 1901 via a mass storage controller (not shown) connected to the system bus 1905. The mass storage device 1907 and its associated computer-readable media provide non-volatile storage for the computer device 1900. That is, the mass storage device 1907 may include computer-readable media (not shown) such as a hard disk or drive.

[0279] Without loss of generality, the computer-readable medium may include computer storage media and communication media. Computer storage media include volatile and non-volatile, removable and non-removable media implemented using any method or technology for storing information such as computer-readable instructions, data structures, program modules, or other data. Computer storage media include random access memory (RAM), read-only memory (ROM), flash memory or other solid-state storage technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic tape cassettes, magnetic tape, disk storage, or other magnetic storage devices. Of course, those skilled in the art will recognize that the computer storage media are not limited to the above-mentioned types. The system memory 1904 and mass storage device 1907 described above can be collectively referred to as memory.

[0280] The memory stores one or more programs, which are configured to be executed by one or more central processing units 1901. The one or more programs contain instructions for implementing the methods described above. The central processing unit 1901 executes the one or more programs to implement the NPC control methods provided in the various method embodiments described above.

[0281] According to various embodiments of this application, the computer device 1900 can also be connected to a remote computer on a network, such as the Internet. That is, the computer device 1900 can be connected to the network 1911 via the network interface unit 1912 connected to the system bus 1905, or the network interface unit 1912 can be used to connect to other types of networks or remote computer systems (not shown).

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

[0283] Optionally, the computer-readable storage medium may include ROM, RAM, solid-state drives (SSDs), or optical discs, etc. The RAM may include resistive random access memory (ReRAM) and dynamic random access memory (DRAM).

[0284] This application provides a computer program product including at least one instruction stored in a computer-readable storage medium. A processor of a computer device reads the at least one instruction from the computer-readable storage medium and executes the at least one instruction, causing the computer device to perform the NPC control method described in the above embodiments.

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

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

Claims

1. An NPC control method, characterized in that, The method includes: In the presence of a first triggering event, a first task execution request corresponding to a first decision task is generated by the first decision system, and the first task execution request is sent to the first decision scheduler corresponding to the first NPC. The first triggering event triggers the first decision task, and the first NPC supports the execution of the first decision task. If the first decision scheduler determines that the task execution conditions of the first decision task are met, the first decision scheduler calls the first behavior system corresponding to the first NPC to control the first NPC to execute the first decision task. Upon completion of the first decision task, the first decision scheduler returns a task completion notification to the first decision system.

2. The method according to claim 1, characterized in that, The step of, when the task execution conditions for the first decision task are determined to be met by the first decision scheduler, invoking the first behavior system corresponding to the first NPC through the first decision scheduler to control the first NPC to execute the first decision task, includes: Upon receiving the first task execution request and with the first NPC in a task execution state, the first task execution chain corresponding to the first NPC is obtained through the first decision scheduler. The first task execution chain includes the second decision task currently being executed by the first NPC and the third decision task to be executed. The first decision scheduler adds the first decision task to the first task execution chain based on the first task priority of the first decision task, the second task priority of the second decision task, and the third task priority of the third decision task. If the task execution conditions of the first decision task are met, the first decision scheduler calls the first behavior system corresponding to the first NPC to control the first NPC to execute the first decision task.

3. The method according to claim 2, characterized in that, The step of adding the first decision task to the first task execution chain by the first decision scheduler based on the first task priority of the first decision task, the second task priority of the second decision task, and the third task priority of the third decision task includes: The first decision scheduler compares the first task priority of the first decision task, the second task priority of the second decision task, and the third task priority of the third decision task. If the priority of the first task is higher than the priority of the second task, the first decision task is added to the first task execution chain before the second decision task by the first decision scheduler. If the priority of the first task is lower than the priority of the second task but higher than the priority of the third task, the first decision task is added to the first task execution chain after the second decision task by the first decision scheduler. When the priority of the first task is higher than that of the second task, and the second decision task is a highly interactive task, the first decision task is added to the first task execution chain after the second decision task by the first decision scheduler.

4. The method according to claim 3, characterized in that, The method further includes: Before adding the first decision task to the second decision task, and if the second decision task supports suspension, the second decision task currently being executed by the first NPC is suspended by the first decision scheduler; if the first NPC completes the execution of the first decision task and meets the task execution conditions of the second decision task, the first decision scheduler calls the first behavior system corresponding to the first NPC to control the first NPC to continue executing the second decision task. If the first decision task is not supported for suspension, and the second decision task is not added to the second decision task before the first decision task is added to the second decision task, the second decision task in the first task execution chain is discarded by the first decision scheduler.

5. The method according to claim 3, characterized in that, When the task execution conditions of the first decision task are met, the first decision scheduler invokes the first behavior system corresponding to the first NPC to control the first NPC to execute the first decision task, including: If there are no other decision tasks preceding the first decision task in the first task execution chain, the first decision scheduler calls the first behavior system corresponding to the first NPC to control the first NPC to execute the first decision task.

6. The method according to claim 3, characterized in that, The method further includes: Before adding the first decision task to the second decision task, and provided that there is no conflict between the first decision task and the second decision task, the first decision scheduler calls the first behavior system corresponding to the first NPC to control the first NPC to continue executing the second decision task.

7. The method according to claim 6, characterized in that, Before adding the first decision task to the second decision task, and when there is no conflict between the first decision task and the second decision task, the first decision scheduler schedules the first behavior system corresponding to the first NPC to control the first NPC to continue executing the second decision task, including: Before adding the first decision task to the second decision task, and when the first decision task does not have the action retention attribute, and the second decision task has the action retention attribute, the second decision task is added to the task retention list by the first decision scheduler. The task retention list is used to maintain decision tasks with the action retention attribute. The first decision scheduler invokes the first behavior system corresponding to the first NPC to control the first NPC to continue executing the second decision task.

8. The method according to any one of claims 1 to 7, characterized in that, In the event of a first triggering event, generating a first task execution request corresponding to a first decision task through a first decision system and sending the first task execution request to the first decision scheduler corresponding to the first NPC includes: In the presence of the first triggering event, the first decision system determines the first NPC based on the NPC ability set corresponding to each NPC in the game, and the first NPC's first NPC ability set indicates that the first NPC supports the execution of the first decision task. The first decision system generates the first task execution request corresponding to the first decision task based on the NPC identifier of the first NPC. The first decision system sends the first task execution request to the first decision scheduler corresponding to the first NPC.

9. The method according to claim 8, characterized in that, The first NPC's first NPC ability set includes a first NPC basic ability set and a first NPC superimposed ability set; wherein, the first NPC basic ability set includes NPC abilities pre-configured before the game; the first NPC superimposed ability set includes NPC abilities assigned to the first NPC during the game.

10. The method according to any one of claims 1 to 9, characterized in that, The method further includes: In the presence of a second triggering event, a system call request corresponding to the fourth decision task is generated by the second decision system and sent to the third decision system. The second triggering event triggers the fourth decision task. When the third decision system receives the system call request, it generates a fifth task execution request corresponding to the fifth decision task and sends the fifth task execution request to the second decision scheduler corresponding to the second NPC. The fifth decision task is a subtask of the fourth decision task, and the second NPC supports the execution of the fourth decision task. If the second decision scheduler determines that the task execution conditions of the fifth decision task are met, the second decision scheduler calls the second behavior system corresponding to the second NPC to control the second NPC to execute the fifth decision task.

11. The method according to claim 10, characterized in that, The method further includes: When the third decision system receives the system call request and the fifth decision task does not have a preset task priority, the third decision system determines the fourth task priority of the fourth decision task as the fifth task priority of the fifth decision task. When the third decision system receives the system call request and the fifth decision task has the preset task priority, the third decision system determines the preset task priority as the fifth task priority of the fifth decision task.

12. The method according to any one of claims 1 to 11, characterized in that, The method further includes: In the presence of a third triggering event, the fourth decision system generates n sixth task execution requests corresponding to the sixth decision task, and sends the n sixth task execution requests to the third decision schedulers corresponding to the n third NPCs respectively. The third NPCs support the execution of the sixth decision task. The n sixth task execution requests include a task association identifier, which is used to indicate that the sixth decision task is a multi-NPC decision task. n is a positive integer and n is greater than or equal to 2. If the third decision scheduler determines that the task execution conditions of the sixth decision task are met, the third decision scheduler calls the third behavior system corresponding to the third NPC to control the third NPC to execute the sixth decision task.

13. The method according to claim 12, characterized in that, The sixth decision task includes a first-stage task and a second-stage task. In the event of a third triggering event, the fourth decision system generates n sixth task execution requests corresponding to the sixth decision task, and sends these n sixth task execution requests to the third decision schedulers corresponding to the n third NPCs, including: In the presence of the third triggering event, the fourth decision system generates n first-stage task execution requests corresponding to the sixth decision task and sends the n first-stage task execution requests to the third decision scheduler corresponding to the n third NPCs. The method further includes: If the third NPC completes the first phase of the task, the third decision scheduler will return a task phase completion notification to the fourth decision system. Upon receiving the task phase completion notifications returned by each of the third decision schedulers, the fourth decision system generates n second-stage task execution requests corresponding to the sixth decision task and sends the n second-stage task execution requests to the third decision schedulers corresponding to the n third NPCs.

14. The method according to claim 13, characterized in that, The method further includes: Upon receiving a stage task interruption notification from the third decision scheduler, the sixth decision task is updated by the fourth decision system based on the task association identifier. The fourth decision system regenerates the n first-stage task execution requests corresponding to the sixth decision task and sends the n first-stage task execution requests to the third decision scheduler corresponding to the n third NPCs.

15. The method according to any one of claims 1 to 14, characterized in that, The method is used in a terminal, and the method further includes: If the existence of a fourth triggering event is determined by the fifth decision system, the fourth triggering event is sent to the server so that the server generates a seventh task execution request corresponding to the seventh decision task through the fifth decision system. The fifth decision system is deployed on the terminal and the server. Upon receiving the seventh task execution request sent by the server, the seventh task execution request is sent to the fourth decision scheduler corresponding to the fourth NPC through the fifth decision system, and the fourth NPC supports the execution of the seventh decision task; If the fourth decision scheduler determines that the task execution conditions for the seventh decision task are met, the fourth decision scheduler calls the fourth behavior system corresponding to the fourth NPC to control the fourth NPC to execute the seventh decision task. Upon completion of the seventh decision task, the fourth decision scheduler returns a task completion notification to the fifth decision system and synchronizes the task completion notification to the server.

16. An NPC control device, characterized in that, The device includes: The decision module is used to generate a first task execution request corresponding to a first decision task through a first decision system when a first triggering event occurs, and send the first task execution request to the first decision scheduler corresponding to the first NPC. The first triggering event triggers the first decision task, and the first NPC supports the execution of the first decision task. The scheduling module is used to control the first NPC to execute the first decision task by calling the first behavior system corresponding to the first NPC through the first decision scheduler when the task execution conditions of the first decision task are determined to be met by the first decision scheduler. The scheduling module is used to return a task completion notification to the first decision system through the first decision scheduler when the first decision task is completed.

17. A computer device, characterized in that, The computer device includes a processor and a memory; the memory stores at least one instruction, which is executed by the processor to implement the NPC control method as described in any one of claims 1 to 15.

18. A computer-readable storage medium, characterized in that, The storage medium stores at least one instruction, which is executed by a processor to implement the NPC control method as described in any one of claims 1 to 15.

19. A computer program product, characterized in that, The computer program product includes at least one instruction stored in a computer-readable storage medium; a processor of a computer device reads the at least one instruction from the computer-readable storage medium and executes the at least one instruction to cause the computer device to implement the NPC control method as described in any one of claims 1 to 15.