









LifeByDesign

Series 1

v1.0


By Mike Baharmast
MB Scientific


CC-2-20-94 All rights reserved
























TABLE OF CONTENTS




A) Overview


B) LifeByDesign- Series1- Theory - 
1- Defining Cyber Life -  Life's embodiment in cyberbugs, individual living, eating to survive, dying, birthing and species survival
2- Pulling off cyber ecology:
2.1- Ofield, sensing and finding food
2.2- Fight of flight and the art of survival
2.3- Birthing and dying
2.4- Energy balance
2.5- Food chain and a viable cyber-eco system
2.6- Predator clusteration and competition
2.7- Mutation and speciation
2.8- future experiments- automutations, morphing, learning, spacial anomalies


C)  LD1- LifeByDesign- Series 1 Software


1.0- Introduction to LD1--Playing the LifeByDesign Series 1 Games
1.01- The Genetic variables and game controls
1.1- Demo game: 3 inert cyberbugs
1.2- Demo game: 3 carnivore round robin
1.3- Food chain demo: 1 carnivore, 1 herbivore and 1 plant species
1.4- Food chain demo: 2 carnivore, 1 herbivore and 1 plant species
1.5- Playing A custom game
1.6 Pausing and resuming a game
1.7 System responsiveness
1.8 Viewing Ofield then cleaning and resuming a game
1.9 Wagering on a game
1.10 Quitting LD1









A) Overview: LifeByDesign  Series 1 - Theory and Software Experiments

LifeByDesign is an arena which provides theoretical settings and it's implementation in software ( LDx - SERIES y).  This release, LD1-Series 1 covers an eco system consisting of species of single celled "cyber-bugs" that exist within a plant life-herbivore-carnivour food chain. The software is written as a series of experiments or games where the winner ends up on top of the food chain and the loosers (probably) go extinct.
 There are several levels of envolvement. A player can merely play the games, a designer may vary genetic variables governing initial design parametes for a species (top speed, ageing and birthing parameters, etc.), an author may write custom genetic code or build a new environment or anything else for that matter.
Genetic variables governing species behavior are available to users in Windows .INI form. Genetic code, in C form, may also be requested. Those confident on their cyberbug designs may go up against each other. The software even lets users wager points on their designs, to make it more interesting. 
MB Scientific will serve as a hub for gathering and dissemination of work in an on going basis.
Convention: the writing conventions used herein are consistent with ANSI C .



B) LifeByDesign - Series 1- Theory

1- Defining Cyber Life through cyberbugs- 
CONCEPTS:Life's embodiment in cyberbugs, individual living, eating to survive, food chain, dying, birthing and species survival, genetic data and code, mutation and speciation,
cybereco system

I'm pattering the definition of cyber life on the concepts that  I'm familiar with, so here it is:
1- In this experimental set a unit of life is called a Cyberbug, it has a body defined in spacial terms. The simplest body is a cell, the subject of the current model. Body morphing is left to future models.
2- A cyberbug is born of a parent, it lives a finite life then it dies
3- A cyberbug consumes energy to survive, and dissipates energy as it lives and moves.
If it runs out of energy it dies. 
4- Cyberbugs in the bottom of the food chain convert raw environmental energy. They are the cyberplants, they embody that energy and are consumed by cyberherbavores which embody that energy. They are consumed by cybercarnivores.
5- A cyberbug's behavior is defined by a set of cybergenes consisting of geneological (parent given and subject to mutations)  variables as well as code . The geneological variables at this time consist of:
Family or clan sign: int sign;
Longevity:  int max_age;
Energy capacity: int max_life;
Birthing energy int b_energy; 
Initial energy at birth: int i_life;
Maximum speed:  int max_vel; 
Energy dissipation profile: int edp;
Dominance threshold:  int min_e_h;
Age of maturity: int adult_age;
Color:  int color;
Hunter_bugs: int hb;
Target_bugs: int tb;
Enemy_bugs or Competitor_bugs: int cb;

The genetic code is currently implemented in C form.

There also a set of dynamic variables which at this time consist of::
Present location: int x, y; In 2 dimensions
Present velocities:  int xvel; int yvel; In 2dimensions
Present energy level:	 int life; 
Present age:  int age;

6- cyberbugs perpetuate through birth; the current model supports single cell birthing, gender mating is left to future models. 

7- Over generations mutation ( variations to genealogical variables and code) may occur, giving rise to speciation. Our current model allows manual (user defined) speciation. Autospeciation/automutation is left to future models.


2- Pulling off cyber ecology: 
CONCEPTS: cyber-eco system, One_Field


2.1- Ofield, sensing and finding food
CONCEPTS: One_filed,sensing and space,  finding food

The first thing that this model does is defining existence. We start by defining  One_Field, ,or Ofield for short, that consists of and gives rise to all constituent cyberbugs.

In our experiments, consisting of 3 cyberbug species in a finite 2 dimensional space, Ofield is currently defined as:

typedef struct One_Field { int strength; int cyberbug_id;} OFIELD;
OFIELD Ofield[4][400][400];

Ofield[cyberbug_species][x][y]. strength   = f(x,y)
Ofield[cyberbug_species][x][y].cyberbug_id=cyberbug_number;

where x,y are cyberbody location and cyberbug_species_type=1, 2 or 3 and cyberbug_id is a number unique to that cyberbug within it's species. f(x,y) is a function that takes maximum strength at x=y=0 (cyberbody center) and trails off away from the cyberbody.

Ofield[0][x][y]  contains the environmentally provided energy source, consumable by bottom of the food chain. Species type 1 are the plant life, type 2 are the herbivores and type 3 the carnivores.

We define sensory perception for cyberbugs as scanning Ofield . Currently Ofield is scanned for it's food source, enemies and competitors, then a bug behaves accordingly as defined by it's genetics.

We then define space from a bug's point of view as it's sensory range. This is a subset of the spacial coordinate system which we have se up as the domain of Ofield.

These 2 fundamental concepts are necessary for implementing the basic genetic pseudo-code FIND FOOD.


2.2- Fight or flight and the art of  survival 
CONCEPTS: hunt, evade, fight, flight and time and the instability of Ofield 

Next we'll lay the genetic pseudocode for CATCH FOOD and DON'T GET EATEN OR KILLED.

A cyberbug scans around for a hunter,  target (food) or an enemy, if it finds a target it will move towards it, i.e. the hunt. If it comes within it's grasping range it will kill it and eat it. If it senses a hunter it will move away from it, i.e. evasion. If it finds and enemy it may move towards it or away from it depending on how it measures it' opponent, i.e. fight or flight.
If it doesn't sense anything it will keep on foraging.

Now we can give a meaningful notion of time for a cyberbug, it is the rate of motion of things (rate of change of Ofield) in a cyberbug's sensory zone.

In abstract all of this implies that Ofield has to be unstable everywhere for time to exist. 


2.3- Birthing and dying
A cyberbug's life is finite, artificially defined as max_age in the genetic set, which is to serve as a measure of maximum wear and tear on a cyberbug over it's life time. 
Also as we established above, cybereco system is dangerous, a cyberbug can get killed or eaten, or just starve to death.

So for a species to be viable in the cybereco system cyberbugs must procreate. Heuristically, in the current model, after a bug has consumed enough to reach BIRTHING_ENERGY can give birth, dispensing INITIAL_ENERGY_AT_BIRTH from itself to it's progeny every time the blessed event occurs.


2.4- Energy balance

Heuristically we have:
CURRENT_CYBER_BUG_ENERGY=INITIAL_BIRTHING_ENERGY + CONSUMED FOOD ENERGY  - DISSIPATED BIRTHING ENERGY - DISSIPATED KINETIC ENERGY-DISSIPATED NORMAL ENERGY

DISSIPATED NORMAL ENERGY is the genetic ENERGY DISSIPATION VALUE. It is supposed to represent the energy (heat, or radiation) that a life form expends even when standing still and doing nothing.

2.5- Food chain and viable cyber-eco systems

Now we have the theoretical foundation for devising and implementing a simple cybereco system. It will contain an environmentally supplied raw energy source (Ofield[0][.][.]), converter (plant like) cyberbugs, herbivore like cyberbugs and carnivore like cyberbugs. 
The object of the experiment will be to see if we can design the bug cyber-genetics so we can have a viable, or lasting, cybereco system; i.e. one that would maintain all 3 species over time.
In the simplest case, barring speciation and mutations, it quickly became clear that there existed an energy input threshold of sorts, below which the eco system wouldn't be viable.
This threshold would naturally be dependent on species genetics, but we didn't pursue that relationship analytically not only because of complexities but mainly because heuristically it was obvious to see what was happening.
To simply demonstrate this, setting Ofield[0][x][y]=0 everywhere would result in plant-life die-offs, then herbivore die-offs, and carnivore die-offs. Increasing the environmental energy supply would increase the chances of survival and eventually the increased values would result in obvious proliferation of cyberbug populations. 
That result put in simple heuristic language would be that for the ecosystem to be viable an abundance of environmentally supplied energy must be available, and for each strand of food chain to be viable an abundance of that energy must percolate up through that food chain. Or in classical terms the entire cybereco system must be aentropic.


2.6- Predator clusteration and competition

Once the energy threshold hurdle was overcome the experiments for establishing a viable ecosystem revealed another tough analytical nut that was again heuristically digestible.

As the energy was abundant the populations would explode, then the natural attraction of bugs to food sources would result in natural clusteration of hunters and formed gang assaults. That gave rise to a natural cooperation in hunt where a prey running from one hunter simply ran into another. The result of this was a great increase in hunting efficiency and that would cause populations in the top of the food chain to explode and the carnivores eventually ate themselves right out of existence. We tried to compensate with changing the genetic variables like aging, birthing, energy absorption/dissipation profiles,etc. as well as environmental energy supply. Inevitably the populations would go through feast and famine oscillations and eventually  the carnivore populations would collapse and sometime the herbivore populations would collapse as well. In a nutshell the food chain was unstable over time.
We saw periods of balance in the top of the food chain when it's numbers where small and prey was relatively abundant. This forced us to introduce the concept of predator self regulation where predators would attack and kill one another as a rule and tolerate one another as an exception. We then introduced genetic variables:  AGE OF MATURITY and DOMINANCE THRESHOLD to help define these exceptions which presently are:
Clan members don't attack their young, i.e. young under the AGE OF MATURITY (they will attack other young). And, a predator is to hungry to attack another if it's energy level falls below DOMINANCE THRESHOLD. 
We also wrote the genetic code for implementation of these concepts. With that we achieved viable eco systems.

2.7- Mutation and speciation

We finally expanded our model to allow for speciation, e.g. different strains of carnivores (defined by different genetic variables), and to try out different subspecies against each other.
At this point this is manually done, i.e. one can go in and change the genetics for a subspecies or another and run an experiment.

2.8- Future implementations: spacial anomalies , automutations, morphing, learning.

There are several areas that show interest and are in the plans. The current model has a homogeneous space, any bug can go any where. It would be interesting to build spacial anomalies, e.g. hiding places, dangerous places, etc.

Another area is that of automutation and speciation. It would be interesting to see if species would find natural stability or if die offs would be forced on top of the food chain giving room for the evolution of new predators mutating out of the bottom of the food chain, or may be all of the above( and then some?!?).

This model hasn't touched the concept of morphing, mainly because the computational requirements are already overwhelming. The concept of  keeping track and handling the dynamics of shapes for hundreds of bugs while keeping the eco system lively would be tackled sometime down the road.

Learning is also in the plans and would likely be encompassed after spacial anomalies and possibly morphing is implemented.


C)  LD1- LifeByDesign- Series 1 Software

1.0- Introduction to LD1--Playing the LifeByDesign Series 1 Games

LD1 software is the experimental test bed for building the cybereco systems using the LifeByDesign model. It is designed to run an experiment as a game, and depending on the experiment being run it has a game objective. In predator round robin games the object is to build the best predator, in 1 predator food chain experiment the object is to build a viable eco system. In multi-predator food chain system you try to put your predator on top of the food chain. Players have access to genetic variables, in .INI form to try to build their own species. Designers may have access to the genetic code( currently in c code form for Windows). To make these games more interesting players may wager points on their creation, or their fondest cyberbug and face them off.
To start,  players can run the canned demo games and get a feel what can be done. They can then use the demo game .INI files as a starting point and build a custom games. The custom game .INI file is LD.INI.

1.01- The Genetic variables and game controls

A user has control over 2 sets of variables during a game. The control variables are toggle switches controlling the game conditions and could by used at any time. The genetic variables control the inherent properties of the cyberbugs at birth and upon initialization, so those should be set prior to starting a game. 

These are the CONTROL variables:

trace=0 ==> a bug's motion is not traced, 1 means that it will be traced on screen
bact_eat=1 ==>carnivorous behavior is allowed, 0 means it is suppressed
bact_ant=1 ==>brownian motion is allowed, 0 means it is suppressed
bact_age=1 ==>ageing is allowed, 0 means it is suppressed
bact_eds=1 ==> energy dissipation is allowed, 0 means it is suppressed
bact_birth=1 ==> birthing is allowed, 1 means it is suppressed
food_chain=1 ==> food chain conditions are on, 0 means they are suppressed
boundary=1 ==> boundary is mapped from a sphere, 0 means solid rectangle
automutation=1 ==> reserved for future

The above variables are in the [control] section of the .INI file and are also available from the Menu heading "CONTROL".

A variable BACKGROUND_OFF is also provided under the CONTROL Menu heading to handle non_preemtive multitasking operating systems, i.e. Windows. It's default value is 1, which suppresses the background operation of the game. Setting it to 0 in the .INI file or checking it off at run time will allow background operation. This is provided to take advantage of preemptive systems like OS2 or Windows NT. The reason is that the great computational overhead of LD impairs the Windows system speed enough to effect applications running in the foreground when the number of bugs get well into the 100 in full blown experiments.

The genetic variables are:
Maximum cyberbug velocity: max_vel; e.g. 5  pixels per tick.
Energy capacity: max_life; e.g. 5000 units, no more enrgy is absorbed past this point.
Longevity: max_age; e.g.  200 ticks (9999 means aging is suppressed).
Initial life at birth: i_life; e.g. 500 units of energy (energy and life are equivalant).
Maximum population; max_pop; e.g. 799, the maximum declared array size, used to keep a lid on haywire designs that can crash the system, populations should stay well below this or you'll probably run out of resources.
Birthing energy: b_energy; e.g. 2000 units. The start of puberty of sorts, past this point a bug may give birth.
Hunter species: h_bact; e.g.1(1 hunts it and eats it); -1 means the bug will not respond to any hunter.
Target species: t_bact; e.g. 2(it hunt and eats 2); -1 means the bug has no target species.
Enemy bugs: e_bact; e.g. 3(it competes with 3, will chase and kill it if it has more energy than it, otherwise it runs away from it trying to stay alive); -1 means the bug doesn't recognize any competitors.
Energy dissipation: edp; e.g. +5 is absorbed (plant like) or - 5 units dissipated (carnivore-herbavore)per tick.
Dominance threshold:  min_e_h;  e.g. 1000  means a predator is too hungry to try to attack other predators below this energy value. 
Age of maturity : adult_age, e.g. 15 means a clan member will not attacked a kin under 15 ticks old
Color: color; bacteria color, 1 through 10 , see color table
Number of subspecies: subs; e.g. 2 ( can be 0 , 1 , 2 or 3.)
Initial bug population: bact_pop; e.g. 30


The next 3  parameters are in INI file for breakdown of the population among the subspecies(if subs>0):
Subspecies 1 population: sp1=10; i.e. the first 10 of the 30
Subspecies 2 population: sp2=20; i.e. the last 20 of the 30
Subspecies 3 population: sp3=0; i.e. none.

These are obviously not genetic but are used by LD1 for initialization and I had to put them somewhere.

Also in the gentic information chain (but not in the INI file) are:
Clan sign: a number or tag unique to a family tree and passed from parent to child.
Local speed and position.
A bug's age.

Note 1: Species numbering convention: 
1 = plant like bugs, they convert environmentally provided energy
2 =  herbivores
3 = carnivores

Note 2: Cyberbug color: for most vga systems 1= red, 2= grean, 3= blue as a rule they correspond to the cyberbug type, 4 through 10 are different shades of red (depending on the selected palate) and are used to color assign carnivore subspecies.

Note 3: Subspecies number. Although up to  the code can handle 3 subspecies, the current cyberbug color scheme assumes all speciation experiments will occur on top of the food chain.

Note 4: If subspecies are declared genetic variables in the subspecies heading overwrite those in the species heading.


1.1- Demo game: 3 inert cyberbugs
This is the simplest of the demo games. The cyberbugs are inert, they neither hunt or are hunted. They just run around in a closed environment with trace and brownian motion set to on. When I first ran this I expected the cyberbug color densities to average out over time. Instead I found an unstable and chaotic mosaic of color patterns, no neighborhood ever remains the same or repeat itself. I found the fact that such a chaotic image could be produced by ordered and predictable bug motions interesting and worth putting in. I also find this fact congruous to inherent and necessary instability of the Ofield.
The game .INI file is LD3INERT.INI.


1.2- Demo game: 3 carnivore round robin

3 predator cyberbug species(40 of each) go after each other in a round robin fashion: species 1 hunts 2, 2 hunts 3 and 3 hunts 1. When all the bugs are equally matched (same genetic variable settings) the game has surprises up it's sleeve. I have seen games where there where many #2, few #1's and one or 2 #3 bugs. Then the #2s ate all the #1s and left themselves wide open for attack by #3s which promptly finished them off. You can actually wager points on this game (WAGER under GAME Menu heading). The surviving species wins the game.
The .INI file is LD3PREDS.INI. 

1.3- Food chain demo: 1 carnivore, 1 herbivore and 1 plant species
The object of this game is to build a viable eco system, i.e. one that sustains itself over time. For this game we took the genetic settings for predator 1 of foodchain demo game 2 and made it better,  but the predator is almost too good in hunting.  The results on our test bed, a 486-33-vga, were:
Over a 2000 tick period the prey popuation oscillated between 30's and 100's and the predetor population oscillated between teens an 30's, a feast or famine scenario.  On a faster system (*) the famine periods sometimes did result in extinction of the prey and/or the predator.

 Here you run into an interesting situation of disastrous bifurcation points: if during one of the famine periods the herbivores can't recover fast enough the food chain collapses. Things that effect recovery include  environmental conditions like food source availability; and genetic settings like birth rate, energy dissipation, etc.
Does this mean that predators that become to good and go unchecked may doom the whole system?!? And if evolution naturally mutates the genes and inevitably a  super predator emerges, does that mean that the top of the food chain is inherently unstable and predators regularly go extinct to be replaced by new predators that evolve from further down the food chain?!?
Does it mean that natural selection picks out  predator lines that  are vicious enough that  would self regulate (very actively) through fratricide?!? 

 You may change the gentic variables in file: LD1C1H1P.INI. 


1.4- Food chain demo: 2 carnivore, 1 herbivore and 1 plant species

Here you try to build a top predator in a viable eco system. It starts off with 2 predator subspecies, and can accommodate up to 3. In the demo INI file LD3C1H1P.INI the velocity of carnivore 1 is genetically faster than carnivore 2, and as expected it wins. Test results on a i486-33-vga system are:
Over a 2000 tick time interval the prey population  rose from the initial value to oscillate between 90's and 180's. The predator1 population oscillated between 20 and 40. Predeator 2 went extinct within 100 ticks.

In a faster system the oscillations would occur in lower populations.

As a custom experiment players may want to try to alter the predetor 2 genetics (under [bact31] heading of LD3C1H1P.INI file !!save the original!!) to rescue the subspecies, and possibly make it the dominant one.


1.5- Playing A custom game

You can take any of the demo INI files and cut and paste pieces of it to the custom INI file LD.INI to design your own cyberbugs and cybereco systems. For example, go into LD3C1H1P.INI, and change one or more of the genetic parameters of the second carnivore subspecies (under [bact32]), perhaps make it faster, etc. Then save your results to LD1.INI, put it in your windows directory and run the custom game option. The object of this game is to see if your subspecies can dominate the 1st subspecies.

 If you build a strain that  you like you can  put it up against someone else's designer bug, etc. and to make it more interesting, wager points on it. I suggest sending us your custom INI to make a real game of it. The way a typical competition will work is that under common conditions two (sub)species will go against each other and the dominant wins.

The Genetic code authors can take this process much farther, there one can work on more fundemental questions than mere competition, in fact there you'll play the role of a cyber-god of sorts and what you do is only bound by your imagination.


1.6- Pausing and resuming a game

You can pause the game by pressing ALT on the keyboard or clicking the left mouse button on the game window. Clicking the left mouse button on any non-game window will also pause the game if BACKGROUND_OFF control variable is checked (or set to 1 in the INI file). Setting BACKGROUND_OFF to 0 allows background operations which works fine for preemptive multitasking systems.
You may resume the game by selecting RESUME AS IS under the GAME Menu heading. 

1.7 System responsiveness

The computational overhead of these games could be huge. In coding this game we made a decision to give this game lots of time so that things moved around fast enough to hold one's interest, specially in multispecied eco systems when numbers get large. As a result in non preemptive systems like windows if you have another task running it may feel the absence of timing. Also pausing or accessing the game menu might experience a short delay.

1.8 Viewing Ofield then cleaning and resuming a game

The Ofield is the lynch pin to this whole model, one can arguable call this the Ofield model. To view the Ofield make this selection, You may the clean and resume the game.

1.9 Wagering on a game

Select this option to wager points on your game, a winner will be declared at the end. Monetary wager are illegal in many places and in any case are advised against. We recommend that the wager be collected in pushups.

1.10 Quitting LD

Make this selection to quit the game.

