The Behaviors


A Fish's learned Behaviors are invoked iteratively during each life cycle. The Behavior Stack represents the Behaviors the Fish has learned and the order in which they will be invoked. Each Behavior has the opportunity to alter the Fish's variables such as Destination. Therefore a Behavior on the bottom of the stack, that is, one invoked early, may be overwritten by a Behavior higher on the stack, that is, one invoked later.
From the perspective of the Behaviors Screen, Behaviors are understood to be invoked downwardly in order. Therefore the bottom of the Behavior Stack is the top of the screen. The Behavior Screen exposes an "edit" button that allows the user to change the order of the Behaviors as he sees fit.

Random Destination

This Behavior checks whether the Fish has reached its Destination and if so assigns a new random Destination.

Cluster Together

This Behavior attempts to model the schooling of Fish by setting the Destination to be the location of the nearest living Fish with a greater Energy than this Fish. The net effect of this over many Fishes is something like schooling. 

Seek Plant

If the Fish's Energy is less than 1000 Cycle Energies, that is, the Fish has less than 1000 cycles to live, this Behavior sets the Fish's Destination to the location of the nearest Plant.

Eat Plant

If a Fish is within Bite Radius of a Plant, the Fish "bytes" the Plant by transferring a sum of Energy from the Plant to the Fish. The sum of Energy is normally equal to 50 times the Cycle Energy. If the Plant does not have that much Energy remaining, whatever Energy the Plant does have is transfered to the Fish and the Plant is "consumed" and disappears.  

Hyper Seek Plant

This Behavior always sets the Fish's Destination to the location of the nearest Plant.

Seek Fish

If the Fish's Energy is less than 1000 Cycle Energies, that is, the Fish has less than 1000 cycles to live, this Behavior sets the Fish's Destination to the location of the nearest Fish.

Eat Fish

If a Fish is within Bite Radius of different Fish, the Fish "bytes" the other Fish by transferring a sum of Energy from the other Fish to this Fish. The sum of Energy is normally equal to 50 times the Cycle Energy. If the other Fish does not have that much Energy remaining, whatever Energy the other Fish does have is transfered to biting Fish and the other Fish enters the dying state and floats away.

Seek Mate

If this Fish's Energy is greater than 75% of the Energy that a Fish is born (or created) with, then this Behavior sets this Fish's Destination to the location of the nearest living Fish of opposite Gender whose Energy is also greater than 75% of the born Energy.

Reproduce

If this Fish's Energy is greater than 75% of the Energy that a Fish is born (or created) with and this Fish is within Bite Radius another Fish also with Energy greater than 75% of born Energy and if the Fishes are of opposite Gender, then this Fish spawns a new Fish. Spawning is as follows: Each parent Fish yields half of the born Energy to the new Fish (so the Fish starts life with 100% born Energy). The Size and Speed of the parent Fishes are OR'ed together to created those attributes in the spawned Fish. The Type of the spawned fish is randomly selected from the parents' types. Last the Behaviors of the parents are passed on. Each behavior of the female Fish is given a 50% chance of passing on to the spawned Fish, and then each behavior of the male Fish is given a 50% chance of passing on. Therefore the spawned Fish has 75% chance of receiving a Behavior if both parents had it and only a 50% chance if only one had it. It is important to note that even if the spawned fish has all the Behaviors that its parents did, the order may have changed because some came from the female Fish and then some came from the male Fish. Behaviors are never duplicated in the spawned Fish even if both parents would have passed on the Behavior.

Don't Collide

This Behavior attempts to avoid long-term intersection of Fishes by detecting intersection and then setting new random Destination for this Fish.

 

Remember, the Behaviors Screen, allows you to select Behaviors and sort them in whatever order you want. Master the Behavior Stack and become the master of your Puddle.