| Computer game is an important branch of artificial intelligence field,which aims to“teach” computers to play chess,cards,mahjong and other games.This thesis takes mahjong as the research carrier,refers to the popular mahjong rules,and carries out corresponding research work for Winning and Waiting,two key sub-processes of mahjong game.As an imperfect information game,mahjong has the following research challenges:(1)Due to the fact that only one’s own hand are visible,the incompleteness of game information and the randomness of discard lead to a sharp increase in decision-making difficulty.(2)The three mahjong operations of Chow,Pung and Kong cause uncertainty in the game order,making it difficult to establish a traditional game tree.(3)The complex and diverse scoring rules for Winning make it difficult to construct a game state evaluation function.The main work of this thesis includes the following three aspects.(1)A segmented game algorithm that integrates knowledge and Monte Carlo tree search is designed.According to the statistical law of mahjong process,artificially divide the whole game process into two periods: the early and later stages.In the early stage of the game,by calculating number of shanten and effective tiles,quantifying the distance from Winning and advancing number of waiting tiles,quickly approaching Winning.In the later stage of the game,by constructing a simulation environment for mahjong games,adaptive improvements are made for each stage of selection,expansion,simulation and backtracking in traditional Monte Carlo tree search respectively.The best path for Winning with maximum expected return is selected based on simulation statistics results.The final experiment shows that compared with single empirical knowledge-based game algorithm,after integrating Monte Carlo tree search,both single-game maximum score,average number of Winning have been significantly improved.(2)A Waiting prediction method based on multi-scale feature extraction and attention mechanism is proposed.In mahjong games,temporal information on field has great influence on predicting Waiting.This thesis proposes solving Waiting prediction problem based on classification idea,first using multi-channel matrix representing “visible”features,“experience” features,“foresight” features in situation.Secondly,convolutional neural network and LSTM encoder are used extract above features,mine temporal information among them.Finally LSTM decoder Attention component calculate influence weight sequence information final prediction,so as pay attention important features when predicting Waiting.Based on the data from the National Computer Game Competition in2020-2021,the Waiting prediction model was trained,and its accuracy reached 87.3% on the validation set.At the same time,the predicted legal rate “Legal Rate” and the predicted fault tolerance rate “Accuracy_N” both performed well.(3)Developed popular mahjong games intelligent agent.Based JJWorld network technology company’s popular mahjong competition platform,the four-layer architecture of the intelligent agent was built in a top-down manner.Using Python and Pytorch,we implemented a fast near Winning policy algorithm,optimal Winning path selection,Mahjong game environment simulation,and predictive Waiting model construction,combined with Mahjong game rules to form a complete intelligent agent decision-making process,participated in the 2022 China Computer Game Championship and won the runner-up,participated in the Mahjong competition of the 2022 IEEE World Game Conference and won the third place,proving that the research results of this article are feasible and have certain advanced nature. |