|Bugs: A Retrospective|
|Experiments in artificial life|
What I've generally come to refer to as 'bugs' in everyday (every day) conversation, started as a series of experiments with cellular automata and artificial life sometime in 1999. The idea was to create a virtual environment where object-oriented beings would live out their life according to various simple rules but left mostly to random fate. What follows is a general description of these experiments.
Beings, or 'bugs' as I shall from here on refer to them, can perform one action during a 'turn', or a tick of the system. This action can be a movement by one 'step' in one of four directions (usually randomly decided) on a plane, an attack on another bug in the same location, the consuming of a resource available in the bug's current location, or the spawning of offspring. Other variables are sometimes thrown in, such as the introduction of different races of bugs, which do battle against each other but not against their own kind, or of multiple sexes which can only reproduce by inter-breeding.
With all these various programs, the key motivating factor is visual effect. In all cases, the virtual drama plays itself out in real time graphics to the great fascination and amusement of all, and in this respect, none of the demonstrations disappoint.
A secondary hope is that the unpredictable interaction between hundreds, and sometimes thousands, of these little creatures will bring about unforeseen large-scale phenomena, which could have complex properties worthy of study. This hope is also fulfilled in many cases.
In situations with multiple sexes, for instance, the preferred outcome in most cases seems to be the rapid extinction of all but two sexes which continue joint life ad infinitum. The second most common outcome is a prolonged co-existence of the last three sexes, followed eventually by the drop to the final two sexes, suggesting that the most stable configuration is one with the fewest sexes necessary for survival.
Other interesting higher-level phenomena include various types of population clustering, diffusion and, in more complex scenarios, cycles of boom and bust.
One of the experiments undertaken in this period was a basic example of evolution through natural selection. A rudimentary mechanism was used in which bugs, which were programmed to fight each other on sight, had an inborn strength factor which determined the outcome of battles. This factor was inherited by offspring, identical to their parents, with an occasional mutation in the form of a random increment or decrement of a new bug's strength factor. As expected, the mean and average strength factor of the population grew over time.
This experiment, though itself unremarkable, gave rise to a more ambitious idea to construct a system in which every aspect of the bugs' behaviour would be influenced by evolution. Instead of following an algorithm for deciding every action, each bug would now have a simple, personalized program which would determine its behaviour during the course of its life. A description of this system follows.
The brain-program for each bug is composed of a series of statements of the form
Cond1 Cond2 ... CondN Action
which means "If conditions Cond1 through CondN are all satisfied, perform Action, otherwise continue down the program." The system itself interprets these high-level programs. Some examples of conditions which can be tested are whether a resource is present in the current location, whether the bug is being attacked by another, or various self-diagnosing conditions, such as whether the bug is running low on resources. Actions that a bug can take are "move north", "consume resource", "spawn", "shield", et cetera.
The system starts with a base population whose brain-programs are generated randomly. A small portion survive, and evolution begins. During reproduction, small mutations are applied to the child bug's program, such as flipping a condition to a different one, changing an action, or adding or deleting a condition. Sometimes, a random line is added to the program, or a randomly chosen one is deleted. Bugs have the option of reproducing asexually, by spawning copies of themselves, or sexually, by merging their programs (via various algorithms) with another bug to create a new one.
As time ticks in the system, the bugs' programs get increasingly rational, and in them we quickly start finding lines such as
If food is low and there is food to the north, move north.
If food is present, eat food.
Various things can be done to influence the development of these brain-programs. For example, the growing size of the programs as evolution progresses can be countered by modifying the rules so that the amount of food that a bug needs is influenced by the size of its program - bugs with bloated brain-programs need more food to sustain themselves. As expected, this results in leaner and more elegant brain-programs.
In addition to fascinating results in the realm of genetic programming, the new system greatly added to the complexity of large-scale phenomena. As evolution altered the bugs' behaviour through the generations, the behaviour of groups also changed over time. Various cycles and trends became more pronounced and there was now a palpable sense of some kind of history unfolding as the system ticked. Also, different runs now gave rise to very diverse bug worlds. Some runs would result in swarms of bugs which ran across the surface of their two-dimensional world consuming resources, some in bug clusters, others in vast areas of dispersed, wandering bugs. Altering the rules of the system and the initial distribution of resources also had interesting and often unpredictable effects on what sort of behaviour the bugs would exhibit on a large scale.
In the last stages of the experiment, additional complexity was added to the virtual world, such as the presence of a resource I called 'water', which covered some parts of the surface and was needed by the bugs for survival, but in which they quickly died ('drowned') if they failed to return to 'dry land'. In some cases, this situation gave rise to 'coastal cities', clusters of bug populations on the edge of the water. Attempts were also made to introduce climate conditions, such as periods when resources rain onto the surface, followed by droughts, during which resources would be gradually taken away, resulting in dwindling but increasingly crafty populations.
As eye candy, the Bug Worlds are great. As science, they are perhaps not as impressive, but one should not overlook the symbolic and artistic value of playing God with a self-contained universe of helpless and hapless digi-insects.
As my interest in the bugs grew, later versions of the software were made to be more accomodating to post-mortem examination. During each run, they periodically dumped maps, brain-program listings and various statistics regarding population, resources, et cetera. Some of these map series were combined into movie files for the ultimate user-friendly enjoyment, and now offer a convenient overview of some of the more interesting bug scenarios.
Here's an example: