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.
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.
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.
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.
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).
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.
We can now assign players in the second screen. This is similar to the offer screen.
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.
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.
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:
Now that we have set up and previewed the task, we can commit it. Committing means saving a version of the task that you can always go back to. You must commit your task to be able to add it to an experiment.
To do this, click the green 'Commit' button at the top right of the screen. Then, enter a description of your changes in the text box and press Commit to save the new version of the task.
You will know the task version is committed when you can no longer edit the task, and the blue 'Edit' button replaces the green 'Commit' button. These changes indicate that we are now viewing the committed version of the task, not editing it.