Programming, game design, and faith

Sun halo

Category: Essays

Binocular depth perception in Alice

You can use Alice to make a 3D movie. The basic idea is to record the movie twice from slightly different camera locations. Viewers can see the depth in the movie by looking at each image with separate eyes. Try it on this image. You can use the Magic Eye trick, or look at it on a phone using Google Cardboard.

Binocular image of bunny in a scene

To make a 3D video in Alice, follow the steps below. I used Alice 2 on MacOS, but the instructions should be adaptable to other environments.

  1. First, the movie window size in Alice needs be an 8:9 ratio, rather than the default 4:3, because we will use iMovie to make the final product, and iMovie creates 16:9 ratio videos (widescreen). We need two images side-by-side, so an 8:9 ratio will work perfectly (a little taller than wide). You can set this in Alice 2 in the viewing angles in “seldom used properties” on the camera. The vertical viewing angle should be changed to 0.75; leave the horizontal viewing angle at 0.67.
  2. Next, create your Alice movie as usual.
  3. At the very beginning of your movie, create a duration 0 visible change (e.g. turn light brightness to 0 and then to 1). We will need this to align the timing of the left and right clips. It serves the same purpose as a clapperboard in a regular movie.
  4. Move the camera 0.05 m left for the viewer’s left eye.
  5. Play the movie, then start the video capture (command-shift-5 on Mac).
  6. Hit Restart on the Alice window. If you don’t see the light black out, hit restart again. Sometimes it’s not visible, so you have to keep restarting until you see the light blink.
  7. Stop the recording at the end of the movie.
  8. Move the camera 0.10 m right for the viewer’s right eye.
  9. Record the movie again. Make sure you see the light black out at the beginning. When you save the recording, make sure you know which clip is right and which one is left.
  10. Trim each clip so it begins right after the light turns on. (You can use QuickTime Player on Mac).
  11. Create a new project in iMovie, and add both clips. Add the right clip first so you know which is which. The one you add first is considered the main clip. Add the left clip so it overlaps with the first clip.
  12. Line up both clips on the left. Trim the longer clip to the length of the shorter.
  13. Select the upper clip and choose Split Screen.
  14. Share the video to a file or whatever you want.

You can watch the exported video in 3D using the “magic eye” trick if you make the window small. You can also watch the video using Google Cardboard or a similar device if you open the movie on your phone.

Example: Alice 2 file and Result video

The crown that will last forever

Presentation at ACMS 2019, Indiana Wesleyan University, 31 May 2019
James Vanderhyde, Saint Xavier University, Chicago

Smash Trophy

Paul, 1 Corinthians 9:24:

Do you not know that in a race all the runners run, but only one gets the prize?
Run in such a way as to get the prize.

David Sirlin, Playing to Win:

Winning at competitive games requires a results-oriented mindset that many players are simply not willing to adopt.

Introduction

David Sirlin, competitive video game tournament champion, wrote a book (2005) that explains how to win at games. Sirlin begins the book by describing a “mountain” of competitive gaming: a few gamers are already “on the journey” to the mountain peak, but most only think they are. “They got stuck at a chasm at the mountain’s base,” and “they are imprisoned in their own mental constructs of made-up game rules. … ‘Playing to win’ is largely the process of shedding the mental constructs that trap players in the chasm who would be happier at the mountain peak.”

The book is very interesting and I recommend it. Sirlin covers many topics related to competitive gaming. Here are few highlights:

  • Shedding the “scrub” mentality (more on this later)
  • Doing whatever it takes: Being competitive requires dedication, training, and choosing the appropriate game. Sirlin gives plenty of advice.
  • The Art of War by Sun Tzu: This is a text written around 500 B.C. It is all about strategies for warfare, especially when not to fight. Sirlin applies this to competitive video games.
  • Champion play styles: Sirlin describes several play styles and then selects exemplars of each style—first one from the world of chess grandmasters, then one from the world of Street Fighter 2.

The scrub mentality

Common usage of the term “scrub” usually means the same thing as a newbie or “noob.” Sirlin means something more specific, however. He is referring to a player who loses but blames the loss on something external to the player: the game is broken, the opponent used a cheap move, the move should be banned, and so on.

Furthermore, the scrub is limited in game performance because of a set of self-imposed rules. They feel good about themselves because they never use “cheap” moves. This is the essence of the scrub mentality. They play by their own rules, rather than by the rules of the game, and if their opponents do not play by their rules, the opponents are labeled “cheap,” “boring,” “unfair,” “dirty players,” etc.

Conversely, players who play to win do whatever it takes to win, even if it means being labeled by scrubs. True competitors do not care about these negative labels. They prove they are the best by winning at tournaments.

For example, a popular competitive video game is Super Smash Bros., in which classic Nintendo characters are pitted against each other in hand-to-hand combat. The way this game works is that attacks do damage, and the more damage a character has sustained, the easier it is to throw them out of the ring. The first player thrown from the ring three times loses. In the first Smash game, a character named Kirby was considered more powerful than the rest of the characters and was even banned at some tournaments. Kirby has an undefeatable move where he sucks in an opponent and jumps off the edge with him. This is called “Kirbycide,” and it works when Kirby is ahead. In the second Smash game, the designers modified the Kirby character to make him much easier to defeat. At that point very few competitive players ever used Kirby. Many players consider Kirbycide to be a cheap move and are angered by it. Competitive players consider it a viable strategy. Watch this video for a competitive match including Kirby (Chu Dat vs. Chillin Dude). At 1:40 you can see the dreaded Kirbycide, and at 5:30 you can see another “cheap” move known as turtling. I don’t know why Chillin didn’t keep up the turtling; he would have won.

Perhaps you’ve played with scrubs. Have you read about them in the Bible?

Biblical scrubs

Jesus often faced the scrub mentality when teaching the Pharisees. “Why don’t your disciples wash their hands before they eat?” (Mark 7:1–23). “Your disciples are picking grain on the Sabbath!” (Matthew 12:1–14). The Pharisees played by their own rules, which they called the tradition of the elders, and expected everyone else to follow them, too. Jesus said to them, “Woe to you, teachers of the law and Pharisees, you hypocrites! You give a tenth of your spices—mint, dill and cumin. But you have neglected the more important matters of the law—justice, mercy and faithfulness,” and “You clean the outside of the cup and dish, but inside they are full of greed and self-indulgence.” (Matthew 23:23, 25).

Paul faced the scrub mentality when teaching the Gentile believers in Colossae: “Do not let anyone who delights in false humility … disqualify you. … [T]hey are puffed up with idle notions by their unspiritual mind.” (Col. 2:18). Whoever those teachers were that Paul was fighting against were again playing by their own rules and imposing their rules on others. “These rules … are based on merely human commands and teachings. Such regulations indeed have an appearance of wisdom, with their self-imposed worship, their false humility and their harsh treatment of the body, but they lack any value in restraining sensual indulgence.” (Col. 2:22–23). Like a scrub, the self-imposed rules are keeping you from succeeding at what you really want.

Have you seen the scrub mentality in your own life?

The game of life

Life is not a game, but let’s see how far the analogy takes us. A game has a system of rules and therefore an objective measure of progress. If you are playing by the rules, and winning more games, you are improving in your desired goal of playing to win.

God has a system of rules, the nature of God. God’s nature is knowable by revelation. It is prescribed to us (partly) as a moral code. When a person has not come to terms with the sinful nature and accepted the grace of God and the saving work of Jesus, “they are imprisoned in their own mental constructs,” like a scrub, even if they are trying to live a moral life. All they have to work with are the moral codes they either come up with on their own or inherit from their parents and environment.

Games have an objective measure of improvement. How are you improving in your Christian walk? According to the rules I listed, you are winning if you are conforming more to the nature of God. This is difficult to determine, although Jesus and Paul listed a few in the passages already cited: justice, mercy, and faithfulness (Matthew 23:23); compassion, kindness, humility, gentleness, and patience (Col. 3:12). Sometimes it hardly seems objective at all. Are you more patient than you were 5 years ago? Can you even tell?

Sirlin (p. 1) wisely shies away from applying his principles outside the game: “games are sharply defined by rules; life is not. Exploring extreme corner cases of a game is what high-level play is all about. Exploring extreme situations in life can easily be socially unacceptable, morally wrong, and illegal.” Granted, some extreme lifestyle choices are all three of these. However, fully relying on God also allows you to reach extreme corner cases of life. How about pursuing a call to preach the gospel in an unreachable corner of the world? How about increasing your tithe by 1% every year until the day you die? How about choosing to live in a “rough” neighborhood? How about praying for every student who comes into your office, even at a state school where you could be in danger of job termination? How about praying for your spouse every single day? Or really and truly living to “rejoice always, pray continually, give thanks in all circumstances” (1 Th. 5)? I hope I someday have enough faith to do any and all of these.

Conclusion

As I study and teach computer science and video game design in particular, I am finding connections to truth and life beyond the technical skills we typically focus on. “Playing to win” is significant as an apologetics argument for the Christian life, which seems irrational to some people. As far as I can tell, Sirlin himself is an atheist. His recommended reading list says The God Delusion by Richard Dawkins is “Possibly the most important book in the world. Not a joke. It will be overlooked.” I presume he sees the scrub mentality in religious people. I think he does not realize that his own work points to faith.

Paul, 1 Corinthians 9:25:

Everyone who competes in the games goes into strict training. They do it to get a crown that will not last, but we do it to get a crown that will last forever.

Smash Trophy

Powered by WordPress & Theme by Anders Norén