home subscribe to email updates subscribe to RSS updates

Experiment: Parasites

Today I had this idea for a visualisation and since work wasn’t too urgent I decided to run with it.

Michael Battle - Flash Experiment

Though the idea is pretty simple, I still think the result is quite fun to watch.

To start, the stage is filled with 20 “parasites” of random colour and direction. The rules they understand are as follows:

  • 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

Eventually you’ll see that one colour/species will win and dominate the stage. At this time click anywhere on the stage to reset and start again.

I think it’s interesting that in order for one species to conquer the screen, it must first become more vulnerable (i.e. when the large parasites split into two smaller ones). At a stretch, one could suggest that this mimics nature.

It’s a bit CPU intensive (the gradient doesn’t help things but I couldn’t resist!)… sorry if your machine struggles. If you’ve bothered to read this you should click the experiment now to reset it. Enjoy.


« Roy Block
AddThis Social Bookmark Button

Related Posts:

Comments:

Sam said,

April 12, 2007 @ 8:19 am

Very cool. Truly mesmerising!

Jono said,

April 12, 2007 @ 10:37 am

Very cooool! Yellow rule the world!!! Maybe two of different colours but same sizes can ‘mate’ (with appropriate lighting and music) and create a hybrid bug of the blended colours? … Or turn canabalistic and take on a pack mentality when there is no food around…

Kappa said,

April 12, 2007 @ 3:40 pm

Nice work mate, convert it to a screensaver and make available for download.

Gary said,

April 13, 2007 @ 1:44 am

If u let it go long enough, they all end up the same colour =D awesome work… you need them to be “afraid” of bigger ones”

btw mine all ended up as pink =D

Ben said,

April 13, 2007 @ 10:25 am

very nice….

Matt C said,

April 13, 2007 @ 7:11 pm

Nice concept. Kinda like Fl0w mark 2 really (http://en.wikipedia.org/wiki/FlOw).

In the end though you just end up with all one color and medium sized paras.

I do like the new ‘Game of life’ feel it has.

Jamie H said,

May 31, 2007 @ 10:35 am

Very cool. If you can turn it into a screensaver it will be perfect. Once you have email to me please.

Cholfo said,

October 16, 2007 @ 11:52 pm

Ohh, that’s pretty neat. Any chance you’ll share the source? Gives me an idea for a potentially fun little Java app.

kometbomb said,

October 17, 2007 @ 2:28 am

Very nice. Maybe you should add mutation of the offspring’s color and/or a mechanism that made the blobs die of starvation. I think this would also stop all but one color going extinct because if there are too few “enemies” around, there also is no food to eat. Maybe the color should vary smoothly. It would be interesting to watch new species born, i.e. their color finally became too different from the dominating color.

Darragh O'Brien said,

October 17, 2007 @ 4:41 am

Very nice, you say the dominant has to make itself vulnerable to win but what would happen if you introduced a colour that didn’t split at all?If it just gained in size?

Roger said,

October 17, 2007 @ 5:50 am

Great!

My two bits: If you move so far without eating, shrink in size.

marcusklaas said,

October 17, 2007 @ 6:44 am

AWESOME IDEA HOLY CRAP THATS COOL

Anon said,

October 17, 2007 @ 7:05 am

One request: Make is to that if a parasite does not feed in a certain amount of time (say 10, 20 seconds) it dies. That would make this just gold.

Adam said,

October 17, 2007 @ 9:47 am

that was pretty cool to watch! love it!

Thomas said,

October 17, 2007 @ 8:46 pm

This is very cool, any chance you will create a screensaver out of it?
Oh one thing..the same color keeps winning :(

Wishamster said,

October 18, 2007 @ 2:58 am

Hehe, very nice.

Mine ended up green :)

Bull3t said,

October 18, 2007 @ 5:07 am

Very clever. That would help people who are beginning to make games in Flash. Well done.

Paul said,

October 18, 2007 @ 8:56 am

Very nice.

As a Flash programmer I can appreciate the amount of thought that went into this.

Raffaele said,

October 18, 2007 @ 2:07 pm

After a few seconds they became all the same color.
I suggest a new rule. If a parassite doesn’t eat for a while it changes to another random color…

Oscar said,

October 18, 2007 @ 2:30 pm

This is pretty damn cool. it reminds me a bit of the Game of Life. It would be interesting to see it if each color had a type of “resistance” or “ability” and see how it would change it. like if red is more resistant to being eaten, yellow could be a bit faster, blue could grow bigger etc…
(after I wrote my comment, I scrolled back up and green had completely dominated).

Bob said,

October 18, 2007 @ 6:21 pm

Excellent simulation ~ really fascinating. Just a little suggestion - introduce death! If a creature does not get enough food per cycle it loses size and eventually dies.

Ruben said,

October 19, 2007 @ 12:29 am

I really enjoyed the experiment, however I feel like I have to point out that what you’re showing is not what I would consider to be parasitic behaviour…

BraveSpear said,

October 19, 2007 @ 4:55 am

You should introduce a flight mode into the game; ie: a smaller one gets chased by a bigger one, it tries to evade getting eaten.

The Bozz said,

October 19, 2007 @ 7:21 am

We need a screensaver out of this.

Daniel Zee said,

October 19, 2007 @ 8:53 am

Really nice, not too slow. I agree, make it a screen saver. And maybe some user interaction to help the parasites that are not dominating, give us that God-like feeling. Let us introduce some “disease” or interference to restart the life-world. Fascinating to watch nonetheless.

Michael said,

October 19, 2007 @ 9:10 am

Hey everyone - thanks for the comments and ideas!

As soon as work calms down a bit I’ll remake this in ActionScript 3 with an assortment of new ideas and options… So we’ll get a speed boost and a fullscreen option.

… and yes, then I’ll look into making it into a screensaver :)

Stay tuned.

gregor said,

October 19, 2007 @ 10:05 am

Very good work! I´ve been reading articles in the last time about evolution etc. I think it´s a “tautology”.

Friday things at Rage on Omnipotent said,

October 20, 2007 @ 1:02 am

[…] Parasites simulation […]

Pete said,

October 21, 2007 @ 2:20 pm

You could make it so that you bet on which colour wins.. not to promote gambling or anything ..

Jeff said,

October 22, 2007 @ 9:28 am

I watched 3 different times, pretty neat experiment.

Jamie Lawrence said,

October 24, 2007 @ 7:59 am

Based on the rules you’ve given I’d say that it’s inevitable that one colour will eventually dominate but which colour is random. Basically, if one colour starts with slightly more parasites, then they have an immediate advantage over the rest of the colours. However, this might not mean that they dominate (due to the random positioning/movement etc — their offspring might be eaten very quickly and the advantage is lost) but eventually one colour will dominate to a certain degree (a “tipping point”) beyond which it is highly unlikely any other colour can take over.

Sorry, long comment, hope it makes sense.

Tammy said,

October 25, 2007 @ 11:15 am

Very cool/amusing. The first time I watched, it took a pretty long time for a “victor” to become present. The second time, it was a lot faster. I agree that it would make a great screen saver.

Jeff said,

October 27, 2007 @ 4:10 am

This is really cool.

john raguso said,

October 28, 2007 @ 1:23 am

Very cool. It’s fun trying to predict which color will eventually dominate; this would be good to play with another person, each one betting on a color.

Brian said,

October 28, 2007 @ 7:40 pm

It’d be interesting to watch graphs of the various “score” (basically just a sum of the mass) of the different teams. It seems like on occasion things boomerang back from one color being in the lead to another color taking control. And yeah, it’s like the game of life, but purdy :) Good show.

magvs said,

October 31, 2007 @ 1:18 am

One rule you you neglect to mention is that parasites of the same color will not attack each other. This means that from the start one color is pre-determined to win based on its initial variables.

Other than that it’s fun to watch. I’m not sure if changing that rule would change the outcome or just delay it. I know this was just something you threw together in your spare time; regardlessly, I think this is good work and you should continue exploring it.

Michael said,

October 31, 2007 @ 1:25 am

Hi Magvs - just a quick FYI, the first rule as stated above:

“Continue forward until you discover another parasite of a different colour and of equal or lesser size”

peterchen said,

October 31, 2007 @ 6:54 am

Wouldn’t it make more sense the other way rund - the bigger you are the slower you move?

Link Leopard | Brian Risk’s Blog said,

November 3, 2007 @ 12:05 am

[…] A fun animated life simulation […]

Juan said,

November 3, 2007 @ 7:58 pm

Great! it’s very nice and fun to watch.

And how about adding some rule of starvation, something like if one doesn’t eat in some time decrease size? spoeed? eventyally die? After all this is how nature works.

Interesting Flash demo « C.H.’s Blog… said,

November 3, 2007 @ 11:17 pm

[…] Interesting Flash demo Jump to Comments On Parasites.  Read the description before watching, it’ll make more sense.  Link. […]

Gstayton said,

November 4, 2007 @ 3:03 pm

wow… very neat, like stated, would make a good screensaver…
btw, black won for my first time (I didnt even know there was a black O_o) so yea… Very neat ^^

Harsha said,

November 10, 2007 @ 4:17 am

Holy Cow!!…Its a different colour everytime!!…Its not predetermined! Good Work!!

Wolfums said,

November 12, 2007 @ 5:05 am

Holy shizz.

Pink is the universal dictator or something on my computer.
Anyways,

Great simulation, made me giggle.
Keep up the good work.
c:

Forrest said,

November 13, 2007 @ 4:49 am

Evolutionary visualizations are great! Thanks for putting in the time to make this one, it’s fascinating.

Jonny said,

November 15, 2007 @ 4:53 am

Time to get started on a C# version for my new screen saver!

woo!

Fantastic idea, well implemented, great job!

Jeff said,

November 26, 2007 @ 9:42 pm

Great implementation, only one suggestion. What about adding a faint pie chart in the background so you can watch the different species gain or lose control?

Well done.

Matthew said,

December 8, 2007 @ 9:32 am

It seems to me that the larger a parasite becomes then that parasite should have a slower rate of speed. Also, how about a size beyond which a parasite cannot grow due to unmaintainability. A parasite that is too large should be able to “decay” a bit until maybe a larger parasite comes along. But this would probably be too massive for the CPU. This is awesome. I think I will try to implement this too even though I am a beginner.

Dave Mark said,

December 11, 2007 @ 2:24 pm

It would be interesting to throw some other AI algorithms in here. Flocking for one… Have some of the parasites be grouping ones that generally stick together. Also, have some that are specifically lunging style - i.e. they can move quickly in short bursts.

See Craig Reynolds work for ideas on implementation.

WWN said,

November 23, 2008 @ 5:52 pm

Wow really love that, it’s very cool. Shouldn’t they also starve if there is no food source.

CookieOfFortune said,

December 10, 2009 @ 8:32 am

You should try adding a starvation time as well. With proper starting conditions, you should be able to get sinusoidal stability with each population.

Slava said,

December 10, 2009 @ 8:21 pm

Inspiring.

I always liked such games but I’m too stupid to program it. So I still play WoW, you know…

Gotta make my own sample where they mutate in color, and die of age or if they don’t eat for some time.

RSS feed for comments on this post · TrackBack URI

Leave a Comment



« Roy Block