Support Home Multiplayer Step By Step

Multiplayer Step-by-step

  • Overview
  • Getting Started
  • Create Instructions
  • Create Offer Screen
  • Assign Players
  • Accept or Refuse
  • Assign Players 2
  • Configure Screen Advance
  • Create Spreadsheet
  • Preview

Overview


This guide will take you through building the Ultimatum Game, a classic multiplayer behavioural experiment, from scratch in the Task Builder. In this task, two players are paired together. One is presented with a sum of money, and must offer the other player a proportion of it. If the other player accepts, both players get their share. If the other player refuses, neither player gets anything.

Getting Started


First, create a new Task Builder task and enable Multiplayer. This is a 2-player task, so we set the number of players to 2.

  1. Click on the Multiplayer tab
  2. Enable multiplayer, and set players to 2

Instructions


We create the instructions as normal, with some text and a continue button. We want all players to have read the instructions and clicked to continue before we advance, which is the default behaviour, so we don't need to add any multiplayer-specific configuration here.

  1. Create a new display
  2. Open the first screen
  3. Add a text object and enter the instructions
  4. Add a continue button

Offer Screen


Each trial is split into two screens: on the first one, we present the amount of money and the first player makes an offer to the second player. We'll build that next.

  1. Create a new display
  2. Open the first screen
  3. Add text for "On the table is..."
  4. Add text for the actual offer, and set it to $100
  5. Add text for "How much will you offer the other player?"
  6. Add a text entry
  7. Add a continue button
  8. Add a Save Response component to the screen and bind it to a network data field called "offer"

Assign Players


Now that we have our basic offer screen, we can set certain objects to only be visible to certain players. The "On the table is" and the actual offer amount should be visible to both players, so we don't need to change those. However, the "How much will you offer the other player" text, the input box, and the continue button should only show for Player A - Player B should wait. We'll then add some text for Player B to say that they should wait for Player A's offer, and configure the screen so that the first response will advance the screen (which will be the offer from Player A).

  1. Add a Multiplayer component to the offer prompt, input box and continue button, and assign them to Player A
  2. Make a duplicate of the offer prompt, and change the text to "The other player is making you an offer..."
  3. Set the second prompt to be assigned to Player B

Accept Or Refuse Screen


We can now implement the second screen, where the other player gets to either accept or refuse the offer. This is similar to the previous screen, except now it's Player B who has access to the response buttons, and Player A who has a prompt telling them that the other player is considering their offer.

  1. Add a second screen to the Trial display
  2. Add text for "On the table is"
  3. Add text for the amount
  4. Add text for "You have been offered"
  5. Add text for the offer, and bind it to the network data field we created earlier
  6. Add two buttons for accept and refuse

Assign Players


We can now assign players in the second screen. This is similar to the offer screen.

  1. Add a Multiplayer component to the offer prompt, accept and refuse buttons, and assign them to Player B
  2. Add text for "You have offered", and assign it to Player A
  3. Add text for "The other player is considering your offer" and assign it to Player A

Configure Screen Advance


Unlike the instructions screen, we want the two trial screens to advance as soon as the relevant player has made their choice. To implement this, we add a Multiplayer - Advance component to the screen, and set it to advance on the first response.

  1. Click on the screen object, and add an Advance - Multiplayer component
  2. Set the Required Players to "First"
  3. Click on the second screen and add another Advance - Multiplayer component, and set its Required Players to "First"

Create Spreadsheet


We can now create a simple spreadsheet to see our trials in action. We're going to start with our instructions, and then set up two trials - one for $100 and one for $1000. The two players will take turns, so one makes an offer from the smaller amount and the second one from the larger amount. We then need to go back to the two screens and bind the text field that displays the amount to the spreadsheet column that specifies it.

  1. Go to the spreadsheets tab and add a spreadsheet
  2. Add three rows, set the first to Instructions and the second two to Trial
  3. Add a column called "Amount" and add some amounts of money
  4. Populate the Player A and Player B columns such that both players get a turn at making the initial offer
  5. Go back to the two trial screens, and bind the amount text to the spreadsheet column

Preview


We can now preview our task to see it in action. Consider logging into Gorilla in two separate browsers, loading up the same task and previewing it in both browsers - you will then have two preview participants running. Matchmake them together and then continue to the task.

There is a more detailed guide to previewing multiplayer tasks here:

Previewing Multiplayer Tasks