Current code:

#side MicroAlgae
#author Tyson Hoffman
#date Begun on 3-2-06

#color A0FFA0

#seed 1

#type MicroAlgae

#hardware
processor 5
solar-cells .15
armor 40
energy 2 0
constructor .15
force-field .06 .1
repair-rate .1
#code
#var life;
#var dir;
        max-armor life!

Main:
        1 constructor-type!
        constructor-max-rate constructor-rate!

        armor life < if
                armor life!
                0 constructor-rate!
                position 2 1 send
                random-angle dir!
                position dir set-force-field
                max-repair-rate repair-rate!
                sync sync sync sync sync sync sync sync sync sync sync sync
                0 force-field-power!
                1 clear-messages
        else
                armor life!
                max-armor armor = if 0 repair-rate! then
        then

        1 messages 0 > if
                1 receive drop 2dup position v- angle pi + dir!
                position dist 20 > Main& ifg
                0 constructor-rate!
                position dir set-force-field
                sync sync sync sync sync sync sync sync sync sync
                0 force-field-power!
                1 clear-messages
        then

        Main& jump

#end

The idea behind this side is two parts. One, algaes are very simple sides to write, and a good starting point. The Grobots "Hello World." if you will.

I looked at a couple algaes(algi?) and noticed they don't do anything. I thought An algae could survive better if it responded to its environment. This is true of anything. At the same time, I didn't want to add much complexity, and try to keep other unnecessary hardware to a minimum. The algae has one goal, make more! The reason for Micro is that I think small cells hold certain advantages, namely you get more of your guys out doing stuff, the harder you will be to kill.

Getting away from danger is quite important, therefore I wanted the side to respond when one cell gets damaged. Forcefields are useful because it helps all neighbors get moving, and can push non-fleeing algae away.

The reason I've posted this is because I noticed a few things about this side. In competition, MicroAlgae regularly outsurvived my other side Flower. This both irks and intrigues me. Flower is near 1000 lines long. This side is 55. It makes the work on Flower seem wasted, and at the same time makes me wonder how I can improve upon this idea. I'll be chronicling my improvements, changes, and techniques on these pages. I hope whomever reads this will be enlightened.

Grobots | Flower >


Page last modified July 08, 2007, at 02:32 PM