Interaction method, apparatus, medium, electronic device, and computer program product
By dynamically generating NPC response behavior sequences through behavior tree generation models, the problem of monotonous NPC interaction responses in existing technologies is solved, and a richer interactive experience and adaptability are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING ZITIAO NETWORK TECH CO LTD
- Filing Date
- 2025-01-13
- Publication Date
- 2026-05-26
Smart Images

Figure CN119733230B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and more specifically, to an interactive method, apparatus, medium, electronic device, and computer program product. Background Technology
[0002] In many game projects, the interactive responses of non-player characters (NPCs) typically rely on a large number of logical settings for the plot and behavior trees written by designers, so that the NPCs' responses can basically conform to the direction of the game's plot. In related technologies, a large number of complex rules usually need to be pre-set manually. However, because players have a large number of interactive actions and input language, it is impossible to pre-write them through massive enumeration, resulting in relatively simple and fixed NPC feedback. Summary of the Invention
[0003] This summary section is provided to briefly introduce the concepts, which will be described in detail in the detailed description section below. This summary section is not intended to identify key or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.
[0004] In a first aspect, this disclosure provides an interaction method, the method comprising:
[0005] A virtual scene interface is displayed, which contains at least one virtual character;
[0006] In response to receiving an interactive operation from the virtual scene interface, obtain the interactive information corresponding to the interactive operation;
[0007] Determine whether there is a behavior in the behavior tree of the target virtual character that responds to the interactive information, wherein the behavior tree of the target virtual character contains multiple behavior sequences of the target virtual character, and the target virtual character is at least one of the virtual characters in the virtual scene interface;
[0008] If there is no behavior in the behavior tree that responds to the interaction information, then a target behavior sequence is generated based on the interaction information and the behavior tree generation model.
[0009] The target virtual character is controlled to respond to the interactive information based on the target behavior sequence.
[0010] Secondly, this disclosure provides an interactive device, the device comprising:
[0011] The first display module is used to display a virtual scene interface, which contains at least one virtual character.
[0012] The first acquisition module is used to acquire the interaction information corresponding to the received interaction operation in the virtual scene interface.
[0013] The first determining module is used to determine whether there is a behavior in the behavior tree of the target virtual character that responds to the interactive information, wherein the behavior tree of the target virtual character contains multiple behavior sequences of the target virtual character, and the target virtual character is at least one of the virtual characters in the virtual scene interface;
[0014] The first generation module is used to generate a target behavior sequence based on the interaction information and the behavior tree generation model if there is no behavior in the behavior tree that responds to the interaction information.
[0015] The control module is used to control the target virtual character to respond to the interactive information based on the target behavior sequence.
[0016] Thirdly, this disclosure provides a computer-readable medium having a computer program stored thereon, which, when executed by a processing device, implements the steps of the method described in the first aspect.
[0017] Fourthly, this disclosure provides an electronic device, comprising:
[0018] A storage device on which computer programs are stored;
[0019] A processing device for executing the computer program in the storage device to implement the steps of the method described in the first aspect.
[0020] Fifthly, this disclosure provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the method described in the first aspect.
[0021] In the above technical solution, when determining the response of the target virtual character to interactive information, if there is no behavior in the behavior tree that responds to the interactive information, a target behavior sequence can be directly generated based on the interactive information and the behavior tree generation model to control the target virtual character to respond. Therefore, during the interaction of the target virtual character, a series of interactive scripts can be generated in real time and dynamically based on the behavior tree generation model, improving the diversity of the target virtual character's interactions. Furthermore, the method provided in this disclosure does not require pre-enumerating a massive number of behavior sequences in the behavior tree. For scenarios where no behavior sequence is configured in the behavior tree, the target virtual character can be controlled to provide reasonable feedback responses, making it suitable for diverse interaction scenarios of different players. This improves the applicability of the method and, while saving manual workload, enhances the anthropomorphism of the virtual character display in the virtual scene, improving the diversity and experience of user interactions.
[0022] Other features and advantages of this disclosure will be described in detail in the following detailed description section. Attached Figure Description
[0023] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale. In the drawings:
[0024] Figure 1 This is a flowchart of an interaction method provided according to one embodiment of the present disclosure.
[0025] Figure 2 This is a schematic diagram of a behavior tree provided according to one embodiment of the present disclosure.
[0026] Figure 3 This is a schematic diagram of a behavior tree provided according to one embodiment of the present disclosure.
[0027] Figure 4 This is a schematic diagram of a behavior tree provided according to one embodiment of the present disclosure.
[0028] Figure 5 This is a schematic diagram of a behavior tree provided according to one embodiment of the present disclosure.
[0029] Figure 6 This is a schematic diagram of the architecture of an interaction method provided according to one embodiment of the present disclosure.
[0030] Figure 7 This is a block diagram of an interactive device provided according to one embodiment of the present disclosure.
[0031] Figure 8 A schematic diagram of the structure of an electronic device suitable for implementing embodiments of the present disclosure is shown. Detailed Implementation
[0032] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0033] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.
[0034] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.
[0035] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.
[0036] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0037] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0038] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.
[0039] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware, such as the electronic device, application, server, or storage medium performing the operations of this disclosed technical solution, based on the prompt message.
[0040] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0041] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.
[0042] Meanwhile, it is understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and related provisions.
[0043] Figure 1 The diagram shown is a flowchart of an interaction method provided according to an embodiment of this disclosure. Figure 1 As shown, the method may include:
[0044] In step 11, a virtual scene interface is displayed, which contains at least one virtual character.
[0045] The virtual scene interface can be the environment in which a virtual character is rendered on a computer, such as a game scene interface. The virtual character can be a non-player character, i.e., an NPC, and can be controlled by a computer. One or more characters can be pre-configured in the virtual scene.
[0046] In step 12, in response to receiving an interactive operation from the virtual scene interface, the interactive information corresponding to the interactive operation is obtained.
[0047] The interaction can be initiated by the user or by other virtual characters in the virtual scene interface.
[0048] As an example, users can interact with target virtual characters in a virtual scene by controlling their corresponding player character's actions. For instance, when user U1 controls player character B1 to walk towards virtual character VA and the distance is less than a distance threshold, an interaction button can be displayed on virtual character VA. The user can then click this button to trigger an interaction with virtual character VA. If the user can input the text "Please recommend some delicious bread," this text can serve as the interaction information. Similarly, if a user controls their player character B1 to enter a bakery and pick up bread, this interaction is the user picking up bread. The corresponding interaction information can describe the bread picked up, such as the type and quantity of bread, and can be configured based on the actual application scenario.
[0049] As another example, in this interactive operation, the interaction is initiated by another virtual character in the virtual scene interface. The virtual character can then be controlled according to its corresponding behavior plan within the virtual scene interface. For instance, if virtual character VA is a bakery employee, then based on the behavior plan, VA can be controlled to perform actions such as inventorying bread in the bakery. When another virtual character VB enters the bakery, this action can be considered an interactive operation, and information about VB entering the bakery and its related information can be used as interactive information for the target virtual character VA to respond. For example, VA can output or display the text "Welcome" or a voice message.
[0050] This interaction can specify the interaction of a virtual character, such as directly selecting the virtual character VA in the example above. Alternatively, the interaction can occur without specifying a virtual character in the virtual scene. For instance, if a user enters the text "Who wants to sing a song?" in the virtual scene interface, the virtual character in the virtual scene interface can determine whether it needs to respond to the user's input.
[0051] In step 13, it is determined whether there is a behavior in the behavior tree of the target virtual character that responds to the interactive information. The behavior tree of the target virtual character contains multiple behavior sequences of the target virtual character, and the target virtual character can be at least one of the virtual characters in the virtual scene interface.
[0052] As an example, if a virtual character corresponding to the interaction is selected in the interaction operation, then the specified virtual character is the target virtual character. For example, in the example above, if the user interacts with the virtual character VA, then the virtual character VA can be determined as the target virtual character.
[0053] As another example, if no virtual character is selected for the interactive operation, the target virtual character can be determined by the object initiating the interaction. This object can be either a user or a virtual character. Taking a user as an example, virtual characters in the virtual scene interface whose distance to the user-controlled player character B1 is less than a distance threshold can be considered as candidate virtual characters. For each candidate virtual character, a Large Language Model (LLM) can be used to determine whether the candidate virtual character needs to respond to the interactive information based on the user's context during the interaction. For example, a first prompt can be constructed based on the user's context during the interaction, and the LLM can analyze whether the candidate virtual character needs to respond. If it is determined that the candidate virtual character needs to respond, then the candidate virtual character is selected as the target virtual character. For example, if the user enters the text "Who wants to sing a song?" in the virtual scene interface, the identified candidate virtual characters are H1, H2, and H3. Through analysis using the LLM, the target virtual characters are determined to be H1 and H2. For example, a second prompt can be constructed based on the user's context during the interaction and various candidate virtual characters, and then the second prompt can be input into a large language model so that the large language model can determine the target virtual character that needs to respond to the interaction information from the candidate virtual characters.
[0054] A behavior tree is used to describe the behavior and decision-making process of AI (Artificial Intelligence). It consists of multiple nodes, each representing a behavior or decision, connected in a specific way to form a tree structure. In a behavior tree, the root node is the starting point of the AI, and the AI's behavior is determined by traversing its child nodes. A behavior tree can typically contain various types of nodes to describe behaviors, such as sequence nodes, selection nodes, conditional nodes, behavior nodes, parallel nodes, and modifier nodes, etc., which can be configured based on the actual application scenario and are not limited in this respect.
[0055] Initially, a sequence of behaviors can be generated by pre-configuring multiple possible behaviors for the target virtual character based on task analysis. For example... Figure 2 The image shows the behavior tree of the initial configuration.
[0056] In this step, the obtained interaction information can be matched with the behavior tree to determine whether there is a behavior in the behavior tree that responds to the interaction information. If so, the target virtual character can be controlled based on the matched behavior in the behavior tree, so that the target virtual character can respond to the interaction information.
[0057] In step 14, if there are no behaviors in the behavior tree that respond to the interaction information, a target behavior sequence is generated based on the interaction information and the behavior tree generation model. This target behavior sequence can be a behavior subtree containing multiple nodes, and the behavior tree generation model can be implemented based on an LLM (Local Management Model). For example, an input prompt text can be constructed based on the interaction information, such as "Please use the nodes available in the project to generate a branch sequence based on the following interaction information, where the interaction information is XXXX." Thus, nodes and sequences can be generated based on the behavior tree generation model. The nodes of the behavior tree can be represented, for example, in JSON format.
[0058] If the behavior tree does not contain any behavior to respond to the interactive information, it means that the behavior tree has not yet configured the target virtual character's response to that interactive information. In other words, the behavior tree did not configure the corresponding interaction during initial configuration, making it difficult to determine how the target virtual character should respond to the interactive operation based on the behavior tree. For example, if a user can input the text "Please recommend some delicious bread," and the behavior tree does not pre-configure the target virtual character's response to this text, it is difficult to determine how the target virtual character should respond based on the behavior tree. In this embodiment, a target behavior sequence can be dynamically generated based on the interactive information to respond to the interactive information. Similarly, when a player brings an NPC to a new scene, if no behavior sequence has been configured for that scene, the NPC can perceive the current scene information in real time, such as props, furniture, buildings, and weather, thus automatically generating the target behavior sequence for that scene based on the behavior tree generation model.
[0059] In step 15, the target virtual character is controlled to respond to interactive information based on the target behavior sequence.
[0060] As an example, instructions corresponding to nodes in the target behavior sequence can be executed according to their types. This allows control over the actions or displays of the target virtual character. For instance, if the target behavior sequence contains behavior nodes A1 and A2, where behavior node A1 instructs the character to move near a croissant and behavior node A2 instructs the output text "I highly recommend croissants!", then the target virtual character's actions can be controlled based on this sequence. For example, the target virtual character VA can be controlled to move near a croissant and output the text "I highly recommend croissants!". The output text can also be displayed as a speech bubble at the corresponding dialogue location of the target virtual character, allowing the user to view and interact with the text. Alternatively, the output text can be output as speech. For example, based on the output text and speech synthesis technology, the corresponding speech can be generated and output, enabling voice interaction with the user. The specific output method can be set based on the actual application scenario, and this disclosure does not limit it.
[0061] The target behavior sequence is implemented based on the structure of a behavior tree. The method of controlling the target virtual character to respond to interactive information based on the target behavior sequence can be the same as the method of controlling the target virtual character based on behavior tree in this field, and will not be described in detail here.
[0062] Therefore, in the above technical solution, when determining the target virtual character's response to interactive information, if there is no behavior in the behavior tree that responds to the interactive information, a target behavior sequence can be directly generated based on the interactive information and the behavior tree generation model to control the target virtual character's response. Thus, during the interaction of the target virtual character, a series of interactive scripts can be generated in real-time and dynamically based on the behavior tree generation model, improving the diversity of the target virtual character's interactions. Furthermore, the method provided in this disclosure does not require pre-enumerating a massive number of behavior sequences in the behavior tree. For scenarios where no behavior sequence configuration is available in the behavior tree, the method can control the target virtual character to provide reasonable feedback responses, making it suitable for diverse interaction scenarios of different players. This improves the applicability of the method and, while saving manual workload, enhances the anthropomorphism of the virtual character's display in the virtual scene, improving the diversity and experience of user interactions.
[0063] In some embodiments, the behavior sequence includes judgment conditions, such as the conditions corresponding to judgment nodes in the behavior sequence. In a hostile NPC scenario, when the player is within the field of view, if the player is within the attack range, the player is attacked; if the player is not within the attack range, the player is chased. The condition nodes may include I1 (player within the field of view), I2 (player within the attack range), and I3 (player not within the attack range).
[0064] Accordingly, determining whether there is a behavior in the target virtual character's behavior tree that responds to the interaction information may include:
[0065] The interaction information is matched with the judgment conditions in multiple behavior sequences in the behavior tree.
[0066] As an example, one approach is to match interaction information with judgment conditions in the behavior sequence based on RAG (Retrieval-Augmented Generation) technology. The matching method can be based on common RAG techniques and is not limited here. Another example is to directly match interaction information with judgment conditions in the behavior sequence of the behavior tree by calculating similarity. For instance, feature vectors for interaction information and judgment conditions can be determined through text splitting and encoding. Then, similarity calculations can be performed based on these feature vectors to obtain the similarity between the interaction information and each judgment condition.
[0067] If a judgment condition is matched, the behavior corresponding to the matched judgment condition will be determined as the behavior to respond to the interactive information.
[0068] As an example, if a judgment condition has a similarity exceeding a preset threshold, the judgment condition with the highest similarity will be used as the matched judgment condition. For example, if the interaction information is that the player enters the attack range, judgment condition I2 can be matched, and the behavior corresponding to judgment condition I2, i.e., attacking the player, can be determined as a response to the interaction information, i.e., controlling the target virtual character to attack the player, thus realizing the interaction between the two.
[0069] If no matching condition is found, it is determined that there is no behavior in the behavior tree that responds to the interactive information.
[0070] As another example, if no similarity exceeds a preset threshold, it is determined that no matching condition was found. For instance, if the interaction information indicates that the player is not within the player's field of vision, and no matching condition was found in this scenario, it is assumed that there is no behavior in the behavior tree that responds to the interaction information; that is, the interaction from the target virtual character cannot be determined based on the behavior tree.
[0071] Therefore, by matching the interaction information with the judgment conditions in the behavior tree, it is possible to quickly and directly determine whether there is a behavior in the behavior tree that responds to the interaction information. This allows for rapid control of the target virtual character's behavior based on the existing behavior sequence in the behavior tree, thereby improving the response efficiency of the target virtual character.
[0072] In some embodiments, generating the target behavior sequence based on the interaction information and the behavior tree generation model may include:
[0073] Based on the interaction information and intent classification model, the interaction intent corresponding to the interaction information is determined.
[0074] The intent classification model can be implemented based on an LLM model. For example, a prompt text can be constructed using interactive information to determine the interaction intent. Based on this intent classification model, a sequence of interactive actions can be generated to provide data reference for subsequently determining the response behavior of the target virtual character. For example, if a user inputs the text "I'm not feeling well" into an NPC, this interactive information can be input into the intent classification model, and if it is determined that the interaction intent corresponding to this information is friendly. The optional classifications of the intent classification model can be pre-set based on the actual application scenario, and this disclosure does not limit this.
[0075] Subsequently, based on the interaction information, the interaction intent, and the behavior tree generation model, a target behavior sequence of the target virtual character is generated, wherein the target behavior sequence is a behavior subtree formed by combining multiple nodes.
[0076] As an example, a prompt text can be constructed based on interaction information and interaction intent to be input into the behavior tree generation model, thereby obtaining node information generated by the behavior tree generation model and a behavior sequence composed of multiple nodes.
[0077] Therefore, the above technical solution can determine the interaction intent based on the interaction information. This interaction intent can then be analyzed in conjunction with the generated target behavior sequence, increasing the accuracy and diversity of the input data for the behavior tree generation model. At the same time, the interaction intent can clearly reflect the interactive emotions between the player and the target virtual character, enabling the target virtual character to generate a target behavior sequence that matches the player's interaction intent. This ensures the consistency of the interaction between the user and the target virtual character, further enhancing the user experience.
[0078] In some embodiments, the method may further include:
[0079] Obtain the object association information of the target virtual character, wherein the object association information includes the environmental information of the virtual environment in which the target virtual character is located and / or the state information of the target virtual character.
[0080] The environmental information can include object information of interactive objects within the virtual environment, such as information about other virtual characters, props within the virtual environment, or scene information, such as weather information. The target virtual character's status information can be its own attribute information, such as its mood, hunger level, and favorability. The updating and maintenance of the target virtual character's status information can be based on methods commonly used in this field. Accordingly, this step can be achieved through the data interface corresponding to the aforementioned object association information.
[0081] Accordingly, the generation of the target behavior sequence based on the interaction information and the behavior tree generation model may include:
[0082] Based on the interaction information, the object association information, and the behavior tree generation model, a target behavior sequence of the target virtual character is generated.
[0083] As an example, a prompt text can be constructed based on interaction information, interaction intent, and object association information to be input into the behavior tree generation model. This allows the model to obtain node information generated by the behavior tree generation model and a behavior sequence composed of multiple nodes. As a result, the generated target behavior sequence can include the feedback behavior of the target virtual character itself, as well as the interaction between the target virtual character and objects in the virtual environment (such as props and environment).
[0084] Therefore, through the above technical solution, information related to the target virtual character in the virtual scene can be further obtained, which can provide more comprehensive data support for the generation of the target virtual character's target behavior sequence. This can not only improve the accuracy of the determined target behavior sequence, but also improve the diversity of the target virtual character's interaction objects in the determined target behavior sequence to a certain extent. At the same time, it can ensure the matching degree between the target behavior sequence and the virtual environment, and improve the fit of controlling the target virtual character in the virtual environment.
[0085] In some embodiments, generating the target behavior sequence of the target virtual character based on the interaction information, the interaction intent, and the behavior tree generation model may include:
[0086] Based on the interaction information, the interaction intent, and the first model, the response intent of the target virtual character in response to the interaction information is obtained.
[0087] As an example, a prompt text can be constructed based on the interaction information and interaction intent, and input into a first model to obtain the response intent of the target virtual character in response to the interaction information, that is, the goal of the target virtual character's response. In the example above, if the user inputs the interaction information "I'm not feeling well," the first model can predict the response intent of the target virtual character. For example, if the response intent is determined to be "to guide the player to rest and provide support if necessary," then the final goal of the target virtual character's response can be determined.
[0088] Based on the interaction information, the response intent, the candidate interaction operation list of the target virtual character, and the second model, the target behavior sequence is obtained, wherein each behavior node of the target behavior sequence indicates an interaction operation that is any one of the candidate interaction operation lists, and the behavior tree generation model includes the first model and the second model.
[0089] Accordingly, in this step, the sequence of actions required for the target virtual character to complete the intent can be further derived based on the determined response intent. As an example, the second model can be implemented based on an LLM model. Multiple candidate interactive operations that the target virtual character can perform can be pre-configured based on actual application scenarios, such as movement, picking up, and dialogue, and can be stored through a candidate interactive operation list. In this step, a prompt text can be constructed based on the interaction information, the response intent, and the candidate interactive operation list of the target virtual character, and input into the second model so that the second model can analyze it and determine the target interactive operation from the candidate interactive operation list based on the response intent. As an example, the prompt text input to the second model can also contain object association information of the target virtual character, so the object corresponding to the target interactive operation can be determined based on the object association information. Furthermore, a behavior tree can be constructed based on the target interactive operation and its corresponding object to obtain the target behavior sequence.
[0090] Following the example above, based on Figure 2 In the behavior tree, A3 and A4 control the target virtual character to move towards the player and nod, thus responding to the user's text input. Afterwards, the player-controlled virtual character does not respond to the target virtual character's response. At this point, based on the player's interaction information regarding the target virtual character's response (i.e., the lack of response to the target virtual character's approach), a target behavior sequence is generated, such as... Figure 3 S1 is the determined target behavior sequence, such as Figure 3 As shown, the parameters of behavior node A5 are represented as follows:
[0091] {"type": "MoveNextTo", "target": "Tent", "distance": "Near"}
[0092] The parameters of behavior node A6 are represented as follows:
[0093] {“gestureHoldName”: “Drink”, “holdItemName”: “Beverage”}
[0094] Therefore, based on behavior node A5, the target virtual character can be controlled to move to the vicinity of the tent, and based on behavior node A6, the target virtual character can be controlled to drink a beverage, so as to achieve interaction.
[0095] Therefore, by generating the response intent of the target virtual character, the response result of the target virtual character can be predicted through the above technical solution. Then, the behavior sequence can be inferred by combining the response intent. On the one hand, the accuracy and effectiveness of the generated target behavior sequence can be guaranteed. On the other hand, the accuracy of the response when controlling the target virtual character based on the target behavior sequence can be guaranteed, thereby improving the user experience.
[0096] In some embodiments, the method further includes:
[0097] Based on the interaction information and the behavior tree, the insertion position of the target behavior sequence in the behavior tree is determined.
[0098] As an example, the interaction information and the nodes in the behavior tree can be fuzzily matched, and the node with the highest matching degree can be used as the parent node of the target behavior sequence, that is, as the insertion position.
[0099] As another example, the interaction intent corresponding to the interaction information can be determined based on the interaction information. The determination method has been detailed above and will not be repeated here. Furthermore, based on the interaction intent, combined with the environmental information of the target virtual character's environment and the nodes in the behavior tree, fuzzy matching can be performed, and the node with the highest matching degree can be used as the parent node of the target behavior sequence, that is, as the insertion position.
[0100] The target behavior sequence is inserted into the behavior tree based on the insertion position to obtain the updated behavior tree, and the updated behavior tree is sent to the server.
[0101] In this step, the target behavior sequence can be inserted into the behavior tree by using the node corresponding to the insertion position as the parent node. Figure 2 As shown, the insertion position of the determined target behavior sequence S1 is P, and the target behavior sequence can be inserted based on this insertion position. Figure 2 In the behavior tree shown, obtain Figure 3 The behavior tree shown.
[0102] Furthermore, after updating the behavior tree locally, the updated behavior tree can be sent to the server so that the server can update its behavior tree and synchronously update the behavior trees used by other clients. For example, each client can pull the latest behavior tree from the server at preset time intervals to update its local behavior tree. Alternatively, after updating the behavior tree, the server can send a synchronization message to the client to notify the client to update its behavior tree from the server, thus updating the behavior tree on the client.
[0103] Therefore, through the above technical solution, the target behavior sequence can be updated into the behavior tree, thereby enabling dynamic updates of the behavior sequence in the behavior tree. This allows the behavior sequence in the behavior tree to be dynamically updated based on historical interactions, increasing the diversity and comprehensiveness of the behavior sequence in the behavior tree. When the target virtual character encounters a type of interaction, the subsequent response behavior of the target virtual character can be quickly and accurately determined based on the automatically generated behavior sequence, improving the efficiency and accuracy of the target virtual character's feedback response and greatly enhancing the user experience.
[0104] In some embodiments, the method may further include:
[0105] In response to receiving a configuration operation for the behavior tree, the individual nodes in the behavior tree are displayed.
[0106] The configuration interface can be displayed to users with configuration permissions. For example, project developers can click the configuration button to trigger configuration operations on the behavior tree and display each node in the behavior tree so that they can view and modify each node in the behavior tree.
[0107] In response to the received update operation on the target node, the target node is updated to obtain the updated behavior tree, and the updated behavior tree is sent to the server.
[0108] As an example, nodes in the behavior tree can contain target behavior sequences generated based on the behavior tree generation model. Since this target behavior sequence is automatically generated, it may contain unreasonable behavior nodes. In this embodiment, developers can manually verify the nodes in the behavior tree. For example, if a developer selects node A6 to delete, the updated behavior tree will look like this. Figure 4 As shown. Similarly, the updated behavior tree can be sent to the server to update the behavior trees in other clients. The synchronization method has been detailed above and will not be repeated here.
[0109] Therefore, the above technical solution can support the update operation of nodes in the behavior tree, thereby improving the controllability of each node in the behavior tree, ensuring the controllability of the final NPC behavior, and guaranteeing the accuracy and rationality of the target virtual character interaction.
[0110] In some embodiments, the method may further include:
[0111] If there is a behavior node in the behavior tree that has been executed a preset number of times, a new behavior subtree is generated based on the target virtual character's historical interaction memory and the behavior subtree to which the behavior node belongs.
[0112] The system can record the execution count of each behavior node in the behavior tree. Each behavior node initially has 0 execution counts, and these counts are incremented by 1 with each subsequent execution, thus accumulating the execution counts of each behavior node. To further enhance the diversity of interactions, in this embodiment, if a behavior node in the behavior tree has reached a preset execution count, it indicates that the target virtual character has been controlled to respond too many times based on that behavior node, potentially leading to a repetitive user experience. In this case, a new behavior subtree can be generated for the behavior subtree to which that behavior node belongs, so as to update the response behavior of the target virtual character in the same scenario.
[0113] As an example, the historical interaction memory of a target virtual character can be used to determine the character's interaction style. To reduce storage space usage, historical interaction memory can be summarized using common LLM memory summarization methods to obtain structured memory. To ensure memory effectiveness, this disclosure allows for the deletion of structured memory based on a forgetting mechanism, further guaranteeing the usability of historical interaction memory.
[0114] When generating a new behavior subtree based on the target virtual character's historical interaction memory and the behavior subtree to which the behavior node belongs, relevant memories can be retrieved from structured memory using RAG based on the judgment conditions in the behavior subtree to which the behavior node belongs. Based on these relevant memories and judgment conditions, the fine-tuning model can be used to optimize the behavior subtree and obtain a new behavior subtree. This fine-tuning model can be implemented based on an LLM model. For example, the fine-tuning model can use DPO (Direct Preference Optimization) to enhance the understanding of the behavior tree on the basis of the behavior tree generation model to obtain the new behavior subtree. DPO then optimizes the model to make the new behavior subtree conform to human preferences.
[0115] Then, the behavior subtree to which the behavior node belongs is replaced with the new behavior subtree to obtain the updated behavior tree, and the updated behavior tree is sent to the server.
[0116] For example, if the behavior subtree to which the behavior node belongs is the behavior subtree to which sequence S1 belongs, and the newly determined behavior subtree is S2, then S2 can replace S1 in the behavior tree, such as... Figure 5 As shown, the updated behavior tree can be obtained. Similarly, the updated behavior tree can be sent to the server to update the behavior trees in other clients. The synchronization method has been detailed above and will not be repeated here.
[0117] Therefore, the above technical solution enables the optimization and regeneration of behavior nodes in the behavior tree, allowing for the dynamic generation of different behavior sequences at different times for the same scenario. This ensures that the behavior of the target virtual character is no longer fixed. For example, based on the newly generated behavior subtree, the target virtual character may change its attitude and behavior towards the player based on the player's actions and dialogue history, further enhancing the diversity of the target virtual character's interactions and improving the user experience.
[0118] like Figure 6 The diagram shown is an architecture diagram provided based on one embodiment of this disclosure. Figure 6 As shown, the interaction intent can be determined based on the interaction information and intent classification model 61, and a behavior subtree can be generated by combining the interaction intent, interaction information, and behavior tree generation model 62 to obtain a new behavior tree. Then, the behavior tree can be updated based on historical interaction memories, the behavior tree, and the fine-tuning model 63 to obtain an updated behavior tree. The specific implementation methods of the above steps have been described above and will not be repeated here.
[0119] Based on the same inventive concept, this disclosure also provides an interactive device, such as... Figure 7 As shown, the device 10 includes:
[0120] The first display module 100 is used to display a virtual scene interface, which contains at least one virtual character.
[0121] The first acquisition module 200 is used to acquire the interaction information corresponding to the interaction operation in response to receiving the interaction operation in the virtual scene interface.
[0122] The first determining module 300 is used to determine whether there is a behavior in the behavior tree of the target virtual character that responds to the interactive information, wherein the behavior tree of the target virtual character contains multiple behavior sequences of the target virtual character, and the target virtual character is at least one of the virtual characters in the virtual scene interface;
[0123] The first generation module 400 is used to generate a target behavior sequence based on the interaction information and the behavior tree generation model if there is no behavior in the behavior tree that responds to the interaction information.
[0124] The control module 500 is used to control the target virtual character to respond to the interactive information based on the target behavior sequence.
[0125] Optionally, the first generation module includes:
[0126] The first determining submodule is used to determine the interaction intent corresponding to the interaction information based on the interaction information and the intent classification model;
[0127] The first generation submodule is used to generate a target behavior sequence of the target virtual character based on the interaction information, the interaction intent, and the behavior tree generation model, wherein the target behavior sequence is a behavior subtree formed by combining multiple nodes.
[0128] Optionally, the device further includes:
[0129] The second acquisition module is used to acquire the object association information of the target virtual character, wherein the object association information includes the environmental information of the virtual environment in which the target virtual character is located and / or the state information of the target virtual character;
[0130] The first generation module includes:
[0131] The second generation submodule is used to generate the target behavior sequence of the target virtual character based on the interaction information, the object association information, and the behavior tree generation model.
[0132] Optionally, the first generation submodule includes:
[0133] The first processing submodule is used to obtain the response intent of the target virtual character in response to the interaction information based on the interaction information, the interaction intent, and the first model.
[0134] The second processing submodule is used to obtain the target behavior sequence based on the interaction information, the response intent, the candidate interaction operation list of the target virtual character, and the second model, wherein each behavior node of the target behavior sequence indicates an interaction operation that is any one of the candidate interaction operation list, and the behavior tree generation model includes the first model and the second model.
[0135] Optionally, the behavior sequence includes a judgment condition, and the first determining module includes:
[0136] The matching submodule is used to match the interaction information with the judgment conditions in multiple behavior sequences in the behavior tree;
[0137] The second determining submodule is used to determine the behavior corresponding to the matched judgment condition as the behavior to respond to the interactive information if a judgment condition is matched.
[0138] The third determining submodule is used to determine that there is no behavior in the behavior tree that responds to the interactive information if no judgment condition is matched.
[0139] Optionally, the device further includes:
[0140] The second determining module is used to determine the insertion position of the target behavior sequence in the behavior tree based on the interaction information and the behavior tree;
[0141] The first update module is used to insert the target behavior sequence into the behavior tree based on the insertion position, obtain the updated behavior tree, and send the updated behavior tree to the server.
[0142] Optionally, the device further includes:
[0143] The second display module is used to display each node in the behavior tree in response to receiving a configuration operation on the behavior tree;
[0144] The second update module is used to update the target node in response to the received update operation on the target node, obtain the updated behavior tree, and send the updated behavior tree to the server.
[0145] Optionally, the device further includes:
[0146] The second generation module is used to generate a new behavior subtree based on the historical interaction memory of the target virtual character and the behavior subtree to which the behavior node belongs if there is a behavior node in the behavior tree that has been executed a preset number of times.
[0147] The third update module is used to replace the behavior subtree to which the behavior node belongs with the new behavior subtree to obtain the updated behavior tree, and send the updated behavior tree to the server.
[0148] The following is for reference. Figure 8 The diagram illustrates a structural schematic of an electronic device (e.g., a terminal device) 600 suitable for implementing embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 8 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0149] like Figure 8As shown, electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processor, etc.) 601, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 602 or a program loaded from storage device 608 into random access memory (RAM) 603. RAM 603 also stores various programs and data required for the operation of electronic device 600. Processing device 601, ROM 602, and RAM 603 are interconnected via bus 604. Input / output (I / O) interface 605 is also connected to bus 604.
[0150] Typically, the following devices can be connected to I / O interface 605: input devices 606 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 607 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 608 including, for example, magnetic tapes, hard disks, etc.; and communication devices 609. Communication device 609 allows electronic device 600 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 8 An electronic device 600 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.
[0151] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 609, or installed from a storage device 608, or installed from a ROM 602. When the computer program is executed by the processing device 601, it performs the functions defined in the methods of embodiments of this disclosure.
[0152] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0153] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.
[0154] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.
[0155] The aforementioned computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to: display a virtual scene interface, the virtual scene interface containing at least one virtual character; in response to receiving an interactive operation in the virtual scene interface, acquire interactive information corresponding to the interactive operation; determine whether there is a behavior in the behavior tree of the target virtual character that responds to the interactive information, wherein the behavior tree of the target virtual character contains multiple behavior sequences of the target virtual character, and the target virtual character is at least one of the virtual characters in the virtual scene interface; if there is no behavior in the behavior tree that responds to the interactive information, generate a target behavior sequence based on the interactive information and a behavior tree generation model; and control the target virtual character to respond to the interactive information based on the target behavior sequence.
[0156] Computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof, including but not limited to object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0157] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0158] The modules described in the embodiments of this disclosure can be implemented in software or in hardware. The names of the modules are not necessarily limiting in certain circumstances; for example, the first display module can also be described as a "module for displaying a virtual scene interface".
[0159] The functions described above in this document can be performed at least in part by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SoCs), complex programmable logic devices (CPLDs), and so on.
[0160] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0161] According to one or more embodiments of this disclosure, Example 1 provides an interaction method, the method comprising:
[0162] A virtual scene interface is displayed, which contains at least one virtual character;
[0163] In response to receiving an interactive operation from the virtual scene interface, obtain the interactive information corresponding to the interactive operation;
[0164] Determine whether there is a behavior in the behavior tree of the target virtual character that responds to the interactive information, wherein the behavior tree of the target virtual character contains multiple behavior sequences of the target virtual character, and the target virtual character is at least one of the virtual characters in the virtual scene interface;
[0165] If there is no behavior in the behavior tree that responds to the interaction information, then a target behavior sequence is generated based on the interaction information and the behavior tree generation model.
[0166] The target virtual character is controlled to respond to the interactive information based on the target behavior sequence.
[0167] According to one or more embodiments of this disclosure, Example 2 provides the method of Example 1, wherein generating the target behavior sequence based on the interaction information and the behavior tree generation model includes:
[0168] Based on the interaction information and intent classification model, the interaction intent corresponding to the interaction information is determined;
[0169] Based on the interaction information, the interaction intent, and the behavior tree generation model, a target behavior sequence of the target virtual character is generated, wherein the target behavior sequence is a behavior subtree formed by combining multiple nodes.
[0170] According to one or more embodiments of this disclosure, Example 3 provides the method of Example 2, wherein the method further includes:
[0171] Obtain the object association information of the target virtual character, wherein the object association information includes environmental information of the virtual environment in which the target virtual character is located and / or the state information of the target virtual character;
[0172] The generation of the target behavior sequence based on the interaction information and the behavior tree generation model includes:
[0173] Based on the interaction information, the object association information, and the behavior tree generation model, a target behavior sequence of the target virtual character is generated.
[0174] According to one or more embodiments of this disclosure, Example 4 provides the method of Example 2, wherein generating the target behavior sequence of the target virtual character based on the interaction information, the interaction intent, and the behavior tree generation model includes:
[0175] Based on the interaction information, the interaction intent, and the first model, the response intent of the target virtual character in response to the interaction information is obtained;
[0176] Based on the interaction information, the response intent, the candidate interaction operation list of the target virtual character, and the second model, the target behavior sequence is obtained, wherein each behavior node of the target behavior sequence indicates an interaction operation that is any one of the candidate interaction operation lists, and the behavior tree generation model includes the first model and the second model.
[0177] According to one or more embodiments of this disclosure, Example 5 provides the method of Example 1, wherein the behavior sequence includes a judgment condition, and determining whether there is a behavior in the behavior tree of the target virtual character that responds to the interaction information includes:
[0178] The interaction information is matched with the judgment conditions in multiple behavior sequences in the behavior tree;
[0179] If a judgment condition is matched, the behavior corresponding to the matched judgment condition is determined as the behavior to respond to the interactive information;
[0180] If no matching condition is found, it is determined that there is no behavior in the behavior tree that responds to the interactive information.
[0181] According to one or more embodiments of this disclosure, Example 6 provides the method of Example 1, wherein the method further includes:
[0182] Based on the interaction information and the behavior tree, the insertion position of the target behavior sequence in the behavior tree is determined;
[0183] The target behavior sequence is inserted into the behavior tree based on the insertion position to obtain the updated behavior tree, and the updated behavior tree is sent to the server.
[0184] According to one or more embodiments of this disclosure, Example 7 provides the method of Example 1, wherein the method further includes:
[0185] In response to receiving a configuration operation for the behavior tree, display each node in the behavior tree;
[0186] In response to the received update operation on the target node, the target node is updated to obtain the updated behavior tree, and the updated behavior tree is sent to the server.
[0187] According to one or more embodiments of this disclosure, Example 8 provides the method of Example 1, wherein the method further includes:
[0188] If there is a behavior node in the behavior tree that has been executed a preset number of times, a new behavior subtree is generated based on the historical interaction memory of the target virtual character and the behavior subtree to which the behavior node belongs;
[0189] Replace the behavior subtree to which the behavior node belongs with the new behavior subtree to obtain the updated behavior tree, and send the updated behavior tree to the server.
[0190] According to one or more embodiments of this disclosure, Example 9 provides an interactive device, the device comprising:
[0191] The first display module is used to display a virtual scene interface, which contains at least one virtual character.
[0192] The first acquisition module is used to acquire the interaction information corresponding to the received interaction operation in the virtual scene interface.
[0193] The first determining module is used to determine whether there is a behavior in the behavior tree of the target virtual character that responds to the interactive information, wherein the behavior tree of the target virtual character contains multiple behavior sequences of the target virtual character, and the target virtual character is at least one of the virtual characters in the virtual scene interface;
[0194] The first generation module is used to generate a target behavior sequence based on the interaction information and the behavior tree generation model if there is no behavior in the behavior tree that responds to the interaction information.
[0195] The control module is used to control the target virtual character to respond to the interactive information based on the target behavior sequence.
[0196] According to one or more embodiments of the present disclosure, Example 10 provides a computer-readable medium having a computer program stored thereon that, when executed by a processing device, implements the steps of the method described in any one of Examples 1-8.
[0197] According to one or more embodiments of this disclosure, Example 11 provides an electronic device, including:
[0198] A storage device on which computer programs are stored;
[0199] A processing device for executing the computer program in the storage device to implement the steps of any one of the methods in Examples 1-8.
[0200] According to one or more embodiments of the present disclosure, Example 12 provides a computer program product including a computer program that, when executed by a processor, implements the steps of the method described in any one of Examples 1-8.
[0201] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
[0202] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.
[0203] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative forms of implementing the claims. Regarding the apparatus in the above embodiments, the specific manner in which the various modules perform their operations has been described in detail in the embodiments relating to the method, and will not be elaborated upon here.
Claims
1. An interaction method, characterized in that, The method includes: A virtual scene interface is displayed, which contains at least one virtual character; In response to receiving an interactive operation from the virtual scene interface, obtain the interactive information corresponding to the interactive operation; Determine whether there is a behavior in the behavior tree of the target virtual character that responds to the interactive information, wherein the behavior tree of the target virtual character contains multiple behavior sequences of the target virtual character, and the target virtual character is at least one of the virtual characters in the virtual scene interface; If there is no behavior in the behavior tree that responds to the interaction information, a target behavior sequence is generated based on the interaction information and the behavior tree generation model. The behavior tree generation model includes a first model and a second model. The first model is used to predict the response intention of the target virtual character. Based on the interaction information, the response intention, the candidate interaction operation list of the target virtual character, and the second model, the target behavior sequence is obtained. Each behavior node in the target behavior sequence indicates an interaction operation that is any one of the candidate interaction operation lists. The target virtual character is controlled to respond to the interactive information based on the target behavior sequence.
2. The method according to claim 1, characterized in that, The generation of the target behavior sequence based on the interaction information and the behavior tree generation model includes: Based on the interaction information and intent classification model, the interaction intent corresponding to the interaction information is determined; Based on the interaction information, the interaction intent, and the behavior tree generation model, a target behavior sequence of the target virtual character is generated, wherein the target behavior sequence is a behavior subtree formed by combining multiple nodes.
3. The method according to claim 2, characterized in that, The method further includes: Obtain the object association information of the target virtual character, wherein the object association information includes the environmental information of the virtual environment in which the target virtual character is located and / or the state information of the target virtual character; The generation of the target behavior sequence based on the interaction information and the behavior tree generation model includes: Based on the interaction information, the object association information, and the behavior tree generation model, a target behavior sequence of the target virtual character is generated.
4. The method according to claim 2, characterized in that, The response intent is obtained based on the interaction information, the interaction intent, and the first model.
5. The method according to claim 1, characterized in that, The behavior sequence includes judgment conditions, and determining whether there is a behavior in the target virtual character's behavior tree that responds to the interaction information includes: The interaction information is matched with the judgment conditions in multiple behavior sequences in the behavior tree; If a judgment condition is matched, the behavior corresponding to the matched judgment condition is determined as the behavior to respond to the interactive information; If no matching condition is found, it is determined that there is no behavior in the behavior tree that responds to the interactive information.
6. The method according to claim 1, characterized in that, The method further includes: Based on the interaction information and the behavior tree, the insertion position of the target behavior sequence in the behavior tree is determined; The target behavior sequence is inserted into the behavior tree based on the insertion position to obtain the updated behavior tree, and the updated behavior tree is sent to the server.
7. The method according to claim 1, characterized in that, The method further includes: In response to receiving a configuration operation for the behavior tree, display each node in the behavior tree; In response to the received update operation on the target node, the target node is updated to obtain the updated behavior tree, and the updated behavior tree is sent to the server.
8. The method according to claim 1, characterized in that, The method further includes: If there is a behavior node in the behavior tree that has been executed a preset number of times, a new behavior subtree is generated based on the historical interaction memory of the target virtual character and the behavior subtree to which the behavior node belongs; Replace the behavior subtree to which the behavior node belongs with the new behavior subtree to obtain the updated behavior tree, and send the updated behavior tree to the server.
9. An interactive device, characterized in that, The device includes: The first display module is used to display a virtual scene interface, which contains at least one virtual character. The first acquisition module is used to acquire the interaction information corresponding to the received interaction operation in the virtual scene interface. The first determining module is used to determine whether there is a behavior in the behavior tree of the target virtual character that responds to the interactive information, wherein the behavior tree of the target virtual character contains multiple behavior sequences of the target virtual character, and the target virtual character is at least one of the virtual characters in the virtual scene interface; A first generation module is configured to generate a target behavior sequence based on the interaction information and a behavior tree generation model if there is no behavior in the behavior tree that responds to the interaction information. The behavior tree generation model includes a first model and a second model. The first model is used to predict the response intention of the target virtual character. Based on the interaction information, the response intention, a candidate interaction operation list of the target virtual character, and the second model, the target behavior sequence is obtained. Each behavior node in the target behavior sequence indicates an interaction operation that is any one of the candidate interaction operation lists. The control module is used to control the target virtual character to respond to the interactive information based on the target behavior sequence.
10. A computer-readable medium having a computer program stored thereon, characterized in that, When executed by a processing device, the computer program performs the steps of the method according to any one of claims 1-8.
11. An electronic device, characterized in that, include: A storage device on which computer programs are stored; A processing device for executing the computer program in the storage device to implement the steps of the method according to any one of claims 1-8.
12. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1-8.