Campaign content
Configure the content your participants engage with.
Campaign content defines the target behaviors your app promotes and how engaging in those behaviors contributes to progress.
In GameBus, your content is centered around Missions.
A Mission contains Milestones. Milestones contain Tasks. Completing a Task creates an Activity and a contribution to one or more Skills. Skill achievements can then determine progress, unlock later Milestones, and feed progress displays.
For example, a Travel habits mission could start with a Try active travel Milestone. A walking Task awards 10 points to the Active travel Skill for a qualifying walk. A gateway opens the next Milestone once the participant reaches 40 points.
Mission availability and participation
A Mission becomes available through a mission enrollment, which links the Mission to a group and a wave.
Unfamiliar concepts?
Mission availability depends on groups, memberships, and waves. See Campaign for an explanation of these concepts.
For a participant to access the mission:
- the mission must be published;
- the participant must have a
Participant-membership in one of the linked groups; and - the one of the linked waves must be active, or have no relevant time boundary.
Whether the participant actually participates is then resolved per membership from the mission enrollment type and any personal mission enrollment decision.
| Mission enrollment | No personal decision | Opted in | Opted out |
|---|---|---|---|
Required | Participates | No influence: always participates | No influence: always participates |
Opted in by default | Participates | Participates | Does not participate |
Opted out by default | Does not participate | Participates | Does not participate |
A required mission cannot be opted out of. If several memberships link the same user to the same mission, participation is evaluated separately for each membership. The app can therefore show a mixed state.
Waves do not restart progress
Waves control when a mission is available, not the lifetime of its progression records.
If a participant progresses through a mission in wave A, wave A ends, and the same mission later becomes available to that membership in wave B, the participant resumes existing progress. A new wave does not restart the mission or create a new completion.
Skills and group statistics
A skill is a container to display a participant's progress in a mission, or across several missions.
Skill achievements are membership-specific. A user who participates in several groups therefore has a separate member skill achievement in each group.
Based on individual membership achievements on a skill, a group skill achievement is calculated. A group skill achievement summarizes all eligible participant memberships in that group for a skill. It stores:
| Statistic | Meaning |
|---|---|
| Sum | Sum of all member contributions. |
| Minimum | Lowest contribution, including zero-score memberships. |
| Maximum | Highest contribution, including zero-score memberships. |
| Average | Arithmetic mean across the complete eligible population. |
| Median | PostgreSQL discrete percentile at 0.5. |
| Count of contributors | Number of memberships with a stored contribution greater than 0. |
The aggregate population consists of memberships that: (a) have the Participant role, and (b) belong to an active user.
Mission enrollment, wave availability, and personal opt-in or opt-out decisions do not change this population.
For example, if a participant earns Active travel points in mission A and later opts out of mission B, those existing points still contribute to the group's Active travel statistics.
A membership without a skill achievement contributes 0 to the aggregate. Negative scores and scores above the skill goal are included without capping. A negative score does not count toward Count of contributors. If no eligible memberships remain, the numerical aggregates are empty database aggregates.
Pending membership requests are not included. Approving a request can add a membership to the population; rejecting it does not. Removing or moving a membership, changing its roles, deactivating or reactivating a user, or deleting a user refreshes the affected group statistics. Removing a membership also removes its membership-specific achievements and contributions.
Milestones and gateways
A milestone represents a stage within a mission. It groups the tasks that are available during that stage and defines when progression to another milestone can occur.
For example, a Travel habits mission could contain three milestones:
Each milestone can have one or more gateways. A gateway defines the condition under which the participant can progress from the current milestone to another milestone—or complete the mission.
Gateways
A gateway defines when progression from a milestone can occur.
It is linked to one Skill and evaluates a member's achievement on that Skill.
A milestone can have several gateways. For example, one gateway could open the next milestone when a participant reaches 40 points on a specific Skill, while another opens a different milestone after a specified date.
A gateway has the following main attributes:
| Attribute | Purpose |
|---|---|
Order | Determines the order in which gateways are evaluated. |
Type | Defines the type of gateway, which can be neutral, upgrade, or downgrade. |
Description | Optional translatable description of the gateway. |
Evaluation type | Determines what triggers evaluation of the gateway. |
Evaluation cron | Optional cron expression used for scheduled evaluation. |
Firing expression | Expression that determines whether the gateway fires. |
Gateway evaluation type
The evaluation type determines when GameBus checks the gateway.
| Evaluation type | Behavior |
|---|---|
Contribution-based | Evaluated when relevant skill contributions or statistics change. |
Time-based | Evaluated according to evaluation cron. |
A time-based-gateway therefore requires an appropriate cron expression, while a contribution-based-gateway is evaluated in response to changes in participant or group progress.
When a gateway fires
The firing expression determines whether a gateway fires.
For example: $.member.contribution >= 40 fires when the participant's contribution to the skill linked to the gateway reaches 40.
A gateway fires when its expression returns a finite numeric value of 1 or greater. Boolean true is therefore also treated as a successful result.
If evaluation fails or returns a non-finite value, the gateway fails closed with an outcome of 0. The failure is logged, and later gateways can still be evaluated.
Gateway expressions
The firing expression can use relevant variables to create advanced firing rules. In particular, it receives the participant's achievement and the group's statistics for the gateway's associated Skill. The expression therefore does not need to identify the Skill itself.
For example: $.member.contribution >= 40 fires when the participant's contribution to the gateway's Skill reaches 40.
Gateway input has the following structure:
{
"member": {
"contribution": 40
},
"group": {
"contribution": {
"sum": 120,
"min": 0,
"max": 50,
"avg": 24,
"median": 20,
"countOfContributors": 4
}
}
}This supports expressions such as:
| Expression | Meaning |
|---|---|
$.member.contribution >= 40 | Fire when the participant reaches 40 points. |
$.group.contribution.avg >= 20 | Fire when the group's average reaches 20 points. |
$.group.contribution.avg >= 20 and $.group.contribution.countOfContributors >= 5 | Fire when the group's average reaches 20 points and at least five memberships have contributed. |
See Expression language for more information and examples.
Gateway hit policy
A milestone can have multiple gateways. Its hit policy determines what happens when more than one gateway could fire.
| Hit policy | Behavior |
|---|---|
First (default) | Evaluate gateways by order and then ID. Stop after the first successful gateway. |
All | Evaluate every gateway and select every successful branch. |
With all, every successful destination can normally open.
For example:
If both gateways fire, both milestones can open.
If one of the successful gateways completes the mission, completion takes precedence. Other branches from that source are not opened, and the mission cannot continue progressing through another simultaneously evaluated branch.
Completing a mission
Each mission has one designated completion milestone. This gives the mission a single endpoint, even when progression branches.
With completes mission set on that milestone, completion occurs only when:
- the milestone has a gateway without a destination;
- that gateway fires while the milestone enrollment is active; and
- the membership is still eligible.
A gateway without a destination is only valid on a milestone marked as completesMission.
For example:
Here, the final gateway does not open another milestone. Instead, firing it completes the mission.
Completion is recorded once per membership and mission. Once recorded, it remains part of the participant's history even if scores or configuration later change.
Further progression for that membership and mission stops. Unfinished branches remain historical records; they are not marked complete simply because another branch reached the endpoint.
Tasks and contributions to Skills
A Task specifies a target behavior you want to promote within a Milestone. It also defines how evidence of that behavior contributes to one or more Skills.
When a participant engages in a Task, GameBus records an Activity. The Task evaluates that Activity against its rules. If a rule matches, it can create one or more task contributions.
For example, a walking Task could specify that:
- the Activity must represent a walk;
- the walk must last at least 20 minutes; and
- a qualifying walk contributes 10 points to the Active travel Skill.
If the participant already has 20 Active travel points, the new contribution raises their Skill achievement to 30.
Activities
An Activity records something a participant did.
Every Activity is based on an Activity Template, which defines the type of Activity. Examples include a walk, bike ride, completed reflection, or watched video.
Activities can also contain properties that describe what happened, such as:
- duration;
- number of steps;
- distance;
- completion percentage; or
- a submitted response.
A provider identifies where the Activity came from, such as GameBus itself or an external service.
Activities can be:
- entered directly through the app;
- supplied by an integration—such as GameBus Sync—or
- created through an embedded Task—such as GameBus Stories.
When an Activity matches a Task
A Task can contain multiple task rules. These rules are evaluated in order.
The first matching rule wins. If no rule matches, the Activity creates no task contribution.
Each task rule has a compliance expression that determines whether an Activity matches that rule.
Task expressions receive the properties of the Activity being evaluated. For example, the duration of the Activity is available to an expression as:
{
"duration": {
"value": 25,
"unit": "minutes"
}
}You can therefore write expressions such as:
| Expression | Meaning |
|---|---|
$.steps.value >= 8000 | Match an Activity containing at least 8,000 steps. |
$.score.value >= 10 and $.mistakes.value < 3 | Match an Activiy with a score ≥ 10 and less than 3 mistakes. |
$.duration.value * duration(``1 ${$.duration.unit ?? "minutes"}``) >= duration("20m") | Match an Activity lasting at least 20 minutes. |
$.distance.value * ($.distance.unit == "centimeters" ? 1 : $.distance.unit == "meters" ? 100 : $.distance.unit == "kilometers" ? 100000 : $.distance.unit == "inches" ? 2.54 : $.distance.unit == "feet" ? 30.48 : $.distance.unit == "miles" ? 160934.4 : 0) >= 500000 | Match an Activity covering at least 5 kilometers. |
See Expression language for more information and examples.
Task contributions
When a task rule matches, it can define one or more Skill outcomes. Each non-zero outcome creates a task contribution for the corresponding Skill.
A task contribution links the:
- Activity;
- Task;
- membership;
- Skill; and
- membership-specific Skill achievement.
The participant's member Skill achievement is the sum of the task contributions that remain for that membership and Skill.
Skill outcomes can also use expressions. For example:
| Expression | Meaning |
|---|---|
10 | Contribute 10 points to the linked Skill. |
-5 | Subtract five points from the linked Skill. |
$.steps.value * 2 | Calculate the contribution from an Activity property. |
min(10, $.steps.value) | Calculate the contribution from an Activity property, with a maximum. |
See Expression language for more information and examples.
Skill outcome expressions must return a finite whole number:
| Result | Effect |
|---|---|
| Positive integer | Increases the Skill achievement. |
| Negative integer | Decreases the Skill achievement. |
0 | Creates no contribution. |
| Fractional value | Cannot be stored as a contribution. |
NaN or infinity | Invalid. |
GameBus Stories and embedded Tasks
A GameBus Story can be used as a user-triggered embedded Task.
The Story runs inside the Task experience and submits an Activity to GameBus. That Activity is then evaluated in the same way as any other eligible Activity.
You can use this same mechanism to create your own embedded Task experiences. See Custom task types for implementation details.
Deleting Activities
Deleting an Activity also removes the task contributions created from that Activity.
GameBus then recalculates the affected member Skill achievements and group statistics from the contributions that remain.
For example, suppose a walk contributes 10 Active travel points and raises a participant's achievement from 20 to 30. Deleting that Activity removes the 10-point contribution and returns the achievement to 20.
Deleting an Activity does not reverse progression history. Previously recorded Milestone transitions and Mission completion remain intact.
Recalculation also does not trigger new gateway transitions by itself. Later gateway evaluations simply use the recalculated Skill achievements together with the existing eligibility and completion state.