Darwinbots Forum
Bots and Simulations => DNA - General => Topic started by: Peter on September 07, 2008, 10:00:37 AM
-
This is somewhat of a startup for a multibot. All the bot is supposed to do. Is just making a multibot with two bots in opposing directions.
Now it just reproduces and does nothing, if you remove that one line there is a bot directed in two directions.
Can someone explain me how this works.
If you don't understand it, load a sim with and without the line.
cond
*.refeye *.myeye =
*.eye5 0 > // <remove this line and see
start
stop
//multi control center
cond
*.multi 1 =
start
50 .sharenrg store
150 .fixlen store
100 .stifftie store
628 .fixang store
stop
//if alone create a second part
cond
*.numties 0 =
*.robage 0 !=
start
50 .repro store
stop
//second part is recombining with it creator.
cond
*.robage 0 =
*.refeye *.myeye =
start
1 .tie store
stop
//if enough energie split.
cond
*.nrg 30000 >
start
.deltie dec
stop
-
// is not really supposed to be used as a comment indicator. As it is, it only works on whole comment lines, not inline. That it works at all is an unintended side effect of another feature I.e. saving hashes into saved bot files.
The code ignores lines that begin with /? (where ? is any character except #) but it does not ignore them if they are inline. Look at the DNA of one of your bots in the properties dialog and you will see the code attempting to parse the comment.
The only official comment delimiter is '.
-
Need to rewrite the birth tie gene, refeye isn't updated on robage zero so the values aren't equal. The inline comment isn't really a good idea. It can be done but it might mess up the stack some.
//second part is recombining with it creator.
cond
*.robage 0 =
start
.tie inc
stop
-
I can't say I noticed anything. Anyhow with or without the //, the code acts the same. If you remove the '*.eye5 0 >' the bot acts different. How does that come.
cond
*.refeye *.myeye =
'if you remove the line
*.eye5 0 >
' in between of here, the bots acts different
start
stop
'multi control center
cond
*.multi 1 = or
start
50 .sharenrg store
150 .fixlen store
100 .stifftie store
628 .fixang store
stop
'if alone create a second part
cond
*.numties 0 =
*.robage 0 !=
start
50 .repro store
stop
'second part is recombining with it creator.
cond
*.robage 0 =
*.refeye *.myeye =
start
1 .tie store
stop
'if enough energie split.
cond
*.nrg 30000 >
start
.deltie dec
stop
Endy thanks for the advise for that condition(tends to do it), but is there a reason why the bot acts different if you add a condition into another gene.
-
By removing that line, you are changing the value of *.myeye from 1 to 0. As Endy said, since *.refeye is not updated on the first cycle of life, it will always be 0 when *.robage is 0. Thus, removing that line in the first gene has a direct impact on whether gene 4 fires or not and thus on whether the bot creates a tie to replace the birth tie or not and thus on whether the bot becomes a multibot or not.
-
By removing that line, you are changing the value of *.myeye from 1 to 0. As Endy said, since *.refeye is not updated on the first cycle of life, it will always be 0 when *.robage is 0. Thus, removing that line in the first gene has a direct impact on whether gene 4 fires or not and thus on whether the bot creates a tie to replace the birth tie or not and thus on whether the bot becomes a multibot or not.
Sorry, was overlooking that one.
Oh, by the way,
The old mulibot tutorial at the wiki didn't really work well. I removed it and I just putted in this one together with the first three genes of animal minimalis. It tends to work remarkably well together, good enought for a tutorial anyway.
It is pretty annoying to have a tutorial whereby the final bot doesn't run as supposed.
-
That tutorial was quite old, probably written by PY.
-
That tutorial was quite old, probably written by PY.
Nope, it was made by endy. I can remember it use to work. Some way all multibots just tend to be very breakable becouse of version changes.
-
Some way all multibots just tend to be very breakable becouse of version changes.
I would be interested in understanding what specifically broke. It is my goal to minimize or eliminate unintentional version-to-version compatibility differences.
-
Does look weird if you don't know about the robage zero eye thing. Had me going there for a second, below is the rewritten code. The first gene is fine, the fourth gene was rewritten.
cond
*.refeye *.myeye =
*.eye5 0 >
start
stop
'multi control center
cond
*.multi 1 = or
start
50 .sharenrg store
150 .fixlen store
100 .stifftie store
628 .fixang store
stop
'if alone create a second part
cond
*.numties 0 =
*.robage 0 !=
start
50 .repro store
stop
'second part is recombining with it creator.
cond
*.robage 0 =
'removed line below, invalid at birth unless bot has zero eyes
'*.refeye *.myeye =
start
'made tie inc to save energy
.tie inc
stop
'if enough energie split.
cond
*.nrg 30000 >
start
.deltie dec
stop
The MB tutorial I believe I wrote, I honestly only vaguely remember it now... PY's tutorial written for a single bot is on the wiki too and is still pretty useful to look at. Both are pretty old. If I can ever figure out the new eye stuff I might write a new one.
-
That tutorial was quite old, probably written by PY.
Nope, it was made by endy. I can remember it use to work. Some way all multibots just tend to be very breakable becouse of version changes.
Ah, different tutorial then
-
Does look weird if you don't know about the robage zero eye thing. Had me going there for a second, below is the rewritten code. The first gene is fine, the fourth gene was rewritten.
Does it look that weird. Well, the first time I came here I asked what kind of purpose the stars have.
My questians are getting better and better.
On a side note there was also a mistake in my fifth gene, dec instead of inc.
Here (http://www.darwinbots.com/Forum/index.php?showtopic=2872&view=getnewpost) you see the bot that I putted inside the tutorial.
I stealed 3 genes of animal minimalis. And now you see a spinning multibot looking for food.
The MB tutorial I believe I wrote, I honestly only vaguely remember it now... PY's tutorial written for a single bot is on the wiki too and is still pretty useful to look at. Both are pretty old. If I can ever figure out the new eye stuff I might write a new one.
A tutorial about the eye-stuff, that could be something I believe there are multiple changes with the eye-stuff. Most bots I write still use the standard eye-setup .Maybe my bots could get an advantage with other eyes.