Author Topic: Don't understand the DNA  (Read 4115 times)

Offline Blowfishy

  • Bot Neophyte
  • *
  • Posts: 1
    • View Profile
Don't understand the DNA
« on: November 19, 2007, 03:46:08 PM »
Hi,

I'm new to DB and I'm trying to understand Animalis Minimalis' DNA so that I can create a simple bot myself. The problem is, I don't understand anything of it. Can someone help me with the DNA explanation, I think the wiki explains it a bit vague.

I understand the meaning of genes. But I dont understand this:

' Gene 1 Food Finder
cond
 *.eye5 0 >
 *.refeye *.myeye !=
start
 *.refveldx .dx store
 *.refvelup 30 add .up store
stop

What does *.eye5 0 > mean, and what does the .refeye and refveldx and refvelup mean??? That's the part I dont understand..

Any help is appreciated,

Blowfishy
« Last Edit: November 19, 2007, 03:54:15 PM by Blowfishy »

Offline shvarz

  • Bot God
  • *****
  • Posts: 1341
    • View Profile
Don't understand the DNA
« Reply #1 on: November 19, 2007, 05:00:10 PM »
Welcome to the board!
I'm not DB code guru, but I can tell you what *.eye5 0 > means - it merely asks whether eye 5 sees anything at all.  

All variable that start with "ref" allow the bot to gather information on another bot - the one that sits in front of it. So that if there is a bot in front of your bot, then  *.refeye tells you how many eye commands that bot has in its genome. Bots can use it to identify their own species (they would have exactly the same number of eye commands).  

Hope this helps.  Are you sure you found the right tutorial? The one I read in my time was very helpful and explained all these things.
"Never underestimate the power of stupid things in big numbers" - Serious Sam

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Don't understand the DNA
« Reply #2 on: November 19, 2007, 09:01:39 PM »
Hi Blowfishy.  Welcome.

The DNA uses RPN - Reverse Polish Notation.  Might want to look this up if your not familiar with this kind of thing.   So

*.eye5 0 >

is really just a way of saying

*.eye5 > 0

Or in words:

"Is the value of the .eye5 memory location greater than zero?"  The result will be True if it is, False if it is not.

The line:

*.refeye *.myeye !=

works the same way.  It's saying "Is the value of the .refeye memory location not equal to the value of the .myeye memory location?"

The two results get ANDed together and the gene fires if they are both True.

The simulator fills in the values of .eye5, refeye and myeye.  .eye5 will be a non zero number if the bot can see something in front of it's center eye.   The value will represnet how close it is.  Refeye will represent the number of eye statements the bot being looked at has in it's DNA.   It will be 0 if there is nothing in view.  .myeye will be the number of eye statements in this bot's DNA.   It's a poor man's way of testign whether the thing the bot is looking at has the same DNA it has.

Cheers.
Many beers....

Offline Gobo

  • Bot Builder
  • **
  • Posts: 67
    • View Profile
Don't understand the DNA
« Reply #3 on: November 19, 2007, 11:23:12 PM »
You might also want to check this out.

Offline Peter

  • Bot God
  • *****
  • Posts: 1177
    • View Profile
Don't understand the DNA
« Reply #4 on: November 20, 2007, 11:58:44 AM »
You could look at these tutorialsbot-tutorials, some of the tutorials are explaining 'Animalis Minimalis' dna.

Well, it looks hard now, it is going to be easier I've been trough that fase. My topic full of questions is 3 pages long, try to beat that.  

The explainationof the gene, step by step.

Quote
cond
start gene

Quote
*.eye5 0 >
Like Eric explained, if eye5 is higher then 0(if it sees something) there will be a true returned.

Quote
*.refeye *.myeye !=
Looks at the number of eye statemens of the other bot and compares then with his own, much used as a conspec-recocnition.
ref =other
my=myself

Quote
start
If all the values between cond and start are true this will be executed.

Quote
*.refveldx .dx store
Looks at the turning of the other bot and put the other way of turning into his own.(to follow the other bot)
ref=other
.dx=self

Quote
*.refvelup 30 add .up store
Same as refveldx exept refelup is the other one speed instead of direction. And here is 30 being added to his own up to get a higher speed then the one before him. So coming closer.

Quote
stop
You may figure this one out.

Hope this helps.
Oh my god, who the hell cares.

Offline fulizer

  • Bot Destroyer
  • ***
  • Posts: 198
    • View Profile
Don't understand the DNA
« Reply #5 on: December 04, 2007, 08:55:08 AM »
it is smarter to edit existing genes than to make your own. unless you need to
"If this is coffee bring me tea, If this is tea, bring me coffee"

Offline Peter

  • Bot God
  • *****
  • Posts: 1177
    • View Profile
Don't understand the DNA
« Reply #6 on: December 05, 2007, 11:11:40 AM »
Quote from: fulizer
it is smarter to edit existing genes than to make your own. unless you need to
Even if you want to do that, a smart move is to know how they work, else you could edit and look if it performs better, but a trial and error method is taking more time then actual learning the dna.
Oh my god, who the hell cares.

Offline fulizer

  • Bot Destroyer
  • ***
  • Posts: 198
    • View Profile
Don't understand the DNA
« Reply #7 on: December 07, 2007, 08:40:27 AM »
Quote from: Peter
Quote from: fulizer
it is smarter to edit existing genes than to make your own. unless you need to
Even if you want to do that, a smart move is to know how they work, else you could edit and look if it performs better, but a trial and error method is taking more time then actual learning the dna.
true
lol quote in a quote
"If this is coffee bring me tea, If this is tea, bring me coffee"