Unity implementation of Marco Wittman's Patch Foraging Task:
A reinforcement learning foraging task developed to elucidate switching behaviour (Leave Stay Decisions) as a function of time linked reward rates.
Click here to play online
Intended to be a portable-ish OS/ device agnostic version of this task; to allow diverse teams (clinical, academic) to collect data easily. This version also contains optional EEG streaming via LSL's (Lab Streaming Layer) custom Unity package, LSL4Unity.
Unity 2D Project; very basic entry-level C#.
Builds tested on for webGL, Mac, Windows & Linux (the EEG LSL stream has only been tested on Windows). As of Feb 2025; iOS/android not tested.
A functional web version is available for use (no EEG). Behavioural data can be downloaded by the user at the end of the task (and at set points throughout).
See here for full details on the actual task, programmatic implementation and data retrieval.
To build a version for use in your lab; Download Unity (& dependencies); download this repo & build.
There are executables bundled with the releases for Windows, Mac & Linux (& WebGL).
If you just want to run through the task, a web version is available here.
Unity 2022.3.16f1 (2D: URP)
LSL4Unity (Lab Streaming Layer as a Unity package)
Feel free to contact @i-brnrd on here or via University of Dundee.
Isla Barnard (developer)
Mihaela Lyustkanova (designed EEG integration)
Marco Wittman (original concept)
Tom Gilbertson (lead)
If you use this, please cite the original paper:
- Wittmann, M., Kolling, N., Akaishi, R. et al. Predictive decision making driven by multiple time-linked reward representations in the anterior cingulate cortex. Nat Commun 7, 12327 (2016). https://doi.org/10.1038/ncomms12327
Please also consider citing this repo (note the DOI resolves to the latest version:)
- Barnard, I., Lyutskanova, M., Wittmann, M., & Gilbertson, T. (2025). Patch-LSD, Zenodo. https://doi.org/10.5281/zenodo.14977005
To Marco Wittman for Predictive decision making driven by multiple time-linked reward representations in the anterior cingulate cortex
See here.