Overview

Units described here are deprecated. Most of their features can be achieved easily (and with more flexibility) by using TCastleScene directly. See our plans for detailed reasoning. The most prominent reason to keep using these units now is that CastleCreatures gives you "ready creatures AI (artificial intelligence)", but we work on exposing this feature in a better way (as TCastleBehavior descendant class).

Units described in this section of the manual are optional, and independent from the rest of the engine. They implement a common logic typical to 3D games.

The units described here are in the CGE source code subdirectory src/game/, they are clearly separated from the rest of CGE code. Using these units is optional. You can implement a perfect 3D game without them (you only need to use scenes, and the viewport already gives you flexible camera and navigation features) and have full flexibility of a general 3D engine. Using these units makes sense if your game concepts fit within typical concepts of the 3D first-person shooter games, described below.

The features provided are:

  • CastlePlayer unit: Single player management. Player has hit points, may collect items, may use weapons (short-range, immediate shooting, missile shooting), may be swimming, may have footsteps sound depending on the terrain.

  • CastleCreatures unit: Creatures with various AI (artificial intelligence). AI ranges from smart walk-attack-flee, to a trivial "missile" (fly along a direction, explode on hit) AI.

  • CastleItems unit: Items that are pickable, may lie on the level, may be in player's inventory, have icons.

  • CastleLevels unit: Levels allow to load a 3D scene with placeholders to define creatures and items, to define water volume, to define move limit for player etc.

  • And utilities for the above units: CastleResources, CastleGameNotifications, CastleDebugTransform.