# Application of Artificial Intelligence in Digital Games Based on Mathematical Statistics

Authors: Lian Xue
Journal: Mobile Information Systems
 (2022)

---

## Abstract

Digital games are various games designed and developed with digital technology and implemented on digital equipment. With the active development of the modern game industry, related technologies such as real-time graphics rendering, realistic interaction, and artificial intelligence of games are also constantly improving. Among them, the artificial intelligence technology of games is limited by the development of theoretical artificial intelligence and the calculation time of real-time systems, and the development lags behind graphics and interactive technology. In order to solve these problems, this paper proposes the application of artificial intelligence in digital games based on mathematical statistics methods, aimed at studying and improving the intelligence level of digital games. The method of this paper is to study the mathematical statistics method and the basic principle of Sarsa learning algorithm and then propose the technology of artificial intelligence applied to digital games. The role of these methods is to study different types of mathematical statistics, to study the behavioral tree of artificial intelligence in digital games and the development prospects of the game, and to update the value of artificial intelligence in each iteration according to the Sarsa algorithm formula. This paper proposes a decision-making system to improve the intelligence level of digital games by analyzing the research status of digital games and the mathematical statistics of basketball digital games. In the basketball game experiment, the difference between the operation data of the decision-making system proposed in this paper and the operation data of human players in five game items reaches 0.51, 0.83, 0.58, 0.49, and 0.78, respectively.


---

## Body

## 1. Introduction

Artificial intelligence has been used in computer games since the very beginning and has been an integral part of gaming, unchanged from the days of Pong and Pac-Man until recently. This paper studies the application of mathematical statistics in classification and correlation analysis. It studies the principles of group customer valuation, construction of relevant indicators, indicator screening methods and weights, customer stratification, and customer value evaluation system, as well as customer stratification service standards and occupancy rates based on this model. In the past ten years, the computing speed of computer hardware has been significantly improved, which has driven the innovation of related computing technologies and led to the rapid development of the game industry. Game sales will increase year by year, many companies have invested in the game industry, and some big-budget games cost hundreds of millions of dollars to develop.In recent years, research on artificial intelligence in games has gradually increased. However, while most research on artificial intelligence in games is limited to the development and technical aspects of game engines, the development of technical aspects also affects visual effects and through the pursuit of “real” visual effects. Artificial intelligence can respond to technology, improve advanced technology, and bring new inspiration and creativity to research at the technical level. This topic combines technology and art and comprehensively studies in-game artificial intelligence technology from multiple perspectives, as well as the multilevel impact of artificial intelligence technology on game intelligence.The innovation of this paper is to propose a technology based on Sarsa algorithm for behavior tree optimization of digital games, which improve the way of creating artificial intelligence behavior trees in digital games, and provide a behavior tree workflow that can use the algorithm. This paper summarizes the respective characteristics of digital games and artificial intelligence technology according to the development status of digital games and artificial intelligence and demonstrates the technical feasibility of artificial intelligence technology to participate in digital game creation. This paper uses artificial intelligence technology to find a creative path for digital games to meet human needs and discusses the transformation of digital game creation concepts and the in-depth exploration of specific creative ideas in which artificial intelligence technology participates. It proposes the concept of interactive artificial intelligence on the basis of artificial intelligence games and discusses the development process of artificial intelligence technology participating in the creation of digital games.


## 2. Related Work

The development of digital games is changing with each passing day, and the research on them is also increasing. How to enhance the application of artificial intelligence in games is a hot research area in academia. Zhao proposed the definite (limit) value calculation formula of RM and DFM test values. He established a mathematical statistical method of residual static torque control by defining relevant parameters, limiting the corresponding torque limit value, the ratio of the measured value to the true value, and the confidence coefficient related to the confidence degree and confidence probability, which improved the residual torque control [1]. The aim of Mbbchir was to develop a statistical model based on patient parameters to predict the length of stay in the intensive care unit after cardiac surgery. The model was used to classify patients into short-term or long-term hospitalizations, and the measurements and main results of the experiment showed that EuroSCORE could be used to differentiate and predict patients for various surgical procedures in the ICU [2]. Alekseev studied the degree of multiple dependencies of wavelet transform coefficients obtained from the parameters of network packets, calculated standard deviations on this basis, and clustered the obtained coefficients to identify anomalies of the investigated network. He proposed to use the mathematical tool of wavelet transform to obtain clusters of coefficients to detect characteristics in major network traffic [3]. Hassabis et al. believe that a better understanding of biological brains could play a crucial role in building intelligent machines. They investigate the historical interaction between the fields of artificial intelligence and neuroscience and highlight current advances in artificial intelligence that may be key to advancing future research in both fields [4]. Makridakis surveys the current state of AI applications in healthcare and discusses its future. He studied the application of artificial intelligence in the treatment of stroke disease in detail, mainly analyzing the three main areas of early detection and diagnosis of patients, treatment, and outcome prediction and prognosis evaluation [5]. Liu et al. attempted to conduct a comprehensive review of artificial intelligence algorithms in rotating machinery fault diagnosis from both theoretical background and industrial application [6]. Sam calls the pattern of recipients and donors responding with an intelligent strategy a “numbers game.” She conducted in-depth interviews and observations on the daily life of councillors in a city, and based on existing data, she studied the preeminent position of outcome-based aid in the digital game [7].


## 3. Mathematical and Statistical Methods of Artificial Intelligence

### 3.1. Mathematical Statistical Methods

The basic methods of mathematical statistics include stochastic simulation, parameter estimation (Bayesian statistics), hypothesis testing, and statistical decision theory [8]. Mathematical statistics can usually be divided into the following categories: The first category is sampling survey and experimental design. Discussions are primarily concerned with theoretical and methodological issues in the collection of observational and experimental data, as well as statistical inference. The second type of task is mainly to explain the principles and methods of statistical inference. The third category includes product sampling inspection, statistical quality control, and reliability statistics. Mathematical statistics according to the application of mathematical statistics method classification are usually divided into three categories, that is, thinking method, descriptive method, and statistical inference method.


#### 3.1.1. Random Simulation

The stochastic differential equations (i.e., the chemical Langevin equations) are described below. First, this paper presents the basic concepts of Poisson random variables and Poisson processes. Poisson random variable:X is a Poisson random variable with parameter q, represented by X to Pq, and obeys a distribution.
(1)ProbX=n=qne−qn!,n=0,1,2⋯n.And the function form of the stochastic differential equation is as follows:(2)Pxn=qt,xet+σt,xtent,where the mean and variance ofX are both q.Poisson process:Xt is a Poisson process with intensity q. If X0=0, then the probability of Xt increasing by more than 2 in a very short time interval h is higher than h. The probability of Oh=1 is qh+Oh. The Poisson process is a continuous time counting process. One of its important characteristics is that the number of events recorded by the Poisson process with intensity q follows a Poisson distribution with parameters within a period t,t+a, that is,
(3)Xt+a−Xt~Pqa.Therefore, the evolution of a random chemical reaction system can be written as the following stochastic simulation equation:(4)Xt=X0+∑j=1MKjtvj.Kjt represents the total number of occurrences of reaction Rj before time t. Since this is a random variable, Xt is also a random variable, so if Kjt+a represents when the system state is Xt=x, the number of times the reaction Rj occurs in time t,t+a is as follows.
(5)Xt+a=Xt+∑j=1MKjt,avj.The above stochastic differential equation gives a good approximation of the stochastic processXt+a if the system satisfies the following two conditions: The time interval a is large enough that the expected number of chemical reactions occurring at the time interval t,t+a is much greater than 1. That is, it looks like this:
(6)ajxa>1∀1<j<M.Assuming that the propensity functionajXt corresponding to all responses in the time interval is almost constant,
(7)ajXt′≈ajXt,∀t′∈t,t+a,∀1≤j≤M.Typically, each reaction increases or decreases the amount of a particular molecule by one. Therefore, when the number of reactant molecules in the system is much larger than 1, as long asa is small enough, it is easy to satisfy the condition. Since the number of occurrences of reaction channel Rj in t,t+a follows a Poisson distribution in the expected ajxa, equation (4) can be rewritten as follows.
(8)Xt+a=Xt+∑j=1MPjajXtavj.At this time, the Poisson random variablePjajXta can be approximated as a normally distributed random variable with the same mean and variance.
(9)PjajXta≈NajXta,ajXta,ajXta>1.So equation (7) can be rewritten approximately as follows:
(10)Xt+a=Xt+∑j=1MNjajXta,XtavjNote that this article uses a normally distributed continuous random variable to obtain a Poisson random variable with approximately integer values. Taking advantage of the properties of the normal distribution, equation (9) can be rewritten in the following format.
(11)Xt+a=Xt+∑j=1MajXtavj+∑j=1MajXta0.5vjNj0,1.Next, whenq is dt, time t is white noise Ejt and represents a random variable satisfying an independent normal distribution Nj0,1, and equation (10) is transformed as follows.
(12)Xt+a=Xt+∑j=1MajXtavjdt+∑j=1Maj0.5XtvjEjtdt0.5Through the statistical analysis of the sample orbits, it can obtain the time course of the probability density of the system state and the statistical properties of interest in this paper.


#### 3.1.2. Bayesian Statistics

Bayesian network parameter learning refers to the process of learning the conditional probability distribution table of nodes from training data on the basis of a given network structure. Parameter learning can also be called parameter estimation, and incorrect model parameters will affect subsequent inference results. Bayesian network structure learning is to learn the corresponding DAG structure from the training sample data, as shown in Figure1.Figure 1
Bayesian network structure learning.If the set of random variablesC=C1,C2,⋯,n and the training dataset G=G1,G2,⋯,Gn for these variables, where n is the number of samples, the purpose of structure learning is to output the corresponding DAG graph structure G. The sample carrier holding device may each include a retainer portion including a vacuum cup bonded material electromagnet or a mechanical device configured to hold the sample carrier. When there are few variables, such as only 1 or 2 variables, its structure can be easily determined. However, when the number of nodes increases, the corresponding possible directed acyclic graph structure also shows an exponential increase. The following function is satisfied between the number of DAGs g,z and the number of nodes n:
(13)gn=1,∑i=1n−1i+1Cni2in−ign−1,n=1,n>1.Obviously,g5=29281 and g10=4.2×1018, and it is absolutely impossible to simply build the structure manually. The structure learning method based on the search score regards the Bayesian network structure learning problem as an optimization problem and uses the search algorithm to find the network structure with the highest score through the scoring function of the specified structure. The mathematical model of structural learning based on search scoring can be expressed as follows:
(14)maxfG,D,s.t.G∈g,G=C.Among them,f is the structure scoring function, g is the structure space (that is, the possible structures), and G=C means that the structure G satisfies the constraint C. Constraint C represents the number of samples, which will be processed according to the formula below when certain parameters are obtained. Therefore, the optimal structure G∗ can be expressed as follows:
(15)G∗=argmaxGfG,D.In structure learning based on search scoring, the first problem is how to calculate its scorefG,D given training data D and a possible structure G. The Bayesian-based scoring function treats equation (14) as the following MAP problem:
(16)G∗=argmaxGPGD,where PGD is the posterior probability of structure G given D. Assuming that the prior probability of G is PG, according to the Bayesian formula, it can be known that
(17)PGD=PDGPGPD.SincePD is independent of G, the logarithm of both sides can be obtained:
(18)logPGD=logPDG+logPG.Assume that the parameters of the model structureG are as follows:
(19)PDG=∫∆G0PDG,∆GP∆GGd∆G.


#### 3.1.3. Statistical Decision-Making

Fuzzy Statistical Decision Theory has no such definition in previous research, and here is a brand new definition name. The features of this project have been explained in detail in the previous section and will not be repeated here. Based on the abovementioned characteristics, there is no method fully adapting to the abovementioned problems in the existing methods. Therefore, a new comprehensive integrated method is proposed here to solve the problem of risk assessment of such projects, hoping to achieve a better assessment effect than ever before. The challenge of this chapter is to study the risk factor assessment method of the project, which is mainly based on the combination of fuzzy hierarchical structure and AHP method. On the basis of the two-dimensional comprehensive evaluation method adopted by the previous scholars, it avoids its shortcomings and establishes a four-dimensional comprehensive evaluation system.


### 3.2. Artificial Intelligence Applied to Digital Games

Games are a peculiar form of human life, but also an integral part of human material production life. From time immemorial or even earlier, there have been games where human civilization has emerged. In ancient China, there were widely circulated and well-known games, such as pitching pots and rolling balls. At the same time, humans also have games for different age groups, from building blocks to childhood jigsaw puzzles, to adult board games, sports games, and more. In fact, the game is not just for fun, and the game itself has certain characteristics. Games can not only bring joy to people but also entertain and educate people, which is very important for the integration of different cultures. Digital games are developing rapidly and have become popular all over the world. As an emerging cultural and creative industry, digital games have better development prospects than other cultural and creative industries. At the same time, the sales of digital game software, hardware, and the game itself are growing rapidly at this stage. Game companies represented by Microsoft, Sony, Nin-tendon, etc., are constantly launching refreshing products and achieving great success [9].Generally speaking, game AI is divided into two layers, decision-making and behavior. The behavior layer can be understood as a middleware in the game. The upper layer is the decision logic, and the lower layer is the animation resources. The work goal is to convert AI requests into animation playback requests. A puppy’s behavioral definitions may include the following: walking, running, sleeping, eating, and drinking. These can be thought of as a series of its actions or logical actions. These behaviors form a collection called a behavior pool. A behavior tree is an efficient way to organize these behaviors.Behavior tree (behavior tree, BT for short) is a tree structure containing hierarchical nodes used to control AI decision behavior. Each time an update is performed, the behavior tree runs a depth-first scan until the underlying leaf node returns success or the status changes to “running” [10]. According to this traversal mechanism, the AI needs to prioritize the behavior tree, and this behavior may need to be placed in the left branch of the behavior tree at design time.Here we use the behavior of a soldier in the game as an example to introduce the structure of the behavior tree. Figure2 shows the behavior tree of a game character.Figure 2
Game character behavior tree structure.When it comes to deciding what kind of behavior the current soldier is going to do, we are going to search the tree from the top down, through some criteria, and finally determine the leaf nodes that need to be done and execute it. The input to the algorithm is a behavior tree, and the tree is first analyzed to find the deepest sequence nodes, which act as reinforcement learning actions to establish theA values corresponding to the A value table.The generatedA value table can be easily split into subtables, the A value subtable of actions corresponding to actions in the behavior tree. The subtable A values are sorted from high to low, and the parameter selection corresponds to the state with the highest percentage A value [11]. Figure 3 illustrates this process, and the main table is divided into subtables by actions, placed in conditional nodes instead of conditional nodes. Subsequent algorithms filter the corresponding states based on the parameters, leaving only a specific percentage of the highest A values.Figure 3
Inserting a conditional node into the behavior tree based on theA value.In this chapter, we will design and implement a popular AI engine based on Unity3D to support common game types and common game AI key technologies on the market. This article will introduce the general design and overall architecture of the engine. The engine is divided into three parts: basic framework class, intelligent agent architecture, and message mechanism. Next, this paper analyzes the design and implementation of these three parts in detail. The main basic components supporting the engine are the basic framework classes and the design and implementation of decision-making systems, perception systems, and behavioral systems [12]. This article introduces the intelligent agent in detail and finally explains the main role of the message mechanism and the message types used in the engine. The general AI engine implemented in this chapter meets the performance characteristics of generality, efficiency, flexibility, extensibility, customization, and platform expansion. It can help game developers quickly build the artificial intelligence required in the game, make the characters and creatures in the game more lifelike, and bring players a more “immersive” game experience.


### 3.3. Basic Principles of Sarsa Learning Algorithm

Sarsa learning algorithm belongs to reinforcement learning staggered learning, which is an in-policy learning method for solving decision/control problems. The Sarsa algorithm estimates the action value functionQπs,a of all executable actions a in any state s under policy π. Here, the TD prediction algorithm can be used to estimate the Q-function [13]. The equation for the Sarsa algorithm to update the action value is as follows:
(20)Qst,at=Qst,at+art+1+vQst+1,at+1−Qst,at.Among them,Qst,at is the action value of taking action a in the current state s, and Qst+1,at+1 is the action value of taking action in the next state. rt+1 is the instantaneous reward of performing the action in this state, t is the number of iterations, a is the learning rate, and v is the conversion factor.The Sarsa algorithm relies on two tables:One is the state-action reward table (called theR table), where each row represents a state. Each column represents an action, and the table value represents the reward for taking that action in that state. By defining the table value of the R table, it can define a reward for the action in each state. With the continuous progress of the algorithm, the rewards of different actions in different states will affect the weights of the corresponding actions in each state. Generally speaking, the value of a row and a column on the R table is positively correlated with the weight of the action corresponding to the final corresponding state [14].One is a state-action table (called aQ table). Each Q table corresponds to an R table with the same number of rows and columns. The table value of the Q table represents the weight of the corresponding action in the corresponding state, and the weight is used by the artificial intelligence to make judgments. Generally speaking, after determining the state, the algorithm will choose the action with the larger weight [15]. The table value is not constant, and it updates its own value in each iteration according to the update equation. After many iterations (generally greater than 2000), the values in the table tend to stabilize.A∗ algorithm is the most effective direct search method to solve the shortest path in static road network and also an effective algorithm to solve many search problems. The closer the distance estimated value in the algorithm is to the actual value, the faster the final search speed. The A∗ algorithm uses a heuristic estimation function h to predict the remaining distance between the current node and the endpoint. When fv is used to represent the path cost from the starting point S to the destination T through node v, the ordered queue usually has nodes v sorted according to fv from small to large. The equation for calculating fv by the A∗ algorithm is as follows:
(21)fv=gS,v+hv,T.In the equation,gS,v is the path cost from the starting point S to the node v, and hv,T is the estimation of the remaining distance from the current point v to the end point T. Dijkstra’s algorithm and A∗ algorithm are traditional shortest path algorithms, they can solve the shortest path problem in static environment. However, in a dynamic environment, the weights on each road section change in real time, and the traditional shortest path algorithm cannot divert vehicles, which will lead to excessive vehicle concentration and congestion transfer [16].


## 3.1. Mathematical Statistical Methods

The basic methods of mathematical statistics include stochastic simulation, parameter estimation (Bayesian statistics), hypothesis testing, and statistical decision theory [8]. Mathematical statistics can usually be divided into the following categories: The first category is sampling survey and experimental design. Discussions are primarily concerned with theoretical and methodological issues in the collection of observational and experimental data, as well as statistical inference. The second type of task is mainly to explain the principles and methods of statistical inference. The third category includes product sampling inspection, statistical quality control, and reliability statistics. Mathematical statistics according to the application of mathematical statistics method classification are usually divided into three categories, that is, thinking method, descriptive method, and statistical inference method.


### 3.1.1. Random Simulation

The stochastic differential equations (i.e., the chemical Langevin equations) are described below. First, this paper presents the basic concepts of Poisson random variables and Poisson processes. Poisson random variable:X is a Poisson random variable with parameter q, represented by X to Pq, and obeys a distribution.
(1)ProbX=n=qne−qn!,n=0,1,2⋯n.And the function form of the stochastic differential equation is as follows:(2)Pxn=qt,xet+σt,xtent,where the mean and variance ofX are both q.Poisson process:Xt is a Poisson process with intensity q. If X0=0, then the probability of Xt increasing by more than 2 in a very short time interval h is higher than h. The probability of Oh=1 is qh+Oh. The Poisson process is a continuous time counting process. One of its important characteristics is that the number of events recorded by the Poisson process with intensity q follows a Poisson distribution with parameters within a period t,t+a, that is,
(3)Xt+a−Xt~Pqa.Therefore, the evolution of a random chemical reaction system can be written as the following stochastic simulation equation:(4)Xt=X0+∑j=1MKjtvj.Kjt represents the total number of occurrences of reaction Rj before time t. Since this is a random variable, Xt is also a random variable, so if Kjt+a represents when the system state is Xt=x, the number of times the reaction Rj occurs in time t,t+a is as follows.
(5)Xt+a=Xt+∑j=1MKjt,avj.The above stochastic differential equation gives a good approximation of the stochastic processXt+a if the system satisfies the following two conditions: The time interval a is large enough that the expected number of chemical reactions occurring at the time interval t,t+a is much greater than 1. That is, it looks like this:
(6)ajxa>1∀1<j<M.Assuming that the propensity functionajXt corresponding to all responses in the time interval is almost constant,
(7)ajXt′≈ajXt,∀t′∈t,t+a,∀1≤j≤M.Typically, each reaction increases or decreases the amount of a particular molecule by one. Therefore, when the number of reactant molecules in the system is much larger than 1, as long asa is small enough, it is easy to satisfy the condition. Since the number of occurrences of reaction channel Rj in t,t+a follows a Poisson distribution in the expected ajxa, equation (4) can be rewritten as follows.
(8)Xt+a=Xt+∑j=1MPjajXtavj.At this time, the Poisson random variablePjajXta can be approximated as a normally distributed random variable with the same mean and variance.
(9)PjajXta≈NajXta,ajXta,ajXta>1.So equation (7) can be rewritten approximately as follows:
(10)Xt+a=Xt+∑j=1MNjajXta,XtavjNote that this article uses a normally distributed continuous random variable to obtain a Poisson random variable with approximately integer values. Taking advantage of the properties of the normal distribution, equation (9) can be rewritten in the following format.
(11)Xt+a=Xt+∑j=1MajXtavj+∑j=1MajXta0.5vjNj0,1.Next, whenq is dt, time t is white noise Ejt and represents a random variable satisfying an independent normal distribution Nj0,1, and equation (10) is transformed as follows.
(12)Xt+a=Xt+∑j=1MajXtavjdt+∑j=1Maj0.5XtvjEjtdt0.5Through the statistical analysis of the sample orbits, it can obtain the time course of the probability density of the system state and the statistical properties of interest in this paper.


### 3.1.2. Bayesian Statistics

Bayesian network parameter learning refers to the process of learning the conditional probability distribution table of nodes from training data on the basis of a given network structure. Parameter learning can also be called parameter estimation, and incorrect model parameters will affect subsequent inference results. Bayesian network structure learning is to learn the corresponding DAG structure from the training sample data, as shown in Figure1.Figure 1
Bayesian network structure learning.If the set of random variablesC=C1,C2,⋯,n and the training dataset G=G1,G2,⋯,Gn for these variables, where n is the number of samples, the purpose of structure learning is to output the corresponding DAG graph structure G. The sample carrier holding device may each include a retainer portion including a vacuum cup bonded material electromagnet or a mechanical device configured to hold the sample carrier. When there are few variables, such as only 1 or 2 variables, its structure can be easily determined. However, when the number of nodes increases, the corresponding possible directed acyclic graph structure also shows an exponential increase. The following function is satisfied between the number of DAGs g,z and the number of nodes n:
(13)gn=1,∑i=1n−1i+1Cni2in−ign−1,n=1,n>1.Obviously,g5=29281 and g10=4.2×1018, and it is absolutely impossible to simply build the structure manually. The structure learning method based on the search score regards the Bayesian network structure learning problem as an optimization problem and uses the search algorithm to find the network structure with the highest score through the scoring function of the specified structure. The mathematical model of structural learning based on search scoring can be expressed as follows:
(14)maxfG,D,s.t.G∈g,G=C.Among them,f is the structure scoring function, g is the structure space (that is, the possible structures), and G=C means that the structure G satisfies the constraint C. Constraint C represents the number of samples, which will be processed according to the formula below when certain parameters are obtained. Therefore, the optimal structure G∗ can be expressed as follows:
(15)G∗=argmaxGfG,D.In structure learning based on search scoring, the first problem is how to calculate its scorefG,D given training data D and a possible structure G. The Bayesian-based scoring function treats equation (14) as the following MAP problem:
(16)G∗=argmaxGPGD,where PGD is the posterior probability of structure G given D. Assuming that the prior probability of G is PG, according to the Bayesian formula, it can be known that
(17)PGD=PDGPGPD.SincePD is independent of G, the logarithm of both sides can be obtained:
(18)logPGD=logPDG+logPG.Assume that the parameters of the model structureG are as follows:
(19)PDG=∫∆G0PDG,∆GP∆GGd∆G.


### 3.1.3. Statistical Decision-Making

Fuzzy Statistical Decision Theory has no such definition in previous research, and here is a brand new definition name. The features of this project have been explained in detail in the previous section and will not be repeated here. Based on the abovementioned characteristics, there is no method fully adapting to the abovementioned problems in the existing methods. Therefore, a new comprehensive integrated method is proposed here to solve the problem of risk assessment of such projects, hoping to achieve a better assessment effect than ever before. The challenge of this chapter is to study the risk factor assessment method of the project, which is mainly based on the combination of fuzzy hierarchical structure and AHP method. On the basis of the two-dimensional comprehensive evaluation method adopted by the previous scholars, it avoids its shortcomings and establishes a four-dimensional comprehensive evaluation system.


## 3.1.1. Random Simulation

The stochastic differential equations (i.e., the chemical Langevin equations) are described below. First, this paper presents the basic concepts of Poisson random variables and Poisson processes. Poisson random variable:X is a Poisson random variable with parameter q, represented by X to Pq, and obeys a distribution.
(1)ProbX=n=qne−qn!,n=0,1,2⋯n.And the function form of the stochastic differential equation is as follows:(2)Pxn=qt,xet+σt,xtent,where the mean and variance ofX are both q.Poisson process:Xt is a Poisson process with intensity q. If X0=0, then the probability of Xt increasing by more than 2 in a very short time interval h is higher than h. The probability of Oh=1 is qh+Oh. The Poisson process is a continuous time counting process. One of its important characteristics is that the number of events recorded by the Poisson process with intensity q follows a Poisson distribution with parameters within a period t,t+a, that is,
(3)Xt+a−Xt~Pqa.Therefore, the evolution of a random chemical reaction system can be written as the following stochastic simulation equation:(4)Xt=X0+∑j=1MKjtvj.Kjt represents the total number of occurrences of reaction Rj before time t. Since this is a random variable, Xt is also a random variable, so if Kjt+a represents when the system state is Xt=x, the number of times the reaction Rj occurs in time t,t+a is as follows.
(5)Xt+a=Xt+∑j=1MKjt,avj.The above stochastic differential equation gives a good approximation of the stochastic processXt+a if the system satisfies the following two conditions: The time interval a is large enough that the expected number of chemical reactions occurring at the time interval t,t+a is much greater than 1. That is, it looks like this:
(6)ajxa>1∀1<j<M.Assuming that the propensity functionajXt corresponding to all responses in the time interval is almost constant,
(7)ajXt′≈ajXt,∀t′∈t,t+a,∀1≤j≤M.Typically, each reaction increases or decreases the amount of a particular molecule by one. Therefore, when the number of reactant molecules in the system is much larger than 1, as long asa is small enough, it is easy to satisfy the condition. Since the number of occurrences of reaction channel Rj in t,t+a follows a Poisson distribution in the expected ajxa, equation (4) can be rewritten as follows.
(8)Xt+a=Xt+∑j=1MPjajXtavj.At this time, the Poisson random variablePjajXta can be approximated as a normally distributed random variable with the same mean and variance.
(9)PjajXta≈NajXta,ajXta,ajXta>1.So equation (7) can be rewritten approximately as follows:
(10)Xt+a=Xt+∑j=1MNjajXta,XtavjNote that this article uses a normally distributed continuous random variable to obtain a Poisson random variable with approximately integer values. Taking advantage of the properties of the normal distribution, equation (9) can be rewritten in the following format.
(11)Xt+a=Xt+∑j=1MajXtavj+∑j=1MajXta0.5vjNj0,1.Next, whenq is dt, time t is white noise Ejt and represents a random variable satisfying an independent normal distribution Nj0,1, and equation (10) is transformed as follows.
(12)Xt+a=Xt+∑j=1MajXtavjdt+∑j=1Maj0.5XtvjEjtdt0.5Through the statistical analysis of the sample orbits, it can obtain the time course of the probability density of the system state and the statistical properties of interest in this paper.


## 3.1.2. Bayesian Statistics

Bayesian network parameter learning refers to the process of learning the conditional probability distribution table of nodes from training data on the basis of a given network structure. Parameter learning can also be called parameter estimation, and incorrect model parameters will affect subsequent inference results. Bayesian network structure learning is to learn the corresponding DAG structure from the training sample data, as shown in Figure1.Figure 1
Bayesian network structure learning.If the set of random variablesC=C1,C2,⋯,n and the training dataset G=G1,G2,⋯,Gn for these variables, where n is the number of samples, the purpose of structure learning is to output the corresponding DAG graph structure G. The sample carrier holding device may each include a retainer portion including a vacuum cup bonded material electromagnet or a mechanical device configured to hold the sample carrier. When there are few variables, such as only 1 or 2 variables, its structure can be easily determined. However, when the number of nodes increases, the corresponding possible directed acyclic graph structure also shows an exponential increase. The following function is satisfied between the number of DAGs g,z and the number of nodes n:
(13)gn=1,∑i=1n−1i+1Cni2in−ign−1,n=1,n>1.Obviously,g5=29281 and g10=4.2×1018, and it is absolutely impossible to simply build the structure manually. The structure learning method based on the search score regards the Bayesian network structure learning problem as an optimization problem and uses the search algorithm to find the network structure with the highest score through the scoring function of the specified structure. The mathematical model of structural learning based on search scoring can be expressed as follows:
(14)maxfG,D,s.t.G∈g,G=C.Among them,f is the structure scoring function, g is the structure space (that is, the possible structures), and G=C means that the structure G satisfies the constraint C. Constraint C represents the number of samples, which will be processed according to the formula below when certain parameters are obtained. Therefore, the optimal structure G∗ can be expressed as follows:
(15)G∗=argmaxGfG,D.In structure learning based on search scoring, the first problem is how to calculate its scorefG,D given training data D and a possible structure G. The Bayesian-based scoring function treats equation (14) as the following MAP problem:
(16)G∗=argmaxGPGD,where PGD is the posterior probability of structure G given D. Assuming that the prior probability of G is PG, according to the Bayesian formula, it can be known that
(17)PGD=PDGPGPD.SincePD is independent of G, the logarithm of both sides can be obtained:
(18)logPGD=logPDG+logPG.Assume that the parameters of the model structureG are as follows:
(19)PDG=∫∆G0PDG,∆GP∆GGd∆G.


## 3.1.3. Statistical Decision-Making

Fuzzy Statistical Decision Theory has no such definition in previous research, and here is a brand new definition name. The features of this project have been explained in detail in the previous section and will not be repeated here. Based on the abovementioned characteristics, there is no method fully adapting to the abovementioned problems in the existing methods. Therefore, a new comprehensive integrated method is proposed here to solve the problem of risk assessment of such projects, hoping to achieve a better assessment effect than ever before. The challenge of this chapter is to study the risk factor assessment method of the project, which is mainly based on the combination of fuzzy hierarchical structure and AHP method. On the basis of the two-dimensional comprehensive evaluation method adopted by the previous scholars, it avoids its shortcomings and establishes a four-dimensional comprehensive evaluation system.


## 3.2. Artificial Intelligence Applied to Digital Games

Games are a peculiar form of human life, but also an integral part of human material production life. From time immemorial or even earlier, there have been games where human civilization has emerged. In ancient China, there were widely circulated and well-known games, such as pitching pots and rolling balls. At the same time, humans also have games for different age groups, from building blocks to childhood jigsaw puzzles, to adult board games, sports games, and more. In fact, the game is not just for fun, and the game itself has certain characteristics. Games can not only bring joy to people but also entertain and educate people, which is very important for the integration of different cultures. Digital games are developing rapidly and have become popular all over the world. As an emerging cultural and creative industry, digital games have better development prospects than other cultural and creative industries. At the same time, the sales of digital game software, hardware, and the game itself are growing rapidly at this stage. Game companies represented by Microsoft, Sony, Nin-tendon, etc., are constantly launching refreshing products and achieving great success [9].Generally speaking, game AI is divided into two layers, decision-making and behavior. The behavior layer can be understood as a middleware in the game. The upper layer is the decision logic, and the lower layer is the animation resources. The work goal is to convert AI requests into animation playback requests. A puppy’s behavioral definitions may include the following: walking, running, sleeping, eating, and drinking. These can be thought of as a series of its actions or logical actions. These behaviors form a collection called a behavior pool. A behavior tree is an efficient way to organize these behaviors.Behavior tree (behavior tree, BT for short) is a tree structure containing hierarchical nodes used to control AI decision behavior. Each time an update is performed, the behavior tree runs a depth-first scan until the underlying leaf node returns success or the status changes to “running” [10]. According to this traversal mechanism, the AI needs to prioritize the behavior tree, and this behavior may need to be placed in the left branch of the behavior tree at design time.Here we use the behavior of a soldier in the game as an example to introduce the structure of the behavior tree. Figure2 shows the behavior tree of a game character.Figure 2
Game character behavior tree structure.When it comes to deciding what kind of behavior the current soldier is going to do, we are going to search the tree from the top down, through some criteria, and finally determine the leaf nodes that need to be done and execute it. The input to the algorithm is a behavior tree, and the tree is first analyzed to find the deepest sequence nodes, which act as reinforcement learning actions to establish theA values corresponding to the A value table.The generatedA value table can be easily split into subtables, the A value subtable of actions corresponding to actions in the behavior tree. The subtable A values are sorted from high to low, and the parameter selection corresponds to the state with the highest percentage A value [11]. Figure 3 illustrates this process, and the main table is divided into subtables by actions, placed in conditional nodes instead of conditional nodes. Subsequent algorithms filter the corresponding states based on the parameters, leaving only a specific percentage of the highest A values.Figure 3
Inserting a conditional node into the behavior tree based on theA value.In this chapter, we will design and implement a popular AI engine based on Unity3D to support common game types and common game AI key technologies on the market. This article will introduce the general design and overall architecture of the engine. The engine is divided into three parts: basic framework class, intelligent agent architecture, and message mechanism. Next, this paper analyzes the design and implementation of these three parts in detail. The main basic components supporting the engine are the basic framework classes and the design and implementation of decision-making systems, perception systems, and behavioral systems [12]. This article introduces the intelligent agent in detail and finally explains the main role of the message mechanism and the message types used in the engine. The general AI engine implemented in this chapter meets the performance characteristics of generality, efficiency, flexibility, extensibility, customization, and platform expansion. It can help game developers quickly build the artificial intelligence required in the game, make the characters and creatures in the game more lifelike, and bring players a more “immersive” game experience.


## 3.3. Basic Principles of Sarsa Learning Algorithm

Sarsa learning algorithm belongs to reinforcement learning staggered learning, which is an in-policy learning method for solving decision/control problems. The Sarsa algorithm estimates the action value functionQπs,a of all executable actions a in any state s under policy π. Here, the TD prediction algorithm can be used to estimate the Q-function [13]. The equation for the Sarsa algorithm to update the action value is as follows:
(20)Qst,at=Qst,at+art+1+vQst+1,at+1−Qst,at.Among them,Qst,at is the action value of taking action a in the current state s, and Qst+1,at+1 is the action value of taking action in the next state. rt+1 is the instantaneous reward of performing the action in this state, t is the number of iterations, a is the learning rate, and v is the conversion factor.The Sarsa algorithm relies on two tables:One is the state-action reward table (called theR table), where each row represents a state. Each column represents an action, and the table value represents the reward for taking that action in that state. By defining the table value of the R table, it can define a reward for the action in each state. With the continuous progress of the algorithm, the rewards of different actions in different states will affect the weights of the corresponding actions in each state. Generally speaking, the value of a row and a column on the R table is positively correlated with the weight of the action corresponding to the final corresponding state [14].One is a state-action table (called aQ table). Each Q table corresponds to an R table with the same number of rows and columns. The table value of the Q table represents the weight of the corresponding action in the corresponding state, and the weight is used by the artificial intelligence to make judgments. Generally speaking, after determining the state, the algorithm will choose the action with the larger weight [15]. The table value is not constant, and it updates its own value in each iteration according to the update equation. After many iterations (generally greater than 2000), the values in the table tend to stabilize.A∗ algorithm is the most effective direct search method to solve the shortest path in static road network and also an effective algorithm to solve many search problems. The closer the distance estimated value in the algorithm is to the actual value, the faster the final search speed. The A∗ algorithm uses a heuristic estimation function h to predict the remaining distance between the current node and the endpoint. When fv is used to represent the path cost from the starting point S to the destination T through node v, the ordered queue usually has nodes v sorted according to fv from small to large. The equation for calculating fv by the A∗ algorithm is as follows:
(21)fv=gS,v+hv,T.In the equation,gS,v is the path cost from the starting point S to the node v, and hv,T is the estimation of the remaining distance from the current point v to the end point T. Dijkstra’s algorithm and A∗ algorithm are traditional shortest path algorithms, they can solve the shortest path problem in static environment. However, in a dynamic environment, the weights on each road section change in real time, and the traditional shortest path algorithm cannot divert vehicles, which will lead to excessive vehicle concentration and congestion transfer [16].


## 4. AI Experimentation and Analysis in Digital Games

### 4.1. Status Quo of Digital Game Research

After searching on the Internet using keywords and consulting existing related books, it was found that the research on digital games is relatively complete, and almost all aspects of digital games have been involved. Figure4 shows the trend in the number of studies on digital games in recent years.Figure 4
Trends in digital games research.The main reasons why there is so much research on digital games are as follows: The design of digital games itself is a very complex and huge project, which will touch many disciplines and fields such as cultural studies, ethics, design studies, computer science, psychology, and communication studies [17]. The industrial value formed by digital games has given a strong impetus to related theoretical research. Figure 5 shows the research data of the survey agency on the volume of China’s digital game market from 2014 to 2020.Figure 5
The development scale of domestic mobile games.It can be seen that the game market in the mobile field has a relatively huge development space. After more than half a century of development, digital games have become a mature industry with high technology, high development speed, and high profit. Compared with foreign countries, domestic digital games started relatively late. However, in the domestic market environment where the mobile network is mature and there are many users, mobile games have developed rapidly with the advantages of device popularity, portability, immediacy, and interactivity, and their number is increasing day by day [18].Figure6 shows the survey data on the scale of China’s online game market.Figure 6
Segmentation of the domestic game industry.Some industry insiders pointed out that China is still in the development stage of digital games, but the phenomenon of game homogeneity and piracy is serious. Many games are of low quality, and user stickiness is small. The road of digital game design still needs to be continuously explored [19].Figure7 presents the results of a survey on the frequency and duration of digital play by children using digital devices. The largest percentage of children play digitally every day, with more than 90% playing digitally on a weekly basis. 85.7% of children play number games within one hour.Figure 7
Frequency and duration of children playing with digital devices.
(a)
Frequency of children playing number games(b)
Single duration of children playing number games


### 4.2. AI Applications in Digital Games

This chapter mainly conducts the actual operation and test of the prototype system that applies the intelligent decision-making model described in this paper. The configuration and environment of the test machine used are shown in Table1.Table 1
Operating environment.
NameParameterProcessorIntel-i3-8100RAMDDR4 16G 2400 MHzGraphics cardGTX750tiOperating systemWindows10 x64Emulator versionAndroid 7.1Unity versionV2017.2.0f3 (64-bit)AS versionV2.3.3Django versionV2.0.3In order to test the correctness of the algorithm, this paper uses a simulation experiment to verify it and completes the simulation experiment with an example of an application scenario [20]. There is only one agent in the experimental scene, called a gladiator. The following is the corresponding behavior definition: defense: resist a certain amount of damage. Reply: restore a certain amount of life. Normal attack: it deals damage based on attack power. Charged attack: it increases damage during consecutive attacks. Finishing attack: take a certain amount of damage, and deal more damage. Escape: go to another area.After setting the behavior tree, due to the different effects caused by the actions of the gladiators, the effect caused by the behavior needs an accurate measurement standard, so it is necessary to make detailed settings for the interaction between the agents. The detailed rules are shown in Table2.Table 2
Gladiator’s state and corresponding reward table.
(a)Enemy count returnEmRecoverDefenseAttackRun awayNone00010Have5250(b)Current life returnHpRecoverDefenseAttackRun awayNone-10-10-10-10Few0525High2050(c)Enemy life returnEpRecoverDefenseAttackRun awayNone1001010Few2050High0050It can be seen that in the second layer, the learned behavior tree selects nonaggressive behaviors in most cases. In the last layer, since there is no state corresponding to common attacks, the nodes of common attacks are directly deleted. The reason may be that the design strength of common attacks is unreasonable, resulting in being completely replaced by other behaviors [21]. This paper uses the behavior tree to conduct simulation experiments, and the experimental results are shown in Table 3.Table 3
Comparison table of experimental results.
Evaluation itemType 1Type 2Top 50 deaths62.0024.00Top fifty percent of deaths0.720.28Average kills2.501.20The final number of survivors1.004.00From the above results, it can be seen that the survivability of the type 2 gladiator is higher. When the battle was fierce at the beginning of the experiment, the type 2 gladiator could have a greater survival rate and had an absolute advantage in the final number of survivors.The training process is relatively long. If a long training process is required for each startup, the ease of use of the system will be greatly reduced [22]. In order to avoid repeated training, it is necessary to save the training results locally, so that the text service to be implemented can be quickly loaded when it is just started. Finally, the information of the obtained results stored in the form of a file is shown in Table 4.Table 4
Training results.
File nameTypeSizewiki.zh.text.modelModel54658 KBwiki.zh.text.model.syn0.npynpy1073191 KBwiki.zh.text.model.syn1neg.npynpy1073191 KBwiki.zh.text.vectorVector2555843 KBIt can be seen that the training results are stored in four files. Among them, npy is the data in the form of the numpy scientific operation library that gensim depends on, model is the model data, and vector is the corresponding vector data. The final single vector file size is 2.43 GB, which is in line with expectations.In order to realize cross-language calling, the system uses packaging, network calling, and other methods, respectively. This paper measures the latency and compares it to the no-network test version data, where the performance penalty due to the local network call itself is almost negligible [23]. Among them, the model loading takes a long time, but only when the text service is started for the first time, it has no effect during the system running. Overall, the system can basically meet the requirements of real-time performance. In addition, the proportion of resources used by the behavior tree module is relatively reasonable, and the entire system runs stably.


### 4.3. Mathematical Statistics of Basketball Number Game

In order to verify the effectiveness of game artificial intelligence, this paper designs and implements a 3V3 basketball game prototype. In order to analyze and compare the training algorithm of the BP neural network mentioned above, this paper records 2675 real-time game data of 25 games in 3V3 basketball game running by the method of automatic sample acquisition. Each game is divided into 15 rounds, and the maximum time for each round is 20 seconds. The real-time data is recorded once per second and output in the format of TXT, and the items are separated by spaces.The experimental platform chooses MATLAB, and the sample is divided into two parts. The number of training samples is 860, the number of test samples is 1658, the minimum error value is 0.02, and the number of training is 2000. Choose different training algorithms when building a neural network and observe the error curve and memory consumption at the end of training. The error drop graphs for various training algorithms are shown in Figure8.Figure 8
Gradient descent and gradient descent with momentum term.The experimental platform is SPSS, and the total data volume is 1684, so the maximum number of clusters is 20. The DB values between 5 and 20 of the number of clusters and the DB values after increasing are counted, as shown in Figure9. Through the observation of Figure 9, it is found that the DB value decreases with the increase of the number of cluster centers. The maximum DB value is 1, and the corresponding number of cluster centers is 20. At the end of the increase of cluster centers, there is no upward trend in the DB value, and it is necessary to further increase the number of cluster centers.Figure 9
The DB value map corresponding to the number of cluster centers.The sample data of the four neural networks are normalized and compared with the actual operation data. The abscissa is the name of the feature data, and the ordinate is the corresponding feature data value, as shown in Figure10.Figure 10
Comparison of total data set and N0 and comparison of clusters 1 and N1.From the test results, the training effect of the total dataset is not ideal. The difference degrees of the first five feature data reached 0.51, 0.83, 0.58, 0.49, and 0.78, respectively, indicating that there is a big difference between the data after cluster analysis and the original data, resulting in inconsistency between the training results and the original data. The sixth feature data scoring rate is a standard that reflects player intelligence, and the scoring rate of players trained by the total data set drops significantly. The reason is that there are contradictory data with different tactical inclinations in the sample, resulting in poor training effect. But compared to the total dataset, the game decision-making system trained by the sample sets from clusters 1 to N1 basically maintains the characteristics of the samples. Observing Figure10, the first five feature data of the running data are basically the same as the sample feature values, and the difference does not exceed 20%. The score rate dropped slightly, because the intelligence of the neural network cannot fully reach the height of humans, and the drop is within the acceptable range [24, 25].The experimental results show that after the secondary clustering, the decision-making system can distinguish the player’s data according to the tactical tendency and then learn, realizing the diversification of the decision-making tendency [26, 27].


## 4.1. Status Quo of Digital Game Research

After searching on the Internet using keywords and consulting existing related books, it was found that the research on digital games is relatively complete, and almost all aspects of digital games have been involved. Figure4 shows the trend in the number of studies on digital games in recent years.Figure 4
Trends in digital games research.The main reasons why there is so much research on digital games are as follows: The design of digital games itself is a very complex and huge project, which will touch many disciplines and fields such as cultural studies, ethics, design studies, computer science, psychology, and communication studies [17]. The industrial value formed by digital games has given a strong impetus to related theoretical research. Figure 5 shows the research data of the survey agency on the volume of China’s digital game market from 2014 to 2020.Figure 5
The development scale of domestic mobile games.It can be seen that the game market in the mobile field has a relatively huge development space. After more than half a century of development, digital games have become a mature industry with high technology, high development speed, and high profit. Compared with foreign countries, domestic digital games started relatively late. However, in the domestic market environment where the mobile network is mature and there are many users, mobile games have developed rapidly with the advantages of device popularity, portability, immediacy, and interactivity, and their number is increasing day by day [18].Figure6 shows the survey data on the scale of China’s online game market.Figure 6
Segmentation of the domestic game industry.Some industry insiders pointed out that China is still in the development stage of digital games, but the phenomenon of game homogeneity and piracy is serious. Many games are of low quality, and user stickiness is small. The road of digital game design still needs to be continuously explored [19].Figure7 presents the results of a survey on the frequency and duration of digital play by children using digital devices. The largest percentage of children play digitally every day, with more than 90% playing digitally on a weekly basis. 85.7% of children play number games within one hour.Figure 7
Frequency and duration of children playing with digital devices.
(a)
Frequency of children playing number games(b)
Single duration of children playing number games


## 4.2. AI Applications in Digital Games

This chapter mainly conducts the actual operation and test of the prototype system that applies the intelligent decision-making model described in this paper. The configuration and environment of the test machine used are shown in Table1.Table 1
Operating environment.
NameParameterProcessorIntel-i3-8100RAMDDR4 16G 2400 MHzGraphics cardGTX750tiOperating systemWindows10 x64Emulator versionAndroid 7.1Unity versionV2017.2.0f3 (64-bit)AS versionV2.3.3Django versionV2.0.3In order to test the correctness of the algorithm, this paper uses a simulation experiment to verify it and completes the simulation experiment with an example of an application scenario [20]. There is only one agent in the experimental scene, called a gladiator. The following is the corresponding behavior definition: defense: resist a certain amount of damage. Reply: restore a certain amount of life. Normal attack: it deals damage based on attack power. Charged attack: it increases damage during consecutive attacks. Finishing attack: take a certain amount of damage, and deal more damage. Escape: go to another area.After setting the behavior tree, due to the different effects caused by the actions of the gladiators, the effect caused by the behavior needs an accurate measurement standard, so it is necessary to make detailed settings for the interaction between the agents. The detailed rules are shown in Table2.Table 2
Gladiator’s state and corresponding reward table.
(a)Enemy count returnEmRecoverDefenseAttackRun awayNone00010Have5250(b)Current life returnHpRecoverDefenseAttackRun awayNone-10-10-10-10Few0525High2050(c)Enemy life returnEpRecoverDefenseAttackRun awayNone1001010Few2050High0050It can be seen that in the second layer, the learned behavior tree selects nonaggressive behaviors in most cases. In the last layer, since there is no state corresponding to common attacks, the nodes of common attacks are directly deleted. The reason may be that the design strength of common attacks is unreasonable, resulting in being completely replaced by other behaviors [21]. This paper uses the behavior tree to conduct simulation experiments, and the experimental results are shown in Table 3.Table 3
Comparison table of experimental results.
Evaluation itemType 1Type 2Top 50 deaths62.0024.00Top fifty percent of deaths0.720.28Average kills2.501.20The final number of survivors1.004.00From the above results, it can be seen that the survivability of the type 2 gladiator is higher. When the battle was fierce at the beginning of the experiment, the type 2 gladiator could have a greater survival rate and had an absolute advantage in the final number of survivors.The training process is relatively long. If a long training process is required for each startup, the ease of use of the system will be greatly reduced [22]. In order to avoid repeated training, it is necessary to save the training results locally, so that the text service to be implemented can be quickly loaded when it is just started. Finally, the information of the obtained results stored in the form of a file is shown in Table 4.Table 4
Training results.
File nameTypeSizewiki.zh.text.modelModel54658 KBwiki.zh.text.model.syn0.npynpy1073191 KBwiki.zh.text.model.syn1neg.npynpy1073191 KBwiki.zh.text.vectorVector2555843 KBIt can be seen that the training results are stored in four files. Among them, npy is the data in the form of the numpy scientific operation library that gensim depends on, model is the model data, and vector is the corresponding vector data. The final single vector file size is 2.43 GB, which is in line with expectations.In order to realize cross-language calling, the system uses packaging, network calling, and other methods, respectively. This paper measures the latency and compares it to the no-network test version data, where the performance penalty due to the local network call itself is almost negligible [23]. Among them, the model loading takes a long time, but only when the text service is started for the first time, it has no effect during the system running. Overall, the system can basically meet the requirements of real-time performance. In addition, the proportion of resources used by the behavior tree module is relatively reasonable, and the entire system runs stably.


## 4.3. Mathematical Statistics of Basketball Number Game

In order to verify the effectiveness of game artificial intelligence, this paper designs and implements a 3V3 basketball game prototype. In order to analyze and compare the training algorithm of the BP neural network mentioned above, this paper records 2675 real-time game data of 25 games in 3V3 basketball game running by the method of automatic sample acquisition. Each game is divided into 15 rounds, and the maximum time for each round is 20 seconds. The real-time data is recorded once per second and output in the format of TXT, and the items are separated by spaces.The experimental platform chooses MATLAB, and the sample is divided into two parts. The number of training samples is 860, the number of test samples is 1658, the minimum error value is 0.02, and the number of training is 2000. Choose different training algorithms when building a neural network and observe the error curve and memory consumption at the end of training. The error drop graphs for various training algorithms are shown in Figure8.Figure 8
Gradient descent and gradient descent with momentum term.The experimental platform is SPSS, and the total data volume is 1684, so the maximum number of clusters is 20. The DB values between 5 and 20 of the number of clusters and the DB values after increasing are counted, as shown in Figure9. Through the observation of Figure 9, it is found that the DB value decreases with the increase of the number of cluster centers. The maximum DB value is 1, and the corresponding number of cluster centers is 20. At the end of the increase of cluster centers, there is no upward trend in the DB value, and it is necessary to further increase the number of cluster centers.Figure 9
The DB value map corresponding to the number of cluster centers.The sample data of the four neural networks are normalized and compared with the actual operation data. The abscissa is the name of the feature data, and the ordinate is the corresponding feature data value, as shown in Figure10.Figure 10
Comparison of total data set and N0 and comparison of clusters 1 and N1.From the test results, the training effect of the total dataset is not ideal. The difference degrees of the first five feature data reached 0.51, 0.83, 0.58, 0.49, and 0.78, respectively, indicating that there is a big difference between the data after cluster analysis and the original data, resulting in inconsistency between the training results and the original data. The sixth feature data scoring rate is a standard that reflects player intelligence, and the scoring rate of players trained by the total data set drops significantly. The reason is that there are contradictory data with different tactical inclinations in the sample, resulting in poor training effect. But compared to the total dataset, the game decision-making system trained by the sample sets from clusters 1 to N1 basically maintains the characteristics of the samples. Observing Figure10, the first five feature data of the running data are basically the same as the sample feature values, and the difference does not exceed 20%. The score rate dropped slightly, because the intelligence of the neural network cannot fully reach the height of humans, and the drop is within the acceptable range [24, 25].The experimental results show that after the secondary clustering, the decision-making system can distinguish the player’s data according to the tactical tendency and then learn, realizing the diversification of the decision-making tendency [26, 27].


## 5. Discussion

The time complexity spectrum sensing based on mathematical statistics studied in this paper mainly starts from reducing the time complexity and is aimed at a single sensing user, without considering the method of multiuser cooperation. Through the process of information acquisition and processing, word segmentation and semantic recognition, and behavior tree decision-making, combined with the specific scenes and functions designed, the logic of the agent and the normal performance of the entire system are basically realized. In the process of design and implementation, some difficulties and problems occurred. Most of these difficulties and problems have been resolved, but there are still some areas of note or improvement. In the actual communication environment, due to the complex communication environment, it is necessary to adopt a multiuser cooperation method for spectrum detection, and at the same time, the existence of malicious users must be considered. Therefore, further research is needed in this aspect of multiuser collaboration. Although the method of constructing ideas has a wide range of applications in mathematical statistics, it is not easy to describe, so there are few typical examples in mathematical statistics involved in this article, which need to be further summarized.


## 6. Conclusions

Mathematical thinking is the soul of learning mathematics, and it is the idealism and basic strategy to guide people to deal with mathematical problems. In this paper, experiments use physics engine triggers to implement a perception system that provides input to intelligent models and a digital game-sharing artificial intelligence system that improves perception reliability. This paper proposes an action tree creation method based on Sarsa algorithm, which can optimize the structure of the action tree and improve its intelligence. On top of this, this paper designs a corresponding simulation experiment to verify its effectiveness. This article discusses the types of information and defines the structure and flow of processing. Among them, the implementation principle and method of speech recognition are emphatically studied. At the same time, the speech recognition SDK is introduced into the realized engineering project, and the cross-language call is realized by packaging, and finally, the speech input function is supported.



---

*Source: 7145588-2022-05-05.xml*