Darwinbots Forum

Bots and Simulations => DNA - General => Tips and Tricks => Topic started by: PurpleYouko on March 14, 2005, 01:11:53 PM

Title: Keep feeding while breeding
Post by: PurpleYouko on March 14, 2005, 01:11:53 PM
Ever noticed that when your little robot reaches enough energy to reproduce, he sometimes doesn't but just keeps right on feeding? The reason is that he can't make a baby when there isn't room in front.

This can sometimes be a critical mistake if you want to colonize the screen before the enemy does.

Here is how you make your robot reproduce without missing a beat.

Start by defining a nice custom variable at the start of the genome. .newmom is my favorite.
Code: [Select]
def newmom 55

cond
 *.newmom 0 >
start
 0 .newmom store
 628 .aimsx store
stop

cond
 *.nrg 6000 >
start
 1 .newmom store
 628 .aimsx store
 50 .repro store
 0 .shoot store
stop

Your robot should spin 180 degrees, pop out a baby then spin straight back and carry right on feeding.

What does the "0 .shoot store" line do?

Figure it out. It isn't that difficult!

 :D  PY  :D
Title: Keep feeding while breeding
Post by: Numsgil on March 14, 2005, 01:21:23 PM
One of my questions:

Which commands are executed in which order?  If we could have a list it'd be  good to know.  I'll look through the source and try it myself.

Knowing that turning happens before reproducing is critical for this to work.
Title: Keep feeding while breeding
Post by: PurpleYouko on March 14, 2005, 01:23:36 PM
Turning before shooting is kind of important too.

Turning is actually about the first thing that is done other than changing memory location like .newmom.

A list of the hierarchy of all the commands would be quite useful.

 :D  PY  :D