CyberBall v3.0, Released 10/4/04


CyberBall is a program that allows you to create various interactive scenarios using a simple ball tossing game.  In this game, the real participant plays ball with 2 or 3 other players who are thought to be real and connected through a network.  Theses other players are of course, computerized confederates.   Using "schedule" files you can define the behaviour of these confederates.  You can tell each confederate to include or exclude any other player at any time.  If you instruct a confederate to exclude another player (real or virtual), you can specify when this happens.  Using "setting" files, you can define how long the game will last, the number and names of players, the pace of the game and the schedule file you wish to use.

Quick Demo

To run the program, simply double-click the CyberBall icon located in the CyberBall folder after installation.  You will be prompted for a settings file.  Select "4pl - ostracize subject.txt" from the settings folder.  You will then be prompted for a subject ID.  Try entering 1.  Read the instructions that appear and then click the link to begin.  When you’re done (takes about 5 minutes), your data will appear in the file log.csv in the "log" folder. 

How it Works

CyberBall uses two types of input files.  The first is called a settings file.  Take a look in the settings folder and open the file "4pl - ostracize subject.txt".  This is a settings file, and is depicted below.  You can create as many settings files as you like.  The first row defines whether the game will have 3 or 4 players (including the real subject).  The second row defines how many total throws will occur before the game ends.  The third row defines the schedule file (see below) that sets the ostracism behaviour of the confederates.  The next four rows define the names of the players.  The first player is the left most player and the second player is always the real subject.  The third player is the right most player and the fourth player is the topmost player which appears only in a four-player game.   After each name, you may specify an optional image file for the player which will appear during game play.  Note that both names and images are optional.  If you do not want a name or an image to appear, simply enter "none", e.g., "name1, none, none" .  The next row defines the pace of the game.  There are 2 values here.  This first value is a constant number of seconds to add between tosses.  The second value is the upper range of a random time value to add to each trial.  In the case below, each throw will take 2 seconds plus a random value between 0 and 3 seconds.    Finally, the last row defines how many blank spaces should be provided in the top of the browser window.  A smaller number (e.g., 0) may be useful here if small screens are to be used.

players, 4
total throws, 30
schedule, ostracize subject.csv
start page, start.htm
name1, Trevor, trevor.jpg
name2, Kip, kip.jpg
name3, Cassie, cassie.jpg
name4, Blair, blair.jpg
game speed, 2, 3
spacing, 2

The second type of file is called a schedule file.  From the schedules folder, open the file ostracize subject 4.txt.  It should open up in any text editor such as NotePad or WordPad. 


This file contains the ostracism behaviour of the various confederate players during the game.  In your settings file you will need to specify a schedule file such as this one.  Each row defines the behaviour of one player.  The first number in each row is the player--remember that Player 2 is always the real subject and so we don't schedule his or her throws.  The remaining numbers in each row indicate who the player is going to throw to each time they get the ball.  Numbers grouped together between commas are randomized.

For example, look at the first row.  This is how Player 1 (the left most player) will treat everybody else.  The first three throws are going to go to Players 2, 3 and 4 in a randomized order.  After that, Player 1 is apparently going to ostracize Player 2 (our subject) by throwing only to Players 3 and 4--throwing to each of them in a random order once every two throws.

Since Player 2 is the real subject, we do not define a schedule.  Of course, the real subject can choose to ostracize any of the confederates during the game, but we do not define acts of free will here--just the acts of an obedient computer.

Players 3 and 4, the right-most and top-most player, are also going to ostracize the real subject (Player 2) after throwing once to each subject in a random order.

Basically, this schedule means that after the real subject has caught the ball once from each subject, no one is going to throw to him/her any more :(

Because you can explicitly control each of every confederate's throws, you can adjust the level of ostracism of any player at any time.  To see an example, check out the "change of heart" sample--in this one, we have one confederate who throws only to the subject after having first joined the other confederates in ostracizing him.  By the end, every one is throwing to the real subject again.  Make sure to have a tissue handy for this one!

Schedule Files Rules

Data Collection

CyberBall records all tosses that occur during the game.  These data, along with the subject ID, date and time of the session, and other info about the session are appended to a file called log.csv which will be located in "log" folder.  Additionally, a separate but structurally identical data file will store the time of each throw rather than the target player.  These times will be appended to a file called time.csv which will also be located in "log" folder.  Data are written when the browser is closed after the game.

Instructions for Subjects

Instructions can be modified by editing the file "start.htm" located in the HTML folder.  This can be done in any HTML editor such as Front Page or Word.   Multiple instruction pages can be developed for different conditions.  You can specify an alternate starting file in the settings file.  You can also edit the "thankyou.htm" file which is displayed at the end of the game.

Using Key Presses instead of Mouse Clicks

Note that the subject may use key presses instead of mouse clicks to throw.   So that it will make sense to the subject, the key mappings are different in 3 vs. 4 player games.   This is just to help the subject and does not affect the data recorded.   If you look at the columns below labeled "data file", this tells you the actual position thrown to.

3-Player Keys   4-Player Keys   Data File
          "2"       4  
"1"   "2"   "1"   "3"   1   3
  S       S       2  

Running CyberBall from MediaLab (PCs only)

You can optionally run CyberBall from within a MediaLab session so that subject IDs and setting files can be entered automatically.  To do this, follow these steps:

That's it.  For details on MediaLab, see

Notes about CSV Files

The data files created by this program are saved in the ..CSV format.  This standard comma-delimited format allows editing of input and output files using any favourite spreadsheet application.  Excel and some other programs may tell you that saving in the .CSV format will cause a loss of formatting and/or other info.  This is fine and in no way will harm your data file.  Users in a few countries may have to set their ‘Regional Settings’ in the Windows Control Panel to that of the United States in order to correctly view and edit .CSV files in Excel.

When you double click on a .CSV Output file it launches the application set by default to open .CSV files on your computer.  If there is no default set, you may have to indicate which application you want to use when you first try this.  Simply choose whichever spreadsheet program you like to use.  If the default program is set but you want to change it then go to Windows Explorer and find a file of the .CSV type and then...

In Windows 95/98

Click it once to highlight it.  While holding down the SHIFT key click the right mouse button on the file and select Open With.  Find and select your desired spreadsheet application.  Check the box that says “Always Use This Application.”

In Windows 2000/XP

Click it once to highlight it.   Click the right mouse button on the file and select ‘Open With.’  Then choose Find and select your desired spreadsheet application.  DirectRT will now send your files to that application for viewing and editing.

Advanced: Synching CyberBall with External Equipment & Programs using TTL signals

Requires the older version 2 and is for PC only.  TTL not available for Java yet.


 Program Credits

Custom Software Development

Copyright © 2002-2004 Empirisoft
Code Developed by Blair Jarvis, Ph.D.
Adapted for cross-platform use by Matt Mashyna

Empirisoft Corporation
28 West 27th, Fl 5
New York, NY  10001

For questions regarding modifications of this program please contact Kip Williams (see below).

Conceptual Design

Kipling D. Williams, Professor
Department of Psychological Sciences
Purdue University
West Lafayette, IN 47907-2004
(765) 494-0845 (office phone)
(765) 496-1264 (dept. fax) (email) (web page)

For References and other research related questions please contact Kip Williams at

Also, see Kip’s website at

The first publication using CyberBall was:

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.

Other publications using CyberBall include:

Zadro, L., Williams, K. D., & Richardson, R. (2004). How low can you go? Ostracism by a computer lowers belonging, control, self-esteem, and meaningful existence. Journal of Experimental Social Psychology, 40, 560-567.

Eisenberger, N. I., Lieberman, M. D., & Williams, K. D. (2003). Does rejection hurt? An fMRI study of social exclusion. Science, 302, 290-292.  (for more on this, see

We’d like to thank Christopher K. T. Cheung for the original development of CyberBall, an online ostracism paradigm, Wilma Choi for her Cyberboy artwork and additional advancements, and Keith Lim for even further developments. We would also like to thank Cassie Govan, Trevor Case, and Lisa Zadro for their insightful comments and advice.