Pressure Project 1: Square Race

My idea for this project came about when I was considering how to create a drama that held viewers’ attention for at least 30 seconds. So I thought, why not create a race?

The starting screen.

When the “Go!” button in the control panel is pressed, the race starts!

And they’re off!

5 squares of differing colors race against each other, and the result varies every time the race is run. By far the most involved part of the project was the creation of the algorithm that propels each square. In the end, I settled on this:

The heart of the algorithm is just a straightforward ramp envelope. The square is simply moved slowly across the screen over the course of 30 seconds. The random, back-and-forth movement of the squares comes from the addition of random numbers to the envelope. I used a smoother on the random values to make the random movement of the square smooth rather than jumpy. A comparator is used to determine if the square is at any point the winner — if the horizontal position of the square (equal to the envelope output plus the random output from the smoother) is at any point greater than or equal to 49, the comparator’s condition is met, and it triggers a jump actor that changes the scene to the “victory screen” for the corresponding color (just some text):

Blue wins this time! Each color has their own victory screen.

While the outcome of the race is in fact random and changes every time, in truth, due to the nature of the algorithm, the first 29 seconds or so of the race don’t impact the result whatsoever. This is because the random number generator that determines the current random displacement of the square does not take into account the previous random displacement of the square. This also means that the race will always be perceived as “neck and neck” and “anyone’s race to win” until the final second, further escalating the drama of the situation. I think this gives the race appropriate casino machine vibes — an elaborate, meaningless show to create anticipation for an outcome that is actually only determined in a brief moment.

One thing I didn’t get around to adding were audio effects and music. I wanted to add a starting gun noise that played when “Go!” was pressed, some anticipation-building music that played during the race, and a victory fanfare for each square. If I were to do this again, I would definitely add these things.

Guts of the starting screen.

The guts of one of the victory screens. In this case, it’s the “Blue Wins!” victory screen. The “Go!” button is connected to a Jump++ actor so that a new race can easily be started.


Leave a Reply