Part 1: Getting Started
Getting Started With Empirica
Although it won't do too much, Empirica works straight out of the box. The first step to customizing your Empirica app is to launch a test game so you can see your edits in action.
Follow the setup guide and create your experiment
Start your app by running the command
meteor
Then, visit your admin panel http://localhost:3000/admin
Log in using the password generated in the command line by step 2
Configuring your app
Click
configuration
in the upper right corner to access app settings. This is where you'll define all your experimental conditions.Click
factors
in the menu bar at the top. This is where you set the mostbasic parameters for your experiment. The only default parameter is
playerCount. Add a new factor by clicking the
+
button. Set the name toone
and the value to1
, then clickCreate Factor Value
.Click
treatments
. This is where you combine factors to create anexperimental condition. Create a new treatment using the factor you just
created and name whatever you want.
Click
Lobby Configurations
and create a new lobby configuration using the default settings.
Creating an experiment session
Click
monitoring
in the upper right corner to toggle your admin panel from configuration to monitoring. This is where you'll interact with all theEmpirica features that have to do with actually running experiments.
Click
New Batch
in the batches panel, select the treatment you justcreated, and click
Create Batch
.Press the
â–º Start
to start the batch.
Testing the experiment as a participant
Navigate to http://localhost:3000/ (or click the
â–º Open App
button on the top right) .Follow through the consent, identification (this would be, e.g., an MTurk/Prolific ID, but you can enter whatever you want right now), instruction pages, and attention check (you have to answer correctly).
You're running an experiment! This is the default app, just a slider with 10
rounds of input. We're going to edit that.
For more information about testing the experiment locally, see our guide on running your experiment.
Creating the experiment title
The client/main.html
is the html point of entry for the React code that determines what a participant sees when they are in your experiment. You should NOT change anything in this file except for the text in between the <title></title>
tags. There you can put the title you want to appear at the top of the tab when people are using your experiment (e.g., "My First Experiment").
Cleaning up the styling
The styling of an Empirica experiment is set in .client/main.less
. Less is very similar to CSS.
The default styling of the experiment is a bit complicated to understand, and to make our experiment look good we want to tweak a few things. Let's start by replacing the code in main.less
with this code:
Understanding an Empirica Experiment
As you go about your first experiment, it might help to try and get a global understanding of what an Empirica Experiment is.
The Empirica Framework
The Empirica framework provides powerful tools to create singleplayer and multiplayer games.
You have the frontend in the /client
folder. This is where you determine what the users will see when they come to your experiment: which components you build your game with and what they look like.
The backend in the /server
folder. This is where you determine the structure of your game.
You have an admin panel
in the browser that allows you to create factors and treatments as well as monitor the games you are running. For now, everything is running locally for your to test out, but the admin panel will look similar once deployed to recruit participants online.
The best ways to learn about the structure of an Empirica experiment and testing it locally is to give the Readme.md file a read or consult our other sections in this documentation.
The Technologies used by Empirica
Empirica is a framework that builds on top of a Meteor.js and React.js app. Meteor does the backend and generally building of the app whilst React is used for the front end.
You can find some tutorial online for both technologies. However, you do not need any knowledge of these technologies for this tutorial.
Our brief explanation on what React components are might help.
Last updated