Programming, game design, and faith

Sun halo

Category: Thoughts

The semantics of “do in order” and “do together”

Alice 2 and Alice 3 have code blocks called “do in order” and “do together.” They call these control structures, although usually programming languages have control structures like “if” and “while.” Instructions placed in a do in order block are executed one after the other. Each instruction has to wait until the one before it finishes before it can start. On the other hand, instructions placed in a do together block are executed simultaneously. All the instructions start at the same time, and the block itself is finished when the longest instruction inside finishes.

This is what I tell my students, but when asked to regurgitate this fact, some students instead say that “do in order” makes the animation choppy, while “do together” makes it smoother. For years I have marked this wrong, saying it has nothing to do with smoothness of animation. These are control structures; they are about how the instructions inside are executed. However, I think I figured out what they were thinking. Imagine you have to reach for something. Your elbow joint and shoulder joint both have to move to reach it, and you move them both together for a smooth movement. If you were to move your elbow joint by itself, and then your shoulder joint by itself, you may still reach your target, but the movement will look robotic and choppy. Therefore, “do together” allows for smoother animation.

Why does “do in order” look choppy and robotic? Robots are controlled by computer programs, and traditionally computer programs execute one instruction at a time. Doing one thing after the other is, in the imagination, exactly what computers do. It is what they do, except when they’re running in parallel.

But is “do together” really a great introduction to parallel programming? When programmers implement parallel algorithms, do they really think in a “do together” semantic? I’m not convinced.

Flipped classrooms

In the CS POGIL activity writing kickoff workshop, we did some activities to become more familiar with how to write good POGIL activities. One of the exercises had me thinking more about it even after the exercise was done. While thinking about the model, I even invented a different definition for the concept, better (in my opinion) than the one given by the model. This is a good feature for models in my own POGIL activities: a good model will keep students thinking about the new concept after the activity is over. The exercise was helpful to me because it focused on the invention part of a POGIL activity, which is something I’m not used to in activity designs.

We often talk about “flipped classrooms,” normally understood to mean the lecture is replaced by students reading at home and then working on homework during class. But a well-written POGIL activity is the real flip: Instead of an individual student observing a well-known concept discovered ages ago, students in a group context invent a concept themselves, maybe even in a new, productive way. Not only is the learning deeper, but the curriculum is decolonized.

New Monty Hall door variant

(The inspiration came from a student’s submission for Remake Candyland.)

Three people play a board game. The first to reach the end of the track wins. You each have a favorite candy, and there are three cards randomly shuffled, one for each candy. The player, on their turn, draws a card. If it is their card, they advance a space. If it is someone else’s card, the other player advances a space. The player can draw once more if they choose.

We can restate this as the Monty Hall game: The player chooses a card but does not reveal it. A neutral game master looks at the other two cards and reveals one that is not the player’s card. The player can choose to keep their choice or switch. Probability would dictate that it is always better to switch.

We can mix this up by having a biased party look at the other two cards and choose whether to allow the choice or not.

Sorcery in video games

I read a question and some responses on the Christian Game Developers Facebook group yesterday. The question was, “How do you guys feel about heroes in fantasy games using magic?” There was some discussion of the prohibitions of sorcery in the Bible and the example of the converts in the NT who burned their magical books.

In the video games I have played, magic is pretty much the same thing as superpowers. Being able to control the wind or throw a fireball is not different from what X-men or Avengers do. One commenter said he doesn’t participate in any of these forms of entertainment. I admire the consistency of this stance, but I think these things are fantasy and fun to imagine.

I had to think about the broader issue of evil in video games when I started playing Diablo and Diablo II. I decided that the stuff in that game (cemeteries, winged demons, pseudo-scriptural text) is almost completely unlike anything related to real Christianity, so it was OK to play.

I stopped playing Diablo II when I saw some of my friends playing the game for hours and hours, waiting for the rare loot drops. I wondered, is this game fun or addicting? Over the years I have come to the conclusion that the real evil of Diablo and other such games is the Skinner box—making players addicted to the game by activating pleasure centers in the brain at random times. Some game companies monetize this by making players pay for loot boxes.

Please think about if you’re playing a game because it’s fun and uplifting, or because your mind is being controlled by pleasure seeking. This goes for creating games, too.

Switching strategies

On the Ludology podcast this week, they said that game balance depends in one respect on how easy it is to switch strategies mid-game. If it is too hard to switch strategies, the endgame becomes meaningless, because there is no point in playing further once a strategy becomes dominant. But if it is too easy to switch strategies, the beginning of the game is meaningless, because you can switch at the end to win without regard for the rest of the game. So the key to making the whole game meaningful is to balance how easy or hard it is to switch strategies.

Powered by WordPress & Theme by Anders Norén