Author Topic: A condition in one gene is having effect on another?  (Read 4954 times)

Offline Peter

  • Bot God
  • *****
  • Posts: 1177
    • View Profile
A condition in one gene is having effect on another?
« 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.

Quote
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
Oh my god, who the hell cares.

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
A condition in one gene is having effect on another?
« Reply #1 on: September 07, 2008, 01:07:34 PM »
// 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 '.

Many beers....

Offline Endy

  • Bot Overlord
  • ****
  • Posts: 852
    • View Profile
A condition in one gene is having effect on another?
« Reply #2 on: September 07, 2008, 01:28:46 PM »
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.

Code: [Select]
//second part is recombining with it creator.
cond
*.robage 0 =
start
.tie inc
stop

Offline Peter

  • Bot God
  • *****
  • Posts: 1177
    • View Profile
A condition in one gene is having effect on another?
« Reply #3 on: September 07, 2008, 01:31:18 PM »
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.
Quote
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.
« Last Edit: September 07, 2008, 01:34:46 PM by Peter »
Oh my god, who the hell cares.

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
A condition in one gene is having effect on another?
« Reply #4 on: September 07, 2008, 03:19:55 PM »
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.
Many beers....

Offline Peter

  • Bot God
  • *****
  • Posts: 1177
    • View Profile
A condition in one gene is having effect on another?
« Reply #5 on: September 07, 2008, 04:19:33 PM »
Quote from: EricL
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.
Oh my god, who the hell cares.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
A condition in one gene is having effect on another?
« Reply #6 on: September 07, 2008, 05:19:41 PM »
That tutorial was quite old, probably written by PY.

Offline Peter

  • Bot God
  • *****
  • Posts: 1177
    • View Profile
A condition in one gene is having effect on another?
« Reply #7 on: September 08, 2008, 12:01:31 PM »
Quote from: Numsgil
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.
Oh my god, who the hell cares.

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
A condition in one gene is having effect on another?
« Reply #8 on: September 08, 2008, 12:09:27 PM »
Quote from: Peter
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.
Many beers....

Offline Endy

  • Bot Overlord
  • ****
  • Posts: 852
    • View Profile
A condition in one gene is having effect on another?
« Reply #9 on: September 08, 2008, 03:44:29 PM »

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.

Code: [Select]
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.
« Last Edit: September 08, 2008, 03:54:10 PM by Endy »

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
A condition in one gene is having effect on another?
« Reply #10 on: September 08, 2008, 05:37:56 PM »
Quote from: Peter
Quote from: Numsgil
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

Offline Peter

  • Bot God
  • *****
  • Posts: 1177
    • View Profile
A condition in one gene is having effect on another?
« Reply #11 on: September 09, 2008, 11:23:28 AM »
Quote from: Endy
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 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.

Quote
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.
Oh my god, who the hell cares.