Skip to content

Street Walking Example

The Street Walking Example demonstrates how SightLab can be used to create an immersive single- or multi-user pedestrian study while simultaneously recording eye tracking, participant movement, traffic behavior, and experiment events.

The example is a useful starting point for studies involving:

  • Pedestrian attention and street-crossing behavior
  • Visual attention to vehicles, signs, pedestrians, and hazards
  • Traffic-density comparisons
  • Vehicle-speed manipulations
  • Spatial navigation and walking behavior
  • Multi-user pedestrian studies
  • Eye tracking and fixation analysis
  • Behavioral, survey, and demographic data collection

Overview

In this example, participants can physically or virtually move through a street environment while SightLab records their experience.

The supplied Street-Walking-Sample.py script:

  • Loads a looping city-ambience audio track (Resources/audio/City-Ambience.mp3) that plays for the duration of each trial.
  • Loads two vehicles, car1 and car3, from Resources/car_locations.osgb and registers each as a SightLab scene object with gaze tracking enabled.
  • Reads Resources/stim_file.csv once per trial (via StimReader) to decide how many of the two vehicles should be visible and moving.

Traffic can be disabled entirely by setting ADD_TRAFFIC = False at the top of the script, which is useful as a bare starting point for a study that doesn't need vehicles at all.

The same project folder also includes:

File Purpose
Street-Walking-Sample.py Single-user experiment (the script described above)
Street-Walking-Sample_Server.py / _Client.py Multi-user version using SightLab's server/client framework
Street-Walking-Sample_Replay.py Opens recorded sessions in Session Replay

Everything described further down this page — vehicle speed as a condition, weather, ratings, instructions, demographics — builds on this same base rather than being separate examples.


Running the Street Walking Study

The Street Walking Example uses the normal SightLab trial workflow: each trial loads a row of conditions, plays out, and is recorded.

The supplied Resources/stim_file.csv looks like this:

Trial number of vehicles starting point weather median fog
1 3 position1 day on off
2 1 position2 night off on
3 1 position3 day on off

Only the number of vehicles column is currently read by the sample script. The remaining columns are already present in the file as a starting point — starting point, weather, median, and fog can each be wired into the trial loop the same way vehicle count is, using StimReader.

These conditions can be stored alongside the participant's behavioral and eye-tracking data for later analysis.


SightLab trial configuration showing different street walking conditions


Traffic Conditions

The example supports manipulating the number of vehicles present during a trial.

car1 and car3 are loaded from Resources/car_locations.osgb and registered as gaze-tracked SightLab scene objects. At the start of each trial, the script reads that trial's number of vehicles entry from the stim file and makes 0, 1, or 2 vehicles visible accordingly.

Because the vehicles are registered scene objects, researchers can examine questions such as:

  • Did the participant look at the approaching vehicle?
  • How long did they look at it, and how many separate times?
  • At what point in the trial did they first notice it?
  • Where was the participant when the vehicle was observed?


Comparison of low-traffic and high-traffic street conditions


Vehicle Speed

In the base script, both vehicles move toward their destination at a fixed 10 m/s, set in the speeds list passed to moveVehicle1().

Speed can be turned into a trial condition the same way vehicle count is — by reading a vehicle speed column from the stim file and passing that value into moveVehicle1() instead of the hard-coded 10:

speeds = [currentEntry['vehicle speed']] * len(vehicles)

Once speed varies by trial, it can be stored and analyzed alongside gaze and movement data to ask questions such as:

  • Does increasing vehicle speed change when participants first look toward traffic?
  • Do participants spend longer looking at faster vehicles?
  • Does walking behavior — stopping, slowing, changing direction — shift as traffic speed increases?


Vehicle approaching a participant with speed information overlay


Environmental Conditions

stim_file.csv already reserves weather, median, and fog columns per trial, even though the base script only acts on number of vehicles today. The same StimReader pattern can drive weather effects, lighting, or road/median configuration, and any of these can be stored with the rest of the trial data:

Participant: P014
Trial: 4
Weather: night
Fog: on
Traffic_Count: 2

Map switching isn't part of the base script (the scene is loaded once at startup), but the same vizfx.addChild(...) call used to load the environment could be parameterized per condition if a study needs to compare multiple street layouts.


Weather, lighting, and road-condition variations available as experimental conditions


Audio

The example loads Resources/audio/City-Ambience.mp3 as a looping ambience track. It starts playing (audio.play() / audio.loop()) at the start of each trial and pauses at the end.

The same pattern can add other layers — traffic noise, horns, sirens, spoken instructions — either as a constant backdrop or as a trial-varying condition.


Street scene illustrating environmental and traffic audio


Eye Tracking and Visual Attention

Both vehicles are registered with sightlab.addSceneObject(name, vehicle, gaze=True), which is what makes them trackable as Regions/Objects of Interest for SightLab's gaze analysis. Any other object in the scene — crosswalks, signs, buildings — can be registered the same way to analyze attention toward it.

SightLab associates gaze behavior with these registered objects and Regions of Interest automatically.


Participant gaze ray intersecting an approaching vehicle


Participant Movement

SightLab records the participant's tracked movement through the environment, making it possible to reconstruct not only what someone looked at, but also where they were and how they moved while looking at it.

Recorded and derived measures include:

  • Walking path and position over time
  • Direction of travel and movement velocity
  • Stops, pauses, and turning behavior
  • Relationship between participant and vehicle position

This is particularly useful for pedestrian research because gaze and movement can be examined on the same timeline. For example:

A participant slows while approaching the curb, looks left toward a fast-moving vehicle, waits for the vehicle to pass, and then continues across the street.

SightLab's recorded data and Session Replay allow these events to be examined together.


Data Collection and Export

SightLab records experiment data that can be exported for additional analysis. The data pipeline can include several complementary files rather than only a single summary spreadsheet:

Raw Tracking Data

Frame-by-frame or sample-level information used to reconstruct the participant's session — head/user position and orientation, eye gaze, gaze intersection, tracked objects, and trial time.

Eye-Tracking Data

Depending on the eye tracker and configuration: gaze position/direction, gaze intersections, fixations, saccades, dwell behavior, and view counts.

Fixation Data

SightLab performs fixation/saccade analysis and generates fixation-specific timeline information — location, timing, duration, and sequence of visual attention.

Trial Timeline

A chronological representation of events during the trial, useful for relating:

Participant movement
        ↓
Vehicle approaches
        ↓
Participant fixation on vehicle
        ↓
Participant slows/stops
        ↓
Vehicle passes
        ↓
Participant continues walking

Experiment Summary

Aggregated metrics and custom experiment values, e.g.:

Participant_ID
Trial
Weather
Traffic_Count
Vehicle_Speed
Average_Walking_Speed
Rating

Replay Data

SightLab also saves the information necessary to reconstruct the session inside Session Replay.


Example SightLab CSV, timeline, fixation, and replay data files

The exported data can subsequently be analyzed using tools such as Python, R, MATLAB, Excel, SPSS, or custom research pipelines.


Session Replay

One of the major advantages of the Street Walking Example is that a session doesn't have to be understood only through spreadsheets — SightLab Session Replay reconstructs the participant's recorded session inside the original virtual environment, and researchers can move through the replay timeline to inspect gaze and movement spatially.


SightLab Session Replay showing participant, gaze, and street environment

Replay supports several visualization modes, which can be toggled and combined:

Walk Paths

Shows the participant's physical trajectory through the street environment in 3D, instead of examining only X/Y/Z values in a spreadsheet. This makes behaviors like curb hesitation, stepping toward the roadway and backing away, or route deviations immediately visible.

Scan Paths

Shows how visual attention moved through the scene over time — for example crosswalk → approaching car → traffic light → opposite sidewalk. This answers not just what was viewed, but in what order, which can reveal the strategies participants use to decide whether it's safe to cross.

Fixations

Visualizes calculated fixation locations in the environment, alongside fixation duration, sequence, and the object being fixated on — useful for examining a participant's visual decision-making process as they move through the scene.

Heatmaps

Aggregates visual attention into a heatmap over the scene, useful for quickly seeing whether participants are primarily looking at vehicles, checking the traffic signal, or scanning the roadway more broadly under different conditions.

Multiple Participants

Because SightLab Replay is also built for multi-user recordings, the same framework can show multiple participants' walk paths and gaze simultaneously — useful for pedestrian-to-pedestrian interaction, group navigation, or shared decision-making studies.


Multi-User Studies

The Street Walking workflow can natively use SightLab's server/client multi-user architecture via the included Street-Walking-Sample_Server.py and _Client.py.

These two scripts are intentionally minimal — they mirror the same trial-start/trial-end loop as the single-user script, relying on SightLab's server/client framework to keep participants synchronized. Traffic, audio, and gaze-registration logic from Street-Walking-Sample.py can be added to the client script the same way it's used in the single-user version.


Several participants walking through the same synchronized street environment

Possible applications include:

  • Two pedestrians deciding when to cross together
  • Social influence on crossing behavior
  • Pedestrian/driver experiments
  • Instructor and participant scenarios

Because this is built on SightLab's multi-user framework, the study can also take advantage of SightLab's other multi-user features, including avatars, synchronized trials, presentation control, and multi-user replay.


Participant Input: Ratings, Instructions & Demographics

None of the following are wired into the base Street Walking sample, but they're standard SightLab patterns that fit naturally into the same trial loop shown above.

Rating Scales

For example, after crossing the street:

yield sightlab.showRatings(
    "How safe did you feel crossing the street?",
    ratingScale=["1", "2", "3", "4", "5"],
    pauseTimer=True
)

Rating responses are saved with the participant's experiment data, and can answer questions like how safe or realistic a crossing felt, or how confident the participant was in their decision.

Instructions

SightLab's normal instruction system can display text such as:

Walk along the sidewalk. When you believe it is safe, cross the street and continue to the marked destination.

Instructions can be shown at the start of the experiment, before individual trials, between conditions, or before a questionnaire.

Demographics

SightLab examples demonstrate using input dialogs to collect demographic or questionnaire information and save it into the experiment summary — for example age, driving experience, walking frequency, or VR experience — so it can be combined with behavioral and eye-tracking measures during analysis.


Rating scale, instructions, and demographic input as displayed to the participant


Other SightLab Features

Because the Street Walking study is a normal SightLab experiment, it isn't limited to the functionality demonstrated in the base sample. Capabilities commonly relevant to pedestrian and traffic studies include:

  • Regions of Interest, dwell time, and view counts
  • Gaze-based interactions and object grabbing
  • Hand, foot, and face tracking; full-body avatars
  • Trial randomization and adaptive experiments
  • External data synchronization (e.g. Lab Streaming Layer, BIOPAC)
  • Screen recording and custom experiment events
  • Custom Python libraries and experiment logic

The full platform feature set is covered in the SightLab Documentation.


Example Research Questions

Visual Attention

  • When does a participant first notice an approaching vehicle?
  • Which objects receive the greatest fixation time?
  • Does visual search behavior change as vehicle speed increases?

Pedestrian Movement

  • Where does the participant stop before crossing, and how long do they hesitate?
  • Does their walking velocity change when a vehicle approaches?

Traffic

  • Does increasing traffic density affect crossing decisions?
  • How does vehicle speed affect visual attention?

Environmental Conditions

  • Does night or fog alter walking speed or fixation duration?

Multi-User Behavior

  • Does another pedestrian influence crossing behavior?
  • Where do users look during social interaction?

Example Study Workflow

A complete Street Walking experiment could follow this workflow:

1. Collect participant information
            ↓
2. Show experiment instructions
            ↓
3. Load experimental condition
   • Traffic count
   • Vehicle speed
   • Weather
   • Audio
            ↓
4. Start SightLab recording
            ↓
5. Participant walks through street
            ↓
6. Record simultaneously
   • Eye tracking / fixations
   • Head/user movement and position
   • Traffic and vehicle behavior
   • Trial events
            ↓
7. End trial
            ↓
8. Present rating scale/questionnaire
            ↓
9. Continue to next condition
            ↓
10. Export experiment data
            ↓
11. Open Session Replay
            ↓
12. Analyze walk paths, scan paths, fixations, heatmaps, and trial summaries


Complete Street Walking experiment workflow from setup through replay and analysis


Related SightLab Documentation

For additional information, see the SightLab documentation:

  • SightLab Documentation: https://help.worldviz.com/sightlab/
  • Session Replay: https://help.worldviz.com/sightlab/session-replay/
  • Example Scripts: https://help.worldviz.com/sightlab/example-scripts/
  • Adding Instructions: https://help.worldviz.com/sightlab/adding-instructions/
  • Multi-User Custom Experiments: https://help.worldviz.com/sightlab/multi-user-custom-experiments/
  • Driving / Vehicle Examples: https://help.worldviz.com/sightlab/driving-example/

Summary

The Street Walking Example demonstrates how a pedestrian VR experiment can combine moving traffic, audio, eye tracking, participant movement, raw data collection, and interactive Session Replay in one research workflow, starting from a small, concrete base script.

The experiment can scale from a relatively simple single-user crossing study — as shipped — to a multi-condition or multi-user research platform by extending the same stim_file.csv / StimReader pattern already used for vehicle count.

After data collection, researchers can move beyond spreadsheets and reconstruct the participant's experience directly in the virtual environment: where they walked, where they looked, what they fixated on, and how those behaviors related to traffic and experimental conditions.