Spaceships and Aliens | Mount Sinai Hospital
Description
The Spaceships and Aliens Game is a game developed in JavaScript (TypeScript).
Link: https://spaceships-aliens.vercel.app
Code: https://github.com/emberlzhang/task_spaceships-aliens_twostep
Purpose
The Spaceships and Aliens game is an online behavioral task designed for the Center for Computational Psychiatry at Mount Sinai Hospital to differentiate between clinical populations with obsessive compulsive disorder (OCD) and healthy control (HC) populations. The task is inspired by the classic “two-stage” task paradigm in cognitive behavioral research.
Gameplay Overview
The player plays rounds of two repeating choices followed in succession:
Choice 1: Pick a space rocket to fly to outer space.
Choice 2: Pick an alien trader.
After making these two choices, the player receives a valuable gem (worth 100 points), or dirt (worth zero points). The probability of receiving a gem or dirt depends on the user’s choice of spaceship and alien trader.
Features
Probabalistic Game Logic
In Stage 1 of the game, the user’s choice of rocket determine which of the two planets they land on.

In Stage 2 of the game, the resulting planet determines which two alien traders the user can choose to trade with. Subsequently, the user’s choice of alien trader will determine, probabilistically, whether they receive a gem or dirt.

Over time, the player may notice certain combinations of rocketship / alien trader choices yield more favorable outcomes, and will thus select those choices.
Changing Probabilities Over Time
Over the course of the game, the gem probabilities associated with the aliens will fluctuate across trials for each of the four aliens, thus yielding different combinations for a favorable outcome. The user is encouraged to adapt, but not all users do.
This ability (or lack thereof) to adapt to changing circumstances in the game over time is of great research interest, particularly with regard to compulsive behavior disorders.
Automatic, Local Data Download
For the purposes of satisfying this application’s main use case, rather than saving user data to a standard relational database such as MySQL or PostgresQL, the application saves the game locally to the user’s computer.
This feature was developed for a specific research use case (e.g. research assistants prompting participants to play the game during on-site research sessions conducted in locations with limited internet access, such as an underground fMRI scanner room).
The data automatically saves when the program is closed or the tab/window is exited, regardless of whether the task is completed. This ensures that data is preserved during interrupted user sessions as well as during testing.
Significance to End User
The game tracks the player’s preference towards task perseveration vs. context switching, with the expectation of higher task perseveration for compulsive behavior populations relative to healthy control populations.
Player behavior and preferences are mapped to Bayesian inference models to discern group-level differences between HC populations and clinical behavioral compulsion groups.