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.