Creating agent senses
With basic agent communication out of the way, we can give our agents the ability to determine visibility with other agents.
Initializing senses
Initializing our agent's senses will follow a functional paradigm that is very similar to what we've used previously. Passing our userData
table inside our initialization function will provide any custom per agent data we'll need going forward:
AgentSenses.lua
:
function AgentSenses_InitializeSenses(userData) end
Updating senses
Updating agent senses is nearly identical to initialization, except that we pass in the sandbox and a deltaTimeInMillis
time difference, so we throttle the update rate of individual senses:
AgentSenses.lua
:
function AgentSenses_UpdateSenses( sandbox, userData, deltaTimeInMillis) end