Skip to content

Progression Tracker

Ciarán Malone edited this page Apr 11, 2022 · 11 revisions

Progression Tracker is built to track noteworthy events during the game. Example: The player levels up, the player Collects an item, the player starts a battle, and the player completes a challenge.

  • Event Name: custom name of the progress event.
  • timestamp: When the event occurred
  • location: (optional field) vector3 position of where the event took place.
  • value: (optional field) custom value for the event.

Progression Data Generated

{
    "_id": "61f95c42d59d1495dec7af3f",
    "SceneName": "SampleScene 1",
    "UniqueID": "61f95c42d59d1495dec7af3f",
    "objectName": "progressionData",
    "sessionName": "588d41cd-62c7-4944-8e43-1e9944bcc9ff",
    "trackedProgressions": [
        {
            "timeStamp": 1.958998680114746,
            "eventName": "Started",
            "value": "1"
        },
        {
            "timeStamp": 14.343352317810059,
            "eventName": "Player Died",
            "value": ""
            "trackedPosition": {
                "x": 11.926076889038086,
                "y": 1.4799998998641968,
                "z": 0.20867344737052918
            }
        }
    ],
}

Calling Progression Tracker

As all games are different it is not possible to predict what each developer would want to track in their games. So the developer can call ProgressionEvent.ProgressionTrigger to create a progression event within their codebase. The tool comes with example components:

Example Script

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using PlaytestingTool; // <- import Playtesting namespace

/// <summary>
/// Trigger progression event with on collision
/// </summary>
public class ProgressionTriggerOnTrigger : MonoBehaviour
{
    [Tooltip("tag of the object you want to trigger the trigger")]
    [SerializeField] string collisionTag;

    [Tooltip("custom name of the progress event")]
    [SerializeField] string EventName;

    [Tooltip("value corresponding to the progression event")]
    [SerializeField] float value;

    [Tooltip("destroy this component when collided")]
    [SerializeField] bool deleteOnCollide;

    void OntriggerEnter(Collider other)
    {
        if (other.CompareTag(collisionTag)){
            ProgressionEvent.ProgressionTriggerWithPosition(EventName, transform.position, value);

            if (deleteOnCollide)
                Destroy(GetComponent<ProgressionTriggerOnTrigger>());
        }
    }
}

ProgressionTrigger

generates progression event data.

example:

ProgressionEvent.ProgressionTrigger("PlayerReachedBox", 12);

params:

  • EventName: custom name of the progress event.
  • value: (optional field) value corresponding to the progression event

ProgressionTrggerWithPosition

generates progression event data with position.

example:

ProgressionEvent.ProgressionTriggerWithPosition("PlayerReachedBox", transform.position, 2);

params:

  • EventName: custom name of the progress event.
  • position: vector3 position of where the event took place.
  • value: (optional field) value corresponding to the progression event

It is recommended that you create a new component to call ProgressionEvents. So that it would be easier to remove features of the tool for release

Clone this wiki locally