AI detection for moving dynamic objects

From Frozenbyte Wiki
Revision as of 11:05, 15 June 2018 by AnteroFB (talk | contribs) (Created page with "== Design == AI should go straight into additional investigation mode when seeing or hearing something suspicious caused by moving dynamic objects. == Visual == File:distra...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Design

AI should go straight into additional investigation mode when seeing or hearing something suspicious caused by moving dynamic objects.

Visual

File:Distractionobject.png
NotifyMask must have the distractionObject in it.

If an AI sees a moving object it will investigate it.

Detection requirements

- Entity must have AreaComponent with distractionObject bit in NotifyMask

- Entity must have dynamic PhysicsComponent

- Entity must have DistractionObjectComponent

  • Currently all dynamic objects use the same component
File:Distractioncomponent.png
The DistractionObjectComponent.

Sound

File:Generatesoundcomponent.png
MinContactForxe and MinContactVelocity properties handle most of the things.
File:Soundgenerator.png
Sound generator.

Sound is generated if the object's motion fulfills the configured parameters. The sound can be created by two types of events: Physics Contacts(collisions) and dragging(Objects moving on the ground).

Contacts be filtered by setting the MinContactForce and MinContactVelocity -properties.

Dragging can be configured by setting the minimum velocity required for the sound to be emitted, and the amount of time the object has to be dragged for the sound to be created.

Detection requirements

- Entity must have a GenerateSoundOnEventComponent and a SoundGeneratorComponent

  • For dynamic objects, there is currently one ObjectSoundGeneratorComponent which is used with all objects

- Volume must be configured in GenerateSoundOnEventComponent, and optionally the minimum velocities / force for the movement, otherwise the tiniest vibration will trigger the sounds.

  • For dynamic objects, there are currently five different GenerateSoundOnEventComponents which are used with all objects
    • VeryQuietObjectGenerateSoundOnEventComponent
    • QuietObjectGenerateSoundOnEventComponent
    • MediumObjectGenerateSoundOnEventComponent
    • LoudObjectGenerateSoundOnEventComponent
    • VeryLoudObjectGenerateSoundOnEventComponent

- Entity must have a dynamic PhysicsComponent

(- Entity should have DistractionObjectComponent for the 5sec starting delay on physics object awakening, and probably coming checks for AI's not being startled by sounds caused by themselves.)

Ignoring AI-caused object movement

The guards will currently attempt to filter out any self-caused sound or visual distractions from dynamic objects by following these rules:

- If the object gets touched by the guard, it will be ignored for a configurable time no matter what(default one seconds). All objects that are directly touching the ignored object, or touch it during the time period will receive the same ignore time. This is repeated for all the objects touching eachother until there are no more contacts for distraction objects.

- If the player touches the object or ropes an object that would be ignored by the first rule (area), following sounds will count as being caused by the player (Unless the guard touches the object afterwards).