-
Notifications
You must be signed in to change notification settings - Fork 11
ALife: Understanding Conversations
Conversations are the verbal and non-verbal communications between ALife in Reactor 3, and is yet another crucial gameplay mechanic for the player. Below, each function related to the system will be described in full.
All major communication (verbal or non) uses alife.communicate(life, gist, **kvargs)
. Calling this function is relatively simple:
life
: As with all other ALife/Life-related functions, this argument should be the ALife doing the talking.
gist
: The idea being communicated.
**kvargs
: Used to pass whatever information that may prove helpful when the conversation is parsed.
A good example of this in action is the following:
communicate(life, 'demand_drop_item', item=_item_to_drop, target=_target['who']['life'])
Broken down, life
demands that the target
drop item
.
Once the communicate call is made, all ALife in a certain range receive the emitted conversation. Most of the time it is discarded, but if they are being specifically targeted then most of the time some kind of action is carried out.
alife.listen()
does the parsing for incoming conversations. In the above example the targeted ALife would drop the item, but it is of course possible to respond by not doing so. The idea is to eventually have most of the ALife weighing the risks of obeying or disobeying certain orders or demands. This is seen in a few areas, like responses to comply
(the ALife may choose to run off or attack instead.)
To avoid redundant calls, alife.consider
, alife.has_considered
, and alife.unconsider
were created for ALife to track each-other. They are simply used to track facts about other ALife and can be used like so:
if consider(life, event['from'], 'surrendered'):
consider
returns True if the passed argument (surrendered
in this case) does NOT exist in the array. In the case that True is returned the argument is added to the array, so the call will return False the next time. It is essentially a way to make sure an actual or reaction is only performed once.