Artificial Life Games


Artificial Life Games

Artificial life is a branch of computer science research, just as artificial intelligence is. Artificial life, or A-life, as it is sometimes called, involves modeling biological processes, often to simulate the life cycles of living things. A-life researchers hope to discover new ways of using computers by using biological mechanisms ”mutation and natural selection, for example ”rather than algorithmic ones. In particular, A-life is the study of emergent properties , unanticipated qualities or behaviors that arise out of the interaction of complex systems. Life itself is considered an emergent property of the planet Earth.

The most famous (though not the first) A-life game is called simply Life and was created by a mathematician named John Conway. It depicts cellular automata , simulated beings that "live" on a grid. All they do is survive, reproduce, and die according to three very simple rules. When people first began playing with the game, they quickly discovered that it had a number of emergent properties even though it had such simple rules. Certain patterns of cells could move across the grid ("gliders"), and some ("glider guns") could even generate an endless stream of new cells .

Because they're intended for entertainment rather than research, commercial A-life games implement only a subset of what A-life research investigates. There aren't any commercial A-life games about observing thousands of generations of one-celled animals evolving in an environment, for example. Typically, A-life games are about maintaining and growing a manageable population of organisms, each of which is unique.

Artificial Pets

One subcategory of artificial life game is the artificial pet . Artificial pets are simulated animals that live on your computer, either in an environment of their own or on your desktop. They can be simulations of real animals, as in the Petz series developed by PF.Magic, or fantasy ones like the Tamagotchi, a tiny and very simple computer game built into a keychain.

Artificial pets are almost always cute. The nature of their gameplay concentrates on training and maintenance, and watching them do endearing things. They seldom reproduce or die, and the player usually wants to interact with only one or two at once. (Games about whole populations of organisms, in which they do reproduce and die, are discussed in the section "Genetic A-Life Games," later in this chapter.)

If the player is going to spend much time looking at an artificial pet, then the pet needs to have quite a lot of AI: a variety of things that stimulate it and behaviors that it exhibits. An artificial pet should have a number of emotions, or moods , that the player can learn by observation and can influence by interacting with it somehow. It also needs to interact meaningfully with others of its own kind: teasing, playing, grooming, fighting, and so on. Above all, it needs to be able to learn, so there must be a way for the player to show it how to do things. The learning process must not be too long (or the player will get frustrated and think his pet is stupid) or too short (or the player will run through everything he can teach it very quickly). (Tamagotchi, being so tiny and inexpensive, are obviously an exception to this principle!)

This quality of rich artificial intelligence distinguishes artificial pets from other kinds of A-life, in which individuals have simple rules but the population as a whole develops emergent properties. Artificial pets can have properties that appear only after they have been around for a while, but typically these are preprogrammed and are not truly emergent.

Because an artificial pet doesn't have much of a challenge or a victory condition (apart from training it to do something specific), it's a software toy rather than a game. ("Software toy" is a term coined by Will Wright, the original designer of Sim City, for entertainment software that you just play around with, without trying to defeat an opponent or achieve victory.) The entertainment of an artificial pet comes from watching it do things and interacting with it. In Petz , shown in Figure 16.1, you can see three cats, all of which are interacting with things in their environments. One is simply sitting on a rug, but it knows that it is a rug and has chosen to sit on it rather than somewhere else. An artificial pet has a large number of behaviors that the player sees repeatedly, and others that occur more rarely. Part of balancing it ”making sure that the player doesn't get bored with it ”is making sure that these rare behaviors occur often enough that the player does get to see them but doesn't take them for granted.

Figure 16.1. Petz from PF.Magic.

graphics/16fig01.gif

The Sims

The Sims is almost the only game of its kind. There was one game a bit like it, Little Computer People , many years ago on the Commodore 64, but it wasn't nearly as rich as The Sims. If The Sims can be said to belong to a class, it is a virtual dollhouse: It simulates a family in a suburban home. You can make the people move around, cause them to complete certain tasks , tell them when to go to bed and when to get up, and so on. You can indirectly influence their relationships by making them talk to each other ”the big difference is that you can't decide what they say, and you can't guarantee that they will like each other. Each simulated person has her own personality, likes, and dislikes.

One of the best things about The Sims is that there are multiple ways to play with it. It's sort of a cross between an artificial pet and a construction and management simulation. You need money to build additions to the house and to buy new furniture for it. The family has to earn that money by at least one member having a job. You can spend quite a lot of time in the buying-and-building mode, if you can afford it, which has nothing at all to do with artificial life. Some players, the particularly goal-oriented ones, really concentrate on this aspect, working hard to construct a mansion and fill it with luxuries . Others are more interested in the interactions among the people. In Figure 8.11 in Chapter 8, "The Internal Economy of Games and Game Balancing," you can see two sims dancing in their kitchen. This might have been spontaneous behavior, but it was more likely in response to an instruction given by the player.

Needs

The main challenge of The Sims is to manage this group of slightly incompetent people and to improve their career prospects by teaching them things that will help them get better jobs. Each person, called a "sim," has eight needs that she must meet on an ongoing basis: hunger, comfort , hygiene, bladder, energy level, fun, social interaction, and room (which, in effect, means uncrowded, attractive surroundings). These needs drive her behavior. When a sim feels a need, she takes actions to meet it somehow. If the need goes unmet for too long, the sim becomes unhappy and can even die (in the case of hunger). Each sim always has a queue of things to do to meet her current needs, unless they're all met at the moment. The player can also give the sim orders, in effect inserting a behavior at the front of the queue. This need-based AI is at the heart of most simple behavior simulations, whether of people or animals; if implemented properly, it works very well.

Skills

Unlike with an artificial pet, it isn't necessary to teach the sims by repeatedly showing them something. Instead, the trick is finding the time for them to improve their skills, which they can do by a variety of means. The sims have six skills: cooking, repair, charisma, body (physical strength and dexterity), logic, and creativity. These skills influence the jobs that they can take and, consequently, the amount of money that they can earn. Unfortunately , the sims are so busy and do everything so slowly that often they don't get enough leisure time to study or work out. The game is very much an exercise in time management.

Personalities

Unlike almost every other computer game, The Sims tries to simulate relationships among individual people. These relationships are not terribly sophisticated, but they do include such concepts as jealousy, anger, and love. Each sim's personality is defined by five key variables : neat, outgoing, active, playful, and nice. These determine how they react to one another and whether they're likely to get along. The Sims also encourages the player to develop friendships among his fellow sims because career advancement is conditional upon having a certain number of friends .

The Success of The Sims

The Sims has been a huge success, which we believe it owes to two things. First, it enables the player to exercise his creativity in a familiar sphere: the ordinary suburban home. In addition to building and furnishing a house, players can design their own "skins" for the sims, creating people who look like themselves (or anyone else). The game actually offers more creative play than Sim City or Sim Tower , for example, just because there are more different kinds of things to do. Players can also take photographs of their houses and store them in albums, along with written commentary that they supply, effectively creating illustrated stories. And they can share all these things over the Internet. The game offers more scope for personal creativity on the part of the player than just about any other on the market.

The second reason for the success of The Sims is that it is about human relationships. The player's immediate objective in playing The Sims is to make sure his sims' physical needs are met, but his secondary, longer-term objective is to meet the sims' mental or emotional needs: fun, social interaction, and quality living space. The need for social interaction is considerably more complex because it involves building relationships with other people rather than simply interacting with objects, and those social interactions can produce emergent properties. Players enjoy watching and influencing these interactions. In fact, the player's imagination plays a very large role in the game, just as it does in playing with dolls . The sims are not terribly complex simulations, but players give them names and personalities and ascribe many more characteristics to them than they actually possess. This quality of imaginative play is actually another form of creativity that contributes strongly to its success, especially among female players.

Genetic A-Life Games

Some A-life games are about managing a population of creatures over time. Rather than concentrating so much on individuals, the object of the game is to achieve certain things with the population as a whole. By far, the most successful of these is the Creatures series from Creature Labs (formerly Cyberlife). In Creatures , you manage a small group of beings called Norns. Norns have a certain amount of AI, and they can be taught things through repetition, like the animals in Petz. Norns also have distinct genetic characteristics. Unlike either the people in The Sims or the animals in Petz , they have a limited life span, so the game is about breeding generation after generation of Norns and exploring and manipulating their world indirectly through them.

Designing a Genome

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 that are common to all creatures. For example, 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. Genes can have any number of possible values, from two (striped or spotted?) to floating-point numbers (height of creature in meters ).

When two individuals reproduce, they mix their genes somehow, and you will need to define how this is done. For a quantitative value such as height, the initial temptation is to average them. Don't do this. Within a very few generations, all your creatures will be the same height, or very nearly. In fact, human genetics works differently. We 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 according to a rule (the allele for brown eyes dominates the 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 brown-eyed person to still pass on the allele for blue eyes. Otherwise, the allele for blue eyes would disappear from the population almost immediately.

As for quantitative values such as weight, in humans , they tend to be controlled by multiple genes and influenced by environmental factors as well. You can define these mechanisms any way you like; you certainly don't have to do it the way humans do. As research goes on, geneticists are finding that mechanisms for genetic recombination and expression are quite complex and vary a lot even within a single species.

Mutation

Mutation is a change to a gene that occurs as a result of some environmental factor. Radiation is well known as being mutagenic; so are some chemicals. Mutation has the benefit that it introduces random new values into the gene pool. Bear in mind that mutation doesn't normally affect the individual whose genes are mutated; it affects only his offspring. Of course, some of these changes can be detrimental or even lethal to the individual that inherits 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, it wastes time and doesn't add anything of value to the gene pool.

Life Span, Maturity, and Natural Selection

Each of your creatures needs a natural life span, or your population will explode. (In Creatures , the life span of a Norn is about 30 real-time minutes.) If you want your population to evolve through natural selection ”that is, to become better adapted to its environment ”then your creatures also need a period of immaturity, when they are not fertile, followed by a period of maturity, when they are. Natural selection works only if it kills off creatures with maladaptive genes before they are old enough to reproduce. If creatures could reproduce immediately after they were born, maladaptive genes would never leave the gene pool. For example, suppose that a creature's genes are such that it is unable to recognize food. This creature should die of starvation very soon. Whatever genetic values determine its food-recognition ability are clearly maladaptive. However, if it can reproduce immediately, those genes will be passed on. For natural selection to take place, you will have to design environmental hazards or other mechanisms (such as starvation ) that tend to kill off young individuals with poor genes before they get the chance to pass on those genes.

(One of the reasons there are so many diseases associated with aging in humans is that those diseases catch you only after you have had the chance to reproduce. There's no natural selection against genes for arthritis and osteoporosis because those are diseases that occur later in life, after people have already had children.)

If there's one thing we know about evolution, it's that it's very slow ”at least, if it works purely through random mutation and natural selection (evidence is growing to suggest that it's more complex than that). The life span of the Norns in Creatures is really too long for the player to breed hundreds of generations. If you want evolution to be a part of your game, you'll need to find ways of making it work nonrandomly or keep the life span of your creatures very short. Of course, the shorter the lifespan is, the less chance a given creature has to exhibit an interesting behavior, so there's a balance to be struck.

Inheritance of Acquired Characteristics

Long ago, in the morning of the world, the first zebra was pure white. But one day, there was a great fire amid the grasses of the savanna. The zebra stood deep in a pond for safety. When she came out, she was very wet. And as she passed through the burned grasses and reeds on the shore of the pond, the cinders left black stripes all along her sides. And from that day to this, all zebras have had black stripes along their sides.

Inheritance of acquired characteristics is a fancy term for this old children's-story idea. People used to think it was how evolution worked ”if giraffes stretched up their necks to get food, the next generation of giraffes would have slightly longer necks, and so on. In fact, the opposite is true: Giraffes with short necks tend to starve without reproducing, leaving only giraffes with long necks in the gene pool. The outcome is the same, but the mechanism is entirely different. Stretching your neck doesn't change your genes.

However, you're designing a computer game. There's no reason you can't include inheritance of acquired characteristics if you want to. If the player pours blue ink over one of his creatures, that could change the creature's genes to produce blue offspring. In fact, this provides a convenient way for the player to do his own genetic engineering. Instead of fiddling with the creature's genes in a rather artificial user interface, he can fiddle with the creature directly to change its genes.

Learned Behavior

Notice that learned information is also an acquired characteristic. Humans are not born knowing arithmetic; they have to be taught it. When you teach a human arithmetic, unfortunately, that doesn't cause her children to be born knowing it because the learning goes into her brain, not into her genes. In a game, however, there's a good reason for storing learned behavior in genes as well. If your creatures need to learn something important to survive, it's unlikely that the player will want to teach each individual one by one. It would be better for the player to teach one individual and then for that learning to be expressed in the genes of its offspring so that the player never has to teach them again.

Alternatively, the creatures could store the information in their brains and then begin to teach each other. Of course, you could allow the content of the teaching to change over time, producing behaviors slightly different from what the player originally intended. If certain teachings produce adaptive behavior, they themselves could be selected for, just as genes are. (The notion that ideas behave the way genes do is called memetics and is a highly controversial topic in academic circles. We're talking about computer games, however, and we can do whatever we like.)

How Many Sexes?

Sexual reproduction has the advantage over asexual reproduction in that it mixes up the genes and creates unique new individuals, which might be better adapted to their environment. You don't have to restrict your number of sexes to two, but it is the most efficient mechanism. Two is a convenient number of sexes because it has the maximum probability that two individuals of opposite sexes will find each other when roaming around their habitat.

Here's an example. Let's assume that you have equal numbers of each sex in the population, and it takes a certain amount of time for a given individual to find another one and determine whether it is a member of the opposite sex. In a two-sex species, there's a 50-50 chance that any other individual is of the opposite sex; that's not bad odds. But if three sexes are required for reproduction, it is harder for all three to find each other. A given individual would need to find two others, which takes longer, and the odds aren't as good, either. Suppose that I'm of sex A, and I need to find two other creatures of sexes B and C, respectively. When I find the first one, the chance is one third that it is also of sex A (no use to me) and two thirds that it is of sex B or C, either of which will do for now. Let's suppose that it's of sex B. Now the two of us have to go hunt for another creature of sex C. The chance of any given creature being of sex C is only one third. So, the total probability that I'll find members of the sexes I need when I bump into two random individuals is only two ninths (2/3 x 1/3) instead of 50%. And of course, it gets worse the more sexes you have.

You don't have to stick to that rule of having equal numbers of each sex, however. Beehives contain one fertile female (the queen ), hundreds of infertile females (the workers), and a few fertile males (the drones). The sex of creatures need not be determined by their genes, either. The sex of many reptiles is determined by the temperatures of their eggs during gestation. Eggs at the top of the pile, nearer the sun, develop into females; the cooler ones at the bottom develop into males.

What Does the Player Do?

A genetic A-life game might not seem to have much for the player to do: Wind it up and watch it go. However, there is actually a fair number of things she might do. For example, she can create completely new individuals and add them to the population to observe how their genes influence the population. She can add and remove environmental hazards that would tend to weed out certain genes. She can play with the rate and nature of mutation by adding or modifying mutagenic objects or areas of the environment. She can also mate particular individuals to select for particular characteristics (with animals, this is considered useful and is called breeding ; with people, it is considered evil and is called eugenics ).



Andrew Rollings and Ernest Adams on Game Design
Andrew Rollings and Ernest Adams on Game Design
ISBN: 1592730019
EAN: 2147483647
Year: 2003
Pages: 148

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net