Office-Wide RFID Powered Nerf War
…because “Why not?” is the best possible reason
When you get an opportunity to build something awesome, you should. One such opportunity arose recently when a few members of our creative team decided to host an office wide after-work nerf battle and party.
Around the same time a client was asking us for examples of our usage of RFID and NFC technology at events. We’ve used the tech before at a few events, but nothing home brewed or terribly unique. The digital team here prides itself on doing what’s weird and awesome (take a gander at what we did on a short timeline for our 8-bit themed party) so we jumped at the chance to build an RFID-powered king of the hill game for our nerf war.
The idea was simple enough. In a ten minute game, four capture points would exist throughout the building. Only one point would be “active” at a time. Each capture point had an RFID reader on it. A team could capture an active point and, for every 5 seconds of point control, earn their team a point. Every minute the point would move to another random control point in the office.
We have about a half dozen and change TVs located around the office with Chromecasts plugged into them. Using an oddball trick in Chrome we would display a map of the building with “capture points” denoted (and who controls them), the time left in the game, and current scores of the game.
The whole application was written in node, built for node-webkit. To access the RFID readers, I wrote a module called serial-rfid-reader which would make it dead-simple to react to the RFID tokens. The capture points, admin control app, and display maps were all linked together by Firebase — it allowed us to make a reactive real-time app with no effort at all. We used AngularJS to tie the page’s logic together.
When building the application, we had a lot of issues with the serial port module getting wrapped in node-webkit. This is not an uncommon issue, so I documented what I did to finally get it working in a helpful gist.
All in all, three days of effort resulted in a pretty fun end result. People loved the game and the office was filled with flying darts and yelling. We’re already plotting version 2 features.