Note: this is Part 1 of my ongoing Diplomacy project: Part 2 can be found here.
So, disclaimer right off the bat: this post is in a slightly different vein than others, in that it’s not detailing the process of a completed project, but rather laying out a roadmap for a large-scale project that I have done some work on, but in all likelihood will take me a few years to truly complete.
First, the end goal: I want to create a robotic gameboard that runs the boardgame Diplomacy. This would be similar to automatic chessboards that already exist, preprogrammed with chess AIs that can play against a human, physically moving around pieces on the board as if by magic (but really by operating a magnet underneath the board). I want to create my own custom version of this, capable of running the game Diplomacy, an amazing Risk-like game with a focus on grand strategy, bluffing, and backstabbing. Players could use my board with a group, or even maybe play against AIs, and the board would adjudicate turn outcomes (a big part of the game) and move player pieces around accordingly. In all, I think this project will require the application of lots of problem-solving with many skillsets - programming, machine code, robotics and electronics, and physical artistry.
Here is the framework that I envision: on a physical level, there will be a board, of course, with pieces placed on it for players to view. These pieces will have magnets in their bases, for the robotic system to interact with. Just beneath the board, there will be an electromagnet “toolhead,” which is moved around via a 2-axis system most likely consisting of shafts, belts, and stepper motors -- picture a basic 3D printer or CNC, with the third axis removed. I really like the idea of using a partially transparent upper board, so that the workings of the robotic system can actually be viewed while in action.
There will need to be some sort of system for players to input their moves into the system: I picture either a keyboard and screen attached to the board, or perhaps more elegantly, a method for sending in inputs via phone; I honestly have yet to really begin to think of how this would work, though.
On a programming level, there will be lots to do, and lots to learn for me, coming from a background of little experience in this area. As previously mentioned, there will need to be code for inputting orders into the system, which may be quite complicated and unknown to me depending on the method I try. Then, the brains of the system will need to actually run a version of Diplomacy based on these inputs; adjudicating outcomes, saving game states, etc. to determine what output must be sent to the robotic system. There will need to be potentially complicated code for translating turn outcomes into moves of the robotic system; pathfinding, optimization, and translation to machine code for the stepper motor output will probably all be challenging. And after all of this, if I’m not totally sick of writing code, I may want to try to create some basic AIs to play against -- but we’ll see when I get there.
Now, not to be totally daunting, here’s what I have so far: I’ve started experimenting with creating a one-axis system (we’ll get to 2 + electromagnet later), utilizing a scavenged stepper motor and some 3D printed mounting parts. I did a bit of research to understand the workings of stepper motors, did some more research on programming some basic controlling functions on an Arduino, and got my first system output: I made the belt spin and moved my dummy “toolhead” back and forth! Proof-of-concept, check. Side note: I started the rail system with these aluminum rods that I picked up as scrap, figuring that it would be pretty easy to design something round to slide on them. I tried with extruded plastic, smooth “journal” bearings, and finally custom ball-bearing linear bearings before the system worked at last. I have more work to do here, before finding a good system that maintains accuracy of the toolhead position while also keeping friction low enough to allow the stepper motor to spin easily and accurately.
I’ve also begun work on the Diplomacy code, aka the “brains” of the system -- I originally thought that I may be able to find and hack some code written and published online; I’m not the first to write an adjudicator program. However, I really lacked the programming skill to adapt one of these to my purposes. Additionally, I have a weakness where I want to completely understand the workings of a system I develop; I enjoy building things totally from the ground up, and so decided the easiest thing to do would be to teach myself Python and crack in on this from square one. Good luck to me
Update August 2021: a couple things have been completed since the genesis of this project idea. First, I have actually completed a Diplomacy gameboard, albeit an “analog” one with no robotics -- that can be found here. Secondly, and perhaps more excitingly for this project, I have all but completed a Python program set that can run and adjudicate Diplomacy through terminal inputs; I’ve discovered a bit of a passion for Python, and programming in general, in the process, and I’m glad I decided to tackle this stage with a blank slate. Sure, my code is probably far from truly efficient, but it’s mine and I’m proud of it. If you want to look at the code, head on over to my github repository.
I’m taking a bit of a hiatus from the project, but will probably get back to it soon by cleaning up and finalizing the adjudication, and working on the machine output code. Onto the hard parts!