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
| Example | What happens | Plugins |
|---|---|---|
| Ultimatum game | One 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 JATOS | The same game on a JATOS server. Only the backend differs. | sync, role |
| Ultimatum game on Firebase | The same game on Firebase, across devices. Only the backend differs. | sync, role |
| Prisoner's dilemma | Two players choose Cooperate or Defect at the same time, then see both choices and their payoffs. | choice, sync |
| Pair up, then play | A larger group is split into pairs, and each pair plays one round of the prisoner's dilemma. | match, choice, sync |
| Public goods game | Players decide how much of an endowment to put into a shared pool, before a shared deadline. | sync, countdown |
Communication
| Example | What happens | Plugins |
|---|---|---|
| Chat room | Participants choose a display name, wait in a lobby, then chat for a fixed time. | chat, sync |
| Drawing together | Participants draw on one shared canvas for a timed round. | draw, countdown, sync |
| Reference game | A 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 board | The same plugin, set up so the matcher puts every shape in the director's order. | reference-game, role, sync |
Groups, votes and scores
| Example | What happens | Plugins |
|---|---|---|
| Poll | Everyone votes, then sees only the vote counts, not who voted for what. | choice, sync |
| Countdown | A timer that ends at the same moment on every screen. | countdown, sync |
| Scoreboard | Each player answers a short quiz, then everyone sees the final ranking at once. | scoreboard, sync |
| Live scoreboard | The same quiz, with a ranking that updates as each player's score comes in. | scoreboard, sync |
| Group quiz | A 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.