Object construction method and related device
By adding perturbations to the NPC's attribute parameters and running the object to be analyzed in the target program to determine its behavior parameters and style, the problem of low NPC construction efficiency in the existing technology is solved, and automated NPC construction and updates are realized, and diversity and efficiency are improved.
Patent Information
- Application Number
- PCT/CN2024/098366
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-08-22
- Filing Date
- 2024-06-11
- Publication Date
- 2025-04-10
AI Technical Summary
In the prior art, building non-player characters (NPCs) with diverse styles is inefficient and requires a large number of manual design and adjustment of behavior trees, resulting in high construction difficulty and cost.
By adding perturbations to the NPC's attribute parameters, generate the attribute parameters of the object to be analyzed, and run the object in the target program to determine its behavior parameters and behavior style. If it is different from the existing NPC, it is added to the NPC collection to achieve automated NPC construction and updates.
It improves the efficiency and diversity of NPC construction, reduces the dependence on manual experience and participation, and realizes automated NPC behavior style updates.
Smart Images

Figure CN2024098366_10042025_PF_FP_ABST
Abstract
Description
Object construction method and related device
[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on August 22, 2023, with application number 2023110706354 and application name “A method for constructing an object and related devices”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of automated processing technology, and in particular to game object construction technology. Background Art
[0003] Non-player characters (NPCs) are indispensable in games. The interactions between NPCs and player characters, as well as their in-game behaviors, are crucial factors influencing the player's gaming experience. NPCs play a variety of roles in games, helping players solve problems, providing quests and challenges, and even enriching the game's storyline. They make the game world feel vivid and real, allowing players to experience a richer emotional experience.
[0004] To enhance the player experience, game developers need to create diverse NPCs to meet diverse NPC interaction needs. In related technologies, the NPC's behavior logic in games is determined by the behavior tree corresponding to the NPC. To create NPCs of different styles, game developers need to design their own behavior trees.
[0005] However, since the construction of NPCs of different styles in related technologies relies heavily on manual design, game developers need to constantly adjust and design the various nodes and branches in the corresponding behavior tree based on development experience, which consumes a lot of time and energy. As a result, the NPC construction efficiency is low, and it is difficult to efficiently build NPCs with diverse styles.
[0006] Summary of the Invention
[0007] In order to solve the above technical problems, the present application provides an object construction method that can automatically and efficiently generate non-player objects with diverse styles.
[0008] The embodiments of this application disclose the following technical solutions:
[0009] In a first aspect, an embodiment of the present application discloses an object construction method, which is executed by a computer device, and the method includes:
[0010] Determining a target object from non-player objects included in the non-player object set, the non-player object having attribute parameters and behavior parameters, the attribute parameters being used to control the behavior of the non-player object in a target program, the behavior parameters being determined based on the behavior of the non-player object in the target program, and the behavior parameters being used to characterize a behavior style of the non-player object in the target program;
[0011] Generating attribute parameters corresponding to the object to be analyzed by adding disturbances to the attribute parameters corresponding to the target object;
[0012] According to the attribute parameters corresponding to the object to be analyzed, the object to be analyzed is run in the target program to determine the behavior parameters corresponding to the object to be analyzed;
[0013] determining, based on the behavior parameters corresponding to the object to be analyzed and the behavior parameters corresponding to each of the non-player objects included in the set of non-player objects, whether the behavior style corresponding to the object to be analyzed is consistent with the behavior style corresponding to each of the non-player objects included in the set of non-player objects;
[0014] When the behavior style corresponding to the object to be analyzed is inconsistent with the behavior styles corresponding to the respective non-player objects included in the non-player object set, the object to be analyzed is added to the non-player object set.
[0015] In a second aspect, an embodiment of the present application discloses an object construction device, the device comprising a first determination unit, a generation unit, a second determination unit, a third determination unit, and a first update unit:
[0016] The first determining unit is configured to determine a target object from non-player objects included in the non-player object set, the non-player object having attribute parameters and behavior parameters, the attribute parameters being used to control the behavior of the non-player object in a target program, the behavior parameters being determined based on the behavior of the non-player object in the target program, and the behavior parameters being used to characterize a behavioral style of the non-player object in the target program;
[0017] The generating unit is configured to generate attribute parameters corresponding to the object to be analyzed by adding disturbances to the attribute parameters corresponding to the target object;
[0018] The second determining unit is configured to run the object to be analyzed in the target program according to the attribute parameters corresponding to the object to be analyzed, and determine the behavior parameters corresponding to the object to be analyzed;
[0019] the third determining unit being configured to determine whether a behavior style corresponding to the object to be analyzed is consistent with a behavior style corresponding to each non-player object included in the set of non-player objects based on the behavior parameters corresponding to the object to be analyzed and the behavior parameters corresponding to each non-player object included in the set of non-player objects;
[0020] The first updating unit is configured to add the object to be analyzed to the non-player object set when the behavior style corresponding to the object to be analyzed is inconsistent with the behavior styles corresponding to each non-player object included in the non-player object set.
[0021] In a third aspect, an embodiment of the present application discloses a computer device, comprising a processor and a memory:
[0022] The memory is used to store a computer program and transmit the computer program to the processor;
[0023] The processor is configured to execute the object construction method described in any one of the first aspects according to instructions in the computer program.
[0024] In a fourth aspect, an embodiment of the present application discloses a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and the computer program is used to execute the object construction method described in any one of the first aspects.
[0025] In a fifth aspect, an embodiment of the present application discloses a computer program product comprising a computer program, which, when executed on a computer device, enables the computer device to execute the object construction method described in any one of the first aspects.
[0026] It can be seen from the above technical solution that in this application, attribute parameters are used to control the behavior of non-player objects in the target program, and the behavior parameters are determined based on the behavior of non-player objects in the target program, so they can characterize the behavior style of non-player objects in the target program. This application can affect the behavior of non-player objects in the target program by adjusting the attribute parameters corresponding to the non-player objects, thereby affecting the corresponding behavior style of the non-player objects in the target program. Based on this, in order to construct non-player objects with rich behavior styles, the target object can be first determined from the set of generated non-player objects, and the attribute parameters corresponding to the object to be analyzed can be generated by adding disturbances to the attribute parameters corresponding to the target object, that is, by disturbing the attribute parameters of the generated target object, the behavior style of the target player can be disturbed, and the object to be analyzed may be different from the target object in behavior style. According to the attribute parameters corresponding to the object to be analyzed, the object to be analyzed can be run in the target program to determine the behavior parameters corresponding to the object to be analyzed. Based on the behavior parameters corresponding to the object to be analyzed and the behavior parameters corresponding to each non-player object in the non-player object set, it can be analyzed whether there is an object with a behavior style corresponding to the object to be analyzed in the non-player object set. If there is no object with a behavior style corresponding to the object to be analyzed in the non-player object set, the object to be analyzed can be added to the non-player object set to automatically update the behavior style of the objects in the non-player object set, which helps to increase the degree of diversity of behavior styles in the non-player object set. Therefore, by running the non-player objects in the non-player object set in the target program, a diverse non-player object interaction experience can be brought to the target program user, while reducing the difficulty of constructing diverse non-player objects, reducing the dependence of object construction on human experience and the need for human participation, and improving the efficiency of object construction. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0028] FIG1 is a schematic diagram of an object construction method in a practical application scenario provided by an embodiment of the present application;
[0029] FIG2 is a flowchart of an object construction method provided in an embodiment of the present application;
[0030] FIG3 is a schematic diagram of an object construction method provided in an embodiment of the present application;
[0031] FIG4 is a schematic diagram of an object construction method provided in an embodiment of the present application;
[0032] FIG5 is a flowchart of a method for constructing an object in a practical application scenario provided by an embodiment of the present application;
[0033] FIG6 is a schematic diagram of an object construction method in a practical application scenario provided by an embodiment of the present application;
[0034] FIG7 is a schematic diagram of an object operation in an actual application scenario provided by an embodiment of the present application;
[0035] FIG8 is a structural block diagram of an object construction device provided in an embodiment of the present application;
[0036] FIG9 is a structural diagram of a terminal provided in an embodiment of the present application;
[0037] FIG10 is a structural diagram of a server provided in an embodiment of the present application. DETAILED DESCRIPTION
[0038] The embodiments of the present application are described below with reference to the accompanying drawings.
[0039] Non-player objects (NPOs) refer to objects other than the player in a game. Players can interact with these objects (e.g., in combat, through collaboration) to experience relevant game content. In related technologies, constructing NPOs requires designers to manually design a behavior tree for these objects. This behavior tree includes behavior nodes corresponding to the different scenarios a NPO may encounter in the game. A behavior node indicates the behavior that the NPO should perform in the corresponding scenario. This means that the mapping between scenarios and behavior nodes determines the behavior of NPOs in the game.
[0040] Because the behavior style of non-player objects is determined by their behavior within the game program, in related art, constructing non-player objects with diverse behavior styles requires designers to constantly modify the various behavior nodes and branches in the behavior tree so that different non-player objects can perform different behaviors in the same scenario. This requires designers to have a strong grasp of the behavior styles, making object construction difficult. Furthermore, it requires designers to spend a significant amount of time and effort designing and maintaining the behavior tree, resulting in high object construction costs. Therefore, the object construction methods used in related art make it difficult to efficiently construct non-player objects with diverse behavior styles.
[0041] In order to solve the above technical problems, the present application provides an object construction method, which realizes the efficient construction of diversified behavioral style objects based on attribute parameters that can control the behavior of non-player objects in the target program and behavioral parameters that can characterize the behavioral style of non-player objects in the target program. By perturbing the attribute parameters of the generated non-player objects, it is possible to obtain an object to be analyzed that may be different from the generated non-player objects in terms of behavioral style. Based on the perturbed attribute parameters, the object to be analyzed is actually run in the target program, and the behavioral parameters corresponding to the object to be analyzed can be obtained. Based on the behavioral parameters, it can be determined whether an object to be analyzed whose behavioral style is inconsistent with that of the existing non-player objects has been constructed. If there is inconsistency, it can be saved as an existing non-player object. It can be seen that the present application can realize automated object construction and evaluation based on attribute parameters and behavioral parameters, which is helpful to efficiently construct non-player objects with diversified behavioral styles.
[0042] It is understood that the method can be executed by a computer device capable of object construction, such as a terminal device or a server. The method can be executed independently by a terminal device or a server, or it can be applied to a network scenario where a terminal device and a server communicate, with the terminal device and the server cooperating to execute the method. The terminal device can be a mobile phone, tablet computer, laptop computer, desktop computer, or other device. The server can be understood to be an application server or a web server. In actual deployment, the server can be a standalone server, a cluster server, or a cloud server.
[0043] In order to facilitate understanding of the technical solution provided by this application, an object construction method provided by an embodiment of this application will be introduced below in combination with an actual application scenario.
[0044] Refer to Figure 1, which is a schematic diagram of an object construction method in an actual application scenario provided by an embodiment of the present application. In this actual application scenario, the computer device used to execute the object construction method can be an object construction server 101 with object construction capabilities, and the target program is a target game program.
[0045] As shown in FIG1 , the generated non-player object set includes N non-player objects, namely, non-player object 1, non-player object 2, and non-player object N, where N is an integer greater than 1. The object construction server 101 can first determine the target object for object construction from the non-player object set, which can be, for example, non-player object 2. By adding a perturbation to the attribute parameter 1 corresponding to non-player object 2, a new attribute parameter 2 can be obtained, which can be used as the attribute parameter corresponding to the object to be analyzed next. Since the attribute parameters can control the behavior of the non-player object in the target game program, and the behavioral parameters determined based on the behavior can reflect the behavioral style of the non-player object, the new attribute parameter 2 generated by adding the perturbation can construct a non-player object with a new behavioral style in the target game program.
[0046] In order to analyze the actual behavior style corresponding to the object to be analyzed, the object construction server 101 can run the object to be analyzed in the target game program based on the attribute parameter 2. As shown in Figure 1, in this actual application scenario, the actual behavior parameters corresponding to the object to be analyzed can be determined through the interaction between the player-controlled object and the object to be analyzed in the target game program, thereby determining the behavior style corresponding to the object to be analyzed. If the behavior style is a behavior style that is not present in the non-player object set, the object construction server 101 can update the non-player object set based on the object to be analyzed, thereby generating a set of non-player objects with multiple behavior styles. By running the non-player objects in the non-player object set in the target game program, a diverse object interaction experience can be provided to the player. It can be seen that the present application can achieve efficient and automated construction of non-player objects with diverse styles, with a low degree of reliance on human participation and human experience.
[0047] Next, the object construction method provided by this application will be introduced in detail with reference to the accompanying drawings.
[0048] Referring to FIG. 2 , FIG. 2 is a flowchart of an object construction method provided in an embodiment of the present application. In this embodiment, the processing device may be any of the aforementioned computer devices having an object construction function. The method includes:
[0049] S201: Determine a target object from non-player objects included in a non-player object set.
[0050] The non-player object set may include at least one non-player object. The non-player objects included in the non-player object set may be non-player objects that have been generated in the target program, or may be non-player objects that have been generated in other programs other than the target program (the non-player objects may be run in the target program), and are not limited here. The target program may be any program that can run non-player objects, such as any game program, animation program, etc. Non-player objects refer to objects other than player objects (i.e., objects controlled by the player) in the target program, that is, virtual objects that are not controlled by the player. It should be emphasized that the player object here may refer to the user of the target program, and is not limited to the player of the game program.
[0051] In this application, the non-player object set includes non-player objects with attribute parameters and behavior parameters. The attribute parameters determine the properties of the non-player objects in the target program, and can be used to control the behavior of the non-player objects in the target program. For example, the parameter for the "perception range" attribute of non-player object A is 3m, which means that non-player object A can perceive other objects within 3m of itself in the target program. This attribute parameter can be used to control the attack behavior of the non-player object in the target program. For example, the non-player object may be more likely to attack other objects within 3m.
[0052] Behavior parameters are determined based on the behavior of non-player objects in the target program and can be used to characterize the behavioral style of non-player objects in the target program. For example, by counting the attack behaviors of non-player objects in the target program, the behavioral parameter "attack distance" corresponding to the non-player objects can be obtained. Different attack distances correspond to different behavioral styles. For example, the behavioral style of non-player objects with a closer attack distance can be "close combat", while the behavioral style of non-player objects with a longer attack distance can be "keeping their distance". In addition, the behavioral parameters in this application can also include multiple parameter forms. For example, they can be parameters directly determined by the behavior of non-player objects, such as the attack distance and movement speed when executing the behavior, or they can be parameters determined through a certain mapping relationship. For example, based on the attack distance and the classification of attack distance under different behavioral styles, it can be determined that the non-player object corresponds to behavioral style 1, so that "1" can be used as a behavior parameter, which can also play a role in characterizing the behavioral style.
[0053] As can be seen from the above description of parameters, attribute parameters can, to a certain extent, influence the behavior of non-player objects in the target program by affecting their behavior within the target program. Based on this, in order to construct a non-player object with a different behavior style from the already generated non-player object, the computer device can modify the attribute parameters of the already generated non-player object and use the modified attribute parameters as the attribute parameters corresponding to the new non-player object.
[0054] The computer device may determine a target object from the set of non-player objects. This target object is the non-player object for which subsequent attribute parameter adjustment is targeted. The target object may be any non-player object in the set of non-player objects, or may be determined according to a specific rule, which is not limited herein.
[0055] S202: Generating attribute parameters corresponding to the object to be analyzed by adding disturbances to the attribute parameters corresponding to the target object.
[0056] Adding perturbations is a way to adjust attribute parameters. The object to be analyzed is the non-player object corresponding to the attribute parameters after adding perturbations.
[0057] In one possible implementation, random perturbations can be added to the target object's corresponding attribute parameters. Random perturbations adjust the original attribute parameters based on random parameter values. By adding random perturbations, the target object's corresponding attribute parameters are changed to randomized attribute parameters, thereby increasing the probability that the changed attribute parameters can be used to construct a non-player object with a behavioral style inconsistent with the target object. In this case, the object to be analyzed is the non-player object corresponding to the attribute parameters after the random perturbations.
[0058] In another possible implementation, directional perturbations can be added to the attribute parameters corresponding to the target object. Directed perturbations refer to adjustments to the original attribute parameters based on specific perturbation parameters. In some cases, a new non-player object with a specific style may be desired. In this case, specific perturbation parameters can be determined based on the attribute parameters corresponding to that specific style, and the attribute parameters of the target object can be directionally adjusted accordingly. The adjusted attribute parameters are then more likely to create a non-player object with the desired specific style. In this case, the object to be analyzed is the non-player object corresponding to the attribute parameters after the directional perturbation.
[0059] S203: According to the attribute parameters corresponding to the object to be analyzed, the object to be analyzed is run in the target program to determine the behavior parameters corresponding to the object to be analyzed.
[0060] In order to analyze whether the object to be analyzed has a behavioral style that is inconsistent with the generated non-player objects, the computer device can run the object to be analyzed in the target program based on the attribute parameters corresponding to the object to be analyzed, so as to obtain the behavior of the object to be analyzed in the target program, and then determine the behavioral parameters corresponding to the object to be analyzed.
[0061] S204: Determine whether the behavior style corresponding to the object to be analyzed is consistent with the behavior style corresponding to each non-player object included in the non-player object set based on the behavior parameters corresponding to the object to be analyzed and the behavior parameters corresponding to each non-player object included in the non-player object set.
[0062] As mentioned above, the behavioral parameters can characterize the behavioral style of the non-player objects in the target program. Therefore, the computer device can analyze and determine the behavioral style corresponding to the object to be analyzed and the behavioral parameters corresponding to each non-player object included in the non-player object set based on the behavioral parameters corresponding to the object to be analyzed and the behavioral parameters corresponding to each non-player object included in the non-player object set.
[0063] S205: Based on the fact that the behavior style corresponding to the object to be analyzed is inconsistent with the behavior styles corresponding to the respective non-player objects included in the non-player object set, the object to be analyzed is added to the non-player object set.
[0064] For the purpose of constructing non-player objects with diverse behavioral styles, the computer device can add the object to be analyzed to the non-player object set when the behavioral style corresponding to the object to be analyzed is inconsistent with the behavioral styles corresponding to the non-player objects included in the non-player object set, thereby increasing the number of behavioral styles in the non-player object set, and then by running the non-player objects in the non-player object set in the target program, a diverse object interaction experience can be brought. "Based on" in this application means that a certain action can be a condition that triggers other actions, but it does not mean that other actions will be triggered. At the same time, the other actions can also have multiple triggering conditions. For example, based on the purpose of constructing other objects, the computer device can also choose to add the object to be analyzed to the non-player object set according to different rules, which is not limited here.
[0065] As can be seen from the above technical solution, this application can influence the behavior of non-player objects in the target program by adjusting the attribute parameters corresponding to the non-player objects, thereby affecting the corresponding behavioral style of the non-player objects in the target program. Based on this, in order to construct non-player objects with rich behavioral styles, the target object can be first determined from the set of generated non-player objects. By adding perturbations to the attribute parameters corresponding to the target object, the attribute parameters corresponding to the object to be analyzed can be generated. That is, by perturbing the attribute parameters of the generated target object, the behavioral style of the target player is disturbed, resulting in an object to be analyzed that may have a different behavioral style from the target object. According to the attribute parameters corresponding to the object to be analyzed, the object to be analyzed can be run in the target program to determine the behavior parameters corresponding to the object to be analyzed. Based on the behavior parameters corresponding to the object to be analyzed and the behavior parameters corresponding to each non-player object in the non-player object set, it can be analyzed whether there is an object with a behavior style corresponding to the object to be analyzed in the non-player object set. If there is no object with a behavior style corresponding to the object to be analyzed in the non-player object set, the object to be analyzed can be added to the non-player object set to automatically update the behavior style of the objects in the non-player object set, which helps to increase the degree of diversity of the behavior styles in the non-player object set. Therefore, by running the non-player objects in the non-player object set in the target program, a diversified non-player object interaction experience can be brought to the target program users, while reducing the difficulty of constructing diversified non-player objects, reducing the dependence of object construction on human experience and the need for human participation, and improving the efficiency of object construction.
[0066] When running the object to be analyzed based on the attribute parameters, the computer device can perform analysis in the following ways:
[0067] When executing step S203, the computer device may execute steps S2031-S2032 (not shown in the figure). Steps S2031-S2032 are a possible implementation of step S203, including:
[0068] S2031: Perform reinforcement learning on the initial object control model according to the attribute parameters corresponding to the object to be analyzed, to obtain an object control model corresponding to the object to be analyzed.
[0069] In the present application, the behavior of non-player objects in the target program is controlled by an object control model, which can be used to determine the behavior that the non-player objects need to perform based on the scenarios that the non-player objects face in the target program. As mentioned above, the behavior of non-player objects in the target program is controlled by attribute parameters, that is, the behavior of non-player objects is constrained by attribute parameters and needs to conform to their corresponding attribute parameters. Therefore, the computer device can perform reinforcement learning on the initial object control model based on the attribute parameters. During the reinforcement learning process, the initial object control model can learn how to determine the behavior that conforms to the attribute parameters, and then the object control model used to control the behavior of the object to be analyzed in the target program can be obtained.
[0070] S2032: Running the object to be analyzed in the target program through the object control model to determine the behavior parameters corresponding to the object to be analyzed.
[0071] Specifically, when executing step S2031, the computer device may execute steps S20311-S20314 (not shown in the figure). Steps S20311-S20314 are a possible implementation of step S2031, including:
[0072] S20311: Obtain the scene parameters corresponding to the object to be analyzed in the target program.
[0073] The scenario parameters are used to identify the behavioral scenarios encountered by the object to be analyzed in the target program. In this application, to make the behavior of non-player objects in the target program more reasonable, the computer device can determine the behavior that the non-player objects should perform based on the behavioral scenarios they encounter in the target program. This can ensure that the behavior is more consistent with the behavioral scenarios faced by the non-player objects and improve the rationality of the behavior. For example, when the behavioral scenario is that there are other objects within a certain distance, the computer device can control the non-player objects to attack or move.
[0074] Based on this, in order to enable the object control model to reasonably control the behavior of the object to be analyzed in the target program, model training can be used to enable the object control model to have the ability to output the behavior that the object to be analyzed should perform based on scenario parameters.
[0075] S20312: Determine behavior control parameters based on the scene parameters through the initial object control model.
[0076] The behavior control parameter is used to control the object to be analyzed to perform the target behavior in the above behavior scenario.
[0077] S20313: Determine the degree of reward feedback for the initial object control model based on the degree of fit between the target behavior and the attribute parameters corresponding to the object to be analyzed.
[0078] As mentioned above, attribute parameters are used to control the behavior of non-player objects in the target program. Specifically, the behavior of non-player objects in the target program should conform to their corresponding attribute parameters. During model training, to enable the object control model to determine behavior control parameters that conform to these attribute parameters, the computer device may determine the degree of reward feedback for the initial object control model in reinforcement learning based on the degree of conformity between the target behavior of the object under analysis as controlled by the initial object control model and the attribute parameters corresponding to the object under analysis. The degree of fit between the target behavior and attribute parameters refers to the degree of fit between the attribute parameters represented by the target behavior and the attribute parameters corresponding to the object to be analyzed. The attribute parameters represented by the target behavior are the attribute parameters actually reflected by the initial object control model when controlling the behavior of the object to be analyzed. For example, if the target behavior is "attack other objects" and the average attack distance of the object to be analyzed during the execution of the target behavior is 10 meters, the attribute parameter represented by "perception range" is approximately 10 meters. If the attribute parameter corresponding to the object to be analyzed is "perception range 5 meters", then the attribute parameters actually represented by the target behavior differ significantly from the attribute parameters corresponding to the object to be analyzed, indicating that the degree of fit between the attribute parameters corresponding to the target behavior and the object to be analyzed is low. Conversely, the closer the attribute parameter represented by the "perception range" of the target behavior is to 5 meters, the higher the degree of fit between the target behavior and the attribute parameters corresponding to the object to be analyzed. Specifically, corresponding fit determination rules can be set for different types of attribute parameters, so that the fit determination rules can be used to determine the fit between the target behavior and the attribute parameters corresponding to the object to be analyzed based on the difference between the attribute parameters represented by the target behavior and the attribute parameters corresponding to the object to be analyzed.
[0079] In reinforcement learning, the purpose of adjusting model parameters is to enable the model to obtain a greater degree of reward feedback. In this application, the degree of reward feedback is positively correlated with the degree of fit. Therefore, determining the reward feedback parameters based on the degree of fit helps the model learn how to determine behaviors that are more consistent with the attribute parameters. Specifically, when determining the reward feedback degree based on the degree of fit, a mapping table between the degree of fit and the degree of reward feedback can be pre-set, and then the reward feedback degree corresponding to the current degree of fit can be found in the mapping table.
[0080] For example, if the attribute parameter corresponding to the object to be analyzed is "perception range 3m", then the behavior that conforms to the attribute parameter should be interacting with other objects within a distance of 3m in the target program. The computer device can determine the actual interaction distance corresponding to the target behavior in the target program based on the behavior control parameters output by the initial object control model. If the interaction distance is beyond 3m and the difference between it and 3m is large, it means that the degree of fit between the target behavior and the attribute parameter is small at this time, so a smaller reward feedback degree can be given. If the interaction distance is close to 3m and beyond 3m, it means that the degree of fit between the target behavior and the attribute parameter is large at this time, based on a larger reward feedback degree. Thus, in this way, the initial object control model can learn to control the object to be analyzed to interact with other objects at a distance of about 3m.
[0081] S20314: Based on the degree of reward feedback, adjust the model parameters corresponding to the initial object control model to obtain the object control model.
[0082] When adjusting the model parameters corresponding to the initial object control model, the computer device can enable the initial object control model to gradually obtain a larger degree of reward feedback, so that the initial object control model can learn how to determine the behavior that is more consistent with the attribute parameters, and obtain the object control model. The object control model can be used to control the behavior of the object to be analyzed in the target program based on the scene parameters corresponding to the object to be analyzed in the target program, that is, to determine the behavior control parameters based on the scene parameters, and enable the object to be analyzed to perform the behavior corresponding to the behavior control parameters in the target program.
[0083] In this way, through the above method, by training an object control model that can determine the behavior control parameters that match the attribute parameters of the object to be analyzed, and using the object control model to control the operation of the object to be analyzed in the target program, it can be ensured that the behavior style of the object to be analyzed is consistent with its corresponding attribute parameters, which is conducive to accurately determining the behavior style corresponding to the object to be analyzed, and then facilitating the subsequent accurate decision on whether to add the object to be analyzed to the non-player object set, that is, ensuring the effective diversification of the non-player object set and avoiding the addition of non-player objects that do not have new behavior styles.
[0084] It is understandable that, since the objects to be analyzed in this application are generated by adding perturbations, multiple objects to be analyzed can theoretically be generated for each target object. Placing each object to be analyzed in the target program for behavioral parameter analysis may result in a significant workload. In one possible implementation, to reduce the workload required for object construction and more efficiently construct non-player objects with diverse styles, the computer device may analyze the probability of the object to be analyzed exhibiting a new behavioral style before running the object in the target program. Only objects to be analyzed with a high probability of exhibiting a new behavioral style are then placed in the target program for analysis.
[0085] There are various ways to analyze the probability of the analyzed object exhibiting a new behavior style. In one possible implementation, attribute parameters are fundamental factors influencing behavioral style. Therefore, if two non-player objects have significantly different attribute parameters, they are generally more likely to have different behavioral styles. Based on this, the computer device can predict the probability of the analyzed object exhibiting a new behavior style based on the differences in attribute parameters.
[0086] The computer device can determine the difference between the attribute parameters corresponding to the object to be analyzed and the attribute parameters corresponding to each non-player object included in the non-player object set. The greater the difference, the higher the probability that the object to be analyzed and each non-player object included in the non-player object set have different behavioral styles. Therefore, when executing step S203, the computer device can execute step S2033 (not shown in the figure). Step S2033 is a possible implementation of step S203, including:
[0087] S2033: If differences between the attribute parameters corresponding to the object to be analyzed and the attribute parameters corresponding to each non-player object included in the non-player object set are greater than a first preset threshold, the object to be analyzed is run in the target program based on the attribute parameters corresponding to the object to be analyzed to determine the behavior parameters corresponding to the object to be analyzed.
[0088] The computer device may preset a first preset threshold. If the difference between the attribute parameters corresponding to the object to be analyzed and the attribute parameters corresponding to each non-player object in the non-player object set is greater than the first preset threshold, it indicates that the attribute parameters of the object to be analyzed are significantly different from those of each non-player object in the non-player object set, and therefore the corresponding behavior style is likely different from that of existing non-player objects. Therefore, the computer device may determine that the object to be analyzed is likely to exhibit a new behavior style and input it into the target program for actual analysis.
[0089] On the contrary, if the condition is not met, it means that there is a non-player object in the non-player object set that is relatively close to the object to be analyzed in terms of attribute parameters, which means that the behavior style corresponding to the object to be analyzed is likely to already exist in the non-player object set. Therefore, the computer device may not further analyze the behavior parameters corresponding to the object to be analyzed, which saves the workload and time required for object construction to a certain extent and further improves the efficiency of object construction.
[0090] Since the object screening is based on the differences between attribute parameters, and the same behavior style may correspond to multiple different attribute parameters, if the non-player object set includes a more comprehensive composition of attribute parameters for each behavior style, it will help to more accurately screen out objects to be analyzed with new behavior styles based on attribute parameters.
[0091] Based on this, in one possible implementation, after selecting objects to be analyzed that can be put into the target program for behavioral style analysis using the above method and determining their behavioral styles, if the differences between the attribute parameters corresponding to the object to be analyzed and the attribute parameters corresponding to each non-player object included in the non-player object set are all greater than a first preset threshold, and there is a non-player object in the non-player object set whose corresponding behavioral style is consistent with that of the object to be analyzed, it indicates that the attribute parameters corresponding to the object to be analyzed are composed of another attribute parameter corresponding to an existing behavioral style. In this case, the computer device can add the object to be analyzed to the non-player object set so that when subsequently filtering objects to be analyzed based on the attribute parameters, the attribute parameter differences can be calculated from the multiple attribute parameter components of the behavioral style. If the difference between the attribute parameters corresponding to the object to be analyzed and one attribute parameter reaches the first preset threshold, but the difference with another attribute parameter is less than the first preset threshold, it can still be determined that the behavioral style corresponding to the object to be analyzed is likely to be an existing behavioral style. This method can further increase the accuracy of filtering objects to be analyzed based on attribute parameters, thereby further improving the efficiency of object construction.
[0092] As mentioned above, attribute parameters can directly influence the behavioral style of non-player objects. Therefore, to a certain extent, attribute parameters can also serve as a representation of the corresponding behavioral style of non-player objects. Based on this, in another possible implementation, the computer device can use a model to perform a more detailed analysis of the attribute parameters to predict the corresponding behavioral style of the object being analyzed.
[0093] The computer device can use the behavior parameter prediction model to determine the predicted behavior parameters corresponding to the object to be analyzed based on the attribute parameters corresponding to the object to be analyzed. The predicted behavior parameters are the behavior parameters corresponding to the object to be analyzed in the target program predicted by the behavior parameter prediction model. The behavior parameter prediction model is used to predict the behavior parameters corresponding to non-player objects in the target program based on the attribute parameters corresponding to the non-player objects. When executing step S203, the computer device can execute step S2034 (not shown in the figure). Step S2034 is a possible implementation of step S203, including:
[0094] S2034: If the differences between the predicted behavior parameters and the behavior parameters corresponding to each non-player object included in the non-player object set are greater than a second preset threshold, the object to be analyzed is run in the target program according to the attribute parameters corresponding to the object to be analyzed to determine the behavior parameters corresponding to the object to be analyzed.
[0095] The computer device may preset a second preset threshold value for determining whether there is a significant difference between behavioral parameters. Because behavioral parameters can characterize the behavioral style of non-player objects, if the differences between the predicted behavioral parameters corresponding to the object to be analyzed and the behavioral parameters corresponding to each non-player object in the set of non-player objects are all greater than the second preset threshold value, this indicates that the behavioral parameters of the object to be analyzed differ significantly from those of the existing non-player objects. Therefore, there is a high probability that the object to be analyzed has a behavioral style that is inconsistent with that of the existing non-player objects. Consequently, the computer device may input the object to be analyzed into the target program for actual analysis.
[0096] On the contrary, if this condition is not met, it means that there are non-player objects in the non-player object set that may be close to the object to be analyzed in terms of behavioral parameters, that is, there is a high probability that there are non-player objects in the existing non-player objects that have the same behavioral style as the object to be analyzed. The computer device may not put the object to be analyzed into the target program for actual analysis.
[0097] Specifically, in a possible implementation, the behavior parameter prediction model can be trained in the following manner:
[0098] The computer device may first obtain a sample non-player object set, where the sample non-player object set includes multiple sample non-player objects, each of which has corresponding attribute parameters and behavior parameters, both of which are actual parameters corresponding to the sample non-player objects.
[0099] The computer device can use multiple sample non-player objects as target sample objects, and determine the pending behavior parameters based on the attribute parameters corresponding to the target sample objects through the initial behavior parameter prediction model. The initial behavior parameter prediction model is a model that requires model training, and the pending behavior parameters are the behavior parameters corresponding to the target sample objects predicted by the initial behavior parameter prediction model.
[0100] Therefore, the difference between the pending behavior parameters and the behavior parameters corresponding to the target sample object can reflect the difference between the behavior parameters predicted by the initial behavior parameter prediction model and the actual behavior parameters corresponding to the target sample object, thereby reflecting the accuracy of the initial behavior parameter prediction model in predicting the behavior parameters. Based on this, the computer device can adjust the model parameters corresponding to the initial behavior parameter prediction model based on this difference, so that the difference between the pending behavior parameters predicted by the initial behavior parameter prediction model and the actual behavior parameters gradually decreases, thereby enabling the initial behavior parameter prediction model to learn how to accurately predict the behavior parameters based on the attribute parameters, thereby obtaining the behavior parameter prediction model.
[0101] In this way, using the behavior parameter prediction model described above, the predicted behavior parameters corresponding to the object to be analyzed are determined based on the attribute parameters of the object to be analyzed. Furthermore, based on the difference between the predicted behavior parameters of the object to be analyzed and the behavior parameters corresponding to each existing non-player object, a decision is made as to whether to run the object to be analyzed in the target program, thereby further determining the behavior style corresponding to the object to be analyzed. This achieves a preliminary screening of the object to be analyzed, avoiding the related resources required to run the object to be analyzed.
[0102] As mentioned above, target objects can be selected randomly or in different ways based on the purpose of the object construction. Next, we will introduce in detail the various methods for selecting target objects.
[0103] It's understandable that behavioral parameters can include multiple behavioral parameter dimensions, and different behavioral parameter dimensions can also indicate different behavioral style dimensions. For example, behavioral parameters can include movement speed and attack range. The behavioral parameter corresponding to movement speed can represent the behavioral style under the "agile / cumbersome" behavioral style dimension, while the behavioral parameter corresponding to attack range can represent the behavioral style under the "close-range combat / distanced" behavioral style dimension.
[0104] Since the same behavior style dimension can have multiple behavior styles, and the behavior style is controlled by attribute parameters, if you want to construct an object with a new behavior style in a certain behavior style dimension, you can select non-player objects corresponding to the multiple behavior styles in the behavior style dimension from the non-player object set. For example, in one possible implementation, the behavior parameters can include behavior parameters in a target behavior parameter dimension, which can be any behavior parameter dimension. The behavior parameters in the target behavior parameter dimension are used to represent the behavior style in the target behavior style dimension, and the target behavior style dimension has multiple behavior styles.
[0105] When executing step S201, the computer device may execute steps S2011-S2012 (not shown in the figure). Steps S2011-S2012 are a possible implementation of step S201, including:
[0106] S2011: Determine a plurality of objects to be processed from the non-player objects included in the non-player object set based on behavior parameters corresponding to the respective non-player objects included in the non-player object set.
[0107] Among them, multiple objects to be processed are non-player objects with different behavioral styles corresponding to the target behavioral style dimension. Because these objects to be processed have different behavioral styles under the target behavioral style dimension, the attribute parameters corresponding to these objects to be processed can more comprehensively reflect the impact of the attribute parameters on the behavioral style under the target behavioral style dimension. In other words, the attribute parameters corresponding to these objects to be processed can more comprehensively reflect the attribute parameter characteristics corresponding to different behavioral styles under the target behavioral style dimension. Therefore, when adding perturbations to the attribute parameters of these objects to be processed, there is a greater probability of constructing attribute parameters corresponding to new behavioral styles under the target behavioral style dimension.
[0108] S2012: Determine the plurality of objects to be processed as target objects respectively.
[0109] The computer device can use multiple objects to be processed as the target object and execute the above-mentioned processing process on the target object, so that the object to be analyzed can be constructed for each target object. The probability of new behavioral styles appearing in these objects to be analyzed under the target behavioral style dimension is high, which helps to improve the accuracy and efficiency of object construction, and can also meet the construction needs of objects for specific behavioral style dimensions.
[0110] For example, if one wants to construct a non-player object with a new behavioral style under behavioral style dimension A, the computer device can select non-player objects corresponding to multiple behavioral styles under the behavioral style dimension A according to the behavioral parameters corresponding to the non-player objects in the non-player object set as multiple objects to be processed.
[0111] Understandably, since the attribute parameters corresponding to different non-player objects are typically different, if a certain behavior style has multiple non-player objects, this indicates that the attribute parameter range corresponding to that behavior style is relatively large. Therefore, adjusting the attribute parameters of the non-player objects under that behavior style is generally difficult to obtain a new behavior style under the same behavior style dimension. Based on this, in one possible implementation, the computer device can use the number of non-player objects corresponding to each behavior style in the non-player object set under the target behavior style dimension as a reference to select the objects to be processed corresponding to each behavior style.
[0112] When executing step S2011, the computer device may execute steps S20111-S20112 (not shown in the figure). Steps S20111-S20112 are a possible implementation of step S2011, including:
[0113] S20111: Determine the number of non-player objects in the non-player object set corresponding to each of the plurality of behavior styles under the target behavior style dimension based on the behavior parameters corresponding to each of the non-player objects included in the non-player object set.
[0114] S20112: Based on the number of non-player objects in the non-player object set corresponding to the multiple behavioral styles under the target behavioral style dimension, determine multiple objects to be processed from the non-player object set.
[0115] The target behavioral style can be any behavioral style within the target behavioral style dimension. The greater the number of objects corresponding to the target behavioral style in the set of non-player objects, the wider the range of attribute parameters corresponding to the target behavioral style. Therefore, when adjusting the attribute parameters of non-player objects corresponding to the target behavioral style, it is easier to ensure that the adjusted attribute parameters remain within the attribute parameters corresponding to the target behavioral style, thereby easily obtaining objects to be analyzed whose behavioral styles have not changed. Therefore, the computer device can reduce the number of attribute parameter adjustments for non-player objects with the target behavioral style.
[0116] Conversely, the fewer objects in the non-player object set that correspond to the target behavioral style, the smaller the range of attribute parameters corresponding to the target behavioral style. Therefore, when adjusting the attribute parameters of the non-player objects corresponding to the target behavioral style, it is easy to change the behavior style of the object to be analyzed corresponding to the adjusted attribute parameters under the target behavioral style dimension. Thus, the computer device can increase the attribute parameter adjustment of the non-player objects with the target behavioral style. Based on this, in the present application, the number of objects corresponding to the target behavioral style in the multiple objects to be processed is negatively correlated with the number of non-player objects corresponding to the target behavioral style in the non-player object set, thereby improving the success rate of constructing non-player objects with new behavioral styles.
[0117] Furthermore, while different non-player objects may correspond to the same behavioral style, their capabilities within the target program may vary. For example, when engaging in combat with other objects within the target program, non-player objects with the same "Close Range Combat" behavioral style may have a higher probability of victory for some non-player objects and a lower probability of victory for others. The capabilities of non-player objects are also a significant factor influencing the player's experience with the program. If the non-player objects in the target program have poor capabilities, they may be unable to effectively interact with the player, resulting in a poor user experience.
[0118] Based on this, in one possible implementation, the computer device may further determine the task execution success rate corresponding to each non-player object included in the non-player object set. This task execution success rate is the success rate of the non-player object in executing a target task within a target program. The target task is used to test the object capabilities of the non-player object. For example, if the object capability to be tested is combat capability, the target task may be defeating other objects within the target program; if the object capability to be tested is interaction capability, the target task may be interacting with a player within the target program.
[0119] When executing step S2011, the computer device may execute step S20113 (not shown in the figure). Step S20113 is a possible implementation of step S2011, including:
[0120] S20113: Determine a plurality of objects to be processed from the non-player objects included in the non-player object set based on the behavior parameters and task execution success rates corresponding to the non-player objects included in the non-player object set.
[0121] The computer device may preset a third preset threshold value for determining whether the non-player objects have a high task execution success rate. If the task execution success rates corresponding to the multiple objects to be processed are all greater than the third preset threshold value, it means that the multiple objects to be processed all have relatively strong object capabilities to a certain extent. Therefore, when constructing objects based on these objects to be processed, the constructed objects to be analyzed are likely to also have relatively high object capabilities, thereby ensuring the stability of the object capabilities of the non-player objects in the target program and thus maintaining the program user experience provided by the non-player objects.
[0122] As mentioned above, this application can achieve efficient construction of non-player objects with specified behavioral style dimensions through the above method. Specifically, in order to meet the actual object construction requirements, the behavioral style dimensions targeted during object construction can be determined by the actual request during object construction.
[0123] The computer device may obtain an object construction request, wherein the object construction request is used to request construction of a non-player object corresponding to the behavior style dimension to be constructed. Thus, the object construction request can represent a construction requirement for a non-player object having a new behavior style under the behavior style dimension to be constructed.
[0124] Therefore, in order to meet the construction requirement, when executing step S201, the computer device may execute step S20114 (not shown in the figure). Step S20114 is a possible implementation of step S2011, including:
[0125] S20114: Determine the behavior style dimension to be constructed as the target behavior style dimension, and determine a plurality of objects to be processed from the non-player objects included in the non-player object set based on the behavior parameters corresponding to the non-player objects included in the non-player object set.
[0126] Therefore, in combination with the above object construction method, after the behavior style dimension to be constructed is determined as the target behavior style dimension, a non-player object with a new behavior style under the behavior style dimension to be constructed can be efficiently constructed.
[0127] It is understandable that, since behavioral parameters can include multiple behavioral parameter dimensions, when selecting a target object, the selection is based on the behavioral parameters of a specified dimension. Therefore, the more behavioral parameter dimensions included in the specified dimension, the more complex the target object selection will be, the higher the complexity of object construction will be, and the less targeted the single behavioral parameter dimension will be. Based on this, in one possible implementation, in order to reduce the processing pressure of the computer device during object construction, the computer device can perform multiple rounds of object construction for multiple behavioral parameter dimensions, thereby distributing the processing pressure of object construction in multiple behavioral parameter dimensions over multiple rounds of object construction.
[0128] In this implementation, object construction is used to complete an object construction task, which includes multiple rounds of object construction. The behavior parameters include multiple behavior parameter dimensions. The behavior style dimensions represented by the behavior parameters under different behavior parameter dimensions are different.
[0129] When executing step S201, the computer device may execute steps S20115-S20116 (not shown in the figure), which are a possible implementation of step S2011, including:
[0130] S20115: During the i-th round of object construction in multiple rounds of object construction, a target behavior parameter dimension is determined from multiple behavior parameter dimensions.
[0131] The target behavior parameter dimension is the behavior parameter dimension targeted by the i-th object construction. The target behavior parameter dimension is any part of the multiple behavior parameter dimensions. It can be one behavior parameter dimension or multiple behavior parameter dimensions. i is a positive integer.
[0132] S20116: Determine a plurality of objects to be processed from the non-player objects included in the non-player object set based on the behavior parameters corresponding to the non-player objects included in the non-player object set.
[0133] After determining the target behavior parameter dimension, through the above method, it is possible to determine from non-player objects an object to be processed that is helpful in constructing a new behavior style under the target behavior style dimension corresponding to the target behavior parameter dimension, so that the i-th round of object construction can be performed based on the object to be processed, that is, the object to be analyzed is constructed through the above method and analyzed in the target program.
[0134] After completing the update of the non-player object set using the objects to be analyzed constructed using the i-th round of objects, the computer device can determine whether the non-player objects included in the non-player object set meet the behavioral style requirements corresponding to the object construction task. The behavioral style requirements can identify the behavioral style of the non-player objects to be constructed for the object construction task. The update of the non-player object set using the objects to be analyzed constructed using the i-th round of objects can be accomplished by adding the objects to be analyzed that meet the requirements to the non-player object set, or by not modifying the non-player object set if all the objects to be analyzed do not meet the requirements. In other words, once the determination of whether each object to be analyzed generated in the i-th round of object construction is added to the non-player object set is completed, the update of the non-player object set using the objects to be analyzed constructed using the i-th round of objects can be considered complete.
[0135] If the behavior style requirements are met, then the non-player object collection already contains the non-player object required for the object construction task, so object construction can be stopped. Conversely, if the requirements are not met, then subsequent object construction behaviors are required to construct a non-player object that meets the behavior style requirements. Therefore, the i+1th round of object construction can be executed. In the i+1th round of object construction, the target behavior parameter dimensions can be reselected for object construction to construct non-player objects with different behavior styles.
[0136] Since each round of object construction is carried out for a specific behavioral parameter dimension, compared to constructing for all behavioral parameter dimensions at one time, the probability of constructing a non-player object with a new behavioral style under the behavioral style dimension corresponding to a specific behavioral parameter dimension is higher, which improves the targeting of each round of object construction, thereby increasing the success rate of each round of object construction, and thus helps to improve the overall efficiency of object construction.
[0137] Similar to behavioral parameters, in one possible implementation, attribute parameters can also include multiple attribute parameter dimensions. As mentioned above, the attribute parameters of the object to be analyzed are generated by adding perturbations to the attribute parameters corresponding to the generated non-player objects. If the attribute parameters include multiple attribute parameter dimensions, then each time an object is constructed, more attribute parameters need to be adjusted, which also places a greater processing pressure on the object construction. Based on this, the computer device can select only the attribute parameters of a certain attribute parameter dimension for adjustment during each round of object construction, thereby distributing the processing pressure caused by attribute parameter adjustment over multiple rounds of object construction.
[0138] Specifically, during the i-th round of object construction, the computer device may determine a target attribute parameter dimension from among multiple attribute parameter dimensions. The target attribute parameter dimension may be any portion of the multiple attribute parameter dimensions, or may be one or more attribute parameter dimensions. When executing step S202, the computer device may execute step S2021 (not shown in the figure). Step S2021 is a possible implementation of step S202, including:
[0139] S2021: Generate attribute parameters corresponding to the object to be analyzed by adding random perturbations to the attribute parameters under the target attribute parameter dimension corresponding to the target object.
[0140] Since only the attribute parameters within the target attribute parameter dimension need to be adjusted in round i, rather than adjusting the attribute parameters across all attribute parameter dimensions, the processing pressure of round i object construction can be reduced to a certain extent. When executing round i+1 object construction, the computer device can re-determine a new target attribute parameter dimension from the multiple attribute parameter dimensions.
[0141] Next, we will introduce in detail how to accurately analyze the behavioral styles of non-player objects based on behavioral parameters.
[0142] It is understandable that different behavioral styles typically have corresponding parameter ranges in terms of behavioral parameters. For example, in the behavioral parameter dimension of "average attack distance," the parameter range corresponding to the behavioral style of "close combat" may be 0-3 meters, indicating that non-player objects in the target program are more inclined to attack at a closer distance. The parameter range corresponding to the behavioral style of "opening the distance" may be 3-10 meters, indicating that non-player objects in the target program are more inclined to attack at a longer distance. Based on this, in one possible implementation, when determining a behavioral style based on behavioral parameters, the computer device may be divided based on the different behavioral parameter ranges corresponding to different behavioral styles.
[0143] When executing step S204, the computer device may execute steps S2041-S2042 (not shown in the figure). Steps S2041-S2042 are a possible implementation of step S204, including:
[0144] S2041: Determine a target parameter interval to which the behavior parameter corresponding to the object to be determined belongs according to the behavior parameter corresponding to the object to be determined and the parameter intervals corresponding to the plurality of behavior styles.
[0145] The object to be determined is any one of the non-player objects included in the object to be analyzed and the non-player object set. Different behavior styles correspond to different parameter intervals. Therefore, when the behavior parameters corresponding to the non-player objects fall within different parameter intervals, the determined behavior styles are different.
[0146] S2042: Determine the behavior style corresponding to the target parameter interval as the behavior style corresponding to the object to be determined.
[0147] In this way, by using the above method, the behavior style corresponding to the object to be determined is determined according to the parameter interval to which the behavior parameter belongs, so that the behavior style can be determined efficiently and conveniently, which is conducive to improving the efficiency of object construction.
[0148] It's understandable that the behavioral style of a non-player object in a target program typically reflects the behavioral characteristics of that non-player object within the target program as a whole. Therefore, it's more reasonable to determine the parameter range for categorizing behavioral styles based on the target program's overall non-player objects. For example, in Program A, if the average attack range of all non-player objects is 10, then a non-player object with an average attack range of 9 would be considered a close-range non-player object in Program A. However, in Program B, if the average attack range of all non-player objects is 3, then a non-player object with an average attack range of 9 would be considered a distance-based non-player object in Program B.
[0149] Based on this, to accurately and reasonably determine the behavior styles corresponding to non-player objects, the computer device can define parameter intervals corresponding to different behavior styles based on the behavior parameters of the entire non-player object corresponding to the target program. In one possible implementation, since the non-player objects in the non-player object set are non-player objects that can be used to run in the target program, the computer device can determine the behavior parameter boundaries and interval segment lengths based on the behavior parameters corresponding to each non-player object included in the non-player object set. The behavior parameter boundaries refer to the range of behavior parameters corresponding to all possible behavior styles, for example, they can include the maximum and minimum values of the behavior parameters. Behavior parameters within the total parameter interval formed by the behavior parameter boundaries have a corresponding behavior style. That is, as long as the behavior parameters fall within the total parameter interval formed by the behavior parameter boundaries, the corresponding behavior style can be determined. The total parameter interval includes parameter intervals corresponding to multiple behavior styles. The computer device can determine the behavior parameter boundaries and interval segment lengths by analyzing the distribution of the behavior parameters corresponding to each non-player object in the non-player object set. For example, the maximum and minimum values of the behavior parameters corresponding to each non-player object can be used as the behavior parameter boundaries.
[0150] The interval segment length is the interval length used to demarcate the parameter intervals corresponding to each behavioral style. The computer device can divide the total parameter interval into multiple parameter intervals corresponding to each behavioral style based on the behavioral parameter boundary and the interval segment length. The interval segment length is the length between the starting points of two adjacent parameter intervals. That is, starting from a behavioral parameter boundary, each interval segment length within the total parameter interval can be used to demarcate a parameter interval corresponding to a behavioral style.
[0151] See Figure 3, which is a schematic diagram of a parameter interval division provided in an embodiment of the present application. It is understood that the interval length of the parameter interval corresponding to the last behavioral style divided in this manner may not meet the interval segment length. Therefore, the present application stipulates that the length between the interval starting points of two adjacent parameter intervals meets the interval segment length.
[0152] Specifically, the division of parameter intervals corresponding to behavioral styles is a key factor affecting the accuracy of object construction, because the interval division directly affects the judgment of behavioral styles. If the parameter intervals involved in the behavioral styles are too large, it will lead to too many behavioral styles being generated, making it difficult to construct objects for each behavioral style during object construction, and it may include behavioral styles that will not appear in the target program, so that the object construction does not fit the actual behavioral characteristics of non-player objects in the target program; if the parameter intervals are too small, some behavioral styles may be omitted during object construction, resulting in the behavioral styles of non-player objects constructed by object construction being relatively simple and not comprehensive. Therefore, the computer equipment needs to accurately determine the behavioral parameter boundaries and interval segment lengths to determine the more reasonable parameter intervals corresponding to each behavioral style.
[0153] In one possible implementation, the distribution of the behavior parameters corresponding to each non-player object typically closely follows the characteristics of a Gaussian distribution. Specifically, because the behavior style of a single non-player object is relatively stable, even if the corresponding behavior parameters fluctuate within the target program, they remain concentrated within a single parameter range. Therefore, the computer device can analyze the distribution of the behavior parameters of each non-player object in the set of non-player objects based on the Gaussian distribution, thereby determining the aforementioned behavior parameter boundaries and interval segment lengths.
[0154] In this implementation, the behavior parameters corresponding to the target non-player object may include multiple behavior parameters, where the multiple behavior parameters may be behavior parameters corresponding to multiple behaviors of the target non-player object in the target program. Since the scenarios faced when executing behaviors, the state of the non-player object itself, etc. may vary, the corresponding behavior parameters when executing behaviors may also vary. For example, when executing the same attack behavior, the parameter of the attack distance corresponding to each attack behavior may be different. The target non-player object can be any non-player object included in the non-player object set, and the differences between the multiple behavior parameters are used to characterize the fluctuation of the behavior parameters of the target non-player object in the target program.
[0155] Because the target non-player object's own behavioral style is relatively stable, the parameter distribution of the multiple behavioral parameters corresponding to the target non-player object is typically concentrated within the parameter range corresponding to the behavioral style, that is, to a certain extent, it conforms to the parameter distribution characteristics of a Gaussian distribution. Based on this, when determining the behavioral parameter boundaries and interval segment lengths based on the behavioral parameters corresponding to the non-player objects included in the non-player object set, the computer device can utilize the characteristics of the Gaussian distribution to treat each non-player object included in the non-player object set as a target non-player object and determine the mean and variance of the multiple behavioral parameters corresponding to each target non-player object. In a Gaussian distribution, parameters are typically concentrated within a parameter range from the sum of the mean and variance to the difference between the mean and variance. Therefore, the computer device can determine the upper parameter boundary corresponding to the target non-player object based on the sum of the mean and variance, and the lower parameter boundary corresponding to the target non-player object based on the difference between the mean and variance. The parameter range formed by the upper and lower parameter boundaries is the parameter range within which the behavioral parameters of the target non-player object are concentrated.
[0156] The computer device may determine the minimum value among the upper parameter bounds corresponding to each non-player object in the non-player object set as the upper parameter bound in the behavior parameter bound, and the minimum value among the lower parameter bounds corresponding to each non-player object in the non-player object set as the lower parameter bound in the behavior parameter bound. This ensures that the total parameter interval formed by the behavior parameter bounds encompasses the behavioral parameters of the vast majority of non-player objects in the non-player object set, allowing each non-player object to be analyzed for its corresponding behavioral style as much as possible. Furthermore, this approach ensures that the total parameter interval formed by the behavior parameter bounds is not excessively large, closely matching the distribution of the behavioral parameters of the non-player objects in the non-player object set, thereby facilitating more accurate analysis of the behavioral style corresponding to each non-player object.
[0157] Furthermore, the computer device can determine the minimum value of the variance corresponding to each non-player object included in the non-player object set as the interval segment length. The variance can reflect the distribution difference of the behavioral parameters of each non-player object. In the Gaussian distribution, using the variance as the interval segment length can effectively divide the non-player objects with different behavioral parameter distributions into different parameter intervals, so that the non-player objects with different behavioral parameter distributions can correspond to different behavioral styles, accurately characterizing the behavioral style differences between different non-player objects. Using the minimum value in the variance as the interval segment length can perform fine-grained interval division of the total parameter interval, so that the parameter interval corresponding to each behavioral style obtained is more accurate, which helps to conduct a more detailed analysis of the behavioral style. The present application can automatically realize the division of the parameter interval corresponding to each behavioral style in the above manner. While ensuring the accuracy and rationality of the parameter interval, it can better fit the behavioral characteristics of the non-player objects in the target program. At the same time, it does not require human participation, reduces the dependence on human experience, and can further improve the efficiency of object construction.
[0158] For example, in an actual application scenario, the behavior parameter may include multiple behavior parameter dimensions, and for the j-th behavior parameter dimension m j For example, the computer device needs to determine the behavior parameter boundary corresponding to the behavior parameter dimension [l j ,u j ] and the interval segment length step j The parameter intervals corresponding to the various behavior styles divided by the behavior parameter boundaries and interval segment lengths should satisfy the requirement that the behavior parameters of the N selected non-player objects with different behavior styles belong to different parameter intervals.
[0159] The computer device can perform multiple running tests on these N non-player objects to obtain the parameter distribution of multiple behavior parameters corresponding to each non-player object. Specifically, let represents the random variable of the behavior parameter of the i-th non-player object in the j-th behavior style parameter dimension, and Indicates that the random variable follows a certain distribution.
[0160] Since the N non-player objects selected have different styles, their distributions will also be different. By calculating the mean of the random variable and variance to approximate it as a Gaussian distribution.
[0161] Thus, the computer device calculates the parameter lower boundary l in the behavior parameter boundary j for:
[0162] At the same time, we get the upper boundary u of the behavior parameter boundaryj for:
[0163] Interval segment length step j It can be:
[0164] At the same time, the computer device can slightly adjust the interval segment length so that it can convert the total parameter interval [l j ,u j ] is exactly divided into integer parameter intervals.
[0165] For example, Figure 4 shows the distribution of behavioral parameters obtained by evaluating the behavioral parameters in three non-player objects under a certain behavioral parameter dimension. The horizontal axis represents the actual size of the behavioral parameter, and the vertical axis is the probability distribution density. The mean values of the behavioral parameters of the three non-player objects are [μ(m 3 ),μ(m 1 ),μ(m 2 )]=[0.117,0.165,0.210], the variances of the three non-player pairs from left to right are [σ(m 3 ),σ(m 1 ),σ(m 2 )]=[0.053,0.053,0.047]. After calculation, the behavior parameter boundary corresponding to this behavior parameter dimension is [l,u]=[0.011,0.304], and the segmentation step is step=0.049. At this time, the average behavior parameters of the three non-player objects in this behavior parameter dimension (considered as the behavior parameters under this dimension) will fall into different parameter intervals, thereby achieving the effect of dividing behavioral styles.
[0166] In the present application, both the behavior parameter boundaries and the interval segment lengths can be updated as the set of non-player objects is updated, so that the division of behavior styles can always be more consistent with the actual object characteristics in the target program.
[0167] In order to facilitate understanding of the technical solution provided by the embodiments of the present application, the object construction method provided by the present application will be introduced below in combination with an actual application scenario.
[0168] See Figure 5, which is a flowchart of an object construction method in an actual application scenario provided by an embodiment of the present application. In this actual application scenario, the target program can be a game program, and the non-player object is an NPC in the game program. The object construction task is used to construct non-player objects corresponding to different behavioral styles under multiple behavioral style dimensions.
[0169] The method includes:
[0170] S501: Determine a sub-search space and a sub-style space from the search space and the style space.
[0171] During each round of object construction, the computer device can perform a subtask scheduling, which is used to determine the sub-search space and sub-style space. The search space refers to the overall attribute parameter dimension, and the style space refers to the overall behavior parameter dimension. In actual application scenarios, this can include a large number of attribute parameter dimensions and behavior parameter dimensions. Therefore, in each object construction, some attribute parameter dimensions can be selected to form a sub-search space, and some behavior parameter dimensions can be selected to form a sub-style space, to carry out targeted object construction. The sub-search space and sub-style space constitute a subtask within the object construction task, that is, the target of this object construction.
[0172] S502: Select a target NPC from the generated NPCs based on the sub-style space.
[0173] The computer device can use the various methods described above to select NPCs from among the NPCs that are helpful in constructing a new behavioral style within the behavioral style dimension corresponding to the sub-style space, as target NPCs. For example, the computer device can evenly select NPCs corresponding to multiple behavioral styles within the behavioral style dimension corresponding to the sub-style space, or it can select NPCs based on their in-game win rates, though this is not limited here. The overall NPC processing process can be illustrated in Figure 6.
[0174] S503: Add random perturbations to the attribute parameters in the sub-search space corresponding to the target NPC to obtain the NPC to be analyzed.
[0175] This application can implement attribute parameter adjustment during object construction based on the Map-Elites (ME) model. The ME model is used to construct multiple objects to be analyzed through parameter adjustment and retain the most valuable objects from among the multiple objects to be analyzed. Therefore, it can meet the process requirements of this application for constructing multiple NPCs to be analyzed by perturbing attribute parameters and selecting the objects to be stored in the NPC set from the multiple objects to be analyzed. When adjusting parameters, only the attribute parameters of the attribute parameter dimensions included in the sub-search space can be adjusted.
[0176] S504: Perform a preliminary evaluation on the NPC to be analyzed.
[0177] Pre-evaluation is used to determine whether the NPC being analyzed has a high probability of adopting a new behavioral style. This can be done in a variety of ways. The computer can perform this evaluation based on the differences between the attribute parameters of the NPC being analyzed and existing NPCs, or by using a behavioral parameter prediction model to predict the corresponding behavioral parameters for the NPC being analyzed.
[0178] S505: Reinforcement learning is performed based on the attribute parameters corresponding to the NPC to be analyzed that have passed the pre-evaluation to obtain a behavior control model corresponding to the NPC to be analyzed.
[0179] If the pre-assessment passes, it indicates that the NPC being analyzed has a high probability of exhibiting a new behavioral style. The computer can then run the NPC into the game program, testing it in a realistic gaming environment to determine the actual behavioral parameters of the NPC being analyzed. First, the computer can train a behavioral control model based on the attribute parameters of the NPC being analyzed, which is used to control the behavior of the NPC being analyzed in the target program.
[0180] S506: Run the NPC to be analyzed in the game program through the behavior control model to determine the corresponding behavior style.
[0181] S507: The NPC set is updated based on the NPC to be analyzed, and it is determined whether the number of behavior styles in the updated NPC set meets the requirement.
[0182] If the NPC to be analyzed has a new behavior style, or if it doesn't have a new behavior style but its attribute parameters differ significantly from those of existing NPCs, that is, different attribute parameters under the same behavior style, it can be used as a reference. In these cases, the NPC to be analyzed can be updated to the NPC set. After the update is completed, the computer device can determine whether the number of behavior styles already in the NPC set meets the requirement.
[0183] S508: End object construction.
[0184] If the number of behavior styles meets the requirement, or the computational overhead reaches the upper limit (the number of times the NPC is run in the game program reaches the upper limit), object construction can be terminated. If the requirement is not met and the computational overhead has not reached the upper limit, a new round of object construction can be executed.
[0185] After constructing the NPC set, the NPCs in the NPC set can be put into the game program for operation. As shown in Figure 7, the game client can send the scene parameters (such as scene description parameters, NPC state parameters, etc.) corresponding to the game scene faced by the NPC in the game program to the game server. The game server uses the object control model to determine the behavior control parameters according to the scene parameters, and sends the behavior control parameters back to the game client, thereby controlling the behavior of the NPC in the game program.
[0186] Based on the object construction method provided in the above embodiment, the embodiment of the present application further provides an object construction device. Referring to FIG8 , FIG8 is a structural block diagram of the object construction device 800 provided in the embodiment of the present application, including a first determining unit 801, a generating unit 802, a second determining unit 803, a third determining unit 804, and a first updating unit 805:
[0187] The first determining unit 801 is configured to determine a target object from non-player objects included in the non-player object set, wherein the non-player object has attribute parameters and behavior parameters, wherein the attribute parameters are used to control the behavior of the non-player object in the target program, and the behavior parameters are determined based on the behavior of the non-player object in the target program, and the behavior parameters are used to characterize the behavior style of the non-player object in the target program;
[0188] The generating unit 802 is configured to generate attribute parameters corresponding to the object to be analyzed by adding disturbances to the attribute parameters corresponding to the target object;
[0189] The second determining unit 803 is configured to run the object to be analyzed in the target program according to the attribute parameters corresponding to the object to be analyzed, and determine the behavior parameters corresponding to the object to be analyzed;
[0190] The third determining unit 804 is configured to determine whether the behavior style corresponding to the object to be analyzed is consistent with the behavior style corresponding to each non-player object included in the set of non-player objects based on the behavior parameters corresponding to the object to be analyzed and the behavior parameters corresponding to each non-player object included in the set of non-player objects;
[0191] The first updating unit 805 is configured to add the object to be analyzed to the non-player object set when the behavior style corresponding to the object to be analyzed is inconsistent with the behavior styles corresponding to each non-player object included in the non-player object set.
[0192] In a possible implementation, the second determining unit 803 is specifically configured to:
[0193] Performing reinforcement learning on the initial object control model according to the attribute parameters corresponding to the object to be analyzed to obtain an object control model corresponding to the object to be analyzed, wherein the object control model is used to control the behavior of the object to be analyzed in the target program;
[0194] The object to be analyzed is run in the target program through the object control model to determine behavior parameters corresponding to the object to be analyzed.
[0195] In a possible implementation, the second determining unit 803 is specifically configured to:
[0196] Acquiring a scenario parameter corresponding to the object to be analyzed in the target program, wherein the scenario parameter is used to identify a behavior scenario corresponding to the object to be analyzed in the target program;
[0197] Determining behavior control parameters based on the scenario parameters using the initial object control model, wherein the behavior control parameters are used to control the object to be analyzed to perform a target behavior in the behavior scenario;
[0198] Determining a reward feedback degree for the initial object control model according to a degree of fit between the target behavior and the attribute parameters corresponding to the object to be analyzed, wherein the reward feedback degree is positively correlated with the degree of fit;
[0199] Based on the degree of reward feedback, the model parameters corresponding to the initial object control model are adjusted to obtain the object control model, which is used to control the behavior of the object to be analyzed in the target program based on the scene parameters corresponding to the object to be analyzed in the target program.
[0200] In a possible implementation, the apparatus further includes a fourth determining unit:
[0201] The fourth determining unit is configured to determine a difference between an attribute parameter corresponding to the object to be analyzed and an attribute parameter corresponding to each non-player object included in the set of non-player objects;
[0202] The second determining unit 803 is specifically configured to:
[0203] If differences between the attribute parameters corresponding to the object to be analyzed and the attribute parameters corresponding to each non-player object included in the set of non-player objects are greater than a first preset threshold, the object to be analyzed is run in the target program based on the attribute parameters corresponding to the object to be analyzed to determine the behavior parameters corresponding to the object to be analyzed.
[0204] In a possible implementation, the apparatus further includes a second updating unit:
[0205] The second updating unit is configured to add the object to be analyzed to the set of non-player objects if differences between attribute parameters corresponding to the object to be analyzed and attribute parameters corresponding to each non-player object included in the set of non-player objects are greater than a first preset threshold, and if there is a non-player object in the set of non-player objects whose corresponding behavior style is consistent with the behavior style corresponding to the object to be analyzed.
[0206] In a possible implementation manner, the apparatus further includes a fifth determining unit:
[0207] The fifth determining unit is configured to determine predicted behavior parameters corresponding to the object to be analyzed based on attribute parameters corresponding to the object to be analyzed using a behavior parameter prediction model, wherein the behavior parameter prediction model is configured to predict behavior parameters corresponding to non-player objects in the target program based on attribute parameters corresponding to the non-player objects;
[0208] The fourth determining unit is specifically configured to:
[0209] If the differences between the predicted behavior parameters and the behavior parameters corresponding to each non-player object included in the non-player object set are greater than a second preset threshold, the object to be analyzed is run in the target program based on the attribute parameters corresponding to the object to be analyzed to determine the behavior parameters corresponding to the object to be analyzed.
[0210] In one possible implementation, the behavior parameter prediction model is trained in the following manner:
[0211] Obtaining a sample non-player object set, the sample non-player object set including a plurality of sample non-player objects, the plurality of sample non-player objects having corresponding attribute parameters and behavior parameters;
[0212] The plurality of sample non-player objects are respectively used as target sample objects, and the undetermined behavior parameters are determined according to the attribute parameters corresponding to the target sample objects through the initial behavior parameter prediction model;
[0213] According to the difference between the undetermined behavior parameter and the behavior parameter corresponding to the target sample object, the model parameters corresponding to the initial behavior parameter prediction model are adjusted to obtain the behavior parameter prediction model.
[0214] In a possible implementation, the behavior parameters include behavior parameters under a target behavior parameter dimension, and the behavior parameters under the target behavior parameter dimension are used to characterize a behavior style under a target behavior style dimension, and the target behavior style dimension has multiple behavior styles;
[0215] The first determining unit 801 is specifically configured to:
[0216] determining, based on behavior parameters corresponding to each non-player object included in the set of non-player objects, a plurality of objects to be processed from each non-player object included in the set of non-player objects, wherein the plurality of objects to be processed include non-player objects having different behavior styles corresponding to the target behavior style dimension;
[0217] The multiple objects to be processed are respectively determined as the target objects.
[0218] In a possible implementation, the first determining unit 801 is specifically configured to:
[0219] determining, based on the behavior parameters corresponding to the respective non-player objects included in the non-player object set, the number of non-player objects in the non-player object set corresponding to the plurality of behavior styles under the target behavior style dimension;
[0220] Based on the number of non-player objects in the non-player object set corresponding to multiple behavioral styles under the target behavioral style dimension, multiple objects to be processed are determined from each non-player object included in the non-player object set, the number of objects corresponding to the target behavioral style in the multiple objects to be processed is negatively correlated with the number of non-player objects corresponding to the target behavioral style in the non-player object set, and the target behavioral style is any behavioral style under the target behavioral style dimension.
[0221] In a possible implementation manner, the apparatus further includes a sixth determining unit:
[0222] The sixth determining unit is configured to determine a task execution success rate corresponding to each non-player object included in the set of non-player objects, wherein the task execution success rate is a success rate of the non-player object in executing a target task in the target program, wherein the target task is used to test the object capability of the non-player object;
[0223] The first determining unit 801 is specifically configured to:
[0224] Based on the behavioral parameters and task execution success rates corresponding to each non-player object included in the non-player object set, a plurality of objects to be processed are determined from each non-player object included in the non-player object set, and the task execution success rates corresponding to each of the plurality of objects to be processed are all greater than a third preset threshold.
[0225] In a possible implementation, the apparatus further includes an acquiring unit:
[0226] The acquisition unit is used to acquire an object construction request, wherein the object construction request is used to request construction of a non-player object corresponding to the behavior style dimension to be constructed;
[0227] The first determining unit 801 is specifically configured to:
[0228] The behavior style dimension to be constructed is determined as the target behavior style dimension, and based on the behavior parameters corresponding to the non-player objects included in the non-player object set, a plurality of objects to be processed are determined from the non-player objects included in the non-player object set.
[0229] In one possible implementation, the object construction task includes multiple rounds of object construction, the behavior parameters include multiple behavior parameter dimensions, and the behavior parameters under different behavior parameter dimensions represent different behavior style dimensions. The first determining unit 801 is specifically configured to:
[0230] During an i-th round of object construction in the multiple rounds of object construction, determining the target behavior parameter dimension from the multiple behavior parameter dimensions, where the target behavior parameter dimension is any part of the multiple behavior parameter dimensions, and i is a positive integer;
[0231] Determining a plurality of objects to be processed from the non-player objects included in the non-player object set based on behavior parameters corresponding to the non-player objects included in the non-player object set;
[0232] The device further includes a judgment unit and an execution unit:
[0233] The judgment unit is configured to judge whether the non-player objects included in the non-player object set meet the behavioral style requirements corresponding to the object construction task after completing the update of the non-player object set using the objects to be analyzed constructed by the i-th round of objects;
[0234] The execution unit is configured to execute the (i+1)th round of object construction in the multiple rounds of object construction if the condition is not satisfied.
[0235] In a possible implementation, the attribute parameter includes multiple attribute parameter dimensions, and the apparatus further includes a seventh determining unit:
[0236] The seventh determining unit is configured to determine, during the i-th round of object construction, a target attribute parameter dimension among the multiple attribute parameter dimensions, wherein the target attribute parameter dimension is any part of the multiple attribute parameter dimensions;
[0237] The generating unit 802 is specifically configured to:
[0238] By adding random disturbance to the attribute parameters under the target attribute parameter dimension corresponding to the target object, the attribute parameters corresponding to the object to be analyzed are generated.
[0239] In a possible implementation, the third determining unit 804 is specifically configured to:
[0240] determining, based on a behavior parameter corresponding to an object to be determined and parameter intervals corresponding to a plurality of behavior styles, a target parameter interval to which the behavior parameter corresponding to the object to be determined belongs, wherein the object to be determined is any one of the object to be analyzed and each non-player object included in the set of non-player objects, and different behavior styles correspond to different parameter intervals;
[0241] The behavior style corresponding to the target parameter interval is determined as the behavior style corresponding to the object to be determined.
[0242] In a possible implementation, the apparatus further includes an eighth determining unit and a dividing unit:
[0243] The eighth determining unit is configured to determine a behavior parameter boundary and an interval segment length based on the behavior parameters corresponding to each non-player object included in the set of non-player objects, wherein the behavior parameters within the total parameter interval formed by the behavior parameter boundary have a corresponding behavior style;
[0244] The division unit is used to divide the total parameter interval into parameter intervals corresponding to the multiple behavioral styles according to the behavioral parameter boundary and the interval segment length, and the interval segment length is the length between the interval starting points of two adjacent parameter intervals.
[0245] In one possible implementation, the behavior parameter corresponding to the target non-player object includes a plurality of behavior parameters, and a difference between the plurality of behavior parameters is used to characterize a fluctuation in the behavior parameter of the target non-player object in the target program. The target non-player object is any non-player object included in the set of non-player objects. The eighth determining unit is specifically configured to:
[0246] taking each non-player object included in the set of non-player objects as the target non-player object, and determining an average value and a variance of a plurality of behavior parameters corresponding to the target non-player object;
[0247] Determining an upper boundary of the parameter corresponding to the target non-player object based on a sum of the mean and the variance, and determining a lower boundary of the parameter corresponding to the target non-player object based on a difference between the mean and the variance;
[0248] The minimum value among the upper boundaries of the parameters corresponding to each non-player object included in the non-player object set is determined as the upper boundary of the parameters in the behavior parameter boundary, the minimum value among the lower boundaries of the parameters corresponding to each non-player object included in the non-player object set is determined as the lower boundary of the parameters in the behavior parameter boundary, and the minimum value among the variances corresponding to each non-player object included in the non-player object set is determined as the interval segment length.
[0249] The embodiment of the present application further provides a computer device, as shown in FIG9 , which may be a terminal device. For example, the terminal device is a mobile phone.
[0250] FIG9 is a block diagram showing a partial structure of a mobile phone related to a terminal device provided in an embodiment of the present application. Referring to FIG9 , the mobile phone includes components such as a radio frequency (RF) circuit 710, a memory 720, an input unit 730, a display unit 740, a sensor 750, an audio circuit 760, a wireless fidelity (WiFi) module 770, a processor 780, and a power supply 790. Those skilled in the art will appreciate that the mobile phone structure shown in FIG9 does not limit the mobile phone and may include more or fewer components than shown, or combine certain components, or arrange the components differently.
[0251] The following is a detailed introduction to the various components of the mobile phone in conjunction with Figure 9:
[0252] The RF circuit 710 can be used to receive and send signals during information transmission or calls. In particular, after receiving downlink information from the base station, it is sent to the processor 780 for processing; in addition, the designed uplink data is sent to the base station. Generally, the RF circuit 710 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (LNA), a duplexer, etc. In addition, the RF circuit 710 can also communicate with the network and other devices through wireless communication. The above-mentioned wireless communication can use any communication standard or protocol, including but not limited to Global System of Mobile communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Messaging Service (SMS), etc.
[0253] The memory 720 can be used to store software programs and modules. The processor 780 executes the various functional applications and data processing of the mobile phone by running the software programs and modules stored in the memory 720. The memory 720 can mainly include a program storage area and a data storage area. The program storage area can store an operating system and at least one application required for a function (such as a sound playback function, an image playback function, etc.); the data storage area can store data created based on the use of the mobile phone (such as audio data, a phone book, etc.). In addition, the memory 720 can include high-speed random access memory and non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage device.
[0254] The input unit 730 can be used to receive input digital or character information, and to generate key signal input related to the user settings and function control of the mobile phone. Specifically, the input unit 730 may include a touch panel 731 and other input devices 732. The touch panel 731, also known as a touch screen, can collect user touch operations on or near it (such as operations performed by the user using any suitable object or accessory such as a finger, stylus, etc. on or near the touch panel 731) and drive the corresponding connection device according to a pre-set program. Optionally, the touch panel 731 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch direction and detects the signal caused by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device and converts it into touch point coordinates, which are then sent to the processor 780. It can also receive commands sent by the processor 780 and execute them. In addition, the touch panel 731 can be implemented using various types such as resistive, capacitive, infrared and surface acoustic wave. In addition to the touch panel 731, the input unit 730 may further include other input devices 732. Specifically, the other input devices 732 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick.
[0255] The display unit 740 can be used to display information input by the user or information provided to the user and various menus of the mobile phone. The display unit 740 may include a display panel 741. Optionally, the display panel 741 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc. Further, the touch panel 731 may cover the display panel 741. When the touch panel 731 detects a touch operation on or near it, it is transmitted to the processor 780 to determine the type of touch event, and then the processor 780 provides a corresponding visual output on the display panel 741 according to the type of touch event. Although in Figure 9, the touch panel 731 and the display panel 741 are used as two independent components to realize the input and output functions of the mobile phone, in some embodiments, the touch panel 731 and the display panel 741 can be integrated to realize the input and output functions of the mobile phone.
[0256] The mobile phone may also include at least one sensor 750, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 741 according to the brightness of the ambient light, and the proximity sensor may turn off the display panel 741 and / or the backlight when the mobile phone is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in all directions (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that identify the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors that the mobile phone can also be configured with, such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., they will not be described here.
[0257] Audio circuit 760, speaker 761, and microphone 762 provide an audio interface between the user and the phone. Audio circuit 760 converts received audio data into electrical signals and transmits them to speaker 761, which then converts them into sound signals for output. Microphone 762, on the other hand, converts collected sound signals into electrical signals, which are then received by audio circuit 760 and converted into audio data. The audio data is then processed by processor 780 and transmitted to, for example, another phone via RF circuit 710, or stored in memory 720 for further processing.
[0258] WiFi is a short-range wireless transmission technology. A mobile phone uses WiFi module 770 to help users send and receive emails, browse the web, and access streaming media, providing wireless broadband internet access. Although FIG9 illustrates WiFi module 770, it is understood that it is not a required component of the mobile phone and can be omitted as needed without changing the essence of the invention.
[0259] Processor 780 is the control center of the phone, connecting all parts of the phone using various interfaces and circuits. By running or executing software programs and / or modules stored in memory 720 and accessing data stored in memory 720, it performs various phone functions and processes data, thereby performing overall phone testing. Optionally, processor 780 may include one or more processing units; preferably, processor 780 may integrate an application processor and a modem processor, where the application processor primarily handles the operating system, user interface, and application programs, while the modem processor primarily handles wireless communications. It is understood that the modem processor may not be integrated into processor 780.
[0260] The mobile phone also includes a power supply 790 (such as a battery) for supplying power to various components. Preferably, the power supply can be logically connected to the processor 780 through a power management system, thereby managing charging, discharging, and power consumption management functions through the power management system.
[0261] Although not shown, the mobile phone may also include a camera, a Bluetooth module, etc., which will not be described in detail here.
[0262] In this embodiment, the processor 780 included in the terminal device is also used to execute the object construction method provided in the embodiment of the present application.
[0263] The embodiment of the present application also provides a server, as shown in Figure 10, which is a structural diagram of the server 800 provided in the embodiment of the present application. The server 800 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPUs) 822 (for example, one or more processors) and a memory 832, and one or more storage media 830 (for example, one or more mass storage devices) for storing application programs 842 or data 844. Among them, the memory 832 and the storage medium 830 can be temporary storage or permanent storage. The program stored in the storage medium 830 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server. Furthermore, the central processing unit 822 can be configured to communicate with the storage medium 830 to execute a series of instruction operations in the storage medium 830 on the server 800.
[0264] The server 800 may also include one or more power supplies 826, one or more wired or wireless network interfaces 850, one or more input and output interfaces 858, and / or one or more operating systems 841, such as Windows Server 2000. TM , Mac OS X TM , Unix TM ,Linux TM , FreeBSD TM etc.
[0265] The steps executed by the server in the above embodiment may be based on the server structure shown in FIG10 .
[0266] An embodiment of the present application further provides a computer-readable storage medium for storing a computer program, wherein the computer program is used to execute any one of the object construction methods described in the aforementioned embodiments.
[0267] An embodiment of the present application further provides a computer program product including a computer program, which, when executed on a computer device, enables the computer device to execute the object construction method described in any one of the above embodiments.
[0268] It is understandable that in the specific implementation of this application, related data such as user information (such as behavioral parameters obtained by testing the interaction between NPC and user in the game program) is involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0269] Those skilled in the art will understand that all or part of the steps of implementing the above-mentioned method embodiment can be completed by hardware related to program instructions, and the above-mentioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiment; and the above-mentioned storage medium can be at least one of the following media: read-only memory (English: read-only memory, abbreviated: ROM), RAM, magnetic disk or optical disk, etc., various media that can store program codes.
[0270] It should be noted that the various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments. The device and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. A person of ordinary skill in the art can understand and implement it without expending creative work.
[0271] The above is merely one specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.
Claims
1. A method for constructing an object, executed by a computer device, the method comprising: Determining a target object from non-player objects included in the non-player object set, the non-player object having attribute parameters and behavior parameters, the attribute parameters being used to control the behavior of the non-player object in the target program, the behavior parameters being determined based on the behavior of the non-player object in the target program, and the behavior parameters being used to characterize the behavior style of the non-player object in the target program; By adding disturbance to the attribute parameters corresponding to the target object, the attribute parameters corresponding to the object to be analyzed are generated; According to the attribute parameters corresponding to the object to be analyzed, the object to be analyzed is run in the target program to determine the behavior parameters corresponding to the object to be analyzed; Determining whether the behavior style corresponding to the object to be analyzed is consistent with the behavior style corresponding to each of the non-player objects included in the non-player object set, according to the behavior parameters corresponding to the object to be analyzed and the behavior parameters corresponding to each of the non-player objects included in the non-player object set; When the behavior style corresponding to the object to be analyzed is inconsistent with the behavior styles corresponding to each of the non-player objects included in the non-player object set, the object to be analyzed is added to the non-player object set.
2. The method according to claim 1, wherein the step of running the object to be analyzed in the target program according to the attribute parameters corresponding to the object to be analyzed and determining the behavior parameters corresponding to the object to be analyzed comprises: According to the attribute parameters corresponding to the object to be analyzed, the initial object control model is reinforced to obtain the object control model corresponding to the object to be analyzed, and the object control model is used to control the behavior of the object to be analyzed in the target program; The object to be analyzed is run in the target program through the object control model to determine the behavior parameters corresponding to the object to be analyzed.
3. The method according to claim 1 or 2, wherein the initial object control model is reinforced learned according to the attribute parameters corresponding to the object to be analyzed to obtain the object control model corresponding to the object to be analyzed, comprising: Acquire a scene parameter corresponding to the object to be analyzed in the target program, wherein the scene parameter is used to identify a behavior scene corresponding to the object to be analyzed in the target program; Determining behavior control parameters based on the scenario parameters through the initial object control model, wherein the behavior control parameters are used to control the object to be analyzed to perform a target behavior in the behavior scenario; Determining a reward feedback degree for the initial object control model according to a fit degree between the target behavior and the attribute parameters corresponding to the object to be analyzed, wherein the reward feedback degree is positively correlated with the fit degree; Based on the degree of reward feedback, the model parameters corresponding to the initial object control model are adjusted to obtain the object control model, and the object control model is used to control the behavior of the object to be analyzed in the target program based on the scene parameters corresponding to the object to be analyzed in the target program.
4. The method according to any one of claims 1 to 3, further comprising: Determine the difference between the attribute parameter corresponding to the object to be analyzed and the attribute parameter corresponding to each of the non-player objects included in the non-player object set; The step of running the object to be analyzed in the target program according to the attribute parameters corresponding to the object to be analyzed to determine the behavior parameters corresponding to the object to be analyzed includes: If differences between the attribute parameters corresponding to the object to be analyzed and the attribute parameters corresponding to each of the non-player objects included in the non-player object set are greater than a first preset threshold, the object to be analyzed is run in the target program according to the attribute parameters corresponding to the object to be analyzed to determine the behavior parameters corresponding to the object to be analyzed.
5. The method according to any one of claims 1 to 4, further comprising: If differences between the attribute parameters corresponding to the object to be analyzed and the attribute parameters corresponding to each of the non-player objects included in the non-player object set are greater than a first preset threshold, and there are non-player objects in the non-player object set whose corresponding behavior style is consistent with the behavior style corresponding to the object to be analyzed, the object to be analyzed is added to the non-player object set.
6. The method according to any one of claims 1 to 5, further comprising: Determining predicted behavior parameters corresponding to the object to be analyzed according to the attribute parameters corresponding to the object to be analyzed by a behavior parameter prediction model, wherein the behavior parameter prediction model is used to predict the behavior parameters corresponding to the non-player object in the target program based on the attribute parameters corresponding to the non-player object; The step of running the object to be analyzed in the target program according to the attribute parameters corresponding to the object to be analyzed to determine the behavior parameters corresponding to the object to be analyzed includes: If the differences between the predicted behavior parameters and the behavior parameters corresponding to each of the non-player objects included in the non-player object set are greater than a second preset threshold, the object to be analyzed is run in the target program according to the attribute parameters corresponding to the object to be analyzed to determine the behavior parameters corresponding to the object to be analyzed.
7. According to the method according to any one of claims 1 to 6, the behavior parameter prediction model is trained by: Acquire a sample non-player object set, wherein the sample non-player object set includes a plurality of sample non-player objects, and the plurality of sample non-player objects have corresponding attribute parameters and behavior parameters; The plurality of sample non-player objects are respectively used as target sample objects, and the undetermined behavior parameters are determined according to the attribute parameters corresponding to the target sample objects through the initial behavior parameter prediction model; According to the difference between the undetermined behavior parameter and the behavior parameter corresponding to the target sample object, the model parameters corresponding to the initial behavior parameter prediction model are adjusted to obtain the behavior parameter prediction model.
8. The method according to any one of claims 1 to 7, wherein the behavior parameters include behavior parameters under a target behavior parameter dimension, the behavior parameters under the target behavior parameter dimension are used to characterize a behavior style under a target behavior style dimension, and the target behavior style dimension has multiple behavior styles; The step of determining the target object from the non-player objects included in the non-player object set includes: Based on the behavior parameters respectively corresponding to the non-player objects included in the non-player object set, a plurality of objects to be processed are determined from the non-player objects included in the non-player object set, wherein the plurality of objects to be processed include non-player objects with different behavior styles corresponding to the target behavior style dimension; The multiple objects to be processed are respectively determined as the target objects.
9. The method according to any one of claims 1 to 8, wherein the step of determining a plurality of objects to be processed from each of the non-player objects included in the non-player object set based on the behavior parameters respectively corresponding to each of the non-player objects included in the non-player object set comprises: Based on the behavior parameters respectively corresponding to the non-player objects included in the non-player object set, determining the number of non-player objects in the non-player object set respectively corresponding to the multiple behavior styles under the target behavior style dimension; Based on the number of non-player objects in the non-player object set respectively corresponding to multiple behavior styles under the target behavior style dimension, multiple objects to be processed are determined from each of the non-player objects included in the non-player object set, the number of objects corresponding to the target behavior style in the multiple objects to be processed is negatively correlated with the number of non-player objects corresponding to the target behavior style in the non-player object set, and the target behavior style is any behavior style under the target behavior style dimension.
10. The method according to any one of claims 1 to 9, further comprising: Determine a task execution success rate corresponding to each of the non-player objects included in the non-player object set, wherein the task execution success rate is a success rate of the non-player object executing a target task in the target program, wherein the target task is used to test the object capability of the non-player object; The determining a plurality of objects to be processed from each of the non-player objects included in the non-player object set based on the behavior parameters respectively corresponding to each of the non-player objects included in the non-player object set comprises: Based on the behavior parameters and task execution success rates respectively corresponding to each of the non-player objects included in the non-player object set, a plurality of objects to be processed are determined from the non-player objects included in the non-player object set, and the task execution success rates respectively corresponding to the plurality of objects to be processed are all greater than a third preset threshold.
11. The method according to any one of claims 1 to 10, further comprising: Obtaining an object construction request, wherein the object construction request is used to request construction of a non-player object corresponding to a behavior style dimension to be constructed; The determining a plurality of objects to be processed from each of the non-player objects included in the non-player object set based on the behavior parameters respectively corresponding to each of the non-player objects included in the non-player object set comprises: The behavior style dimension to be constructed is determined as the target behavior style dimension, and based on the behavior parameters respectively corresponding to each of the non-player objects included in the non-player object set, a plurality of objects to be processed are determined from each of the non-player objects included in the non-player object set.
12. The method according to any one of claims 1 to 11, wherein the object construction task includes multiple rounds of object construction, the behavior parameter includes multiple behavior parameter dimensions, and the behavior parameters under different behavior parameter dimensions represent different behavior style dimensions, and the determining of multiple objects to be processed from each of the non-player objects included in the non-player object set based on the behavior parameters corresponding to each of the non-player objects included in the non-player object set comprises: During the i-th round of object construction in the multiple rounds of object construction, the target behavior parameter dimension is determined from the multiple behavior parameter dimensions, the target behavior parameter dimension is any part of the multiple behavior parameter dimensions, and i is a positive integer; Determining a plurality of objects to be processed from the non-player objects included in the non-player object set based on the behavior parameters respectively corresponding to the non-player objects included in the non-player object set; The method further comprises: After completing the update of the non-player object set by using the objects to be analyzed constructed by the i-th round of objects, determining whether the non-player objects included in the non-player object set meet the behavior style requirements corresponding to the object construction task; If not satisfied, the i+1th round of object construction in the multiple rounds of object construction is executed.
13. The method according to any one of claims 1 to 12, wherein the attribute parameter comprises a plurality of attribute parameter dimensions, and the method further comprises: During the i-th round of object construction, a target attribute parameter dimension among the multiple attribute parameter dimensions is determined, where the target attribute parameter dimension is any part of the attribute parameter dimensions among the multiple attribute parameter dimensions; The generating the attribute parameters corresponding to the object to be analyzed by adding disturbance to the attribute parameters corresponding to the target object includes: By adding random disturbance to the attribute parameters under the target attribute parameter dimension corresponding to the target object, the attribute parameters corresponding to the object to be analyzed are generated.
14. The method according to any one of claims 1 to 13, wherein determining whether the behavior style corresponding to the object to be analyzed is consistent with the behavior style corresponding to each of the non-player objects included in the non-player object set based on the behavior parameters corresponding to the object to be analyzed and the behavior parameters corresponding to each of the non-player objects included in the non-player object set comprises: Determining a target parameter interval to which the behavior parameter corresponding to the object to be determined belongs according to the behavior parameter corresponding to the object to be determined and the parameter intervals corresponding to the plurality of behavior styles, wherein the object to be determined is any one of the non-player objects included in the object to be analyzed and the non-player object set, and different behavior styles correspond to different parameter intervals; The behavior style corresponding to the target parameter interval is determined as the behavior style corresponding to the object to be determined.
15. The method according to any one of claims 1 to 14, further comprising: Based on the behavior parameters corresponding to each of the non-player objects included in the non-player object set, determining the behavior parameter boundary and the interval segment length, the behavior parameters in the total parameter interval formed by the behavior parameter boundary have the corresponding behavior style; The total parameter interval is divided into parameter intervals corresponding to the plurality of behavior styles respectively according to the behavior parameter boundary and the interval segment length, and the interval segment length is the length between the interval starting points of two adjacent parameter intervals.
16. The method according to any one of claims 1 to 15, wherein the behavior parameter corresponding to the target non-player object includes a plurality of behavior parameters, the difference between the plurality of behavior parameters is used to characterize the behavior parameter fluctuation of the target non-player object in the target program, the target non-player object is any one of the non-player objects included in the non-player object set, and the determining the behavior parameter boundary and the interval segment length based on the behavior parameters corresponding to each of the non-player objects included in the non-player object set comprises: Taking each of the non-player objects included in the non-player object set as the target non-player object, and determining average values and variances of multiple behavior parameters corresponding to the target non-player object; Determining an upper boundary of a parameter corresponding to the target non-player object based on a sum of the mean value and the variance, and determining a lower boundary of a parameter corresponding to the target non-player object based on a difference between the mean value and the variance; The minimum value among the upper boundaries of the parameters corresponding to each of the non-player objects included in the non-player object set is determined as the upper boundary of the parameters in the behavior parameter boundary, the minimum value among the lower boundaries of the parameters corresponding to each of the non-player objects included in the non-player object set is determined as the lower boundary of the parameters in the behavior parameter boundary, and the minimum value among the variances corresponding to each of the non-player objects included in the non-player object set is determined as the interval segment length.
17. An object construction device, comprising a first determining unit, a generating unit, a second determining unit, a third determining unit and a first updating unit: The first determination unit is used to determine a target object from non-player objects included in the non-player object set, the non-player object having attribute parameters and behavior parameters, the attribute parameters being used to control the behavior of the non-player object in the target program, the behavior parameters being determined based on the behavior of the non-player object in the target program, and the behavior parameters being used to characterize the behavior style of the non-player object in the target program; The generating unit is used to generate the attribute parameters corresponding to the object to be analyzed by adding disturbances to the attribute parameters corresponding to the target object; The second determining unit is used to run the object to be analyzed in the target program according to the attribute parameters corresponding to the object to be analyzed, and determine the behavior parameters corresponding to the object to be analyzed; The third determination unit is used to determine whether the behavior style corresponding to the object to be analyzed is consistent with the behavior style corresponding to each of the non-player objects included in the non-player object set according to the behavior parameters corresponding to the object to be analyzed and the behavior parameters corresponding to each of the non-player objects included in the non-player object set; The first updating unit is configured to add the object to be analyzed to the set of non-player objects when the behavior style corresponding to the object to be analyzed is inconsistent with the behavior styles corresponding to each of the non-player objects included in the set of non-player objects.
18. A computer device, comprising a processor and a memory: The memory is used to store a computer program and transmit the computer program to the processor; The processor is configured to execute the object construction method according to any one of claims 1 to 16 according to the instructions in the computer program.
19. A computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, wherein the computer program is used to execute the object construction method according to any one of claims 1 to 16.
20. A computer program product comprising a computer program, which, when executed on a computer device, enables the computer device to execute the object construction method according to any one of claims 1 to 16.