Online multiplayer experiment demo using Pavlovia shelf

I’ve created a proof-of-concept demo for using the shelf to do a “multiplayer” game. It’s a simple one-shot coordination task

Experiment (note: if nobody else is trying it out, you can open it in two separate browser windows and it will treat each browser window as its own player): coordination_demo [PsychoPy]

Repository: Jonathan Kominsky / multiplayer_demo · GitLab

Some notes:

  1. The shelf updates very slowly, sometimes taking several seconds, so it’s only really viable for turn-taking games. Even then, participants will need patience.
  2. Matchmaking is a hard problem and my solution is a bit rudimentary. Any feedback or suggested refinements would be welcome.
  3. In order to stop everything from freezing when waiting for your partner to respond, rather than using “await” I had to use some messy “then” functions with some extra booleans. It’s not elegant, and if people who understand async functions better than I do know how to make this less ugly I’d love to hear it.