Return to the Prisoner's Dilemma Task with Reciprocity page
							Prisoner Dilemma Game - Reciprocity Design

Script Author: Katja Borchert, Ph.D. ( for Millisecond Software, LLC
Date: 01-04-2018
last updated: 01-08-2018 by K.Borchert ( for Millisecond Software LLC

Script Copyright © 01-08-2018 Millisecond Software


This script implements a Prisoner Dilemma Game within a reciprocity design similar to the one 
described by:

Bell R, Mieth L, Buchner A (2017). Separating conditional and unconditional cooperation in a 
sequential Prisoner's Dilemma game. PLoS ONE 12(11): e0187952. https://doi.

Participants play an investment prisoner dilemma game. Each round they are coupled with a 
different partner (introduced via images) and have to decide to invest money into a shared
fund or not. For each investment/cooperation decision, the computer adds a certain amount of money to 
the fund (e.g. if participant decides to cooperate and invests money, the computer adds money.
If the partner decides to invest money, the computer adds additional money.). At the end of each
round the money in the shared fund gets equally divided between the two people.
a) Partner cooperates-participant does not: participant makes net gain
b) Mutual cooperation: participant makes a net gain (as high as the incentive amount provided by computer)
c) Mutual non-cooperation: participant neither wins nor loses any money
d) Participant cooperates-partner does not: participant makes a net loss

The game is divided into two phases:
1. Exposure phase: During the exposure phase, participants get to know their different partners via their images
2. Test phase: During the test phase, participants are again coupled with the same partners as well
as a couple of new ones.

The default data stored in the data files are:

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

build:							Inquisit build
computer.platform:				the platform the script was run on
date, time, subject, group:		date and time script was run with the current subject/groupnumber 
blockcode, blocknum:			the name and number of the current block
trialcode, trialnum: 			the name and number of the currently recorded trial
									(Note: not all trials that are run might record data; by default data is collected unless /recorddata = false is set for a particular trial/block) 
stimulusitem:					the presented stimuli in order of trial presentation
response:						the participant's response
correct:						accuracy of response: 1 = correct response; 0 = otherwise
latency: 						the response latency (in ms); measured from:

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

script.startdate:				date script was run
script.starttime:				time script was started
script.subjectid:				subject id number
script.groupid:					group id number
script.elapsedtime:				time it took to run script (in ms)
computer.platform:				the platform the script was run on
/completed:						0 = script was not completed (prematurely aborted); 1 = script was completed (all conditions run)

* separate data files: to change to one data file for all participants (on Inquisit Lab only), go to section
"DATA" and follow further instructions


1. Exposure Phase:
- 24 trials: participant plays the game with 12 female partners (6 look angry, 6 look happy) and 12 male partners
(6 look angry, 6 look happy)
- by default, the computer assigns to each partner image its investment decision (cooperation vs. non-cooperation)
(the number of cooperation and non-cooperation 'decisions' is balanced across genders and facial expressions;
the assignment is randomly done for each participant)
- the order of the images is selected at random for each participant
- by default, participant is forced to cooperate during the first round

2. Test Phase:
- 36 trials: participants play the game with the 24 exposure-phase partners and 12 new ones 
(6 females: 3 happy, 3 angry; 6 males: 3 happy and 3 angry)
- the order of the images is selected at random for each participant
- by default, the investment decision of the partners is decided randomly by the computer
- by default, participant is forced to cooperate during the first round

Trial Sequence:
- presentation of current start balance (5000ms)
- presentation of current partner image and the cooperation question (until response)
- decision delay (1000ms)
- participant decision feedback (1000ms)
- partner decision delay (5000ms)
- partner decision feedback (5000ms)
- presentation of gain/loss outcome (5000ms)
- presentation of end balance (5000ms)

Round Duration (default settings): 27s + response time

provided by Millisecond Software - can be edited under section Editable Stimuli

provided by Millisecond Software - can be edited under section Editable Instructions

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:

/computerStrategy:				the strategy the computer uses to make its choice.
								If parameters.reciprocityDesign is set to 'true', the selected strategy is overwritten
								and the assigned values.exposureComputerDecision is used instead during the exposure phase.
								Furthermore, some of these strategies may not make sense given the experimental design used.
								(e.g. 'tit-for-tat' only makes sense if the same partner is used repeatedly)
									1 = 'cooperation': selects the cooperative strategy X on every round									
									2 = 'competition': simply defects on every round of every game by choosing the non-cooperative strategy Y
									3 = 'random': selects randomly
									4 = 'tit-for-tat': cooperates on first round then mirrors the players choices from the previous rounds
									5 = 'tit-for-two-tats': computer cooperates until 2 defects in a row and does not cooperate again until player does
									6 = 'probabilistic': cooperates on first round, then selects the strategy that is most often used by player
									(Note: if player has selected the cooperative strategy exactly 50% of the time, computer selects cooperative strategy)

Copyright © Millisecond Software. All rights reserved.
Contact | Terms of Service | Security Statement | Employment