Non-player character model determination method and device, electronic equipment and storage medium

Optimizing the NPC model by collecting game environment status data solves the problems of poor NPC anthropomorphism and dependence on player data in the existing technology, achieves efficient and realistic NPC model training, and reduces dependence on player data.

CN118662909APending Publication Date: 2024-09-20NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202310267119.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-14
Publication Date
2024-09-20

AI Technical Summary

Technical Problem

In the existing technology, NPC models have poor anthropomorphic effects and are highly dependent on player data, resulting in insufficient comprehensive performance of NPCs generated by training, and uneven data distribution resulting in low generalization.

Method used

By collecting the game environment state data set, inputting the initial NPC model to generate execution actions, and optimizing the model based on performance and anthropomorphic evaluation results, the target NPC model is generated to avoid reliance on historical player data, and use performance evaluation and anthropomorphic evaluation to jointly supervise the model. train.

Benefits of technology

It has realized an NPC model with anthropomorphic effect while ensuring competitive performance, improving the authenticity of the NPC model and the efficiency of training sample set generation, and reducing the dependence on player data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118662909A
    Figure CN118662909A
Patent Text Reader

Abstract

The invention provides a non-player character model determination method and device, electronic equipment and a storage medium, and relates to the technical field of neural networks. According to the method, training of the model is jointly supervised through the performance evaluation result and the anthropomorphic evaluation result, so that the obtained target non-player model can have an anthropomorphic effect while the competitive performance is ensured, and the authenticity of the non-player character model is improved. The generation of the anthropomorphic training sample set can be obtained only by labeling the track sequence generated by the NPC model by partial personnel, and anthropomorphic behavior learning of the NPC model can be realized based on the generated anthropomorphic training sample set. According to the method, the generation efficiency of the training sample set can be greatly improved, a large amount of player data does not need to be collected in advance, and excessive dependence on the player data is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of neural network technology, and in particular to a method, device, electronic device and storage medium for determining a non-player character model. Background Art

[0002] NPC (non-player character) is a type of role in the game, which refers to the game characters in electronic games that are not controlled by real players. Since NPC needs to interact with player characters in the game scene to promote the execution of the game, it is particularly important to train NPC anthropomorphism.

[0003] In the existing technology, most people use imitation learning to generate NPC anthropomorphic strategies. By filtering out the required sample data from the players' historical game data and modeling the NPC's state and action based on the sample data, imitation learning will perform state-to-action mapping learning through supervised learning to achieve NPC anthropomorphic strategy learning.

[0004] However, existing imitation learning has a strong dependence on player data. Due to the uneven distribution of player data, the performance of the NPCs generated by training is not comprehensive enough and the anthropomorphism effect is not good. Summary of the invention

[0005] The purpose of this application is to provide a method, device, electronic device and storage medium for determining a non-player character model in order to solve the problem of poor anthropomorphic effect of NPC models in the prior art.

[0006] To achieve the above purpose, the technical solution adopted in the embodiment of the present application is as follows:

[0007] In a first aspect, an embodiment of the present application provides a method for determining a non-player character model, comprising:

[0008] Collect game environment status data set;

[0009] Inputting the game environment state data set into an initial non-player role model, and the initial non-player role model generates an execution action corresponding to the game environment state information at each moment according to the game environment state information at each moment in the game environment state data set;

[0010] According to the execution actions corresponding to the game environment state information at each moment, the output performance evaluation results and the anthropomorphic evaluation results of the initial non-player character model are obtained;

[0011] According to the performance evaluation result and the anthropomorphism evaluation result of the initial non-player character model, the initial non-player character model is optimized to obtain a target non-player character model.

[0012] In a second aspect, an embodiment of the present application further provides a device for determining a non-player character model, including: a collection module, a generation module, an acquisition module, and a training module;

[0013] The acquisition module is used to collect a game environment status data set;

[0014] The generating module is used to input the game environment state data set into an initial non-player role model, and the initial non-player role model generates an execution action corresponding to the game environment state information at each moment according to the game environment state information at each moment in the game environment state data set;

[0015] The acquisition module is used to acquire the output performance evaluation result and anthropomorphic evaluation result of the initial non-player role model according to the corresponding execution action under the game environment state information at each moment;

[0016] The training module is used to optimize the initial non-player character model according to the performance evaluation result and the anthropomorphism evaluation result of the initial non-player character model to obtain a target non-player character model.

[0017] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor. When the electronic device is running, the processor and the storage medium communicate through the bus, and the processor executes the machine-readable instructions to perform the steps of the method for determining a non-player character model provided in the first aspect.

[0018] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the method for determining a non-player character model provided in the first aspect are executed.

[0019] The beneficial effects of this application are:

[0020] The present application provides a method, device, electronic device and storage medium for determining a non-player role model. The execution action corresponding to the game environment state information at each moment and the game environment state information at each moment generated by the initial non-player role model can be evaluated for performance and anthropomorphism, and the performance evaluation results and anthropomorphism evaluation results of the execution action corresponding to the game environment state information at each moment are obtained respectively, so as to optimize the initial non-player role model in combination with the performance evaluation results and the anthropomorphism evaluation results to obtain the target non-player role model. Since the execution action is generated in real time through the collected game environment state information, and the game environment state information does not depend on the historical player data, it can be constructed in real time, thereby getting rid of the dependence of the training of the non-player role model on the historical player data, and avoiding the problem of low generalization of the model training results caused by the uneven distribution of historical player data. In addition, the training of the model is supervised by the performance evaluation results and the anthropomorphism evaluation results together, so that the obtained target non-player model can have anthropomorphism effect while ensuring the competitive performance, thereby improving the authenticity of the non-player role model.

[0021] Secondly, the generation of anthropomorphic training sample sets only requires some personnel to annotate the trajectory sequences generated by the NPC model, and the anthropomorphic behavior learning of the NPC model can be realized based on the generated anthropomorphic training sample sets. Compared with the method of obtaining training sample sets based on collected historical player data, this method can not only greatly improve the efficiency of generating training sample sets, but also does not require the prior collection of a large amount of player data, thus avoiding excessive reliance on player data.

[0022] In addition, the anthropomorphic strategy improvement scheme based on curriculum iteration iteratively updates the anthropomorphic training sample set, thereby achieving iterative optimization of the anthropomorphic reward network, which can guide the training to generate an NPC model with high-quality anthropomorphic behavior. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0024] Figure 1 A flowchart of a method for determining a non-player character model provided in an embodiment of the present application;

[0025] Figure 2 A schematic flow chart of another method for determining a non-player character model provided in an embodiment of the present application;

[0026] Figure 3 A flowchart of another method for determining a non-player character model provided in an embodiment of the present application;

[0027] Figure 4 A schematic diagram of a network model architecture provided for an embodiment of the present application;

[0028] Figure 5 A schematic flow chart of another method for determining a non-player character model provided in an embodiment of the present application;

[0029] Figure 6 A flowchart of another method for determining a non-player character model provided in an embodiment of the present application;

[0030] Figure 7 A schematic flow chart of another method for determining a non-player character model provided in an embodiment of the present application;

[0031] Figure 8 A schematic diagram of a device for determining a non-player character model provided in an embodiment of the present application;

[0032] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0033] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the drawings in the present application only serve the purpose of explanation and description and are not used to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn in real proportion. The flowchart used in this application shows the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowchart can be implemented out of sequence, and the steps without logical context can be reversed in order or implemented simultaneously. In addition, those skilled in the art can add one or more other operations to the flowchart under the guidance of the content of the present application, or remove one or more operations from the flowchart.

[0034] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.

[0035] It should be noted that the term "comprising" will be used in the embodiments of the present application to indicate the existence of the features declared thereafter, but does not exclude the addition of other features.

[0036] First, the relevant background technology of this method is described:

[0037] At present, most existing methods use imitation learning to generate anthropomorphic strategies for NPCs. The overall process can be divided into four sub-processes: data collection, data cleaning, state-action modeling, and model training. In the data collection process, in order to meet the needs of state and action modeling, researchers will write specific scripts to collect game data of players of various segments and levels as completely as possible. Subsequently, researchers will screen and filter player data according to scene requirements, which can be specifically divided into two parts: data initial screening and targeted data filtering. Data initial screening will eliminate low-quality player data in abnormal situations such as player disconnection and midway exit. Targeted data filtering will perform specific data filtering based on actual task requirements. For example, when the task requirement is to generate an anthropomorphic strategy for a specific NPC character, the player data of other characters will be eliminated; when the task requirement is to generate a high-intensity NPC strategy, only high-segment or highly competitive player data will be retained. In order to reduce the learning complexity of NPC strategies, the state-action modeling process usually simplifies the state characteristics and action characteristics of NPCs. For example, in actual game scenarios, players can move in all directions, which is a continuous action, but action modeling usually divides the actual movement action into multiple discrete actions in fixed sectors. After completing state-action modeling, imitation learning will learn the mapping from state to action through supervised learning, that is, anthropomorphic strategy learning.

[0038] Although the existing imitation learning technology can realize the generation of anthropomorphic NPCs to a certain extent, due to its strong data dependence, it still has obvious problems and shortcomings in the actual game field.

[0039] (1) The anthropomorphic NPC strategy based on imitation learning has obvious lags: Different from many fields, the game itself has unique version update properties. For example, when certain specific versions are updated, the attributes and skills of the NPCs have extremely obvious changes. This makes it difficult to deploy previously trained NPC strategies and difficult to effectively use previously collected player data. For this reason, player data collection and anthropomorphic model training can only be carried out again after the game version is launched, which makes the actual launch of the anthropomorphic NPC strategy slower than the launch of the game by weeks or even months.

[0040] (2) NPC data is unevenly distributed, making it difficult to generate complete NPC anthropomorphic strategies: Multiplayer online role-playing games, multiplayer online tactical competitive games, and other types of games often have relatively rich and complex character systems. Players often do not master all NPC characters in actual gameplay, and usually only use one or a few specific NPC characters. This results in an uneven distribution of NPC data during data collection. Due to the strong data dependence of imitation learning technology, NPC models with less player data are difficult to train effectively.

[0041] (3) The uneven distribution of player levels makes it difficult to ensure the generation of highly competitive NPC personified strategies: In many competitive games, there are very obvious differences in the playing methods and styles of players of different levels and levels. For this reason, it is necessary to design different personified NPCs for players of different levels. However, the actual distribution of players is extremely uneven, that is, more than 90% of the players are maintained in a relatively mid-level segmentation range, and the number of high-level players is relatively small. This makes it difficult for imitation learning to effectively obtain sufficient high-level player data, making it difficult to generate highly competitive personified NPC strategies.

[0042] Based on the above problems, this technical solution mainly solves how to avoid excessive reliance on player data in the generation of NPC anthropomorphic behavior, which makes it impossible to achieve anthropomorphic NPC strategy generation when the data volume and data quality are insufficient. Specifically, the present invention will overcome the following difficulties:

[0043] (1) Generation of NPC anthropomorphic training data not based on player data: Due to the lag of player data and the uneven distribution of data, it is difficult to effectively apply actual player data to the generation of anthropomorphic NPC strategies in a timely manner. However, actual anthropomorphic data plays a vital role in the generation of NPC anthropomorphic behaviors. To this end, a scheme for generating anthropomorphic data not based on human player data is provided;

[0044] (2) Efficient anthropomorphic NPC training strategy: Traditional NPC anthropomorphic behavior generation algorithms often only imitate player behavior, which may lead to problems such as insufficient competitiveness of the imitated NPC. To this end, traditional methods also need to reshape NPC behavior (by writing rules or introducing reinforcement learning, etc.). Therefore, an anthropomorphic NPC training algorithm is provided under the premise of ensuring NPC competitiveness and other characteristics.

[0045] (3) NPC anthropomorphism progressive iterative optimization: Due to the invariance of player data in a specific version, existing anthropomorphic algorithms can only be optimized for that version. This makes it difficult to iterate the algorithm, and it can usually only be done by re-collecting online data. To this end, an iterative anthropomorphic optimization solution is provided.

[0046] The method steps of this solution are described below through specific embodiments:

[0047] Figure 1 A flowchart of a method for determining a non-player role model provided in an embodiment of the present application; the execution subject of the method may be a computer, a server or other device, such as Figure 1 As shown, the method may include:

[0048] S101, collecting game environment status data set.

[0049] Optionally, the game environment state data set may include game environment state information at different moments, where the different moments may be consecutive moments.

[0050] Game environment status information may refer to the characteristics of the game environment itself and some attribute information assigned to game characters (hereinafter referred to as NPCs) by the system, such as map information, weather information in the game scene, terrain information, etc. The character's attribute information may include: the character's health limit, the character's skills, and the character's skill cooling status, etc.

[0051] It is worth noting that the game environment status information is not changed by player operations. It is different from player data. Player data refers to the data generated by the player when controlling the character to execute the game, such as: consumption data generated by the player controlling the character to purchase props, combat data generated by the player controlling the character to execute combat, etc.

[0052] S102, inputting the game environment state data set into the initial non-player role model, and the initial non-player role model generates corresponding execution actions under the game environment state information at each moment according to the game environment state information at each moment in the game environment state data set.

[0053] Usually, the NPC will perform corresponding actions under different game environment states. For example, if the game environment state information is: move forward, then the NPC will perform the action of moving forward; or if the game environment state information is: reduce the target virtual character's health by 5 drops, then the NPC will perform an attack action on the target virtual character, and the attack intensity of the attack action is to reduce the target virtual character's health by 5 drops.

[0054] That is, the NPC model will execute and output the execution actions corresponding to the game environment status data based on the input game environment status data.

[0055] Then, the above-mentioned game environment state data set is input into the initial NPC model, and the initial NPC model can output the corresponding execution actions under the game environment state information at each moment.

[0056] The initial NPC model may be a pre-built NPC model that can only guarantee basic behaviors.

[0057] S103, obtaining the performance evaluation result and the anthropomorphic evaluation result of the output initial non-player role model according to the corresponding execution action under the game environment state information at each moment.

[0058] In some embodiments, based on the corresponding execution actions under the game status information at each moment, the game competitive performance and degree of anthropomorphism of the initial NPC model can be evaluated. For each moment, the consistency between the competitive performance of the execution action corresponding to the game status information at that moment and the competitive performance of the target execution action under the game status information at that moment can be judged. The higher the consistency, the higher the performance of the initial NPC model. Similarly, the degree of anthropomorphism of the execution action can also be judged to obtain an anthropomorphism evaluation result.

[0060] Among them, the anthropomorphism evaluation result can refer to the degree to which the NPC model performs game actions like a human, while the performance evaluation result can refer to the intensity of the NPC model when performing game actions, that is, the strength of its competitive performance and combat effectiveness.

[0061] S104: Optimize the initial non-player character model according to the performance evaluation result and the anthropomorphism evaluation result of the initial non-player character model to obtain a target non-player character model.

[0062] In some embodiments, the initial NPC model can be optimized based on the performance evaluation results and the anthropomorphic evaluation results of the initial NPC model obtained as described above. By combining the performance evaluation and the anthropomorphic evaluation to optimize the initial NPC model, the obtained target NPC model can satisfy the anthropomorphic characteristics while having competitive performance, thereby improving the authenticity of the generated NPC model.

[0063] Optionally, when the non-role player model pre-trained based on the present method is placed in a game scene to perform game operations, the execution actions it outputs have good performance both in terms of the degree of anthropomorphism and in terms of combat effectiveness and competitive performance.

[0064] In summary, the method for determining the non-player role model provided in this embodiment can perform performance and anthropomorphic evaluations on the execution actions corresponding to the game environment state information at each moment generated by the initial non-player role model, and obtain the performance evaluation results and anthropomorphic evaluation results of the execution actions corresponding to the game environment state information at each moment, respectively, so as to optimize the initial non-player role model in combination with the performance evaluation results and the anthropomorphic evaluation results, and obtain the target non-player role model. Since the execution actions are generated in real time through the collected game environment state information, and the game environment state information does not depend on the historical player data, it can be constructed in real time, thereby getting rid of the dependence of the training of the non-player role model on the historical player data, and avoiding the problem of low generalization of the model training results caused by the uneven distribution of historical player data. In addition, the training of the model is jointly supervised by the performance evaluation results and the anthropomorphic evaluation results, so that the obtained target non-player model can have anthropomorphic effects while ensuring competitive performance, thereby improving the authenticity of the non-player role model.

[0065] Figure 2 A flowchart of another method for determining a non-player character model provided by an embodiment of the present application; optionally, in step S102, before the initial non-player character model generates an execution action according to the game environment state information at each moment in the game environment state data set, the method may include:

[0066] S201, collecting mapping relationships between multiple sets of game environment state information and execution actions.

[0067] In one feasible manner, based on a reinforcement learning method, the mapping relationship between multiple sets of game environment state information and execution actions can be obtained by collecting interaction data between NPCs and the game environment in historical game data.

[0068] In one implementation, the behavior rules of the NPC may also be constructed based on the behavior tree. The behavior rules may include: a mapping relationship between game environment state information and execution actions, that is, the behavior rules may specify what actions the NPC performs under what game environment state information.

[0069] S202: construct an initial non-player role model according to the mapping relationship between each game environment state information and the execution action.

[0070] Then, based on the mapping relationship between the game environment status information and the execution actions obtained above, an initial NPC model can be constructed, wherein the initial NPC model can only guarantee basic behaviors and does not have anthropomorphism.

[0071] Optionally, in step S103, obtaining the performance evaluation results and the anthropomorphic evaluation results of the output initial non-player character model may include: inputting the execution actions corresponding to the generated game environment status information at each moment into the performance evaluator and the anthropomorphic evaluator, respectively, and obtaining the performance evaluation results of the initial non-player character model output by the performance evaluator under the game environment status information at each moment, and the anthropomorphic evaluation results of the initial non-player character model output by the anthropomorphic evaluator under the game environment status information at each moment.

[0072] In some embodiments, the initial NPC model, the performance discriminator, and the anthropomorphism discriminator may be different units in the same network model, and the output of the initial NPC model may be used as the input of the performance discriminator and the anthropomorphism discriminator.

[0073] Optionally, the execution actions corresponding to the game environment status information at each moment generated above and the game environment status information at each moment are respectively input into the performance evaluator and the personification evaluator, and the performance evaluation results output by the performance evaluator and the personification evaluation results output by the personification evaluator can be obtained respectively.

[0074] Among them, both the performance evaluator and the anthropomorphic evaluator can be pre-trained discriminators with basic discriminative functions.

[0075] A performance evaluation result and an anthropomorphic evaluation result can be obtained correspondingly under different game environment status information.

[0076] Optionally, in step S104, optimizing the initial non-player character model according to the performance evaluation result and the anthropomorphic evaluation result of the initial non-player character model to obtain a target non-player character model may include: optimizing the initial non-player character model according to the performance evaluation result and the anthropomorphic evaluation result of the initial non-player character model and the anthropomorphic reward output by the anthropomorphic reward network generated by training with the anthropomorphic training sample set to obtain the target non-player character model.

[0077] In some embodiments, an anthropomorphic reward network can also be introduced. The anthropomorphic reward network can output an anthropomorphic reward corresponding to the execution action according to the degree of anthropomorphism of the execution action output by the NPC. The higher the degree of anthropomorphism, the higher the corresponding anthropomorphic reward. The anthropomorphic reward generated by the anthropomorphic reward network guides the calculation of the anthropomorphic loss function, which can be used to optimize the anthropomorphic characteristics of the NPC model.

[0078] Among them, the anthropomorphic reward network can be trained and generated according to the collected anthropomorphic training sample set, and the anthropomorphic reward network can perform anthropomorphic judgment on the execution actions generated by the NPC model under the game environment state information at any time, and output the judgment result, which may include: the anthropomorphic reward corresponding to the execution action.

[0079] Then, based on the performance evaluation results and anthropomorphic evaluation results of the initial NPC model, as well as the anthropomorphic rewards output by the anthropomorphic reward network, the initial NPC model can be optimized to obtain the target NPC model.

[0080] The target NPC model obtained by jointly optimizing the performance evaluator, the anthropomorphic evaluator and the anthropomorphic reward network can guide the NPC to generate anthropomorphic behaviors while ensuring the competitiveness of the NPC.

[0081] Figure 3 A flowchart of another method for determining a non-player character model provided in an embodiment of the present application; optionally, optimizing the initial non-player character model according to the performance evaluation result and the anthropomorphic evaluation result of the initial non-player character model, and the anthropomorphic reward output by the anthropomorphic reward network generated by training the anthropomorphic training sample set to obtain the target non-player character model may include:

[0082] S301. Generate a performance loss value based on the performance evaluation result at the current moment and the accumulated environmental rewards at the current moment and the next moment. The environmental rewards are generated according to a preset performance-related environmental reward function.

[0083] Figure 4 A schematic diagram of a network model architecture provided in an embodiment of the present application is shown as follows: Figure 4 As shown, the network model may include: an initial NPC model, a performance evaluator, and an anthropomorphic evaluator. The collected game environment state data set is input as input data into the initial NPC model, wherein the game environment state information at each moment may be input in sequence according to the time information of each game environment state information in the game environment state data set, and the initial NPC model may output the execution action corresponding to the game environment state information at each moment in sequence.

[0084] For a round of model training, the performance evaluator can output the performance evaluation result at the current moment based on the execution action received at the current moment and the game environment status information at the current moment; similarly, the anthropomorphic evaluator can output the anthropomorphic evaluation result at the current moment based on the execution action received at the current moment and the game environment status information at the current moment.

[0085] In some embodiments, performance-related environmental rewards may also be introduced, which are different from anthropomorphic rewards. Since the reward rules of performance-related environmental rewards rarely rely on subjective consciousness, the reward rules corresponding to the performance level of the NPC's execution actions under different game environment status information may be pre-set.

[0086] Then, based on the execution actions output by the current NPC model and the set reward rules, the environmental reward at the current moment can be generated, and the environmental reward at the next moment can also be predicted, that is, the cumulative environmental reward.

[0087] Then, according to the performance evaluation result at the current moment and the accumulated environmental rewards at the current moment and the next moment, the current performance loss value can be generated.

[0088] The calculation formula of the performance loss value of the performance discriminator can be shown as follows:

[0089]

[0090] Usually, L=1, then J(φ)=0.5*(r t +V φ (s′)- φ (s t )) 2 ,

[0091] Among them, V φ (·) represents the judge, φ represents the network parameters of the judge, R t represents the environmental reward at time t, s′, s t Respectively represent the game environment status information at time t+1 and time t. t + L V φ (s′) can be understood as the cumulative environmental reward, which specifically means the actual reward of the environmental feedback at the current moment plus the judge’s prediction of the reward at the next time). φ (s t ) represents the performance evaluation result output by the performance evaluator at time t.

[0092] It is worth noting that the evaluator evaluates the execution actions output by the NPC, but the actual calculation of the evaluation results is based on the game environment state information corresponding to the execution actions.

[0093] S302: Generate an anthropomorphic loss value according to the anthropomorphic evaluation result at the current moment and the accumulated anthropomorphic rewards at the current moment and the next moment.

[0094] Optionally, an anthropomorphic reward network (i.e. Figure 4The anthropomorphic reward function shown in ) generates the anthropomorphic reward at the current moment and the anthropomorphic reward at the next moment, and obtains the cumulative anthropomorphic reward.

[0095] Similar to the calculation method of performance loss value, the anthropomorphic loss value can be generated according to the anthropomorphic evaluation result at the current moment and the accumulated anthropomorphic rewards at the current moment and the next moment. The specific calculation formula can refer to the calculation formula of performance loss value.

[0096] S303, iteratively optimizing the network parameters of the initial non-player character model according to the performance loss value and the anthropomorphism loss value, and iteratively optimizing the network parameters of the performance evaluator and the anthropomorphism evaluator, to obtain a target non-player character model.

[0097] Optionally, the network parameters of the initial NPC model can be iteratively optimized according to the obtained performance loss value, and the network parameters of the performance evaluator can also be iteratively optimized; and the network parameters of the initial NPC model and the network parameters of the anthropomorphic evaluator can be iteratively optimized according to the anthropomorphic loss value. The NPC model obtained after optimization is the target NPC model.

[0098] Among them, the optimization goal of the initial NPC model is to maximize the probability of the maximum value action:

[0099] Usually, L = 1, then

[0100]

[0101] Among them, π(·|·) represents the initial NPC model, θ represents the network parameters of the initial NPC model, and the actual meaning of this formula represents the optimization gradient of the initial NPC model.

[0102] Figure 5 A flowchart of another method for determining a non-player character model provided by an embodiment of the present application; optionally, in step S303, iteratively optimizing the network parameters of the initial non-player character model according to the performance loss value and the anthropomorphic loss value, and iteratively optimizing the network parameters of the performance evaluator and the anthropomorphic evaluator to obtain the target non-player character model may include:

[0103] S501: Determine whether the current performance loss value meets the performance loss threshold, and whether the current anthropomorphic loss value meets the anthropomorphic loss threshold.

[0104] In some embodiments, based on the current performance loss value obtained in each round of training, it is determined whether the current performance loss value meets the performance loss threshold, and it is determined whether the current anthropomorphic loss value meets the anthropomorphic loss threshold.

[0105] S502. If not, adjust the network parameters of the current non-role player model to obtain a new non-role player model, adjust the network parameters of the current performance evaluator to obtain a new performance evaluator, and adjust the network parameters of the current anthropomorphic evaluator to obtain a new anthropomorphic evaluator.

[0106] When the performance loss value does not meet the performance loss threshold, the network parameters of the current NPC model are adjusted to obtain a modified NPC model. It should be noted that for the first round of training, the current NPC model refers to the initial NPC model, and for each training after the first round, the NPC model is constantly modified, and each round of NPC models is different, and is uniformly represented by the current NPC model.

[0107] When the anthropomorphic loss value does not meet the anthropomorphic loss threshold, the network parameters of the current NPC model are also modified to obtain a modified NPC model.

[0108] Then, after the network parameters of the jointly supervised NPC model based on the anthropomorphic loss value and the performance loss value are corrected, a new NPC model can be obtained.

[0109] At the same time, when the performance loss value does not meet the performance loss threshold, the network parameters of the performance evaluator need to be adjusted to obtain a new performance evaluator. When the anthropomorphic loss value does not meet the anthropomorphic loss threshold, the network parameters of the anthropomorphic evaluator need to be adjusted to obtain a new anthropomorphic evaluator.

[0110] S503. Input the collected new game environment state data set into the new non-role player model, and generate the current new performance loss value and the current new anthropomorphic loss value according to the new performance evaluation result output by the new performance evaluator and the new anthropomorphic evaluation result output by the new anthropomorphic evaluator. Iterative execution is performed until the current new performance loss value meets the performance loss threshold and the current new anthropomorphic loss value meets the anthropomorphic loss threshold, and the current non-role player model is used as the target non-role player model.

[0111] Based on the obtained new NPC model, a new game environment state data set can be collected, and the new game environment state data set may contain data different from the game environment state data set used in the previous round of training.

[0112] The new game environment state data set is input into the new NPC model, and the execution actions corresponding to the game environment state information at each moment in the new game environment state data output by the NPC model are obtained. The execution actions are respectively input into the new performance evaluator and the new anthropomorphic evaluator as input data, so as to obtain the current new performance evaluation result and the new anthropomorphic evaluation result, and thus the current performance loss value and the current anthropomorphic loss value can be obtained based on the above performance loss value and the calculation method of the anthropomorphic loss value. And respectively judge whether the current performance loss value meets the performance loss threshold, and whether the current anthropomorphic loss value meets the anthropomorphic loss threshold.

[0113] The above steps are executed repeatedly until the current performance loss value meets the performance loss threshold and the anthropomorphic loss value meets the anthropomorphic loss threshold. Then, the correction of the network parameters is stopped and the current NPC model is used as the target NPC model.

[0114] Figure 6 A flowchart of another method for determining a non-player character model provided by an embodiment of the present application; optionally, in the above steps, according to the performance evaluation result and the anthropomorphic evaluation result of the initial non-player character model, and the anthropomorphic reward output by the anthropomorphic reward network generated by training the anthropomorphic training sample set, the initial non-player character model is optimized, and before obtaining the target non-player character model, the following steps may be included:

[0115] S601. According to the processing result of the initial non-player character model based on the real game environment data, an initial sample data set is obtained, where the initial sample data set includes: multiple trajectory sequences of the initial non-player character model, each trajectory sequence is composed of multiple data pairs, and each data pair includes game environment state information and corresponding execution actions.

[0116] In this embodiment, the anthropomorphic reward network used above is described.

[0117] First, the behavior sequence generated by the initial NPC model during online interaction with the real game environment can be obtained, that is, the initial sample data set.

[0118] The initial sample data set may include multiple trajectory sequences of the initial NPC model, each trajectory sequence is composed of multiple data pairs, and each data pair includes game environment state information and corresponding execution actions.

[0119] S602: Label each trajectory sequence in the initial sample data set to generate labeling information of each trajectory sequence, where the labeling information is used to characterize the degree of anthropomorphism of the trajectory sequence.

[0120] In some embodiments, each trajectory sequence can be annotated by manual evaluation, which only needs to judge whether the trajectory sequence generated by the initial NPC model is anthropomorphic and the degree of anthropomorphism, that is, to judge which part of the trajectory sequence is human-like and which part is not human-like.

[0121] Since the trajectory sequence presents the behavioral characteristics of the NPC model in the form of data, it is difficult for evaluators to judge the degree of anthropomorphism of the trajectory sequence through a single piece of data. The trajectory sequence is used for computer data processing.

[0122] Then, the evaluator can replay the online interactive video of the NPC model and the game environment, and annotate each trajectory sequence based on the behavior of the NPC model in the video. For example, the human-like part (higher degree of anthropomorphism) can be annotated as +1, the non-human-like part (lower degree of anthropomorphism) can be annotated as -1, and the rest can be annotated as 0, thus obtaining an anthropomorphic evaluation sequence containing three types of evaluation values. Among them, the rest can refer to the part that cannot be distinguished whether it is human-like or not.

[0123] S603: Obtain an anthropomorphic training sample set according to each trajectory sequence and the annotation information of each trajectory sequence.

[0124] Then, based on the labeled initial sample data set, an anthropomorphic training sample set can be obtained.

[0125] S604: Use the anthropomorphic training sample set to train and generate an anthropomorphic reward network.

[0126] Optionally, the anthropomorphic training sample set may be input into an anthropomorphic reward network to be trained to obtain the anthropomorphic reward network.

[0127] Optionally, a deep neural network U(s) can be designed 0:t ) to predict the reward value of the trajectory from frame 0 to frame t. Then, the algorithm calculates two trajectory sequences of different lengths ( And t 2 >t 1 ) and optimizes the reward based on the anthropomorphic evaluation value between the two trajectories. There are three specific cases:

[0128] 1) If there is only a human-like indicator between two trajectories, the loss function is

[0129] 2) If there is only an unhuman-like metric between the two trajectories, the loss function is

[0130] 3) If there is no indicator between the two trajectories, the loss function is

[0131] After iterative optimization based on the above method, an anthropomorphic reward network can be trained.

[0132] The generation of the above-mentioned anthropomorphic training sample set only requires some personnel to label the trajectory sequence generated by the NPC model, and the anthropomorphic behavior learning of the NPC model can be realized based on the generated anthropomorphic training sample set. Compared with the method of obtaining training sample sets based on collected historical player data, this method can not only greatly improve the efficiency of generating training sample sets, but also does not require the collection of a large amount of player data in advance, avoiding excessive reliance on player data, which is very friendly for a game that has not yet been launched or is planned to be launched.

[0133] Figure 7 A flowchart of another method for determining a non-player character model provided by an embodiment of the present application; optionally, in step S104, after obtaining the target non-player character model, the method may further include:

[0134] S701: Generate a new anthropomorphic training sample set based on the target non-player character model.

[0135] In some embodiments, in the early stage of anthropomorphic reward network training, the anthropomorphic parts in the trajectory sequence of the anthropomorphic training sample set generated by the initial NPC model's actual interaction with the environment will be relatively small, which will result in most of the labeled trajectory sequences being non-human-like parts, with very few actual human-like parts.

[0136] The anthropomorphic strategy improvement scheme based on course iteration can address the problem of uneven distribution of positive and negative samples caused by too few anthropomorphic behaviors in the trajectory sequences of the anthropomorphic training sample set generated by NPC in the early stage.

[0137] Optionally, the trained target NPC model may interact with the game environment to generate new interaction data, and new anthropomorphic training samples may be collected from the interaction data.

[0138] S702 : Generate labeling information of each trajectory sequence in the new anthropomorphic training sample set according to the anthropomorphism degree of each trajectory sequence in the new anthropomorphic training sample set and the average value of the samples.

[0139] Optionally, the human-like index can be evaluated by comparing samples. For each trajectory sequence in the new anthropomorphic training sample set, when the anthropomorphism degree of the trajectory sequence is greater than the average of the anthropomorphism degrees of all trajectory sequences, the trajectory sequence is marked as: +1 (human-like), that is, the anthropomorphism degree is high.

[0140] That is, by lowering the anthropomorphism judgment standard, samples that are basically human-like are also given human-like labeling information.

[0141] S703: Iteratively update the anthropomorphic reward network using a new anthropomorphic training sample set with labeled information to obtain an updated anthropomorphic reward network.

[0142] The annotated new anthropomorphic training sample set is input into the current anthropomorphic reward network for iterative updating of the network. By continuously improving the anthropomorphic reward network's judgment criteria for anthropomorphism, an updated anthropomorphic reward network is obtained.

[0143] Based on the updated anthropomorphic reward network, the target NPC model can be optimized again to guide the target NPC model to generate high-quality anthropomorphic behaviors, thereby ensuring that the NPC model has a certain competitive performance and continuously optimizing its anthropomorphic degree.

[0144] In summary, the method for determining the non-player role model provided in this embodiment can perform performance and anthropomorphic evaluations on the execution actions corresponding to the game environment state information at each moment generated by the initial non-player role model, and obtain the performance evaluation results and anthropomorphic evaluation results of the execution actions corresponding to the game environment state information at each moment, respectively, so as to optimize the initial non-player role model in combination with the performance evaluation results and the anthropomorphic evaluation results, and obtain the target non-player role model. Since the execution actions are generated in real time through the collected game environment state information, and the game environment state information does not depend on the historical player data, it can be constructed in real time, thereby getting rid of the dependence of the training of the non-player role model on the historical player data, and avoiding the problem of low generalization of the model training results caused by the uneven distribution of historical player data. In addition, the training of the model is jointly supervised by the performance evaluation results and the anthropomorphic evaluation results, so that the obtained target non-player model can have anthropomorphic effects while ensuring competitive performance, thereby improving the authenticity of the non-player role model.

[0145] Secondly, the generation of anthropomorphic training sample sets only requires some personnel to annotate the trajectory sequences generated by the NPC model, and the anthropomorphic behavior learning of the NPC model can be realized based on the generated anthropomorphic training sample sets. Compared with the method of obtaining training sample sets based on collected historical player data, this method can not only greatly improve the efficiency of generating training sample sets, but also does not require the prior collection of a large amount of player data, thus avoiding excessive reliance on player data.

[0146] In addition, the anthropomorphic strategy improvement scheme based on curriculum iteration iteratively updates the anthropomorphic training sample set, thereby achieving iterative optimization of the anthropomorphic reward network, which can guide the training to generate an NPC model with high-quality anthropomorphic behavior.

[0147] The following describes the apparatus, device, storage medium, etc. used to execute the method for determining the non-player character model provided by the present application. The specific implementation process and technical effects are as mentioned above and will not be described in detail below.

[0148] Figure 8 A schematic diagram of a non-player character model determination device provided in an embodiment of the present application, the functions implemented by the non-player character model determination device correspond to the steps performed by the above method. The device can be understood as the above-mentioned computer or server, or a processor of the server, or can also be understood as a component independent of the above-mentioned server or processor that implements the functions of the present application under the control of the server, such as Figure 8 As shown, the device may include: a collection module 810, a generation module 820, an acquisition module 830, and a training module 840;

[0149] The acquisition module 810 is used to acquire a game environment status data set;

[0150] A generation module 820, for inputting the game environment state data set into the initial non-player role model, and the initial non-player role model generates the corresponding execution action under the game environment state information at each moment according to the game environment state information at each moment in the game environment state data set;

[0151] An acquisition module 830 is used to acquire the performance evaluation result and the anthropomorphic evaluation result of the output initial non-player role model according to the corresponding execution action under the game environment state information at each moment;

[0152] The training module 840 is used to optimize the initial non-player character model according to the performance evaluation result and the anthropomorphism evaluation result of the initial non-player character model to obtain a target non-player character model.

[0153] Optionally, the device further comprises: a building module;

[0154] The acquisition module 810 is also used to acquire mapping relationships between multiple sets of game environment state information and execution actions;

[0155] The construction module is used to construct an initial non-player role model according to the mapping relationship between each game environment state information and the execution action.

[0156] Optionally, the acquisition module 830 is specifically used to input the corresponding execution actions under the generated game environment status information at each moment and the game environment status information at each moment into the performance evaluator and the personification evaluator, respectively, and obtain the performance evaluation results of the initial non-player character model output by the performance evaluator under the game environment status information at each moment, and the personification evaluation results of the initial non-player character model output by the personification evaluator under the game environment status information at each moment.

[0157] Optionally, the training module 840 is specifically used to optimize the initial non-player character model according to the performance evaluation results and the anthropomorphic evaluation results of the initial non-player character model, and the anthropomorphic reward output by the anthropomorphic reward network generated by training with the anthropomorphic training sample set, to obtain a target non-player character model.

[0158] Optionally, the training module 840 is specifically used to generate a performance loss value according to the performance evaluation result at the current moment and the accumulated environmental rewards at the current moment and the next moment, and the environmental rewards are generated according to a preset performance-related environmental reward function;

[0159] Generate an anthropomorphic loss value based on the anthropomorphic evaluation result at the current moment and the accumulated anthropomorphic rewards at the current moment and the next moment;

[0160] According to the performance loss value and the anthropomorphism loss value, the network parameters of the initial non-character player model are iteratively optimized, and the network parameters of the performance evaluator and the anthropomorphism evaluator are iteratively optimized to obtain the target non-player character model.

[0161] Optionally, the training module 840 is specifically used to determine whether the current performance loss value meets the performance loss threshold, and whether the current anthropomorphic loss value meets the anthropomorphic loss threshold;

[0162] If not, the network parameters of the current non-role player model are adjusted to obtain a new non-role player model, the network parameters of the current performance evaluator are adjusted to obtain a new performance evaluator, and the network parameters of the current anthropomorphic evaluator are adjusted to obtain a new anthropomorphic evaluator;

[0163] The collected new game environment state data set is input into the new non-role player model, and the current new performance loss value and the current new anthropomorphic loss threshold are generated according to the new performance evaluation results output by the new performance evaluator and the new anthropomorphic evaluation results output by the new anthropomorphic evaluator. The execution is iterative until the current new performance loss value meets the performance loss threshold and the current new anthropomorphic loss value meets the anthropomorphic loss threshold, and the current non-role player model is used as the target non-role player model.

[0164] Optionally, the training module 840 is further configured to obtain an initial sample data set according to a processing result of the initial non-player character model based on the real game environment data, the initial sample data set comprising: a plurality of trajectory sequences of the initial non-player character model, each trajectory sequence being composed of a plurality of data pairs, each data pair comprising game environment state information and a corresponding execution action;

[0165] Label each trajectory sequence in the initial sample data set to generate labeling information for each trajectory sequence, and the labeling information is used to characterize the degree of anthropomorphism of the trajectory sequence;

[0166] According to each trajectory sequence and the annotation information of each trajectory sequence, a personified training sample set is obtained;

[0167] An anthropomorphic training sample set is used to train and generate an anthropomorphic reward network.

[0168] Optionally, the generating module 820 is further configured to generate a new anthropomorphic training sample set according to the target non-player character model; generate labeling information of each trajectory sequence in the new anthropomorphic training sample set according to the anthropomorphic degree of each trajectory sequence in the new anthropomorphic training sample set and the average value of the samples;

[0169] The training module 840 is further used to iteratively update the anthropomorphic reward network using a new anthropomorphic training sample set with labeled information to obtain an updated anthropomorphic reward network.

[0170] Through the above device, the generation module generates the corresponding execution actions under the game environment state information at each moment through the initial non-player role model, and the training module can perform performance and anthropomorphic evaluation on the execution actions, respectively obtaining the performance evaluation results and anthropomorphic evaluation results of the execution actions corresponding to the game environment state information at each moment, thereby optimizing the initial non-player role model in combination with the performance evaluation results and the anthropomorphic evaluation results to obtain the target non-player role model. Since the execution actions are generated in real time through the collected game environment state information, and the game environment state information does not depend on the historical player data, it can be constructed in real time, thereby getting rid of the dependence of the training of the non-player role model on the historical player data, and avoiding the problem of low generalization of the model training results caused by the uneven distribution of historical player data. In addition, the training of the model is jointly supervised by the performance evaluation results and the anthropomorphic evaluation results, so that the obtained target non-player model can have anthropomorphic effects while ensuring competitive performance, thereby improving the authenticity of the non-player role model.

[0171] The above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASIC), or one or more digital singnal processors (DSP), or one or more field programmable gate arrays (FPGA). For another example, when a module is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).

[0172] The above modules can be connected or communicated with each other via a wired connection or a wireless connection. The wired connection may include a metal cable, an optical cable, a hybrid cable, etc., or any combination thereof. The wireless connection may include a connection in the form of a LAN, a WAN, Bluetooth, a ZigBee, or NFC, or any combination thereof. Two or more modules may be combined into a single module, and any one module may be divided into two or more units. Those skilled in the art will clearly understand that for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the method embodiment, and will not be repeated in this application.

[0173] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application includes: a processor 801, a storage medium 802 and a bus 803, wherein the storage medium 802 stores machine-readable instructions executable by the processor 801. When the electronic device runs a method for determining a non-player role model in the embodiment, the processor 801 communicates with the storage medium 802 via the bus 803, and the processor 801 executes the machine-readable instructions to perform the following steps: collecting a game environment state data set;

[0174] Inputting the game environment state data set into the initial non-player role model, the initial non-player role model generates the corresponding execution action under the game environment state information at each moment according to the game environment state information at each moment in the game environment state data set;

[0175] According to the corresponding execution actions under the game environment state information at each moment, the performance evaluation results and the anthropomorphic evaluation results of the initial non-player role model are obtained and output;

[0176] According to the performance evaluation results and the anthropomorphic evaluation results of the initial non-player character model, the initial non-player character model is optimized to obtain a target non-player character model.

[0177] In a feasible implementation, before the processor 801 generates execution actions according to the game environment state information at each moment in the game environment state data set by the initial non-player role model, it is specifically used to: collect mapping relationships between multiple sets of game environment state information and execution actions;

[0178] According to the mapping relationship between each game environment state information and execution action, an initial non-player role model is constructed.

[0179] In a feasible implementation scheme, when the processor 801 executes the acquisition of the performance evaluation results and the anthropomorphic evaluation results of the initial non-player character model output, it is specifically used to: input the corresponding execution actions under the generated game environment status information at each moment and the game environment status information at each moment into the performance evaluator and the anthropomorphic evaluator respectively, and respectively obtain the performance evaluation results of the initial non-player character model output by the performance evaluator under the game environment status information at each moment, and the anthropomorphic evaluation results of the initial non-player character model output by the anthropomorphic evaluator under the game environment status information at each moment.

[0180] In a feasible implementation manner, when the processor 801 optimizes the initial non-player character model according to the performance evaluation results and the anthropomorphic evaluation results of the initial non-player character model to obtain the target non-player character model, it is specifically used to: optimize the initial non-player character model according to the performance evaluation results and the anthropomorphic evaluation results of the initial non-player character model, and the anthropomorphic reward output by the anthropomorphic reward network generated by training with the anthropomorphic training sample set, to obtain the target non-player character model.

[0181] In a feasible implementation, when the processor 801 optimizes the initial non-player character model according to the performance evaluation result and the anthropomorphic evaluation result of the initial non-player character model and the anthropomorphic reward output by the anthropomorphic reward network generated by training with the anthropomorphic training sample set to obtain the target non-player character model, the processor 801 is specifically used to: generate a performance loss value according to the performance evaluation result at the current moment and the accumulated environmental rewards at the current moment and the next moment, and the environmental reward is generated according to a preset performance-related environmental reward function;

[0182] Generate an anthropomorphic loss value based on the anthropomorphic evaluation result at the current moment and the accumulated anthropomorphic rewards at the current moment and the next moment;

[0183] According to the performance loss value and the anthropomorphism loss value, the network parameters of the initial non-character player model are iteratively optimized, and the network parameters of the performance evaluator and the anthropomorphism evaluator are iteratively optimized to obtain the target non-player character model.

[0184] In a feasible implementation, when the processor 801 performs iterative optimization of the network parameters of the initial non-role player model according to the performance loss value and the anthropomorphic loss value, and iterative optimization of the network parameters of the performance evaluator and the anthropomorphic evaluator to obtain the target non-player role model, it is specifically used to: determine whether the current performance loss value meets the performance loss threshold, and whether the current anthropomorphic loss value meets the anthropomorphic loss threshold;

[0185] If not, the network parameters of the current non-role player model are adjusted to obtain a new non-role player model, the network parameters of the current performance evaluator are adjusted to obtain a new performance evaluator, and the network parameters of the current anthropomorphic evaluator are adjusted to obtain a new anthropomorphic evaluator;

[0186] The collected new game environment state data set is input into the new non-role player model, and the current new performance loss value and the current new anthropomorphic loss value are generated according to the new performance evaluation results output by the new performance evaluator and the new anthropomorphic evaluation results output by the new anthropomorphic evaluator. The execution is iterative until the current new performance loss value meets the performance loss threshold and the current new anthropomorphic loss value meets the anthropomorphic loss threshold, and the current non-role player model is used as the target non-role player model.

[0187] In a feasible implementation scheme, before the processor 801 optimizes the initial non-player character model according to the performance evaluation result and the anthropomorphic evaluation result of the initial non-player character model and the anthropomorphic reward output by the anthropomorphic reward network generated by training the anthropomorphic training sample set to obtain the target non-player character model, the processor 801 is specifically used to: obtain an initial sample data set according to the processing result of the initial non-player character model based on the real game environment data, the initial sample data set including: multiple trajectory sequences of the initial non-player character model, each trajectory sequence consisting of multiple data pairs, each data pair including game environment state information and corresponding execution actions;

[0188] Label each trajectory sequence in the initial sample data set to generate labeling information for each trajectory sequence, and the labeling information is used to characterize the degree of anthropomorphism of the trajectory sequence;

[0189] According to each trajectory sequence and the annotation information of each trajectory sequence, a personified training sample set is obtained;

[0190] An anthropomorphic training sample set is used to train and generate an anthropomorphic reward network.

[0191] In a feasible implementation, after obtaining the target non-player character model, the processor 801 is specifically configured to: generate a new anthropomorphic training sample set according to the target non-player character model;

[0192] Generate labeling information of each trajectory sequence in the new anthropomorphic training sample set according to the anthropomorphic degree of each trajectory sequence in the new anthropomorphic training sample set and the average value of the samples;

[0193] A new anthropomorphic training sample set with labeled information is used to iteratively update the anthropomorphic reward network to obtain an updated anthropomorphic reward network.

[0194] Through the above method, after the computer device generates the corresponding execution action under the game environment state information at each moment through the initial non-player role model, the performance and anthropomorphic evaluation of the execution action can be performed, and the performance evaluation results and anthropomorphic evaluation results of the execution action corresponding to the game environment state information at each moment are obtained respectively, so as to optimize the initial non-player role model in combination with the performance evaluation results and the anthropomorphic evaluation results, and obtain the target non-player role model. Since the execution action is generated in real time through the collected game environment state information, and the game environment state information does not depend on the historical player data, it can be constructed in real time, thereby getting rid of the dependence of the training of the non-player role model on the historical player data, and avoiding the problem of low generalization of the model training results caused by the uneven distribution of historical player data. In addition, the training of the model is jointly supervised by the performance evaluation results and the anthropomorphic evaluation results, so that the obtained target non-player model can have anthropomorphic effect while ensuring the competitive performance, thereby improving the authenticity of the non-player role model.

[0195] Secondly, the generation of anthropomorphic training sample sets only requires some personnel to annotate the trajectory sequences generated by the NPC model, and the anthropomorphic behavior learning of the NPC model can be realized based on the generated anthropomorphic training sample sets. Compared with the method of obtaining training sample sets based on collected historical player data, this method can not only greatly improve the efficiency of generating training sample sets, but also does not require the prior collection of a large amount of player data, thus avoiding excessive reliance on player data.

[0196] In addition, the anthropomorphic strategy improvement scheme based on curriculum iteration iteratively updates the anthropomorphic training sample set, thereby achieving iterative optimization of the anthropomorphic reward network, which can guide the training to generate an NPC model with high-quality anthropomorphic behavior.

[0197] Among them, the storage medium 802 stores program code, and when the program code is executed by the processor 801, the processor 801 executes various steps in the method for determining the non-player character model according to various exemplary embodiments of the present application described in the above "Exemplary Method" section of this specification.

[0198] Processor 801 can be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor (DigitalSignal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, and can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present application can be directly embodied as a hardware processor to be executed, or a combination of hardware and software modules in the processor can be executed.

[0199] Storage medium 802, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory may include at least one type of storage medium, such as flash memory, hard disk, multimedia card, card-type memory, random access memory (Random Access Memory, RAM), static random access memory (Static Random Access Memory, SRAM), programmable read-only memory (Programmable Read Only Memory, PROM), read-only memory (Read Only Memory, ROM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), magnetic memory, disk, optical disk, etc. The memory is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The storage medium 802 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.

[0200] Optionally, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and the computer program is executed when the processor is running, and the processor performs the following steps: collecting a game environment state data set;

[0201] Inputting the game environment state data set into the initial non-player role model, the initial non-player role model generates the corresponding execution action under the game environment state information at each moment according to the game environment state information at each moment in the game environment state data set;

[0202] According to the corresponding execution actions under the game environment state information at each moment, the performance evaluation results and the anthropomorphic evaluation results of the initial non-player role model are obtained and output;

[0203] According to the performance evaluation results and the anthropomorphic evaluation results of the initial non-player character model, the initial non-player character model is optimized to obtain a target non-player character model.

[0204] In a feasible implementation, before the processor 801 generates execution actions according to the game environment state information at each moment in the game environment state data set by the initial non-player role model, it is specifically used to: collect mapping relationships between multiple sets of game environment state information and execution actions;

[0205] According to the mapping relationship between each game environment state information and execution action, an initial non-player role model is constructed.

[0206] In a feasible implementation scheme, when the processor 801 executes the acquisition of the performance evaluation results and the anthropomorphic evaluation results of the initial non-player character model output, it is specifically used to: input the corresponding execution actions under the generated game environment status information at each moment and the game environment status information at each moment into the performance evaluator and the anthropomorphic evaluator respectively, and respectively obtain the performance evaluation results of the initial non-player character model output by the performance evaluator under the game environment status information at each moment, and the anthropomorphic evaluation results of the initial non-player character model output by the anthropomorphic evaluator under the game environment status information at each moment.

[0207] In a feasible implementation manner, when the processor 801 optimizes the initial non-player character model according to the performance evaluation results and the anthropomorphic evaluation results of the initial non-player character model to obtain the target non-player character model, it is specifically used to: optimize the initial non-player character model according to the performance evaluation results and the anthropomorphic evaluation results of the initial non-player character model, and the anthropomorphic reward output by the anthropomorphic reward network generated by training with the anthropomorphic training sample set, to obtain the target non-player character model.

[0208] In a feasible implementation, when the processor 801 optimizes the initial non-player character model according to the performance evaluation result and the anthropomorphic evaluation result of the initial non-player character model and the anthropomorphic reward output by the anthropomorphic reward network generated by training with the anthropomorphic training sample set to obtain the target non-player character model, the processor 801 is specifically used to: generate a performance loss value according to the performance evaluation result at the current moment and the accumulated environmental rewards at the current moment and the next moment, and the environmental reward is generated according to a preset performance-related environmental reward function;

[0209] Generate an anthropomorphic loss value based on the anthropomorphic evaluation result at the current moment and the accumulated anthropomorphic rewards at the current moment and the next moment;

[0210] According to the performance loss value and the anthropomorphism loss value, the network parameters of the initial non-character player model are iteratively optimized, and the network parameters of the performance evaluator and the anthropomorphism evaluator are iteratively optimized to obtain the target non-player character model.

[0211] In a feasible implementation, when the processor 801 performs iterative optimization of the network parameters of the initial non-role player model according to the performance loss value and the anthropomorphic loss value, and iterative optimization of the network parameters of the performance evaluator and the anthropomorphic evaluator to obtain the target non-player role model, it is specifically used to: determine whether the current performance loss value meets the performance loss threshold, and whether the current anthropomorphic loss value meets the anthropomorphic loss threshold;

[0212] If not, the network parameters of the current non-role player model are adjusted to obtain a new non-role player model, the network parameters of the current performance evaluator are adjusted to obtain a new performance evaluator, and the network parameters of the current anthropomorphic evaluator are adjusted to obtain a new anthropomorphic evaluator;

[0213] The collected new game environment state data set is input into the new non-role player model, and the current new performance loss value and the current new anthropomorphic loss value are generated according to the new performance evaluation results output by the new performance evaluator and the new anthropomorphic evaluation results output by the new anthropomorphic evaluator. The execution is iterative until the current new performance loss value meets the performance loss threshold and the current new anthropomorphic loss value meets the anthropomorphic loss threshold, and the current non-role player model is used as the target non-role player model.

[0214] In a feasible implementation scheme, before the processor 801 optimizes the initial non-player character model according to the performance evaluation result and the anthropomorphic evaluation result of the initial non-player character model and the anthropomorphic reward output by the anthropomorphic reward network generated by training the anthropomorphic training sample set to obtain the target non-player character model, the processor 801 is specifically used to: obtain an initial sample data set according to the processing result of the initial non-player character model based on the real game environment data, the initial sample data set including: multiple trajectory sequences of the initial non-player character model, each trajectory sequence consisting of multiple data pairs, each data pair including game environment state information and corresponding execution actions;

[0215] Label each trajectory sequence in the initial sample data set to generate labeling information for each trajectory sequence, and the labeling information is used to characterize the degree of anthropomorphism of the trajectory sequence;

[0216] According to each trajectory sequence and the annotation information of each trajectory sequence, a personified training sample set is obtained;

[0217] An anthropomorphic training sample set is used to train and generate an anthropomorphic reward network.

[0218] In a feasible implementation, after obtaining the target non-player character model, the processor 801 is specifically configured to: generate a new anthropomorphic training sample set according to the target non-player character model;

[0219] Generate labeling information of each trajectory sequence in the new anthropomorphic training sample set according to the anthropomorphic degree of each trajectory sequence in the new anthropomorphic training sample set and the average value of the samples;

[0220] A new anthropomorphic training sample set with labeled information is used to iteratively update the anthropomorphic reward network to obtain an updated anthropomorphic reward network.

[0221] Through the above method, after the computer device generates the corresponding execution action under the game environment state information at each moment through the initial non-player role model, the performance and anthropomorphic evaluation of the execution action can be performed, and the performance evaluation results and anthropomorphic evaluation results of the execution action corresponding to the game environment state information at each moment are obtained respectively, so as to optimize the initial non-player role model in combination with the performance evaluation results and the anthropomorphic evaluation results, and obtain the target non-player role model. Since the execution action is generated in real time through the collected game environment state information, and the game environment state information does not depend on the historical player data, it can be constructed in real time, thereby getting rid of the dependence of the training of the non-player role model on the historical player data, and avoiding the problem of low generalization of the model training results caused by the uneven distribution of historical player data. In addition, the training of the model is jointly supervised by the performance evaluation results and the anthropomorphic evaluation results, so that the obtained target non-player model can have anthropomorphic effect while ensuring the competitive performance, thereby improving the authenticity of the non-player role model.

[0222] Secondly, the generation of anthropomorphic training sample sets only requires some personnel to annotate the trajectory sequences generated by the NPC model, and the anthropomorphic behavior learning of the NPC model can be realized based on the generated anthropomorphic training sample sets. Compared with the method of obtaining training sample sets based on collected historical player data, this method can not only greatly improve the efficiency of generating training sample sets, but also does not require the prior collection of a large amount of player data, thus avoiding excessive reliance on player data.

[0223] In addition, the anthropomorphic strategy improvement scheme based on curriculum iteration iteratively updates the anthropomorphic training sample set, thereby achieving iterative optimization of the anthropomorphic reward network, which can guide the training to generate an NPC model with high-quality anthropomorphic behavior.

[0224] In the embodiment of the present application, the computer program can also execute other machine-readable instructions when run by the processor to execute other methods described in the embodiment. For the specific execution method steps and principles, please refer to the description of the embodiment, which will not be repeated here.

[0225] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0226] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0227] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0228] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (English: processor) to perform some steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (English: Read-Only Memory, abbreviated: ROM), random access memory (English: Random Access Memory, abbreviated: RAM), disk or optical disk and other media that can store program codes.

Claims

1. A method for determining a non-player character model, characterized in that: include: Collect game environment status data set; Inputting the game environment state data set into an initial non-player role model, and the initial non-player role model generates an execution action corresponding to the game environment state information at each moment according to the game environment state information at each moment in the game environment state data set; According to the execution actions corresponding to the game environment state information at each moment, the output performance evaluation results and the anthropomorphic evaluation results of the initial non-player character model are obtained; According to the performance evaluation result and the anthropomorphism evaluation result of the initial non-player character model, the initial non-player character model is optimized to obtain a target non-player character model.

2. The method according to claim 1, characterized in that Before the initial non-player character model generates an execution action according to the game environment state information at each moment in the game environment state data set, the method includes: Collect multiple sets of mapping relationships between game environment status information and execution actions; The initial non-player role model is constructed according to the mapping relationship between each game environment state information and the execution action.

3. The method according to claim 1, characterized in that The obtaining and outputting the performance evaluation result and the anthropomorphic evaluation result of the initial non-player character model includes: The execution actions corresponding to the generated game environment status information at each moment and the game environment status information at each moment are respectively input into a performance evaluator and an anthropomorphism evaluator, and the performance evaluation results of the initial non-player character model under the game environment status information at each moment output by the performance evaluator and the anthropomorphism evaluation results of the initial non-player character model under the game environment status information at each moment output by the anthropomorphism evaluator are respectively obtained.

4. The method according to claim 1, characterized in that: The step of optimizing the initial non-player character model according to the performance evaluation result and the anthropomorphic evaluation result of the initial non-player character model to obtain a target non-player character model includes: According to the performance evaluation result and the anthropomorphic evaluation result of the initial non-player character model, and the anthropomorphic reward output by the anthropomorphic reward network generated by training with the anthropomorphic training sample set, the initial non-player character model is optimized to obtain a target non-player character model.

5. The method according to claim 4, characterized in that The step of optimizing the initial non-player character model according to the performance evaluation result and the anthropomorphic evaluation result of the initial non-player character model and the anthropomorphic reward output by the anthropomorphic reward network generated by training with the anthropomorphic training sample set to obtain a target non-player character model includes: Generate a performance loss value according to the performance evaluation result at the current moment and the accumulated environmental rewards at the current moment and the next moment, wherein the environmental rewards are generated according to a preset performance-related environmental reward function; Generate an anthropomorphic loss value based on the anthropomorphic evaluation result at the current moment and the accumulated anthropomorphic rewards at the current moment and the next moment; The network parameters of the initial non-player character model are iteratively optimized according to the performance loss value and the anthropomorphism loss value, and the network parameters of the performance evaluator and the anthropomorphism evaluator are iteratively optimized to obtain the target non-player character model.

6. The method according to claim 5, characterized in that The iterative optimization of the network parameters of the initial non-player character model according to the performance loss value and the anthropomorphic loss value, and the iterative optimization of the network parameters of the performance evaluator and the anthropomorphic evaluator to obtain the target non-player character model includes: Determine whether the current performance loss value meets the performance loss threshold, and whether the current anthropomorphic loss value meets the anthropomorphic loss threshold; If not, the network parameters of the current non-role player model are adjusted to obtain a new non-role player model, the network parameters of the current performance evaluator are adjusted to obtain a new performance evaluator, and the network parameters of the current anthropomorphic evaluator are adjusted to obtain a new anthropomorphic evaluator; The collected new game environment state data set is input into the new non-role player model, and according to the new performance evaluation result output by the new performance evaluator and the new anthropomorphic evaluation result output by the new anthropomorphic evaluator, a current new performance loss value and a current new anthropomorphic loss value are generated, and the execution is iterated until the current new performance loss value meets the performance loss threshold and the current new anthropomorphic loss value meets the anthropomorphic loss threshold, and the current non-role player model is used as the target non-role player model.

7. The method according to claim 4, characterized in that Before optimizing the initial non-player character model according to the performance evaluation result and the anthropomorphic evaluation result of the initial non-player character model and the anthropomorphic reward output by the anthropomorphic reward network generated by training with the anthropomorphic training sample set to obtain the target non-player character model, the method includes: According to the processing result of the initial non-player character model based on the real game environment data, an initial sample data set is obtained, wherein the initial sample data set includes: a plurality of trajectory sequences of the initial non-player character model, each trajectory sequence is composed of a plurality of data pairs, each data pair includes game environment state information and a corresponding execution action; Annotating each trajectory sequence in the initial sample data set to generate annotation information of each trajectory sequence, wherein the annotation information is used to characterize the degree of anthropomorphism of the trajectory sequence; Obtaining the anthropomorphic training sample set according to the trajectory sequences and the labeling information of the trajectory sequences; The anthropomorphic training sample set is used to train and generate the anthropomorphic reward network.

8. The method according to claim 4, characterized in that After obtaining the target non-player character model, the method further includes: Generating a new anthropomorphic training sample set according to the target non-player character model; Generate labeling information of each trajectory sequence in the new anthropomorphic training sample set according to the anthropomorphic degree of each trajectory sequence in the new anthropomorphic training sample set and the average value of the samples; The anthropomorphic reward network is iteratively updated using the new anthropomorphic training sample set with labeled information to obtain an updated anthropomorphic reward network.

9. A device for determining a non-player character model, characterized in that: include: Acquisition module, generation module, acquisition module, training module; The acquisition module is used to collect a game environment status data set; The generating module is used to input the game environment state data set into an initial non-player role model, and the initial non-player role model generates an execution action corresponding to the game environment state information at each moment according to the game environment state information at each moment in the game environment state data set; The acquisition module is used to acquire the output performance evaluation result and anthropomorphic evaluation result of the initial non-player role model according to the corresponding execution action under the game environment state information at each moment; The training module is used to optimize the initial non-player character model according to the performance evaluation result and the anthropomorphism evaluation result of the initial non-player character model to obtain a target non-player character model.

10. An electronic device, characterized in that: include: A processor, a storage medium and a bus, wherein the storage medium stores program instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the program instructions to execute the method for determining a non-player character model as described in any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method for determining a non-player character model according to any one of claims 1 to 8 is executed.

Citation Information

Cited By

  • Model evaluation method and device and electronic equipment

    CN119782142A