Base Task is the class from which all tasks are derived. It holds UI support, variables, a state machine, and various functions. The goal of Base Task is to do 99% of the setup without your help. Basic Timed Task is running with all defaults of Base Task.
Task Name - Name of the Task
Duration - How long does the timer run for before ending the task
Target - Select a target prefab (more info below)
Player Prefab - Select between Player Normal or Player Beam. Normal is a single-click gunshot, while Beam fires continuously when held down (intended for tracking).
Player Spawn Location - This is how you alter where the player spawns. Default (0, 2.2, -3.5)
Walkable Level Geo - This is a scriptable object that houses a prefab of geo (walls, barriers, etc.) and an array of (x, y, z) coordinates. THIS MUST BE FILLED OR THE PLAYER WILL SPAWN IN A VOID.
Targets On Screen - How many targets will be on screen at any given time
Score Type - Pick between different types of scoring (more info below)
Is Clear Targets On Miss - This behaviour removes all targets from the screen and respawns them when a shot is missed.
Predefine Target Locations - This bool decides whether or not to utilize the coordinates from the Walkable Level Geo as the location of targets.
Is Target as Termination - This behaviour switches the task's timer to count upwards and sets the termination condition to a certain number of targets. This also saves time as a stat.
Targets Before Termination - This is how many targets need to be shot before the task ends.
Is PK For Termination Only - This changes the termination to only include the player's destroyed targets, and not targets that have self-destructed
Is Using Delayed Targets - Changes targets to spawn in after a random delay
Min target Delay - Minimum time in seconds before a target will spawn
Max Target Delay - Maximum time in seconds before a target will spawn
Grid Center - This is the central point of spawning. Leave the X at 0. Y should be above 2 but below the total Y. Center the Z between the deepest and shallowest points
Standard room (18, 10, 33)
Large room (58, 10, 68) this spawns centered around (0,0,0)
XRange - Determines the width of spawning. (-xrange, xrange)
YRange - Max height of spawn from grid center. Be sure this value + Y of the grid center does NOT go over max. (0, yrange)
ZRange - Determines the width of spawning. (-zrange, zrange).
protected virtual bool IsTerminationMet()
{
if (isTimerCountingUp)
{
return ((shotTargets + selfDestroyedTargets) >= targetsBeforeTerminate);
}
else
{
return time <= 0;
}
}
This function returns a termination condition as a bool; When the bool is true, it will end the task. By default, this is set to a timer that counts down or a set number of targets to be hit.
protected virtual void UpdateUI()
{
//update text
timerText.text = "Time: " + Mathf.CeilToInt(time);
scoreText.text = "Score: " + score;
if (accuracy > 0)
{
accuracyText.text = "Accuracy: " + Mathf.CeilToInt(accuracy) + "%";
}
else
{
accuracyText.text = "Accuracy: " + 0 + "%";
}
timerText.gameObject.SetActive(true);
scoreText.gameObject.SetActive(true);
accuracyText.gameObject.SetActive(true);
}
This function updates the UI. By default, the timer, score, and accuracy are displayed.
protected virtual void FillGraphs()
{
displayData.DrawGraph(taskName, DisplayData.GraphType.Score);
}
This function decides what is displayed on the graphs of the post-task panel. Currently, there is only one graph. Valid graph types include: Score, Accuracy, Speed, and Targets.
This section may change once the UI is finalized.
Basic - Has a bullseye
Timed - Vanishes after some time, no bullseye
Tiny - 40% the size of a Basic
Moving - Follows a movement pattern
Tracked - Score differently (meant for tracking tasks), follows a movement pattern
*For more information, please click the hyperlink to the Targets page.
Targets - Only shot targets
TargetsAccuracy - Shot targets, accuracy, and bullseyes
AccuracyTracking - Specific to tracking tasks, counts the duration spent on target, accuracy, and bullseyes
TargetsTime - Shot targets, time as a penalty
TargetsTimeAccuracy - Shot targets, accuracy, bullseyes, time as a penalty
Note: Score of 0 is possible by time penalty. Accuracy can give up to 500 pts at 100%. Bullseyes give 5 additional pts, configurable in basetask under centerAdditionalPoints.
Basic Task - No changes from base task
Basic Tracking Task - Stats track tracked targets hit
Reflex - UI shows targets left instead of timer
Gallery - UI hides score text
Flicking - Spawns every other target at the grid center
Task packs are sets of 2-5 tasks that can be queued up through the visual novel. Each pack is a scriptable object with 3 parts:
Pack Number - Starting at 1, must be unique to each pack.
Pack Description - Theme of the pack, what it contains
Task[] - These are all the tasks that will be played in sequence by the player
After generating a pack, you MUST add it to the array of packs in the Training manager script on the GameMgr in the TrainingScene. It's a drag-and-drop.