DarkAI

ZONES

Zones define areas of visibility that can be assigned to one or more entities. When a valid target enters a zone all entities assigned to the zone are notified of the event and can act as if the target entered their line of sight. Entities will make their way to the event in order to check it out, and whilst the target remains in the zone their position will be known to assigned entities. Entities rate the threat of zone targets as lower than normal targets so an entity will prefer to seek out targets it recently lost before moving to zone targets.

Zones can be assigned to friendly or enemy entities or both at the same time, and can replace their field of view. If an entity's view range is set to 0 they will only be able to see targets that enter any assigned zones, and as such any target that leaves the zone will be lost by such an entity. Alternatively entities with a valid view range can be set to follow targets out of the zone for as long as they can see them using an aggressive stance.

Zones can be restricted to a specific container so that only entities from that container, which enter the zone, will trigger an event. Zones can be assigned to entities from any container regardless of which container the zone is in, this allows an unusual case in which, for example, entities in container 1 can be assigned a zone from container 0 and be able to see entities from container 0 that enter the zone.

This could be used to simulate a balcony scenario where the balcony is container 1 and the ground floor is container 0, the zone can be created to cover the area of the ground floor visible from the balcony and assigned to all entities on the balcony. By creating a half height obstacle around the edge of the balcony entities will be prevented from leaving the balcony whilst still being able to see over it. Entities that enter the ground floor zone will then be spotted by the entities on the balcony and shoot at them. There are some restrictions to this method, any entity on the ground floor that ducks will be hidden by the half height balcony obstacle and not be shot at, obstacles on the ground floor container will not obstruct the line of sight of entities on the balcony zones provide a region of complete visibility (you could use multiple overlapping zones to restrict visibility only to areas you want), entities on the balcony but not near the edge will still act as if they can see directly to the ground floor, any balcony entity that is assigned the zone will be notified of entities entering the zone no matter where they are (you may want to assign entities to the zone only when they are on the balcony). The ground floor entities will not be able to see the balcony entities, but you could apply the same method by creating a zone on the balcony in container 1 and assigning it to all the entities on the ground in container 0 to achieve the same effect.