The diminishing returns of distance: Computational analysis of approach-avoidance behavior under threat of predation
Data files
Aug 21, 2026 version files 3.02 MB
-
Prepare_wolf_data.R
30.51 KB
-
README.md
5.69 KB
-
Wolf_analysis.R
22.24 KB
-
Wolf_behavior.csv
1.43 MB
-
Wolf_game_level.csv
28.53 KB
-
Wolf_inverse_power_law.stan
2.87 KB
-
Wolf_linear.stan
2.73 KB
-
Wolf_subject_level.csv
1.09 KB
-
WOLF_task.zip
1.49 MB
Abstract
Foraging under threat of predation is a paradigmatic scenario involving the interplay between approach and avoidance motivation across species. Previous foraging paradigms in humans have revealed aspects of approach-avoidance behavior and its neural underpinnings, but have generally involved simple choices such as a binary decision to stay or flee. Here, we present results from 40 adult participants who completed the Weighing Opportunity and Loss in Foraging (WOLF) task, a novel two-dimensional foraging context with threat of predation in which participants choose from five possible actions at each turn. We fit computational models in which choices depend on the subjective utility of each option, which itself depends on approach motivation (resource richness) and avoidance motivation (predator distance). Model comparison revealed that an inverse power law model, in which the marginal subjective utility of additional distance from the wolf diminished with wolf distance, outperformed a linear model. Model parameters explained more than 75% of the variance in task performance, mediated by the average resource richness of choices (for the approach-related parameter) and the number of deaths on the task (for the avoidance-related parameters). An exploratory analysis found that self-reported anxious arousal was associated with a more linear relationship between wolf distance and avoidance motivation. The results demonstrate that a behaviorally rich foraging paradigm in which participants select from multiple options at each turn can enable explicit modeling of subjective utilities in the interplay between approach and avoidance motivation. Future work can examine neural underpinnings of complex approach-avoidance behavior and their alteration in mental health disorders.
Dataset DOI: 10.5061/dryad.jq2bvq8mm
Description of the data and file structure
Files and variables
File: Wolf_subject_level.csv
Description: Subject-level task and questionnaire measures.
Variables
- subject: Subject ID
- total: Total score on the task
- deaths: Total number of deaths on the task
- masq_GDA: Mood and Anxiety Symptom Questionnaire, General Distress-Anxiety subscale score
- masq_AA: Mood and Anxiety Symptom Questionnaire, Anxious Arousal subscale score
- masq_GDD: Mood and Anxiety Symptom Questionnaire, General Distress-Depression subscale score
- masq_AD: Mood and Anxiety Symptom Questionnaire, Anhedonic Depression subscale score
File: Wolf_game_level.csv
Description: Game-level task measures, with one row per subject and game.
Variables
- subject: Subject ID
- game_id: Game condition identifier
- game_order: Order in which the game was presented to the participant
- hunt: Wolf directional-weighting parameter (
HuntingRatio; higher values produce stronger movement bias toward the player when the wolf is moving) - wolf_move: Wolf movement distance per turn (0 indicates a stationary wolf)
- game_score: Final score for the game
- mean_field_richness: Mean field value associated with the participant's recorded action across turns for which that action had an available destination; larger values indicate richer fields
- mean_wolf_distance: Mean farmer–wolf Manhattan distance during the game, in task coordinate units
- n_turns: Number of recorded turns in the game
- death: Indicator that the participant was captured by the wolf (0 = no, 1 = yes)
File: Wolf_behavior.csv
Description: Turn-level task data, with one row per recorded turn.
Variables
- subject: Subject ID
- game_id: Game condition identifier
- game_order: Order in which the game was presented to the participant
- turn_in_game: Sequential turn number within the game
- hunt: Wolf directional-weighting parameter (
HuntingRatio; higher values produce stronger movement bias toward the player when the wolf is moving) - rt: Response time in seconds (NA indicates no recorded response)
- wolf: Wolf position (numbered 1–25 on the 5 × 5 grid, counting by rows)
- farmer: Farmer position
- center: Candidate position if the participant does not move
- up: Candidate position if the participant moves up (NA indicates that movement is unavailable)
- down: Candidate position if the participant moves down (NA indicates that movement is unavailable)
- left: Candidate position if the participant moves left (NA indicates that movement is unavailable)
- right: Candidate position if the participant moves right (NA indicates that movement is unavailable)
- center_val: Field richness if the participant does not move
- up_val: Field richness if the participant moves up (NA indicates that movement is unavailable)
- down_val: Field richness if the participant moves down (NA indicates that movement is unavailable)
- left_val: Field richness if the participant moves left (NA indicates that movement is unavailable)
- right_val: Field richness if the participant moves right (NA indicates that movement is unavailable)
- center_wolf: Manhattan distance from the wolf, in grid steps, if the participant does not move
- up_wolf: Manhattan distance from the wolf, in grid steps, if the participant moves up (NA indicates that movement is unavailable)
- down_wolf: Manhattan distance from the wolf, in grid steps, if the participant moves down (NA indicates that movement is unavailable)
- left_wolf: Manhattan distance from the wolf, in grid steps, if the participant moves left (NA indicates that movement is unavailable)
- right_wolf: Manhattan distance from the wolf, in grid steps, if the participant moves right (NA indicates that movement is unavailable)
- mov: Choice made by the participant
Larger values of the *_val variables indicate richer fields.
File: WOLF_task.zip
Description:
PsychoPy task implementation and associated configuration and image files used to administer the WOLF task in the original study. See WOLF_task/README.md inside the archive for installation, task mechanics, configuration details, and output documentation.
File: Wolf_inverse_power_law.stan
Description:
Stan code for the inverse-power-law model, in which the wolf-distance contribution to subjective utility follows an inverse power law.
File: Wolf_linear.stan
Description:
Stan code for the linear model, in which the wolf-distance contribution to subjective utility is linear in distance.
File: Wolf_analysis.R
Description:
R code for analysis of WOLF data, including running Stan models, linear regression models, mediation models, and simulations.
File: Prepare_wolf_data.R
Description:
R code for processing the raw PsychoPy output files from the WOLF task. It generates:
Wolf_behavior.csv, a turn-level dataset containing observed choices, candidate destination locations, field values, and wolf distances;Wolf_game_level.csv, a game-level dataset containing game condition, score, mean selected-field richness, mean wolf distance, number of recorded turns, and capture status;Wolf_task_subject_summary.csv, a subject-level dataset containing total task points and number of deaths.
Human subjects data
Data has been de-identified by using coded study identifiers rather than personally identifiable identifiers. Participants provided written consent to participate in the study.
Participants
Forty participants (n = 19 women) from the San Diego area completed the WOLF task (Mean age = 27.9, SD = 10.69; range = 18-58; 37.5% Asian, 45% White, 2.5% multiracial, 15% prefer not to say/other; 25% Hispanic, 75% not Hispanic; Mean years of education = 15.725, SD = 2.85). In addition to performing the experimental task (described below), participants completed the Mood and Anxiety Symptom Questionnaire (MASQ), an assessment of affect with anxiety-specific, depression specific, and shared symptom factors. Informed consent was obtained from all participants prior to participating and participants were monetarily compensated for their time. The institutional review board of the University of California San Diego approved all study procedures.
WOLF Task
The interactive task was displayed using PsychoPy on a desktop PC where participants controlled a farmer icon within a 5×5 grid of resource fields with the arrow keys on a keyboard. Each field was represented by a circle that varied in color from green to yellow, indicating the resource availability at that location. The objective of the task was to maximize harvested resources while avoiding a wolf, represented by a separate icon that moved concurrently with the farmer.
At the start of each game, the farmer started at the middle of the screen. Each turn lasted one second, during which the participant selected one of five possible actions: remain stationary or move up, down, left, or right. The fields were harvested automatically at the end of each decision. Harvesting was denoted in real-time by a change in field color at the end of each decision (i.e., change from green to yellow), decreasing in value by 30% per decision until depletion. The initial configuration of the field varied across 18 games, each comprising up to 25 turns. Some games began with all fields in a fully green, high-resource state, while others presented spatially structured distributions, with one region of the grid containing higher-value fields and another region containing lower-value fields in a gradient reduction (see Fig. 1).
A wolf was also present in each game placed at a random corner. The wolf moved simultaneously with the farmer according to one of three predetermined behavioral patterns. In random movement games (8 games), the wolf selected a movement direction at equal probability from the four cardinal directions. In stationary trials (2 games), the wolf remained in its starting location throughout the game. In high-predation trials (8 games), the wolf exhibited behavior biased toward the farmer’s location. This was achieved using a weighted probability mechanism, wherein movement options that reduced the distance between the wolf and the farmer were included in the selection pool 50 times, while all other movement options were included only once. A movement direction was then selected randomly from this weighted distribution, increasing the likelihood that the wolf would approach the farmer.
Participants accumulated points based on the total value of harvested resources. However, if the farmer and the wolf occupied the same field at any time, the game resulted in farmer’s “death” and terminated immediately, and the participant forfeited all points accrued during that game. The next game then began with a new field configuration. This task structure required participants to balance resource maximization with predator avoidance.
