Training AI to play King of Glory, is this considered a hangup? ! (With source code)

Play the glory of the king with the AI ​​trained by yourself

Based on the deep learning framework pytorch (resnet101+GPT), it is only a verification demonstration at present, because the training data is small and the level of reinforcement learning has not been entered, so the level is not high.

This source code model mainly uses the  decoding part of the source code of SamlynnEvans Transformer . And the pre-trained model "resnet101-5d3b4d8f.pth" that comes with pytorch

Let's first look at the effect of AI playing the glory of the king

Play the glory of the king with the AI ​​trained by yourself

Training AI to play the king of glory project source code

https://github.com/FengQuanLi/ResnetGPT

Pay attention to the following points when running this code! ! ! ! !

1. At present, after this model is trained with more than 100 games of descendant data , the game shows various problems such as giving heads and various irregularities in the code itself . Please forgive me.
2. This code was originally just my test model whether it can play King of Glory . Friends at station B strongly demanded to be open sourced. It is estimated that there are many problems with hasty open source , please forgive me.
3. Operating environment win10; win7 has not been tested , it is estimated to be possible. Requires an Nvidia graphics card with 6G or above video memory , although 4G 1050ti is barely ok.
4. A mobile phone with Android debugging enabled and able to play King of Glory is required . The virtual machine has not been tried , and it should be feasible in theory.
5. Need to download  the windows version of scrcpy . Just unzip all files to the root directory of the project (this is my stupid way).
6. Minitouch will be installed automatically when the pyminitouch library is running. If you cannot install it automatically, you need to install minitouch  manually , which is troublesome . If you have any difficulties, please Baidu. Also , minitouch does not support Android10
7. The resolution of my mobile phone is 1080*2160 .This code is not optimized for different mobile phones. The position described in the minitouch command of different mobile phones will be different , and the code needs to be adjusted accordingly . Please be sure to pay attention.
8. Pay attention to the layout of the game , it must be the same. For the layout, please refer to the B station video or the training screenshots I uploaded. .
9. After the game is updated, it may cause unforeseen consequences , so the long-term validity of this code to play Honor of Kings cannot be guaranteed.

I may be a video tutorial later , at the same time talk about my design ideas. The screenshots in some areas are not visible , the downloadable items can be seen by opening readme.md under pycharm.

Guess you like

Origin blog.csdn.net/qq_38082146/article/details/115120782