User Manual: Inquisit Cyberball 5


___________________________________________________________________________________________________________________

											Cyberball Version 5
											(German instructions)
___________________________________________________________________________________________________________________

Script Author:	David Nitz for Millisecond Software, LLC
Date:			08-02-2021
last updated:   09-30-2024 by K. Borchert (katjab@millisecond.com) for Millisecond Software, LLC

Script Copyright ©  09-30-2024 Millisecond Software

For questions about this script, please contact support@millisecond.com.

German translation provided by K. Borchert for Millisecond Software
___________________________________________________________________________________________________________________
BACKGROUND INFO
___________________________________________________________________________________________________________________
This script implements Kip Williams's Cyberball game (version 5) used in research on ostracism, social exclusion, 
rejection, bullying, or discrimination.

References for Cyberball:
Cyberball 5 Manual, App version 5.4.0.2, Manual version 1.3, last updated 1/9/2019. 
Retrieved from https://www.empirisoft.com/cyberball/Manuals/Manual_for_Cyberball_5_v5402.pdf.

Cyberball App version 5.4.0.2 source code retrieved from https://www.empirisoft.com/cyberball.aspx.

Announcement page for Cyberball 5. https://www3.psych.purdue.edu/~willia55/Announce/cyberball.htm

Literature:
Williams, K. D., Cheung, C. K. T., & Choi, W. (2000). CyberOstracism: Effects of being ignored over the Internet. 
Journal of Personality and Social Psychology, 79, 748-762.

Williams, K. D., & Jarvis, B. (2006). Cyberball: A program for use in research on ostracism and interpersonal acceptance. 
Behavior Research Methods, Instruments, and Computers, 38, 174-180.

Hartgerink, C. H. J., van Beest, I., Wicherts, J. M., & Williams, K. D. (2015). The ordinal effects of ostracism: 
A meta-analysis of 120 Cyberball studies. PloSONE, 10. e0127002. doi: 10.1371/journal.pone.0127002

****NOTE****
Due to technical limitations, chat/message functionality is NOT available in this implementation.

___________________________________________________________________________________________________________________
TASK DESCRIPTION
___________________________________________________________________________________________________________________
Cyberball is a virtual ball-tossing game that can be used in research on ostracism, social exclusion, or rejection. 
It has also been used to study discrimination and prejudice (in these instances, Cyberball ball toss choices are 
used as Dependent Variable).

___________________________________________________________________________________________________________________
DURATION 
___________________________________________________________________________________________________________________
Duration will depend substantially on the chosen parameters, chiefly the total number of throws.
You can assume roughly 5 to 6 seconds per throw, i.e. a game consisting of 30 throws will take about 3 minutes to 
complete.

___________________________________________________________________________________________________________________
DATA OUTPUT DICTIONARY
___________________________________________________________________________________________________________________
The fields in the data files are:

(1) Raw data file: 'cyberball5_raw*.iqdat' (a separate file for each participant)

___________________________________________________________________________________________________________________
DATA OUTPUT DICTIONARY
___________________________________________________________________________________________________________________
The fields in the data files are:

(1) Raw data file: 'cyberball5_raw*.iqdat' (a separate file for each participant)

___________________________________________________________________________________________________________________
DATA OUTPUT DICTIONARY
___________________________________________________________________________________________________________________
The fields in the data files are:

(1) Raw data file: 'cyberball5_raw*.iqdat' (a separate file for each participant)

inquisit.version, inquisit.version: 	The specific Inquisit version used (the 'build') used to collect the data.
computer.platform:					The platform the script was run on (win/mac/ios/android).
date, time, 						Date and time script was run
subject, group, session				with the current subject id/group number/session number.

///Parameter Settings:
showavatars: 						Whether avatar images should be shown. Default is false. 
									Avatar images can be customized under item.playeravatars.
									
showstats: 							Whether basic on-screen throw statistics should be shown 
									(throws taken and made by the human player, total throws).
									Default is false.
									
nPlayers: 							Number of players in the given game. Default is 3.
									The script supports 3- to 9-player games.
									
nthrows: 							Number of throws to be made during the game.
spectate: 							Whether the human player should only "watch" the game being played.
									When set to true, the computer takes over controlling player 2, 
									making random throws to the other players. A "spectate" condition is often 
									used as a control condition. Default is false.
									
scheduleType: 						Whether the script should administer an "ostracize", "include", or "custom"
									schedule.
									
ostracismTarget: 					Applies when running an "ostracize" schedule. Number of the player being 
									excluded by the other players. Default is 2 (human player).
									
ostracismMode: 					Applies when running an "ostracize" schedule. Determines the degree to which 
									the target is ostracized.
									0 = target receives 0 throws from the NPCs.
									1 = target receives 1 throw from the NPCs, early in the schedule.
									2 = target receives 2 throws frm the NPCs, early in the schedule.
									You may set higher  Make sure to increase nthrows commensurate 
									with the chosen setting. E.g. for a schedule comprising only 10 throws, it may 
									not be possible to actually achieve two throws to the target early on. Achieving 
									5 throws to the target would be downright impossible and would also make the 
									schedule something that is not actually an ostracism schedule.
									
customScheduleNumber:				Index number of the custom schedule; applies when scheduletype is set to "custom".
									Default is 1. For information on how to assign different custom schedules to different 
									between-subjects conditions, see section SCHEDULING LISTS and the example expt elements 
									#4 and #5 in this script.
									
throwmode:							"speed" or "duration"
									"speed" => ball travels at constant speed: 
									A throw will take longer between two players that are farther apart than between two 
									players that are closer together, since the ball will have to travel a longer (relative) 
									distance.
									"duration" => ball travels with constant duration:
									Throws between players that are farther apart take the same amount of time as throws between 
									two players that are closer togehter, i.e. the ball will travel at higher relative speed 
									between the two more distant players.
									Defaults is "duration".
									
throwSpeed:							Relative speed of the ball when throwmode is set to "speed".
									Expressed as fraction of horizontal display area traversed per second.
									0.25 => quarter of horizontal screen aread traversed in one second.
									0.5 => half the horizontal screen area traversed in one second.
									1 => entire horizontal screen area traversed in one second.
									Default is 0.45.
									
throwDuration:						Constant duration of a throw when throwmode is set to "duration".
									Given in milliseconds. Default is 900.

blockNum, blockCode:				The number and name of the current block (built-in Inquisit variable).
trialNum, trialCode: 				The number and name of the currently recorded trial (built-in Inquisit variable).
									Note: trialNum is a built-in Inquisit variable; it counts all trials run; even those
									that do not record data to the data file such as feedback trials. Thus, trialNum 
									may not reflect the number of main trials run per block.
response:							The participant's response (player selection).
latency: 							The response latency in milliseconds.

receivedFrom: 				Whom the current ballholder received the ball from.
ballAt: 					The current ballholder.
throwTo: 					Whom the current ballholder chose to throw the ball to.
throwDistanceMM:			Distance covered by the current throw in mm.
throwDurationS:			Duration of the current throw in seconds.
throwSpeedMM:_s				Realized throw speed in mm/s.
delay: 						Delay after which the throw was executed.
player2Received:			Running count of times player 2 (human) received the ball.
player2thrown:				Running count of times player 2 (human) threw the ball.
throwCount: 				Running count of realized throws.
deprecated: 				Running count of deprecated throws.

generatedThrowSchedule: 	A text string recording the generated throw schedule, or -- in the case of custom 
							schedules -- the experimenter-entered custom schedule. 
							For details, see section SCHEDULING LISTS.
							
realizedThrowSchedule: 		The realized throw schedule, including the choices maded by the human player, across 
							the progression of the game.
							
widthMM:					Width of the used screen area in mm.
heightMM:					Height of the used screen area in mm.

(2) Summary data file: 'cyberball5_summary*.iqdat' (a separate file for each participant)

inquisit.version, inquisit.version: 	The specific Inquisit version used (the 'build') to collect the data.
computer.platform:					the platform the script was run on (win/mac/ios/android)
startDate:							date script was run
startTime:							time script was started
subjectId:							assigned subject id number
groupId:							assigned group id number
sessionId:							assigned session id number
elapsedTime:						time it took to run script (in ms); measured from onset to offset of script
completed:							0 = script was not completed (prematurely aborted); 
									1 = script was completed (all conditions run)

///parameter settings:									
									
showavatars: 						Whether avatar images should be shown. Default is false. 
									Avatar images can be customized under item.playeravatars.
									
showstats: 							Whether basic on-screen throw statistics should be shown 
									(throws taken & made by the human player, total throws).
									Default is false.
									
nPlayers: 							Number of players in the given game. Default is 3.
									The script supports 3- to 9-player games.
									
nthrows: 							Number of throws to be made during the game.

spectate: 							Whether the human player should only "watch" the game being played.
									When set to true, the computer takes over controlling player 2, 
									making random throws to the other players. A "spectate" condition is often 
									used as a control condition. Default is false.
									
scheduleType: 						Whether the script should administer an "ostracize", "include", or "custom"
									schedule.
									
ostracismTarget: 					Applies when running an "ostracize" schedule. Number of the player being 
									excluded by the other players. Default is 2 (human player).
									
ostracismMode: 					Applies when running an "ostracize" schedule. Determines the degree to which 
									the target is ostracized.
									0 = target receives 0 throws from the NPCs.
									1 = target receives 1 throw from the NPCs, early in the schedule.
									2 = target receives 2 throws frm the NPCs, early in the schedule.
									You may set higher  Make sure to increase nthrows commensurate 
									with the chosen setting. E.g. for a schedule comprising only 10 throws, it may 
									not be possible to actually achieve two throws to the target early on. Achieving 
									5 throws to the target would be downright impossible and would also make the 
									schedule something that is not actually an ostracism schedule.
									
customScheduleNumber:				Index number of the custom schedule; applies when scheduletype is set to "custom".
									Default is 1. For information on how to assign different custom schedules to different 
									between-subjects conditions, see section SCHEDULING LISTS and the example expt elements 
									#4 and #5 in this script.
									
throwmode:							"speed" or "duration"
									"speed" => ball travels at constant speed: 
									A throw will take longer between two players that are farther apart than between two 
									players that are closer together, since the ball will have to travel a longer (relative) 
									distance.
									"duration" => ball travels with constant duration:
									Throws between players that are farther apart take the same amount of time as throws between 
									two players that are closer togehter, i.e. the ball will travel at higher relative speed 
									between the two more distant players.
									Default is "duration".
									
throwSpeed:							Relative speed of the ball when throwmode is set to "speed".
									Expressed as fraction of horizontal display area traversed per second.
									0.25 => quarter of horizontal screen aread traversed in one second.
									0.5 => half the horizontal screen area traversed in one second.
									1 => entire horizontal screen area traversed in one second.
									Default is 0.45.
									
throwDuration:						Constant duration of a throw when throwmode is set to "duration".
									Given in milliseconds. Default is 900.

///Data:									
player2Received:					Count of times player 2 (human) received the ball.
player2thrown:						Count of times player 2 (human) threw the ball.
throwCount: 						Count of realized throws.
deprecated:							Count of throw deprecations during the administration of the schedule.

generatedThrowSchedule: 			A text string recording the generated throw schedule, or -- in the case of custom schedules -- 
									the experimenter-entered custom schedule (plus potential padding). 
									For details, see section SCHEDULING LISTS.
									
realizedThrowSchedule: 				The realized throw schedule, including the choices maded by the human player, across 
									the progression of the game.
player1label to
player9Label:						Labels assinged to players 1 to 9. Default is "Player 1" to "Player 9".

widthMM:								Width of the used screen area in mm.
heightMM:							Height of the used screen area in mm.
___________________________________________________________________________________________________________________
EXPERIMENTAL SET-UP 
___________________________________________________________________________________________________________________
(1)  Task:
- Participants engage in a ball-toss game with between 2 to 8 other (virtual) players.
- The virtual players' behavior can be configured in numerous ways, e.g. to exclude the participant or any of the 
virtual players, to include all players, and anything in between.

(2) End of Task:
- The task ends when the configured number of ball tosses has been reached.

(3) Instructions
- Instructions can be easily changed under EDITABLE INSTRUCTIONS.
- Some stimuli can be easily changed under EDITABLE STIMULI.

(4) Dependent Variables/Scores:
Data files record who threw the ball to whom, including the choices made by the human participant and 
computer-controlled players (NPCs), how long each throw was delayed, as well as general game settings and the 
type of schedule administered.

Typically, Cyberball is used as an independent variable, i.e. experimental manipulation to induce varying 
degrees of social inclusion or exclusion (ostracism). As such, it does not have traditional scores or dependent 
variables to report. 

When used as a dependent variable in studies of empathy, altruistic behavior, prejudice or discrimination, the 
variable of interest is the human player's throwing behavior (cf. Williams & Jarvis, 2006, p. 177).
___________________________________________________________________________________________________________________
INSTRUCTIONS 
___________________________________________________________________________________________________________________
Instructions are as provided in the original Cyberball 5 application.
Instructions can be easily changed under section EDITABLE INSTRUCTIONS.

___________________________________________________________________________________________________________________
EDITABLE CODE 
___________________________________________________________________________________________________________________
Check below for (relatively) easily editable parameters, stimuli, instructions etc. 
Keep in mind that you can use this script as a template and therefore always "mess" with the entire code 
to further customize your experiment.

The parameters you can change are:
/nPlayers: 							Number of players in the given game. Default is 3.
									The script supports 3- to 9-player games.
/nthrows: 							Number of throws to be made during the game. Default is 30.
/spectate: 							true or false. Whether the human player should only "watch" the game being played.
									When set to true, the computer takes over controlling player 2, 
									making random throws to the other players. A "spectate" condition is often 
									used as a control condition. Default is false.
/scheduleType: 						Whether the script should administer an "ostracize", "include", or "custom"
									schedule.
/ostracismTarget: 					Applies when running an "ostracize" schedule. Number of the player being 
									excluded by the other players. Default is 2 (human player).
/ostracismMode: 					Applies when running an "ostracize" schedule. Determines the degree to which 
									the target is ostracized.
									0 = target receives 0 throws from the NPCs.
									1 = target receives max. 1 throw from the NPCs, early in the schedule (1st 25% of throws).
									2 = target receives max. 2 throws from the NPCs, early in the schedule (1st 25% of throws).
									You may set higher values. Make sure to increase parameters.nthrows commensurate 
									with the chosen setting. E.g. for a schedule consisting of only 10 or 15 throws, it may 
									not be possible to actually achieve two throws to the target early on. Achieving 
									5 throws to the target would be downright impossible, apart from transforming the 
									schedule into something that is not actually an ostracism schedule.
/customScheduleNumber: 			Applies when running a "custom" schedule. The script can support multiple, different 
									custom schedules used in different between-subjects condition. When multiple custom 
									schedules are present, this parameter must be set to the appropriate schedule number
									/onexptbegin in the given between-subjects condition. See section SCHEDULING LISTS and
									the example expt elements #4 and #5 in this script.
/throwmode:							"speed" or "duration"
									"speed" => ball travels at constant speed: 
									A throw will take longer between two players that are farther apart than between two 
									players that are closer together, since the ball will have to travel a longer (relative) 
									distance.
									"duration" => ball travels with constant duration:
									Throws between players that are farther apart take the same amount of time as throws between 
									two players that are closer togehter, i.e. the ball will travel at higher relative speed 
									between the two more distant players.
/throwSpeed:						Relative speed of the ball when parameters.throwmode is set to "speed".
									Expressed as fraction of horizontal display area traversed per second.
									0.25 => quarter of horizontal screen aread traversed in one second.
									0.5 => half the horizontal screen area traversed in one second.
									1 => entire horizontal screen area traversed in one second.
									Default: 0.4
/throwDuration:						Constant duration of a throw when parameters.throwmode is set to "duration".
									Given in milliseconds. Default: 900
/showavatars: 						true or false. Whether avatar images should be shown. Default is false. 
									Avatar images can be customized under item.playeravatars.
/showstats: 						true or false. Whether basic on-screen throw statistics should be shown 
									(throws taken & made by the human player, total throws).
									Default is false.
/player1Label: to
/player9Label:						Labels for players 1 to 9.

/player1LabelColor: to
/player9LabelColor: 				Colors of the labels for players 1 to 9.



___________________________________________________________________________________________________________________

	CYBERBALL 5 SCHEDULE GENERATOR HELPER SCRIPT
___________________________________________________________________________________________________________________

Script Author:	David Nitz for Millisecond Software, LLC
Date:			08-02-2021
last updated:   05-25-2023 by K. Borchert (katjab@millisecond.com) for Millisecond Software, LLC

Script Copyright © 05-25-2023 Millisecond Software

For questions about this script, please contact support@millisecond.com.
___________________________________________________________________________________________________________________
BACKGROUND INFO
___________________________________________________________________________________________________________________
This helper script contains automatic schedule generators for ostracism and inclusion scales. The generators are 
closely modeled after those of the original Cyberball 5 application, with a few minor tweaks and adaptations to 
Inquisit's way of doing things.

trial.ostracismGenerator generates an ostracism schedule according to the chose parameter settings -- number of 
players, number of throws, the chosen ostracism target, the ostracism mode, and so forth. It will automatically 
compensate for potential throw deprecations by adding the required number of replacement throws to the schedule. 
It will also generate a parallel, random throw delay schedule.

trial.inclusionGenerator generates an inclusion schedule according to the chose parameter settings -- number of 
players, number of throws, and so forth. It will automatically compensate for potential throw deprecations by 
adding the required number of replacement throws to the schedule. It will also generate a parallel, random throw 
delay schedule.
NOTE: Each available player has an equal probability of being the recipient of a given throw. This CAN result in 
schedules that "accidentally" ostracize one of the players simply due to random chance, especially if the chosen 
number of throws is low.

Defining custom schedules affords the most control and flexibility beyond simple, automatically generated ostracism 
and inclusion schedules.

trial.customGenerator handles custom throw and delay schedules. Its primary job is to transfer the defined custom 
throw (and associated delay) schedule from its "custom_throwscheduleX" / "custom_delayscheduleX" lists to the main 
lists (list.throwschedule and list.delayschedule). When a custom schedule with too few throws to compensate for 
deprecations is used, trial.customGenerator will automatically "pad" the schedule with a sufficient amount of random 
throws to the NPCs (non-human players). To have full control over the properties of your custom schedule, however, 
you should construct it to take potential throw deprecations into account from the get-go.