Author Topic: Eyes in DB!?  (Read 8848 times)

Offline Greven

  • Bot Destroyer
  • ***
  • Posts: 345
    • View Profile
Eyes in DB!?
« on: June 22, 2005, 07:28:39 AM »
This is both a question and a suggestion.

I havent checked this and therefore my question is:
I know that if a bot do use any eye commands, the function is entirely skipped, but what if there is only one, say eye8? Do the program calculate every single eye? I dont know have the eye distance etc. is calculated, but if eye9 aint dependent on anyother eye, there is no meaning in calculating eye1, if only eye9 is represented in the genome. or what? Please reply! Because if the program does this, calculates eye1, when only eye9 is used, this could speed the program!
10010011000001110111110100111011001101100100000110110111000011101011110010110000
011000011000001100010110010111101001110100110010111100101000001000001111001011101
001101001110011011010011100011110100111000011101100100000100110011010011100110110
010110000011100111101001110110111101011101100110000111101001101001110111111011101
01100100000111010011010001100001110111010000010001001000010100001

Offline Ulciscor

  • Bot Destroyer
  • ***
  • Posts: 401
    • View Profile
Eyes in DB!?
« Reply #1 on: June 22, 2005, 07:46:48 AM »
Just wondering if this idea would be messed up by a virus inserting a gene which uses another .eye location? Like a bot using only .eye5 gets an insertion with a reference to .eye8 but this wouldn't work because the program only calculates .eye5.
Unless every cycle the program checks how many eye references there are, and calculates the appropriate values, but wouldn't that take a lot of time?
:D Ulciscor :D

I used to be indecisive, but now I'm not so sure.

Offline Carlo

  • Bot Destroyer
  • ***
  • Posts: 122
    • View Profile
Eyes in DB!?
« Reply #2 on: June 22, 2005, 08:15:07 AM »
It works like that: the dna isn't explored at all; instead, each bot has a flag which is called eyeused (or something like that), which is false at birth. When a value is read from any one of the eye locations, that flag is set to true. When the flag is true, the sight routines are calculated. So, each robot sees only from the second time it tries to see in its life; on the other hand, the procedure will still work with viruses or everything else. There's no point in calculating only single eyes, since all eyes are calculated together with a single search on near robots.
« Last Edit: June 22, 2005, 08:15:34 AM by Carlo »

Offline Ulciscor

  • Bot Destroyer
  • ***
  • Posts: 401
    • View Profile
Eyes in DB!?
« Reply #3 on: June 22, 2005, 08:19:47 AM »
So does that mean that the first time an eye location is read it won't get a value? Or is it read, the flag set the routine called and then the value passed back?
:D Ulciscor :D

I used to be indecisive, but now I'm not so sure.

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
Eyes in DB!?
« Reply #4 on: June 22, 2005, 09:00:46 AM »
That is right. When robot age is zero they are completely blind. By age 1 they can recognize everything around them.
There are 10 kinds of people in the world
Those who understand binary.
and those who don't

:D PY :D

Offline Ulciscor

  • Bot Destroyer
  • ***
  • Posts: 401
    • View Profile
Eyes in DB!?
« Reply #5 on: June 22, 2005, 10:17:16 AM »
Just out of interest what value is returned the first time it reads an .eye address? 0?
:D Ulciscor :D

I used to be indecisive, but now I'm not so sure.

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
Eyes in DB!?
« Reply #6 on: June 22, 2005, 10:30:26 AM »
The first time it reads it (at age 1) it is pretty much always facing its parent so the number in eye5 is quite high. In versions prior to 2.35 this was extremely predictable and read exactly 77 every time.
In the newer versions the eyes have been somewhat overhauled so I am not sure what is returned now. Try running a sim frame by frame till a robot gives birth then switch to the baby and check its eyes at age 0 and 1. I haven't done this with the new version yet.
In the upcoming 2.4 it is going to be almost impossible to predict since the robot sizes will vary much more dramatically.
« Last Edit: June 22, 2005, 10:31:32 AM by PurpleYouko »
There are 10 kinds of people in the world
Those who understand binary.
and those who don't

:D PY :D

Offline Greven

  • Bot Destroyer
  • ***
  • Posts: 345
    • View Profile
Eyes in DB!?
« Reply #7 on: June 22, 2005, 10:43:22 AM »
I have tested what PY suggested serveral times, and I got 150 and/or 155 at age 0, with the simplebot2. Then it rotates and then nothing in eye5.
10010011000001110111110100111011001101100100000110110111000011101011110010110000
011000011000001100010110010111101001110100110010111100101000001000001111001011101
001101001110011011010011100011110100111000011101100100000100110011010011100110110
010110000011100111101001110110111101011101100110000111101001101001110111111011101
01100100000111010011010001100001110111010000010001001000010100001

Offline Ulciscor

  • Bot Destroyer
  • ***
  • Posts: 401
    • View Profile
Eyes in DB!?
« Reply #8 on: June 22, 2005, 10:47:40 AM »
I think I meant what value is returned when the bot tries to get the value when the address hasn't been "activated" yet. Like when it tries to access an .eye address for the first time, a flag is set, but is a value still returned?
:D Ulciscor :D

I used to be indecisive, but now I'm not so sure.

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
Eyes in DB!?
« Reply #9 on: June 22, 2005, 11:04:44 AM »
At age zero it will (or should) return zero since the eyes array has yet to be populated.
There are 10 kinds of people in the world
Those who understand binary.
and those who don't

:D PY :D

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Eyes in DB!?
« Reply #10 on: June 22, 2005, 11:16:07 AM »
There are actually alot of shortcuts you can use since you know the eyes together form a 90 degree angle.  But I have thought about limiting eye recognition to 9 if only 5 is used.

Currently (in my version I'm working on right now), bumping into another bot seems to activate the eyes.  I have absolutely no idea why.

Offline Ulciscor

  • Bot Destroyer
  • ***
  • Posts: 401
    • View Profile
Eyes in DB!?
« Reply #11 on: June 22, 2005, 11:46:55 AM »
What's the activating condition for an eye anyway?
:D Ulciscor :D

I used to be indecisive, but now I'm not so sure.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Eyes in DB!?
« Reply #12 on: June 22, 2005, 11:56:57 AM »
I think if any of the *.eyeXs are attempted to be put on the stsack, the eyes activate.

Offline Ulciscor

  • Bot Destroyer
  • ***
  • Posts: 401
    • View Profile
Eyes in DB!?
« Reply #13 on: June 22, 2005, 12:03:57 PM »
So either a collision is putting an .eyeX on the stack or there is some hole that is activating the eyes directly? That may require some detective work...
 :blink:
:D Ulciscor :D

I used to be indecisive, but now I'm not so sure.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Eyes in DB!?
« Reply #14 on: June 22, 2005, 12:26:18 PM »
Yep, such a pain.