Adding a simple AI to Pocket Go


By golly I’ve done it, you can now play against a computer Go player in Pocket Go!

Admittedly, this player is extremely bad and predictable. But with some help from analyzing the Simple Player code for Fuego I have created a liberties maximizing computer player. It won’t fill in its own captured area and will try and expand the liberties of its groups (and minimize yours) which is a good enough analogue given the limited power of the Playdate and the complexities of Go.

There are still kinks to work out, like how it is very aggressive in placing stones in an area that is very clearly under your control instead of just skipping its turn, it will not respect Ko which is frustrating, and it always starts with the same moves.

It is fast enough that you won’t need to wait more than a second for the computer to make a move, but to add more intelligent moves like not giving up seki which it currently loves to do, I will need to optimize the code by converting the move scoring into C. Hopefully that gives enough of a performance boost that I can implement as many checks as possible so that it no longer plays like a 6 year old.

Let me know if you encounter any issues with the computer player, and enjoy!

Files

pocket-go.pdx.zip 86 kB
Jan 13, 2024

Get Pocket Go

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.