Just ran sleepy again with your method:
That eyestrength thing is indeed eating up a lot. Numsgil, here is the code for eyestrength, any idea how to make it faster? It is supposed to trow a Boolean and revert to 1.
0.25s Private Function eyestrength(n1 As Integer) As Single 'Botsareus 2/3/2013 eye strength mod
Const EyeEffectiveness As Byte = 3 'Botsareus 3/26/2013 For eye strength formula
If SimOpts.Pondmode And rob(n1).pos.y > 1 Then 'Botsareus 3/26/2013 Bug fix if robot Y pos is almost zero
eyestrength = (EyeEffectiveness / (rob(n1).pos.y / 2000) ^ SimOpts.Gradient) ^ (6828 / SimOpts.FieldHeight) 'Botsareus 3/26/2013 Robots only effected by density, not light intensity
Else
0.02s eyestrength = 1
End If
0.02s If Not SimOpts.Daytime Then eyestrength = eyestrength * 0.8
0.03s If eyestrength > 1 Then eyestrength = 1
End Function
This is called from all over the place in the buckets module such as:
'Returns the distance an eye of absolute width w can see.
'Eye sight distance S varies as a function of eye width according to: S = 1 - ln(w)/4
'where w is the absolute eyewidth as a multiple of the standard Pi/18 eyewidths
Public Function EyeSightDistance(w As Integer, n1 As Integer) As Single 'Botsareus 2/3/2013 modified to except robot id
If w = 35 Then
EyeSightDistance = 1440 * eyestrength(n1)
Else
EyeSightDistance = 1440 * (1 - (Log(w / 35) / 4)) * eyestrength(n1)
End If
End Function
Good find btw.