Skip to content

Repository files navigation

Bots Position Viewer

Part of the DIMS-network — see the DIMS Dashboard.

Interactive dashboard for exploring player movement data from the bots experiment — a study on human–bot detection in a two-player 2D grid game.

See deployed on huggingface Bots-viewer

Dataset preview


What the experiment is about

Pairs of participants played 30-second rounds on a 10×10 grid. After each round, each player rated whether they thought their partner was a human or a bot (1 = definitely human, 5 = definitely bot) and how much they felt they were doing something together (1 = not at all, 5 = very much).

The dataset contains 521 rounds with two players each, recorded at 10 Hz (300 ticks per round).


Files

PathPurpose
app.pyDash dashboard (run this)
rqa_analysis.pyRQA / cRQA computation module — designed to be modified
assets/data/positions.csvRaw movement data — 312 600 rows, 9 columns
assets/theme.cssDark-theme CSS overrides
notebooks/lab04_rqa.ipynbTutorial notebook the analysis follows
requirements.txtPython dependencies
DockerfileContainer build (Hugging Face Spaces deploy)

Dataset columns

ColumnDescription
playerRoundIdUnique ID for a player within a round
roundIdUnique round identifier
tickTimestep 0–299 (30 s at 10 Hz)
x, yPosition on the 10×10 grid
answerPlayer's perception of partner: 1 (human) – 5 (bot)
partners_answerPartner's same rating
togethernessFelt sense of doing something together: 1 (no) – 5 (yes)
partners_togethernessPartner's same rating

Setup

pip install -r requirements.txt

Note: PyRQA uses OpenCL for acceleration. On most machines it will fall back to CPU automatically. If you see OpenCL warnings, they are safe to ignore.


Running the dashboard

cd bots-viewer
python app.py # opens at http://localhost:8051
python app.py --port 8055

Dashboard tabs

TabShows
TrajectoryAnimated player circles on the grid (Play/Pause + scrubber). Toggle the Trail button to overlay full paths. When both players share a cell, they split left/right.
RQA — Player 1/2Recurrence plot (RP) for each player's x-coordinate + quantification metrics table
cRQA (cross)Cross-recurrence plot between both players + metrics table

The sidebar lets you switch between coordinate modes (x, y, x+y) and tune all RQA/cRQA parameters live.


Running the batch analysis script

Computes RQA and cRQA for every round and saves a CSV of metrics:

python rqa_analysis.py
# → writes rqa_metrics_all.csv next to this file
python rqa_analysis.py --csv /path/to/positions.csv --out /path/to/output.csv

Modifying the analysis (rqa_analysis.py)

All tunable parameters are in the DEFAULT PARAMETERS block at the top of the file:

# RQA (single player)RQA_EMBEDDING_DIM=1# phase-space embedding dimensionRQA_TIME_DELAY=1# lag between embedded dimensions (ticks)RQA_RADIUS=1.0# FixedRadius threshold — raise for more recurrences# cRQA (cross between two players)CRQA_EMBEDDING_DIM=3CRQA_TIME_DELAY=5CRQA_RADIUS=1.0# Coordinate mode: 'x', 'y', or 'xy'COORDINATE_MODE='x'

Aim for a recurrence rate between ~5% and ~20%. If RR is too low, increase the radius; if too high, decrease it.

For the 'xy' mode (2D positions), a radius of ~1.5 works well:

COORDINATE_MODE='xy'RQA_RADIUS=1.5CRQA_RADIUS=1.5

RQA metrics

MetricMeaning
RRRecurrence Rate — density of recurrent points
DETDeterminism — proportion of points on diagonal lines (predictability)
LAverage diagonal line length
L_maxLongest diagonal line
DIVDivergence — 1 / L_max (related to Lyapunov exponent)
L_entrShannon entropy of diagonal line lengths
LAMLaminarity — proportion of points on vertical lines (intermittency)
TTTrapping Time — average vertical line length
V_maxLongest vertical line
V_entrShannon entropy of vertical line lengths

Reference

Parameters follow the tutorial notebook lab04_rqa.ipynb (CPM II course, 2025).
PyRQA documentation: https://pypi.org/project/PyRQA/8.1.0/

About

Bots Position Viewer — Dash dashboard for trajectory + RQA/cRQA of a 2-player grid game (DIMS-network)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages