Search

CN-121998042-A - Behavior tree generation method, behavior tree generation device, electronic device, storage medium and program product

CN121998042ACN 121998042 ACN121998042 ACN 121998042ACN-121998042-A

Abstract

The application discloses a behavior tree generation method, a device, electronic equipment, a storage medium and a program product, and relates to the technical field of computers, wherein the method comprises the steps of obtaining an initial prompt word corresponding to a virtual object and a target game environment where the virtual object is located; the method comprises the steps of inputting initial prompt words into a pre-trained decision model to generate a first behavior tree corresponding to a virtual object, deploying the first behavior tree into a target game environment to obtain game data, inputting the game data into a pre-trained cognitive model to generate data description information corresponding to the game data, and optimizing the first behavior tree based on the data description information to obtain a target behavior tree of the virtual object in the target game environment. By implementing the technical scheme of the application, the automatic generation and optimization of the game virtual object behavior tree can be realized based on the closed loop iteration of the cooperation of the decision model and the cognitive model, and the intelligent level and the generation efficiency of the game virtual object are improved.

Inventors

  • CHEN JIARUI
  • HU YUJING
  • Lv Tangjie
  • FAN CHANGJIE
  • HU ZHIPENG

Assignees

  • 网易(杭州)网络有限公司

Dates

Publication Date
20260508
Application Date
20260116

Claims (12)

  1. 1. A method of behavioral tree generation, the method comprising: acquiring an initial prompt word corresponding to a virtual object and a target game environment in which the virtual object is located; inputting the initial prompt word into a pre-trained decision model to generate a first behavior tree corresponding to the virtual object; Deploying the first behavior tree to the target game environment to obtain game play data; Inputting the game data into a pre-trained cognitive model, and generating data description information corresponding to the game data; And optimizing the first behavior tree based on the data description information to obtain a target behavior tree of the virtual object in the target game environment.
  2. 2. The method of claim 1, wherein the inputting the initial prompt word into a pre-trained decision model generates a first behavior tree corresponding to the virtual object, comprising: acquiring an initial knowledge base corresponding to the virtual object; And guiding the generation process of the decision model aiming at the behavior tree by utilizing the initial prompt word based on the strategy knowledge information in the initial knowledge base to obtain the first behavior tree.
  3. 3. The method according to claim 2, wherein the guiding the generating process of the decision model for the behavior tree by using the initial prompt word based on the policy knowledge information in the initial knowledge base to obtain the first behavior tree includes: based on strategy knowledge information in the initial knowledge base, guiding the decision model to generate a second behavior tree aiming at the generation process of the behavior tree by using the initial prompt word; Performing format conversion on the second behavior tree based on a preset analysis mode to obtain a conversion result; And if the conversion result represents that the second behavior tree is successfully converted, obtaining the first behavior tree after the second behavior tree is converted.
  4. 4. A method according to claim 3, characterized in that the method further comprises: if the conversion result represents that the second behavior tree fails to be converted, generating error prompt information; And modifying the second behavior tree based on the error prompt information to obtain the modified second behavior tree.
  5. 5. The method according to claim 1, wherein the method further comprises: and analyzing the data description information based on the cognitive model, and generating the game experience information corresponding to the data description information.
  6. 6. The method of claim 5, wherein optimizing the first behavior tree based on the data description information to obtain a target behavior tree of the virtual object in the target game environment comprises: acquiring a current optimization round aiming at the first behavior tree; if the current optimization round is the first round of optimization aiming at the first behavior tree, establishing an initial experience pool corresponding to the virtual object based on the game experience information; And optimizing the first behavior tree based on the initial experience pool and the game data description to obtain a target behavior tree of the virtual object in the target game environment.
  7. 7. The method of claim 6, wherein the method further comprises: If the current optimization round is non-first round optimization aiming at the first behavior tree, a first experience pool corresponding to the last optimization round is obtained; Writing the game experience information into the first experience pool to obtain a target experience pool; and optimizing the first behavior tree based on the target experience pool and the game data description to obtain a target behavior tree of the virtual object in the target game environment.
  8. 8. The method of claim 6, wherein optimizing the first behavioral tree based on the initial experience pool and the game data description results in a target behavioral tree for the virtual object in the target game environment, comprising: Generating an update instruction for an initial knowledge base based on the decision model for the response results of the game data description and the initial experience pool; Updating the initial knowledge base by using the updating instruction to obtain a target knowledge base; And optimizing the first behavior tree based on the target knowledge base, the initial experience pool and the game data description to obtain a target behavior tree of the virtual object in the target game environment.
  9. 9. An action tree generation apparatus, the apparatus comprising: The acquisition module is used for acquiring an initial prompt word corresponding to the virtual object and a target game environment in which the virtual object is located; the first generation module is used for inputting the initial prompt word into a pre-trained decision model and generating a first behavior tree corresponding to the virtual object; the deployment module is used for deploying the first action tree to the target game environment to obtain game play data; The second generation module is used for inputting the game play data into a pre-trained cognitive model and generating data description information corresponding to the game play data; and the optimizing module is used for optimizing the first behavior tree based on the data description information to obtain a target behavior tree of the virtual object in the target game environment.
  10. 10. An electronic device, comprising: A memory and a processor, the memory and the processor being communicatively connected to each other, the memory having stored therein computer instructions, the processor executing the computer instructions to perform the behavioral tree generation method of any one of claims 1 to 8.
  11. 11. A computer-readable storage medium having stored thereon computer instructions for causing a computer to perform the behavior tree generation method of any one of claims 1 to 8.
  12. 12. A computer program product comprising computer instructions for causing a computer to perform the behavioural tree generation method as claimed in any one of claims 1 to 8.

Description

Behavior tree generation method, behavior tree generation device, electronic device, storage medium and program product Technical Field The present application relates to the field of computer technologies, and in particular, to a behavior tree generation method, apparatus, electronic device, storage medium, and program product. Background In the fields of game development and artificial intelligence application, the decision-making capability which is efficient, anthropomorphic and adaptive to dynamic environments is provided for virtual objects (such as non-player characters, competitive robots and the like), and is always a key for improving game experience and interactive realism. Conventionally, in order to realize the intelligent behavior, two types of technical paths mainly exist, namely, a deep learning-based method is adopted, a complex high-dimensional state space is handled through training a neural network model, but the complex high-dimensional state space is usually faced with challenges such as difficult training data collection, complicated parameter tuning, long training period and the like, and a behavior tree model based on manual design is clear in structure, easy to understand and modify, can organize simple behaviors in a modularized mode, is difficult to flexibly adapt to a behavior tree which is simply constructed manually when handling a game environment with high complexity and dynamic change, and is designed to handle complex scenes, and too high requirements are put on manual design and maintenance. Disclosure of Invention The application provides a behavior tree generation method, a behavior tree generation device, electronic equipment, a storage medium and a program product, which are used for solving the problem that the construction efficiency and adaptability of an intelligent game decision model are difficult to balance. The application provides a behavior tree generation method, which comprises the steps of obtaining initial prompt words corresponding to a virtual object and a target game environment where the virtual object is located, inputting the initial prompt words into a pre-trained decision model to generate a first behavior tree corresponding to the virtual object, deploying the first behavior tree into the target game environment to obtain game play data, inputting the game play data into a pre-trained cognitive model to generate data description information corresponding to the game play data, and optimizing the first behavior tree based on the data description information to obtain the target behavior tree of the virtual object in the target game environment. In an alternative implementation mode, the method includes inputting initial prompt words into a pre-trained decision model to generate a first behavior tree corresponding to a virtual object, and based on strategy knowledge information in the initial knowledge base, guiding the decision model to a generation process of the behavior tree by the initial prompt words to obtain the first behavior tree. In an alternative embodiment, based on strategy knowledge information in an initial knowledge base, a decision model is guided by using an initial prompt word to aim at a generation process of a behavior tree to obtain a first behavior tree, wherein the method comprises the steps of generating a second behavior tree by using the initial prompt word to guide the decision model to aim at the generation process of the behavior tree based on the strategy knowledge information in the initial knowledge base, carrying out format conversion on the second behavior tree based on a preset analysis mode to obtain a conversion result, and if the conversion result represents that the second behavior tree is successfully converted, obtaining a first behavior tree after the second behavior tree is converted. In an alternative implementation, if the conversion result represents that the conversion of the second behavior tree fails, error prompt information is generated, and the second behavior tree is modified based on the error prompt information to obtain a modified second behavior tree. In an alternative embodiment, the data description information is analyzed based on the cognitive model, and the office experience information corresponding to the data description information is generated. In an alternative embodiment, the first behavior tree is optimized based on the data description information to obtain a target behavior tree of the virtual object in the target game environment, and the method comprises the steps of obtaining a current optimization round aiming at the first behavior tree, if the current optimization round is the first round of optimization aiming at the first behavior tree, establishing an initial experience pool corresponding to the virtual object based on the game experience information, and optimizing the first behavior tree based on the initial experience pool and the game data description to obtain t