Polarith AI
1.8
Environment

front-end: AIMEnvironment

The environment is part of the perception pipeline. Here, the objects which should be perceived are assigned, can be grouped and labeled properly. Hence, environment components can be used to organize your scene for the AI. In addition, they can increase the performance dramatically when multiple agents should perceive the same things. For example, there can be an environment for interest objects and one for danger objects. Every object in the environment list is used to receive the data for one resulting percept which is processed by a behaviour later on. Thus, it is also advised to mark non-dynamic environments as Static to save performance for environments which never change.

Note that you definitely should set up proper labels for environments due to the fact that environments are only accessible by their labels to serve behaviours as percept input source.

Properties

This component has got the following specific properties.

Property Description
Label Used to identify this environment. When a Steering Perceiver is assigned to a Steering Filter, the label is shown within the filter's inspector. Then, they can be accessed in the attached behaviours.
Static If enabled, it is assumed that neither the GameObjects are changing nor the values of the referenced objects. This way the data is cached only once, which can save you a lot of performance.
Layers All objects which are in the layers specified here are automatically belonging to the environment. Therefore, the objects need to be active at runtime start.
GameObjectsA list of references to game objects which should be perceived by agents. For each object a percept is created and cached continuously.

Remarks

Instead of specifying single objects within game object lists, you can specify whole layers for the environment to obtain objects from. This mechanism can only be used for objects which are active at runtime start and it is especially useful for prefabs. When you assign a layer to a prefab, all objects you create in the scene based on this prefab are automatically in the prefab's layer, too. That way, in the editor, you do not need to specify new objects in environments if the appropriate layer has already been set. This can boost up your workflow a lot.

If you have a lot of static, non-interactive objects in your scene, e.g. rocks, trees or walls, it is highly recommended to group these objects into environments which are marked as Static.

Imprint