Othello Engine 2
An othello engine using compute shaders to run a neural network.
Made in 2026
Implementation
In the previous version of my othello engine, I used a simple algorithmic function to return a move value. In this version, I used a neural network built on compute shaders to approximate the value of a move. Coding the neural network was actually pretty easy. All a basic neural network really is, is matrix multiplication. However, training the neural network is pretty difficult. I decided to cheat and train the neural network in python first. The neural network first plays a game against itself. Then, throughout the game, the network tries to predict the chances of winning for each color. This prediction is converted to a loss function. The loss function is then used to update the weights of the neural network. Afterwards, the weights are exported to a file. Then, the weights are loaded into the compute shader.
Results
The neural network plays worse than the algorithmic function. I think my current neural network is probably not complex enough. Real othello engines use CNNs (which are like neural networks but with fancy math to make them work with images). However, I am not sure how to implement a CNN in compute shaders, so I will just leave the project as it is for now.
Download
Download the source code. You will have to run it yourself and configure the makefile.