Author Topic: Varying sight distance as a function of eye width  (Read 7824 times)

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Varying sight distance as a function of eye width
« on: December 26, 2007, 03:48:30 PM »
In playing around with building a bot that can catch Shrinking Violets, its apparent that having the sight distance the same for all species makes sneaking up and "surprising" a species rather difficult, particularily when everyone is using omnieye vision.

I'm still planning on adding .camo at some point, but what do people think about the idea of making an eye's sight distance a function of it's width?  The wider the eye, the shorter the distance it can see.  If we assume the sight distance for the default PI/18 eye width is 1, then I might scale this such that the sight distance S for a specific eye width W as a function of W

S = 1 - log(W)/2 where W is the eyewidth as a mutplie of standard Pi/18 eye widths.

Thus, when the .eyewidth is 0 and thus the eye has the standard width, W=1 and thus S=1.

For a 360 degree omnieye, W=36.  S ~ 0.22.

For an eye half the normal width, W = 0.5, S~1.15.

For the narrowest eye possible, W=1/35, S~2.54.

So, omnieye bots can only see about 1/4th as far as bots with the standard eye wdith.  Bots using a long distance eagle eye can potentially see 2.5 times as far as standard bots, but with an incredibly narrow field.

This change might actually improve performance, particularly over sims with omnieye bots.

What think?
Many beers....

Offline shvarz

  • Bot God
  • *****
  • Posts: 1341
    • View Profile
Varying sight distance as a function of eye width
« Reply #1 on: December 26, 2007, 03:53:32 PM »
sounds reasonable
"Never underestimate the power of stupid things in big numbers" - Serious Sam

Offline MacadamiaNuts

  • Bot Destroyer
  • ***
  • Posts: 273
    • View Profile
Varying sight distance as a function of eye width
« Reply #2 on: December 26, 2007, 10:09:58 PM »
Totally ok.

Predator animals have a narrower field of view pointed ahead because (I think) they get better resolution for details, therefore being able to notice smaller/farther/immobile things.
Sometimes you win, and sometimes you lose...

Offline shvarz

  • Bot God
  • *****
  • Posts: 1341
    • View Profile
Varying sight distance as a function of eye width
« Reply #3 on: December 26, 2007, 11:31:20 PM »
"Field of view pointed ahead" is necessary for depth perception. If you need to catch something in front of you (be it a prey or just a branch on a tree), then you need very accurate measurement of how far it is.

I like the idea of balancing depth and broadness, mostly for its simplicity. But I think that accuracy of measurement and the concept of "focus" should be somewhere there as well. Maybe in the future.
« Last Edit: December 26, 2007, 11:31:46 PM by shvarz »
"Never underestimate the power of stupid things in big numbers" - Serious Sam

Offline Endy

  • Bot Overlord
  • ****
  • Posts: 852
    • View Profile
Varying sight distance as a function of eye width
« Reply #4 on: December 27, 2007, 04:22:29 AM »
Sounds good, might even have more of a predator/prey dynamic from it.

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Varying sight distance as a function of eye width
« Reply #5 on: January 11, 2008, 09:25:05 PM »
FYI, this has been implemented in 2.43z.
Many beers....

Offline fulizer

  • Bot Destroyer
  • ***
  • Posts: 198
    • View Profile
Varying sight distance as a function of eye width
« Reply #6 on: January 15, 2008, 06:13:36 AM »
to optimise eyey width to eye distance each eye will need to be 36 degrees
"If this is coffee bring me tea, If this is tea, bring me coffee"

Offline Peter

  • Bot God
  • *****
  • Posts: 1177
    • View Profile
Varying sight distance as a function of eye width
« Reply #7 on: January 15, 2008, 12:28:27 PM »
Quote from: fulizer
to optimise eyey width to eye distance each eye will need to be 36 degrees
I don't understand you, for what, why.

Please explain.
Oh my god, who the hell cares.

Offline fulizer

  • Bot Destroyer
  • ***
  • Posts: 198
    • View Profile
Varying sight distance as a function of eye width
« Reply #8 on: January 16, 2008, 08:55:33 AM »
if you want to be able to see 360 egrees around and need to see as far as you can you need to divide the 10 eyes into equal areas
360 (the number of degrees in a circle) divided by 10 (the number of eyes in a bot ) = 36.
thus making 36 degress (not bot mesurments) the best way to see as far as possible while seeing all around you
"If this is coffee bring me tea, If this is tea, bring me coffee"

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Varying sight distance as a function of eye width
« Reply #9 on: January 16, 2008, 11:19:00 AM »
And your 360 degree eye bot will be easily picked off by my 359 degree eye bot that can see you before you can see it.

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Varying sight distance as a function of eye width
« Reply #10 on: January 16, 2008, 11:37:05 AM »
Quote from: fulizer
if you want to be able to see 360 egrees around and need to see as far as you can you need to divide the 10 eyes into equal areas
360 (the number of degrees in a circle) divided by 10 (the number of eyes in a bot ) = 36.
thus making 36 degress (not bot mesurments) the best way to see as far as possible while seeing all around you
Please...

First, to state the obvious, bots have 9 eyes, not 10.

The area an eye of width W (0 <= W <=36) is given by:

A = (1 - log(W)/2)^2 * PI) * (W/36)

If someone wants to find the eye width that mazimizes coverred area for a specific eye, one needs to maximize the value of A over the range 0 <= W <=36.
Many beers....

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Varying sight distance as a function of eye width
« Reply #11 on: March 14, 2008, 11:43:13 AM »
I need to point out that in the corse of implimenting this, it became apparent that VB6 does not include a log operator (base 10).  It only includes a natural ln operator (base e).   I'm lazy, so the actual formula as implimented in the code is:

S = 1 - ln(W)/4 where W is the eyewidth as a mutplie of standard Pi/18 eye widths.

See the first post in this topic for context.

I would appreciate any feedback on whether the eyesight sensitivity represented by this formula meets with people's approval and expectations.
Many beers....

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Varying sight distance as a function of eye width
« Reply #12 on: March 14, 2008, 01:00:58 PM »
You can implement log10 by doing ln(x) / ln(10)

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Varying sight distance as a function of eye width
« Reply #13 on: March 14, 2008, 04:01:07 PM »
Quote from: Numsgil
You can implement log10 by doing ln(x) / ln(10)
I'm sorry, what part of "I'm lazy" did you not understand?  

That's bascially what I did.  ln(10) ~= 2.3.  I  rounded down.
« Last Edit: March 14, 2008, 04:03:46 PM by EricL »
Many beers....

Offline rsucoop

  • Bot Destroyer
  • ***
  • Posts: 166
    • View Profile
Varying sight distance as a function of eye width
« Reply #14 on: March 14, 2008, 07:43:30 PM »
Quote from: EricL
Quote from: Numsgil
You can implement log10 by doing ln(x) / ln(10)
I'm sorry, what part of "I'm lazy" did you not understand?  

That's bascially what I did.  ln(10) ~= 2.3.  I  rounded down.

It may not be best for rounding down. Decimals arent really supported anyways, so it doesn't seem even necesary to use algebraiclly derived forumlas for a geometric process. Just use geometry. The function of log returns the exponent; where 10^x = 3 | x has to equal the proper exponent to equal that. So don't use log for this problem. Whil it is a great idea to have a logorythmic eye form, it may be best to go with the more natural modded, as is the human eyesight. Modular functions of the eye length would mean that the result could be returned to compare the idea that we have here, bot length. The eyelength is already dependant on the radius of the Bot, is it not? If I am not mistaken this was already used for how eyes return values, with 100 being equal to a bots radius twice. It seems this was a very great conecpt, the eyes were on the outside and no matter what, the eye returned some value equal to its radius. Without this, development of eyesight may be difficulkt genetically, and could hinder the creation of mutatant genuius creation of pure chance. This also means a small anoying miny bot would not be able to see as far as a bot twice its size with equal widths. I do see where you're coming from with the log form, it is a focal equation; but I think for easy implementation in genetic coding, it should be a modular form. Since we know the radius of the bot as a var, the eyewidth and length will automatically be limited by this, or at least should be. When I'm not so tired I'll present the formulas of these ideas; esentially, true vision could be achieved with such a modular function, as the log is basically a more complex form to the idea, I like where you're coming from, but unless eyes and focal magnification (or length magnification as you have changed it to do so), esentially, a bot could have 0 eyesight and still work.