A method and system for updating task system data based on a behavior tree
By adopting a behavior tree-based data update method in the task system, task events and progress are integrated into the task behavior tree, which solves the problems of complex design and complex data update of traditional task system, and achieves efficient task progress update and reduces development costs.
Patent Information
- Application Number
- CN202110796585.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-14
- Publication Date
- 2025-06-20
- Estimated Expiration
- 2041-07-14
AI Technical Summary
The traditional table-driven task system design is complex, which increases the labor costs of developers. The task preconditions are often difficult to design and data updates are complex.
Using the task system data update method based on the behavior tree, by establishing multiple task behavior trees, task events of the same event type are integrated into the same task behavior tree, and task events and their task progress are placed in each task node under the task behavior tree, and the task progress of the task node is updated according to the triggered preset conditions.
It improves the efficiency of task progress update, reduces the labor costs of developers, and simplifies the maintenance and development process of task systems.
Smart Images

Figure CN115617821B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of game design, and particularly relates to a method and system for updating task system data based on a behavior tree. Background Art
[0002] Due to the increasingly fierce competition in the game industry, during the game design process, the design of the task system is becoming more and more rich and complex. For the traditional table-driven task system, due to its fixed attribute characteristics and the development method based on agreements (supporting several types of condition detections), it greatly limits the diversity of tasks, increases the labor cost of developers, and the traditional table-driven scheme generally designs the system task table according to the task type, fixed types of preconditions, completion conditions, etc. Players judge which tasks are currently acceptable and the completion progress of the accepted tasks according to the table. When completed, rewards are obtained according to the task ID. The defects of this method are as follows:
[0003] 1. The types of preconditions for tasks need to rely on the agreements between planners and developers, and when new preconditions are added, the data coupling relationship is very troublesome.
[0004] 2. When there are multiple task preconditions, the design difficulty of the table-driven method is large.
[0005] 3. Task updates depend on specific task types and internal data (unrelated to task IDs). Therefore, when updating data, the progress update can only be completed by traversing all task lists, with high complexity. Summary of the Invention
[0006] The technical problem to be solved by the present invention is to provide a method and system for updating task system data based on a behavior tree, reducing the labor cost of developers and the maintenance cost of the system.
[0007] To solve the above technical problem, the technical solution adopted by the present invention is as follows:
[0008] A method for updating task system data based on a behavior tree includes the steps of:
[0009] S1. Establish multiple task behavior trees according to the event types of task events. Each of the task behavior trees contains multiple task nodes with preset association relationships, and each of the task nodes includes a task event and a task progress related to the event type;
[0010] S2. When starting the task system, load all the task behavior trees. When a preset condition triggered by the client is obtained, select the corresponding task behavior tree according to the event type corresponding to the triggered preset condition;
[0011] S3. The task behavior tree finds the corresponding task node according to the preset condition, and updates all the task progress under the corresponding task node according to the triggered preset condition.
[0012] To solve the above technical problems, another technical solution adopted by the present invention is:
[0013] A task system data update system based on a behavior tree includes a behavior tree editing subsystem and a business driving subsystem. The behavior tree editing subsystem includes a first memory, a first processor, and a first computer program stored on the first memory and executable on the first processor. The business driving subsystem includes a second memory, a second processor, and a second computer program stored on the second memory and executable on the second processor;
[0014] When the first processor executes the first computer program, the following steps are implemented:
[0015] S1. Establish multiple task behavior trees according to the event types of task events. Each task behavior tree contains multiple task nodes with preset association relationships, and each task node includes a task event and a task progress related to the event type;
[0016] When the second processor executes the second computer program, the following steps are implemented:
[0017] S2. When starting the task system, load all the task behavior trees. When a preset condition is triggered by the client, select the corresponding task behavior tree according to the event type corresponding to the triggered preset condition;
[0018] S3. The task behavior tree finds the corresponding task node according to the preset condition, and updates all the task progress under the corresponding task node according to the triggered preset condition.
[0019] The beneficial effects of the present invention are as follows: The present invention provides a task system data update method and system based on a behavior tree. By establishing multiple task behavior trees, task events of the same event type are integrated into the same task behavior tree, and the task events and their task progress are placed in each task node under the task behavior tree. When a preset condition is triggered by the client, the corresponding task behavior tree of the corresponding type can be quickly found according to the type of the preset condition, and the task behavior tree triggers the update of the task progress under all the task nodes corresponding to the preset condition, effectively improving the efficiency of task progress update and reducing the labor of developers. Description of the Drawings
[0020] Figure 1Flowchart of a method for updating data of a task system based on a behavior tree according to an embodiment of the present invention;
[0021] Figure 2 Structural diagram of a system for updating data of a task system based on a behavior tree according to an embodiment of the present invention.
[0022] Label description:
[0023] 1. A system for updating data of a task system based on a behavior tree; 2. Behavior tree editing subsystem; 21. First memory; 22. First processor; 3. Business drive subsystem; 31. Second memory; 32. Second processor. Detailed implementation manners
[0024] To describe in detail the technical content, achieved purpose and effects of the present invention, the following is described in conjunction with the embodiments and with reference to the accompanying drawings.
[0025] Before that, some basic concepts of the behavior tree in the present invention are described.
[0026] Behavior tree: A behavior tree is a tree structure for controlling decision-making behaviors, which contains hierarchical nodes (such as composite nodes, decorator nodes, condition nodes, and action nodes, etc.). Each node can return three states: success, failure, and running.
[0027] Basic node concepts of the behavior tree:
[0028] (1) Composite nodes, whose behaviors are determined by child nodes. Specifically, there are sequence nodes, selector nodes, parallel nodes, behavior subtrees, wait signal nodes, etc.:
[0029] Sequence node: All child nodes are executed sequentially. If all child nodes are Success, the sequence node returns Success. If any one child node returns Failure, it will immediately return Failure;
[0030] Selector node: The selector node returns Success when any one child node returns Success and no longer continues to run the subsequent child nodes. When all child nodes are Failure, the selector node will return Failure;
[0031] Parallel node: Logically, the parallel node executes all child nodes "simultaneously" in parallel, and then determines its own state according to the states of all child nodes (different return conditions can be configured);
[0032] Behavior subtree: Nested use of the behavior tree, supporting passing parameters to the subtree;
[0033] Wait Signal: It simulates the "blocking" process of waiting for a certain condition. Generally, it is used for the business logic to notify the behavior tree to perform behavior checks. Its node returns Running until the condition attached to it is true. If there are child nodes, it executes its child nodes and, when the child nodes end, returns the return value of the child nodes. If there are no child nodes, it directly returns success.
[0034] (2) Decorator Node: As a control branch node, it must and only accepts one child node. Before the decorator node is executed, it first executes the child node and determines its own state according to its own control logic and the return result of the child node. For example, loop N times, loop until a condition, always succeed / fail / running, etc.
[0035] (3) Condition Node: It compares and judges the left and right parameters and returns success or failure according to the result.
[0036] (4) Action Node: It refers to the leaf node of the behavior tree. Its usage method usually provides a data interface for the behavior tree module by the business layer and is called on the action node.
[0037] Please refer to Figure 1 , a method for updating data of a task system based on a behavior tree, including the steps:
[0038] S1. Establish multiple task behavior trees according to the event types of task events. Each of the task behavior trees contains multiple task nodes with preset association relationships, and each of the task nodes includes task events and task progress related to the event type;
[0039] S2. When the task system is started, load all the task behavior trees. When a preset condition triggered by the client is obtained, select the corresponding task behavior tree according to the event type corresponding to the triggered preset condition;
[0040] S3. The task behavior tree finds the corresponding task nodes according to the preset condition and updates all the task progress under the corresponding task nodes according to the triggered preset condition.
[0041] As can be seen from the above description, the beneficial effects of the present invention are as follows: By establishing multiple task behavior trees, task events of the same event type are integrated into the same task behavior tree, and the task events and their task progress are placed in each task node under the task behavior tree. When a preset condition is triggered by the client, the corresponding task behavior tree of the corresponding type can be quickly found according to the type of the preset condition, and the task behavior tree triggers the update of the task progress under all the task nodes corresponding to the preset condition, effectively improving the efficiency of task progress update and reducing the labor of developers.
[0042] Further, each of the task nodes in step S1 includes a task event related to the event type, and the task progress further includes:
[0043] Under each of the task nodes, there are also preconditions and completion conditions corresponding to the task event;
[0044] The precondition is used to determine whether the task event has been received;
[0045] The completion condition is used to determine whether the counting task event is completed;
[0046] Step S3 is specifically the following steps:
[0047] S31. The task behavior tree finds all the corresponding task nodes according to the preset conditions, determines whether the precondition under the task node is true. If so, it receives the task event under the task node and updates the status of the task progress to "task received", and executes step S32. Otherwise, it updates the status of the task progress to "task not received";
[0048] S32. According to the triggered preset conditions, it determines whether the completion condition is true. If so, it moves the task event to the completed task list and updates the status of the task progress to "task completed". Otherwise, it updates the status of the task progress to "task not completed".
[0049] It can be seen from the above description that by using the logic of the behavior tree to judge the preconditions and completion conditions of tasks, that is, according to the type of tasks, relevant preconditions and completion conditions are independently configured for each task in the form of a behavior tree, and a task data update process is designed. When the completion condition or precondition is triggered, the complex judgment is handed over to the behavior tree logic to be implemented to drive the update of the task progress, simplifying the development process and improving the development efficiency of the task system.
[0050] Further, the task nodes include composite nodes, decorator nodes, condition nodes, and action nodes;
[0051] The composite nodes include sequence nodes, selector nodes, parallel nodes, behavior subtrees, and wait signals;
[0052] The type of the task node is determined by the preset association relationship between multiple task nodes.
[0053] As can be seen from the above description, during the development of the game task system, by using the behavior tree to configure each node of the task system, developers only need to complete the access of the basic process, and then planners can freely configure relevant types of task nodes for each task according to the preset association relationships, and conduct idea verification and participate in the system development, which simplifies the development process, greatly improves the efficiency, and is not prone to logical problems in the program.
[0054] Further, between the steps S1 and S2, the following step is further included:
[0055] S11. Merge all the task behavior trees into a total behavior tree, where the total behavior tree includes multiple selection nodes, and each selection node corresponds to one of the task behavior trees;
[0056] The step S2 specifically includes the following steps:
[0057] S21. When starting the task system, load the total behavior tree;
[0058] S22. When a preset condition triggered by the client is obtained, traverse each selection node of the total behavior tree according to the event type corresponding to the preset condition, and select the corresponding task behavior tree.
[0059] As can be seen from the above description, by merging each task behavior tree into a total task behavior tree, through the interface for exposing event data externally, such as event type, event data, etc., all task data is driven and updated by one behavior tree, further simplifying the task data update process and improving the efficiency of task update.
[0060] Further, the following steps are further included:
[0061] S4. When the task system modifies or adds the preset condition, the task behavior tree adjusts the configurations of all the task nodes related to the modified or added preset condition.
[0062] As can be seen from the above description, the task behavior tree visualizes the business logic, and staff can directly modify or add task nodes to achieve the editing and modification of the relevant configurations of the task system, reducing the system maintenance cost and improving the development efficiency.
[0063] Please refer to Figure 2 , a task system data update system based on a behavior tree, including a behavior tree editing subsystem and a business driving subsystem. The behavior tree editing subsystem includes a first memory, a first processor, and a first computer program stored on the first memory and executable on the first processor. The business driving subsystem includes a second memory, a second processor, and a second computer program stored on the second memory and executable on the second processor;
[0064] When the first processor executes the first computer program, the following steps are implemented:
[0065] S1. Establish multiple task behavior trees according to the event types of task events. Each of the task behavior trees contains multiple task nodes with preset association relationships, and each task node includes a task event and a task progress related to the event type;
[0066] When the second processor executes the second computer program, the following steps are implemented:
[0067] S2. When starting the task system, load all the task behavior trees. When a preset condition triggered by the client is obtained, select the corresponding task behavior tree according to the event type corresponding to the triggered preset condition;
[0068] S3. The task behavior tree finds the corresponding task node according to the preset condition, and updates all the task progress under the corresponding task node according to the triggered preset condition.
[0069] As can be seen from the above description, the beneficial effect of the present invention is that: based on the same technical concept, in cooperation with the above-mentioned method for updating task system data based on a behavior tree, a task system data updating system based on a behavior tree is provided. By establishing multiple task behavior trees, task events of the same event type are integrated into the same task behavior tree, and the task events and their task progress are placed in each task node under the task behavior tree. When the client triggers a preset condition, the corresponding task behavior tree of the corresponding type can be quickly found according to the type of the preset condition, and the task progress under all task nodes corresponding to the preset condition is triggered to be updated by the task behavior tree, effectively improving the efficiency of task progress update and reducing the labor of developers.
[0070] Further, each task node in step S1 including a task event and a task progress related to the event type further includes:
[0071] Each task node further includes a precondition and a completion condition corresponding to the task event;
[0072] The precondition is used to judge whether the task event has been received;
[0073] The completion condition is used to judge whether the counting task event is completed;
[0074] Step S3 is specifically the following steps:
[0075] S31. The task behavior tree finds all the corresponding task nodes according to the preset conditions, and determines whether the preconditions under the task nodes are true. If so, it receives the task events under the task nodes and updates the status of the task progress to "task received", and executes step S32. Otherwise, it updates the status of the task progress to "task not received".
[0076] S32. Determine whether the completion condition is true according to the triggered preset condition. If so, move the task event to the completed task list and update the status of the task progress to "task completed". Otherwise, update the status of the task progress to "task not completed".
[0077] As can be seen from the above description, by judging the preconditions and completion conditions of tasks through the logic of the behavior tree, that is, according to the type of tasks, the relevant preconditions and completion conditions are independently configured for each task in the form of a behavior tree, and the task data update process is designed. When the completion condition or precondition is triggered, the complex judgment is handed over to the behavior tree logic to implement, so as to drive the update of the task progress, simplify the development process, and improve the development efficiency of the task system.
[0078] Further, the task nodes include composite nodes, decorator nodes, condition nodes and action nodes.
[0079] The composite nodes include sequence nodes, selector nodes, parallel nodes, behavior sub-trees and wait signals.
[0080] The type of the task nodes is determined by the preset association relationships among multiple task nodes.
[0081] As can be seen from the above description, during the development of the game task system, the behavior tree method is used to configure each node of the task system. Developers only need to complete the access of the basic process, and then the planners can freely configure the relevant types of task nodes for each task according to the preset association relationships and conduct idea verification, and participate in the development of the system, which simplifies the development process, greatly improves the efficiency, and is not prone to program logic problems.
[0082] Further, there is also a step between steps S1 and S2:
[0083] S11. Merge all the task behavior trees into a total behavior tree, and the total behavior tree contains multiple selector nodes, and each selector node corresponds to a task behavior tree.
[0084] Step S2 specifically includes the following steps:
[0085] S21. When starting the task system, load the total behavior tree.
[0086] S22. When a preset condition is triggered by the client, traverse each selection node of the total behavior tree according to the event type corresponding to the preset condition, and select the corresponding task behavior tree.
[0087] As can be seen from the above description, by merging each task behavior tree into a total task behavior tree and exposing an interface for event data externally, such as event type, event data, etc., all task data is driven and updated by one behavior tree, which further simplifies the task data update process and improves the efficiency of task update.
[0088] Furthermore, when the first processor executes the first computer program, the following steps are also implemented:
[0089] S4. When the task system modifies or adds the preset condition, adjust the configurations of all task nodes in the task behavior tree that are related to the modified or added preset condition.
[0090] As can be seen from the above description, the task behavior tree visualizes the business logic, and the staff can directly modify or add task nodes to achieve the editing and modification of the relevant configurations of the task system, reducing the system maintenance cost and improving the development efficiency.
[0091] Please refer to Figure 1 , Embodiment 1 of the present invention is:
[0092] A method for updating task system data based on a behavior tree, including the steps of:
[0093] S1. Establish multiple task behavior trees according to the event types of task events. Each task behavior tree contains multiple task nodes with preset association relationships, and each task node includes a task event and a task progress related to the event type;
[0094] S2. When the task system is started, load all task behavior trees. When a preset condition is triggered by the client, select the corresponding task behavior tree according to the event type corresponding to the triggered preset condition;
[0095] S3. The task behavior tree finds the corresponding task nodes according to the preset conditions and updates all task progress under the corresponding task nodes according to the triggered preset conditions.
[0096] The task progress update of the game is generally triggered by events, such as collecting / using items, etc. In this embodiment, a behavior tree is used to horizontally manage the task system. By establishing multiple task behavior trees, task events of the same event type are integrated into the same task behavior tree, and the task events and their task progress are placed in each task node under the task behavior tree. When the user triggers a preset event, the corresponding task behavior tree of the corresponding type can be quickly found according to the type of the preset condition, and the corresponding task node is triggered to update the task progress of the relevant task, effectively improving the efficiency of task progress update and reducing the labor of developers.
[0097] Among them, each task node in step S1 includes a task event related to the event type and a task progress, and also includes:
[0098] Each task node also includes a precondition and a completion condition corresponding to the task event;
[0099] The precondition is used to judge whether the task event has been received;
[0100] The completion condition is used to judge whether the counting task event is completed.
[0101] In this embodiment, the behavior tree not only provides a visual business logic editing function, that is, developers can expose the data interfaces required by the tasks in the graphical interface, which is convenient for planners to directly configure and edit relevant data, such as the configuration of completion conditions or preconditions; at the same time, the behavior tree also supports exporting configuration files to provide behavior data for the behavior tree module, that is, automatically exporting the configuration of tasks according to all behavior trees, including but not limited to task IDs, task preconditions, task descriptions, task rewards, task completion conditions, and task completion progress data, etc. Among them, the task description and character rewards are static data and can be managed independently (managed by external tables). The preconditions and completion conditions of the tasks are both dynamic data. Here, taking the precondition as an example, when a single task contains multiple preconditions, the data in the behavior tree and task node where the task is located can be exported through the behavior tree editor tool for display on the client interface.
[0102] After the configuration of the precondition and the completion condition is completed, in this embodiment, step S3 above is specifically the following steps:
[0103] S31. The task behavior tree finds all corresponding task nodes according to the preset conditions, judges whether the precondition under the task node is true. If so, receives the task event under the task node and updates the status of the task progress to the received task, and executes step S32. Otherwise, updates the status of the task progress to the un-received task;
[0104] S32. Determine whether the completion condition is true according to the triggered preset condition. If so, move the task event to the completed task list and update the status of the task progress to completed task; otherwise, update the status of the task progress to uncompleted task.
[0105] In this embodiment, the task data update process is designed according to the task type. Tasks of the same type and with the same business logic are under one behavior tree. According to the completion condition or the completion situation of the precondition, the complex judgment is handed over to the behavior tree logic to be implemented, so as to drive the update of the task progress, simplify the development process, and improve the development efficiency of the task system. For example, in the triggered type task event, according to the triggered type event, all tasks related to this event are configured in one task behavior tree. When the preset condition of this type of task is triggered, by judging the completion situation of the precondition and the completion condition, the progress and data of the relevant tasks are updated.
[0106] Among them, the task nodes include composite nodes, decorator nodes, condition nodes and action nodes. The composite nodes include sequence nodes, selector nodes, parallel nodes, behavior subtrees and wait signals.
[0107] In this embodiment, the type of the task node is determined by the preset association relationship between multiple task nodes.
[0108] That is, during the development process of the game task system, the behavior tree method is used to configure each node of the task system. Developers only need to complete the access of the basic process, then the planners can freely configure the relevant type of task nodes for each task according to the preset association relationship, and conduct idea verification and participate in the development of the system, which simplifies the development process, greatly improves the efficiency, and is not prone to logical problems in the program.
[0109] Among them, between steps S1 and S2, there is also a step:
[0110] S11. Merge all task behavior trees into a total behavior tree. The total behavior tree contains multiple selector nodes, and each selector node corresponds to a task behavior tree.
[0111] Among them, step S2 specifically includes the following steps:
[0112] S21. When starting the task system, load the total behavior tree;
[0113] S22. When obtaining that the client triggers a certain preset condition, traverse each selector node of the total behavior tree according to the event type corresponding to the preset condition, and select the corresponding task behavior tree.
[0114] To simplify the update process, the task behavior trees of various types can be merged into a total task behavior tree. By exposing an interface for event data externally, such as event types, event data, etc., all task data is updated by one behavior tree. For example, when obtaining an item, the sub-behavior tree triggered by this event type is determined through the total task behavior tree, and the progress of multiple related tasks is updated by the sub-behavior tree.
[0115] In this embodiment, the following steps are further included:
[0116] S4. When the task system modifies or adds preset conditions, the task behavior tree adjusts the configurations of all task nodes related to the modified or added preset conditions.
[0117] That is, in this embodiment, the task behavior tree visualizes the business logic. Staff can directly modify or add task nodes to edit and modify the relevant configurations of the task system. At the same time, they can also modify or add task preconditions and completion conditions to achieve dynamic updates of preconditions or completion conditions, reducing the maintenance cost of the system and improving development efficiency. For example, if the production probability of certain items is adjusted, the corresponding task data also needs to be updated synchronously. At this time, only the configuration of the task nodes corresponding to the behavior tree related to the item needs to be adjusted to complete the editing of all relevant task conditions and avoid missing modifications.
[0118] In addition, in this embodiment, since the behavior tree is loaded in a configuration manner, the data of the behavior tree supports hot loading, which is convenient for the upgrade of the task system and bug fixing, etc., greatly improving the robustness of the task system.
[0119] Please refer to Figure 2 , Embodiment 2 of the present invention is:
[0120] Based on the above Embodiment 1, this embodiment provides a task system data update system 1 based on a behavior tree, including a behavior tree editing subsystem 2 and a business driving subsystem 3. The behavior tree editing subsystem 2 includes a first memory 21, a first processor 22, and a first computer program stored on the first memory 21 and executable on the first processor 22. The business driving subsystem 3 includes a second memory 31, a second processor 32, and a second computer program stored on the second memory 31 and executable on the second processor 32.
[0121] Among them, when the first processor 22 executes the first computer program, it implements step S1 in the above Embodiment 1. When the second processor 32 executes the second computer program, it implements steps S2 and S3 in the above Embodiment 1.
[0122] In summary, the task system data update method and system based on behavior trees provided by the present invention establish multiple task behavior trees, integrate task events of the same event type into the same task behavior tree, and place the task events and their task progress in each task node under the task behavior tree. When the user triggers a preset event, the corresponding task behavior tree of the corresponding type can be quickly found according to the type of the preset condition, and the corresponding task node is triggered to update the task progress of the relevant task, effectively improving the efficiency of task progress update and reducing the labor of developers. Among them, in the development process of the game task system, by using the behavior tree method to configure each node of the task system, developers only need to complete the access of the basic process and visualize the business logic, then the planners can freely configure the task nodes, including the preconditions and completion conditions, and conduct idea verification, that is, hand over the complex judgment to the behavior tree logic implementation and participate in the system development, simplifying the development process, greatly improving the efficiency, and not easily having program logic problems and configuring the relevant preconditions and completion conditions; at the same time, the individual task behavior trees can also be merged into a total task behavior tree, and the update of all task data is driven by one behavior tree, further simplifying the update process and improving the update efficiency.
[0123] The above are only the embodiments of the present invention, and do not limit the patent scope of the present invention. Any equivalent transformation made by using the content of the specification and drawings of the present invention, or directly or indirectly applied in the related technical fields, shall be included in the patent protection scope of the present invention by the same token.
Claims
1. A method for updating data of a task system based on a behavior tree, characterized in that, Including the steps: S1. Establish multiple task behavior trees according to the event types of task events. Each of the task behavior trees contains multiple task nodes with preset association relationships, and each of the task nodes includes a task event and a task progress related to the event type; S2. When the task system is started, load all the task behavior trees. When a preset condition triggered by the client is obtained, select the corresponding task behavior tree according to the event type corresponding to the triggered preset condition; S3. The task behavior tree finds the corresponding task nodes according to the preset condition, and updates all the task progress under the corresponding task nodes according to the triggered preset condition; In step S1, each of the task nodes includes a task event and a task progress related to the event type, and further includes: Under each of the task nodes, there are also a precondition and a completion condition corresponding to the task event; The precondition is used to judge whether the task event has been received; The completion condition is used to judge whether the task event is completed; Step S3 is specifically the following steps: S31. The task behavior tree finds all the corresponding task nodes according to the preset condition, judges whether the precondition under the task node is true. If so, receive the task event under the task node and update the status of the task progress to "task received", and execute step S32. Otherwise, update the status of the task progress to "task not received"; S32. Judge whether the completion condition is true according to the triggered preset condition. If so, move the task event to the completed task list and update the status of the task progress to "task completed". Otherwise, update the status of the task progress to "task not completed".
2. The method for updating data of a task system based on a behavior tree according to claim 1, characterized in that, The task nodes include composite nodes, decorator nodes, condition nodes and action nodes; The composite nodes include sequence nodes, selector nodes, parallel nodes, behavior subtrees and wait signals; The type of the task node is determined by the preset association relationships among the multiple task nodes.
3. The method for updating data of a task system based on a behavior tree according to claim 1, characterized in that, Between step S1 and S2, there is also a step: S11. Merge all the task behavior trees into a total behavior tree. The total behavior tree contains multiple selector nodes, and each selector node corresponds to a task behavior tree; Step S2 specifically includes the following steps: S21. When the task system is started, load the total behavior tree; S22. When a preset condition triggered by the client is obtained, traverse each selector node of the total behavior tree according to the event type corresponding to the preset condition, and select the corresponding task behavior tree.
4. The method for updating data of a task system based on a behavior tree according to claim 1, characterized in that, It also includes the following steps: S4. When the task system modifies or adds the preset condition, the task behavior tree adjusts the configurations of all the task nodes related to the modified or added preset condition.
5. A system for updating data of a task system based on a behavior tree, characterized in that, It includes a behavior tree editing subsystem and a business-driven subsystem. The behavior tree editing subsystem includes a first memory, a first processor, and a first computer program stored on the first memory and executable on the first processor. The business-driven subsystem includes a second memory, a second processor, and a second computer program stored on the second memory and executable on the second processor; When the first processor executes the first computer program, the following steps are implemented: S1. Establish multiple task behavior trees according to the event types of task events. Each task behavior tree contains multiple task nodes with preset association relationships, and each task node includes a task event and a task progress related to the event type; When the second processor executes the second computer program, the following steps are implemented: S2. When starting the task system, load all the task behavior trees. When a preset condition triggered by the client is obtained, select the corresponding task behavior tree according to the event type corresponding to the triggered preset condition; S3. The task behavior tree finds the corresponding task nodes according to the preset condition, and updates all the task progress under the corresponding task nodes according to the triggered preset condition; In step S1, each task node including the task event and task progress related to the event type further includes: Each task node further includes a precondition and a completion condition corresponding to the task event; The precondition is used to judge whether the task event has been received; The completion condition is used to judge whether the task event is completed; Step S3 is specifically the following steps: S31. The task behavior tree finds all the corresponding task nodes according to the preset condition, judges whether the precondition under the task node is true. If so, receive the task event under the task node and update the status of the task progress to task received, and execute step S32. Otherwise, update the status of the task progress to task not received; S32. Judge whether the completion condition is true according to the triggered preset condition. If so, move the task event to the completed task list and update the status of the task progress to task completed. Otherwise, update the status of the task progress to task not completed.
6. A data update system for a behavior tree-based task system according to claim 5, characterized in that, The task nodes include composite nodes, decorator nodes, condition nodes, and action nodes; The composite nodes include sequence nodes, selector nodes, parallel nodes, behavior subtrees, and wait signals; The type of the task node is determined by the preset association relationships among multiple task nodes.
7. A data update system for a behavior tree-based task system according to claim 5, characterized in that, Between step S1 and S2, there is also a step: S11. Merge all the task behavior trees into a total behavior tree. The total behavior tree contains multiple selector nodes, and each selector node corresponds to a task behavior tree; Step S2 specifically includes the following steps: S21. When starting the task system, load the total behavior tree; S22. When a preset condition triggered by the client is obtained, traverse each of the selection nodes of the total behavior tree according to the event type corresponding to the preset condition, and select the corresponding task behavior tree.
8. A data update system for a behavior tree-based task system according to claim 5, characterized in that, When the first processor executes the first computer program, the following steps are further implemented: S4. When the task system modifies or adds the preset condition, adjust the configurations of all the task nodes in the task behavior tree that are related to the modified or added preset condition.
Citation Information
Patent Citations
Game task running method and device and electronic terminal
CN110941485A
Controlling event-driven behavior of wagering game objects
US20110021263A1