Proof that Hogwarts has Magic Wands
A magic wand game based on Unity that takes you into the magical world of Harry Potter.
Get to know my Work
Introduction
This project is a magic wand game that simulates Harry Potter spellcasting with wrist rotation and voice inputs.
It was created by a team of 3 in the Sensors and Circuits course at Global Innovation Exchange (GIX), a collaboration between the University of Washington and Tsinghua University. We used various sensors, circuits, and programming languages to collect and process signals from a physical wand product and send them to a Unity game engine. The game is in the testing phase and has received positive user feedback. It provides an immersive and innovative gaming experience for magic fans.
Be careful!
Voldemort appears!
What did we find through secondary research?
"It is not easy for people to experience magic in daily life to satisfy their imagination"
Even though Universal Studios provides related services, many unfavorable factors, such as long travel distances, epidemics, and economic recession, make an experience expensive.
"Countless people want to be a member of the wizarding world"
Fact 1: When The Wizarding World of Harry Potter opened, Universal Studios Hollywood had the most significant increase in attendance among theme parks worldwide in 2016, rising 13.9 percent to nearly 8.1 million from 7.1 million in 2015. [2016 TEA/AECOM theme park attendance report]
Fact 2: The spell Harry Potter has cast on retail has been revealed in financial statements, which show that the boy wizard’s chain of just three stores generated $26.1 million (£20.1 million) of revenue over the 15 months to the end of February last year. [2020 Forbes]
Fact 3: In 2021, mobile games based on J. K. Rowling’s Harry Potter reached over $1 billion in lifetime revenue. [2021 Sensor Tower]
Design Question
How might we allow people worldwide who like to think outside the framework of reality to experience the magical world at a lower cost in their daily life and satisfy their rich imaginations?
Let us try to empathize with people in need!
Stop... Wait...
Wait! Instead of producing another page of boring proposals, why not use what we've learned to build a magic wand game
🪄
Pickup Sensors!
Prototype. Connect Sensors & Circuits
First, we used a 3D printer to print out the wand shell. Then, we used C++ language to develop the Arduino board to receive data from the accelerometer, gyroscope, and sound detector. Finally, we assembled the parts into the wand shell.
Data Collection & Processing
First, we printed out the data through the serial monitor provided by Arduino. This includes the acceleration on the X, Y, and Z axis, a button state (to determine whether to reset the wand position on the computer screen), and a sound detection state (to determine whether the user says a spell).
#include <SparkFunLSM9DS1.h>
LSM9DS1 imu;
void printAccel() {
// Get the X, Y, and Z direction acceleration from the sensor.
Serial.print(imu.calcAccel(imu.ax), 5);
Serial.print(" ");
Serial.print(imu.calcAccel(imu.ay), 5);
Serial.print(" ");
Serial.print(imu.calcAccel(imu.az), 5);
Serial.print(" ");
}
void loop () {
// Read the state of the reset push button value (0 or 1).
buttonState = digitalRead(buttonPin);
// Check if the push button is pressed.
// If it is, the button state is HIGH (= true, or 1).
if (buttonState == HIGH) {Serial.print("0 ");}
else {Serial.print("1 ");}
// Read the value of the sound detector.
microphoneValue = digitalRead(microphonePin);
Serial.print(microphoneValue);
}
Then, we transmitted data to the Unity development environment through the Ardity plug-in. Just use readSerialMessage () from the sensor message. At the same time, another SendSerialMessage () allows us to communicate with the hardware (but not in this project).
Finally, in the unity game development environment, we applied the data from Ardity to the movement of the wand on the screen.
In the example below, the data we capture is used to control the wand with the rotation of the player's wrist. However, if I were to redevelop now, I would take it a step further — By setting the initial position of the wand and converting the acceleration into the current speed to move up, down, left, and right instead of controlling it through the wrist rotation.
public void OnMessageArrived(string msg) {
// Read acceleration from X, Y direction.
wandSpeedx = speed + (float.Parse(axisN[0]));
wandSpeedy = speed + (float.Parse(axisN[1]));
// Change the position of the wand according to the change in wrist rotation.
wandModifier.transform.position = wandModifier.transform.position
+ new Vector3(-(wandSpeedx), 0, 0);
wandModifier.transform.position = wandModifier.transform.position
+ new Vector3(0,(wandSpeedy), 0);
// If the wand is out of the screen, users can press the button to
return to the original position.
if (resetWand == 1) {
wandModifier.transform.position = new Vector3(0, 0, 0);
}
}
Let's Demo!
Chia-Wei Chang
C/C ++ Programming
Sensor Connection & Data Collection
Website Design & Development
Ke Wang (Kelly)
UX Design
Game Scene Planning
Video Editing
Shenshen Lei
Unity Game Development
Product Design
C# Programming