CN111760276A - Game behavior control method, device, terminal, server and storage medium - Google Patents

Game behavior control method, device, terminal, server and storage medium Download PDF

Info

Publication number
CN111760276A
CN111760276A CN202010684806.2A CN202010684806A CN111760276A CN 111760276 A CN111760276 A CN 111760276A CN 202010684806 A CN202010684806 A CN 202010684806A CN 111760276 A CN111760276 A CN 111760276A
Authority
CN
China
Prior art keywords
game
behavior
target
picture
training
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010684806.2A
Other languages
Chinese (zh)
Other versions
CN111760276B (en
Inventor
黄超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202010684806.2A priority Critical patent/CN111760276B/en
Publication of CN111760276A publication Critical patent/CN111760276A/en
Application granted granted Critical
Publication of CN111760276B publication Critical patent/CN111760276B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/40Processing input control signals of video game devices, e.g. signals generated by the player or derived from the environment
    • A63F13/44Processing input control signals of video game devices, e.g. signals generated by the player or derived from the environment involving timing of operations, e.g. performing an action within a time slot
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/50Controlling the output signals based on the game progress
    • A63F13/52Controlling the output signals based on the game progress involving aspects of the displayed game scene
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/047Probabilistic or stochastic networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features

Abstract

The embodiment of the invention discloses a game behavior control method, a game behavior control device, a terminal, a server and a storage medium; the embodiment of the invention can obtain the game picture at the moment t1, wherein the game picture comprises the image of the game role; inputting a game picture into the behavior prediction model, so that the game behaviors of the game character under N different delay times are obtained at the time t 2; determining the predicted consumed time according to the time t1 and the time t 2; determining a target output channel in N output channels of the behavior prediction model based on the prediction time consumption; determining the game behavior corresponding to the target output channel as a target game behavior; and controlling the game role to execute target game behaviors in the game. According to the method and the device, the time consumed by prediction is measured, and the output corresponding to the predicted time consumption is selected from the outputs of the output channels as the game behavior to be executed by the game role in the future, so that the influence of the predicted time consumption on the prediction result is reduced. Therefore, the game behavior prediction accuracy can be improved.

Description

Game behavior control method, device, terminal, server and storage medium
Technical Field
The invention relates to the field of games, in particular to a game behavior control method, a game behavior control device, a terminal, a server and a storage medium.
Background
Currently, the game AI can automatically determine which game actions should be executed by the game character at the moment to play the game according to the game picture.
However, when the game AI generates the game behavior, it takes a certain time to perform the calculation, that is, the current generation method of the game behavior may generate a certain delay, and when the delay is too large, the problem that the finally obtained game behavior exceeds the time limit of the game behavior may often occur, so that the current method for predicting the game behavior is not accurate enough.
Disclosure of Invention
The embodiment of the invention provides a game behavior control method, a game behavior control device, a terminal, a server and a storage medium, which can improve the accuracy of the game behavior control method.
The embodiment of the invention provides a game behavior control method, which comprises the following steps:
acquiring a game picture at a time t1, wherein the game picture comprises an image of a game role, and the time t1 is the time of generating the game picture;
inputting the game picture into a behavior prediction model, so as to obtain the game behaviors of the game character under N different delay times at the time t2, wherein the behavior prediction model comprises N output channels, each output channel corresponds to each game behavior, N is a positive integer, and t2 is the time when the prediction of the prediction model is completed;
determining a predicted elapsed time according to the time t1 and the time t 2;
determining a target output channel from the N output channels of the behavior prediction model based on the predicted elapsed time;
determining the game behavior corresponding to the target output channel as a target game behavior;
and controlling the game role to execute the target game behavior in the game.
An embodiment of the present invention further provides a game behavior control device, including:
the game device comprises a picture unit, a processing unit and a display unit, wherein the picture unit is used for acquiring a game picture at the moment t1, and the game picture comprises an image of a game role;
a prediction unit, configured to input the game screen into a behavior prediction model, so as to obtain game behaviors of the game character at N different delay times at time t2, where the behavior prediction model includes N output channels, each output channel corresponds to each game behavior, and N is a positive integer;
the time consumption unit is used for determining predicted time consumption according to the t1 time and the t2 time;
a target unit, configured to determine a target output channel among N output channels of the behavior prediction model based on the predicted elapsed time;
and the behavior unit is used for determining the game behavior corresponding to the target output channel as a target game behavior and controlling the game role to execute the target game behavior in the game.
In some embodiments, the prediction unit comprises:
a characteristic subunit, configured to extract, through the behavior prediction model, a picture characteristic of the game picture;
and the probability subunit is used for determining the probability distribution of the game behavior of the game character in the game picture in j seconds delay on the basis of the picture characteristics in the ith output channel, wherein i is a positive integer less than or equal to N, and j is a rational number greater than 0.
In some embodiments, the target unit is to:
determining the ith output channel as a target output channel;
determining probability distribution of game behaviors of the game characters output by the target output channel in j seconds as target probability distribution;
determining the game behavior of the game character under the j second delay based on the target probability distribution, and taking the behavior of the game character under the j second delay as the target game behavior.
In some embodiments, the feature subunit is to:
determining the output downsampling convolution characteristics of the xth pooling layer, wherein x is a positive integer greater than 0;
performing convolution processing on the downsampling convolution characteristics output by the xth pooling layer on the xth +1 convolution layer to obtain convolution characteristics output by the xth +1 convolution layer;
performing down-sampling processing on the convolution characteristics output by the (x + 1) th convolution layer in the (x + 1) th pooling layer to obtain down-sampling convolution characteristics output by the (x + 1) th pooling layer;
the convolution characteristic output by the 1 st convolution layer is obtained by performing convolution processing on the game picture by the 1 st convolution layer;
and returning and executing the step to determine the downsampling convolution characteristics output by the xth pooling layer until the convolution characteristics output by the last convolution layer are obtained, and mapping the convolution characteristics output by the last convolution layer to a vector space at the full-connection layer to obtain the picture characteristics of the game picture.
In some embodiments, the prediction unit further comprises:
the system comprises a sample subunit, a training sample collection and a control unit, wherein the sample subunit is used for acquiring a preset model and the training sample collection, the training sample collection comprises training samples which are sequenced according to time, and the training samples comprise training images and real behavior labels of game roles in the training images;
a modifying subunit, configured to modify the real behavior label of the tth training sample in the training sample set to the real behavior label of the t + jth training sample in the training sample set, so as to obtain a j-second delayed training sample set, where t and j are rational numbers;
and the training subunit is used for training a preset model by adopting the j-second delayed training sample set until the preset model is converged to obtain a behavior prediction model.
In some embodiments, the preset model includes an output layer including N output channels, the training subunit includes:
the channel submodule is used for determining a target output channel corresponding to j second delay in the N output channels of the preset model;
and the training submodule is used for training the target output channel by adopting the j-second delayed training sample set so as to finish the training of the target output channel until the training of all output channels in a preset model is finished, and obtaining a behavior prediction model.
In some embodiments, the training submodule is to:
performing feature extraction on the training images in the j-second delayed training sample set to obtain picture features of the training images;
determining probability distribution of game role game behaviors in the training image according to the picture features in the target output channel;
determining a predicted game behavior of a game character in the training image based on a probability distribution of game character game behavior in the training image;
determining a loss value of the target output channel based on the predicted game behavior and the real behavior label of the game role in the training image;
modifying a parameter of the target output channel based on the penalty value until the target output channel converges.
In some embodiments, the sample subunit comprises:
the recording submodule is used for recording game pictures, determining the game pictures as training images and determining the recording time as the generation time of the training images;
the generating submodule is used for acquiring the real behavior of the game role at the generating moment fed back when the game is recorded;
the determining submodule is used for determining the real behaviors as real behavior labels of game roles in the training sample;
and the embedding submodule is used for embedding the training sample into a training sample set according to the generation time of the training image.
In some embodiments, the generation submodule is configured to:
when a game is recorded, determining a behavior control triggered in a game picture;
determining game behaviors corresponding to the behavior controls;
and determining the game behavior corresponding to the behavior control as the real behavior of the game role at the generation moment.
In some embodiments, the action unit, when controlling the game character to perform the target game action in a game, is configured to:
determining a behavior control corresponding to the target game behavior in a game picture;
and triggering a behavior control corresponding to the target game behavior in a game picture so as to enable the game role to execute the target game behavior in the game.
The embodiment of the invention also provides a terminal, which comprises a memory, a first memory and a second memory, wherein the memory stores a plurality of instructions; the processor loads instructions from the memory to execute the steps of any one of the game behavior control methods provided by the embodiments of the present invention.
The embodiment of the invention also provides a server, which comprises a memory, a storage and a control unit, wherein the memory stores a plurality of instructions; the processor loads instructions from the memory to execute the steps of any one of the game behavior control methods provided by the embodiments of the present invention.
The embodiment of the present invention further provides a computer-readable storage medium, where multiple instructions are stored in the computer-readable storage medium, and the instructions are suitable for being loaded by a processor to perform any one of the steps in the game behavior control method provided in the embodiment of the present invention.
The embodiment of the invention can obtain the game picture at the moment t1, wherein the game picture comprises the image of the game role; inputting the game picture into a behavior prediction model so as to obtain the game behaviors of the game role under N different delay times at the time t2, wherein the behavior prediction model comprises N output channels, each output channel corresponds to each game behavior, and N is a positive integer; determining the predicted consumed time according to the time t1 and the time t 2; determining a target output channel in N output channels of the behavior prediction model based on the prediction time consumption; determining the game behavior corresponding to the target output channel as a target game behavior; and controlling the game role to execute target game behaviors in the game.
When the game behaviors to be executed by the game character in the future are predicted each time, the game behaviors to be executed by the game character under the j-second delay are predicted through the output of each output channel, the delay of the game character at present is confirmed through calculating the predicted time consumption, and therefore the game behaviors corresponding to the predicted time consumption are selected from the N game behaviors, and the influence of the delay on the prediction result is reduced.
For example, the present invention may predict, through the output channel 1, a game behavior that a game character should execute with a delay of 0.1 second, predict, through the output channel 2, a game behavior that a game character should execute with a delay of 0.2 second, predict, through the output channel 3, a game behavior that a game character should execute with a delay of 0.3 second, and assume that the time taken to calculate this prediction is 0.2 second, may use the game behavior predicted by the output channel 2 as the target game behavior
Therefore, the game behavior prediction accuracy can be improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1a is a schematic view of a scene of a game behavior control method according to an embodiment of the present invention;
FIG. 1b is a flow chart of a game behavior control method according to an embodiment of the present invention;
FIG. 1c is a schematic view of a game role executing a game action in a running game according to an embodiment of the present invention;
FIG. 1d is a schematic structural diagram of a game behavior prediction model provided in an embodiment of the present invention;
FIG. 2a is a flow chart of a game behavior control method according to an embodiment of the present invention;
FIG. 2b is a schematic diagram of a training sample set modification of a game behavior control method according to an embodiment of the present invention;
FIG. 2c is a schematic structural diagram of a default model according to an embodiment of the present invention;
FIG. 3 is a schematic structural diagram of a game behavior control device according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a terminal or a server according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The embodiment of the invention provides a game behavior control method, a game behavior control device, a terminal, a server and a storage medium.
The game behavior control device may be specifically integrated in an electronic device, and the electronic device may be a terminal, a server, or other devices. The terminal can be a mobile phone, a tablet Computer, an intelligent bluetooth device, a notebook Computer, or a Personal Computer (PC), and the like; the server may be a single server or a server cluster composed of a plurality of servers.
In some embodiments, the game behavior control device may be integrated into a plurality of electronic devices, for example, the game behavior control device may be integrated into a plurality of servers, and the game behavior control method of the present invention is implemented by the plurality of servers.
In some embodiments, the server may also be implemented in the form of a terminal.
For example, referring to fig. 1a, the electronic device may be a terminal, and the terminal may automatically intercept a game screen including a game character and record an interception time t1 of the game screen; the terminal adopts a behavior prediction model stored locally to predict N game behaviors of a game character according to a game picture, and records a prediction completion time t2, wherein the behavior prediction model may include an output layer, and the output layer may include N output channels: the output channel 1 predicts the game behavior of the game character after the future delta T1 seconds, the output channel 2 predicts the game behavior of the game character after the future delta T2 seconds, and the … output channel n predicts the game behavior of the game character after the future delta Tn seconds; the terminal determines the predicted time (t2-t1) of the prediction according to the interception time t1 and the prediction completion time t2, and determines a target output channel in N output channels of the behavior prediction model based on the predicted time (t2-t 1); and determining the game behavior corresponding to the target output channel as the target game behavior, and controlling the game role to execute the target game behavior in the game.
For example, when T2-T1 is Δ T2, the output channel 2 may be determined as the target output channel, and the play action corresponding to the output channel 2 may be determined as the target play action.
The following are detailed below. The numbers in the following examples are not intended to limit the order of preference of the examples.
Artificial Intelligence (AI) is a technique that uses a digital computer to simulate the human perception environment, acquire knowledge, and use the knowledge, which can make a machine function similar to human perception, reasoning, and decision making. The artificial intelligence technology mainly comprises a computer vision technology, a voice processing technology, a natural language processing technology, machine learning, deep learning and the like.
Among them, Computer Vision (CV) is a technology for performing operations such as recognition and measurement on a target image by using a Computer instead of human eyes and further performing processing. Computer vision techniques typically include image processing, image recognition, image semantic understanding, image retrieval, virtual reality, augmented reality, synchronized localization and mapping, and other techniques, such as image rendering, image edge extraction, and other image processing techniques.
In this embodiment, a game behavior control method based on simulation learning is provided, and as shown in fig. 1b, a specific flow of the game behavior control method may be as follows:
101. a game screen at time t1 is acquired, and the game screen includes an image of a game character.
Where the time t1 is a picture generation time, that is, a time at which the game picture is generated, and for example, when the game picture is generated at 12 hours, 20 minutes, 14 seconds, and 6 milliseconds, the picture generation time may be recorded as [12:20:14:6 ].
The method for acquiring the game picture and determining the picture generation time of the game picture has various modes, for example, the game picture and the picture generation time can be acquired from a game terminal through a network, and the game terminal can intercept the game picture and record the intercepted time as the picture generation time; for example, a game may be locally executed, a game screen of the locally executed game may be intercepted, and the intercepted time may be used as the screen generation time, and the like.
In some embodiments, a set of game frames may be obtained, which may include a plurality of frames of game frames.
102. And inputting the game picture into a behavior prediction model, so as to obtain the game behaviors of the game character under N different delay times at the time t2, wherein the behavior prediction model comprises N output channels, each output channel corresponds to each game behavior, and N is a positive integer.
The behavior prediction model may be any kind of Neural network model, for example, the behavior prediction model may be a Convolutional Neural Network (CNN), a Full Convolutional Network (FCN), a Recurrent Neural network (CNN), a deep Neural network (CNN), or the like.
The behavior prediction model may include an output layer, where the output layer may include N output channels, and each output channel of the behavior prediction model may predict a game behavior of the game character, where N is a positive integer.
The time t2 is the time when the prediction of the prediction model is completed, and after the prediction is completed, the time when the prediction is completed needs to be recorded, for example, when the prediction model predicts the game behaviors of the game character under N different delay times at 12 hours, 20 minutes, 16 seconds and 6 milliseconds, the time when the prediction is completed can be recorded as [12:20:16:6 ].
The delay time refers to a problem that the game AI delays the control of the game character to execute the target game behavior in the game to a later time due to a time consumption prediction and the like, so that the game character is delayed or lagged when executing the target game behavior in the game.
The game behavior refers to all interaction behaviors of the game character and the game, for example, the game behavior may include releasing game skill, using game props, executing game actions, and the like.
For example, referring to fig. 1c, fig. 1c shows three game behaviors of a game character in a game screen of a cool game, in which the game character can perform a game behavior [ jump ], a game behavior [ squat ], a game behavior [ no action ], and the like; the player can control the game character to execute the corresponding game behavior by triggering the game behavior control on the game picture.
For example, in FIG. 1c, when a player clicks the control "jump," the game character may perform a game action [ jump ], thereby controlling the game character to cross an obstacle ahead; when the player clicks the control 'squat', the game role can execute game action [ squat ], so as to control the game role to drill through the obstacle in front; the game character may perform the game action [ no action ] when the player does not click on any control, thereby controlling the game character to continue running.
For example, in some embodiments, step 102 may include the steps of:
(1) extracting picture characteristics of a game picture through a behavior prediction model;
(2) determining the probability distribution of game behaviors of game characters in the game picture in j seconds delay based on picture features in an ith output channel, wherein the probability distribution of the game behaviors can be used for predicting the game behaviors, i is a positive integer less than or equal to N, and j is a rational number greater than 0;
(3) record time t 2.
The picture features of the game picture may be features including feature information of color, texture, shape, space, content, and the like of the game picture, and the picture features may be expressed in the form of vectors, matrices, and the like.
Each output channel of the behavior prediction model can be used for predicting game behaviors which should be executed by the game character under the delay of j seconds.
For example, the screen feature of the game screen may be input to each output channel, the output of the i-th output channel is a probability distribution of the game behavior of the game character delayed by j seconds, for example, the output layer of the prediction model may include 5 output channels, the output of the 1 st output channel is a probability distribution of the game character to execute the game behavior with 0.5 second delay, the output of the 2 nd output channel is a probability distribution of the game character to execute the game behavior with 1 second delay, the output of the 3 rd output channel is a probability distribution of the game character to execute the game behavior with 1.5 second delay, the output of the 4 th output channel is a probability distribution of the game character to execute the game behavior with 2 second delay, and the output of the 5 th output channel is a probability distribution of the game character to execute the game behavior with 2.5 second delay.
For example, the probability distribution of the 2 nd output channel that the game character should perform the game action with a 1 second delay is shown in table 1:
game behavior Probability of
Jumping 0.3
Squatting down 0.3
No behavior 0.4
TABLE 1
For example, the probability distribution of the output of the 3 rd output channel that the game character should perform the game action with a 1.5 second delay is shown in table 2:
Figure BDA0002587147850000091
Figure BDA0002587147850000101
TABLE 2
In some embodiments, after the probability distribution is obtained through the output channel, the game behavior can be determined according to the probability distribution, so that the game behavior corresponding to the output channel is directly obtained.
For example, in some embodiments, each game behavior may be directly ranked according to the probability distribution, and the game behavior with the highest probability may be determined as the target behavior, for example, referring to table 1, it may be determined that the probability of [ no behavior ] in the probability distribution that the game character should execute the game behavior at a delay of 1 second is the highest, and then the 2 nd output channel corresponds to the game behavior [ no behavior ].
In some embodiments, the prediction completion time is the time after all the output channels in the behavior prediction model output the result, for example, if the prediction model includes 3 output channels, the time when the first output channel outputs the result is [12:20:16:2], the time when the second output channel outputs the result is [12:20:16:4], and the time when the third output channel outputs the result is [12:20:16:6], the latest time [12:20:16:6] is taken as the prediction completion time.
In some embodiments, the prediction completion time is an average of times at which each output channel outputs the result in the behavior prediction model, for example, if the prediction model includes 3 output channels, a time at which a first output channel outputs the result is [12:20:16:2], a time at which a second output channel outputs the result is [12:20:16:4], and a time at which a third output channel outputs the result is [12:20:16:6], the prediction completion time is an average of times at which the results are output by [12:20:16:2], [12:20:16:4], [12:20:16:6], that is, a value of [12:20:16: 4].
The training process of the behavior prediction model will be described below, and the model structure of the behavior prediction model will be described first:
in some embodiments, the behavior prediction model may include a convolutional layer and a fully-connected layer, and the step of "(1) extracting picture features of the game picture" may include the steps of:
A. performing convolution processing on the game picture on the convolution layer to obtain convolution characteristics of the game picture;
B. and mapping the convolution characteristics to a vector space at the full connection layer to obtain the picture characteristics of the game picture.
The convolutional layer may extract feature information of the game screen, the obtained feature information may be referred to as a convolutional feature or a feature map (feature map), and the fully-connected layer may map the feature map generated by the convolutional layer into a vector of a fixed length, so as to obtain the screen feature of the game screen.
For example, a fully-connected layer may convolve feature x1、x2、x3Mapping to vector space to obtain picture characteristics (a) of game picture1,a2,a3):
A1=w11*x1+w12*x2+w13*x3+b1
A2=w21*x1+w22*x2+w23*x3+b2
A3=w31*x1+w32*x2+w33*x3+b3
Wherein, w11~w22、b1~b3Are all parameters of the fully connected layer.
Since one convolution kernel provides only one weight, that is, one convolution kernel can only extract one type of features from a game picture, the feature extraction by one convolution kernel is not sufficient, so that various features can be identified by adding a plurality of convolution kernels to a convolutional layer, and thus, in some embodiments, the convolutional layer may include a plurality of convolutional layers.
Since the number of parameters of the convolution feature is large, overfitting of game behavior prediction may be caused when the number of convolution features is too large, in order to reduce the parameters and keep important feature information of game pictures in the convolution feature, a pooling layer may be added after each convolution layer of the behavior prediction model to perform parameter compression, i.e., downsampling, on the convolution feature.
Because the depth of the convolution features extracted by one convolution layer is limited, in some embodiments, the behavior prediction model may include multiple convolution layers in order to extract more rich, fine and more deeply abstract convolution features.
In some embodiments, the behavior prediction model may include a plurality of convolutional layers and a plurality of pooling layers, each convolutional layer may be followed by one pooling layer, and the step "a. convolving the game frame at the convolutional layer to obtain the convolution characteristic of the game frame" may include the steps of:
determining the output downsampling convolution characteristics of the xth pooling layer, wherein x is a positive integer greater than 0;
performing convolution processing on the downsampling convolution characteristics output by the xth pooling layer on the xth +1 convolution layer to obtain convolution characteristics output by the xth +1 convolution layer;
performing down-sampling processing on the convolution characteristics output by the (x + 1) th convolution layer in the (x + 1) th pooling layer to obtain down-sampling convolution characteristics output by the (x + 1) th pooling layer;
the convolution characteristic output by the 1 st convolution layer is obtained by performing convolution processing on a game picture by the 1 st convolution layer;
and returning and executing the step to determine the downsampling convolution characteristics output by the xth pooling layer until the convolution characteristics output by the last convolution layer are obtained, so that the convolution characteristics of the game picture are obtained.
For example, referring to fig. 1d, in the present scheme, convolution processing may be performed on an image at the 1 st convolution layer to obtain convolution characteristic 1, and then downsampling processing may be performed on the convolution characteristic 1 at the 1 st pooling layer to obtain downsampled convolution characteristic 1; and then, carrying out convolution processing on the downsampling convolution characteristic 1 on the 2 nd convolution layer to obtain a convolution characteristic 2, carrying out downsampling processing on the convolution characteristic 2 on the 2 nd pooling layer to obtain a downsampling convolution characteristic 2, repeating the steps until the downsampling convolution characteristic m is carried out on the mth pooling layer to obtain a downsampling convolution characteristic m, and determining the downsampling convolution characteristic as the final convolution characteristic of the game picture.
The method of downsampling processing may include a maximum pooling method, an average pooling method, and the like, for example, by moving a window with a preset size on the convolution feature, the maximum pooling method stores the maximum number in the window into a matrix, so as to obtain a downsampling convolution feature; and the average pooling method averages all numbers in the window and stores the averaged numbers in a matrix, thereby obtaining the downsampling convolution characteristic.
103. And determining the predicted time consumption according to the time t1 and the time t 2.
Here, the prediction elapsed time may be equal to the prediction completion time t1 minus the picture generation time t 2.
For example, if the picture generation time t1 is 12:20:14:6, the prediction completion time t2 is 12:20:16:7, and the prediction takes 2.1 seconds.
104. And determining a target output channel in the N output channels of the behavior prediction model based on the prediction time consumption.
Since each output channel corresponds to one delay, the output channel corresponding to the delay that is closest to the predicted elapsed time may be determined as the target output channel.
For example, the output layer of the prediction model may include 5 output channels, where the 1 st output channel corresponds to 0.5 second delay, the 2 nd output channel corresponds to 1 second delay, the 3 rd output channel corresponds to 1.5 second delay, the 4 th output channel corresponds to 2 second delay, and the 5 th output channel corresponds to 2.5 second delay; assuming that the predicted elapsed time is 2.1 seconds, which is closest to the 2 second delay, the 4 th output channel is determined as the target output channel.
105. And determining the game behavior corresponding to the target output channel as the target game behavior, and controlling the game role to execute the target game behavior in the game.
Since the probability distribution of the game character's game behavior in the game screen at the i-th output channel can be determined based on the screen characteristics in step 102, at this time, in some embodiments, step 105 may include the following steps:
determining the ith output channel as a target output channel;
determining probability distribution of game behaviors of game characters corresponding to the target output channel in j seconds as target probability distribution;
and determining the target game behavior of the game character under the delay of j seconds based on the target probability distribution.
For example, in some embodiments, the game play with the highest probability may be determined as the target game play based on the probability distribution.
In some embodiments, step 105, in controlling a game character to perform a target game action in a game, may include the steps of:
determining a behavior control corresponding to the target game behavior in the game;
and triggering a behavior control corresponding to the target game behavior in the game so that the game role adopts the target game behavior to interact with the game.
For example, referring to fig. 1c, assuming that the target game behavior is "squat", the corresponding behavior control "squat" in the game may be triggered, so that the game character performs a squat action in the game.
As can be seen from the above, the embodiment of the present invention can acquire the game screen at the time t1, where the game screen includes the image of the game character; inputting the game picture into a behavior prediction model so as to obtain the game behaviors of the game role under N different delay times at the time t2, wherein the behavior prediction model comprises N output channels, each output channel corresponds to each game behavior, and N is a positive integer; determining the predicted consumed time according to the time t1 and the time t 2; determining a target output channel in N output channels of the behavior prediction model based on the prediction time consumption; determining the game behavior corresponding to the target output channel as a target game behavior; and controlling the game role to execute target game behaviors in the game.
Therefore, each output channel in the prediction model provided by the scheme can predict the game behavior of the game role which should be executed under a certain delay, and after the prediction is completed, the scheme can calculate the delay caused by the time consumed by the prediction, so that the target output channel corresponding to the delay is determined in the N output channels, the game behavior output by the target output channel is determined as the target game behavior of the game role which should be executed under the delay, and the accuracy of the game behavior control method is improved.
The method described in the above embodiments is further described in detail below.
The scheme can improve the accuracy of the game behavior control method, particularly games such as sound games and running games which have high requirements on behavior timeliness, and can effectively reduce the influence of delay caused by time consumption on the game behavior timeliness.
Therefore, in the present embodiment, the method according to the embodiment of the present invention will be described in detail by taking training of a behavior prediction model for a running game as an example.
As shown in fig. 2a, a specific flow of a game behavior control method is as follows:
201. the method comprises the steps of obtaining a preset model and a training sample set, wherein the training sample set can comprise training samples sequenced according to time, and the training samples can comprise training images and real behavior labels of game characters in the training images.
The model structure of the preset model is the same as that of the behavior prediction model in step 102, and the network parameters of the preset model can be changed by training the preset model, so that the behavior prediction model in step 102 is obtained.
The training samples can include training images and real behavior labels of game characters in the training images, the real behavior labels are real game behavior labels of the game characters in the training images, and the real behavior labels can be labeled on the training images.
The preset model and the training sample set may be obtained through a variety of methods, for example, the preset model and the training sample set may be obtained from a server through a network, may be entered locally by a technician, and thus obtained locally, and for example, the training sample set may be automatically intercepted from a game terminal running locally, and the like.
For example, in order to improve the efficiency of acquiring the training sample set and achieve automatic acquisition of the training sample set, in some embodiments, the training of the model may be performed by a method simulating learning, so that the computer may automatically acquire the preset model and the training sample set, so step 201 may include the following steps:
recording a game picture, determining the game picture as a training image, and determining the recorded moment as the generation moment of the training image;
acquiring the real behavior of the game role fed back when the game is recorded at the generating moment;
determining the real behaviors as real behavior labels of game roles in the training samples;
and putting the training samples into the training sample set according to the generation time of the training images.
For example, the embodiment may run a game in a computer, and automatically intercept multiple frames of images, where each frame of image is intercepted, that is, the action that the game character is performing at the time of this interception is automatically confirmed, so as to generate a real action label, take the frame of image and the real action label as a training sample, and finally compose multiple training samples into a training sample set according to the interception time.
For example, in some embodiments, the action that the game character is performing at the time of the interception may be automatically confirmed, so as to generate the real action annotation, and the step "obtaining the real action of the game character at the time of generation that is fed back at the time of recording the game" may include the following steps:
when a game is recorded, determining a behavior control triggered in a game picture;
determining game behaviors corresponding to the behavior controls;
and determining the game behavior corresponding to the behavior control as the real behavior of the game role at the generation moment.
For example, a game picture may be recorded when a user plays a game, and a game behavior corresponding to a behavior control triggered in the game picture by the user is detected, so that the game behavior corresponding to the behavior control is determined as a real behavior of a game character at a generation time.
For example, when a user plays a game, a frame of game screen is captured, a position clicked by a finger of the user in the game screen is detected, a behavior control corresponding to the position in the frame of game screen is determined to be a behavior control x, and a game behavior corresponding to the behavior control x is a game behavior a, so that the game behavior a can be determined as a real behavior of a game character at a generation time, and the game behavior a is marked on the frame of game screen.
202. And modifying the real behavior label of the training sample at the t second in the training sample set into the real behavior label of the training sample at the t + j second in the training sample set to obtain a training sample set with j second delay, wherein t and j are rational numbers.
In order to reduce the influence of delay on the timeliness of the generated game behaviors, the scheme can move the real behavior labels of the training sample sets forward according to various delays set by technicians, so that a plurality of training sample sets are obtained, and the real behavior labels of the training samples in the newly generated training sample sets are equivalent to the game behaviors to be executed by game characters in the training images at future moments.
For example, referring to fig. 2b, when j is 0.2, the real behavior of the 0.2 th image in the original training sample set is labeled [ motionless ] as the real behavior of the 0 th image in the training sample set delayed by 0.2 seconds; marking the real behavior of the 0.3 th image in the original training sample set as the real behavior of the 0.1 th image in the 0.2 second delayed training sample set; marking the real behavior of the 0.4 th image in the original training sample set as the real behavior of the 0.2 th image in the 0.2 second delayed training sample set; and taking the real behavior mark [ motionless ] of the 0.5 th image in the original training sample set as the real behavior mark of the 0.3 th image in the training sample set with 0.2 second delay.
By setting the value of j, a plurality of training sample sets with j-second delay can be obtained, for example, if j is equal to 1, 2, and 3, a training sample set with 1-second delay, a training sample set with 2-second delay, and a training sample set with 3-second delay are obtained.
203. And training the preset model by adopting the j-second delayed training sample set until the preset model is converged to obtain a behavior prediction model.
In this embodiment, the model structure of the preset model may refer to fig. 2c, and includes 5 convolutional layers and 4 pooling layers, and a full-connected layer and an output layer, where each convolutional layer may include two convolutional cores, and the output layer includes 3 output channels, where the output channel 1 may be set by a technician to be used for generating that the game character should execute the game behavior with a delay of 0.1 second, the output channel 2 may be set by the technician to be used for generating that the game character should execute the game behavior with a delay of 0.2 second, and the output channel 3 may be set by the technician to be used for generating that the game character should execute the game behavior with a delay of 0.3 second.
In step 202, a training sample set with 0.1 second delay, a training sample set with 0.2 second delay, and a training sample set with 0.3 second delay may be obtained, and these training sample sets are used to train the preset model until the preset model converges, so that the behavior prediction model may be obtained.
Thus, in some embodiments, the preset model may include an output layer, the output layer may include N output channels, and step 203 may include the steps of:
(1) determining a target output channel corresponding to j second delay in N output channels of a preset model;
(2) and training the target output channel by adopting the j-second delayed training sample set, thereby finishing the training of the target output channel until the training of all output channels in the preset model is finished, and obtaining the behavior prediction model.
In some embodiments, the step "(2) training the target output channel with the j-second delayed training sample set" may include the steps of:
1. performing feature extraction on the training images in the j-second delayed training sample set to obtain picture features of the training images;
2. determining probability distribution of game behaviors of the game roles in the training images according to the picture characteristics in a target output channel;
3. determining a predicted game behavior of the game character in the training image based on a probability distribution of the game behavior of the game character in the training image;
4. determining a loss value of a target output channel based on the predicted game behavior and the real behavior label of the game role in the training image;
5. modifying parameters of the target output channel based on the loss value until the target output channel converges.
For example, when training is performed by using a training sample delayed by 0.2 second, the control method similar to step 102 may be used to predict the predicted game behavior of the training sample delayed by 0.2 second, so as to obtain the output results of the output channels 1, 2, and 3, determine the loss value of the output channel 2 according to the output result of the output channel 2 and the real behavior label of the training sample delayed by 0.2 second, modify the parameter of the output channel 2 according to the loss value of the output channel 2, and repeat the above steps until the preset model converges, so as to obtain the behavior prediction model.
For example, a plurality of output results of the output channel 2 can be obtained by updating parameters of a preset model for a plurality of times in a training process, and the loss value of the output channel 2 is calculated by counting the output results and according to the real behavior label.
In some embodiments, the preset model may include a convolutional layer and a fully connected layer, and the step "1. performing feature extraction on the training images in the training sample set delayed by j seconds to obtain the picture features of the training images" may include the following steps:
performing convolution processing on training images in the training sample set delayed for j seconds on the convolution layer to obtain convolution characteristics of a game picture;
and mapping the convolution characteristics to a vector space at the full connection layer to obtain the picture characteristics of the game picture.
Step "1, performing feature extraction on the training images in the training sample set delayed by j seconds to obtain the picture features of the training images" is similar to step 102, and thus is not described herein again.
204. The method comprises the steps of obtaining a game picture, determining picture generation time of the game picture, predicting N game behaviors of a game role according to the game picture by adopting a behavior prediction model, recording prediction completion time, determining prediction time consumption according to the picture generation time and the prediction completion time, determining a target output channel in N output channels of the behavior prediction model based on the prediction time consumption, and determining the game behavior corresponding to the target output channel as target game behavior.
For example, the computer may intercept the game image at time t1, obtain the behavior probability distribution output by each output channel in the behavior prediction model at time t2, calculate the predicted elapsed time (t2-t1), and determine the target game behavior according to the behavior probability distribution output by the prediction model corresponding to the elapsed time.
205. And determining a behavior control corresponding to the target game behavior in the game, and triggering the behavior control corresponding to the target game behavior in the game so as to enable the game role to interact with the game by adopting the target game behavior.
For example, when the action is [ jump ], a button for jumping in the game is automatically triggered; when the action is squatting, a button for squatting in the game is automatically triggered; when the action is [ do not act ], the game button is not clicked.
As can be seen from the above, the embodiment of the present invention may obtain a preset model and a training sample set, where the training sample set may include training samples ordered according to time, and the training samples may include training images and real behavior labels of game characters in the training images; modifying the real behavior label of the training sample at the t second in the training sample set into the real behavior label of the training sample at the t + j second in the training sample set to obtain a training sample set delayed by j seconds; training a preset model by adopting a j-second delayed training sample set until the preset model is converged to obtain a behavior prediction model; acquiring a game picture, determining picture generation time of the game picture, predicting N game behaviors of a game role according to the game picture by adopting a behavior prediction model, and recording prediction completion time, so that prediction time consumption is determined according to the picture generation time and the prediction completion time, a target output channel is determined in N output channels of the behavior prediction model based on the prediction time consumption, and the game behavior corresponding to the target output channel is determined as target game behavior; and determining a behavior control corresponding to the target game behavior in the game, and triggering the behavior control corresponding to the target game behavior in the game so as to enable the game role to interact with the game by adopting the target game behavior.
Therefore, the delayed training sample set can be obtained according to the real behavior labels of the training samples in the delayed forward training sample set, and a plurality of output channels corresponding to the delay are constructed for the preset model, so that after the delayed training sample set is adopted to train the preset model, the behavior prediction model obtained after training can accurately predict the game behavior under the condition of different delays, the influence of the delay on game behavior prediction is greatly reduced, and the accuracy of game behavior prediction is improved.
In order to better implement the above method, an embodiment of the present invention further provides a game behavior control device, where the game behavior control device may be specifically integrated in an electronic device, and the electronic device may be a terminal, a server, or other devices. The terminal can be a mobile phone, a tablet computer, an intelligent Bluetooth device, a notebook computer, a personal computer and other devices; the server may be a single server or a server cluster composed of a plurality of servers.
For example, in the present embodiment, the method of the embodiment of the present invention will be described in detail by taking an example in which the game behavior control device is specifically integrated in the terminal.
For example, as shown in fig. 3, the game behavior control device may include a screen unit 301, a prediction unit 302, a time-consuming unit 303, a target unit 304, and a behavior unit 305, as follows:
a (first) picture unit 301.
The screen unit 301 may be configured to acquire a game screen at time t1, the game screen including an image of a game character.
And (ii) a prediction unit 302.
The prediction unit 302 may be configured to input the game screen to a behavior prediction model, so as to obtain the game behaviors of the game character at N different delay times at time t2, where the behavior prediction model includes N output channels, each output channel corresponding to each game behavior, and N is a positive integer.
In some embodiments, the prediction unit 302 may include a feature subunit and a probability subunit, as follows:
(1) a feature subunit.
The feature subunit may be configured to extract a picture feature of the game picture by the behavior prediction model.
In some embodiments, the feature subunit may be configured to perform the steps of:
determining the output downsampling convolution characteristics of the xth pooling layer, wherein x is a positive integer greater than 0;
performing convolution processing on the downsampling convolution characteristics output by the xth pooling layer on the xth +1 convolution layer to obtain convolution characteristics output by the xth +1 convolution layer;
performing down-sampling processing on the convolution characteristics output by the (x + 1) th convolution layer in the (x + 1) th pooling layer to obtain down-sampling convolution characteristics output by the (x + 1) th pooling layer;
the convolution characteristic output by the 1 st convolution layer is obtained by performing convolution processing on a game picture by the 1 st convolution layer;
and returning and executing the step to determine the downsampling convolution characteristics output by the xth pooling layer until the convolution characteristics output by the last convolution layer are obtained, and mapping the convolution characteristics output by the last convolution layer to a vector space at the full-connection layer to obtain the picture characteristics of the game picture.
(2) A probability subunit.
The probability subunit may be configured to determine, at the ith output channel, a probability distribution of game behavior of the game character in the game screen at a delay of j seconds based on the screen feature, where i is a positive integer less than or equal to N, and j is a rational number greater than 0.
In some embodiments, the prediction unit 302 may further include a sample subunit, a modification subunit, and a training subunit, as follows:
(1) a sample subunit.
The sample subunit may be configured to obtain a preset model and a training sample set, where the training sample set includes training samples sorted according to time, and the training samples include training images and real behavior labels of game characters in the training images.
In some embodiments, the sample subunit may include a recording submodule, a generating submodule, a determining submodule, and an embedding submodule, as follows:
A. and a recording submodule.
The recording submodule may be configured to record a game screen, determine the game screen as a training image, and determine a recording time as a generation time of the training image.
B. And generating a submodule.
The generation submodule can be used for acquiring the real behaviors of the game characters fed back when the game is recorded at the generation moment.
In some embodiments, the generation submodule may be operable to perform the steps of:
when a game is recorded, determining a behavior control triggered in a game picture;
determining game behaviors corresponding to the behavior controls;
and determining the game behavior corresponding to the behavior control as the real behavior of the game role at the generation moment.
C. A sub-module is determined.
The determination submodule may be configured to determine the real-world behavior as a real-world behavior token for the game character in the training sample.
D. And (5) placing a submodule.
The embedding submodule may be configured to embed the training samples into the training sample set according to the generation time of the training image.
(2) The sub-unit is modified.
The modifying subunit may be configured to modify the real behavior label of the tth training sample in the training sample set to the real behavior label of the t + j second training sample in the training sample set, so as to obtain a j-second delayed training sample set, where t and j are rational numbers.
(3) A training subunit.
The training subunit may be configured to train the preset model using the j-second delayed training sample set until the preset model converges, so as to obtain a behavior prediction model.
In some embodiments, the preset model includes an output layer, the output layer includes N output channels, and the training subunit may include a channel submodule and a training submodule as follows:
A. and (5) a channel submodule.
The channel submodule may be configured to determine a target output channel corresponding to the j-second delay among the N output channels of the preset model.
B. And training the submodule.
The training submodule can be used for training the target output channel by adopting the j-second delayed training sample set, so that the training of the target output channel is completed until the training of all output channels in the preset model is completed, and the behavior prediction model is obtained.
In some embodiments, the training submodule may be configured to perform the steps of:
performing feature extraction on training images in the j-second delayed training sample set to obtain feature vectors of the training images;
determining probability distribution of game behaviors of the game roles in the training images according to the feature vectors in the target output channel;
determining a predicted game behavior of the game character in the training image based on a probability distribution of the game behavior of the game character in the training image;
determining a loss value of a target output channel based on the predicted game behavior and the real behavior label of the game role in the training image;
modifying parameters of the target output channel based on the loss value until the target output channel converges.
(III) time consuming Unit 303
The time consuming unit 303 may be configured to determine the predicted time consumption according to time t1 and time t 2.
(IV) target unit 304.
The target unit 304 may be configured to determine a target output channel among the N output channels of the behavior prediction model based on the predicted elapsed time.
In some embodiments, the target unit 304 may be configured to perform the following steps:
determining the ith output channel as a target output channel;
determining probability distribution of game behaviors of the game role output by the target output channel in j seconds as target probability distribution;
and determining the game behavior of the game character under the j second delay based on the target probability distribution, and taking the behavior of the game character under the j second delay as the target game behavior.
And (five) an action unit 305.
The behavior unit 305 may be configured to determine a game behavior corresponding to the target output channel as a target game behavior, and control the game character to execute the target game behavior in the game.
In some embodiments, the behavior unit 305, when controlling a game character to perform a target game behavior in a game, may be configured to perform the following steps:
determining a behavior control corresponding to the target game behavior in the game picture;
and triggering the corresponding behavior control of the target game behavior in the game picture so as to enable the game role to execute the target game behavior in the game.
In a specific implementation, the above units may be implemented as independent entities, or may be combined arbitrarily to be implemented as the same or several entities, and the specific implementation of the above units may refer to the foregoing method embodiments, which are not described herein again.
As can be seen from the above, the game behavior control apparatus of the present embodiment can obtain the game screen at the time t1 from the screen unit, where the game screen includes the image of the game character; inputting the game picture into a behavior prediction model by a prediction unit, so as to obtain the game behaviors of the game character under N different delay times at the time t2, wherein the behavior prediction model comprises N output channels, each output channel corresponds to each game behavior, and N is a positive integer; determining a predicted elapsed time by the elapsed time unit according to the time t1 and the time t 2; determining, by the target unit, a target output channel among the N output channels of the behavior prediction model based on the predicted elapsed time; and determining the game behavior corresponding to the target output channel as the target game behavior by the behavior unit, and controlling the game character to execute the target game behavior in the game.
Therefore, the accuracy of game behavior prediction can be improved.
The embodiment of the invention also provides the electronic equipment which can be equipment such as a terminal, a server and the like. The terminal can be a mobile phone, a tablet computer, an intelligent Bluetooth device, a notebook computer, a personal computer and the like; the server may be a single server, a server cluster composed of a plurality of servers, or the like.
In some embodiments, the game behavior control device may be integrated into a plurality of electronic devices, for example, the game behavior control device may be integrated into a plurality of servers, and the game behavior control method of the present invention is implemented by the plurality of servers.
In this embodiment, a detailed description will be given by taking the electronic device of this embodiment as an example of a terminal, for example, as shown in fig. 4, which shows a schematic structural diagram of a terminal according to an embodiment of the present invention, specifically:
the terminal may include components such as a processor 401 of one or more processing cores, memory 402 of one or more computer-readable storage media, a power supply 403, an input module 404, and a communication module 405. Those skilled in the art will appreciate that the terminal configuration shown in fig. 4 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components. Wherein:
the processor 401 is a control center of the terminal, connects various parts of the entire terminal using various interfaces and lines, and performs various functions of the terminal and processes data by operating or executing software programs and/or modules stored in the memory 402 and calling data stored in the memory 402, thereby performing overall monitoring of the terminal. In some embodiments, processor 401 may include one or more processing cores; in some embodiments, processor 401 may integrate an application processor, which primarily handles operating systems, user interfaces, applications, etc., and a modem processor, which primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 401.
The memory 402 may be used to store software programs and modules, and the processor 401 executes various functional applications and data processing by operating the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data created according to the use of the terminal, and the like. Further, the memory 402 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 access to the memory 402.
The terminal also includes a power supply 403 for powering the various components, and in some embodiments, the power supply 403 may be logically coupled to the processor 401 via a power management system, such that the power management system may perform functions of managing charging, discharging, and power consumption. The power supply 403 may also include any component of one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
The terminal may also include an input module 404, the input module 404 being operable to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
The terminal may also include a communication module 405, and in some embodiments the communication module 405 may include a wireless module, through which the terminal may wirelessly transmit over short distances, thereby providing wireless broadband internet access to the user. For example, the communication module 405 may be used to assist a user in sending and receiving e-mails, browsing web pages, accessing streaming media, and the like.
Although not shown, the terminal may further include a display unit and the like, which will not be described in detail herein. Specifically, in this embodiment, the processor 401 in the terminal loads the executable file corresponding to the process of one or more application programs into the memory 402 according to the following instructions, and the processor 401 runs the application programs stored in the memory 402, thereby implementing various functions as follows:
acquiring a game picture at the time of t1, wherein the game picture comprises an image of a game role;
inputting the game picture into a behavior prediction model so as to obtain the game behaviors of the game role under N different delay times at the time t2, wherein the behavior prediction model comprises N output channels, each output channel corresponds to each game behavior, and N is a positive integer;
determining the predicted consumed time according to the time t1 and the time t 2;
determining a target output channel in N output channels of the behavior prediction model based on the prediction time consumption;
determining the game behavior corresponding to the target output channel as a target game behavior;
and controlling the game role to execute target game behaviors in the game.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
Therefore, the game behavior prediction method and the game behavior prediction device can improve the accuracy of game behavior prediction.
It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by instructions or by associated hardware controlled by the instructions, which may be stored in a computer readable storage medium and loaded and executed by a processor.
To this end, embodiments of the present invention provide a computer-readable storage medium, in which a plurality of instructions are stored, where the instructions can be loaded by a processor to execute steps of any one of the game behavior control methods provided by the embodiments of the present invention. For example, the instructions may perform the steps of:
acquiring a game picture at the time of t1, wherein the game picture comprises an image of a game role;
inputting the game picture into a behavior prediction model so as to obtain the game behaviors of the game role under N different delay times at the time t2, wherein the behavior prediction model comprises N output channels, each output channel corresponds to each game behavior, and N is a positive integer;
determining the predicted consumed time according to the time t1 and the time t 2;
determining a target output channel in N output channels of the behavior prediction model based on the prediction time consumption;
determining the game behavior corresponding to the target output channel as a target game behavior;
and controlling the game role to execute target game behaviors in the game.
Wherein the storage medium may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.
Since the instructions stored in the storage medium can execute the steps in any one of the game behavior control methods provided in the embodiments of the present invention, the beneficial effects that can be achieved by any one of the game behavior control methods provided in the embodiments of the present invention can be achieved, which are detailed in the foregoing embodiments and will not be described herein again.
The game behavior control method, device, terminal, server and computer-readable storage medium provided by the embodiments of the present invention are described in detail above, and a specific example is applied in the description to explain the principle and the implementation of the present invention, and the description of the above embodiments is only used to help understanding the method and the core idea of the present invention; meanwhile, for those skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (14)

1. A game play behavior control method, comprising:
acquiring a game picture at a time t1, wherein the game picture comprises an image of a game role, and the time t1 is the time of generating the game picture;
inputting the game picture into a behavior prediction model, so as to obtain the game behaviors of the game character under N different delay times at the time t2, wherein the behavior prediction model comprises N output channels, each output channel corresponds to each game behavior, N is a positive integer, and t2 is the time when the prediction of the prediction model is completed;
determining a predicted elapsed time according to the time t1 and the time t 2;
determining a target output channel from the N output channels of the behavior prediction model based on the predicted elapsed time;
determining the game behavior corresponding to the target output channel as a target game behavior;
and controlling the game role to execute the target game behavior in the game.
2. A game behavior control method according to claim 1, wherein the inputting of the game screen to the behavior prediction model to obtain the game behavior of the game character at N different delay times at time t2 comprises:
extracting picture features of the game picture through the behavior prediction model;
and determining the probability distribution of game behaviors of the game characters in the game pictures in j seconds delay on the basis of the picture characteristics in the ith output channel, wherein i is a positive integer less than or equal to N, and j is a rational number greater than 0.
3. The game behavior control method according to claim 2, wherein the determining the game behavior corresponding to the target output channel as the target game behavior comprises:
determining the ith output channel as a target output channel;
determining probability distribution of game behaviors of the game characters output by the target output channel in j seconds as target probability distribution;
determining the game behavior of the game character under the j second delay based on the target probability distribution, and taking the behavior of the game character under the j second delay as the target game behavior.
4. The game behavior control method according to claim 2, wherein the prediction network includes a convolutional layer, a pooling layer, and a full-link layer, and the extracting picture features of the game picture by the behavior prediction model includes:
determining the output downsampling convolution characteristics of the xth pooling layer, wherein x is a positive integer greater than 0;
performing convolution processing on the downsampling convolution characteristics output by the xth pooling layer on the xth +1 convolution layer to obtain convolution characteristics output by the xth +1 convolution layer;
performing down-sampling processing on the convolution characteristics output by the (x + 1) th convolution layer in the (x + 1) th pooling layer to obtain down-sampling convolution characteristics output by the (x + 1) th pooling layer;
the convolution characteristic output by the 1 st convolution layer is obtained by performing convolution processing on the game picture by the 1 st convolution layer;
and returning and executing the step to determine the downsampling convolution characteristics output by the xth pooling layer until the convolution characteristics output by the last convolution layer are obtained, and mapping the convolution characteristics output by the last convolution layer to a vector space at the full-connection layer to obtain the picture characteristics of the game picture.
5. A game play behavior control method according to claim 1, wherein before the game screen is input to the behavior prediction model, the method further comprises:
acquiring a preset model and a training sample set, wherein the training sample set comprises training samples sequenced according to time, and the training samples comprise training images and real behavior labels of game roles in the training images;
modifying the real behavior label of the training sample at the t second in the training sample set into the real behavior label of the training sample at the t + j second in the training sample set to obtain a training sample set delayed by j seconds, wherein t and j are rational numbers;
and training a preset model by adopting the j-second delayed training sample set until the preset model is converged to obtain a behavior prediction model.
6. The game behavior control method of claim 5, wherein the preset model comprises an output layer, the output layer comprises N output channels, and the training of the preset model using the j-second delayed training sample set until the preset model converges to obtain the behavior prediction model comprises:
determining a target output channel corresponding to j second delay in the N output channels of the preset model;
and training the target output channel by adopting the j-second delayed training sample set, thereby finishing the training of the target output channel until the training of all output channels in a preset model is finished, and obtaining a behavior prediction model.
7. A game play activity control method as claimed in claim 6, wherein said training of said target output channel with said j-second delayed training sample set comprises:
performing feature extraction on the training images in the j-second delayed training sample set to obtain picture features of the training images;
determining probability distribution of game role game behaviors in the training image according to the picture features in the target output channel;
determining a predicted game behavior of a game character in the training image based on a probability distribution of game character game behavior in the training image;
determining a loss value of the target output channel based on the predicted game behavior and the real behavior label of the game role in the training image;
modifying a parameter of the target output channel based on the penalty value until the target output channel converges.
8. A game behaviour control method according to claim 5, wherein said obtaining a set of training samples comprises:
recording a game picture, determining the game picture as a training image, and determining the recorded moment as the generation moment of the training image;
acquiring the real behavior of the game role at the generating moment fed back when the game is recorded;
determining the real behaviors as real behavior labels of game roles in the training samples;
and placing the training sample into a training sample set according to the generation time of the training image.
9. The game behavior control method according to claim 8, wherein the acquiring of the real behavior of the game character fed back at the time of game recording at the time of the generation includes:
when a game is recorded, determining a behavior control triggered in a game picture;
determining game behaviors corresponding to the behavior controls;
and determining the game behavior corresponding to the behavior control as the real behavior of the game role at the generation moment.
10. A game play activity control method according to claim 1, wherein the controlling of the game character to execute the target game play activity in a game comprises:
determining a behavior control corresponding to the target game behavior in a game picture;
and triggering a behavior control corresponding to the target game behavior in a game picture so as to enable the game role to execute the target game behavior in the game.
11. A game play activity control apparatus, comprising:
the game device comprises a picture unit, a processing unit and a display unit, wherein the picture unit is used for acquiring a game picture at the moment t1, and the game picture comprises an image of a game role;
a prediction unit, configured to input the game screen into a behavior prediction model, so as to obtain game behaviors of the game character at N different delay times at time t2, where the behavior prediction model includes N output channels, each output channel corresponds to each game behavior, and N is a positive integer;
the time consumption unit is used for determining predicted time consumption according to the t1 time and the t2 time;
a target unit, configured to determine a target output channel among N output channels of the behavior prediction model based on the predicted elapsed time;
and the behavior unit is used for determining the game behavior corresponding to the target output channel as a target game behavior and controlling the game role to execute the target game behavior in the game.
12. A terminal comprising a processor and a memory, said memory storing a plurality of instructions; the processor loads instructions from the memory to perform the steps of the game behaviour control method according to any one of claims 1 to 10.
13. A server comprising a processor and a memory, the memory storing a plurality of instructions; the processor loads instructions from the memory to perform the steps of the game behaviour control method according to any one of claims 1 to 10.
14. A computer readable storage medium storing instructions adapted to be loaded by a processor to perform the steps of the method of any of claims 1 to 10.
CN202010684806.2A 2020-07-16 2020-07-16 Game behavior control method, device, terminal, server and storage medium Active CN111760276B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010684806.2A CN111760276B (en) 2020-07-16 2020-07-16 Game behavior control method, device, terminal, server and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010684806.2A CN111760276B (en) 2020-07-16 2020-07-16 Game behavior control method, device, terminal, server and storage medium

Publications (2)

Publication Number Publication Date
CN111760276A true CN111760276A (en) 2020-10-13
CN111760276B CN111760276B (en) 2022-06-14

Family

ID=72726802

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010684806.2A Active CN111760276B (en) 2020-07-16 2020-07-16 Game behavior control method, device, terminal, server and storage medium

Country Status (1)

Country Link
CN (1) CN111760276B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116351072A (en) * 2023-04-06 2023-06-30 北京羯磨科技有限公司 Robot script recording and playing method and device in online game

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1910870A (en) * 2004-01-09 2007-02-07 日本电气株式会社 Load distributing method, node, and control program
CN109241946A (en) * 2018-10-11 2019-01-18 平安科技(深圳)有限公司 Abnormal behaviour monitoring method, device, computer equipment and storage medium
CN109582463A (en) * 2018-11-30 2019-04-05 Oppo广东移动通信有限公司 Resource allocation method, device, terminal and storage medium
CN109634714A (en) * 2018-11-02 2019-04-16 北京奇虎科技有限公司 A kind of method and device of intelligent scheduling
CN109718556A (en) * 2019-01-30 2019-05-07 腾讯科技(深圳)有限公司 Game data processing method, device and server
CN109847367A (en) * 2019-03-06 2019-06-07 网易(杭州)网络有限公司 A kind of prediction technique, model generating method and the device of game winning rate
CN110152290A (en) * 2018-11-26 2019-08-23 深圳市腾讯信息技术有限公司 Game running method and device, storage medium and electronic device
CN110339569A (en) * 2019-07-08 2019-10-18 深圳市腾讯网域计算机网络有限公司 Control the method and device of virtual role in scene of game
US20190321727A1 (en) * 2018-04-02 2019-10-24 Google Llc Temporary Game Control by User Simulation Following Loss of Active Control
CN111282272A (en) * 2020-02-05 2020-06-16 腾讯科技(深圳)有限公司 Information processing method, computer readable medium and electronic device

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1910870A (en) * 2004-01-09 2007-02-07 日本电气株式会社 Load distributing method, node, and control program
US20190321727A1 (en) * 2018-04-02 2019-10-24 Google Llc Temporary Game Control by User Simulation Following Loss of Active Control
CN109241946A (en) * 2018-10-11 2019-01-18 平安科技(深圳)有限公司 Abnormal behaviour monitoring method, device, computer equipment and storage medium
CN109634714A (en) * 2018-11-02 2019-04-16 北京奇虎科技有限公司 A kind of method and device of intelligent scheduling
CN110152290A (en) * 2018-11-26 2019-08-23 深圳市腾讯信息技术有限公司 Game running method and device, storage medium and electronic device
CN109582463A (en) * 2018-11-30 2019-04-05 Oppo广东移动通信有限公司 Resource allocation method, device, terminal and storage medium
CN109718556A (en) * 2019-01-30 2019-05-07 腾讯科技(深圳)有限公司 Game data processing method, device and server
CN109847367A (en) * 2019-03-06 2019-06-07 网易(杭州)网络有限公司 A kind of prediction technique, model generating method and the device of game winning rate
CN110339569A (en) * 2019-07-08 2019-10-18 深圳市腾讯网域计算机网络有限公司 Control the method and device of virtual role in scene of game
CN111282272A (en) * 2020-02-05 2020-06-16 腾讯科技(深圳)有限公司 Information processing method, computer readable medium and electronic device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李艳等: "RTS游戏中用户行为的神经网络预测模型", 《计算机工程与设计》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116351072A (en) * 2023-04-06 2023-06-30 北京羯磨科技有限公司 Robot script recording and playing method and device in online game

Also Published As

Publication number Publication date
CN111760276B (en) 2022-06-14

Similar Documents

Publication Publication Date Title
CN111260754B (en) Face image editing method and device and storage medium
CN108920213B (en) Dynamic configuration method and device of game
CN111741330B (en) Video content evaluation method and device, storage medium and computer equipment
CN107423398A (en) Exchange method, device, storage medium and computer equipment
JP7374209B2 (en) Virtual object movement control method, movement control device, terminal and computer program
CN110349572A (en) A kind of voice keyword recognition method, device, terminal and server
CN111973996B (en) Game resource release method and device
US11551479B2 (en) Motion behavior pattern classification method, system and device
CN110738211A (en) object detection method, related device and equipment
CN111292262B (en) Image processing method, device, electronic equipment and storage medium
CN111079833B (en) Image recognition method, image recognition device and computer-readable storage medium
CN112052948B (en) Network model compression method and device, storage medium and electronic equipment
CN112232258A (en) Information processing method and device and computer readable storage medium
CN111325204B (en) Target detection method, target detection device, electronic equipment and storage medium
CN111666919A (en) Object identification method and device, computer equipment and storage medium
CN113344184B (en) User portrait prediction method, device, terminal and computer readable storage medium
CN111079001A (en) Decoration recommendation information generation method and device, storage medium and electronic equipment
CN111760276B (en) Game behavior control method, device, terminal, server and storage medium
CN112995757B (en) Video clipping method and device
CN111026267A (en) VR electroencephalogram idea control interface system
CN113633983A (en) Method, device, electronic equipment and medium for controlling expression of virtual character
CN116680391A (en) Custom dialogue method, training method, device and equipment for custom dialogue model
CN107657657A (en) A kind of three-dimensional human modeling method, device, system and storage medium
CN110287912A (en) Method, apparatus and medium are determined based on the target object affective state of deep learning
CN111652073B (en) Video classification method, device, system, server and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40030731

Country of ref document: HK

GR01 Patent grant
GR01 Patent grant