Skill / Behavior System

When an object in the game has a Skill Component (9) attached, it has one or more skills attached to it, which it can trigger. A skill is the root of a tree of behaviors that get executed once the skill is triggered.

In the case of an attack by a player, these skills are executed on the client and the synchronized to the server. The server may then interpret what the client has done (and possibly sanity-check it) and execute any server side consequences of the attack. This includes updating the health of enemies for all players and smashing an object once it has been killed.

For enemies, the Combat AI triggers the skill and as such the server must execute it. That information is then synchronized to the clients for display.

Handling a behavior

When a skill is triggered on the client, it will send a StartSkill message. This message contains a bitstream that represents all the decisions the client has made whenever a behavior has multiple paths to continue. An example for this would be the Area of Effect / AoE (7) which will serialize the amount of objects within the area, and then the object id and remaining bitstream for all of these objects.

When a behavior is not completed immediately, it will serialize a handleID, which will then later be used to identify a SyncSkill message that serializes the continued execution. It is possible that this happens multiple times for a single skill execution.

Client -> Server: StartSkill
Server -> Client: EchoStartSkill

    Client -> Server: SyncSkill
    Server -> Client: EchoSyncSkill

Behavior Templates

Via the BehaviorTemplate table, each behavior is assigned a template. This template defines what the behavior does, what it serializes to the bit stream and which subsequent actions will be triggered. These templates are parameterized via the BehaviorParameter table.

The following is a list of (networked) behavior templates.