Rage Chess: All The Rage

Ayden Townsley
3 min readApr 29, 2022
Rage Chess Trailer

These last two weeks have been a busy time. With my time at Holberton coming to a close, the job search is in full force. In addition, I am in the final weeks of my capstone project (round two). With our efforts in initial sprints focused on reworking some of the base components of Rage Chess, this last sprint has been an effort to clean up and personally, to clean up the function of my contribution.

Rage Chess is a game about letting all those petty little emotions out that you experience while playing games. The ones that people have always told you to bottle up, but maybe you are tired of hearing “don’t trash the place just because you are losing Bob” or “Stop yelling at me, I was the best man at your wedding Bob”. Well no more. Feel free to take out your anger from the safety of the virtual world. If you have pushed your friends and family away, or maybe they just wont play games with you anymore, we have you covered there as well.

My main task for this run of Rage Chess, was to create a Computer opponent option. I am very happy to say that we have succeeded in doing so.

We have taken one of the very best chess engines available, Stockfish, and made it your arch nemesis.

The idea was to take a 3D chess board, create data that the stockfish interface could understand, then take its response and translate that back into a 3D action, on a VR headset.

So much has been learned about, Android, Threading, and chess engines. First off, our target device is a Quest 2. It is the most popular VR headset right now, and runs on a version of android. When compiling from our Unity project, an APK gets built and installed on our headset. Stockfish, can either be compiled for a specific target, or in our case some common targets (armv7) are already compiled for. I had to familiarize myself with the android file structure in order to correctly find and use our stockfish executable once built to our headset.

The first time running stockfish on my Quest was awesome… and nauseating. I do not get motions sick easily, but when your frame rate drops to single digits, it can throw you off very quickly. The reason for this issues comes from Unity and the headset both running all visual (and most other things) on the main thread. When a program like stockfish comes along, it tends to take up those resources and bog everything down. I was pretty stumped, but with some help from a mentor, I had some research to do on Multi-threading.

Multithreading spins up an additional space in which you can execute code in parallel. This works wonderfully and allows us to keep our lunch down and query stockfish for moves. To query stockfish, you have to look into UCI (Universal Chess Interface) and let me tell you, finding info on how to use a chess engine as a command line tool was quite difficult. A couple pages duct taped together managed to get me enough info in order to correctly ask stockfish for moves in it’s native language.

Long story short, there is a lot of string processing that happens to make this work. It was an incredibly fun task to take on, and one that I am eager to continue working on.

Right now, stockfish in Rage Chess is fairly limited. The goal is to create a rich experience (and character to play) against. For instance, I did not get to implement a skill scale, as there was not a ton of info I had found on that topic yet. So much is still to be done, as well as adding other elements, like combat, to Rage Chess.

It has been, and continues to be, an incredible adventure with a wonderful team.

Check us out: https://github.com/aydentownsley/RageChess

trailer: https://www.youtube.com/watch?v=3mn-psxHJNs

--

--

Ayden Townsley
0 Followers

Your friendly neighborhood full stack developer