-
Notifications
You must be signed in to change notification settings - Fork 68
Glossary
This page is a collection of keyword used in Godex.
An Entity
is just a container of components, differently from an Object
it doesn't have any behaviour or meaning; it can be anything and it's behaviour is driven by the assigned components.
Example
You could represent the mushrooms power-ups in Mario with the following set of components:
-
PhysicsBody
: Used to specify thisEntity
has a RigidBody. -
Position
: Used to specify that thisEntity
has a position. -
GrowPowerup
: Used to specify the type of the power-up.
Or the character (Mario) could be done with the following set of components:
-
PhysicsBody
: Used to specify thisEntity
has a RigidBody. -
Position
: Used to specify that thisEntity
has a position. -
Character
: Used to specify this entity is the character.
The Component
is a piece of data that can be attached to an Entity
. It can describe a characteristic, a state, an event of an Entity
. Usually, taken alone, the components doesn't do much: but the combination of them allow building complex mechanisms easily and easy to maintain.
Example
Example of some components:
-
TransformComponent
: Describes the 3D world location. -
MeshComponent
: Describes the associated mesh. -
Visible
: Describes the visibility state. -
Hit
: Event that notify thisEntity
got hit.
It's a Component
but without data. It's used to mark and differentiate the Entities
:
Example
BlueTeam
RedTeam
Character
Enemy
💡 Note that the tag component is not a special component type. The keyword exists just to give more flavour.
The Databag
is a global piece of data, and it's used to store global utility information.
Example
List of some Databag
s:
-
FrameTime
: Databag where the framedelta
and thephysics_delta
is stored. -
OsDatabag
: Where it's stored some info about the OS (timestamp, platform, date). -
EngineDatabag
: Where the engine details are stored.
The World
is the container of all ECS data: Entities
, Component
s, Databag
s.
The System
is just a function that perform some operations on the World
data. It manipulates (transform) the Entities
, Component
s, Databag
s data. The System
is defined by the user, and represent a piece of game logic.
Example
List of System
s:
-
TimerSystem
: Advances the timers clock till it expire. -
MoveSystem
: Moves theEntity
locations.
The Query
is used by the System
s to fetch the Component
s from the world; it returns the Entities
that fulfills the request.
void timer_system(Query<TimerSystem> &p_query){}
void move_system(Query<Velocity, TransformComponent> &p_query){}
void heal_system(Query<Health, Heal, Maybe<ExtraHealPowerup>> &p_query){}
void damage_system(Query<Health, Damage, Without<Immunity>> &p_query){}
The Storage
is the memory class used to store the components. There are different type of storages, each with a different set of features.
Exactly like the Storage
but allow to store more entries of the same Compnent
per Entity
. For example you can have an Entity
with more Damage
component.
The Batch
is returned by the Query
to give access to the Component
s stored in batches.
The Event
is a Component
that at the end of each frame it's automatically destroyed. It's super useful to code one time messages or events.
Useful to create mechanisms like:
- The damage mechanics.
- The healing mechanics.
- The hit mechanics.
- The enter/exit mechanics.
- The button click mechanics.
Community & Support
- Open an issue
- Join the Discord Community
- Start a new discussion
- Home
- Getting Started
- Concepts
- Godot & Godex communication
- Godex Importer
- Bullet Physics Engine
- Classes
Support
Useful links