IA on AI

Parasites and Tri-life

I was Stumbling through AI sites on the web when I ran across this little creation called “Parasites” by Michael Battle. It’s an app of a very simple “a-life” mechanism. It’s almost reminiscent of John Conway’s “Game of Life” in that it is a collection of very simple rules that then turns into seemingly complex looking behavior. (In fact, see below for another entry from the same site that is based on Conway’s life.)

The parasites follow the following rules:

  • Continue forward until you discover another parasite of a different colour and of equal or lesser size
  • Once a suitable target parasite is found, follow it.
  • If you manage to get close enough, take a bite out of it
  • When eating others, grow in size.
  • If size gets too big, dissolve into two child parasites of the same colour
  • If someone is eating you, shrink in size.
  • If size gets too small, die
  • The bigger you are, the faster you can move

(I recommend looking at it a few times before continuing with reading this. Remember to click on the app to reset it otherwise you will end up with parasites that are all the same.)

While I like looking at it and it is mezmerizing for a while, there are some things I would love to see added to it. Most of them come from Craig Reynolds’ work with steering behaviors.

For example, I would like to not see the parasites overlap but rather avoid each other. Also, while the parasites will turn toward and follow potential food, there doesn’t seem to be a mechanism in place to have smaller parasites run away from predators at all. Lastly, it would be nice to see some group behaviors – perhaps a certain color of parasites could tend to be in a group using flocking algorithms.

I like what Michael has done but it would be nice to see more out of this very basic simulation.


On a slightly different note, Battle has done another project that IS very much like Conway’s Life. This one, called “Tri-life” is a little less satisfactory. In it, he uses the RGB color components of the neighboring triangles in a sort of “Rock-Paper-Scisors” battle . The winner gets to propogate its color to the loser. The full rules are:

To get your head around the Combat phase, you’ll first need to know the overarching rule that Red conquers Green, Green conquers Blue and Blue conquers Red.

… Red > Green > Blue > Red …

The pseudocode for the process looks like this:

  • Figure out if I’m predominantly Red, Green or Blue by looking at my hex components.
  • Find the average colour of my three adjacent Triangles and find their predominant colour.
  • If we both have the same predominant colour, set my colour to the average between me and them.
  • If I win the fight, set my most dominant colour component to max (255) and my least dominant colour component to zero.
  • If I lose the fight, set my least dominant colour component to max and my most dominant to max

I like the attempt to add more than just “alive or dead” to the possibility space and almost incorporating a sort of genetic component. I do find it fascinating to watch the relatively stabilized blobs of color with all the fighting going on at the edges. It really reminds me of a sort of influence map.

All in all, good work and fun stuff to watch!

Tags: , , , , , , , , ,

Leave a Reply