Documentation/Articles/Introduction to Game Object System
From NeoAxis Engine Wiki
| Language: | Status: | Approved |
Contents |
Description
Game Object System is a software environment used for creating project’s game logic.
By means of Game Object System world’s game logic is created. Game Object System determines what elements the world consists of and how it runs (in other words, all aspects of project’s game logic)
The Game Object System is a way to determine all game logic objects as well as the way they interact.
Anything in the game world is a game object whether it is a robot, a crate or a landscape.
Game Object Class
The basic characteristic of any game object is its game class. The class determines object’s attributes and logic, i.e. object’s behavior. Game object classes are created by programmers.
Same class can be the basis for different game objects. For example, a number of game characters from the "Data\Types\Units" folder (Bug, Girl, Robot, Zombie) belong to the GameCharacter class. These characters share same logic but have different parameter values (appearance, speed, weapon).
Classes can be used for creating objects of various types. For example, the StaticMesh class enables creation of object’s three-dimensional model and adjustment of object collisions. The GameCharacter class sets character specific logic. Game objects of this class can move across the map and use weapons. The SkyBox class is used for creating the sky.
Programmers can create their own classes based on standard NeoAxis Engine classes.
You can view the list of standard game classes and their description here.
Class Hierarchy
Game object classes can be derived from other classes forming a class tree. All the game classes in NeoAxis Engine are derived from the Entity class.
Let us examine the class hierarchy. For example, the Aircraft class is derived from the Unit class used for creating user-controlled units, while the Unit class is derived from the Dynamic class used for creating dynamic objects (i.e. those changing their position or state). The Dynamic class is derived from the MapObject class used for working with map objects. Finally, the MapObject class is derived from the Entity class.
In fact, a class is a list of parameters (e.g. character’s maximal health points). Parameters are determined by game object type (see below).
Game object type
Any object has a game type. A game object type is always based on a particular game class, specifying object’s properties provided by the given class.
E.g object properties are appearance (usually a 3d-model), movement speed, color of the sky etc.
To make the things simpler, let us examine this system in detail. For example, in some game there are characters and vehicles. "Characters" and "Vehicles" – are the two classes with different properties and logic. Robots and zombies are the types based on the "Character" class. Trucks and autos are the types based on the "Vehicle" class. Finally, all robots, zombies, trucks and autos on the map are game objects of the corresponding game types.
Game object types are stored in .type files. You can create and edit game object types in Game Object Editor.

