Eyesight

Eyesight is critical to survival in the real world. Not so much in Evagents (yet!), but agents still have a feature called eyesight that enables them to interact and potentially react to environmental changes.


For now, eyesight only takes into account 2 things: other agents, and local time of day (3 things if you count the MOONLIGHT setting).


Agents have 6 eyes, each with 3 inputs: red, green, and blue. A single eye structure has 2 traits: Direction and FOV.

The direction is in range [0,2pi], where the values 0 AND 2pi both orient the eye towards the agent's front (the front being the direction of the spike and positive wheel movement).

The FOV is in range [0,pi] and denotes a field of view centered on the Direction trait within which other objects are still seen by the eye.


Math is applied to the other agent's RGB values, and proportionalities are applied for the following: Distance, centered-ness to the FOV, and Light value of the seeing agent's cell.* This means that as other agents get to the edge of the FOV, and during Night, if Moonlight is not enabled, then the agent will have a hard time seeing the other agent.

When an agent is seen, all three channels (R,G,B) are checked; if the agent is brighter than what has already been seen, then it takes on its value (Please note, in previous versions of Evagents this was a raw aggregate sum of ALL SEEN agents within FOV). This in theory allows for the potential of Camouflage, but note that currently the agent's environment does not contribute (Soon I will have a fully functional OPTIONAL cell-seeing function that can be toggled in the Config, but for now the code only exists in comment form)


*This is intentionally wrong, as one of the purposes of the day-night cycle was to reduce processing requirements of all agents' eyes and forcing ray-tracing for light is not at all aligned with that goal.