DEV Community

kgauld1
kgauld1

Posted on

Octograd 2020 -- Othello Gameplay Bot

Othello AI Bot

One summer, I programmed a bot to play the board game Othello, which I then used in the CodeCup gameplay competition, earning top 50 internationally among all age groups, and first place out of high schoolers nationally.

Demo Video

How I built it (what's the stack? did I run into issues or discover something new along the way?)

I built this program initially using the MiniMax algorithm for artificial intelligence gameplay. This algorithm works by maximizing the user's future options, while minimizing the options of the opponent.

I initially treated every space the same, but over time developed a positional heuristic, which weighted the acquisition of different spaces differently (i.e. corners are really good, spaces next to corners are really bad).

After the heuristic was implemented, I made changes to the actual gameplay algorithm, switching to the NegaMax algorithm, which uses the same logic, but is more concise and is generally slightly faster.

To compete in CodeCup, I had to alter the rules of the game to fit the description of their "Flippo" game. This game allowed for the player to flip their own pieces and place pieces anywhere on the board, so the functionality had to be changed to match.

Overall, this project taught me a lot about artificial intelligence and how AI gameplay bots work, and gave me insight into advanced programming which I had never experienced before.

Additional Thoughts / Feelings / Stories

In the future, I'd like to upgrade the algorithm I used to include Alpha-Beta Pruning, which would allow the AI to look "deeper", maximizing the score for more turns than is possible with MiniMax or NegaMax.

Top comments (0)