CN-122020409-A - Meta universe player behavior offline hosting method and system
Abstract
The application provides a meta-universe player behavior offline hosting method and system, which relate to the technical field of computers, and the method comprises the steps of obtaining online data of a real player in a predefined behavior tree, wherein the online data comprise environment variables, external conditions, decision behaviors and unique IDs stored in decision nodes, taking the environment variables and the external conditions as characteristic data sets, taking the decision behaviors as label data sets, generating sample data sets, wherein each sample data corresponds to one unique ID, inputting the sample data sets into a decision tree model, calculating information entropy or information entropy gain of each characteristic in the characteristic data sets by a training method module based on a recursive splitting algorithm, determining splitting characteristics according to the information entropy or the information entropy gain, generating splitting conditions correspondingly, recursively dividing the sample data sets into subsets according to the splitting conditions, and storing node data generated in the splitting process into tree structure modules until splitting stop conditions are met, so as to construct a player decision behavior model.
Inventors
- YAO JUNFENG
- LIAO ZHIYONG
- WANG LE
- GUO SHIHUI
- LIN HAO
- ZHANG XIAOLEI
- He Jiean
- Lv Jianyang
Assignees
- 厦门大学
- 咪咕新空文化科技(厦门)有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20260415
Claims (10)
- 1. A meta-universe player behavior offline hosting method, characterized in that a predefined behavior tree comprises a state machine, decision nodes and operation nodes, the method comprising: acquiring online data of a real player in a predefined behavior tree, the online data of the real player comprising The decision node stores environment variables, external conditions, decision behaviors and unique IDs; taking the environment variable and the external condition as characteristic data sets, and taking decision behaviors as tag data sets, generating sample data sets, wherein each sample data corresponds to a unique ID; Inputting a sample data set into a decision tree model, wherein the decision tree model comprises a training method module and a tree structure module, the training method module calculates information entropy or information entropy gain of each feature in the feature data set based on a recursive splitting algorithm, determines splitting features according to the information entropy or the information entropy gain and correspondingly generates splitting conditions, recursively divides the sample data set into subsets according to the splitting conditions until splitting stop conditions are met, stores node data generated in the splitting process in the tree structure module, and constructs and obtains a player decision behavior model; in the model prediction stage, the state machine responds to real player offline information of the meta universe and sends notification to the decision node; After receiving the notification, the decision node acquires the current environment variable and the external condition through the injected data collection interface instance and sends the current environment variable and the external condition to a player decision behavior model, and the player decision behavior model outputs the predicted behavior and returns the predicted behavior to the decision node of the behavior tree; The decision node selects an operation node corresponding to the predicted behavior according to a preset behavior-operation node mapping table; Responsive to selection of the decision node, the operational node controls the virtual character in the meta-universe to perform the action to complete offline hosting of the live player action.
- 2. The method of claim 1, wherein the definition of the predefined behavioral tree comprises a definition of a training data collection phase comprising: Defining a state machine, switching the state of a player of a control person and sending a notice of the switched state to a decision node; Defining decision node, receiving notification, obtaining environment variable, external condition and instruction operation issued by real player by means of injected data collection interface example and Calling an external condition callback function, carrying out logic judgment on data acquired by a data collection interface instance according to a service rule carried by the external condition callback function, judging whether the acquired data meets the condition for triggering execution of a specified behavior, and Synchronously collecting and storing the acquired data by training a data collection object, and generating and storing decision behaviors and unique IDs according to the logic judgment, and When the condition for triggering execution of the specified behavior is met, selecting an operation node according to a preset behavior-operation node mapping table and sending a unique ID to the operation node; Defining an operation node, responding to the selection of the decision node, controlling the virtual roles in the metauniverse to execute the behaviors, and establishing and storing an association record between the behaviors and the unique ID.
- 3. A method according to claim 2, characterized in that the decision behavior, the environment variables, the external conditions and the unique ID are stored in a locally temporary Json file to be called from the Json file in preparation for training of the decision tree model.
- 4. The method of claim 1, wherein the defining of the decision tree model comprises: Defining a decision tree model class structure of a decision tree model, wherein the decision tree model class structure comprises a tree structure module, a feature list module, a training method module and a prediction method module; The prediction method module is used for acquiring current environment variables and external conditions of the metauniverse and calling a tree traversal algorithm to calculate and obtain a prediction behavior in a model prediction stage.
- 5. The method according to claim 1, wherein said calculating information entropy or information entropy gain of each feature in the feature data set based on the recursive splitting algorithm, determining splitting features based on the information entropy or information entropy gain and corresponding generating splitting conditions, recursively dividing the sample data set into subsets based on the splitting conditions until a splitting stop condition is satisfied, comprises: a. extracting the feature value of each feature in the feature data set, calculating the information entropy of each feature in the current node based on the feature value, or extracting the tag value of the tag class in the tag data set under the condition of the feature of the given feature data set, and calculating the information entropy gain of each feature in the current node based on the tag value; b. determining splitting characteristics of the current node based on information entropy or information entropy gain of each characteristic, and generating splitting conditions according to the splitting characteristics; c. dividing the sample data set into two subsets according to the splitting condition, repeatedly executing the steps a to c until the splitting stop condition is met, generating leaf nodes, and completing the recursion construction of the branch direction which meets or does not meet the splitting condition.
- 6. The method of claim 5, wherein storing the node data generated during the splitting process in a tree structure module to construct a player decision behavior model comprises: And storing the information entropy or the information entropy gain of the characteristics, the splitting conditions and the branching directions in the corresponding nodes of the tree structure module in the splitting process, and constructing to obtain the player decision behavior model.
- 7. The method of claim 5, wherein determining the split characteristic of the current node based on the entropy of each characteristic or the entropy gain comprises: determining the feature with the lowest information entropy or the highest information entropy gain as the split feature of the current node or Each feature is used as a virtual splitting feature to execute virtual splitting, and left and right child nodes are generated; respectively calculating information entropy gains of all possible splitting modes of the left child node and the right child node, and respectively determining the information entropy gain with the maximum value as left potential benefit and right potential benefit; and inputting the left potential benefit, the right potential benefit and the information entropy gain into a preset global evaluation function to obtain a global score of each feature, and determining the feature with the highest score as the split feature of the current node.
- 8. The method of claim 6, wherein the method further comprises: Acquiring a new environment variable and an external condition, inputting the new environment variable and the external condition into a player decision behavior model, and determining a target leaf node in which the new environment variable and the external condition fall; judging whether the Indonesia of the target leaf node changes or not; If the player decision behavior model is not changed, local reconstruction of the player decision behavior model is not performed; If the current node changes, the target leaf node is determined to be a new current node, a sample data set falling into the target leaf node, a new environment variable and an external condition are taken as training data, and splitting is started from the new current node until a splitting stopping condition is met, so that the local reconstruction of the player decision behavior model is completed.
- 9. The method according to claim 6 or 8, wherein the splitting stop condition is that the entropy gain of the information after splitting of the current node is lower than a preset gain value during splitting.
- 10. The meta-universe player behavior offline hosting system is characterized by comprising a server side and a client side; The server side is used for acquiring online data of the real player in the predefined behavior tree, wherein the online data of the real player comprises environment variables, external conditions, decision behaviors and unique IDs stored in the decision nodes, and Generating a sample data set with the environment variable and the external condition as characteristic data sets and the decision behavior as a tag data set, wherein each sample data corresponds to a unique ID, and Inputting the sample data set into a decision tree model, wherein the decision tree model comprises a training method module and a tree structure module, the training method module calculates the information entropy or the information entropy gain of each feature in the feature data set based on a recursive splitting algorithm, determines splitting features according to the information entropy or the information entropy gain and correspondingly generates splitting conditions, recursively divides the sample data set into subsets according to the splitting conditions until the splitting stop conditions are met, stores node data generated in the splitting process in the tree structure module, and constructs and obtains a player decision behavior model, and In the model prediction stage, the state machine responds to real player offline messages of the meta-universe to send notifications to decision nodes, and After the decision node receives the notification, the current environment variable and the external condition are acquired through the injected data collection interface instance and are sent to the player decision behavior model, the player decision behavior model outputs the predicted behavior to return to the decision node of the behavior tree, and The decision node selects an operation node corresponding to the predicted behavior according to a preset behavior-operation node mapping table; the client is used for responding to the selection of the decision node, and the operation node controls the virtual characters in the meta universe to execute the behaviors so as to complete the offline hosting of the behaviors of the real players.
Description
Meta universe player behavior offline hosting method and system Technical Field The application relates to the technical field of computers, in particular to a meta-universe player behavior offline hosting method and system. Background In the related technology of the metauniverse game, after a real player goes offline, the behavior of a virtual character (namely, non-PLAYER CHARACTER, NPC) is determined through a preset strategy decision behavior, so that the behavior of the real player is simulated, and the game hosting of the real player is realized. The current part of meta-universe games are experienced by real players by using fragmentation time, and due to the fact that the related technology adopts preset strategy decision behaviors, decision death is caused, changes cannot be made according to external factors such as ambient environment changes or scenario development, authenticity is lacking, the real players are easy to feel boring after experiencing, and the viscosity of the real players to the meta-universe games is poor. Disclosure of Invention The application provides a meta-universe player behavior offline hosting method and system, which can enable virtual roles to dynamically react according to external factors such as surrounding environment changes or scenario development and the like, and enhance the viscosity of a real player to a meta-universe game. The first aspect of the application provides a meta-universe player behavior offline hosting method, wherein a predefined behavior tree comprises a state machine, a decision node and an operation node, and the method comprises the following steps: acquiring online data of a real player in a predefined behavior tree, the online data of the real player comprising The decision node stores environment variables, external conditions, decision behaviors and unique IDs; taking the environment variable and the external condition as characteristic data sets, and taking decision behaviors as tag data sets, generating sample data sets, wherein each sample data corresponds to a unique ID; Inputting a sample data set into a decision tree model, wherein the decision tree model comprises a training method module and a tree structure module, the training method module calculates information entropy or information entropy gain of each feature in the feature data set based on a recursive splitting algorithm, determines splitting features according to the information entropy or the information entropy gain and correspondingly generates splitting conditions, recursively divides the sample data set into subsets according to the splitting conditions until splitting stop conditions are met, stores node data generated in the splitting process in the tree structure module, and constructs and obtains a player decision behavior model; in the model prediction stage, the state machine responds to real player offline information of the meta universe and sends notification to the decision node; After receiving the notification, the decision node acquires the current environment variable and the external condition through the injected data collection interface instance and sends the current environment variable and the external condition to a player decision behavior model, and the player decision behavior model outputs the predicted behavior and returns the predicted behavior to the decision node of the behavior tree; The decision node selects an operation node corresponding to the predicted behavior according to a preset behavior-operation node mapping table; Responsive to selection of the decision node, the operational node controls the virtual character in the meta-universe to perform the action to complete offline hosting of the live player action. In some embodiments, the definition of the predefined behavior tree includes a definition of a training data collection phase, the definition of the training data collection phase including: Defining a state machine, switching the state of a player of a control person and sending a notice of the switched state to a decision node; Defining decision node, receiving notification, obtaining environment variable, external condition and instruction operation issued by real player by means of injected data collection interface example and Calling an external incoming condition callback function, carrying out logic judgment on the data acquired by the data collection interface instance according to the service rule carried by the external incoming condition callback function, judging whether the acquired data meets the condition for triggering execution of the appointed behavior, and Synchronously collecting and storing the acquired data by training the data collection object, generating and storing the decision behavior and the unique ID according to the logic judgment, and When the condition for triggering execution of the specified behavior is met, selecting an operation node according to a preset behavior-operation node mapp