Data Base Model
This describes the TBE Data Model. By populating the database with data typed by the model, the user implements his game. This is called data driven design. The user interface to editing this data can be located in Unity under "TBE→Data: ". There are three data editors:
-
TBE→Data: Editor
-
TBE→Data: Actors
-
TBE→Data: Core
You can have more than one Database in a Project and you can move the default database from its default location to one that suits you better. See Database Location
The Data Editors let you edit instances of the main object types and there are tooltips on many properties, so this documentation will not cover all the properties of the data model.
All Main Object Types in the data model indirectly inherit from ScriptableObject
:
Below (extending) LocalizedNamed
and Named
are the concrete Model classes.
See Model Overview for an overview of how model classes relate to each other.
Main Model Classes
Unit (localized)
At Runtime, Units (and also Items) are GameObjects in the World.
Units have Life, Shield and Energy. Using Shield and Energy is optional, but Life is used to determine the death of a Unit.
Ability (localized)
Units have Abilities. Abilities affect the Game World via Effects. Subtypes are:
-
Instant
-
Instant Abilities can instantly start casting, because they do not require a target. However, they still have a cast time, after which their effect(s) get executed.
-
-
Inventory
-
a Unit with an Inventory Ability can receive Items.
-
-
Target
-
extends instant ability. Has a max range and other properties needed for targeting.
-
-
etc…
Behavior (localized)
Behaviors are applied to Units. A Behavior applies Modifications to the Unit. Subtypes are:
-
Attribute
-
An Attribute is a Behavior innate to the Unit and will not be removed from it.
-
An Attribute has a level
-
if a runtime unit has an attribute at level 2, then this is comparable to having a Buff at 2 stacks.
-
-
Buff
-
A Buff is a Behavior with a duration.
-
A Buff can trigger Effects while the duration of the Buff is running.
-
A Buff at multiple stacks will not cause it’s Effects to be triggered multiple times.
-
Effect (non localized)
When an effect occurs, we always know it’s caster (casting Unit). The target on an effect is optional and when it is not given, then the target is the caster.
Subtypes of Effect are:
-
Modify Unit
-
Create Unit
-
Damage
-
Heal
-
Apply Behavior
-
Remove Behavior
Validator (non localized)
Validators are used to validate if an Effect can be executed, or an ability can be cast.
Item (localized)
An Item can exist on its own, but it can only appear in the game world (e.g. dropped, picked up), if it references a Unit. If it does not, it can still be used in cases where it is e.g. traded, crafted, etc.
When an item should be droppable (able to exist) in the world, then a corresponding unit must be created to represent it.
Weapon (localized)
If an Item should be considered a weapon, that Item must reference a weapon. At Runtime, the Item must be equipped (must be in an item slot that is flagged as equipped) to be considered usable by the unit. If a unit has a usable weapon, it can autoattack and Weapons are only used in autoattacks. If a unit has multiple usable weapons, it will use the weapon with the lowest range that can reach its target. In that way, it will use a melee weapon if the target is in melee range.
Supporting Object Types
Core Data Object Types:
see Core Data