Author Topic: Demo of new .eyeNwidth sysvars  (Read 8022 times)

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Demo of new .eyeNwidth sysvars
« on: November 22, 2006, 04:16:37 PM »
Simple example illustrating the new ability to change the width of the field of view for each eye.


'If something comes into the focus eye, narrow the view like a laser beam.
'Make the width of each eye as narrow as possible and point them right next to one another for maximum resolution
cond
*.eyef 0 >
start
-34 .eye1width store
-34 .eye2width store
-34 .eye3width store
-34 .eye4width store
-34 .eye5width store
-34 .eye6width store
-34 .eye7width store
-34 .eye8width store
-34 .eye9width store
-140 4 add .eye1dir store
-105 3 add .eye2dir store
-70 2 add .eye3dir store
-35 1 add .eye4dir store
35 1 sub .eye6dir store
70 2 sub .eye7dir store
105 3 sub .eye8dir store
140 4 sub .eye9dir store
stop

'If there is nothing in focus, revert to normal vision.
cond
*.eyef 0 =
start
0 .eye1width store
0 .eye2width store
0 .eye3width store
0 .eye4width store
0 .eye5width store
0 .eye6width store
0 .eye7width store
0 .eye8width store
0 .eye9width store
0 .eye1dir store
0 .eye2dir store
0 .eye3dir store
0 .eye4dir store
0 .eye6dir store
0 .eye7dir store
0 .eye8dir store
0 .eye9dir store
stop

'Dummy gene that has an eye statement so the program knows to turn on the eyes
cond
start
*.eye5 > 0
stop
end
Many beers....

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
Demo of new .eyeNwidth sysvars
« Reply #1 on: November 22, 2006, 04:45:49 PM »
Hmm... If I understand this correctly the bot get a better sense of the size and position of the object it's looking at? If so, then it whould be better if it could spread it's vision slightly wider to see all of the object.
The internet is corrupt and controlled by criminally minded people.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Demo of new .eyeNwidth sysvars
« Reply #2 on: November 22, 2006, 05:00:57 PM »
Very nice.  Alot of possibilities open up.

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Demo of new .eyeNwidth sysvars
« Reply #3 on: November 22, 2006, 05:04:47 PM »
The gene above is mearly illustrative.  Given the sight distance and average bot width, there probably isn't much of a need to narrow the width of the eyes beyond perhaps 5 or so (-29 .eyeNwidth store) in real bots though you never know....  The concept is that by narrowing the field, you get better resolution about the exact bearing of far away objects and also can look past nearby objects to see far ones if you want.  The image below illustrates this.  I changed the gene to make each eye absolute width 5.  Note that the bot can look past the near and focus on the far one, which would otherwise show up in a bunch of eyes and maybe even in .eye5 if the eye widths weren't narrowed.  With it's vision narrowed, the refvars will be representitive of the far bot, not the near one.


cond
*.eyef 0 >
start
-29 .eye1width store
-29 .eye2width store
-29 .eye3width store
-29 .eye4width store
-29 .eye5width store
-29 .eye6width store
-29 .eye7width store
-29 .eye8width store
-29 .eye9width store
-140 20 add .eye1dir store
-105 15 add .eye2dir store
-70 10 add .eye3dir store
-35 5 add .eye4dir store
35 5 sub .eye6dir store
70 10 sub .eye7dir store
105 15 sub .eye8dir store
140 20 sub .eye9dir store
stop
Many beers....

Offline Henk

  • Bot Destroyer
  • ***
  • Posts: 110
    • View Profile
Demo of new .eyeNwidth sysvars
« Reply #4 on: November 23, 2006, 05:04:16 AM »
This is nice  It is quite drastic though, I imagine evo-bots can get pretty messed up with mutations involving these sysvars, and I've already witnessed what waste can do to a bot if a random value is stored in any of these sysvars.

I imagine this isn't very backwards compatible(ie bots that don't know about this can get messed up pretty bad), or am I wrong?

(not that I'm against these features, I luv em  )
cond
*.DBbugs 0 =
start
.rejoice inc
stop

Offline Zinc Avenger

  • Bot Builder
  • **
  • Posts: 56
    • View Profile
Demo of new .eyeNwidth sysvars
« Reply #5 on: November 23, 2006, 07:55:21 AM »
Apart from needing to explicitly have a reference to an eye to turn on eyes, I can't see it breaking existing bots. These are just additional features that if not used, which default to the original standards. I could be wrong here of course

And of course, older bots are all of a sudden going to become very, very vulnerable to having their eyes messed with. Can even something fearsome like the top tie feeder beat a bunch of T. Preservans which has been modified to shoot, say, -4 into .eyef?  

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Demo of new .eyeNwidth sysvars
« Reply #6 on: November 23, 2006, 12:27:17 PM »
ZA is absolutely correct.  It is totally and completely 100% backward compatable.  None of the new eye features mess up exsiting bots.  Values of 0 in the new sysvars do exactly what everyone has been used to for a very very long time.  I worked hard to make sure this was the case even though it complicates things some (e.g. when you use .eyeNdir or .eyeNwidth, the values are offsets from the defaults, not the actual direction or width).

The point about having an eye statement for the eyes to work is a performance thing in the code that has been there since before I came on the scene.  The code doesn't populate the eyes if the bot does not have an eyeN sysvar in it's DNA.  This works fine for most hand coded bots, but not for evolved bots since they can evolve indirect addressing of the .eyeN locations.

Thus, it's not in the code yet, but I will likely disable this little perf thing in 2.43 so that the .eyeN sysvars get populated even for bots that have no .eyeN sysvars.  Hate to take the perf hit, but it's probably not large - most bots in most sims except plants use their eyes.  We will get it back and more when I implement stupid built-in plants.
Many beers....

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Demo of new .eyeNwidth sysvars
« Reply #7 on: November 23, 2006, 12:46:01 PM »
Quote from: Zinc Avenger
And of course, older bots are all of a sudden going to become very, very vulnerable to having their eyes messed with. Can even something fearsome like the top tie feeder beat a bunch of T. Preservans which has been modified to shoot, say, -4 into .eyef?  
The marco point is well taken but in the name of nit picking clarity, I think you mean shoot -4 into .focuseye, not .eyef.  

Presumedly, the top feeder does not (yet) use any of the new eye features and thus never bothers to check the value of .eyef, which for bots that never change their focus eye, will always be the same as the vaule of .eye5.  Shooting a -4 into .eyef will therefor not have any effect on bots that never read from that sysvar.

Sooting -4 into .focuseye on the otherhad can really screw up a bot since presumedly it has no DNA to change .focuseye back, it's refvars will from then on represent what is in .eye1, not .eye5.

Again however, the marco point is very well taken.  There are many sysvars which if mucked with by another bot or by waste build up can really screw up a bot.  And now there are 20 (well, 19) more.
Many beers....

Offline Zinc Avenger

  • Bot Builder
  • **
  • Posts: 56
    • View Profile
Demo of new .eyeNwidth sysvars
« Reply #8 on: November 24, 2006, 07:19:13 AM »
Yup that's what I meant. And I wonder why none of my hand-written bots never work!

Oh, and when it comes to evolution having a hard time with all these new sysvars... I've learned never to discount the possibility of evolution doing the most insanely complicated and unlikely things with a bunch of bitwise operators, timers, and seemingly-irrelevant numbers.
« Last Edit: November 24, 2006, 08:34:34 AM by Zinc Avenger »

Offline Light

  • Bot Destroyer
  • ***
  • Posts: 245
    • View Profile
Demo of new .eyeNwidth sysvars
« Reply #9 on: December 03, 2006, 12:40:19 PM »
using

1221 .eye5width store

and then

cond
*.eye5 0 >
start
  *.refxpos *.refypos angle .setaim store
stop

gives a bot that will turn towards whatever is nearest to him, negates the need for other eyes  

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Demo of new .eyeNwidth sysvars
« Reply #10 on: December 03, 2006, 12:46:06 PM »
Cool.

FYI, that only works for small fields.  I.e. for bots in postions less than (32000,32000).
Many beers....

Offline Light

  • Bot Destroyer
  • ***
  • Posts: 245
    • View Profile
Demo of new .eyeNwidth sysvars
« Reply #11 on: December 03, 2006, 02:59:42 PM »
With 360 degree vision it means the end of spinning bots
« Last Edit: December 03, 2006, 03:00:58 PM by Light »

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Demo of new .eyeNwidth sysvars
« Reply #12 on: December 03, 2006, 03:39:54 PM »
I have this concern as well.  If you can change where your eyes point, and can change where you shoot, why do you ever need to turn at all?

Offline Jez

  • Bot Overlord
  • ****
  • Posts: 788
    • View Profile
Demo of new .eyeNwidth sysvars
« Reply #13 on: December 03, 2006, 03:49:18 PM »
You know bots never used to spin? The first one to use that method was Circumversor Algificus.  

I totally see where you are coming from though, it's not really making life any harder for the bots. Eutopia just got another fluffy pillow!  
If you try and take a cat apart to see how it works, the first thing you have in your hands is a non-working cat.
Douglas Adams

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Demo of new .eyeNwidth sysvars
« Reply #14 on: December 03, 2006, 05:22:55 PM »
Quote from: Numsgil
I have this concern as well.  If you can change where your eyes point, and can change where you shoot, why do you ever need to turn at all?
So, my $0.02 here is that the whole concept of organism asymmetry - having a head and a tail, a front and a back - isn't that important for single celled organisms but should evolve naturally when we see complex multi-bots.  It makes sense for the cells that specialize in vision in multibots to only look forward because their own cells block looking behind them.  It makes sense for the mouth or the teeth (I.e. the cells that specialize in shooting or tie feeding) to be near the front where the eyes are.   It makes sense for locomotion to go head first since that is where the eyes are.  It makes sense for the cells that specialize in expelling waste to be at the tail end to leave waste behind and keep the waste out of the mouth, etc.  A head-end and a tail-end, the need to turn to look at things, etc.  evolves naturally in multi-cellular organisms but when the organism is essntially a point source it's much less important.

I might also argue that it is more natural for a single bot to have the ability to move it's eyes than to turn.  The logic here is that presumedly, the eyes mass much much less than the bot itself and moving them only requires the bot using "muscles" that act upon itself where as turning requires the bot acting upon it's environment using some means that isn't defined and is hard to rectify with real-world phsyics.  Witness the unresolved issues we still have with angular momentum....
Many beers....