LogoLogo
  • Introduction
  • Getting Started
    • Setup
      • Windows WSL Instructions (new)
      • Windows WSL Instructions
      • Linux Instructions
    • Creating your experiment
    • Running your experiment
    • Updating your experiment
  • Conceptual Overview
    • Game Life Cycle
      • Customising when players submit stages
    • Concepts
    • Randomization & Batches
    • API
  • Guides
    • V2 Migration
    • Managing the Data
    • Special Empirica Components
    • The Admin Panel
    • Deploying Your Experiment
      • Ubuntu tutorial
  • Tutorials
    • Beginner Experiment: Prisoner's Dilemma
      • Part 1: Before you start
      • Part 2: Creating the Experiment in Empirica
      • Part 3: Getting Accustomed to the Code
      • Part 4: Coding the Prisoner's Dilemma Game
        • Part 4.1: Removing example code
        • Part 4.2: Intro Text
        • Part 4.3: Set up the game stages
        • Part 4.4: Build the "Choice" React Component
        • Part 4.5: Build the "Result" React Component
        • Part 4.6: Compute the Score
      • Part 5: Customizing the experiment
        • Part 5.1: Changing the number of rounds
        • Part 5.2: Turning the chat on and off
      • Part 6: Deployment
  • FAQ
    • I need help!
    • The Processes and Elements of an Empirica Experiment
    • Managing Players and Games
  • Resources
    • Helpful Linux Commands
    • Code Editors
    • Javascript and React
  • Links
    • Empirica website
    • Twitter
    • GitHub
Powered by GitBook
On this page
  • Beginning and intro steps
  • gameStart
  • Rounds and Stages
  • Game end and exit steps
  • List of callbacks

Was this helpful?

Edit on GitHub
Export as PDF
  1. Conceptual Overview

Game Life Cycle

PreviousUpdating your experimentNextCustomising when players submit stages

Last updated 1 year ago

Was this helpful?

Elements on this page refer to the , and of an Empirica experiment.

Empirica experiments are event driven. The image below summarizes the lifecycle from the beginning of a game through exit steps.

Beginning and intro steps

In the admin panel, you would create a Batch of games for players to join. Players enter the game where they go through a consent form (optional), they provide an identifier (which can be set via URL queries), and they do the intro steps (the instructions and other components you have set in the intro steps. All of these are set by you in the ./client . During these steps, players are asynchronous; namely, they complete these steps at their own pace until they have finished them, independent from the pace of other players.

gameStart

Once players finish the intro steps they are sent to a lobby where they wait until every player has joined. When every player has joined, the Game object is created based on what is set in ./server/src/callbacks.js in the Empirica.onGameStart(). This is where certain parameters are set, and where the Rounds and their Stages are created.

Rounds and Stages

Then players go through each Stage of each Round. Once a Stage is finished, they move on to the next. If this was the last Stage of a Round, they move on to the next Round. If this was the last Round, they move on to the Exit Steps.

During these steps, players are synchronous; namely, every player has to finish each stage before they can all move on to the next.

In the ./server/src/callbacks.js, a series of callbacks are triggered during this process:

See our guide on customising when player submit a stage:

Game end and exit steps

After which, the players goes through the exit steps. During these steps, players are asynchronous; namely, they complete these steps at their own pace until they have finished them, independent from the pace of other players.

List of callbacks

The list of callbacks goes as follows in order:

  • onGameStart Required

  • onRoundStart Repeated for each Round

  • onStageStart Repeated for each Stage

  • onStageEnd Repeated for each Stage

  • onRoundEnd Repeated for each Round

  • onGameEnd

Before a round starts, is called.

Before a stages starts, is called.

When a Stage ends, is called.

When a Round ends, is called.

Finally, when the last Round ends, after the end of Stage and Round callbacks are triggered, the callback is called in the ./server/src/callbacks.js.

onRoundStart
onStageStart
onStageEnd
onRoundEnd
Customising when players submit stages
onGameEnd
concepts
API