Coroutines, Dialogue, and Testing

Danny Gallagher
IMM at TCNJ Senior Showcase 2017
2 min readApr 20, 2017

As we near the homestretch of our projects, I finished the VR portion of my game. This week, I implemented the wave system, end screens, and restart functions. These tasks seem deceptively simple- just write a couple variables to change game states, right? Well, the devil lies in the transitions between these game states. A hard switch to a new scene would be jarring to a normal player, let alone a player immersed in VR. In addition, switching scenes in general would require a great deal of rewiring references to prevent null reference objections. To solve these problems, I decided to use coroutines to fade text in and out, then use a controller to determine what that same texts says. The coroutines not only allow me to organize each phase of the game into separate threads, but let me utilize the WaitforSeconds command, which helps sequence animations, fades, and button activations in a natural manner.

I also recorded dialogue and added sound effects to the end of each wave, to break up the tension of the game. By injecting some humor in between spurts of action, I hope to give players a chance to step back, relax, and have fun.

Finally, I tested on the Oculus. I was unable to use the fire controller- I believe because of the inability of the computer to connect to the internet, and thus to Oculus. I also had some bizarre problems with freezing, loading, and firing when I attempted to play from the editor, but after I sent an actual build to the Oculus, the game worked splendidly. The only issue I really have to worry about is the length of the chord. After trying to spin in the chair, I quickly realized that the wire continuously got caught. I could move with some freedom when standing, but that led to more nausea. Thus, I will have to think carefully about how I situate the wires during the Showcase (perhaps I will have to suspend the wires above the player to prevent wrapping). This just goes to show the value of testing even things that initially seem minor- as you never know what will work and what can snowball into a problem.

--

--