Game Development Reference
In-Depth Information
the editor view to make configuring them easier. The following figure is based on the
visualization of a sense in a RAIN AI:
Note
The early versions of RAIN included additional senses, such as smell, with the
idea that more senses meant more realism. However, adding more senses was
confusing for users and was used only in rare cases, so they were cut from the
current versions. If you need a sense such as smell for something like the ant
hearing, such as using a visual for smell and have it on a layer not visible to play-
ers in game.
While setting up characters to sense game objects in their environment, you might
think that the AI system would automatically analyze everything in the scene (game
objects and geometry) to determine what is sensed. This will work for small levels
but as we've seen before, we run into the problem of scaling if we have a very large
scene with many objects. Larger scenes will mostly have background items that our
AI doesn't care about, and we will need a more complex system to analyze all the
objects to be efficient. Typically, AI systems work using a simplified version of the
level, for example, how pathfinding uses navigation meshes to find a path instead of
using the geometry from the level directly because it is much more efficient. Simil-
arly, our senses don't work on everything; for an object to be sensed, it needs to be
tagged.
In RAIN, the AI characters we create have an
AIRig
object, but for items we want
to detect in the scene, we add a RAIN
Entity
component to them. The
RAIN
menu
in Unity has a
Create Entity
option that is used to add an
Entity
component. The