Minimax Algorithm in Tactical RPG

I made this experiment as part of my final task at the university. The game has three types of units: leader, warrior, and mage. The game will end when the leader is dead or runs out of HP. Because of this condition, I made the enemy computer prioritize attacking the player’s leader unit.

Problems: How to make a computer enemy that challenging for player?

Solutions: I use the Minimax algorithm to make the enemy calculate and predict the player’s actions and choose the best action to win the game. The enemy calculates every possible move and also considers some components such as unit position, unit attack, and unit health. In this experiment, the enemy only calculates until 3 turns ahead.