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

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Varying sight distance as a function of eye width
« Reply #15 on: March 15, 2008, 12:40:37 PM »
Not sure I follow you.  I only have a minor in math...  

Things are actually a little more complicated.  Let me explain.

The equation above is only used to determine the maximum distance an eye can see given it's width.  It gives the relationship between eye width and sight distance and yes, it could be changed to a simple lookup table.   If there are no bots within this maximum distance (edge to edge) in the field of view of the specific eye, the eye value will be 0.   For the default eye width of pi/18, this sight distance is 1440, edge to edge.  So yes, larger bots can see farther and will be seen sooner relative to smaller bots with the same center location.

This max sight distance S is calculated as a function of the eye's width and then the actual value returned by the eye is determined by a different formula:

V = 1/((d+10)/S)^2  where d is the actual edge to edge distance between the two bots.

That is, an eye value is roughly the inverse square of the percentage of the maximum distance represented by the edge to edge distance between the bots.  (The + 10 is there for divide by 0 protection and to scale values in such a way to use most of the positive value range.  I choose a formula which attempts to strike a balance between giving traditional eye values (1-100) at mid to long range that legacy bots would be used to while providing much greater resolution at close range.  This is something I am soliciting empirical feedback on.

Note that overlapping bots will generate eye values of 32000 (if the bot is within the eye's field of view).  Same for when a bot is inside or overlaps a shape.  Eyes can be thought of as being located at the bot's center, so an eye's field of view includes the field of view inside the bot, but you can think of the eye value as "overloading" when a bot overlaps what it is viewing.

For shapes, d is the closest part of the shape within the eye's field of view.  This allows for very precise eyesight at close range for finding shape corners, the angle of incidence of the line of sight and so on.  But this is not currently the case for viewed bots however.  Today, the center of the viewed bot plus it's radius are used determine if the bot is in the field of view and within the sight range and the eye value is calculated using this d, not the d of the closest point of the bot in the field of view.  This can give somewhat inacurate distance values in cases where the closest part of the bot is not in the field of view (when a narrow eye is sighting along a bot's side for example) and in some cases, allows for seeing bots just beyond the sight distance which should really not be visible.   It is on my worklist to address this.
« Last Edit: March 15, 2008, 01:09:26 PM by EricL »
Many beers....

Offline rsucoop

  • Bot Destroyer
  • ***
  • Posts: 166
    • View Profile
Varying sight distance as a function of eye width
« Reply #16 on: March 19, 2008, 08:23:35 PM »
I can see the relationship as a mod function, with maybe even just a quadratic with two radicals, which could be easier to program. But unfortunately my mind is so zapped; too many things not enough time or care. When I have the time (maybe next month) I'll elaborate from where I coming from: essentially the values the eye returned would change accordingly.

Offline rsucoop

  • Bot Destroyer
  • ***
  • Posts: 166
    • View Profile
Varying sight distance as a function of eye width
« Reply #17 on: April 06, 2008, 02:13:06 PM »
Ok, so a mod is a remainder. This means any ratio has a mod. So we know no matter what their is a maximum length which will never be exceeded, this is our cieling, or higher Z-Alpha plane. There is also a width, which has a log limit, where it can never reach 0; this means that 0 is the hole, so we can redefine 0 in a mod. We know that any bot can only get a value of 2.54 in the S. So we say w mod S*D. That should give you better return function from an eye system where width and distance play a role. The inverse square law should work flawlessly, but you need floating decimal points.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Varying sight distance as a function of eye width
« Reply #18 on: April 06, 2008, 04:03:49 PM »
Okay, I'm fairly certain you're just making up terms now   What is a "Z-Alpha plane".  Is it like the "ZZ9 plural Z alpha"?    You have entirely lost me in your train of thought.

Offline rsucoop

  • Bot Destroyer
  • ***
  • Posts: 166
    • View Profile
Varying sight distance as a function of eye width
« Reply #19 on: April 06, 2008, 04:13:35 PM »
Yeah, I should have used the term lattice, but I couldn't remember from my math notes.

from wiki- If we consider the lattice  generated by a constant α and a variable z, then F(Λ) is an analytic function of z.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Varying sight distance as a function of eye width
« Reply #20 on: April 06, 2008, 04:22:09 PM »
Sorry I only did intro to abstract algebra.  We never got as far as lattices.  Or is it topology?  Either way, you're going to have to stick with algebra and calc if you want Eric and I to follow you.

Offline rsucoop

  • Bot Destroyer
  • ***
  • Posts: 166
    • View Profile
Varying sight distance as a function of eye width
« Reply #21 on: April 06, 2008, 04:36:00 PM »
Sounds fair enough to me.

If I recall, the inverse square law requires no interference. So what if we added heat vectors? This would change the speed of light and cause a bot to see further in some places.