Method, device and electronic device for determining target object

By collecting data in the game scene, determining object and environment characteristics using neural network models, and selecting target objects, the problem of single target decision performance of virtual players and high pressure on server operations is solved, and the game experience and server efficiency are improved.

CN115193031BActive Publication Date: 2025-05-23NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210491335.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-07
Publication Date
2025-05-23
Estimated Expiration
2042-05-07

AI Technical Summary

Technical Problem

When the existing technology controls the behavior of virtual players, the limitations of expert rules and systems lead to the virtual players' goal decision performance in the same or similar scenarios, which is easy to be seen through by real players, affecting the game experience; at the same time, although the supervised learning method can simulate the decisions of real players, the calculation amount is large, resulting in an increase in server computing pressure.

Method used

By collecting the specified data of the current game scene, including the object data and environment data of the alternative objects, the preset neural network model is used to determine the characteristics of the object and environment, and the target object is selected based on the degree of feature matching, reducing the calculation amount of the neural network model.

Benefits of technology

It realizes diversified goal decisions for virtual players in different scenarios, improves the gaming experience of real players, and reduces the computing pressure on the server.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115193031B_ABST
    Figure CN115193031B_ABST
Patent Text Reader

Abstract

The present invention provides a method, device and electronic device for determining a target object; wherein the method comprises: collecting object data of candidate objects and environmental data of the current game scene; searching for a first feature of at least part of the data from a feature set; if there is remaining data for which the first feature has not yet been found, inputting the remaining data into a preset neural network model, and outputting a second feature corresponding to the remaining data; determining the object feature corresponding to the object data of the candidate object and the environmental feature corresponding to the environmental data from the first feature and the second feature; determining the target object from the candidate objects based on the matching degree between the environmental feature and the object feature. This method can enable a virtual player to simulate the target decision of a real player, making the virtual player more humanized and improving the game experience of the real player; it is not necessary for all features to be calculated by the neural network model, which reduces the amount of calculation and relieves the computing pressure of the server.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of game technology, and in particular to a method, device and electronic equipment for determining a target object. Background Art

[0002] In a game that requires multiple players, if there are not enough real players, virtual players are required to participate in the game. The behavior of virtual players is usually controlled by the server, which in turn controls the behavior of the virtual characters corresponding to the virtual players. In related technologies, expert rule systems such as finite state machines and behavior trees can be used to control the behavior of virtual players. Due to the limitations of expert rule systems, virtual players have a single target decision performance in the same or similar scenarios, which can easily be identified as virtual players by real players, affecting the game experience of real players. In other methods, the model can be trained through supervised learning so that the model learns the target decisions of real players, but the model has a large amount of calculation during use, which brings greater computing pressure to the server. Summary of the invention

[0003] In view of this, the purpose of the present invention is to provide a method, device and electronic device for determining a target object, so that a virtual player can simulate the target decision of a real player, making the virtual player more humanized and improving the gaming experience of the real player; at the same time, the amount of calculation can be reduced and the computing pressure of the server can be reduced.

[0004] In a first aspect, an embodiment of the present invention provides a method for determining a target object, the method comprising: collecting designated data in a current game scene, wherein the designated data comprises object data of candidate objects in the current game scene, and environmental data of the current game scene; the environmental data comprises: scene data of the current game scene and / or object data of a controlled virtual object; the controlled virtual object and the candidate object are in the same game match; searching for a first feature of at least part of the data in the designated data from a preset feature set; if there is remaining data in the designated data for which the first feature has not yet been found, inputting the remaining data into a preset neural network model, and outputting a second feature corresponding to the remaining data; determining the object features corresponding to the object data of the candidate object, and the environmental features corresponding to the environmental data from the first and second features; and determining the target object from the candidate objects based on the degree of matching between the environmental features and the object features.

[0005] The above-mentioned feature set includes: multiple object data, and object features corresponding to each object data; the object features are obtained in the following manner: each object data is input into a neural network model, and the object features corresponding to the object data are output; and / or, the feature set includes: multiple environment data, and environment features corresponding to each environment data; the environment features are obtained in the following manner: each environment data is input into a neural network model, and the environment features corresponding to the environment data are output.

[0006] The above-mentioned neural network model includes a first subnetwork and a second subnetwork; the first subnetwork is used to input object data and output object features of the object data; the second subnetwork is used to input environmental data and output environmental features of the environmental data; the above-mentioned step of inputting the remaining data into a preset neural network model if there is remaining data for which the first feature has not been found in the specified data, and outputting the second feature corresponding to the remaining data, includes: if there is remaining data for which the first feature has not been found in the specified data, determining whether the remaining data belongs to object data or environmental data; if the remaining data belongs to object data, inputting the remaining data into the first subnetwork, outputting the object features corresponding to the remaining data, and using the object features corresponding to the remaining data as the second feature; if the remaining data belongs to environmental data, inputting the remaining data into the second subnetwork, outputting the environmental features corresponding to the remaining data, and using the environmental features corresponding to the remaining data as the second feature.

[0007] The above-mentioned step of searching for the first feature of at least part of the data in the specified data from a preset feature set; if there is remaining data in the specified data for which the first feature has not been found, inputting the remaining data into a preset neural network model, and outputting the second feature corresponding to the remaining data, includes: searching for object features corresponding to the object data of the candidate object from the preset feature set, and taking the object features as the first features; inputting environmental data into the neural network model, outputting environmental features corresponding to the environmental data, and taking the environmental features as the second features.

[0008] The above neural network model is trained in the following manner: searching for the moment when the candidate object was hit from historical game records; collecting object sample data and environmental sample data of the candidate object within a specified time period before the moment of being hit from historical game records; generating training data based on the object sample data and environmental sample data; training the neural network model based on the training data; wherein, in the training data, the sample labels of the object sample data and the environmental sample data are used to indicate: the candidate object that was hit.

[0009] The above-mentioned neural network model includes a first subnetwork, a second subnetwork and a similarity calculation network; the above-mentioned step of training the neural network model based on training data includes: inputting object sample data into the first subnetwork and outputting a first intermediate result; inputting environmental sample data into the second subnetwork and outputting a second intermediate result; inputting the first intermediate result and the second intermediate result into the similarity calculation network and outputting the sample similarity of the first intermediate result and the second intermediate result; training the neural network model based on sample similarity, sample labels, and a preset loss function.

[0010] After the above step of inputting the remaining data into a preset neural network model and outputting the second feature corresponding to the remaining data if there is remaining data in the specified data for which the first feature has not been found, the method further includes: updating the remaining data and the second feature corresponding to the remaining data into the feature set.

[0011] The above-mentioned candidate objects include multiple ones; the above-mentioned step of determining the target object from the candidate objects based on the degree of matching between the environmental features and the object features includes: for each candidate object, inputting the environmental features and the object features of the candidate object into the similarity calculation network in the neural network model, and outputting the similarity corresponding to the candidate objects; and determining the candidate object corresponding to the maximum similarity as the target object.

[0012] In a second aspect, an embodiment of the present invention provides a device for determining a target object, the device comprising: a data acquisition module, for collecting specified data in a current game scene, wherein the specified data includes object data of candidate objects in the current game scene, and environmental data of the current game scene; the environmental data includes: scene data of the current game scene and / or object data of a controlled virtual object; the controlled virtual object and the candidate object are in the same game match; a feature acquisition module, for searching a first feature of at least part of the data in the specified data from a preset feature set; if there is remaining data in the specified data for which the first feature has not been found, the remaining data is input into a preset neural network model, and a second feature corresponding to the remaining data is output; an object determination module, for determining object features corresponding to the object data of the candidate object, and environmental features corresponding to the environmental data from the first feature and the second feature; and determining the target object from the candidate objects based on the degree of matching between the environmental features and the object features.

[0013] In a third aspect, an embodiment of the present invention provides an electronic device, including a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the above-mentioned method for determining the target object.

[0014] In a fourth aspect, an embodiment of the present invention provides a machine-readable storage medium, which stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the above-mentioned method for determining the target object.

[0015] The embodiments of the present invention bring the following beneficial effects:

[0016] The above-mentioned method, device and electronic device for determining the target object collect designated data in the current game scene, wherein the designated data includes object data of candidate objects in the current game scene, and environmental data of the current game scene; the environmental data includes: scene data of the current game scene and / or object data of the controlled virtual object; the controlled virtual object and the candidate object are in the same game match; from a preset feature set, searching for the first feature of at least part of the data in the designated data; if there is remaining data in the designated data for which the first feature has not been found, inputting the remaining data into a preset neural network model, and outputting the second feature corresponding to the remaining data; determining the object feature corresponding to the object data of the candidate object and the environmental feature corresponding to the environmental data from the first feature and the second feature; determining the target object from the candidate objects based on the degree of matching between the environmental feature and the object feature.

[0017] In this method, feature data of some features are calculated in advance and saved in a feature set. When the virtual player makes a target decision, he first searches for the feature in the feature set. If there is data where the feature is not found, the neural network model is used to calculate the feature, and then the target object is determined from the candidate objects based on the degree of match between the environmental features and the object features. This method can enable the virtual player to simulate the target decision of the real player, making the virtual player more humanized and improving the gaming experience of the real player. At the same time, there is no need for all features to be calculated by the neural network model, which reduces the amount of calculation and the computing pressure on the server.

[0018] Other features and advantages of the present invention will be described in the following description, and part of them will become obvious from the description, or be understood by practicing the present invention. The purpose and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description, claims and drawings.

[0019] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative work.

[0021] Figure 1 A flow chart of a method for determining a target object provided by an embodiment of the present invention;

[0022] Figure 2 A schematic diagram of a neural network model provided by an embodiment of the present invention;

[0023] Figure 3 A schematic diagram of the structure of a device for determining a target object provided by an embodiment of the present invention;

[0024] Figure 4 A schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0025] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0026] Virtual players are also called AI (Artificial Intelligence) players. For a long time, the behavior control of virtual players has been controlled by expert rule systems such as finite state machines and behavior trees. Every time the game is updated or the virtual players need to be updated, planners and programmers need to do a lot of maintenance work; among them, the expert rule system has many manual rules, which require professional planners to adjust, and programmers to cooperate in writing the code for related behaviors, which has high labor costs; and due to the limitations of the expert rule system, it is impossible to make virtual players behave as diversely as real players; virtual players have a relatively simple performance in fixed scenes, whether in accompanying play or guiding players to get started, it is easier for real players to identify them as virtual players.

[0027] In another way, supervised learning is used to train the model to learn the target decisions of real players. The behavior of virtual players is controlled by the trained model, which can make the behavior of virtual players behave like real people. However, for some games, the state space is extremely large, and the use of ordinary neural networks will inevitably lead to a large amount of calculation, especially for state synchronization games. Most of the calculation is placed on the server side. For games with high DAU (Daily Active User), it will bring great pressure to the server and consume more resources. In addition, in the process of model training, the use of reinforcement learning training requires high computing power and a long construction period, and most of them remain in the experimental stage. Today, when games are updated more and more frequently, it cannot meet the needs of rapid implementation.

[0028] Based on the above, the embodiments of the present invention provide a method, device and electronic device for determining a target object. This technology can be applied to the target decision-making process of a virtual player in a game scene, for example, the virtual player selects an attack target, an interaction target, etc.

[0029] First, see Figure 1 A flow chart of a method for determining a target object is shown, the method comprising the following steps:

[0030] Step S102, collecting designated data in the current game scene, wherein the designated data includes object data of candidate objects in the current game scene, and environmental data of the current game scene; the environmental data includes: scene data of the current game scene and / or object data of the controlled virtual object; the controlled virtual object and the candidate object are in the same game match;

[0031] In this embodiment, there are usually multiple players participating in the same game, and each player controls a virtual object, which acts in the game scene. The above-mentioned controlled virtual object can be understood as an object controlled by a virtual player, and the above-mentioned candidate object can be an object controlled by a virtual player or a real player. The candidate object can be one or more, and in most cases, there are multiple candidate objects, and then through the steps in this embodiment, the target object is determined from the multiple candidate objects.

[0032] The relationship between the controlled virtual object and the candidate object may be an adversarial relationship, a teammate relationship, or no relationship at all. In the case where the controlled virtual object and the candidate object are in an adversarial relationship, the controlled virtual object determines the target object from the candidate objects in the manner of this embodiment, and the target object may be the attack object of the controlled virtual object. In the case where the controlled virtual object and the candidate object are in a teammate relationship, the controlled virtual object determines the target object from the candidate objects in the manner of this embodiment, and the target object may be an object that further generates a mutual cooperation relationship on the basis of the teammate relationship. In the case where the controlled virtual object and the candidate object do not have any relationship, the controlled virtual object determines the target object from the candidate objects in the manner of this embodiment, and the target object may serve as the teammate object, attack object, etc. of the controlled virtual object.

[0033] The above-mentioned current game scene includes a game environment, a controlled virtual object in the game environment, and an alternative object. The present embodiment aims to select a target object from the alternative objects. For example, the target object can be used as an attack object of the controlled virtual object. Based on this purpose, it is necessary to collect object data of the alternative objects in the current game scene. If the alternative objects include multiple ones, it is necessary to collect object data for each alternative object. The object data of the alternative object may include: the distance between the controlled virtual object and the alternative object, the distance between the alternative object and the specified object in the scene, the game progress status of the alternative object, the moving speed, position, direction and other sub-data of the alternative object.

[0034] The above-mentioned environmental data can be divided into two types. One is scene data, which can specifically include the status of each item or prop in the current game scene, such as the status of rocket chairs, boards, windows and other items in the scene. The other is object data of controlled virtual objects, which can include sub-data such as character information, movement speed, status, position, attack cooldown time, skill cooldown time, and the distance between the controlled virtual character and the specified object of the controlled virtual object. Environmental data can include both scene data and object data of controlled virtual objects, or only one of scene data or object data of controlled virtual objects.

[0035] It should be noted here that the object data of the candidate object mentioned above can be understood as data related to the candidate object, and the environmental data mentioned above can be understood as data unrelated to the candidate object.

[0036] Step S104, searching for a first feature of at least part of the specified data from a preset feature set; if there is remaining data in the specified data for which the first feature has not been found, inputting the remaining data into a preset neural network model, and outputting a second feature corresponding to the remaining data;

[0037] In this embodiment, in order to reduce the amount of computation of the neural network model, the data features of part or all of the specified data are calculated in advance and stored in the above-mentioned feature set. As can be seen from the above description, the specified data can specifically include object data of candidate objects, scene data and object data of controlled virtual objects; taking the object data of candidate objects as an example, one object data may include sub-data such as the distance between the controlled virtual object and the candidate object, the distance between the candidate object and the specified object in the scene, the game progress status of the candidate object, the moving speed, position, and direction of the candidate object. As long as any one of the sub-data in the two object data is different, the two object data can be considered different; the same applies to scene data and object data of controlled virtual objects. Therefore, it can be seen that there may be many types of object data of candidate objects, scene data and object data of controlled virtual objects.

[0038] If the feature set includes data features of the object data of the candidate object, each object data corresponds to one data feature; it should be noted that for the same candidate object, the moving speed of the candidate object is different, and the object data is different at this time; the orientation of the candidate object is different, and the object data is also different at this time. Only when each sub-data in the two object data is the same, can the two object data be considered the same.

[0039] In actual implementation, considering that there are many types of data in the above-mentioned specified data, only the data features corresponding to some of the specified data are saved in the feature set; or when the game is updated, the candidate object is updated, or the controlled virtual object is updated, only the data features corresponding to some of the specified data may be saved in the feature set. That is, it is difficult for the feature set to guarantee that all the data features of the specified data can be found.

[0040] Based on the above, in this embodiment, when the specified data is collected, the corresponding data features can be searched from the feature set for each type of data in the specified data; if the data features of all the data in the specified data can be found from the feature set, then the above-mentioned first feature includes the object features of the object data of the candidate object, and also includes the environmental features of the environmental data; then there is no need to obtain the second feature through the neural network model, and the second feature is empty at this time.

[0041] If only data features of part of the specified data can be found in the feature set, it is necessary to obtain the second features of the remaining data through a neural network model. The neural network model can be a feature extraction network, which can be implemented by a convolutional neural network, etc. The neural network model needs to be pre-trained.

[0042] In a specific implementation, the feature set only stores data features of the candidate object's object data, and the first feature includes the object features of the candidate object's object data; the remaining data is the environmental data, and the environmental data is input into the neural network model to output the environmental features corresponding to the environmental data. In another implementation, the feature set only stores data features of the environmental data, and the first feature includes the environmental features of the environmental data; the remaining data is the candidate object's object data, and the object data is input into the neural network model to output the object features of the candidate object's object data, which is the second feature.

[0043] It should be noted that the set of the first feature and the second feature includes data features of all data in the specified data, but which data features of the specified data the first feature and the second feature respectively include is not limited in this embodiment and needs to be determined based on the feature data in the feature set.

[0044] In addition, the above neural network model can be trained by using the target objects selected by real players in historical game matches, the object features of the target objects when selecting the target objects, and the scene features of the game scenes as training samples, so that the neural network model learns the target roles of real players, so that the output features can reasonably indicate the most reasonable target decision under the premise of the specified data. Considering that in a game, the object data of the candidate objects may be exhaustive, therefore, after the training of the neural network model is completed, the object data of the candidate data that may appear in the game can be first input into the neural network model to obtain the object features and save them in the aforementioned feature set. Alternatively, the environmental data in the game may be exhaustive, therefore, after the training of the neural network model is completed, the environmental data that may appear in the game can be first input into the neural network model to obtain the environmental features and save them in the aforementioned feature set.

[0045] Step S106, determining object features corresponding to the object data of the candidate object and environment features corresponding to the environment data from the first feature and the second feature; determining the target object from the candidate objects based on the matching degree between the environment features and the object features.

[0046] For a real player, when there are multiple candidate objects, it is necessary to comprehensively consider and determine which candidate object is more suitable as the target object based on the scene characteristics of the current game scene, the characteristics of the controlled virtual object controlled by the virtual player, and the object characteristics of each candidate object. Similarly, when controlling the virtual player to select a target object, this embodiment determines the candidate object corresponding to the most matching object characteristics as the target object based on which candidate object's object characteristics better match the environmental characteristics, thereby making the target decision of the virtual player closer to that of the real player.

[0047] The matching degree between the above-mentioned environmental features and the object features may specifically be calculated by parameters such as similarity and distance between the environmental features and the object features, or the matching degree between the environmental features and the object features may be determined by other algorithms.

[0048] The above-mentioned method for determining the target object collects specified data in the current game scene, wherein the specified data includes object data of the candidate objects in the current game scene, and environmental data of the current game scene; the environmental data includes: scene data of the current game scene and / or object data of the controlled virtual object; the controlled virtual object and the candidate object are in the same game match; from a preset feature set, searching for a first feature of at least part of the data in the specified data; if there is remaining data in the specified data for which the first feature has not been found, inputting the remaining data into a preset neural network model, and outputting a second feature corresponding to the remaining data; determining the object feature corresponding to the object data of the candidate object and the environmental feature corresponding to the environmental data from the first feature and the second feature; and determining the target object from the candidate objects based on the degree of matching between the environmental feature and the object feature. In this method, feature data of some features are calculated in advance and saved in a feature set. When the virtual player makes a target decision, he first searches for the feature in the feature set. If there is data where the feature is not found, the neural network model is used to calculate the feature, and then the target object is determined from the candidate objects based on the degree of match between the environmental features and the object features. This method can enable the virtual player to simulate the target decision of the real player, making the virtual player more humanized and improving the gaming experience of the real player. At the same time, there is no need for all features to be calculated by the neural network model, which reduces the amount of calculation and the computing pressure on the server.

[0049] The following embodiments specifically describe the implementation of the feature set. The feature set includes: a plurality of object data, and object features corresponding to each object data; the object features are obtained by: inputting each object data into a neural network model, and outputting the object features corresponding to the object data; and / or, the feature set includes: a plurality of environment data, and environment features corresponding to each environment data; the environment features are obtained by: inputting each environment data into a neural network model, and outputting the environment features corresponding to the environment data.

[0050] In a specific implementation, the above feature set can be implemented by the following Table 1.

[0051] Table 1

[0052]

[0053] Taking the object features of candidate objects as an example, one candidate object may correspond to multiple pieces of object data, and one piece of object data corresponds to one object feature. For the object data of the candidate object in the specified data collected from the current game scene, the object features of the piece of object data can be used as the object features of the object data of the candidate object in the specified data only if they are the same as each sub-data of a piece of object data in the feature set.

[0054] After listing multiple object data, each object data can be input into the neural network model to output object features. For example, in Table 1, one object data includes multiple seed data of R1, D1, B1, M1, S1, K1, and P1, and the object feature corresponding to the object data is Embedding1.

[0055] Similarly, after listing a variety of environmental data, each environmental data can be input into the neural network model to output environmental features. In actual implementation, if the feature space of a certain data is relatively large and there are many types of features, exhaustive data will result in a very large amount of data in the feature set. In this case, consider calculating the features of data with fewer types of features and a limited amount of data in the feature set when exhaustive data is used, and save them in the feature set.

[0056] In a specific implementation, considering that the types of object data of candidate objects in the game scene are limited, only each type of object data and the object features corresponding to each type of object data can be saved in the feature set; or, if the types of environmental data in the game scene are limited, only each type of environmental data and the environmental features corresponding to each type of environmental data can be saved in the feature set. Of course, the feature set can also save multiple types of object data and multiple types of environmental data, as well as the features corresponding to each type of data.

[0057] The following embodiment provides a specific implementation of a neural network model. Figure 2 An example of a neural network model is shown. The neural network model includes a first subnetwork and a second subnetwork; the first subnetwork is used to input object data and output object features of the object data; the second subnetwork is used to input environmental data and output environmental features of the environmental data. The first subnetwork and the second subnetwork are independent networks, and the parameters of the computing layers of the first subnetwork and the second subnetwork, as well as the neurons in the computing layers can be the same or different. The first subnetwork includes multiple computing layers, and the number of neurons in each computing layer is shown; Figure 2As an example only, the number of computing layers in the first sub-network and the number of neurons in each computing layer can be adjusted according to demand, and this embodiment does not limit it. Similarly, the second sub-network includes multiple computing layers, and each computing layer shows the number of neurons in the computing layer; the number of computing layers in the second sub-network and the number of neurons in each computing layer can be adjusted according to demand, and this embodiment does not limit it.

[0058] For example, the first computing layer in the first subnetwork includes 60 neurons, while the first computing layer in the second subnetwork includes 30 neurons. The number of neurons in each computing layer in the first subnetwork and the second subnetwork can be adjusted independently. Figure 2 In the example, the first subnetwork and the second subnetwork both include four computing layers, and the number of computing layers of the first subnetwork and the second subnetwork can also be adjusted independently. For example, the first subnetwork can include five computing layers, the second subnetwork can include three computing layers, and so on.

[0059] If there is remaining data in the specified data for which the first feature has not been found, it is determined that the remaining data belongs to object data or environmental data; if the remaining data belongs to object data, the remaining data is input into the first sub-network, the object features corresponding to the remaining data are output, and the object features corresponding to the remaining data are used as the second features; if the remaining data belongs to environmental data, the remaining data is input into the second sub-network, the environmental features corresponding to the remaining data are output, and the environmental features corresponding to the remaining data are used as the second features.

[0060] Usually, there are many computing layers in a neural network model, and each computing layer has many neurons, which leads to a large number of weight parameters in the neural network model. When the neural network model calculates features, the amount of calculation is large. In this embodiment, the neural network model only calculates some features, thereby reducing the amount of calculation and reducing the computing pressure of the server.

[0061] Considering that the object data of the candidate objects is easier to enumerate, in actual implementation, the object features corresponding to the object data of the candidate objects are searched from the preset feature set, and the object features are used as the first features; the environmental data is input into the neural network model, and the environmental features corresponding to the environmental data are output, and the environmental features are used as the second features. It can be understood that during the game operation, the environmental features corresponding to the environmental data are calculated by the second sub-network of the neural network model, while the first sub-network is in a non-working state. In this way, the amount of computation of the neural network model can be reduced. When the number of computing layers and neurons of the first sub-network and the second sub-network is similar, this method can reduce the amount of computation by nearly half; at the same time, the object data stored in the feature set is also within a certain quantity range, which ensures the efficiency of feature search.

[0062] The following embodiment continues to describe the training method of the neural network model. The neural network model is trained in the following manner: searching for the time when the candidate object was hit from the historical game records; collecting the object sample data and environment sample data of the candidate object within a specified time period before the hit time from the historical game records; generating training data based on the object sample data and environment sample data; training the neural network model based on the training data; wherein, in the training data, the sample labels of the object sample data and environment sample data are used to indicate: the candidate object that was hit.

[0063] The specified time length may be a fixed value or a variable value, for example, the time length between the time when the candidate object is hit and the time when the last candidate object is hit before the hit is used as the specified time length. The two candidate objects here may be the same object or different objects.

[0064] This embodiment is illustrated by taking determining the attack target object from the candidate objects as an example. If it is found from the historical records that the candidate object A was attacked at time t1 and time t2, and the candidate object B was attacked at time t3; at this time, the object sample data and environmental sample data of the candidate object A are collected from time t0 to time t1, and the sample label is set to indicate that the attacked candidate object is the candidate object A; the object sample data and environmental sample data of the candidate object A are collected from time t1 to time t2, and the sample label is set to indicate that the attacked candidate object is the candidate object A; the object sample data and environmental sample data of the candidate object B are collected from time t2 to time t3, and the sample label is set to indicate that the attacked candidate object is the candidate object B.

[0065] It should also be noted that after finding the moment when the candidate object was hit, the cause of the hit can be further determined. If the hit is not caused by the subjective action of the virtual object controlled by the real player, the training data will not have a positive impact on the learning of the model, and in this case, the training data will not be used. The above-mentioned subjective action of the virtual object not controlled by the real player can be, for example, an attack on the candidate object caused by a prop in the scene.

[0066] If the candidate objects include four types, each of the training samples is (Q, D 1 ,D 2 ,D 3 ,D 4 ,y), where y is the sample label, which indicates which candidate object has been hit. Q is the environment sample data, and D1-D4 are the object sample data of the four candidate objects. Since the player's target at the same time is likely to be only one target object, each training sample can be split into four: (Q, D 1 ,0),(Q,D 2,0),(Q,D 3 ,0),(Q,D 4 ,1). Among them, 1 means that the attack target of the virtual object controlled by the real player at this time is the candidate object corresponding to D4. Obviously, 1 can appear in the last position in any line.

[0067] After the model training is completed, the model is mainly used in the scenario where the controlled virtual object is controlled by the virtual player. Since the model has learned some strategies for selecting target objects when the real player controls the virtual object, the model can imitate the real player and control the controlled virtual object to select the target object. The strategy of the controlled virtual object controlled by the virtual player to select the target object is similar to that of the real player, thereby improving the degree of humanization of the virtual player and thus improving the gaming experience of the real player who participates in the game with the virtual player.

[0068] Continue to see Figure 2 The neural network model includes a first subnetwork, a second subnetwork and a similarity calculation network; during the training process, the first subnetwork, the second subnetwork and the similarity calculation network jointly participate in the training; specifically, the object sample data is input into the first subnetwork, and the first intermediate result is output; the environment sample data is input into the second subnetwork, and the second intermediate result is output; the first intermediate result and the second intermediate result are input into the similarity calculation network, and the sample similarity of the first intermediate result and the second intermediate result is output; based on the sample similarity, the sample label, and the preset loss function, the neural network model is trained.

[0069] The first sub-network and the second sub-network map the object sample data and the environment sample data into feature vectors of the same dimension, calculate the sample similarity through the similarity calculation network, and then fit the sample similarity with the sample label to obtain the fitting result, and then adjust the network parameters in the neural network model based on the loss function and the fitting result. The loss function can be a distance-based loss function Hinge Loss, a classification-based loss function SampledSoftmax, etc.

[0070] The similarity calculation network here is used to calculate the similarity between the object sample data and the environment sample data, which can be calculated by cosine similarity or other methods. After the model training is completed, the similarity calculation network can also be used to calculate the similarity between the environmental features and the object features of the candidate objects, and the similarity is used to characterize the degree of match between the environmental features and the object features of the candidate objects.

[0071] Specifically, the candidate objects include multiple ones; for each candidate object, the environmental characteristics and the object characteristics of the candidate object are input into the similarity calculation network in the neural network model, and the similarity corresponding to the candidate object is output; the candidate object corresponding to the maximum similarity is determined as the target object.

[0072] In order to further improve the data in the feature set, the feature combination can be continuously updated during the game. Specifically, the remaining data and the second feature of the remaining data object are updated to the feature set. The more complete the feature set is, the fewer features need to be calculated by the neural network model during the game, and the less computing power the server needs to bear.

[0073] The target object determination method provided in this embodiment requires a certain amount of storage space to store feature sets, thereby reducing the amount of model calculations during game operation, improving calculation effects and reducing the amount of calculations. By exchanging space for time, the amount of computation of the neural network is greatly reduced, reducing the pressure on the server caused by high DAU, and avoiding excessive resource consumption as much as possible.

[0074] Corresponding to the above method embodiment, see Figure 3 A schematic diagram of a target object determination device is shown, the device comprising:

[0075] The data acquisition module 30 is used to acquire the specified data in the current game scene, wherein the specified data includes the object data of the candidate objects in the current game scene and the environmental data of the current game scene; the environmental data includes: the scene data of the current game scene and / or the object data of the controlled virtual object; the controlled virtual object and the candidate object are in the same game game;

[0076] The feature acquisition module 32 is used to search for a first feature of at least part of the specified data from a preset feature set; if there is remaining data in the specified data for which the first feature has not been found, the remaining data is input into a preset neural network model, and a second feature corresponding to the remaining data is output;

[0077] The object determination module 34 is used to determine the object features corresponding to the object data of the candidate object and the environment features corresponding to the environment data from the first feature and the second feature; and determine the target object from the candidate objects based on the matching degree between the environment features and the object features.

[0078] The above-mentioned device for determining the target object collects designated data in the current game scene, wherein the designated data includes object data of candidate objects in the current game scene, and environmental data of the current game scene; the environmental data includes: scene data of the current game scene and / or object data of the controlled virtual object; the controlled virtual object and the candidate object are in the same game match; from a preset feature set, searching for a first feature of at least part of the data in the designated data; if there is remaining data in the designated data for which the first feature has not been found, inputting the remaining data into a preset neural network model, and outputting a second feature corresponding to the remaining data; determining the object feature corresponding to the object data of the candidate object and the environmental feature corresponding to the environmental data from the first feature and the second feature; and determining the target object from the candidate objects based on the degree of matching between the environmental feature and the object feature. In this method, feature data of some features are calculated in advance and saved in a feature set. When the virtual player makes a target decision, he first searches for the feature in the feature set. If there is data where the feature is not found, the neural network model is used to calculate the feature, and then the target object is determined from the candidate objects based on the degree of match between the environmental features and the object features. This method can enable the virtual player to simulate the target decision of the real player, making the virtual player more humanized and improving the gaming experience of the real player. At the same time, there is no need for all features to be calculated by the neural network model, which reduces the amount of calculation and the computing pressure on the server.

[0079] The above-mentioned feature set includes: multiple object data, and object features corresponding to each object data; the object features are obtained in the following manner: each object data is input into a neural network model, and the object features corresponding to the object data are output; and / or, the feature set includes: multiple environment data, and environment features matching each environment data; the environment features are obtained in the following manner: each environment data is input into a neural network model, and the environment features corresponding to the environment data are output.

[0080] The above-mentioned neural network model includes a first subnetwork and a second subnetwork; the first subnetwork is used to input object data and output object features of the object data; the second subnetwork is used to input environmental data and output environmental features of the environmental data; the above-mentioned feature acquisition module is also used to: if there is remaining data in the specified data for which the first feature has not been found, determine whether the remaining data belongs to object data or environmental data; if the remaining data belongs to object data, input the remaining data into the first subnetwork, output the object features corresponding to the remaining data, and use the object features corresponding to the remaining data as the second features; if the remaining data belongs to environmental data, input the remaining data into the second subnetwork, output the environmental features corresponding to the remaining data, and use the environmental features corresponding to the remaining data as the second features.

[0081] The feature acquisition module is also used to: search for object features corresponding to the object data of the candidate object from a preset feature set, and use the object features as the first features; input the environmental data into the neural network model, output the environmental features corresponding to the environmental data, and use the environmental features as the second features.

[0082] The above-mentioned device also includes a model training module, which is used to: find the time when the alternative object was hit from the historical game records; collect object sample data and environmental sample data of the alternative object within a specified time period before the hit time from the historical game records; generate training data based on the object sample data and environmental sample data; train the neural network model based on the training data; wherein, in the training data, the sample labels of the object sample data and the environmental sample data are used to indicate: the alternative object that was hit.

[0083] The above-mentioned model training module is also used to: input object sample data into the first sub-network and output the first intermediate result; input environmental sample data into the second sub-network and output the second intermediate result; input the first intermediate result and the second intermediate result into the similarity calculation network and output the sample similarity of the first intermediate result and the second intermediate result; train the neural network model based on the sample similarity, sample labels, and a preset loss function.

[0084] The above-mentioned device also includes an updating module, which is used to update the remaining data and the second feature of the remaining data object into the feature set.

[0085] The object determination module is used to: for each candidate object, input the environmental features and the object features of the candidate object into the similarity calculation network in the neural network model, output the similarity corresponding to the candidate object; and determine the candidate object with the greatest similarity as the target object.

[0086] This embodiment also provides an electronic device, including a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the method for determining the target object in the above game scene. The electronic device can be a server or a terminal device.

[0087] See also Figure 4 As shown, the electronic device includes a processor 100 and a memory 101, wherein the memory 101 stores machine executable instructions that can be executed by the processor 100, and the processor 100 executes the machine executable instructions to implement the method for determining the target object in the above-mentioned game scene.

[0088] Further, Figure 4 The electronic device shown further includes a bus 102 and a communication interface 103 , and the processor 100 , the communication interface 103 and the memory 101 are connected via the bus 102 .

[0089] The memory 101 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 103 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used. The bus 102 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0090] The processor 100 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 100. The above processor 100 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present invention can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module may be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 101, and the processor 100 reads the information in the memory 101 and completes the steps of the method of the above embodiment in combination with its hardware.

[0091] This embodiment also provides a machine-readable storage medium, which stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the method for determining the target object in the above-mentioned game scene.

[0092] The computer program product of the method, device, electronic device and storage medium for determining the target object in the game scene provided by the embodiments of the present invention includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the method described in the previous method embodiments. The specific implementation can be found in the method embodiments, which will not be repeated here.

[0093] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system and device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0094] In addition, in the description of the embodiments of the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, and it can be the internal communication of two components. For those skilled in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0095] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.

[0096] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.

[0097] Finally, it should be noted that the above embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above embodiments, those skilled in the art should understand that any person skilled in the art can still modify the technical solutions recorded in the above embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. A method for determining a target object, It is characterized in that The method comprises: Collecting designated data in the current game scene, wherein the designated data includes object data of candidate objects in the current game scene and environmental data of the current game scene; the environmental data includes: scene data of the current game scene and / or object data of a controlled virtual object; the controlled virtual object and the candidate object are in the same game match; the controlled virtual object is an object controlled by a virtual player, and the candidate object is an object controlled by a virtual player or a real player; From a preset feature set, search for a first feature of at least part of the data in the specified data; if there is remaining data in the specified data for which the first feature has not been found, input the remaining data into a preset neural network model, and output a second feature corresponding to the remaining data; wherein the feature set pre-stores data features of at least part of the data in the specified data; the feature set includes: a plurality of object data, and object features corresponding to each of the object data; the object features are obtained by: inputting each of the object data into the neural network model, and outputting the object features corresponding to the object data; and / or, the feature set includes: a plurality of environmental data, and environmental features corresponding to each of the environmental data; the environmental features are obtained by: inputting each of the environmental data into the neural network model, and outputting the environmental features corresponding to the environmental data; Determine the object features corresponding to the object data of the candidate object and the environmental features corresponding to the environmental data from the first features and the second features; determine the target object from the candidate objects based on the degree of matching between the environmental features and the object features; the process of determining the target object from the candidate objects includes: the neural network model imitates a real player and controls the controlled virtual object to select the target object from the candidate objects.

2. The method according to claim 1, It is characterized in that The neural network model includes a first sub-network and a second sub-network; the first sub-network is used to input the object data and output the object features of the object data; the second sub-network is used to input the environment data and output the environment features of the environment data; If there is remaining data in the designated data for which the first feature has not been found, the step of inputting the remaining data into a preset neural network model and outputting the second feature corresponding to the remaining data comprises: If there is remaining data in the designated data for which the first feature has not been found, determining that the remaining data belongs to the object data or the environment data; If the remaining data belongs to the object data, input the remaining data into the first sub-network, output the object feature corresponding to the remaining data, and use the object feature corresponding to the remaining data as the second feature; If the remaining data belongs to the environmental data, the remaining data is input into the second sub-network, the environmental features corresponding to the remaining data are output, and the environmental features corresponding to the remaining data are used as the second features.

3. The method according to claim 1, It is characterized in that The step of searching for a first feature of at least part of the specified data from a preset feature set; if there is remaining data in the specified data for which the first feature has not been found, inputting the remaining data into a preset neural network model, and outputting a second feature corresponding to the remaining data comprises: Searching for an object feature corresponding to the object data of the candidate object from a preset feature set, and using the object feature as the first feature; The environmental data is input into the neural network model, and the environmental features corresponding to the environmental data are output, and the environmental features are used as the second features.

4. The method according to claim 1, It is characterized in that The neural network model is trained in the following way: Searching for the attack moment of the candidate object from the historical game records; Collecting object sample data and environment sample data of the candidate object within a specified time period before the attack moment from the historical game record; Generate training data based on the object sample data and the environment sample data; wherein, in the training data, sample labels of the object sample data and the environment sample data are used to indicate: candidate objects to be hit; The neural network model is trained based on the training data.

5. The method according to claim 4, It is characterized in that The neural network model includes a first sub-network, a second sub-network and a similarity calculation network; the step of training the neural network model based on the training data includes: Inputting the object sample data into the first sub-network and outputting a first intermediate result; Inputting the environmental sample data into the second sub-network and outputting a second intermediate result; Inputting the first intermediate result and the second intermediate result into the similarity calculation network, and outputting the sample similarity between the first intermediate result and the second intermediate result; The neural network model is trained based on the sample similarity, the sample label, and a preset loss function.

6. The method according to claim 1, It is characterized in that If there is remaining data in the specified data for which the first feature has not been found, after the step of inputting the remaining data into a preset neural network model and outputting the second feature corresponding to the remaining data, the method further includes: The remaining data and the second feature corresponding to the remaining data are updated into the feature set.

7. The method according to claim 1, It is characterized in that The candidate objects include a plurality of candidate objects; the step of determining the target object from the candidate objects based on the matching degree between the environmental features and the object features includes: For each candidate object, input the environmental features and the object features of the candidate object into a similarity calculation network in the neural network model, and output the similarity corresponding to the candidate object; The candidate object corresponding to the maximum similarity is determined as the target object.

8. A device for determining a target object, It is characterized in that The device comprises: A data acquisition module, used to acquire designated data in the current game scene, wherein the designated data includes object data of candidate objects in the current game scene, and environmental data of the current game scene; the environmental data includes: scene data of the current game scene and / or object data of a controlled virtual object; the controlled virtual object and the candidate object are in the same game match; the controlled virtual object is an object controlled by a virtual player, and the candidate object is an object controlled by a virtual player or a real player; A feature acquisition module, used to search for a first feature of at least part of the data in the specified data from a preset feature set; if there is residual data in the specified data for which the first feature has not been found, input the residual data into a preset neural network model, and output a second feature corresponding to the residual data; wherein the feature set pre-stores data features of at least part of the data in the specified data; the feature set includes: a plurality of object data, and object features corresponding to each of the object data; the object features are obtained by: inputting each of the object data into the neural network model, and outputting the object features corresponding to the object data; and / or, the feature set includes: a plurality of environmental data, and environmental features corresponding to each of the environmental data; the environmental features are obtained by: inputting each of the environmental data into the neural network model, and outputting the environmental features corresponding to the environmental data; An object determination module is used to determine the object features corresponding to the object data of the candidate object and the environmental features corresponding to the environmental data from the first features and the second features; based on the degree of matching between the environmental features and the object features, determine the target object from the candidate objects; the process of determining the target object from the candidate objects includes: the neural network model imitates a real player and controls the controlled virtual object to select the target object from the candidate objects.

9. An electronic device, It is characterized in that The method comprises a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the method for determining a target object according to any one of claims 1 to 7.

10. A machine-readable storage medium, It is characterized in that The machine-readable storage medium stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the method for determining a target object according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Control method and device for virtual object, and electronic device

    CN109999496A

  • Virtual presence system and method through merged reality

    US20200404217A1