FUNDAMENTALS OF GAME DESIGN, SECOND EDITION
Genetic A-Life Games
Some A-life games involve managing a population of creatures over time. Rather than concentrating so much on individuals, the player tries to achieve certain goals with the population as a whole. By far the most successful of these is the Creatures series from Creature Labs, in which the player manages a small group of beings called Norns, creatures who can learn things through repetition. Norns also have distinct genetic characteristics that are reflected in their appearance and behavior. Unlike the people in The Sims, Norns have a limited life span, so the game focuses on breeding generation after generation of Norns and exploring and manipulating their world indirectly through them.
To create a game in which you crossbreed creatures and get new, unique individuals, you need to devise a genome: a set of descriptors (genes) that define all the important characteristics of the creature. These characteristics should include everything about the creature that can vary from individual to individual: shape, size, coloration, and so on. You can leave out details common to all creatures. For instance, if all your creatures will have two eyes and that will never change, there's no need to store a gene called "number of eyes."
When two individuals reproduce, they mix their genes, and you will need to define how this mixing takes place. It's a common mistake to think that you
should average the values from the two parents; if you do this, within a very few generations, all your creatures will be the same height or very nearly so. Human genetics work differently. Humans have not one value for each characteristic, but two, one inherited from the mother and one from the father. These two values are called alleles. If a person's two alleles for the same trait don't match, one of them dominates the other according to a rule. The allele for brown eyes dominates the recessive allele for blue, so people with one brown allele and one blue allele will have brown eyes. When a human reproduces, one of the two alleles is chosen at random to go on to the next generation. This means that it's possible for a browneyed person to still pass on the allele for blue eyes. Otherwise, the allele for blue eyes disappears from the population almost immediately.
Mutation is a change to a gene that occurs as a result of some environmental factor. Radiation famously causes mutations; so do some chemicals. Bear in mind that a mutation does not have a lasting effect on the population unless it occurs in reproductive cells, and even then the results appear only in the offspring of the individual whose cells mutate. Such mutations may benefit the population by introducing random new values into the gene pool, but they may just as easily be detrimental or even lethal to the individuals that inherit them. For the purposes of your game, you probably don't want to allow lethal mutations—those that produce miscarriages or stillborn offspring. If your creatures' gestation period is long, allowing lethal mutations wastes the player's time and doesn't add anything of value to the gene pool—or the game.