Skip to content

PanicRoom

Virtual Reality Human Fear Conditioning Paradigm

Download Latest Version

Built with WorldViz Vizard 8 + SightLab VR

Author: Aleksandar Dimov, BIOPAC Systems Inc. 2026

1. Overview

PanicRoom is a fully scripted virtual reality template for human Pavlovian fear conditioning research. It was developed as a starting point for researchers who want to use immersive VR to study associative threat learning, fear acquisition, and extinction, all within a tightly controlled laboratory paradigm.

Participants are seated in a sparsely furnished virtual room and observe two colored doors, blue and red, presented one at a time across three experimental phases. The blue door serves as the conditioned stimulus (CS+), and on the majority of acquisition trials it is paired with an aversive unconditioned stimulus (US): a virtual monster that leaps through the open door accompanied by a 100 dB female scream. The red door is never paired with the US. Through repeated exposure, participants learn to associate the blue door with threat, and that learned fear is then measured and subsequently extinguished in later phases.

The paradigm dissociates explicit subjective fear ratings from implicit psychophysiological indices of conditioned fear and has been validated in a sample of 84 healthy adults (Lucifora et al., 2024).

The template runs inside the Vizard / SightLab VR development environment and is implemented as a single Python script, panicroom.py. All timing, trial sequencing, stimulus presentation, audio, BIOPAC marker emission, and a researcher-facing operator GUI are handled within this one file. Researchers can adapt the paradigm to their needs primarily by editing the CONFIG dictionary at the top of the script.

2. Task Design

Conceptual Framework

PanicRoom implements a classic differential fear conditioning paradigm. Two conditioned stimuli (CS+ and CS-) are used so that any psychophysiological or subjective difference between them at the end of acquisition must arise from the learning history rather than from general arousal, familiarity, or the physical properties of the stimulus. The 80% partial reinforcement schedule, eight of ten CS+ trials reinforced during acquisition, is intentional: partial reinforcement produces more resistant fear memories, closer to real-world threat learning, and avoids a ceiling effect in physiological responding.

Phase Structure

The experiment is organized into three sequential phases, each launched manually by the researcher from a desktop GUI. Trial order within every phase is fully randomized on each run.

Phase CS+ Trials CS- Trials Reinforcement Duration
1. Habituation 4 4 0% (none) ~4 min
2. Acquisition 10 10 80% (8 of 10 CS+ reinforced) ~5 min
Break - - Participant exits VR 5 min
3. Extinction 10 10 0% (none) ~5 min
Optional 24 h Recall 10 10 0% (none) ~10 min (day 2)

Trial Timeline

Every trial, regardless of phase, follows the same fixed 15-second structure:

  • 0-9 s - Closed-door presentation: The CS door, blue or red, appears closed. This is the critical window for SCR measurement.
  • 9-12 s - Open-door window: The door rotates open with a realistic swing animation, 90 degrees over approximately 1.2 s. On reinforced CS+ trials, the monster appears immediately at t = 9 s, looms for 2 s, then leaps toward the participant over the final 1 s, accompanied by a 100 dB scream.
  • 12-15 s - Inter-trial interval (ITI): All CS doors are hidden. The neutral door, if present in the scene, is shown briefly as a placeholder, then also hidden before the next trial begins.

Stimuli

  • CS+ (blue door): A blue-colored door in the virtual room. During acquisition, paired with the US on 80% of trials.
  • CS- (red door): A red-colored door. Never paired with the US.
  • US - Monster: A virtual monster, smily_horror_monster.osgb, loaded as a Vizard avatar, positioned in the doorway, playing an idle/loom animation for 2 s before leaping 4.5 m toward the participant's viewpoint over 1 s.
  • US - Scream: A mono WAV file, scream.wav, played as 3D audio attached to the monster object so that it spatializes correctly as the monster leaps. Engine volume is set to 1.0; the absolute 100 dB SPL level must be verified with a sound-level meter on the headphones before each session.

Participant Instructions

A single instruction screen is displayed inside the HMD at the start of the experiment. Participants are told to look at the doors as they appear and open, that no button presses are required, that they may stop at any time, and that they will be asked to rate the doors at the end of each session. Ratings are collected once per phase, not per trial, to avoid disrupting the psychophysiological signal.

3. Parameters the Researcher Can Control

All experimenter-facing parameters are declared in the CONFIG dictionary at the top of panicroom.py. Parameters marked [P] are part of the validated paradigm; changing them deviates from Lucifora et al. (2024).

Parameter Default Description
CS_CLOSED_DURATION 9.0 s [P] Duration of the closed-door CS presentation window. Also determines the SCR scoring epoch.
CS_OPEN_DURATION 3.0 s [P] Duration of the open-door window, equal to the total US duration on reinforced trials.
ITI_DURATION 3.0 s [P] Inter-trial interval. Doors hidden during this period.
DOOR_OPEN_ANGLE_DEG 90 degrees How far the door swings open. Visual/aesthetic only.
DOOR_OPEN_DURATION 1.2 s Time for the door swing animation. Must be less than or equal to CS_OPEN_DURATION.
US_LOOM_DURATION 2.0 s [P] Time the monster is visible but stationary in the doorway before leaping.
US_LEAP_DURATION 1.0 s [P] Duration of the monster's leap toward the participant.
US_LEAP_OFFSET [0, 0, 4.5] m Translation applied during the leap, XYZ in world-space meters.
SCREAM_VOLUME 1.0 Engine-side playback volume, from 0.0 to 1.0. Absolute SPL is set at hardware.
SCREAM_FILE Resources\media\scream.wav Path to the US audio file.
HAB_CSPLUS_TRIALS 4 [P] Number of CS+ trials in the Habituation phase.
HAB_CSMINUS_TRIALS 4 [P] Number of CS- trials in the Habituation phase.
ACQ_CSPLUS_TRIALS 10 [P] Number of CS+ trials in the Acquisition phase.
ACQ_CSMINUS_TRIALS 10 [P] Number of CS- trials in the Acquisition phase.
ACQ_REINFORCE_RATE 0.8 [P] Proportion of CS+ trials reinforced, 80% partial reinforcement.
EXT_CSPLUS_TRIALS 10 [P] Number of CS+ trials in the Extinction phase.
EXT_CSMINUS_TRIALS 10 [P] Number of CS- trials in the Extinction phase.
HAB_TO_ACQ_PAUSE 60 s [P] Reference pause between Habituation and Acquisition.
ACQ_TO_EXT_BREAK 300 s [P] Reference break between Acquisition and Extinction.
FSR_SCALE_MIN 1 [P] Lower anchor of the post-session fear rating scale.
FSR_SCALE_MAX 10 [P] Upper anchor of the post-session fear rating scale.
BIOPAC_ENABLED False Set True to activate BIOPAC marker sending via SightLab.

[P] = validated protocol parameter (Lucifora et al., 2024).

Runtime Controls (Researcher GUI)

The researcher operates the experiment from a desktop overlay panel, not visible in the HMD. It provides:

  • Habituation / Acquisition / Extinction buttons: Launch the corresponding phase. A re-entry guard prevents accidental double-press while a phase is running.
  • Emergency STOP button: Immediately flushes the log and quits the Vizard simulation. Use in case of participant distress.

Suggestions for Future Expandable Parameters

Counterbalancing of Stimulus Color

Currently the blue door is always the CS+ and the red door is always the CS-, following the original publication. A counterbalancing flag, such as SWAP_CS_COLOUR = False, would randomize or explicitly assign color-to-CS+ mapping across participants, which is recommended for replications and multi-site studies.

US Intensity Control

The US leap offset, US_LEAP_OFFSET, and loom time, US_LOOM_DURATION, could be parameterized as levels such as MILD, MODERATE, or STRONG to enable within-person or between-group US intensity manipulations. This is useful for studying fear acquisition thresholds or individual differences in threat sensitivity.

Contextual Cues

The current implementation uses a fixed virtual room. Adding a CONTEXT parameter to select between two or more room environments, such as room_A.osgb and room_B.osgb, would enable context-dependent fear renewal protocols (ABA, ABC, AAB renewal), which are of major interest in translational extinction research.

CS Duration Jitter

Adding optional Gaussian jitter around CS_CLOSED_DURATION, such as CS_JITTER_SD = 0.0, would reduce temporal predictability of the US. This manipulation is known to influence expectancy-based fear responding and is common in more advanced conditioning paradigms.

Discrimination Training Parameters

The CS+/CS- ratio is fixed at 1:1. Exposing NUM_CSPLUS and NUM_CSMINUS as independent parameters, already partially done, would allow exploration of unequal ratios relevant to generalization and discrimination paradigms.

Optional 24-Hour Recall Session

The design brief describes an optional recall session run 24 hours later. A RECALL_ENABLED flag and associated trial counts, RECALL_CSPLUS_TRIALS and RECALL_CSMINUS_TRIALS, could activate a fourth phase, enabling fear memory consolidation studies without any code modifications.

4. Outcome Measures

Primary Outcomes

Skin Conductance Response (SCR)

The key psychophysiological index. Computed per trial as peak skin conductance during the 9-second closed-door CS window minus mean conductance during the 2-second baseline immediately preceding CS onset. Values are square-root transformed before analysis to normalize the distribution. The template supports BIOPAC integration by sending timestamped digital markers at every critical event. See section 5 for details.

Fear Stimulus Rating (FSR)

A 10-point Likert scale, from 1 = "not scary at all" to 10 = "extremely scary", is collected separately for the red and blue doors at the end of each phase. Ratings are collected inside the HMD using SightLab's built-in rating-scale interface and logged automatically. This constitutes the explicit measure of conditioned fear.

Measure Type Timing Scale Logged to
SCR (peak minus baseline) Implicit / physiological Per trial, offline from physio recording Microsiemens (microS) BIOPAC / external system
FSR - Blue door Explicit / subjective Once per phase, post-session 1-10 Likert panicroom_log.txt + SightLab summary
FSR - Red door Explicit / subjective Once per phase, post-session 1-10 Likert panicroom_log.txt + SightLab summary

Event Log

Every experiment event is written to panicroom_log.txt in the working directory, formatted as hh:mm:ss.ms EVENT_TAG [optional value]. This plain-text log enables offline alignment of subjective and physiological data even when no BIOPAC is connected. Key tags include:

  • TRIAL_START_CSP_US: Onset of a reinforced CS+ trial.
  • TRIAL_START_CSP: Onset of an unreinforced CS+ trial.
  • TRIAL_START_CSM: Onset of a CS- trial.
  • DOOR_OPEN_CSP / DOOR_OPEN_CSM: Moment the door begins to open.
  • US_ONSET: Monster becomes visible, start of SCR scoring epoch for US.
  • US_LEAP: Monster begins leap, final 1 s of US.
  • TRIAL_END: End of open-door window / start of ITI.
  • RATING_CSP / RATING_CSM: Participant's subjective fear rating for each door.
  • PHASE_START_* / PHASE_END_*: Phase-level markers for segmenting the log file.

Suggestions for Augmenting Outcome Measures

  • Trial-level expectancy ratings
  • Heart rate / cardiac deceleration
  • Eye tracking / gaze dwell time / pupil dilation
  • Startle potentiation
  • Respiration rate
  • Ecological momentary assessment (EMA) of fear memory

5. Physiological Measurements

PanicRoom was designed from the outset with psychophysiological recording in mind. The template supports BIOPAC integration directly, but all events are also written to the plain-text log, which can be used to synchronize any recording system.

BIOPAC Integration

Set BIOPAC_ENABLED = True in the CONFIG block and enable the BIOPAC Markers checkbox in the SightLab GUI. The script then sends named global events to AcqKnowledge at five key time points per trial:

Marker Code Tag Name Event
1 CS_MINUS_ONSET CS- trial start, closed-door onset
2 CS_PLUS_ONSET_REINFORCED / CS_PLUS_ONSET_UNREINFORCED CS+ trial start
3 US_ONSET Monster becomes visible, loom begins
4 US_LEAP Monster begins leap, final 1 s
5 TRIAL_END End of open-door window / ITI begins

Skin Conductance (EDA)

  • Recommended replication: BIOPAC EDA100C amplifier with TSD203 Ag/AgCl electrodes, or LEAD110A + EL507A and GEL101A, recorded at 2000 Hz; EDA100D with BN-EDA-LEAD2 and EL507A and GEL101A.
  • Electrode placement: Middle and index fingers of the non-dominant hand, or as per your site SOP. Use Velcro straps rather than adhesive for ease of removal.
  • SCR scoring window: Peak conductance during the 9 s CS closed-door epoch minus mean conductance during the 2 s baseline immediately preceding CS onset. Square-root transform before analysis.

Audio calibration

The scream must be set to 100 dB SPL at the headphone output. Verify with a calibrated sound-level meter before every session. The engine-side SCREAM_VOLUME parameter, default 1.0, controls only the digital playback level; it does not guarantee 100 dB SPL at the ear without hardware calibration.

  • Extract CS onset markers, codes 1 and 2, from the log or AcqKnowledge file.
  • Define epochs: baseline = 2 s pre-CS onset; response window = 0-9 s post-CS onset.
  • Compute peak-minus-baseline SCR per trial; square-root transform.
  • Average within Phase x Stimulus cells, including CS+ reinforced, CS+ unreinforced, and CS-.
  • Test the Phase x Stimulus interaction, using mixed ANOVA, for conditioning and extinction effects.

6. Notes, Tips, and Advice

Setup Checklist

  • Audio calibration: Always verify 100 dB SPL at the headphone output with a sound-level meter before each participant. A 6 dB error, half the voltage, dramatically changes arousal and SCR amplitude.
  • Hearing screening: Given the 100 dB scream, pre-screen participants for hearing sensitivity and include an explicit "you may stop at any time" clause in the consent form.
  • EDA electrode preparation: Clean the skin with alcohol and allow at least 10 minutes for isotonic contact gel to stabilize before recording. Instruct participants to remain still during trials.
  • Baseline recording: Record at least 5 minutes of resting EDA before the experiment to assess baseline skin conductance level (SCL) and identify non-responders.
  • Eye adaptation: Allow the participant 1-2 minutes in the VR environment before starting the instruction screen to reduce initial novelty arousal.

Phase pauses

The 60-second pause between Habituation and Acquisition, HAB_TO_ACQ_PAUSE, and the 5-minute break between Acquisition and Extinction, ACQ_TO_EXT_BREAK, are critical for physiology. Use these intervals to check electrode impedance, ask the participant how they are feeling, and check data quality in AcqKnowledge before proceeding.

One Phase Per Script Run

The current implementation is designed for one phase per script execution: once a phase button is pressed and the phase completes with ratings, the operator phase panel is hidden and the script does not allow re-launching. To run the next phase, such as moving from Habituation to Acquisition on the same day or running Extinction after the break, restart the Vizard script. This is intentional: it prevents accidental double-running of phases and forces the researcher to confirm the transition.

Trial Randomization

Trial order is re-randomized on each script run using Python's random.shuffle(). The 80% partial reinforcement schedule is implemented by randomly selecting 8 of the 10 CS+ trials as reinforced at the start of each acquisition run. This means the exact pattern of reinforced versus unreinforced CS+ trials will differ across participants, which is correct for the partial reinforcement protocol.

Monster Animation

The monster, USobject, is loaded as a Vizard avatar using vizfx.addAvatar() to support armature animation playback with state(1). The embedded USobject child in room.osgb is hidden and replaced by this avatar. If the avatar file, smily_horror_monster.osgb, cannot be found, the script falls back to the embedded child, which will not animate but will still translate during the leap. Always verify that the monster file path is correct relative to the script location.

BIOPAC Troubleshooting

  • Markers not appearing in AcqKnowledge: Confirm that the BIOPAC Markers checkbox is enabled in the SightLab settings panel, that BIOPAC_ENABLED is set to True in CONFIG, and that the BIOPAC hardware is connected and AcqKnowledge is in recording mode before starting the VR script.
  • biopacFlag off warning in console: This means SightLab detected no BIOPAC connection. Check the USB/network cable and AcqKnowledge server settings.
  • Marker timing offset: BIOPAC global events are network-transmitted. A small jitter, typically less than 10 ms, is expected. Use panicroom_log.txt as the ground truth if sub-10 ms accuracy is needed.

Ethics

The paradigm uses no electric shock or pain stimulus, which simplifies ethical approval in most jurisdictions. However, the 100 dB scream, combined with an immersive monster encounter in VR, can provoke genuine fear and distress. Ensure your consent form clearly describes the aversive nature of the task and that participants are repeatedly reminded they may stop at any time. The emergency STOP button is positioned for immediate access.

7. Relevant References and Publications

Primary Reference

Lucifora, C., Gangemi, A., D'Italia, G., Culicetto, L., Ferraioli, F., Grasso, G. M., & Vicario, C. M. (2024). PanicRoom: a virtual reality-based Pavlovian fear conditioning paradigm. Frontiers in Psychology, 15, 1432141. https://doi.org/10.3389/fpsyg.2024.1432141

This is the validation paper for the PanicRoom paradigm. It describes the full protocol, participant sample (N = 84 healthy adults), SCR and FSR outcomes, and discusses the dissociation between explicit and implicit fear indices.

Background and Theoretical Context

Bouton, M. E. (2004). Context and behavioral processes in extinction. Learning & Memory, 11(5), 485-494.

Craske, M. G., Hermans, D., & Vansteenwegen, D. (Eds.). (2006). Fear and Learning: From Basic Processes to Clinical Implications. American Psychological Association.

Lonsdorf, T. B., Menz, M. M., Andreatta, M., Fullana, M. A., Golkar, A., Haaker, J., ... & Merz, C. J. (2017). Don't fear 'fear conditioning': Methodological considerations for the design and analysis of studies on human fear acquisition, extinction, and return of fear. Neuroscience & Biobehavioral Reviews, 77, 247-285.

Pittig, A., Schulz, A., Craske, M. G., & Alpers, G. W. (2014). Acquisition of behavioral avoidance: Task-irrelevant conditioned stimuli trigger costly decisions. Journal of Abnormal Psychology, 123(2), 369.

VR in Fear Conditioning

Dibbets, P., Poort, H., & Arntz, A. (2012). Reinstatement of fear responses after a virtual reality extinction procedure. Cognition & Emotion, 26(1), 35-50.

Meyerbröker, K., & Emmelkamp, P. M. G. (2010). Virtual reality exposure therapy in anxiety disorders: A systematic review of process-and-outcome studies. Depression and Anxiety, 27(10), 933-944.

Document generated from panicroom.py and Design_brief_Human_Fear_Conditioning_Paradigm.md.