Category Archives: game design

Mathematics as a single player, evergreen strategy game.

I spend a fair amount of time on the Keith Burgun Games Discord, which is a community built up around Keith Burgun’s game design theory work. He’s interested, I would say, in designing so-called evergreen strategy games in the vein of Go or Chess. That is, games which facilitate long term engagement. He is also interested in single player strategy games.

My sense is that these two goals compete pretty strongly with one another. Without providing a full account, my sense is that evergreen strategy games like Go and Chess are evergreen almost entirely due to the fact that they are multiplayer games. The addition of a human opponent, in my view, radically changes the game design landscape. As such, single player game design is different beast. This might account for why single player strategy games seem to fall short of evergreen character, where they exist at all.

How might we account for these differences? The basic argument is thus: all a multiplayer strategy game must do is provide a large enough state space between the two players that, in the presence of intelligent play, there is enough richness that a conversation and a culture of conversation can arise. I understand multiplayer, competitive strategy games in at least the following way: in such games each player wants to reach a goal while preventing the other player from the same or a similar goal. To do so they must construct and execute a strategy (which encompasses, for our purposes, both a strategy to the goal and a counterstrategy against the other player). The player naturally wishes to conceal their strategy from their competitor, but each move they make necessarily communicates information about their strategy. The vital tension of the game comes from the fact that it forces the competitors into a conversation where each utterance is the locus of two, competing, but necessary, goals: to embody the players strategy and to reveal as little about it as possible.

From this point of view the rules of a multiplayer game can be quite “dumb.” They do not, alone, provide the strategic richness. They only need to give a sufficiently rich vocabulary of moves to facilitate the conversation. One way of seeing this is to consider that the number of possible games of Go is vastly larger than the number of games of Go human players are likely to play. Go furnishes a large state space, much of which is unexplored. The players of Go furnish the constraints which make the game live.

Single player games, even in the era of the computer, which can enforce a large number of rules, struggle to meet the level of richness of multiplayer games exactly for the same reason computers cannot pass the Turing test. A computer alone cannot furnish a culture or a conversation.

(At this point you may raise the point that computers can play Go and Chess. This is true. But they cannot play like a person. In a way, the fact that AlphaGo plays in ways which surprise expert player’s of Go demonstrates my point. Playing AlphaGo is a bit like playing against a space alien who comes from an alternative Go tradition. Interpreting a move that AlphaGo makes is challenging because it isn’t part of the evolved culture of Go. In a sense, its moves are in a different language or dialect.)

Terrence Deacon argues, in Incomplete Nature (a very useful book the fundamental point of which perhaps fails to land) that we can make useful progress understanding phenomena in terms of constraint rather than in terms of construction. For instance, we can nail down what a game of Go is as much by describing what doesn’t occur during a game than what does. Another way to appreciate this point is to recognize that we can play Go with orange and blue glass beads as well as we can play it with shell and slate pieces: the precise material construction of the pieces and the board don’t matter to the game. The question I want to pose from this point of view is: where do operating constraints in a game of Go come from?

I think I’ve made a clear argument by this point that the constraints which define any given game of Go come from the players rather than the rules of Go. The rules of Go merely create a context of constraint which forces the players to interact. By creating a context where each move necessarily (partially) communicates the (hopefully concealed) intent of each player, Go creates a space where someone can be said to have a style of play. Where two players can even be said to have a style. Even a community can be understood as having a style. Play, then, is more like a literary tradition than it is like a fully rational analytical process exactly by virtue of the fact that in the presence of such a large true state space of games, play stays near a much smaller, often intuitively or practically understood, effective state space.

Single player games operate in a similar way. Either the single player or a computer enforces some rules, but the rules themselves imply (typically) a much larger true state space than the state space explored by human players. The difference is, of course, that the player is competing against a much simpler counter-constrainer. In most single player, computer hosted, strategy games the counter-constraining forces are typically a small number of very simple agents pursuing a bunch of distinct goals. If you think of each move of a game as being an utterance in a dialog, as is the case in a two player game, then, in a single player game, the player is doing worse than having a conversation with themselves: they are speaking to no one, though the game engine might be attempting to provide an illusion of conversation. Providing the illusion of culture and conversation is the grand challenge of single player strategy game design.

(Interesting note: from this point of view, games have hardly evolved from the simple (and arguably deeply unsatisfying) text-interpreters of text adventure games.)

Believe it or not, all that was front matter for the following observation which I find myself returning to over and over: Mathematics is perhaps the best example of a single player, evergreen, strategy game-like institution.

Mathematics can plausibly be described as a game. The lusory goal of a mathematical exercise is typically to construct a particular sentence in a formal language using the less than efficient means provided by the rules of that formal system. In other words, you could just write out the sentence, but you don’t let yourself do so. You force yourself, using only the formal rules of your system and your axioms, to find a way to construct the sentence. As in real games, the number of possible rewrites you can make using the formal system is much, much larger than the ones you’re actually interested in. In a real sense, the mathematician is doing the heavy lifting when it comes to the practical character of a formal system. Indeed, the community of mathematicians is doing the lifting. They develop an evolving culture of proof strategy which constrains the typical manipulation of symbols profoundly. In this way, the practice of mathematics is much like the play of multiplayer strategy games. There are probably many, many ways to prove a given theorem, assuming it is provable, but exactly because the space of proof is so large and because humans are so limited in comparison to it, style evolves as a necessity. It helps us prune probably ineffective strategies.

What insights are there here for us, as game designers? It seems to be a maxim, over at the Keith Burgun discord, that we ought not to let the player design the game. Often this comes up in places where players are given agency over goals. We might find that players adopt restrictions on their play to intentionally increase difficulty. Or they might design arbitrary goals like playing without losing any health or restricted to a subset of the board. If we to build an analogy to mathematics, it would be as if we specially designated a class of mathematicians to identify target proofs and then handed them to a distinct set of mathematicians (forbidden to invent their own theorems) to prove them. But it is precisely the freedom of mathematicians to invent their own rules and goals that makes mathematics so much like an evergreen game. To use the language of constraint, mathematicians are able to play against themselves. They build both the rules of the game and then they constrain the space of play by playing. Having the freedom to choose goals and means, they can ensure that play remains stimulating even in the absence of an opponent.

In contrast, players of single player, computer hosted strategy games who are forced to pursue only the goals the designer wants, are hamstrung to grapple with systems which inevitably offer insufficiently rich constraints. Designer’s who forbid themselves from considering player-selected goals (and even player modification of rules) are restricting themselves from considering design questions like “What sort of rule sets facilitate interesting goal choices?” Such limitations make their games as dead as the computers which host them. Not entirely dead, but pretty lifeless.

On the (pseudo?)-paradox of “fair” games.

Fair Games and 50% Win Chances

I’ll take it as an assumption in the rest of this article that a fair game is one where each player has a 50% chance of winning. We also sometimes call such a situation a “good match” or say that the game will be good if we believe such a state of affairs prevails. We also tend to view negatively the opposite condition, wherein one player has a huge advantage over the other and hence where we expect the probability of that player losing is very low (implying the probability of the other player losing is very high).

Dismal Coin FlipThese considerations aren’t limited to two player competitive games.  If we are playing a single player, digital or otherwise interactive game, we call that game “fair” when we have about a 50% chance of winning. We would call a game where our chance of winning is ~1% unfair or badly designed, and where our chance of winning is ~99% boring or badly designed.

A Pseudo-contradiction

At first glance this seems to imply a contradictory attitude, one illustrated by recalling that we also call a coin flip “fair” if there is a 50% chance of the coin landing on either face. If the purpose of a game is to determine which player is the better player, how can it be that we seem to also want the outcome of the game to be as random as possible (such that for good matches, each player has a 50% chance of winning). It would appear that good games have random outcomes and that seems to contradict their apparent purpose in measuring how well a player plays.

(NB. The account is a little harder to render in the case of single player interactive systems. However, it seems paradoxical that a player would engage with a system with the intent of winning when the outcome could equivalently be determined by the toss of a coin).

Resolution

I don’t think this is a genuine paradox, of course: when we say a game is fair, what we are saying is that the outcome isn’t random, but that it depends, sensitively, on which player makes the better sequence of moves in response to the other player. Why sensitively? Well, when two players are closely matched the the outcome of the game, if the win probability for either player is 50%, should depend very sensitively on how well each player actually plays. In particular, close matches come down to one or two critical mistakes or strokes of brilliance to tip the scales in one direction.

(This is particularly true because of another property of games (approximate reversibility) which I believe games must also have, but which I don’t discuss here.)

So it isn’t really surprising that we can resolve this merely apparent contradiction about games. But the resolution points us towards another important argument:

Implications about Randomness

Because the outcome of a good game should depend sensitively on the moves of the player, the randomness present in a good game should be minimal or not present at all. Why? Because if the outcome of a game depends sensitively on the moves the player makes, then it also must necessarily depend sensitively on random influences on the game state. Why? For outcomes to depend sensitively on a move implies that each move a player makes is carefully tuned for the game state, which they have correctly appreciated in order to make the right move. But if the game state changes randomly, then a good move might be turned into a bad move by a random change in the game state.

(It is possible to imagine random changes to the game state which don’t change the quality of moves. But if this is the case, then these changes to the game state are _extraneous_ to playing the game and may as well be removed).

Conclusion

To restate the argument:

  1. we believe games should be fair, which is to say that a given player should have a 50% change of winning
  2. this is because we want games to be sensitive tests of the quality of play of the given player, where the outcome depends sensitively on moves. We don’t want the game itself to be actually be random in the sense that the outcome is extraneous to the game itself.
  3. Random elements (which are necessarily extraneous to the game in their origin) reduce the sensitivity of the win condition on the specific moves made by a player
  4. Hence, good games should have minimal random elements.

This argument puts game designers in a difficult position. For designers of multiplayer games, they must make sure that the game’s rules don’t advantage particular players or add the appropriate handicap if they do. This turns out to be difficult. In Chess, for instance, white has a slight win chance, although the precise probability is unknown. Typically, for a new game without a long history of play, it will be very hard to determine whether such a bias exists and what size it might be.

With the rise of computers and single player strategy games a different set of design concerns manifests. The temptation in single player game design is to use random elements to provide variety for a gameplay system which may not have the strategic depth furnished by the presence of a second rational player. It is hard to imagine a deterministic single player game with the same initial conditions each play that can stand up to repeated play.

I think the way forward here is to randomize the initial conditions of any such game subject to the constraint that a given initial condition preserves the win 50% rate (perhaps based on artificial intelligence play or some other way of characterizing win chance) and then to make play from that point forward completely deterministic.

The Ethics of Game Design

In the next week or so, I’ll be on the Dinofarm Games Community Podcast talking about the ethics of game design. My baby is just one week old, though! So I might not have been as coherent there as I wanted to be. As such, I thought I’d collect a few notes here while they were still in my head.

As a preamble: there are lots of ethical implications of games that I don’t discuss here. Particularly social ones: since games often depict social and cultural situations (like novels, plays or television shows) similar ethical concerns operate for games as for those artifacts. Here I’m specifically interested in those special ethical questions associated with games as interactive systems.

The question I’m interested in is: “What are the ethical obligations of a game designer, particularly to the player?” In a way, this is an old question in a new disguise, recognizable as such since the answer tends to dichotomize in a familiar way: is the game designer supposed to give the player what they want or is she supposed to give the player that which is good for them?

Let’s eliminate some low hanging fruit: if we design a game which is addictive, in the literal sense, I think most people will agree that we’ve committed an ethical lapse. There are a few folks out there with unusual or extreme moral views who would argue that even a game with bona fide addictive qualities isn’t morally problematic, but to them I simply say we’re operating with a different set of assumptions. However, the following analysis should hopefully illuminate exactly why we consider addictive games problematic as well as outline a few other areas where games ethical impact is important.

I think the most obvious place to start with this kind of analysis is to ask whether games are leisure activity, recreation or whether they provide a practical value. By leisure activity I mean any activity which we perform purely for pleasure, by recreation, I mean an activity that is performed without an immediate practical goal but which somehow improves or restores our capacity to act on practical goals, and by practical value, I mean something which immediately provides for a concrete requirement of living.

Its a little unclear where games fall into this rubric. It is easiest to imagine that games are purely leisure activities. This fits the blurb provided by the wikipedia article and also dovetails, broadly, with my understanding of games in public rhetoric. Categorizing games as purely leisure activities seems to justify a non-philosophical attitude about them: what is the point of worrying about the implications of that which is, at a fundamental level, merely a toy¹?

Point number one is that even toys, which have no practical purpose but to provide fun, are subject to some broad ethical constraints. It isn’t implausible to imagine that we could implant an electrode directly into a person’s brain such that the application of a small current to that electrode would produce, without any intervening activity, the sensation of fun. We could then give the person a button connected to that electrode and allow them to push it. This is technically an interactive system, perhaps even a highly degenerate game. It is certainly providing the player with the experience of fun, directly. However, its likely that a person so equipped would forego important practical tasks in favor of directly stimulating the experience of fun. If we gradually add elements between button presses and the reward or between the electrodes and the reward circuitry, we can gradually transform this game into any interactive system we could imagine. Clearly, at some point, the game might lose its property that it overwhelms the player’s desire to perform practical tasks. That line is the line between ethical and non-ethical game design.

In other words, game designers subscribing to the leisure theory of games are still obligated, perhaps counter-intuitively, to make their games sufficiently unfun that they don’t interfere with the player’s practical goals.

We have two interpretations of game value: the recreational and the practical interpretations.

Of these, the idea of the game as recreation may be closest to what is often discussed on the Dinofarm Discord channel. Its also frequently the narrative used to justify non-practical games. You’ve likely heard or even used the argument that digital games can improve hand-eye coordination or problem solving skills. This interpretation rests on their existing an operational analogy between the skills required to play a game and those required to perform practical tasks. There is a lot of literature on whether such a link exists and what form or forms it takes.

If no such link exists we can rubbish this entire interpretation of games, so its more interesting to imagine the opposite (as it least seems to sometimes be the case). When a link exists the value proposition for a game is: this game provides, as a side effect of play, a practical benefit. Why the phrase “as a side effect of play?” Because, if the purpose of the game is to provide the practical benefit, then we must always compare our game against some practical activity which might provide more of that same benefit than an equivalent effort directed towards non-game activity.

To choose a particularly morally dubious example, we might find that playing Doom improves firing range scores for soldiers. But shouldn’t we compare that to time spent simply practicing on the firing range? Without some further argumentative viscera, this line of thinking seems to lead directly to the conclusion that if games are recreation, we might always or nearly always find some non-game activity which provides a better “bang” for our buck.

Elaborating on this line of argument reveals what the shape of the missing viscera might be. Why is it plausible that we could find some non-game activity that works as well or better than any given game at meeting a practical end? Because games must devote some of their time and structure to fun and, as such, seem to be less dense in their ability to meet a concrete practical goal. In Doom, for instance, there are a variety of mechanics in the game which make it an exciting experience which don’t have anything to do with the target fixation behavior we are using to justify our game.

But we can make an argument of the following form: a purely practical activity which results the improvement of a skill requires an amount of effort. That effort might be eased by sweetening the activity with some fun elements, converting it to a game, allowing less effort for a similar gain of skill.

On this interpretation the ethical obligation of the game designer is to ensure that whatever skill they purport to hone with their game is developed for less effort than the direct approach. If they fail to meet this criteria, then they fail to provide the justification for their game.

The final interpretation we need to consider is that games themselves provide a direct, practical, benefit. I think this is a degenerate version of the above interpretation. It turns out to be difficult to find examples of this kind of game, but they do exist. Consider Fold.it, a game where player activity helps resolve otherwise computationally expensive protein folding calculations.

In this kind of game the developer has a few ethical obligations. The first is to make sure that the fun the game provides is sufficient compensation for the work the player has done or to otherwise make sure the player’s play is given with informed consent. For instance, if we design a game that gives player’s fun to solve traveling salespeople problems which, for some reason, we are given a cash reward for solving, a good argument can be made that, unless the game is exceptionally fun, we’re exploiting our player base. If the game were really so fun as to justify playing on its own terms, why wouldn’t we simply be playing it ourselves?

Game designers of this sort also need to make sure that there isn’t a more efficient means to the practical end. Since the whole purpose of the game is to reach a particular end, if we discover a more efficient way to get there, the game is no longer useful.

I think there is probably much more to say on this subject but I had a baby a week ago and three hours of sleep last night, so I think I will float this out there in hopes of spurring some discussion.

The Dinofarm Community Interpretation

At the end of the podcast we decided on a very specific definition of games (from an ethical standpoint). We (myself and users Hopenager and Redless) decided games could  be described as a kind of leisure whose purpose is to produce the feeling of pleasure associated with learning. Since this is a leisure interpretation, we aren’t concerned directly with practical value, which I think is square with the way we typically think of games. However, as a leisure interpretation we need a theory of how games operate in the context of the player’s larger goals.

Let’s sketch one. What circumstances transpire in a person’s life where they have the desire for the pleasure associated with learning but are unable to pursue that desire in productive terms? One possibility is fatigue: after working on productive activities, a person might have an excess of interest in the experience of learning but a deficit of energy to pursue those productive activities. In that situation, a game can satisfy the specific desire with a lower investment of energy (which could mean here literal energy or just lower stress levels – games, since they aren’t practical, are typically less stressful than similar real world situations).

Once the game is completed, the desire ought to be satisfied but not stimulated, allowing the player to rest and then pursue practical goals again.

Again, there are probably other possible ways of situation ethical games in this interpretation, but I think this is a compelling one: games should satisfy, but not stimulate, the desire to learn, and only in those situations where that desire might not be more productively used, as is in the case of mental exhaustion or the need to avoid stress.

Games shouldn’t have a “loop” which intends to capture the player’s attention permanently. Indeed, I think ethical games should be designed to give up the attention of the player fairly easily, so they don’t distract from practical goals.

And them’s my thoughts on the ethics of game design.

¹: Note that there is a loose correspondence between our rubric and The Forms. Toys, roughly, seem to be objects of leisure, puzzles and contests are arguably recreation, and games are, potentially, at least, objects of real practical value. Maybe this is the interpretation of games is the one underlying “gamification” enthusiasts.

Goals, Anti-Goals and Multi-player Games

In this article I will try to address Keith Burgun‘s assertion that games should have a single goal and his analysis of certain kinds of goals as trivial or pathological. I will try to demonstrate that multi-player games either reduce to single player games or necessitate multiple goals, some of which are necessarily the sorts of goals which Burgun dismisses as trivial. I’ll try to make the case that such goals are useful ideas for game designers as well as being necessary components of non-trivial multi-player games.

(Note: I find Keith Burgun’s game design work very useful. If you are interested in game design and have the money, I suggest subscribing to his Patreon.)

Notes on Burgun’s Analytical Frame

The Forms

Keith Burgun is a game design philosopher focused on strategy games, which he calls simply games. He divides the world of interactive systems into four useful forms:

  1. toys – an interactive system without goals. Discovery is the primary value of toys.
  2. puzzle – bare interactive system plus a goal. Solving is the primary value of the puzzle.
  3. contests – a toy plus a goal all meant to measure performance.
  4. games – a toy, plus a goal, plus obfuscation of game state. The primary value is in synthesizing decision making heuristics to account for the obfuscation of the game state.

A good, brief, video introduction to the forms is available here. Burgun believes a good way to construct a game is to identify a core mechanism, which is a combination of a core action, a core purpose, and a goal. The action and purpose point together towards the goal. The goal, in turn, gives meaning to the actions the player can take and the states of the interactive system.

On Goals

More should be said on goals, which appear in many of the above definitions. Burgun has a podcast which serves as a good long form explication of many of his ideas. There is an entire episode on goals here. The discussion of goals begins around the fifteen minute mark.

Here Burgun provides a related definition of games: contests of decision making. Goals are prominent in this discussion: the goal gives meaning to actions in the game state.

Burgun raises a critique of games which feature notions of second place. He groups such goals into a category of non-binary goals and gives us an example to clarify the discussion: goals of the form “get the highest score.”

His analysis of the poorness of this goal is that it seems to imply a few strange things:

  1. The player always gets the highest score they are capable of because the universe is deterministic.
  2. These goals imply that the game becomes vague after the previous high score is beaten, since the goal is met and yet the game continues.

The first applies to any interactive system at all, so isn’t a very powerful argument, as I understand it. Take a game with the rules of Tetris except that the board is initialized with a set of blocks already on the board. The player receives a deterministic sequence of blocks and must clear the already present blocks, at which point the game ends. This goal is not of the form “find the highest score” or “survive the longest” but the game’s outcome is already determined by the state of the universe at the beginning of the game. From this analysis we can conclude that if (1) constitutes a downside to the construction of a goal, it doesn’t apply uniquely to “high score” style goals.

(2) is more subtle. While it is true that in the form suggested, these rules leave the player without guidelines after the goal is met, I believe that in many cases a simple rephrasing of the goal in question resolves this problem. Take the goal:

G: Given the rules of Tetris, play for the highest score.

Since Tetris rewards you for clearing more lines at once and since Tetris ends when a block becomes fixed to the board but touches the top of the screen, we can rephrase this goal as:

G': Do not let the blocks reach the top of the screen.

This goal is augmented by secondary goals which enhance play: certain ways of moving away from the negative goal G' are more rewarding than others. Call this secondary goal g: clear lines in the largest groups possible. Call G' and goals like it “anti-goals.”

This terminology implies the definition.

If a goal is a particular game state towards which the player tries to move, an anti-goal is a particular state which the player is trying to avoid. Usually anti-goals are of the form “Do not allow X to occur” Where X is related to a (potentially open ended) goal.

Goals of the “high score” or “survive” variety are (or may be) anti-goals in disguise. Rephrased properly, they can be conceived of in anti-goal language. Of course there are good anti-goals and bad ones, just as there are good goals and bad goals. However, I would argue that the same criteria applies to both types of goals: a good (anti) goal is just one which gives meaning to the actions a person is presented with over an interactive system.

Multi-Player Games and Anti-Goals

I believe anti-goals can be useful game design, even in the single player case. In another essay I may try to make the argument that anti-goals must be augmented with mechanics which tend to move the player towards the anti-goal against which players must do all the sorts of complex decision making which produces value for players.

However, there is a more direct way of demonstrating that anti-goals are unavoidable aspects of games, at least when games are multi-player. This argument also demonstrates that games with multiple goals are in a sense inevitable, at least in the case of multi-player games. First let me describe what I conceive of as a multi-player game.

multi-player game: A game where players interact via an interactive system in order to reach a goal which can only be attained by a single player.

The critical distinction I want to make is that a multi-player game is not just two or more people engaged in separate contests of decision making. If there are not actions mediating the interaction of players via the game state then what is really going on is many players are playing many distinct games. A true multi-player game must allow players to interact (via actions).

In a multi-player game, players are working towards a win state we can call G. However, in the context of the mechanics which allow interaction they are also playing against a (set of) anti-goals {A}, one for each player besides themselves. These goals are of the form “Prevent player X from reaching goal G“. Hence, anti-goals are critical ingredients to successful multi-player game design and are therefore useful ideas for game designers. Therefore, for a game to really be multi-player then there must be actions associated with each anti-goal {A}.

An argument we might make at this point is that if players are playing for {A} and not explicitly for G then our game is not well designed (for instance, it isn’t elegant or minimal). But I believe any multi-player game where a player can pursue G and not concern herself with {A}, even in the presence of game actions which allow interaction, is a set of single player games in disguise. If we follow our urge to make G the true goal for all players at the expense of {A} then we may as well remove the actions which intermediate between players and then we may as well be designing a single player game whose goal is G.

So, if we admit that multi-player games are worth designing, then we also admit that at least a family of anti-goals are worth considering. Note that we must explicitly design the actions which allow the pursuit of {A} in order to design the game. Ideally these will be related and work in accord with the actions which facilitate G but they cannot be identical to those mechanics without our game collapsing to the single player case. We must consider {A} actions as a separate (though ideally related) design space.

Summary

I’ve tried to demonstrate that in multi-player games especially, anti-goals, which are goals of the for “Avoid some game state”, are necessary, distinct goal forms worth considering by game designers. The argument depends on demonstrating that a multi-player game must contain such anti-goals or collapse to a single player game played by multiple people but otherwise disconnected.

In a broader context, the idea here is to get a foot in the door for anti-goals as rules which can still do the work of a goal, which is to give meaning to choices and actions in an interactive system. An open question is whether such anti-goals are useful for single player games, whether they are useful but only in conjunction with game-terminating goals, or whether, though useful, we can always find a related normal goal which is superior from a design point of view. Hopefully, this essay provides a good jumping off point for those discussions.


On Inform 7, Natural Language Programming and the Principle of Least Surprise

I’ve been pecking away at Inform 7 lately on account of its recently acquired Gnome front end. For those not in the know, Inform (and Inform 7) is a text adventure authoring language. I’ve always been interested in game programming but never had the time (or more likely the persistence of mind) to develop one of any sophistication myself. Usually in these cases one lowers the bar, and as far as interactive media goes, you can’t get much lower, complexity wise, than text adventures.

Writing a game in Inform amounts to describing the world and it’s rules in terms of a programming language provided by Inform. The system then collects the rules and descriptions and creates a game out of them. Time was, programming in Inform used to look like:

Constant Story "Hello World";
Constant Headline "^An Interactive Example^";
Include "Parser";
Include "VerbLib";
[ Initialise;
  location = Living_Room;
  "Hello World"; ];
Object Kitchen "Kitchen";
Object Front_Door "Front Door";
Object Living_Room "Living Room"
  with
      description "A comfortably furnished living room.",
      n_to Kitchen,
      s_to Front_Door,
  has light;

Which is recognizably a programming language, if a bit strange and domain specific. These days, writing Inform looks like this: (from my little project):

"Frustrate" by "Vincent Toups"
Ticks is a number which varies.
Ticks is zero.
When play begins:  
Now ticks is 1.

The Observation Room is a room. "The observation room cold and
surreal. Stars dot the floor underneath thick, leaded glass, cutting
across it with a barely perceptible tilt. This room seems to have been
adapted for storage, and is filled with all sorts of sub-stellar
detritus, sharp in the chill and out of place against the slowly
rotating sky. Even in the cold, the place smells of dust, old wood
finish, and mildew. [If ticks is less than two] As the sky cuts its
way across the milky way, the whole room seems to tilt.  You feel
dizzy.[else if ticks is less than four]The plane of the galaxy is
sinking out of range and the portal is filling with the void of
space. It feels like drowning.[else if ticks is greater than 7]The
galactic plane is filling the floor with a powdering of
stars.[else]The observation floor looks out across the void of space.
You avert your eyes from the floor.[end if]"

Every turn: Now ticks is ticks plus one.
Every turn: if ticks is 10:
decrease ticks by 10.

As you can see, the new Inform adopts a “natural language” approach to programming. As the Inform 7 website puts it

[The] Source language [is] modelled closely on a subset of English, and usually readable as such.

Also reproduced in the Inform 7 manual is the following quote from luminary Donald Knuth:

Programming is best regarded as the process of creating works of literature, which are meant to be read… so we ought to address them to people, not to machines. (Donald Knuth, “Literate Programming”, 1981)

Which better than anything else illustrates the desired goal of the new system: Humans are not machines! Machines should accommodate our modes of expression rather than forcing us to accommodate theirs! If it wasn’t for the unnaturalness of programming languages, the logic goes, many more people would program. The creation of interactive fiction means to be inclusive, so why not teach the machine to understand natural language?

This is a laudable goal. I really think the future is going to have a lot more programmers in it, and a primary task of language architects is to design programming languages which “regular” people find intuitive and useful. For successes in that arena see Python, or Smalltalk or even Basic. Perhaps these languages are not the pinnacle of intuitive programming environments but whatever that ultimate language is, I doubt seriously it will look much like Inform 7.

This is unfortunate, because reading Inform 7 is very pleasant, and the language is even charming from time to time. Unfortunately, it’s very difficult to program in1, and I say that as something of a programming language aficionado. It’s true that creating the basic skeleton of a text adventure is very easy, but even slightly non-trivial extensions to the language are difficult to intuitively get right. For instance, the game I am working on takes place on a gigantic, hollowed out natural satellite, spinning to provide artificial gravity. The game begins in a sort of observation bubble, where the floor is transparent and the stars are visible outside. Sometimes this observation window should be pointing into the plane of the Milky Way, but other times it should be pointing towards the void of space because the station’s axis of rotation is parallel to the plane of the galaxy. The description of the room should reflect these different possibilities.

Inform 7 operates on a turn based basis, so it seems like it should be simple enough to create this sort of time dependent behavior by keeping track of time but it was frustrating to figure out how to “tell” the Inform compiler what I wanted.

First I tried joint conditionals:

  When the player is in the Observation Room and
the turn is even, say: "The stars fill the floor."

But this resulted in an error message. Maybe the system doesn’t know about “evenness” so I tried:

  When the player is in the Observation Room and
the turn is greater than 3, say "The stars fill the floor."

(Figuring I could add more complex logic later).

Eventually I figured out the right syntax, which involved creating a variable and having a rule set its value each turn and a separate rule reset the value with the periodicity of the rotation of the ship, but the process was very frustrating. In Python the whole game might look, with the proper abstractions, like:


while not game.over():
    game.describe_location(player.position);
    if (player.position == 'The Observation Room' and
         game.turn() % 10):
        print "The stars fill the floor."

Which is not perhaps as “englishy” as the final working Inform code (posted near the beginning of this article) but is much more concise and obvious.

But that isn’t the reason the Python version is less frustrating to write. The reason is the Principle of Least Surprise, which states, roughly, that once you know the system, the least surprising way of doing things will work. The problem with Inform 7 is that “the system” appears to the observer to be “written English (perhaps more carefully constructed that usual)”. This produces in the coder a whole slew of assumptions about what sorts of statements will do what kind of things and as a consequence, you try a lot of things which, according to your mental model, inexplicably don’t work.

It took me an hour to figure out how to make what amounts to a special kind of clock and I had the benefit of knowing that underneath all that “natural English” was a (more or less) regular old (prolog flavored) programming environment. I can’t imagine the frustration a non-programmer would feel when they first decided to do something not directly supported or explained in the standard library or documentation.

That isn’t the only problem, either. Natural english is a domain specific language for communicating between intelligent things. It assumes that the recepient of the stream of tokens can easily resolve ambiguities, invert accidental negatives (pay attention, people do this all the time in speech) and tell the difference between important information and information it’s acceptable to leave ambiguous. Not only are computers presently incapable of this level of deduction/induction, but generally speaking we don’t want that behavior anyway: we are programming to get a computer to perform a very narrowly defined set of behaviors. The implication that Inform 7 will “understand you” in this context is doubly frustrating. And you don’t want it to “understand,” you want it to do exactly.

A lot of this could be ameliorated by a good piece of reference documentation, spelling out in exact detail the programmatic environment’s behavior. Unfortunately, the bundled documentation is a big tutorial which does a poor job of delineated between constructs in the language and elements of it. It all seems somewhat magical in the tutorial, in other words, and the intrepid reader, wishing to generalize on the rules of the system, is often confounded.

Nevertheless, I will probably keep using it. The environment is clean and pleasant, and the language, when you begin to feel out the classical language under the hood, is ok. And you can’t beat the built in features for text based games. I doubt that Inform 7, though, will seriously take off. Too many undeliverable promises.

1 This may make it the only “Read Only” programming language I can think of.

Quick Thoughts about Interactive Fiction

I’ve recently started a podcast called Text Adventure Purgatory wherein myself and several friends play and talk about Text Adventures/Interactive Fiction. Doing so has crystalized, in my mind, a few thoughts have been in mere fluid suspension in the back of my head about games and fun in general.

“A Theory of Fun for Game Design,” by Raph Koster asserts the following basic premise: fun is learning. This predicts that if a game offers to you a system which you can learn, then you will have fun playing it up until you have exhausted either the system or your capacity to continue learning about it. It’s silly to suggest that this theory covers everything that is fun or everything we might want to assert is a game (this kind of idealism is counterproductive in any context, if you ask me), but it is, I would argue, a useful one.

What is learning, anyway? I think neuroscience and contemporary machine learning techniques (which are inspired by and inspire neuroscience) can provide us with a useful model of the process: learning is an optimization problem which attempts to map inputs onto “desired” outputs or outcomes. Eg: the pixels (and their history) on a screen are mapped by our brains into a series of button presses which result in Mario reaching the end of the screen, where he touches the flag pole. Better than just describing the process, we now have a reasonable idea of how it happens too, and how to imitate the process in software.

There are lots of techniques for the latter, but they basically boil down to optimizing an objective function (the mapping from input to output) by exploring the input space, finding, and following trends in the output space. That is, start with a naive model, take some characteristic input data, apply the model to it, measure the outcome, make small changes to the model to improve the outcome (lots of strategies for this step), repeat until the model behaves well enough for your purposes. In the brain this happens by adjusting synaptic weights (and other physiological properties) of the neurons in question. In computerized learning systems this occurs by modifying the numerical parameters of the model.

Now we are ready for the point of this reflection: text adventures and interactive fiction provide too sparse a set of inputs and outputs to meaningfully train a system for playing. They (generally, I’m sure exceptions exist or attempt to exist) don’t provide a rich enough state space for learning, and hence they aren’t fun in the way that “A Theory of Fun” proposes we interpret that word.

What do I mean by “too sparse?” I mean, for one thing, that for any state in the game I can specify some non-perverse measure of similarity and value for that measure which has the following property: there will be no neighboring states included within that boundary. This is in contrast to games which involve simulated motion in space, which is, for the purposes of our discussion, continuous (that computers actually only simulate discrete spaces is not really material to the discussion: they are discrete spaces of sufficient granularity that our brains perceive them to be continuous).

For instance, there is a state in Deadline, the infocom game we played for several episodes in TAP, wherein the player character has discovered several pieces of broken china in the rose garden near the balcony of the library in which a murder has taken place. We arrive at this state only and exactly when a particular sequence of events (amounting, in isolation, to a few turns in the right order) has occured. There is nothing to refine about the process of reaching this state: either you perform the sequence of actions that produce this outcome or you do not so perform them.

A bit of reflection reveals how much in contrast this is with more typical videogames: in Super Mario Brothers, for instance, there are effectively an infinite number of ways to touch (to specify a single instance) the final flagpole in each level. As we vary the exact moment we press the jump botton, where we jump from, how long we hold it, how long we have run before, we refine the final state of interest and can find a solution which maximizes our height on the pole. There is a continuum of input states and output states (and a clear way of measuring our success) which allows those learning circuits (to use a drastically oversimplifying colloquialism) to grab onto something.

When playing a text adventure, in contrast, we essentially have nothing to do but explore, often by brute force, the state space the game gives us branch by branch until we find the final state. This is not usually fun, and using the context clues embedded in the text rarely helps: they can be either obtuse, in which case we are in the first strategy, or obvious, in which case there isn’t much to do but follow their instructions and traverse the graph. This problem is exacerbated by the fact that text adventures present themselves to us as text, creating the illusion of a rich, detailed world where, computationally, the exact opposite is true: everything reduces to a set of nodes connected by edges. Labeling more than one of those edges as “ending” the game helps a little: we can repeat the experience and land at different ending nodes by virtue of knowledge obtained on previous playthroughs, but we are still jumping for discrete state to discrete state, connected by discrete edges of low cardinality.

This isn’t a dig at interactive fiction: it is a way of explaining why it doesn’t “play like” other kinds of videogames, despite sharing a medium (computers). Novels, for instance, are even more restricted than interactive fiction: they proceed only and exactly in one way and come to life only and exactly as we read them.

Maybe these reflections tell us what we already know: that interactive fiction is more literature than game and that we should look elsewhere than traditional videogame experiences for an interpretive strategy which will allow us to discuss interactive fiction meaningfully.