2013-03-04: Player as Programmer

The source for this post is online at 2013-03-04-player-as-programmer.scrbl.

Categories: Games

One of my hobbies is playing video games. Videos games have a bad reputation with a lot of people as being a particularly bad form of entertainment, so some people I talk to are surprised when they find out I play them. In this post, I discuss why I enjoy games against other forms of entertainment.

-

Compared to other forms of entertainment, video games have many virtues, especially for an adult with children:

Of course, games have some problems, which are mostly shared with other types of popular entertainment: many popular games contain violence, gore, bad language, etc. Luckily, the game rating agency, the ESRB, has very thorough reviews (compare New Super Mario Bros. Wii, Final Fantasy XIII, and Call of Duty: Black Ops II), as opposed to movies or TV where the ratings have no information behind them at all. So, it is very easy to avoid what you don’t want to see. The fact that games are so often consumed by children means that there are many games targeted at them and you can have a basically endless supply of clean games if you want. Furthermore, one of the great things about older games is that they lack the visual fidelity to produce offensive effects, so they are incredibly pure and the catalog of good old games is vast.

In any case, the thing that most compels me to play games is that they are "learning machines": each game presents a unique system of play that constantly evaluates your performance in that system, encouraging you to improve with rewards and ratcheting up the challenge as you progress. It feels good to learn something and master it—games can provide this experience in a compelling way.

I think of the activity of playing a game as very similar to programming, and I enjoy it for the same reason: I have a new challenge and I have to discover a way to approach it that will succeed. For example, you can think of a game’s player as a function with the type:

(GameState -> PlayerAction)

That is, the player consumes the GameState, an encoding (often visual) of the state of the game, and produces a PlayerAction (often, by pressing buttons on their controller). In contrast to this "stateless" player, some games require a "stateful" player that plans and reacts to their plans, which would be like the type:

(PlayerMemory GameState -> PlayerMemory PlayerAction)

I think some good examples of these different player styles are something like Pong, where you can be stateless, and something like Civilization, where you need a detailed strategy that is not simply reactionary on the game state.

When you are playing a game, you are writing this function into your brain. Since programming is a rewarding activity, this can be a rewarding activity too, although I think this is uniquely fun because you are sitting in front of a great test case generator and you can modify your style continuously.

Something that concerns me a great deal is: which games are fun? Or from another perspective: which functions are fun? Yet another distinction is: which functions are fun to write and which functions are fun to run? In future posts, I’ll explore these ideas and discuss my theory of what makes games fun and how that can influence game design.