image03

Ever go to a hackathon with the sole purpose of making your childhood dreams come true? Well that’s exactly what we had in mind when we set out for BostonHacks. We wanted to make a real life virtual reality duel disk from the show Yu-Gi-Oh that we watched as kids. In the show a character would place a monster card on the duel disk. It would make the monster appear life sized through a holographic animation to battle with their opponent. We thought it would be incredibly fun to recreate this with an Oculus Rift, some NFC tech, and of course a plastic toy duel disk!

The Components

In the beginning, putting it all together was really difficult. Both of us were completely new to building hardware hacks. Here are the components needed and what roles they played.Screen Shot 2015-12-15 at 4.54.08 PM

Arduino UNO R3: This was used to integrate the NFC Card Reader into Unity by use of serial port I/O. In other words, the System.io.ports module in Unity allows us to open a port, take the data, and copy it to a string. The Arduino was connected with the card reader onto a breadboard. We also had a volt shifter which was vital to make the conversion from 5 to 3 volts across the board.

NFC Card Reader: This part detected NFC chips attached to the cards which allowed each card to be recognized. Each NFC chip has a unique ID by default and is defined the Yu-Gi-Oh! cards. For example, the back of the Blue Eyes White Dragon card had its own chip. Once the card is scanned, a 3D model of the monster card would appear in the realm!

shadowrealmvr2

Oculus Rift: The Rift was simply used to enable us and users to see the landscape on a 3D plane. This is where all the magic happens!

image06

Duel Disk:  Our favorite component was only used for authenticity.

We had some real help from Lyle Cheatham, a fellow hacker from Waterloo University, who showed us how to get a lot of the hardware setup. Once we collaboratively got over that hump, the sky was the limit from there!

Entering the Matrix

This was a pure hack, and believe it or not there was no algorithm involved to make this happen. Below are code snippets that are the main gears behind the ShadowRealm functionality. We tinkered with Unity settings and imported certain libraries in our C# Unity code, and then we were able to get serial input from the Arduino.

Arduino code to read NFC Chip and send to serial port

The Experience

Initially, we had faced a lot of problems with the hardware because both of us were very new to hardware hacking at the time. When a fellow hacker explained to us how it worked, we were able to get the RFID reader up and running in no time. We definitely learned a lot about the fundamentals of Arduinos, which can be applied to future hacks. The first time we saw a monster in the simulator was such a relief. We had spent the past couple hours trying various methods of communicating with the Arduino through the serial port, but all had crashed our game. The first time the game didn’t crash, we saw the monster appear and at that point we knew we would be able to demo.

BostonHacks was a really cool environment, and everyone was really helpful! It was definitely a Hacky Halloween with all the costumes and candy, and it was awesome to see everyone lend a hand with a common mindset of making sure that we all had functioning hacks. The best part about it all was daylight savings though. That extra hour of hacking could not have been more clutch!

Special shout out to Jade Yee for being the dopest person ever and supporting us! We didn’t leave BostonHacks with a win, but we did get two 5 LB Hershey Bars and a Minecraft pickaxe. Reliving our childhood dream was priceless!

image00

Shahan Ahkter and Biggie Emmanuel are a senior and a sophomore respectively at Rutgers University. They both study Computer Science and have been to 15+ hackathons combined like HackRU, HackNY, and BostonHacks. Find Shahan and Biggie on GitHub.