AI detection for moving dynamic objects
AI should go straight into additional investigation mode when seeing or hearing something suspicious caused by moving dynamic objects.
If an AI sees a moving object it will investigate it.
- 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
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.
- 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
- 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).