Sunday, February 6, 2011


Jeffrey Ventrella's GenePool is pretty incredible.

The physics of movement is beautiful, the "genetic" material is satisfyingly crunchy, and the experience of watching tiny "dramas" unfold is far more fun than El-Fish, though it is similarly soothing and pleasant to watch. Bots experience different types of selective pressures: natural (dominated by the bots' ability to actually reach food), sexual (interestingly, the bots are by default attracted most to those which share their own colors, but this can be changed), and artificial (you can save a bot's genotype to disk and do stuff like drag them, or food around, to ensure their survival. I'm guilty of saving a few inept but charismatic ones this way). As far as I know, this is the only artificial life simulator to include sexual selection (maybe you know of others?)

Given that evolution can be a difficult concept for students to grasp, I can imagine great benefits from inviting them to watch it actually happen in a framework like this.

Thursday, February 3, 2011

The Game is Boring: Blobistat postmortem

While Vincent was working on his version of an evolution defense game, I'd been working on my interpretation, Blobistat. Though it's not a tower defense game, it is an evolution simulation in which the player is tasked with the goal of poisoning all the predators (germs) before they eat their pink, helpless prey. Each germ has a unique resistance "genotype" which is displayed in a white bubble, signifying the minimum concentration of each antibiotic needed to affect it. The 4 antibiotics do different things: slowomycin reduces speed, nomifloxin prevents them from eating, stericilin prevents reproduction, and necrodizole, the most expensive, depletes health. As the germs reproduce, their offspring get "mutated" versions of their genome, so that the trend in resistance statistics changes over time depending on which germs survive.
One benefit to this setup is that the germs reproduce in real time every 10 seconds or so, so that the player can actually see evolution working in the 1-2 minutes it takes to play a round of the game. A clear defect is that the only thing the player has to interact with is a set of sliders that control the antibiotic concentration. Snooze alert.

While playing it, I did feel a sense of panic when a germ ambled toward one of the prey objects. But the "eating" itself passes almost unnoticed (a little blood is in order). This is just one example of how this project lacks satisfying visual, auditory, and tactile feedback.

Maybe a bigger issue is that it's poorly tuned. The game has only two stable states, and so it's easy to run out of antibiotics and watch the game field become totally overrun with germs. It is actually the complete opposite of adaptive difficulty.

There is also the problem of what happens when you run out of points to buy antibiotics - since points are awarded every second, but the antibiotics are purchased each frame, there is a strong "popping" effect that does very little damage to the germs and also fails to communicate bankruptcy to the player.

I think what Vincent really means is not that the model itself is boring, but that the game is boring. We need to work on that.

The Model is Boring: Biological Tower Defense Postmortem

Three months ago I wrote rather glibly that games are, by their nature, educational, and that all one need to do to capture this educational power is to replace the in-game models with whatever scientific or real-world model you were interested in teaching. If you wanted to teach evolution, then you integrate the rules of evolution into your game, and people will come to intuitively understand the phenomenon.

I'm not a game developer, but I am a scientist. It's appropriate, then, that I overemphasized the ease of integrating scientific models into games without really appreciating the difficulty associated with making the resultant game fun. My first foray into game development (my first foray which has reached a finished point, at any rate) is an apt demonstration of the problems integrating games with models.

Biological Tower Defense3 is an attempt to integrate a model of pathogen evolution into the game genre usually called "Tower Defense."

Because I'd never completed a project before, I aimed for what I thought was the simplest possible gameplay. "Monsters," represented by round polygons, make their chaotic way from the left part of the screen to the right, bouncing off the top and bottom edges. True to the genre, the player constructs a series of impediments and offensive weaponry to destroy the incoming "bugs." These objects cost money, which is awarded when a bug is destroyed and which is lost when a bug manages to make it to the other edge of the screen. Unlike many Tower Defense games, you build and defend at the same time, and can place a new object at any point in the game. When you run out of cash, the game ends.

How is evolution integrated into this basic framework? Well, each pathogen has four "force fields" around its central core, each a distinct color. The four colors represent different antibiotics, and the thickness of each line represents how resistant the individual bug is to a particular antibiotic. A bug with a thick green line is very resistant to the green antibiotic. If a bug has a very thin red line, its very susceptible to the red antibiotic. I've assumed that there is an energetic cost associated with maintaining each resistance, so a bug cannot be highly resistant to one antibiotic without decreasing its resistance to the others. This is meant to represent the actual costs of maintaining resistance for an organism, as well as the tendency for genes which are not actively selected for to deteriorate by natural mutation. The impediments and offensive weaponry are also each loaded with a different mixture of antibiotics. The amount of damage a cannon does against a bug is based on the strength of the dose of each antibiotic that cannon is loaded with adjusted by the resistance profile of the individual bug. Likewise with "bandages," which slow bugs down and deal damage to them as long as the bug overlaps the bandage. The medical metaphors wear quite thin, I admit.

When a bug makes it to the other side of the screen, in addition to costing you some money, it enters the reproducing pool of bugs. Every three minutes or so, the bugs in this pool undergo virtual cell division, each producing new offspring with slightly different immunity profiles. These bugs then join the march of bugs entering the screen on the left.

Finally, the player is allowed to adjust the dosage she is using to fight the bugs off via an in game menu. The hitch is that drugs which are particularly effective (calculated by examining the live bug pool) are more expensive than drugs to which most bugs are resistant. The intent is for the player to have to manage both the resistance profile of the bug population and the cost of buying effective drugs. It seems like a relatively elegant model, in my mind.

There is just the simple problem that the game is incredibly boring.

Let's break it down.

First, the game is highly abstract, so immediately upon starting the player is greeted with a little animated "battle field" upon which nothing is obviously controllable directly. I've recently added a small in game tutorial text which gives instructions, but I think the take home lesson is that players want to interact immediately. A surrogate for this is an engaging set of instructions, perhaps already embedded in the game's metaphor. But its better to let the player run to the right.

Next, the whole game model (beyond tower defense) is actually pretty complicated. Even though we are able to explain it clearly in a few paragraphs, the game itself is remarkably uncommunicative about how things work. For instance, how are we to know that there is even an economic model at work for drug prices? The in game tutorial tells you that, but how does the game show it? How are we to know that the bugs are reproducing (besides a little message saying so?). Part of this could be remediated by the inclusion of more visual indicators of game state. A persistant measure of the average bug immunity in the corner of the screen would probably help, along with a representation of the "survived bug breeding pool" where offscreen bugs milled around more and more excitedly before reproducing, perhaps one by one.

But this would be polishing on an essential flaw in the game design, which is that the model is out of temporal sync with the game. Tower Defense is a coffee break game. You play for ten minutes at a time, and I don't think most people devote much attention to it. It is just barely a game, in a way - you set up your little defenses and then sit back and watch. Evolution is an incredibly slow process, even in the abbreviated and form that its presented in Biological Tower Defense. I'd imagine that it would take upwards of 20 minutes for interesting variability to develop in the bug population. It's hard to imagine someone with the patience to play a game with so few rewards and so simple a system for so long.

The only other game I can think of which includes a reasonable model of evolution is Dwarf Fortress, which suffers its own game design problems, but which at least many people actually play. What can we learn from Dwarf Fortress? Well, I think the primary lesson is that

DF is paced for long play, and so the model of evolution, which is based roughly on Mendellian discrete gene inheritance, fits naturally into the gameplay. If you want to build muscular guard dogs, you set some dwarfs1 to the task of killing all but the strongest dogs each generation2, and then go about your other business. In 20 minutes, which might be 10 dog generations later, you've got only big dogs.

There is obviously a lot else to learn about games and models, but I'd like to leave off with two simple ideas. The first is that the game has to provide an entertaining context for the model and the second is that one way to do that is to make sure the model is "paced" at around the same speed as the game. Otherwise, the player will struggle to even notice the model is there.


1 The plural of Dwarf is apparently Dwarfs, not Dwarves.
2 Since it's Dwarf Fortress, it's obviously about 1000x more complicated than this, requiring that you restrain dogs in pens for mating and do all sorts of other things, but that's the basic idea.
3 Thanks to Gold_Ninja on the SelectButton forums for pointing out a bug. Check out the results of the SB Game Bakedown, while you're at it.

Wednesday, December 8, 2010

Graph War

I was browsing the Math Reddit today when I came across Graph War, which you can think of as an extension of the classic "Gorillas" game. In Gorillas, you were restricted to tweaking the initial conditions of a differential equation describing gravity's (and wind's) effect on a banana. Graph Wars takes it to the obvious next levels, letting you specify any function, or specify paths via first and second order differential equations. This seems like a great game for a first Calculus or Differential Equations class, especially if you let the students play with computer assistance.

Check out Graph War.

Monday, November 15, 2010

Fancy Pigeons: a genetic strategy game

At SF Science Hack Day this past weekend, an ad hoc group of scientists, engineers, and other flavors of geek designed a game which we hope can be an engaging way to learn genetics.

We sought to design a game which simulates microevolution, and is hopefully infectiously fun enough that players are naturally compelled to understand the underlying genetic mechanisms in order to succeed. Our concept is called Fancy Pigeons:

Fancy Pigeons is a strategy game in which players must selectively breed a flock of pigeons to bypass a series of obstacles. The object of the game is to get as many pigeons as possible through the course, with points awarded for each offspring that clears a challenge. Because players can see the queue of upcoming obstacles, they can choose breeding pairs which will produce offspring with both short- and long-term fitness. Mendelian genetics is faithfully represented, and in order to succeed, the player must maintain genetic variability in the population through heterozygosity while optimizing for a specific phenotype.

Game Play
Players are given charge of a flock of 24 pigeons. When the game begins, the pigeons ambiently mill about on the left side of the screen, pecking at the ground. On the right side of the screen, player see the obstacles: for example, a river, flaming bushes, and a fence. Instructional text appears on the bottom of the screen based on the obstacle at hand, ie “Breed pigeons which can cross the river with their heads above water.” By dragging and dropping two pigeons to a “mating box,” players populate a grid of 16 potential offspring, representing every possible genotype which can arise from the parental cross. The phenotype of the offspring is revealed, as well as their genotype. When satisfied, players can press “mate” to release the parents and 16 offspring back into the environment. After a 2 second delay (during which time clicking is disabled) 16 randomly selected birds flash and disappear so that the flock size is kept constant. A counter at the top of the screen keeps track of generation, decrementing each time a cross is made.

When this counter reaches 0, the pigeons attempt to bypass the next obstacle. Clicking is disabled during this time, and on average, 1 or 2 pigeons cross at once, so that players can observe their individual fates: birds that have phenotypes appropriate for the obstacles typically pass through, while those that do not typically die. Points are awarded for each successful passage, optionally modified by the difficulty of the obstacle. After all birds have traversed the obstacle, the generation counter resets, and players are once again free to breed.

Players lose when all birds die, and they win when the pigeons are finished crossing the final obstacle. The winning screen also displays the final point score, which can be posted to a leaderboard.

Deep river. Birds must be tall enough to cross without drowning. Selection: anything other than wild type.
Fire. Birds must be able to walk over the fire without burning their bodies. Selection: birds with long legs.
Fence. Birds must be small enough to fit through a hole. Selection: wild type.

A - dominant, wild type neck.
a - recessive, long neck.
B - dominant, wild type legs.
b - recessive, long legs.

This project won the Best Design award at Hack Day!

Now for the implementation....

Tuesday, November 9, 2010

The Scientific Method, According to Science

Pigmen Research Council on

The popularly-bemoaned reality of science education in schools is that it is based on rote learning of scientific output rather than actually doing science. Taking a biochemistry course, for example, is actually nothing like doing actual biochemistry (much to my delight as a grad student). Even when courses offer a lab section or a segment on experimental design, most students are taught "the scientific method." While the concept, broadly communicated as a "way of doing science" is quite nuanced, most of us will associate the phrase with a rigid list of steps. It's not a bad start: it emphasizes evidenced-based reasoning and the isolation of a single variable. But science doesn't really happen this way. This version gets a bit closer by including a little loop that hints at some requirement for tenacity: if you arrive at "Hypothesis is false or partially true" you're directed to "Think! Try again" and go back to "Construct hypothesis."

Dubious value of hypotheses aside, this loop is an improvement: it emphasizes that failure is possible, acceptable, and maybe even constructive. And it really only scratches the tip of the iceberg of the quagmire of confusion and frustration that real science can present. But with limited time devoted to science education and sparse resources in the lab classroom, few students practically get to spend much time working these issues out for themselves. They are being robbed of what is maybe the most important point of science education: to keep searching and trying until you can really convince yourself (and others) that you have shown something to be true.

Pikmin, a strategy game in which the player controls plant-animal hybrids to overcome various obstacles.
A solution may be to allow the student to perform these vital fumblings in a virtual space, rather than a real one. James Paul Gee makes an argument that video games provide children with ways to do real science in his excellent What Video Games Have to Teach Us About Learning and Literacy:
I believe, for example, that the identity Pikmin recruits relates rather well to the sort of identity a learner is called on to assume in the best active science learning in schools and other sites. Such learning - just like Pikmin - encourages exploration, hypothesis testing, risk taking, persistence past failure, and seeing "mistakes" as new opportunities for progress and learning.
If this is true, then our six-year-old is privileged in this respect over children who do not have the opportunity to play such games (in an active and critical way). ... Other children may get to practice this identity only during the limited amount of time their school devotes to active and critical learning in science - the sort that lets children do science rather than memorize lists of facts - which is often no time at all.

Make the game fun enough, as Vincent has argued, and they will do this using no real-world resources, but also using their own "recreational" time. Actually, such an effort is already underway in Minecraft - and it is collaborative to boot: the Pigmen Research Central, from which the lead image is taken. Both the content and the affect of these posts reminds me a lot of early natural scientists - compare it to A letter from Mr Antony van Leuwenhoek, concerning the Seeds of Oranges, etc., though rigor differs by an order of magnitude.

Even so, providing students with an opportunity to actually play at being Leuwenhoeks is infinitely better than describing to them how to do it. You can describe the physics of bicycles until the cows come home, but students will not be able to learn to ride unless given the opportunity to practice, play, and experiment. I believe this principle holds whether the sandbox is tangible and easy to obtain (a bike) or abstract and nebulous (an environment with underlying laws that permits scientific exploration). If we are going to teach students to think like scientists, we better give them a sandbox that emulates the joy of discovery, accepts failure, and demands rigor in exploration.

Sunday, November 7, 2010

The Model is the Game

You only need to take a look at some of the FAQs on to see that people go to heroic efforts to understand the games they love to play. There is a tendency to ascribe to these efforts the pal of mental illness of some kind (autism, Asperger's, obsessive compulsive disorder) but I'd like to take the opposite position: it is entirely natural for a person to wish to understand a system with which they interact, and which gives them pleasure or some other utility. It is true that few people go to the lengths that "aerostar," the author of the above linked exhaustively researched Final Fantasy Tactics Battle Mechanics Guide, has gone (though it is clear from his acknowledgments that it wasn't a solo effort), but tons of people have read his guide, and use it to play the game. That is the main point: the impulse to understand things in detail, to "know" them, is not the soul province of a nerdy few. It is a natural behavior of any healthy human interacting with a system.

Edmutatement is a blog about games which educate, but saying so presupposes that there could be some other type of game. There are lots of ways to think about what a game is, of course, but anything complex enough to be recognizably a game must teach something to the player, namely the rules of the game. That we associate games principally with entertainment is, arguably, the oddity. Play is universally understood as an act of learning in human children, so much so that to deny a child the ability to engage in play is to permanently damage it. That humans continue to play well into and beyond adulthood is widely understood to be a positive and deeply human characteristic. Even the negative press coverage that video games often get accuses them of training children to kill: an acknowledgment, however backhanded and (in any case) misinformed, that games do teach something.

Minecraft, a remarkable and amazing indie sandbox game, is a great example of games teaching without resorting to cheap tricks. The game simulates an effectively infinite natural landscape and allows the player, either alone or in an (incomplete, but still enjoyable) multiplayer setting, to explore and build whatever structures they desire out of the limited, but rich, in-game resources. The game provides some context and danger in the form of monsters, which require that the player at least build some kind of shelter to survive at night, but otherwise encourages no specific kind of play. Some players focus on exploration, building a series of small houses, while others focus on truly massive and dynamic constructs.

Minecraft is a technical challenge for its creator, Notch, in that it has to provide simulations of the dynamics of water flow, plant growth, fire, decay, and (no kidding) electrical circuitry that are complex enough to be interesting, believable and functional but simple enough to be simulated in real time on a truly massive scale. The tool Notch reached for is Cellular Automata, which are simple rule based systems in which the state of a particular element in the game is updated based on the states of its neighbors. These systems match the requirements exactly, because they are famous for being simple to specify and execute, but nevertheless capable of producing extremely rich and complex simulations.

Conway's Game of Life

Minecraft is still alpha software, and has essentially zero documentation, so the community of players has created the Minepedia to share information on how the game's many cellular automata (CA) function. Understand how water, one of the systems governed by a CA, is critical to building many impressive structures, and understanding Redstone, the in-game surrogate for electrical circuitry, is necessary for building automatic structures. To build anything of consequence with Redstone will quickly teach the player about the basics of digital circuity, of which it provides a complete model. Intrepid Minecrafters have even build simulations of the Ur-Cellular Automaton, Conway's Game of Life, using Redstone Circuitry.

Where am I going with all this? Well, I am going right to my one sentence summary of my educational game design philosophy: The Model is the Game. If you create a game which embeds the model you wish to teach a player into the game as (part of) the rules of the game, people will naturally learn that model, so long as the game provides some compelling reason for doing so. If you want to teach people the basic idea of evolution, a current Edmutatement Project, then just make the game itself evolution. Provide the right incentives (here is the rub, of course) and you will teach people the theory of evolution without them ever once reading a snippet of text or cracking open a textbook. In a very meaningful way, every piece of scientific knowledge constitutes a model, perhaps simplified, of how physical objects interact and behave. Find a way to make these models fun, and people will go to great lengths to learn them.