Skip to main content

Examples

Each example is a complete experiment in one HTML file, in the examples/ folder of the repository. Most use the local adapter, so you can play every part yourself from two or more tabs of one browser.

Running an example​

From a clone of the repository (see Before the release):

npm install && npm run build
npx http-server .

Open an example, for example http://localhost:8080/examples/chat-room.html. Then copy the whole address, including the ?mp_session=… the page added to it, into a second tab. Each tab is one participant.

To run an example with real participants on separate computers, change its adapter; see Choosing a backend.

Economic games​

ExampleWhat happensPlugins
Ultimatum gameOne player offers a split of $10; the other accepts or rejects it. Walked through step by step in the ultimatum game guide.sync, role
Ultimatum game on JATOSThe same game on a JATOS server. Only the backend differs.sync, role
Ultimatum game on FirebaseThe same game on Firebase, across devices. Only the backend differs.sync, role
Prisoner's dilemmaTwo players choose Cooperate or Defect at the same time, then see both choices and their payoffs.choice, sync
Pair up, then playA larger group is split into pairs, and each pair plays one round of the prisoner's dilemma.match, choice, sync
Public goods gamePlayers decide how much of an endowment to put into a shared pool, before a shared deadline.sync, countdown

Communication​

ExampleWhat happensPlugins
Chat roomParticipants choose a display name, wait in a lobby, then chat for a fixed time.chat, sync
Drawing togetherParticipants draw on one shared canvas for a timed round.draw, countdown, sync
Reference gameA director describes one abstract shape at a time over chat, and a matcher picks it out (Hawkins, Frank & Goodman, 2020).reference-game, role, sync
Reference game, full boardThe same plugin, set up so the matcher puts every shape in the director's order.reference-game, role, sync

Groups, votes and scores​

ExampleWhat happensPlugins
PollEveryone votes, then sees only the vote counts, not who voted for what.choice, sync
CountdownA timer that ends at the same moment on every screen.countdown, sync
ScoreboardEach player answers a short quiz, then everyone sees the final ranking at once.scoreboard, sync
Live scoreboardThe same quiz, with a ranking that updates as each player's score comes in.scoreboard, sync
Group quizA classroom quiz game: one host screen runs the questions, and players answer on their phones against the clock. Runs on JATOS.sync

References​

Hawkins, R. D., Frank, M. C., & Goodman, N. D. (2020). Characterizing the dynamics of learning in repeated reference games. Cognitive Science, 44(6), e12845.