Skip to content

Evidence

The Perception module comes with a unique Evidence system that allows scene agents to detect changes in objects made by other characters (like the player) and react accordingly.

What was that...?

Let's say we are making a stealth game where the player is sneaking through a series of rooms. If the player leaves a door open, guards may notice this change and react accordingly. For example, raising their awareness.

The Evidence component can be added to any game object.

Evidence

The Tag field is a string that identifies the Evidence type.

Multiple Evidences with the same Tag

You can have multiple Evidence components with the same Tag value. Discovering one of them will mark all of them as already seen. This is very useful if you want guards to only notice evidence once.

For example, if the player leaves three doors open, a guard should only raise its awareness once and notice there's someone around just once. Otherwise a guard might shout three times in a row the same line and look a bit too goofy.

The On Sight allows the Evidence to be seen by other agents.

The Emit Noise checkbox allows the Evidence to emit a noise when it is tampered, and allows other agents to notice it using the Hearing sensor.

Noise with Tag

It is worth noting that when an Evidence emits a noise, it will also make use of the Tag field as the identifier of the noises. Apart from noticing the Evidence agents can also react to the noise emitted just like any other noise, using the On Hear Trigger.

The Emit Scent allows the Evidence component to emit a scent identified by the Tag field that other agents can catch when the component is tampered.

Scent with Tag

Just like with noise, the scent emitted by the Evidence component can be used just like any other scent. The On Smell Trigger can catch its whiff identifying it by its Tag field.

Tampering

An Evidence does nothing by itself. Instead it must be Tampered in order for the Evidence to be noticeable by other agents.

Evidence at Runtime with Tampered field

Debug Evidence at Runtime

When entering Play-Mode you can select any Evidence component and a new field will appear at the bottom called Is Tampered, which indicates the current value.

In order to Tamper or Reset an already tampered evidence you can use the Tamper Evidence instruction and Restore Evidence instruction, respectively.

Evidence Tamper Instruction

Once an Evidence is tampered, it will start being noticeable by other Perception components.

Detection

The Trigger On Notice Evidence can be used to react when a tampered Evidence component is detected.

On Notice Evidence Trigger

The On Notice Evidence component detects when a specific Perception component detects a new Evidence, which can be optionally filtered by a specific Tag or not.

Relaying Knowledge

In order to make multiple Perception agents look like they work as a team, you can also relay Evidence knowledge between them. This is done using the Relay Evidence instruction, which fills in the knowledge gaps of the targeted agent.

Relay Evidence Knowledge

When a Perception has new relayed Evidence knowledge transferred, it can also react using the On Relayed Evidence Trigger.

Relayed Evidence Knowledge Trigger

Communication between Guards

Let's say we have two guards and one of them notices that a door has been opened. In that case, the first guard will receive the On Notice Evidence trigger event, upon which it will update its internal knowledge about the current state of Evidence components.

After the guard shouts something like We have company! Someone left a door open! it could use the Relay Evidence instruction in order to communicate to nearby guards that they should be alert.

Nearby guards can use the Relayed Evidence Trigger in order to know that a new Evidence component has been discovered by another guard nearby and raise their awareness level and shout something like Understood!.