The brief was to adapt this simple board game into a app with 3 main modes of play; Player vs Player (local), Player vs AI, and Player vs Player (online). Although the mechanics of the game where relatively simple creating a worthy AI opponent was a challenge in itself. What I found particularly challenging was finding the balance between the AI being unbeatable to it being beaten every time.
The solution to creating effective AI was to emulate human behaviour as closely as possible. The AI would firstly analysis the current state of the board, then using the A* pathfinding algorithm with a heuristic to determine the most effective move and the cost of that move; Cost reflecting how many turns it would take to achieve that particular play. A human player would behave in a similar way, however we would be limited to the foresight we have, so to “dumb down” the AI we limited its own foresight.
The online Player vs Player mode works in a turn based fashion, players are presented with the last move of there opponent once they checked the game, allowing them to send a reactive play. Players were not tied to playing a single match they could play multiple matches and at their own pace.