Activities

What is an Activity?

Fishing, combat, and singing are all examples of activities.  What do these have in common? Some activities generate Actions.  Combat, for example, will generate many actions (strikes, blocks, dodges...).  That's why it is connected to the Clock - just like a Soul.  Singing would probably not generate any actions.  It is merely started and, eventually, stopped.  People entering within hearing range would hear the singing.

In White Orb only one activity can be performed at a time by a single person.  So you can't sing while fighting.  This is to simplify things - it may be changed later.

Activities vs Souls

Each Physical can only be involved in one activity (or none).  If a new activity is started, the current one will stop.  When involved in an activity, the activity will be like a temporary soul that sits between the Physical and it's normal Soul(s) - if it has any.  The creature's real Souls are still active and allowed to produce actions - but the Activity has higher priority and may cancel actions requested by the soul.

Here is the normal relation between a soul and it's body (when no activities are in progress):

Here's what happens when an Activity is started:

So the activity may cancel or modify any actions requested by the soul.  Take a combat situation for example.  "Talk" actions would probably not be affected by the Activity (they would be let through, unmodified), while "Move" actions might be cancelled completely (if the combat handler activity wants full control over movements).  Spellcasting might be made more difficult in a combat situation, etc.

How are activities started?

Yep.  The act of starting an Activity is in itself an Action.  Stopping an activity is also an action.  They will probably be  implemented as StartActivityEvent and StopActivityEvent. Here's an example of the control flow.

Let's say Joe has found a nice lake and wants to start fishing.  And let's say I'm controlling Joe via a player client (so I'm his Soul).  Here's what happens:

Action filtering

Action filtering can be used in quite useful ways.  If the soul requests an action that contradicts the current activity the activity has three choices.
  1. Cancel the action.
  2. Modify the action
  3. Stop the activity and execute the action
This will vary from case to case.  Fishing is quite harmless, so if the Soul wants to do something like walk away from the lake the activity will probably just stop automatically (no point bothering the player with messages like "you can't walk east because you are fishing").  In combat, on the other hand, the activity itself will probably be more dominant.  Like you can't just walk off - you have to manage to disengage first.  Or suffer heavy penalties...

Class hierarchy

Another difference between Activity and Soul is that activity is not a subclass of Physical.  This is because an activity can control more than one participant - it doesn't fit nicely into the container hierarchy like a Soul does.  Here's how Activity fits into the core hierarchy:

Active is an interface for objects that queue actions want to be notified when they have been completed (or cancelled).


Henrik Kniberg

Last updated: