Auto-translated
TL DR: You can see the progress here: https://ihromant.github.io
SMOrc
SMOrc SMOrc
SMOrc SMOrc SMOrc
SMOrc SMOrc
SMOrc
Hello, dear chat. I think everyone has heard about AlphaZero, which is now considered unbeatable in chess. Under the hood, AlphaZero has something called machine learning on neural networks. And with its help, thanks to a simple training strategy (the machine learns to play the same way people do - by playing and gaining experience), it eventually beat Stockfish. That was a digression.
In fact, there is nothing complicated in the AlphaZero code from the point of view of implementation. (for example, you can see the pseudocode here https://gist.github.com/erenon/cb42f6656e5e04e854e6f44a7ac54023). The question is in the infrastructure (Google released something called a TPU chip for this) and in the number of computers that calculate this model. Also, from the pseudocode, you can see that by replacing just a few parts of the code, you can apply the same algorithm to Go or Shogi.
What am I getting at? I'm getting at the fact that whoever understands how AlphaZero works can (conquer the universe) write AI for any game they want (like, for example, they write bots for Dota that are already beating the champions of The International https://openai.com/five/ ).
Of course, Heroes has something in common with Dota (randomness, incomplete information) and with chess (complete turn-based gameplay). But in reality, in some cases, Heroes is very simple in terms of options. Here is one of the options I would like to consider.
Suppose you have a Temple. Articles 1-2-5-8, mana 120. And 350 skeletons. And a Dragon Utopia is looming. Question for the experts in the chat: should I go there or not? Sanek, for example, doesn't make a move, creates a map in the editor, and runs this battle there 3-4 times, and after that decides what to do at the moment when the opponent curses, "why isn't he making a move?". Leaving aside the jokes, in the Dragon Utopia, everything is very predetermined (dragons will attack certain stacks, there is no morale, we have very few viable options as a response - shield, defense, attack, wait, animate), and so on until victory (or defeat).
In general, the model fits very well with the algorithm called Reinforced Learning. The principle is simple - we go into the Dragon Utopia, make some assumption, get (moderator removed), draw conclusions, try something new. Or we fought well, we think about how to spend less mana.
Now about the connection with another game. There is a game called "tic-tac-toe". I think someone has already played it in pairs or at school. The game is actually very similar to taking a Dragon Utopia with a Temple. There are approximately the same number of options, in the end there is a result, you can vary the number of answers (for example, play not 3x3 3 in a row, but 5x5 or 5x6 4 in a row, or 15x15 5 in a row). If you teach a computer to play this game, then by making simple manipulations, you can teach the computer to take a Dragon Utopia with a Temple.
Sorry for the long introduction, now finally the essence. I was able to teach the computer to play tic-tac-toe 3x3 3 in a row, 5x5 4 in a row so that it does not lose, and if you make a mistake, it wins. I did this using the Reinforced Learning algorithm and machine learning on neural networks. You can see the code here https://github.com/Ihromant/reinforced-learning .
I am almost sure that it can be adapted for the case with a Temple and a Dragon Utopia. That is, teach the computer to take the Dragon Utopia with minimal losses, and if there are no losses, then with minimal mana loss. If you go further, then you can go to taking castles (even to the point of using harpies to siege), it's just more complicated, it takes longer, and you can't skip it.
Now, why did I create all this? Firstly, to brag (well, yes, ego). Secondly, I have approached the stage where someone can help. I see two obvious options so far:
1. I need a model of the interaction between dragons and skeletons. I think that I will be able to integrate this model over time, but firstly, I work, secondly, I have other activities. And this requires diligence and is a bit boring. And training on the wrong model will give incorrect advice. Then the model may grow to the point of taking castles and so on. But I need an expert in computer behavior who can translate his experience of fighting computers into code.
2. Training models is not done instantly. Next, it will be necessary to train step by step. The process is actually quite boring. Started, waited, saved to a file. The file was uploaded somewhere, someone else launched it, trained it, uploaded it. I need a computer with a good video card (I have a laptop, I plan to buy a computer, but not yet). Because to teach the computer to play 5x5 tic-tac-toe, it takes 2 hours of work on my powerful work computer). You can imagine how long it will take to train taking a castle.
In general, that's all for now. Let's discuss.
SMOrc
SMOrc SMOrc
SMOrc SMOrc SMOrc
SMOrc SMOrc
SMOrc
Hello, dear chat. I think everyone has heard about AlphaZero, which is now considered unbeatable in chess. Under the hood, AlphaZero has something called machine learning on neural networks. And with its help, thanks to a simple training strategy (the machine learns to play the same way people do - by playing and gaining experience), it eventually beat Stockfish. That was a digression.
In fact, there is nothing complicated in the AlphaZero code from the point of view of implementation. (for example, you can see the pseudocode here https://gist.github.com/erenon/cb42f6656e5e04e854e6f44a7ac54023). The question is in the infrastructure (Google released something called a TPU chip for this) and in the number of computers that calculate this model. Also, from the pseudocode, you can see that by replacing just a few parts of the code, you can apply the same algorithm to Go or Shogi.
What am I getting at? I'm getting at the fact that whoever understands how AlphaZero works can (conquer the universe) write AI for any game they want (like, for example, they write bots for Dota that are already beating the champions of The International https://openai.com/five/ ).
Of course, Heroes has something in common with Dota (randomness, incomplete information) and with chess (complete turn-based gameplay). But in reality, in some cases, Heroes is very simple in terms of options. Here is one of the options I would like to consider.
Suppose you have a Temple. Articles 1-2-5-8, mana 120. And 350 skeletons. And a Dragon Utopia is looming. Question for the experts in the chat: should I go there or not? Sanek, for example, doesn't make a move, creates a map in the editor, and runs this battle there 3-4 times, and after that decides what to do at the moment when the opponent curses, "why isn't he making a move?". Leaving aside the jokes, in the Dragon Utopia, everything is very predetermined (dragons will attack certain stacks, there is no morale, we have very few viable options as a response - shield, defense, attack, wait, animate), and so on until victory (or defeat).
In general, the model fits very well with the algorithm called Reinforced Learning. The principle is simple - we go into the Dragon Utopia, make some assumption, get (moderator removed), draw conclusions, try something new. Or we fought well, we think about how to spend less mana.
Now about the connection with another game. There is a game called "tic-tac-toe". I think someone has already played it in pairs or at school. The game is actually very similar to taking a Dragon Utopia with a Temple. There are approximately the same number of options, in the end there is a result, you can vary the number of answers (for example, play not 3x3 3 in a row, but 5x5 or 5x6 4 in a row, or 15x15 5 in a row). If you teach a computer to play this game, then by making simple manipulations, you can teach the computer to take a Dragon Utopia with a Temple.
Sorry for the long introduction, now finally the essence. I was able to teach the computer to play tic-tac-toe 3x3 3 in a row, 5x5 4 in a row so that it does not lose, and if you make a mistake, it wins. I did this using the Reinforced Learning algorithm and machine learning on neural networks. You can see the code here https://github.com/Ihromant/reinforced-learning .
I am almost sure that it can be adapted for the case with a Temple and a Dragon Utopia. That is, teach the computer to take the Dragon Utopia with minimal losses, and if there are no losses, then with minimal mana loss. If you go further, then you can go to taking castles (even to the point of using harpies to siege), it's just more complicated, it takes longer, and you can't skip it.
Now, why did I create all this? Firstly, to brag (well, yes, ego). Secondly, I have approached the stage where someone can help. I see two obvious options so far:
1. I need a model of the interaction between dragons and skeletons. I think that I will be able to integrate this model over time, but firstly, I work, secondly, I have other activities. And this requires diligence and is a bit boring. And training on the wrong model will give incorrect advice. Then the model may grow to the point of taking castles and so on. But I need an expert in computer behavior who can translate his experience of fighting computers into code.
2. Training models is not done instantly. Next, it will be necessary to train step by step. The process is actually quite boring. Started, waited, saved to a file. The file was uploaded somewhere, someone else launched it, trained it, uploaded it. I need a computer with a good video card (I have a laptop, I plan to buy a computer, but not yet). Because to teach the computer to play 5x5 tic-tac-toe, it takes 2 hours of work on my powerful work computer). You can imagine how long it will take to train taking a castle.
In general, that's all for now. Let's discuss.