MB Construction

From WikiManual
Revision as of 02:25, 6 July 2007 by Endy (talk | contribs) (Contruction page for basic mb)
Jump to: navigation, search

Below is a slightly modified form of TierMBt2. It represents a basic form of a multibot and has several unique features that make it easier to work with. It typically forms lines but will also form triangular forms on occasion.

cond
*.robage 0 =
start
.tie inc
.numties .memloc store
stop

The .tie inc allows it to setup it's initial tie, typically tieing itself to it's parent. Next it stores the location of numties into memloc, this allows it to easily determine the number of ties other bots have. Multi works similar, but doesn't record unhardened ties.

cond start .out1 inc stop

This gene continually increases out1. Other bots can check this against refage to see if the bot's age does in fact match.

cond
*.nrg 3000 >
*.body 100 <
start
100 *.body sub .strbody store
stop

Keeps body levels around 100, only activates when the bot has enough nrg.

cond
*.nrg 3000 >
*.body 100 >
start
50 .repro store
stop

Ahh, reproduction the beginnings of life.

cond
*.myeye *.refeye =
*.in1 *.refage =
*.numties 2 <
*.memval 2 <
start
.tie inc
stop

Any time the bot and the bot it's looking at have less than two ties, a new tie is formed. This helps with bots seperated from the main multibot either by natural tie stretching, accidental tie removal, or it's partner dieing.

cond
*.myeye *.refeye !=
*.in1 *.refage !=
*.eye5 45 >
*.multi 1 =
start
-1 .shoot store
stop

Feeding gene, currently bot only feeds when it ties have hardened.

cond
*.myeye *.refeye =
*.in1 *.refage =
*.eye5 0 >
start
314 rnd *.aim add .setaim store store
stop
cond
*.eye5 0 =
start
314 rnd *.aim add .setaim store
stop

Random search genes using setaim. This is one of the most useful commands since it allows individual bots to look around themselves. Using aimdx or aimsx will turn the entire multibot, making co-ordinated motion difficult without specifically designating a single "head" for the entire multibot.

cond
*.myeye *.refeye !=
*.in1 *.refage !=
*.eye5 0 >
start
*.refxpos *.refypos angle .setaim store
stop

Hunting gene allows bot to exactly focus on it's prey.

cond
*.eye5 0 >
*.myeye *.refeye !=
*.in1 *.refage !=
start
*.maxvel *.vel sub 2 div .up store
stop

Acceleration controls, bot accelerates whenever it sees prey.

cond
*.numties 2 >
start
.deltie inc
stop

This causes the bot to delete ties when it has more than two. This helps to keep the structure of the mb from getting out of control.

end