Entity¶
An entity in Bug Fables is an object that could be seen as the building blocks of the game. It features common logic used throughout the game and allows to have complex runtime behaviors. In other words, it's what allows the game to have any kind of interactions whether it's movement, enemy encounters or loading zones to name a few. It is made of 2 components, one of them being optional:
- EntityControl: This defines what an entity can do and defines the most common aspects of all entities. It can be viewed as a component that gives utilities and modifiers for an object to have.
- NPCControl: This leverages the utilities and modifiers defined in EntityControl to implement more complex behaviors and logic for map entities specifically. Any other entities created manually outside of exceptional cases (such as a shop system) do not use an NPCControl. The component is stored in the
npcdata
field of EntityControl.
Differences between an entity and a map entity¶
Due to these components having a clear delimitation, it gives a new definition to a map entity for this game. A map entity is an entity that was predefined in a map and therefore, it will be created with an NPCControl. In other words, map entities are entities, but not all entities are map entities. It also means NPCControl is a missnomer: it doesn't just handles NPC, it handles all the logic of all map entities which may or may not be NPCs.
A map entity has to be created using CreateEntities of MapControl through using the data provided by the map entity data while an entity can be created manually through the standard entity creation process. Additionally, an Item map entity can be created using CreatItem. While it is possible to make any entities an NPC by assigning the npcdata
field to a new NPCControl, this isn't supported outside of very exceptional cases (such as a shop system) and isn't encouraged in practice.