Table of Contents

Start Page » Game Development with the Drag[en]gine » Sensors

No game would be complete without the AI sensing the environment to be smart or preventing actors from walking across obstacles like they are big huge blocks. Sensors are something which many games neglect although they are important. The Drag[en]gine does not only provide sensors for simplifying and improving AI and collision detection it also improves tasks which otherwise can be expensive. For this various types of sensors are provided by the Drag[en]gine.


The lumimeter works like a illumination measurement device in the real world. It detects the intensity and optionally the color of the light hitting the lumimeter. This can be used to adjust camera parameters or triggering behaviors or game events. The lumimeter can measure light omni directional or with a cone shape. You can at any time query the intensity in candela of the lumimeter. A typical use for this sensor it to be placed near the eyes of an actor to react to light.

Touch Sensor

Touch sensors track a given slab of space for intrusion of terrain geometry or colliders. A touch sensor is located at a position in the world and owns a set of shapes. Each shape is tracked individually for objects entering and leaving. Whenever a terrain or colliders enters or leaves a shape a notification is send to the game scripts. This is an easy way to realize triggers as in contrary to physics system colliders touch sensors register also objects passing through a shape during one frame update ( for example during slight lag ). In addition the objects in contact with a shape are stored and can be queried at any time. Especially collision testing ( collider hits, collider move hits and ray hits ) can be conducted on the content of a shape. This makes the touch sensor a very efficient collision testing facility since only a small set of the world is tested. No expensive collision tests are required. Paired with notifications fast sensing of your environment can be conducted. If possible group collections of shapes into one touch sensor to improve spacial locality. This is usually the case for characters sensing their direct surrounding.