-
Final Update
06/01/2018 at 14:02 • 0 commentsMethods to make project:
Designing VR Race Car Game
Before designing my own virtual reality game, I first learned the foundations of Unity through an online Udacity Nanodegree course. After learning about the basics tools, I started out by making a 3D plane object for the terrain and lowering and raising the terrain in order to make the mountains and valleys. Rocks, asphalt, and grass textures were then imported in order to make the virtual reality more real. A standard asset car was then placed into the scene through the Assets provided by Unity and a camera stabilization code was attached in order to reduce motion sickness. Two different tree objects were later placed throughout the scene in order to prevent the player from cutting across the map and finishing the game early. The billboard start value was also adjusted so that the trees would be rendered nicely and not just appear as soon as the car came closer. To test this game, users were asked questions and improvements were made throughout the process (Appendix A).
Development of Hardware
A photoelectric sensor was implemented and attached to the bicycle in order to determine the rate that the player was pedaling at. A photoelectric sensor detects the light beam reflected from the pedal when it passes (Appendix G). Data is continuously collected for two seconds and the number of times the pedal has passed the sensor is counted. After comparing if the user has sped up, slowed down, or stayed constant from the previous two seconds, commands are transmitted to Unity. A “3” means that the user has increased their speed, a “2” means that the user has stayed constant, and a “1” means that the user has reduced their speed. The readings from the SerialMonitor were recorded in order to determine that the code was efficiently working. One of the main issues that arose from this setup was that the baseline value for the sensor would change because of external light and a calibration reading was implemented to make for easy changes (Appendix F).
Integration of Unity and Arduino
The first approach to integrating Unity and Arduino was through the serial port. Because Unity doesn’t have the needed libraries to do this, I included the full .NET 2.0 library in the player settings. To initialize the port, the port and the baud rate was needed and the System.IO.Ports was imported in order to do so. Using the commands of Serial.write and Serial.flush help to transmit the data from Arduino (Appendix E). Unable to make the direct connection between the two softwares using serial port, I realized through research that direct serial connection doesn’t work on Macs (Appendix D). Instead, a SerialProxy implementation was attempted in order to configure the connection, however, that link also failed to be established (Appendix C). Because of the problem that occurs with Macs, in the future I would transfer all my work to a Windows computer and try again.
Results of my project:
The game terrain was overall designed very efficiently and was engaging for the user. Because user testing was really important in determining the quality of the game, if it was fun to play, and how players felt in the environment, I asked my peers and family on their input. I not only wanted their overall opinion, but I also asked tailored questions such as, “Does the environment make you feel like you are playing a race car game?”, “How does the audio make you feel”, and “Is the size of the car accurate in relation to the other game elements?” Most of my testing was done through my mom who helped me improve the environment and the map that was made. Vaishnavi Mantha noted that the game was entertaining, however, she very quickly found a shortcut and way to cut through the middle of the map. After seeing this, I added barriers to the side of the road to force players to stay on the designated path and further added trees to enforce that players could not find another path. After fixing that issue I asked other friends, such as Ramia Rahman. Ramia also liked the game, however, she stated that because of how fast the car was going when it went over the bumps it caused her motion sickness. To overcome this, I lowered the overall speed of the car in the script. Through more user testing, I was able to determine other unexpected problems, such as unusual features on the map. Another problem that I ran into was working with the prefab for the Unity car given in the asset store. The MobileControlRig was very hard to modify as it was a script given by Unity and instead I wrote my own script to control the movement of the car. Although controlling the car with head movement would be optimal, I had to control it using buttons as it was easier to implement in the given time.
The photoelectric sensor worked as expected meaning that it effectively transmitted data from the Arduino. Everytime the pedal passed the photoelectric sensor the data would change, however, a problem that I ran into was the need for calibration because the changing in light when I tested it at different times. To overcome this in the future, I can write a more robust algorithm that looks for the difference in incoming light instead of making the base line reading from the sensor a set number. I can also add a shield to protect the sensor from external readings.
-
Final Update
06/01/2018 at 13:59 • 0 commentsMethods to make project:
Designing VR Race Car Game
Before designing my own virtual reality game, I first learned the foundations of Unity through an online Udacity Nanodegree course. After learning about the basics tools, I started out by making a 3D plane object for the terrain and lowering and raising the terrain in order to make the mountains and valleys. Rocks, asphalt, and grass textures were then imported in order to make the virtual reality more real. A standard asset car was then placed into the scene through the Assets provided by Unity and a camera stabilization code was attached in order to reduce motion sickness. Two different tree objects were later placed throughout the scene in order to prevent the player from cutting across the map and finishing the game early. The billboard start value was also adjusted so that the trees would be rendered nicely and not just appear as soon as the car came closer. To test this game, users were asked questions and improvements were made throughout the process (Appendix A).
Development of Hardware
A photoelectric sensor was implemented and attached to the bicycle in order to determine the rate that the player was pedaling at. A photoelectric sensor detects the light beam reflected from the pedal when it passes (Appendix G). Data is continuously collected for two seconds and the number of times the pedal has passed the sensor is counted. After comparing if the user has sped up, slowed down, or stayed constant from the previous two seconds, commands are transmitted to Unity. A “3” means that the user has increased their speed, a “2” means that the user has stayed constant, and a “1” means that the user has reduced their speed. The readings from the SerialMonitor were recorded in order to determine that the code was efficiently working. One of the main issues that arose from this setup was that the baseline value for the sensor would change because of external light and a calibration reading was implemented to make for easy changes (Appendix F).
Integration of Unity and Arduino
The first approach to integrating Unity and Arduino was through the serial port. Because Unity doesn’t have the needed libraries to do this, I included the full .NET 2.0 library in the player settings. To initialize the port, the port and the baud rate was needed and the System.IO.Ports was imported in order to do so. Using the commands of Serial.write and Serial.flush help to transmit the data from Arduino (Appendix E). Unable to make the direct connection between the two softwares using serial port, I realized through research that direct serial connection doesn’t work on Macs (Appendix D). Instead, a SerialProxy implementation was attempted in order to configure the connection, however, that link also failed to be established (Appendix C). Because of the problem that occurs with Macs, in the future I would transfer all my work to a Windows computer and try again.
Results of my project:
The game terrain was overall designed very efficiently and was engaging for the user. Because user testing was really important in determining the quality of the game, if it was fun to play, and how players felt in the environment, I asked my peers and family on their input. I not only wanted their overall opinion, but I also asked tailored questions such as, “Does the environment make you feel like you are playing a race car game?”, “How does the audio make you feel”, and “Is the size of the car accurate in relation to the other game elements?” Most of my testing was done through my mom who helped me improve the environment and the map that was made. Vaishnavi Mantha noted that the game was entertaining, however, she very quickly found a shortcut and way to cut through the middle of the map. After seeing this, I added barriers to the side of the road to force players to stay on the designated path and further added trees to enforce that players could not find another path. After fixing that issue I asked other friends, such as Ramia Rahman. Ramia also liked the game, however, she stated that because of how fast the car was going when it went over the bumps it caused her motion sickness. To overcome this, I lowered the overall speed of the car in the script. Through more user testing, I was able to determine other unexpected problems, such as unusual features on the map. Another problem that I ran into was working with the prefab for the Unity car given in the asset store. The MobileControlRig was very hard to modify as it was a script given by Unity and instead I wrote my own script to control the movement of the car. Although controlling the car with head movement would be optimal, I had to control it using buttons as it was easier to implement in the given time.
The photoelectric sensor worked as expected meaning that it effectively transmitted data from the Arduino. Everytime the pedal passed the photoelectric sensor the data would change, however, a problem that I ran into was the need for calibration because the changing in light when I tested it at different times. To overcome this in the future, I can write a more robust algorithm that looks for the difference in incoming light instead of making the base line reading from the sensor a set number. I can also add a shield to protect the sensor from external readings.
-
March Summary
04/19/2018 at 17:29 • 0 commentsThis month I ran into a lot of problems. Firstly, I uploaded the game from the computer onto my android phone and the car started going in the wrong direction. I tried changing the direction of the camera and the car and also modifying the values and location of the mobiletiltcontrolrig prefab that I was using. Despite all this I was unable to fix the direction of the car, so I started researching on solutions and looking deeper at the code. I think instead of using the mobile tilt I will use buttons or I will try remaking my entire terrain and seeing if the same problem occurs. Secondly, I had trouble sending the data from Arduino to Unity, however, I think that should be pretty easy to fix because I found a website explaining how to do so. Hopefully, next month I will make more progress than having setbacks.
-
February Summary
04/19/2018 at 17:10 • 0 commentsSo far, I have been able to get the car to move on the track that I have designed and this month I moved onto the hardware side. I attached a photoelectric sensor to an Arduino to measure the speed of the user pedaling and convert the data I receive into the speed. I also continued to research on how to transmit this data into unity and found out that I need to use the serial port for that and I started to configure this.
-
January Update
04/19/2018 at 17:00 • 0 commentsThis month I completed designing the entire maze. I started from designing the terrain (the different trees and different heights in the land) and added the path for the car to follow. I also decided to add stones on the edge so the car doesn't go out of the track. I also am using the standard asset car that unity provides and I wrote a script for the camera to stabilize so that the user won't have a lot of motion sickness.
Top view of the race car track
Camera view
-
November Summary
12/05/2017 at 15:40 • 0 commentsI worked further on the Unity code and learned about how to place objects in the scenery and adjust their position and size. I also started to work on shaders and lighting in the game. I looked at different sources to better understand how to implement Arduino and Unity such as: https://www.alanzucconi.com/2015/10/07/how-to-integrate-arduino-with-unity/. I also continued to look at different research articles such as: https://www.ethz.ch/content/dam/ethz/special-interest/baug/ivt/ivt-dam/vpl/reports/1201-1300/ab1244.pdf. The article also brought up other concerns such as smoothing the data received from the sensor and possible filtering methods.
-
October Summary
11/02/2017 at 18:11 • 0 commentsThis month I wrote 2 article reviews on the pros and cons of Google Cardboard and on Oculus Vs Vive. I also finalized my project design and wrote the proposal along with presented it to the class. Through feedback from my classmates I realized that I need to research on how the sensor will update the phone in real time.