Ready Player One

Computer geeks can often be gamers of varying degrees. Board games, tabletop, PC, consoles; the list goes on.

I’ve been into gaming since I first saw Castle Wolfenstein. I was big into gaming when I was younger. Going to local LAN parties, competitions, and competing in online brackets.

When you start playing tougher opponents you start analyzing the game a different way. You’re looking at ‘the meta’. The meta of a given game changes over time. What tactics, team composition, tools, and the weapons that people choose to use define a lot of it. Sometimes the meta is physically outside of the game. PC players are constantly upgrading GPUs, CPUs, mice with better sensors, mechanical keyboards, monitors with faster refresh rates, etc. It’s a little different in the console world.

I started playing on a console some time after I realized I would never get Half-Life 2: Episode 3 in my lifetime. I had played the original Call of Duty games on the PC, so I was excited for modern warfare. I was happy to get into the beta. One of the downsides of playing on a controller for me is that your right thumb has a lot of functions to cover. It’s controlling the right tick for aiming, the face buttons, etc. Sometimes you want to be able to jump or prone out while still retaining control of your aim.

This was the first hardware hack I did for game controllers.

Solving Problems with Technology

Essentially what I did was rip apart the Xbox360 controller and find the carbon pads that the buttons press onto, and solder thin wire onto them and add buttons to the bottom of the controller so I could now use my other fingers that were just resting before. These kinds of controller mods are approved for most tournaments. There are full companies out there that just make custom controllers doing this.

I was originally going to just buy one, but they’re pretty expensive. A standard model with just those modifications could often be well over $100. The controllers could be had in stock config for anywhere from 30-60 depending on when you purchased them in the console’s lifetime. I did this for myself for years. Back in 2013 I joined a competitive group for console games mostly centered around Call of Duty (we were able to hold #1 for clan-wars for decent stretches of time in Ghosts and Advanced Warfare). One thing I learned there was that there were other people who also wanted to have that functionality but didn’t like a $130 price tag. So I started making controllers for other people. I got into doing things like adjustable depth triggers, trigger stops, airbrushing, custom shells, etc. I probably built 200+ controllers during that time.

I’m not really going into depth on how to do those mods because I produced a whole YouTube playlist about how to do them yourself: https://www.youtube.com/watch?v=kOlUTdP44XE&list=PLLGyKJ-XOlkZUdDf6va2hOPNWD8xwU0zc

If you’re interested, I cover the tools you’ll need and common problems you can run into, etc.

Going Back to My Roots

In the past 6 months I have gotten back into PC gaming. I’m not as dextrous as I used to be. My fingers don’t flick to the keys and back like they used to when I played Tribes or Quake every day. I put some thought into it and about what led me to modifying controllers in the first place. I was using all my fingers on the keyboard, and most of them on the mouse…but I had two feet sitting there doing nothing. I needed something to help me along until I got the muscle memory back.

So I built a controller for my feet.

At a previous job I had used similar techniques to programmatically turn hardware on and off and press buttons for test fixtures we were building. One fixture we built, that I named after TARS from Interstellar, had several Raspberry Pis that ran little web services on them that you could hit to “press” buttons. We used them in Jenkins jobs so that test suites could put hardware into bluetooth pairing mode and the test suite could use mobile devices to connect and complete the tests.

I didn’t really want to dedicate an entire Pi to being a foot controller though.

What I did have was a ‘Teensy’ from PRJC https://www.pjrc.com/teensy/.

A Teensy is basically like an Arduino with some expanded libraries. I had one already and used it for a security demo. I had programmed it to be a keyboard. It would input key sequences that allowed me to take remote control of Mac desktops if a user left their desktop unlocked (setting a reverse shell, basically). I’ve also built complete DIY keyboards using them too.

I did a quick prototype on a breadboard just to make sure I could get it working:

So I was thinking about what I could use for the foot switch. There are decent momentary foot switches I could order but I wanted to test the concept without spending anything. I wanted something like a guitar effects pedal in FormFactor. I then remembered that I had a drum set from the Rock Band game in storage. It had a foot pedal for the bass/kick drum that was essentially a momentary switch. It used something called a reed switch, which is a magnet operated switch. When the magnet gets close enough the switch moves to its on or off position depending on if it’s normally open or closed. Many security systems work this way to track if a door or window is opened or closed.

I wanted more than just one button for the proof of concept…so I just bolted some some plates and added two of the switches I used to use for controllers.

The pedal was a little unstable side to side so I glued in a stabilizer. It’s ugly and looks like some kind of failed Ghostbusters prop, but it’s functional.

The Teensy up close

A wide shot of the pedal

So now when I’m playing PlayerUnknown’s Battlegrounds I have a foot switch for push-to-talk and two other buttons for leaning left and right while aiming and with out having to move my fingers from the WASD keys.

The code to power the controller is really very simple. The keyboard library handles things like debounce for you (essentially the state when a key is in between going down or up).

If you were building a single key controller/keyboard, the code is simple and small enough to put right in this blog post:

#include <Bounce.h>
const int yPin = 0;
Bounce yBtn = Bounce(yPin, 10);

void setup() {
  pinMode(yPin, INPUT_PULLUP);
}

void loop() {
  if(yBtn.update()){
    if (yBtn.fallingEdge()) {
      Keyboard.press('y');
    }
    if (yBtn.risingEdge()){
      Keyboard.release('y');
    }
  }
}

The Teensy, like most devices, is just constantly looping and waiting for some kind of interrupt. It captures the state of the button and then acts on changed states; either it’s being pressed (a falling edge) or released (a rising edge). You need to do this as a press-or-release because some buttons need to be held down, like sprint, gas, or movement.

I’ve grown to like the foot switch for various things, so I’ll probably invest in some nicer pedals as I consider the prototype a success.

Also, you can totally buy what I built here. I really enjoy building things and learning more about them so this was a fun project that is really very beginner friendly.

Also, it’s important to address that this isn’t just useful for gaining an advantage or easing back into something. People with disabilities also really enjoy video games too. They can benefit from rapid prototyping using tools and techniques like this. You can find more info on other projects for gamers with disabilities here.