Skip to content

Commit bb0cd77

Browse files
authored
Merge pull request #396 from NVlabs/TaskFlow
Task flow integration
2 parents 13b4ade + db02540 commit bb0cd77

18 files changed

+917
-167
lines changed
Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
{
2+
description = "task-level configuration example";
3+
frameRate = 120;
4+
showHUD = true;
5+
renderWeaponStatus = true;
6+
pretrialDuration = 0;
7+
8+
weapon = {
9+
id = "2hit";
10+
firePeriod = 0.3;
11+
damagePerSecond = 2;
12+
autoFire = false;
13+
};
14+
15+
sessions = (
16+
{
17+
// This session tests out different weapon cooldowns and cooldown indicators testing the memory of the participant
18+
// for which one had which cooldown indicator
19+
id = "1target_cd";
20+
description = "1 target cooldown";
21+
cooldownMode = "ring"; // Session-level config can still be used to set defaults for all tasks
22+
cooldownColor = Color4(0.7,1.0,0.9,0.75);
23+
24+
tasks = [
25+
{
26+
id = "normal";
27+
// The order arrays refer to the trial array IDs
28+
// The correctAnswers must be in the question options for this task
29+
trialOrders = [
30+
{
31+
order = ["ring", "box"];
32+
correctAnswer = "box";
33+
},
34+
{
35+
order = ["box", "ring"];
36+
correctAnswer = "ring";
37+
},
38+
{
39+
order = ["ring slow fire", "box slow fire"];
40+
correctAnswer = "box";
41+
},
42+
{
43+
order = ["box slow fire", "ring slow fire"];
44+
correctAnswer = "ring";
45+
},
46+
];
47+
questions = [ {
48+
prompt = "Which style of cooldown indicator did you see most recently?";
49+
type = "MultipleChoice";
50+
randomOrder = false;
51+
options = ["ring", "box"];
52+
} ];
53+
count = 1;
54+
},
55+
{
56+
id = "slow fire";
57+
trialOrders = [
58+
{ order = ["ring"]; correctAnswer = "fast"; },
59+
{ order = ["ring slow fire"]; correctAnswer = "slow"; },
60+
{ order = ["box"]; correctAnswer = "fast"; },
61+
{ order = ["box slow fire"]; correctAnswer = "slow"; },
62+
];
63+
questions = [ {
64+
prompt = "Was the cooldown for the last trial fast, or slow?";
65+
type = "MultipleChoice";
66+
randomOrder = false;
67+
options = ["fast", "slow"];
68+
} ];
69+
count = 1;
70+
},
71+
];
72+
trials = (
73+
{
74+
id = "ring";
75+
targetIds = ( "static");
76+
},
77+
{
78+
id = "box";
79+
targetIds = ( "static");
80+
cooldownMode = "box";
81+
},
82+
{
83+
id = "ring slow fire";
84+
targetIds = ( "static");
85+
weapon = {
86+
id = "2hit_slow";
87+
firePeriod = 0.5;
88+
damagePerSecond = 1.1;
89+
};
90+
},
91+
{
92+
id = "box slow fire";
93+
targetIds = ( "static");
94+
cooldownMode = "box";
95+
weapon = {
96+
id = "2hit_slow";
97+
firePeriod = 0.5;
98+
damagePerSecond = 1.1;
99+
};
100+
},
101+
);
102+
103+
},
104+
{
105+
// This session tests the ability of the user to compare stutter happening vs. not
106+
id = "2targets_stutter";
107+
description = "2 targets frame stutter";
108+
weapon = {
109+
id = "1hit";
110+
firePeriod = 0.2;
111+
damagePerSecond = 6;
112+
autoFire = false;
113+
};
114+
frameTimeArray = (0.008); // Set a default value and override in trials below
115+
randomizeTaskOrder = true; // This is the default, but it's important to this session
116+
tasks = [
117+
{
118+
id = "none";
119+
trialOrders = [
120+
{ order = ["none", "none"]; },
121+
{ order = ["10/s", "10/s"]; },
122+
{ order = ["2/s", "2/s"]; },
123+
{ order = ["none", "10/s"]; },
124+
{ order = ["10/s", "none"]; },
125+
{ order = ["none", "2/s"]; },
126+
{ order = ["2/s", "none"]; },
127+
{ order = ["2/s", "10/s"]; },
128+
{ order = ["10/s", "2/s"]; },
129+
];
130+
questions = [ {
131+
prompt = "Which of the last 2 sets of targets felt more stuttery?";
132+
type = "MultipleChoice";
133+
randomOrder = false;
134+
options = ["first", "second"];
135+
} ];
136+
count = 2;
137+
},
138+
];
139+
trials = (
140+
{
141+
id = "none";
142+
targetIds = ( "moving", "moving");
143+
},
144+
{
145+
id = "10/s";
146+
targetIds = ( "moving", "moving");
147+
// This sequence should repeat about 10 times per second at the set 120 fps
148+
frameTimeArray = (0.008, 0.008, 0.008, 0.008, 0.008, 0.008, 0.008, 0.008, 0.008, 0.008, 0.016);
149+
},
150+
{
151+
id = "2/s";
152+
targetIds = ( "moving", "moving");
153+
// This should be 59 total entries, meaning there is 1 stutter every 59 frames, which should be roughly 2 every second
154+
frameTimeArray = (0.008, 0.008, 0.008, 0.008, 0.008, 0.008, 0.008, 0.008, 0.008, 0.008, 0.008, 0.008, 0.008, 0.008, 0.008, 0.008, 0.008, 0.008, 0.008, 0.008, 0.008, 0.008, 0.008, 0.008, 0.008, 0.008, 0.008, 0.008, 0.008, 0.008, 0.008, 0.008, 0.008, 0.008, 0.008, 0.008, 0.008, 0.008, 0.008, 0.008, 0.008, 0.008, 0.008, 0.008, 0.008, 0.008, 0.008, 0.008, 0.008, 0.008, 0.008, 0.008, 0.008, 0.008, 0.008, 0.008, 0.008, 0.008, 0.016);
155+
},
156+
);
157+
158+
},
159+
);
160+
161+
targets = (
162+
{
163+
id = "static";
164+
destSpace = "player";
165+
speed = ( 0, 0 );
166+
visualSize = ( 0.05, 0.05 );
167+
},
168+
{
169+
id = "moving";
170+
destSpace = "player";
171+
speed = ( 10, 10 );
172+
visualSize = ( 0.05, 0.05 );
173+
},
174+
);
175+
176+
}

data-files/samples/tasks.Status.Any

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
currentUser = "Sample User";
3+
sessions = ( "1target_cd", "2targets_stutter");
4+
settingsVersion = 1;
5+
users = (
6+
{
7+
id = "Sample User";
8+
sessions = ( "1target_cd", "2targets_stutter");
9+
} );
10+
11+
}
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
// This is a sample of how to implement a 2 interval forced choice experiment.
2+
// This uses the task-level specification available in FPSci versions starting in early 2023.
3+
//
4+
// For an example of how to do a similar type of experiment without the task-level specification
5+
// see the twoifc-trial sample experiment.
6+
{
7+
// global settings
8+
showMenuBetweenSessions = False;
9+
clearMissDecalsWithReference = True;
10+
showReferenceTargetMissDecals = False;
11+
description = "2IFC";
12+
13+
scene = {
14+
name = "FPSci Simple Hallway";
15+
};
16+
17+
feedbackDuration = 0.0; // Time allocated for providing user feedback
18+
pretrialDuration = 0.0; // Time allocated for preparing for trial
19+
maxTrialDuration = 5.0; // Maximum duration allowed for completion of the task
20+
referenceTargetSize = 0.03;
21+
22+
// feedback settings
23+
trialFeedbackDuration = 0.0;
24+
referenceTargetInitialFeedback = "Use left shift key to clear the reference targets (red) and left mouse click to clear test targets (green).";
25+
sessionFeedbackDuration = 1.0;
26+
sessionCompleteFeedback = "Session complete! Moving to next session.";
27+
allSessionsCompleteFeedback = "All Sessions Complete! Thank you for participating in this experiment.";
28+
29+
// weapon settings
30+
weapon = {
31+
id = "Half Second Cooldown";
32+
firePeriod = 0.5;
33+
autoFire = False;
34+
damagePerSecond = 2.1;
35+
maxAmmo = 3600;
36+
};
37+
38+
// UI settings
39+
showHUD = True;
40+
renderWeaponStatus = True;
41+
cooldownMode = "ring";
42+
cooldownInnerRadius = 40.0;
43+
cooldownColor = Color4(1.0,1.0,1.0,0.8);
44+
45+
// session settings
46+
sessions = (
47+
{
48+
id = "delays";
49+
description = "delay comparison task-style";
50+
tasks = [
51+
{
52+
id = "normal";
53+
// Note that specifying multiple orderings for the stimulus is simple to express here
54+
trialOrders = [
55+
{ order = ["0", "2"]; correctAnswer = "Worse"; },
56+
{ order = ["0", "4"]; correctAnswer = "Worse"; },
57+
{ order = ["0", "8"]; correctAnswer = "Worse"; },
58+
{ order = ["2", "0"]; correctAnswer = "Better"; },
59+
{ order = ["4", "0"]; correctAnswer = "Better"; },
60+
{ order = ["8", "0"]; correctAnswer = "Better"; },
61+
];
62+
questions = [ {
63+
type = "MultipleChoice";
64+
prompt = "Was this trial better or worse than the previous one?";
65+
randomOrder = false;
66+
options = ["Better", "Worse"];
67+
optionKeys = ["1", "4"];
68+
fullscreen = true;
69+
showCursor = false;
70+
fontSize = 40;
71+
} ];
72+
count = 1;
73+
},
74+
];
75+
trials = (
76+
{
77+
id = "0";
78+
frameDelay = 0;
79+
targetIds = ( "stray_fly_hard");
80+
},
81+
{
82+
id = "2";
83+
frameDelay = 2;
84+
targetIds = ( "stray_fly_hard");
85+
},
86+
{
87+
id = "4";
88+
frameDelay = 4;
89+
targetIds = ( "stray_fly_hard");
90+
},
91+
{
92+
id = "8";
93+
frameDelay = 8;
94+
targetIds = ( "stray_fly_hard");
95+
},
96+
);
97+
98+
},
99+
);
100+
101+
// target settings
102+
targets = (
103+
{
104+
id = "stray_fly_hard";
105+
destSpace = "player";
106+
elevationLocked = False;
107+
speed = ( 8, 15 );
108+
visualSize = ( 0.03, 0.03 );
109+
eccH = ( 5.0, 15.0 );
110+
eccV = ( 0.0, 1.0 );
111+
motionChangePeriod = ( 0.5, 0.6 );
112+
jumpEnabled = False;
113+
},
114+
);
115+
116+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
currentUser = "Sample User";
3+
sessions = ("delays");
4+
settingsVersion = 1;
5+
users = (
6+
{
7+
id = "Sample User";
8+
sessions = ("delays");
9+
},
10+
);
11+
}

0 commit comments

Comments
 (0)