B U G S
(Carnivorous Mutating Tribbles From Hell)
Version 2.0
31 Jul 89
Alpha Chi Rho Programming Cooperative
1621 Tibbits Avenue
Troy, NY 12180
Software and Documentation Copyrights:
Version 0.8 - Copyright (C) 1989, Peter Oehler for ACRPC
Version 2.0 - Copyright (C) 1989, Shannon Posniewski for ACRPC
OVERVIEW
Bugs is an interactive graphic simulation of Darwinian evolution;
specifically through survival of the fittest. This program is
based on an idea presented in the May 1989 issue of Scientific
American in an article titled "Simulated Evolution: wherein bugs
learn to hunt bacteria", by A. K. Dewdney.
For bio majors:
In our scenario, the environment is a pond and living in the pond
are protozoa. The protozoa (usually called bugs) are block shaped
critters moving about the screen. Their purpose is simple: to
exist and to reproduce. They are out in search of food, bacteria,
in the form of blue dots scattered about the screen. Reproduction
is carried out in a somewhat strange fashion. The process might be
termed mutational mitosis, since two individuals are produced from
a single parent, where one is identical to the mother and the other
is similar, but differs slightly in its genetic makeup.
For Trekkies:
In our scenario, the environment is the grain storage area on
Starbase 5. Living in this grain storage bin, much to Captain
Kirk's chagrin, are tribbles. For our purposes, they are block
shaped critters of various color wandering around the screen.
Their purpose is three-fold: to exist, reproduce, and make a
science fiction television series. To do this, they are in search
of food, in particular quadro-triticale. The super-grain has been
dyed blue for ease of identification and is scattered about the
screen randomly. As Dr. McCoy noticed, reproduction is by
"mutational mitosis or somethin'" in these fuzzy creatures. As
Spock cogently explained later, two individual entities are
produced from one. The first is identical to the mother, whereas
the second is slightly different genetically.
As an aside, this is one reason we subtitled our program
Carnivorous Mutating Tribbles from Hell. Although tribbles are not
insects, they are referred to as "bugs" from here on.
1
THE BIRTH OF BUGS
The Programmers:
This "project" (some call it a fiasco) was started by Pete "the
Feet" Oehler when he decided that it was about time to see if the
stuff they publish in Scientific American was worth its salt.
Shannon "Poz" Posniewski happened upon the room as Pete was
finishing the basic program and, with the help of Dan "Frodo"
Wiesen, Iwan "Spokes" Axt, and Scott "Monkeyboy" Macneil came up
with and coded a veritable plethora of enhancements. (Cotton
candy, some called it.) Since it was a little too early to head
down to their favorite downtown watering hole, Holmes and Watson
Ltd. (simply "H&W's" to aficionados) they hammered out over 500
lines of not so spiffy code. (It did spiffy things, but it wasn't
pretty.) Over the next couple days, the menus and "zoom" code was
hammered out by Poz, Pete, and Frodo. This 800+ lines of much
sweeter code is what was released as Version 0.8.
Some thought this was to be the end of the story. Much to their
surprise (and disgust), Poz took the QuickBASIC program, casually
threw away the reams of code and began work on a Turbo C version.
The reason for the change in language (besides the obvious) was for
an increase in speed. If you have a pre-2.0 version and compare it
to this one you know what I mean. In any case, enough cotton candy
was added to make even the most iron-stomached 12 year old sick and
is now presented to you as Version 2.0. (Version 1.0 was a
short-lived Turbo C cut.)
Pete, Poz, Frodo, Spokes, and Scott are all members of the Delta
Phi Chapter of the Alpha Chi Rho Fraternity at Rensselaer
Polytechnic Institute in Troy, NY. The original version (0.8) was
written, unsurprisingly, during the two weeks prior to Finals week,
Spring 1989. The Turbo C version (2.0) was worked on from the week
after Finals until mid-June 1989.
The Program:
The original program represented over 100 man-hours of coding. It
was programmed in Microsoft QuickBASIC. "For God's sake, why?" you
ask. Well, it seems that BASIC was the only language that we all
knew fairly well (read: lowest common denominator.) The original
version was written and run on a DTK 286/10 AT compatible running
at 10 MHz with a Fountain EGA card and a NEC Multisync II monitor.
The Turbo C version (2.0) represents well over 400 man-hours of
coding. It takes full advantage of the Borland Graphic Interface
routines, which should allow the program to be run on any graphics
card supported by Borland's BGI. It was written on a Standard
(yes, that's a brand name) 286 AT compatible running at 8 MHz with
a Standard EGA card and a Samsung EGA monitor. It was tested on a
386 machine running at 16MHz with a Paradise VGA card. It is
reeeaaally fast on the 386.
The documentation was written using Enable, by The Software Group.
2
And Now, the Inevitable:
The authors would appreciate a donation of $15.00 so that they can
pay for more beer to program with. Make it payable to Pete Oehler
and send it to:
AXP Programming Cooperative
Attn: Pete Oehler
1621 Tibbits Avenue
Troy, NY 12180
With your magical donation, you will receive, free of charge, an
upgrade to the next version of BUGS, in-depth documentation, the
QuickBASIC source code, the Turbo C source code, the knowledge that
you have made an ethically correct decision, and last (but not
least) a registration number to disable the annoying reminder.
If you can't afford the $15.00 then either send us a six-pack of
Dos Equis, a job offer, or whatever other money you have in your
wallet. You are free to send us anything else you like. Depending
on how much we like what you send us, you may get the services
mentioned above (but don't count on it).
By the way, this program is yours only on an "as-is" basis. There
are NO warranties.
That means:
1. If it doesn't work, tough.
2. If you lose money because of this program, tough.
3. If you have any other damages (including, but not
limited to, brain damage, loss of eyesight,
marital difficulties, catastrophic motherboard failure,
etc.) because of this program, tough.
4. If you don't like any of the above, tough.
5. Have a nice day.
But you should know this, since every piece of software you own has
this same statement on it. (Usually in some 3 point typeface and
filled with words seemingly CAPITALIZED randomly, ranting about
LIMITED warranties and that you LOSE if ANYTHING goes wrong. Some
SOFTWARE companies EVEN charge for BACKUPS, which can only be made
by when AUTHORIZED by AUTHORIZED PEOPLE (like SANTA CLAUS and the
TOOTH FAIRY). In ANY case, BELIEVE me that all those AGREEMENTS
add up to the above, except that they may have a 90 DAY WARRANTY on
the DISKS.)
3
THE PROGRAM SPECIFICS
The bugs are very active during each cycle. They decide which
direction to move, move that direction, expend one unit of energy
and age by one unit. In addition to these mundane activities,
several conditions are checked.
Chow time:
If the bug has come upon a bacterium (food, quadro-triticale.), it
is consumed and the bug gains the associated energy times an
efficiency factor that decreases with age.
Just like taxes or pushing up the daisies:
If the bug's energy has fallen to zero the bug dies of starvation.
If the option for death by old age has been enabled, the bug's age
is checked against five times its spawning age. If the bug is
older, the bug dies and its body provides fertilizer for the
bacteria.
Like crazed weasels:
If a bug is mature (i.e., old enough to spawn) and has enough
energy to spawn, it will produce an offspring. One of the
offspring's movement genes may be altered (hence Carnivorous
MUTATING Tribbles From Hell) and up to two other genes may be
modified slightly. (Incidentally, the QuickBASIC version is
limited to 100 simultaneous bugs, if there are currently 100
survivors no spawning will occur until a bug dies. This problem
was remedied in the Turbo C version (2.0) where the number of bugs
is determined by the amount of free memory.)
Pigging out:
If a bug has eaten so much that its energy exceeds its obesity
factor, it explodes and provides more nutrients for the bugs.
Dog eat dog:
If a bug runs into another bug, a check is made to see if at least
one of them is in the predator phase. If this is the case, then a
conflict results. The victor is determined by which one has the
higher score as calculated by the formula age^2 * energy. If the
victor is a predator, it consumes the loser (hence CARNIVOROUS
Mutating Tribbles From Hell) and gains the associated energy. If
the victor is not a predator, it leaves the carcass for bacteria to
grow on.
4
GENE INFORMATION
Each bug has several attributes associated with it, that, in total,
constitute a unique individual. These characteristics are stored
in its genes. The genes are what determine how the bug is affected
by the environment.
Motion:
The first six genes affect the bug's tendency to move in a
particular direction relative to its current position. Imagine
that there is a bug sitting on the documentation below. Before you
squash it, note that there are six directions which it can move.
Forward (G1)
|
(G6) Left | Right (G2)
\ /
\ * /
>-+-< Don't even THINK
>-+-< about laughing
/ >-+-< \ at the picture!
/ \
(G5) Hard Left | Hard Right (G3)
|
Backward (G4)
Each bug has a different propensity for moving in each of these
directions. This is represented by giving each direction a
"weighting", which corresponds to how often the bug will move that
direction. The higher the gene value, the higher the probability
the bug will move in the associated direction. The probability (P)
the bug will move forward, is calculated (obviously?) as follows:
P=(2^G1)/(2^G1+2^G2+2^G3+2^G4+2^G5+2^G6).
(Which, through an unusual programming slight of hand, is
completely calculated as an integer.)
Terrible Teens:
The bugs pass through a stage of development where they will attack
and eat other bugs. The onset of this stage is determined by a
gene referred to as Young Predator age and terminated at the value
of Old Predator. A bug in this stage is still capable of eating
the vegetable matter on the screen. (Perhaps Young Omnivore might
have been more accurate.)
Puberty:
Spawn Age is the age (in cycles) at which a bug reaches maturity
and may reproduce. It may seem desirable to put this very low so
as to get lots of generations in a short time. However, keep in
mind three things: (1) If they reproduce too quickly, natural
selection may not take effect; (2) they have no energy stored in
case food levels drop and (3) with Death by Old Age enabled they
will die at five times their Spawn Age.
5
Strength:
Spawn Energy is the minimum energy the bug needs to have in order
to reproduce. If a bug is of spawn age and its energy exceeds this
value, it will divide. This will effectively divide the bug's
energy by two, so a low spawn energy could be dangerous during
times of drought or famine.
Cellulite:
Obesity is the maximum amount of energy a bug may metabolize before
it explodes in a shower of protoplasm. The original reason for
this gene was to keep bug energies from exceeding the variable size
we were using (the classic 32767 limit). The idea grew on us,
however, and we therefore kept it in the new version. Besides,
Frodo whined and argued arduously to keep his explosion routine, of
which he is quite fond. (Little did he know that it was scrapped
in the Turbo C version due to lack of time (and want) to
implement.)
We've got Big Bugs:
There is also an option for bug Size. This value is the number of
pixels to the side of a bug. (Normally, the size is three.) Being
big has the advantage of being able to pick up more food in each
step. (There was a planned tradeoff between size, metabolism rate,
and speed, but it hasn't been worked in... yet.) The biggest
problem with using the size gene is that is slows down the program
LOTS. (See The Flags Menu).
6
PROGRAM OPERATION
The program opens with a title screen (DA NA! ... Drink!). If you
wish, you can just watch the bugs on this screen to get a feel for
how they move around, and so forth. When you press a key the
actual program will begin.
In a hurry?
If you want to see how it works NOW, read on.
After pressing any key, select the Options menu, then select Fill
Screen. Type a small number like 5. After the screen fills,
choose Add Random. Type how many "families" you'd like to start
with. 5 is pretty good.
Now, press the mouse's right button (or
Return to The Skeptic Tank's main Index page.
The views and opinions stated within this web page are those of the
author or authors which wrote them and may not reflect the views and
opinions of the ISP or account user which hosts the web page. The
opinions may or may not be those of the Chairman of The Skeptic Tank.