TBE Runtime

Readers of this documentation should already be familiar with the model of the base data.

The runtime consists of different types of classes:

  • Contexts (a.k.a. Managers)

  • Runtime Model classes

    • These classes represent (wrap) instances of the base data and define additional properties that are required at runtime(e.g. a runtime ability needs to know it’s current level whereas the model ability does not).

The TBE Runtime introduces the use of R3

1. Topics

1.1. Messaging

The MessageBus.Singleton static component is the entry point to Messaging. Messaging takes place in a pub/sub fashion. A reactive stream is used as MessageBus so clients can filter the stream and only react to certain messages.

Messages derive from GameMessage so everybody can find out which Message classes exist.

1.2. Actors

Actors are reacting to messages and are displaying corresponding visuals or playing sounds.

At runtime, every actor is associated with a unit.

1.3. Animations

Animations use the unity animation system. In this way it will be possible to also use unity’s network animation. Animations and Animation Controllers are not provided by TBE because they are project specific.

TBE only describes the way in which you can integrate your animations.

1.4. Input

We consider the mouse to have two buttons and one is the "select" button and the other is the "action" button. The select button always does the same, regardless of the current game state. It selects a unit. The action button is context-sensitive and can be one of "move-to", "use", "attack".

See also the classes InputManager and ClientPlayerContext

1.5. UI

The UI has the responsibility to observe the runtime data it wants to present.

The Unit UI is "reused", which means that it is not destroyed and recreated when the selected Unit changes. However, cast slots and item slots in the UI are destroyed and recreated when the selected Unit changes.

2. Gameplay

Every Unit belongs to a player. Every player is in a Team. A Player has a PlayerController which is one of

User, Neutral, Hostile, Computer
  • User means the Player is controlled by a User.

  • Every Player can - apart from his own units - control Neutral Units.

  • Hostile Units will attack everything but do not have their own agenda.

  • Computer has the agenda to win the game.

Of course, Neutral and hostile are also driven by the computer.