Inspiration

At the beginning of the competition, we wanted to construct a hardware project to bring a fun real-life project for participants to enjoy. However, when we looked through our supplies, we realized that we only had a few hardware items:

  • A Raspberry Pi
  • An ultrasonic sensor
  • A breadboard, jumper wires, and Ethernet cable

This small selection heavily restrained what we could accomplish with are project, but out of desperation comes innovation. Because the ultrasonic sensor could measure distance, we came up with the idea of using the sensor to control motion in a video game. This led us to build a fantasy-themed game that would use the sensor to create a great experience to smoothly connect real-world inputs with virtual interactions.

What it does

"The Bad Dragon" is a synthesis of hardware and software components for a unique gaming experience. On the hardware side, a Raspberry Pi is programmed to read distance data from an ultrasonic sensor on a breadboard. The ultrasonic sensor data is measured by seeing how long emitted sound waves take to bounce back to it and utilized to control the video game as an analog input.

Meanwhile, on the software side, a small video game was built on Unity to work on a peer-to-peer connection with the Raspberry Pi. Free online assets were combined with software scripts to form a cohesive, challenging game for the user to learn how our hardware works. This game software communicates with a one-way peer-to-peer server from the Raspberry Pi, taking in sensor data as inputs for the player's height in the game. The result is an immersive gameplay session where the user's interactions with the sensor have immediate feedback on the screen.

How we built it

We started by arranging a breadboard with the ultrasonic sensor, jumper wires, and resistors based on online schematic. We then connected the breadboard to the Raspberry Pi and uploaded a Python script to read data from the sensor. After the Python script was tested successfully, a TCP server Python script was developed to translate sensor data into game inputs and send inputs to the Unity game.

Meanwhile, the game software was all developed within the Unity game engine. The free assets sourced online for UI and audio were synthesized with original game logic scripts to build a short but complete game to demonstrate the capabilities of our hardware setup. At the end, the Raspberry Pi was connected to the computer running the Unity game with an Ethernet cable, allowing direct communication between the TCP server with the computer.

Challenges we ran into

As mentioned in the introduction, the lack of hardware components limited how much we could accomplish with our project. Though we managed to build a smooth hardware-software combination, initial brainstorming was very arduous. Fortunately, we were able to use resources from the TI Lab such as resistors to complete the setup, proving the value of the tools hackathons provide. Additionally, we did not have a GPIO to USB cable to connect the computer with the Raspberry Pi through serial. To circumvent this issue, we had to build a server script to connect the Raspberry Pi with the computer through Ethernet access, but we did manage to have little to no latency issues.

With our software, we faced several issues learning how to use the Unity game engine. Because we were first-time hackers, we had to learn how to use Unity on-the-go along with all of the issues surrounding UI assets, game logic conflicts, and more. In the end, we were able to use our critical thinking skills to fix these issues and work together to make our scripts work together.

Accomplishments that we're proud of

We are proud of everything we have done in this project. From the hardware to the software, the effort we put into our programming and design paid off in the final product. By far the largest accomplishment in our project was having a sensor intended for distance data collection be able to not just communicate with our Unity game but smoothly control it. We are also proud of building a finished Unity project together, complete with a main menu and multiple game elements. Creating this project was tough, but what we managed to get working across multiple facets of game design, server development, and breadboard arrangement amazed us.

What we learned

From this project, we have learned many hardware and software essentials that we will likely carry into our careers. Our hardware building taught us the value of preparation and how to build basic circuits to communicate with a computer. Our software development taught us the basics of Python and C# syntax and how to apply them for different use cases from servers to video games. Unity game design specifically demonstrated the challenge of complexity vs simplicity in construction and keeping development environments consistent across devices to ensure data is not lost. Most importantly, we learned how to work together as team members not just sharing code on GitHub but actively communicating about issues in our programming and problem-solving together.

What's next for The Bad Dragon

While our game ended up being fun to play, we believe we can accomplish much more with it. With our hardware prototype setup, we can start building a more permanent design with a casing to make it easier to transport and put together. Meanwhile with our software, we can continue evolving the game to have more gameplay mechanics and fix bugs involving game object interactions and hardware inputs. Together, these improvements would make our game project a much more enjoyable experience for users to have fun with unique control systems in video games.

Built With

Share this project:

Updates