Backgammon AI

Skills Utilized
Jquery CSS HTML JS Node/npm
Description

The current iteration of the AI that the computer opponent of Backgammon uses was designed and implemented by me. After receiving a fair few number of complaints and suggestions regarding the computer AI I was tasked with improving it. The task took a few weeks where I went over the suggestions we got, researched common strategies and standard Backgammon AI's found elsewhere, implementing, writing tests for, and fine-tuning the new AI. After we had cleared the new AI for release we gave it a test run. Half of our players would, unknowingly, be served the old AI and half would be served the new AI. We'd collect analytics, and compare how the new AI fared in comparison to the old AI. The result was that the new AI was winning on average twice as many games as the old AI did - a considerable improvement. The new AI was given the full release, and it has been serving on the site since. The fact that we stopped getting complaints over the AI being bad and instead started getting complaints that it was cheating was an indicator I had probably done my job right. The current iteration of the AI is a state-machine. In the first turn it has a simple lookup-dictionary telling it what the best move is after each possible die roll. After the first turn it performs a simple state-evaluation, looking at all possible moves it has given the roll it got and giving the resulting table a score: the AI would prioritize captures, prioritize building multiple safe stacks, and would prioritize getting its pieces away from the opponent end zone in order to not get locked in. In the end game it would change gears and simply try to get as many pieces as quickly to the end zone as possible. The game, much like all games on Cardgames.io, is built on a foundation of Jquery-backed Javascript, and standard HTML/CSS.