Tom’s Magic Cube – The Beginning

As anyone reading this likely already knows, I like to make controllers. Like a lot. I’ve fallen into the pit of always having input at the very forefront of my mind with anything (maybe not a pit!), so whenever a game comes around my first thought is “What controller could I make for this?”

Magnets and Pirate Ships

This brings me to a project I’ve been working on for about… half a year now: Tom’s Magic Cube! That’s a pending name. When I was in San Fran showcasing OVERTIME in alt.ctrl.GDC, the game that took home the badass trophy for best game in alt.ctrl was Hot Swap. I had the chance to meet Peter Gyory, one of the developers, and fell in love with the mechanisms that allowed for fast, entertaining and refreshing input. To summarize the game, two players must take small, plastic and magnetic control pieces and plug them into one of two slots in their own control board. These components control a pirate ship that has to both keep itself afloat, find treasure, and defend against other ships shooting cannon balls at them. The pieces range from a steering wheel to a water pump that extinguishes fire, but are in limited amount. This forces the players to exchange pieces, implicitly define responsibilities, and explore what configuration works best. Until getting hit by another five cannon balls on one side, and sinking fast.


What got me most excited was the construction of the controller. Magnets hold the buttons down, a notch on one corner enforces proper orientation, and a series of pins allow for electronic input from each piece. The parts themselves are Mechamagnets, an input exploration designed by Clement Zheng, one of the other team members on the project. Mechamagnets “…explore[] a technique to rapidly prototype haptic and functional physical interfaces through desktop 3D printing and embedded static magnets.” I immediately started exploring use-cases for them in my own projects, but the spark didn’t come until about a week or two after I returned from GDC.

3D Controllers for 2D Platformers

A new quarter at DePaul started a week after I returned, and one of the courses I began was Professor Peter McDonald‘s Topics in Game Design class, with this session being about 2D platformers. The course is a deep dive into 2D platformers and the impact every small element has on shaping the design of everything around it. My good friend Kailey Phan Mitchell and I started working on an auto-scrolling, colorful platformer where a cube must venture across colorful platforms (ROYGBV) while collecting various items. The game itself was simple and entertaining, but from the start we knew we wanted some sort of alternative input. Now, here’s where the Magic Cube finally enters.

The shape was the first focus. We wanted some input that could allow for individual coloring of six different colors to connect to the platforms. Naturally, that let us to a cube! It’s a familiar shape and provides easily grip-able edges so that players don’t accidentally press anything. The size was essentially defined by a custom PCB I made to house an ESP32 board and some extra bits for input. An embedded Fusion file is presented below.

I utilized the Mechamagnets design mentioned previously to rapidly create inputs that had more impact than a standard push button, and added a slit in the button intake wall to place the hall sensor needed to read the magnet movement. Each hall sensor shares power and ground, with pull-up resistors places between the 5V out and the input pin. You can read more about the wiring of the sensors here. The ESP32 inside was powered by a LiPo battery, and sends serial output of all button values over Bluetooth, while Unity reads com port data every frame.

Looking to the Future

The ending result, both controller and game, were fairly simple, but extremely satisfying in their input. We further explored button input by introducing wall obstacles of certain colors, requiring the player to hold down that button color to make it disappear while still managing jumping around. For a few weeks of work (outside of other classes, student employment, and life), it’s not too shabby! Shortly after finishing the class, I began work on version two of the controller. This includes, but is not limited to: gyroscope input, LEDs, custom circuit board panels, clean, repairable design, increased size, resin-printed light-up buttons, heat-inserted threads and low-profile socket cap screws, and more! Stay tuned on my social media and feel free to reach out with any questions! Twitter, Instagram


Leave a Reply