SlideShare ist ein Scribd-Unternehmen logo
1 von 125
Downloaden Sie, um offline zu lesen
Online Behavioral Experiments
with NodeGame
Stefano Balietti
Network Science Institute, Northeastern University
Harvard Institute for Quantitative Social Science
D'Amore McKim School of Business, Northeastern University
@balietti | @nodegameorg | stefanobalietti.com | nodegame.org
1. Become confident about the principles and the methodology
behind social science scientific experiments
2. Get a quick-start with the software nodeGame to conduct
experimental research online
Goals of the Workshop
Workshop Instructors
Workshop Instructors
Me
Social Scientist Open Source
Developer
Workshop Instructors
Me
Social Scientist
Open
Source
Developer
What is an experiment?
An experiment is a methodological procedure carried out with the
goal of verifying, falsifying, or establishing the validity of a hypothesis.
A test under controlled conditions that is made to demonstrate a
known truth, examine the validity of a hypothesis, or determine the
efficacy of something previously untried.
An experiment is an empirical method that arbitrates between
competing hypotheses.
What is an experiment?
Internal validity:
The extent to which a causal inference based on a study is
warranted by an experiment.
What is an experiment?
Control
3 Pillars of Experimental Design
RandomizationIndependence
Control
3 Pillars of Experimental Design
RandomizationIndependence
Deliberate choice of the variables
that will be kept constants and those
that will be varied: treatment variables
Control
3 Pillars of Experimental Design
Randomization
Independence
Treatment variables must not be correlated
Control
3 Pillars of Experimental Design
Randomization
Independence
Participants are randomly assigned to conditions
Conditions are executed in random order
Stratification might be required
Internal validity:
The extent to which a causal inference based on a study is
warranted by an experiment.
External validity:
The extent to which the results of a study can be generalized
or extended to others.
What is an experiment?
Internal validity:
The extent to which a causal inference based on a study is
warranted by an experiment.
External validity:
The extent to which the results of a study can be generalized
or extended to others.
What is an experiment?
External Validity
Galileo's hand-made drawing of the moon surface. Sidereus Nuncius (1610)
External Validity
Galileo's hand-made drawing of the moon surface. Sidereus Nuncius (1610)
External Validity
Telescope:
From Land to Sky
Galileo's hand-made drawing of the moon surface. Sidereus Nuncius (1610)
External Validity
Telescope:
From Land to Sky
Experiments:
From Lab to Real Life
Super-brief history of scientific experiments
• Novum Organum (1620)
• Scientific induction
• Torturing Nature to extract her secrets
Super-brief history of scientific experiments (1/3)
• Novum Organum (1620)
• Scientific induction
• Torturing Nature to extract her secrets
Super-brief history of scientific experiments (1/3)
Ever heard of Phlogistons??
“There is a property common to almost all
the moral sciences, and by which they are
distinguished from many of the physical;
that is, that it is seldom in our power to
make experiments with them”
John Stuart Mill, 1836
Super-brief history of scientific experiments (2/3)
“There is no laboratory in which economists can test
their hypothesis”
, 1993
Super-brief history of scientific experiments (2B/3)
Nobel prize for Vernon Smith
“for having established laboratory
experiments as a tool in empirical
economic analysis, especially in the
study of alternative market mechanisms”
2002
Super-brief history of scientific experiments (3/3)
The Puzzle of Cooperation
The Ultimatum Game
The Ultimatum Game
Rules:
• 2 Players (A,B)
• 100 $
The Ultimatum Game
Rules:
• 2 Players (A,B)
• 100 $
• Player A makes a proposal
The Ultimatum Game
Rules:
• 2 Players (A,B)
• 100 $
• Player A makes a proposal
• Player B can accept or refuse the split.
The Ultimatum Game
Rules:
• 2 Players (A,B)
• 100 $
• Player A makes a proposal
• Player B can accept or refuse the split.
• If B accepts each one gets his/her
share.
The Ultimatum Game
Rules:
• 2 Players (A,B)
• 100 $
• Player A makes a proposal
• Player B can accept or refuse the split.
• If B accepts each one gets his/her
share.
• If B refuses both players get nothing.
The Ultimatum Game: How to Split 100$
Rules:
• 2 Players (A,B)
• 100 $
• Player A makes a proposal
• Player B can accept or refuse the split.
• If B accepts each one gets his/her
share.
• If B refuses both players get nothing.
The Ultimatum Game: How to Split 100$
A B
The Ultimatum Game: How to Split 100$
Proposer Respondent
RationalRational
The Ultimatum Game: How to Split 100$
Proposer Respondent
I say 99 for me
and 1 for you.
RationalRational
The Ultimatum Game: How to Split 100$
Proposer Respondent
I say 99 for me
and 1 for you.
RationalRational
I say OK.
The Ultimatum Game: How to Split 100$
Human Being Human Being
I say 99 for me
and 1 for you.
The Ultimatum Game: How to Split 100$
Human Being Human Being
I say…$!!@**
I say 99 for me
and 1 for you.
Nowak (2006) 5 rules for Cooperation
Traditional Laboratory Research
• Decision making tools, heuristics, models of human behavior
Traditional Laboratory Research
• Decision making tools, heuristics, models of human behavior
• BUT
Traditional Laboratory Research
• Decision making tools, heuristics, models of human behavior
• BUT
• Small groups of individuals, generally 4-12 (bounded by uni. Lab)
Traditional Laboratory Research
• Decision making tools, heuristics, models of human behavior
• BUT
• Small groups of individuals, generally 4-12 (bounded by uni. Lab)
• Behavior of individuals in social networks under-researched
Traditional Laboratory Research
• Decision making tools, heuristics, models of human behavior
• BUT
• Small groups of individuals, generally 4-12 (bounded by uni. Lab)
• Behavior of individuals in social networks under-researched
• Limited in the number of hypotheses that can be tested
Traditional Laboratory Research
• Decision making tools, heuristics, models of human behavior
• BUT
• Small groups of individuals, generally 4-12 (bounded by uni. Lab)
• Behavior of individuals in social networks under-researched
• Limited in the number of hypotheses that can be tested
• Observations are limited in time
Traditional Laboratory Research
• Decision making tools, heuristics, models of human behavior
• BUT
• Small groups of individuals, generally 4-12 (bounded by uni. Lab)
• Behavior of individuals in social networks under-researched
• Limited in the number of hypotheses that can be tested
• Observations are limited in time
• Limited(?) external validity
Traditional Laboratory Research
• Decision making tools, heuristics, models of human behavior
• BUT
• Small groups of individuals, generally 4-12 (bounded by uni. Lab)
• Behavior of individuals in social networks under-researched
• Limited in the number of hypotheses that can be tested
• Observations are limited in time
• Limited(?) external validity
• Generally high costs for an academic budget
The Present/Future of
Behavioral Research
The Present/Future of
Behavioral Research
Workshop Instructors
Me
Social Scientist Open Source
Developer
Workshop Instructors
Me
Social Scientist
Open Source Developer
nodeGame 3.x
Install nodeGame 3.x
1. Go to http://nodegame.org
2. Click on the “Get Started” button
3. Follow instructions to install Development version
4. Keep following my talk!
nodeGame 3.x Architecture Overview
nodeGame 3.x Architecture Overview
nodeGame 3.x Architecture Overview
nodeGame 3.x Architecture Overview
~46.000 lines
(including comments)
Launch nodeGame 3.x
Open a terminal and browse to the nodegame folder
Start the server with the command: node launcher.js
Open a browser and access the default ultimatum game at the url:
localhost:8080/ultimatum
Start an automated player (bot) at the url:
localhost:8080/ultimatum?clientType=autoplay
Access the administrator interface at the url:
localhost:8080/ultimatum/monitor/
Create a New Game
cd nodegame/bin/
node nodegame create-game gamename <author> <email>
Creates a new game in the games/ folder (usually nodegame/games/)
Important! Windows users must install the nodegame-generator package
manually from the git repository (or npm)
git clone https://github.com/nodeGame/nodegame-generator.git
cd nodegame-generator
npm install
Anatomy of a Game
Anatomy of a Game
Features:
- Define game variables and treatments
- Define the game sequence with the Stager API
- Implement the game sequence into client types
The Game Sequence and Client Types
Game Sequence Client Types
stager.stage("instructions")
.step("instructions_1")
.step("instructions_2")
.step("instructions_3");
stager.stage("quiz");
stager.repeat("game", 3)
stager.stage("questionnaire");
stager.extendStage("game", {
steps: ["offer", "respond",
. "display_results"]
});
Code Snippet
The Game Sequence and Client Types
Game Sequence Client Types
stager.stage("instructions")
.step("instructions_1")
.step("instructions_2")
.step("instructions_3");
stager.stage("quiz");
stager.repeat("game", 3)
stager.stage("questionnaire");
stager.extendStage("game", {
steps: [ "offer", "respond",
. "display_results" ]
});
Code Snippet
The Game Sequence and Client Types
Game Sequence Client Types
Client types implement the game sequence
by extending its steps and stages.
The Game Sequence and Client Types
Game Sequence Client Types
The Game Sequence and Client Types
Game Sequence Client Types
The Game Sequence and Client Types
Game Sequence Client Types Code Snippet
stager.setDefaultProperty("coins",100);
stager.extendStage("game", {
coins: 200
});
stager.extendStep("offer", {
coins: 50
});
The Game Sequence and Client Types
Game Sequence Client Types Code Snippet
stager.setDefaultProperty("coins",100);
stager.extendStage("game", {
coins: 200
});
stager.extendStep("offer", {
coins: 50
});
node.game.getProperty("coins") returns 50 in
step 'offer', 200 in steps 'respond' and 'display results'
inside the 'game' stage, and 100 in any other step.
Step/Stages Properties are hierarchical
Some Built-in Step-Properties
Property Description Type
init Executed upon entering the step/stage function
exit Executed upon exiting the step/stage function
timer Sets the maximum execution time for step (ms) number
timeup Executed if the timer expires function
done Executed when the step terminates function
cb The actual step execution function
Logic Client Type
Executed on the server, governs a game room
- Makes groups
- Keep track of game history
- Handles disconnections and reconnections
- Access to:
- internal Database NDDB: node.game.memory
- player list: node.game.pl
- channel and registry object
Player Client Types
Executed on a client, e.g. a browser
- Display/manipulate information on screen
- Exchange messages with the server and other players
- Respond to user events
- Determine when the current step is finished (“done”)
W (Window): manipulates information on screen and the behavior of user interface,
e.g. disabling right click, locking screen, etc.
At the end of each step, the game developer must call the method
node.done, which triggers a procedure that advances the client to the next step.
Inside a Step Callback Function
Instructions Step
- Player client type
- No interaction with other players
- No interaction with the page
- No time limit
- Simply click “Done” when
finished reading and advance to
next step
Inside a Step Callback Function
Instructions Step
- Player client type
- No interaction with other players
- No interaction with the page
- No time limit
- Simply click “Done” when
finished reading and advance to
next step
Inside a Step Callback Function
stager.extendStep('instructions_1', {
frame: "instr1.htm"
});
Instructions Step
- Player client type
- No interaction with other players
- No interaction with the page
- No time limit
- Simply click “Done” when
finished reading and advance to
next step
Inside a Step Callback Function
stager.extendStep('instructions_1', {
frame: "instr1.htm"
});
Widget Step
- Player client type
- No interaction with other players (at
the moment)
- Standardized interaction
- With or without time limit
- Register the mood of the participant
using the PANAS method.
Instructions Step
- Player client type
- No interaction with other players
- No interaction with the page
- No time limit
- Simply click “Done” when
finished reading and advance to
next step
Inside a Step Callback Function
stager.extendStep('instructions_1', {
frame: "instr1.htm"
});
Widget Step
- Player client type
- No interaction with other players (at
the moment)
- Standardized interaction
- With or without time limit
- Register the mood of the participant
using the PANAS method.
Instructions Step
- Player client type
- No interaction with other players
- No interaction with the page
- No time limit
- Simply click “Done” when
finished reading and advance to
next step
Inside a Step Callback Function
stager.extendStep('instructions_1', {
frame: "instr1.htm"
});
Widget Step
- Player client type
- No interaction with other players (at
the moment)
- Standardized interaction
- With or without time limit
- Register the mood of the participant
using the PANAS method.
Instructions Step
- Player client type
- No interaction with other players
- No interaction with the page
- No time limit
- Simply click “Done” when
finished reading and advance to
next step
stager.extendStep('instructions_2', {
widget: "MoodGauge"
});
Roles (version 3.5 dev)
stager.extendStep('bidder', {
matcher: {
// Available roles.
roles: [ 'BIDDER', 'RESPONDENT'],
// Each player is matched with a
// partner and is assigned a role.
match: 'roundrobin',
// How to continue matching after
// all combinations are exhausted
cycle: 'repeat_invert'
}
});
Logic Client Type
Roles (version 3.5 dev)
stager.extendStep('bidder', {
roles: {
BIDDER: {
frame: 'bidder.htm',
cb: function() {
// Bidder stuff.
}
},
RESPONDENT: {
frame: 'resp.htm',
cb: function() {
// Respondent stuff.
}}}
});
Player Client Type
stager.extendStep('bidder', {
matcher: {
// Available roles.
roles: [ 'BIDDER', 'RESPONDENT'],
// Each player is matched with a
// partner and is assigned a role.
match: 'roundrobin',
// How to continue matching after
// all combinations are exhausted
cycle: 'repeat_invert'
}
});
Logic Client Type
Inside the Step Callback Function
// The respondent receives the offer,
// displays it, and terminates the step.
// On incoming data labeled "offer",
// executes the function.
node.on.data("offer", function(msg) {
// Display offer using W.
W.setInnerHTML("offer", msg.data);
// End step.
node.done();
});
// Player made a choice
// and clicked the submit button.
submit.onclick = function() {
// Send offer to respondent.
node.say("offer", "respondent", 1);
// End step, store offer in server.
node.done({ offer: 1 });
};
I say 99 for me
and 1 for you.
Proposer Respondent
NDDB: Internal Database
// The respondent receives the offer,
// displays it, and terminates the step.
// On incoming data labeled "offer",
// executes the function.
node.on.data("offer", function(msg) {
// Display offer using W.
W.setInnerHTML("offer", msg.data);
// End step.
node.done();
});
// Player made a choice
// and clicked the submit button.
submit.onclick = function() {
// Send offer to respondent.
node.say("offer", "respondent", 1);
// End step, store offer in server.
node.done({ offer: 1});
};
I say 99 for me
and 1 for you.
Proposer Respondent
Logic Client Type
NDDB database
node.game.memory
NDDB: Internal Database
node.done({ offer: 1 });
// Set an object in memory explicitly.
node.set({ foo: "bar" });
NDDB: Internal Database
{
stage: {
stage: 2,
step: 1,
round: 1
},
player: "respondent",
timestamp: 1480336721939
offer: 1, // foo: "bar"
// node.done specific.
timeup: false,
time: 4321, // from step.
done: true
};
node.done({ offer: 1 });
// Set an object in memory explicitly.
node.set({ foo: "bar" });
NDDB: Internal Database
var m = node.game.memory; // NDDB instance.
// Lazy loading.
m.select("player", "=", "respondent");
m.and("stage.step", "=", 1)
.and("offer")
.fetch()[0];
// Use indexes.
m.player["respondent"].last();
m.stage["2.1.1"].select("offer").fetch()[0];
node.done({ offer: 1 });
// Set an object in memory explicitly.
node.set({ foo: "bar" });
{
stage: {
stage: 2,
step: 1,
round: 1
},
player: "respondent",
timestamp: 1480336721939
offer: 1, // foo: "bar"
// node.done specific.
timeup: false,
time: 4321, // from step.
done: true
};
NDDB: Internal Database
// Modify database items upon inserting them.
node.game.memory.on("insert", function(item) {
// Decorate item or save it somewhere else.
});
// Disable internal database completely.
// Remove default event listener.
node.off('in.set.DATA');
// Add new one.
node.on('in.set.DATA', function(msg) {
// Save msg somewhere else, e.g. Mongo.
});
Event Listener
Manager
node.game.events
NDDB: Internal Database
// Modify database items upon inserting them.
node.game.memory.on("insert", function(item) {
// Decorate item or save it somewhere else.
});
// Disable internal database completely.
// Remove default event listener.
node.off('in.set.DATA');
// Add new one.
node.on('in.set.DATA', function(msg) {
// Save msg somewhere else, e.g. Mongo.
});
Event Listener
Manager
node.game.events
Events in nodeGame 3.x
Internal: generated by the game or by the nodeGame engine.
Incoming: triggered by incoming messages, 'in.[target].[action]', ‘in.set.DATA’
Events in nodeGame 3.x
Internal: generated by the game or by the nodeGame engine.
Incoming: triggered by incoming messages, 'in.[target].[action]', ‘in.set.DATA’
// Registering an internal event listener.
node.on('LOCAL_EVENT', function(a, b) {
// This is local event.
});
// Triggering a local event.
node.emit('LOCAL_EVENT', 1, 2);
Events in nodeGame 3.x
Internal: generated by the game or by the nodeGame engine.
Incoming: triggered by incoming messages, 'in.[target].[action]', ‘in.set.DATA’
// Registering an internal event listener.
node.on('LOCAL_EVENT', function(a, b) {
// This is local event.
});
// Listening for incoming DATA msgs.
node.on('in.say.DATA', function(msg) {
// I got a data msg!
});
// Listening for incoming "foo" DATA msgs.
node.on.data('foo', function(msg) {
// I got a data msg labeled "foo"!
});
// Triggering a local event.
node.emit('LOCAL_EVENT', 1, 2);
// Triggering a local event.
node.say('foo', "bar");
Events in nodeGame 3.x
Events are hierarchically organized, where you register your event matters!
Events in nodeGame 3.x
Events are hierarchically organized, where you register your event matters!
// Listening for incoming "foo" DATA msgs.
node.on.data('foo', function(msg) {
// I got a data msg labeled "foo"!
});
Events in nodeGame 3.x
Events are hierarchically organized, where you register your event matters!
// Listening for incoming "foo" DATA msgs.
node.on.data('foo', function(msg) {
// I got a data msg labeled "foo"!
});
Valid only in Quiz stage
Events in nodeGame 3.x
Events are hierarchically organized, where you register your event matters!
// Listening for incoming "foo" DATA msgs.
node.on.data('foo', function(msg) {
// I got a data msg labeled "foo"!
});
Registered in init or cb function of Step 3.3
Valid only in step 3.3 (any round).
Events in nodeGame 3.x
Events are hierarchically organized, where you register your event matters!
// Listening for incoming "foo" DATA msgs.
node.on.data('foo', function(msg) {
// I got a data msg labeled "foo"!
});
Registered in the init function of “Game”
Valid throughout all steps of “Game” stage
Events in nodeGame 3.x
Events are hierarchically organized, where you register your event matters!
How to register a listener valid throughout all
the game?
Events in nodeGame 3.x
Events are hierarchically organized, where you register your event matters!
stager.setInitCb(function() {
// Listening for incoming "foo" DATA msgs.
node.on.data('foo', function(msg) {
// I got a data msg labeled "foo"!
});
});
How to register a listener valid throughout all
the game?
In the init function of the game!
Anatomy of a Game
Topics Covered and To Cover
Topics Covered and To Cover
Recruiting Participants
Free Platforms
Psychological Research on the Net
http://psych.hanover.edu/research/exponnet.html
The Web Experiment List
http://www.wexlist.net
Online Social Psychology Studies
http://www.socialpsychology.org/expts.htm
Volunteer Science
http://www.volunteerscience.com
Recruiting Participants
Commercial Platforms
ODesk, Freelancer, Elance, Guru, CrowdFlower, Innocentive, SurveySampling,
UpWork …
Most used in research:
How To Run a Game on AMT:
The Big Picture
1. Upload nodeGame server + game to a server
e.g. Heroku cloud: https://github.com/nodeGame/nodegame-heroku
2. Create a new HIT on Amazon Mechanical Turk (AMT), e.g. using the requester
interface or other service API.
3. Use the nodegame-mturk package
https://github.com/nodeGame/nodegame-mturk/
to handle:
- Connection and authentication from AMT HIT page to nodeGame server.
- Opening/expiring/extending HIT while running it.
- Payments, bonuses and qualifications after HIT is done.
Known Issues Conducting
Synchronous Experiments on AMT
1. Not a survey or classification task, need to have DIFFERENT
people at the same time on your platform
Known Issues Conducting
Synchronous Experiments on AMT
1. Not a survey or classification task, need to have DIFFERENT
people at the same time on your platform
2. Btw, not too few, not too many
Known Issues Conducting
Synchronous Experiments on AMT
1. Not a survey or classification task, need to have DIFFERENT
people at the same time on your platform
2. Btw, not too few, not too many
3. Waiting time in the waiting room should be limited and
homogenous across participants
Known Issues Conducting
Synchronous Experiments on AMT
1. Not a survey or classification task, need to have DIFFERENT
people at the same time on your platform
2. Btw, not too few, not too many
3. Waiting time in the waiting room should be limited and
homogenous across participants
4. Demographics should be stratified as much as possible
Known Issues Conducting
Synchronous Experiments on AMT
1. Not a survey or classification task, need to have DIFFERENT
people at the same time on your platform
2. Btw, not too few, not too many
3. Waiting time in the waiting room should be limited and
homogenous across participants
4. Demographics should be stratified as much as possible
5. Participants should not re-take the same experiment again
Known Issues Conducting
Synchronous Experiments on AMT
1. Not a survey or classification task, need to have DIFFERENT
people at the same time on your platform
2. Btw, not too few, not too many
3. Waiting time in the waiting room should be limited and
homogenous across participants
4. Demographics should be stratified as much as possible
5. Participants should not re-take the same experiment again
6. Dropouts rate (non-completing the HIT) signigicantly affects the
whole experiment, increasing costs $$ and time to complete it
Known Issues Conducting
Synchronous Experiments on AMT
1. Not a survey or classification task, need to have DIFFERENT
people at the same time on your platform
Pay minimum wage (at least). Make bonus dependent on
performance
Known Issues Conducting
Synchronous Experiments on AMT
1. Not a survey or classification task, need to have DIFFERENT
people at the same time on your platform
2. Btw, not too few, not too many
Rule of thumb: 2.8 times desidered number of participants
Expire HIT as soon as desired number of participant entered
the experimental pipeline (+small buffer)
3x
Known Issues Conducting
Synchronous Experiments on AMT
1. Not a survey or classification task, need to have DIFFERENT
people at the same time on your platform
2. Btw, not too few, not too many
3. Waiting time in the waiting room should be limited and
homogenous across participants
Rule of thumb: 2.8 times desidered number of participants
Expire HIT as soon as desired number of participant entered
the experimental pipeline (+small buffer)
Dispose participants who waited too long (compensated)
Known Issues Conducting
Synchronous Experiments on AMT
4. Demographics should be stratified as much as possible
Waiting room can group players based on features
Collect some demographics features in a pre-experimental part
Start 2 (or more) groups at the same time
Known Issues Conducting
Synchronous Experiments on AMT
5. Participants should not re-take the same experiment again
Create one HIT (no group) with 3x rule
Keep track of turker ids (nodegame-mturk)
Assign qualification via AMT API (nodegame-mturk)
Known Issues Conducting
Synchronous Experiments on AMT
6. Rate of dropouts (non-completing the HIT) significantly affects the
whole experiment, increasing costs $$ and time to complete it
• Make sure waiting time is not too long (previous advices)
Known Issues Conducting
Synchronous Experiments on AMT
6. Rate of dropouts (non-completing the HIT) significantly affects the
whole experiment, increasing costs $$ and time to complete it
• Make sure waiting time is not too long (previous advices)
• Inform about required time BEFORE and DURING experiment
Known Issues Conducting
Synchronous Experiments on AMT
6. Rate of dropouts (non-completing the HIT) significantly affects the
whole experiment, increasing costs $$ and time to complete it
• Make sure waiting time is not too long (previous advices)
• Inform about required time BEFORE and DURING experiment
• Design experiments that are robust to dropout (as much as
possible). For example, use shares instead of fixed quantities.
Known Issues Conducting
Synchronous Experiments on AMT
6. Rate of dropouts (non-completing the HIT) significantly affects the
whole experiment, increasing costs $$ and time to complete it
• Make sure waiting time is not too long (previous advices)
• Inform about required time BEFORE and DURING experiment
• Design experiments that are robust to dropout (as much as
possible). For example, use shares instead of fixed quantities.
• Use requirements checkings.
Known Issues Conducting
Synchronous Experiments on AMT
6. Rate of dropouts (non-completing the HIT) significantly affects the
whole experiment, increasing costs $$ and time to complete it
• Make sure waiting time is not too long (previous advices)
• Inform about required time BEFORE and DURING experiment
• Design experiments that are robust to dropout (as much as
possible). For example, use shares instead of fixed quantities.
• Use requirements checkings.
• Use “seriousness checks” and “warm-up” phases.
How To Run a Game on AMT
AMT
How To Run a Game on AMT
AMT HIT
Not Just Experiments,
also Gamification
• Industry: lots of A/B testing and customer surveys
• Gamification: applies elements of game playing to solve
complex and simple problems
• Increasing trend
• Improve engagement and understanding
• Fun
• Generate More and Better Ideas
• Train Machine Learning Algorithms
(http://quickdraw.withgoogle.com)
Contributions Welcome!
• Using it, request features, report bugs
• Help developing
• Extremely well documented source code
Contributions Welcome!
• Using it, request features, report bugs
• Help developing
• Extremely well documented source code
Thank You!
@balietti | @nodegameorg | stefanobalietti.com | nodegame.org

Weitere ähnliche Inhalte

Andere mochten auch

Andere mochten auch (13)

Are your v8 garbage collection logs speaking to you?Joyee Cheung -Alibaba Clo...
Are your v8 garbage collection logs speaking to you?Joyee Cheung -Alibaba Clo...Are your v8 garbage collection logs speaking to you?Joyee Cheung -Alibaba Clo...
Are your v8 garbage collection logs speaking to you?Joyee Cheung -Alibaba Clo...
 
Node's Event Loop From the Inside Out - Sam Roberts, IBM
Node's Event Loop From the Inside Out - Sam Roberts, IBMNode's Event Loop From the Inside Out - Sam Roberts, IBM
Node's Event Loop From the Inside Out - Sam Roberts, IBM
 
Math in V8 is Broken and How We Can Fix It - Athan Reines, Fourier
Math in V8 is Broken and How We Can Fix It - Athan Reines, FourierMath in V8 is Broken and How We Can Fix It - Athan Reines, Fourier
Math in V8 is Broken and How We Can Fix It - Athan Reines, Fourier
 
Real-Time Machine Learning with Node.js - Philipp Burckhardt, Carnegie Mellon...
Real-Time Machine Learning with Node.js - Philipp Burckhardt, Carnegie Mellon...Real-Time Machine Learning with Node.js - Philipp Burckhardt, Carnegie Mellon...
Real-Time Machine Learning with Node.js - Philipp Burckhardt, Carnegie Mellon...
 
Web MIDI API - the paster, the present, and the future -
Web MIDI API - the paster, the present, and the future -Web MIDI API - the paster, the present, and the future -
Web MIDI API - the paster, the present, and the future -
 
Comet with node.js and V8
Comet with node.js and V8Comet with node.js and V8
Comet with node.js and V8
 
IBM MQ v8 and JMS 2.0
IBM MQ v8 and JMS 2.0IBM MQ v8 and JMS 2.0
IBM MQ v8 and JMS 2.0
 
Nodifying the Enterprise - Prince Soni, TO THE NEW
Nodifying the Enterprise - Prince Soni, TO THE NEWNodifying the Enterprise - Prince Soni, TO THE NEW
Nodifying the Enterprise - Prince Soni, TO THE NEW
 
Text Mining with Node.js - Philipp Burckhardt, Carnegie Mellon University
Text Mining with Node.js - Philipp Burckhardt, Carnegie Mellon UniversityText Mining with Node.js - Philipp Burckhardt, Carnegie Mellon University
Text Mining with Node.js - Philipp Burckhardt, Carnegie Mellon University
 
Building Scalable Web Applications Using Microservices Architecture and NodeJ...
Building Scalable Web Applications Using Microservices Architecture and NodeJ...Building Scalable Web Applications Using Microservices Architecture and NodeJ...
Building Scalable Web Applications Using Microservices Architecture and NodeJ...
 
Node.js Event Loop & EventEmitter
Node.js Event Loop & EventEmitterNode.js Event Loop & EventEmitter
Node.js Event Loop & EventEmitter
 
Express State of the Union at Nodejs Interactive EU- Doug Wilson
Express State of the Union at Nodejs Interactive EU- Doug WilsonExpress State of the Union at Nodejs Interactive EU- Doug Wilson
Express State of the Union at Nodejs Interactive EU- Doug Wilson
 
The Coming Intelligent Digital Assistant Era and Its Impact on Online Platforms
The Coming Intelligent Digital Assistant Era and Its Impact on Online PlatformsThe Coming Intelligent Digital Assistant Era and Its Impact on Online Platforms
The Coming Intelligent Digital Assistant Era and Its Impact on Online Platforms
 

Ähnlich wie Workshop: Science Meets Industry: Online Behavioral Experiments with nodeGame - Stefano Balietti, Northeastern University

Ap research methods
Ap   research methodsAp   research methods
Ap research methods
Rammata940
 
Intro to Rapid Experimentation - Intel July 2015
Intro to Rapid Experimentation - Intel July 2015Intro to Rapid Experimentation - Intel July 2015
Intro to Rapid Experimentation - Intel July 2015
Julie Stanford
 
Scientific method ppt
Scientific method pptScientific method ppt
Scientific method ppt
ladynoid
 
Princiiples of scientific method in anthropology-1198815173874496-3
Princiiples of scientific method in anthropology-1198815173874496-3Princiiples of scientific method in anthropology-1198815173874496-3
Princiiples of scientific method in anthropology-1198815173874496-3
panaidu
 

Ähnlich wie Workshop: Science Meets Industry: Online Behavioral Experiments with nodeGame - Stefano Balietti, Northeastern University (20)

Mathematically Elegant Answers to Research Questions No One is Asking (meta-a...
Mathematically Elegant Answers to Research Questions No One is Asking (meta-a...Mathematically Elegant Answers to Research Questions No One is Asking (meta-a...
Mathematically Elegant Answers to Research Questions No One is Asking (meta-a...
 
Synchronous Online Experiments with NodeGame
Synchronous Online Experiments with NodeGameSynchronous Online Experiments with NodeGame
Synchronous Online Experiments with NodeGame
 
UX from 30,000ft - COMP33512 - Lectures 13 & 14 - Week 7 - 2013/2014 Edition ...
UX from 30,000ft - COMP33512 - Lectures 13 & 14 - Week 7 - 2013/2014 Edition ...UX from 30,000ft - COMP33512 - Lectures 13 & 14 - Week 7 - 2013/2014 Edition ...
UX from 30,000ft - COMP33512 - Lectures 13 & 14 - Week 7 - 2013/2014 Edition ...
 
The Reproducibility Crisis in Psychological Science: One Year Later
The Reproducibility Crisis in Psychological Science: One Year LaterThe Reproducibility Crisis in Psychological Science: One Year Later
The Reproducibility Crisis in Psychological Science: One Year Later
 
Applied Data Science for monetization: pitfalls, common misconceptions, and n...
Applied Data Science for monetization: pitfalls, common misconceptions, and n...Applied Data Science for monetization: pitfalls, common misconceptions, and n...
Applied Data Science for monetization: pitfalls, common misconceptions, and n...
 
Ap research methods
Ap   research methodsAp   research methods
Ap research methods
 
Loubier slide share_qualitative
Loubier slide share_qualitativeLoubier slide share_qualitative
Loubier slide share_qualitative
 
The Role of Agent-Based Modelling in Extending the Concept of Bounded Rationa...
The Role of Agent-Based Modelling in Extending the Concept of Bounded Rationa...The Role of Agent-Based Modelling in Extending the Concept of Bounded Rationa...
The Role of Agent-Based Modelling in Extending the Concept of Bounded Rationa...
 
Intro to Rapid Experimentation - Intel July 2015
Intro to Rapid Experimentation - Intel July 2015Intro to Rapid Experimentation - Intel July 2015
Intro to Rapid Experimentation - Intel July 2015
 
PropMap Pitch Deck
PropMap Pitch DeckPropMap Pitch Deck
PropMap Pitch Deck
 
Agile shortcuts conf
Agile shortcuts confAgile shortcuts conf
Agile shortcuts conf
 
Ch07
Ch07Ch07
Ch07
 
Scientific method ppt
Scientific method pptScientific method ppt
Scientific method ppt
 
Princiiples of scientific method in anthropology-1198815173874496-3
Princiiples of scientific method in anthropology-1198815173874496-3Princiiples of scientific method in anthropology-1198815173874496-3
Princiiples of scientific method in anthropology-1198815173874496-3
 
Princiiples of Scientific Method in Anthropology
Princiiples of Scientific Method in AnthropologyPrinciiples of Scientific Method in Anthropology
Princiiples of Scientific Method in Anthropology
 
Hpai class 19 - influence tactics - 042720
Hpai   class 19 - influence tactics - 042720Hpai   class 19 - influence tactics - 042720
Hpai class 19 - influence tactics - 042720
 
Tim Brown ACEAS Phenocams
Tim Brown ACEAS PhenocamsTim Brown ACEAS Phenocams
Tim Brown ACEAS Phenocams
 
DEF CON 27 - KATHERINE PRATT - hacking your thoughts batman forever meets bla...
DEF CON 27 - KATHERINE PRATT - hacking your thoughts batman forever meets bla...DEF CON 27 - KATHERINE PRATT - hacking your thoughts batman forever meets bla...
DEF CON 27 - KATHERINE PRATT - hacking your thoughts batman forever meets bla...
 
sience 2.0 : an illustration of good research practices in a real study
sience 2.0 : an illustration of good research practices in a real studysience 2.0 : an illustration of good research practices in a real study
sience 2.0 : an illustration of good research practices in a real study
 
David Williamson Shaffer: Epistemic Games (Paris juin 2011)
David Williamson Shaffer: Epistemic Games (Paris juin 2011)David Williamson Shaffer: Epistemic Games (Paris juin 2011)
David Williamson Shaffer: Epistemic Games (Paris juin 2011)
 

Mehr von NodejsFoundation

From Pterodactyls and Cactus to Artificial Intelligence - Ivan Seidel Gomes, ...
From Pterodactyls and Cactus to Artificial Intelligence - Ivan Seidel Gomes, ...From Pterodactyls and Cactus to Artificial Intelligence - Ivan Seidel Gomes, ...
From Pterodactyls and Cactus to Artificial Intelligence - Ivan Seidel Gomes, ...
NodejsFoundation
 

Mehr von NodejsFoundation (6)

The Morality of Code - Glen Goodwin, SAS Institute, inc.
The Morality of Code - Glen Goodwin, SAS Institute, inc.The Morality of Code - Glen Goodwin, SAS Institute, inc.
The Morality of Code - Glen Goodwin, SAS Institute, inc.
 
Take Data Validation Seriously - Paul Milham, WildWorks
Take Data Validation Seriously - Paul Milham, WildWorksTake Data Validation Seriously - Paul Milham, WildWorks
Take Data Validation Seriously - Paul Milham, WildWorks
 
From Pterodactyls and Cactus to Artificial Intelligence - Ivan Seidel Gomes, ...
From Pterodactyls and Cactus to Artificial Intelligence - Ivan Seidel Gomes, ...From Pterodactyls and Cactus to Artificial Intelligence - Ivan Seidel Gomes, ...
From Pterodactyls and Cactus to Artificial Intelligence - Ivan Seidel Gomes, ...
 
Breaking Down the Monolith - Peter Marton, RisingStack
Breaking Down the Monolith - Peter Marton, RisingStackBreaking Down the Monolith - Peter Marton, RisingStack
Breaking Down the Monolith - Peter Marton, RisingStack
 
The Enterprise Case for Node.js
The Enterprise Case for Node.jsThe Enterprise Case for Node.js
The Enterprise Case for Node.js
 
Node Foundation Membership Overview 20160907
Node Foundation Membership Overview 20160907Node Foundation Membership Overview 20160907
Node Foundation Membership Overview 20160907
 

Kürzlich hochgeladen

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Kürzlich hochgeladen (20)

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 

Workshop: Science Meets Industry: Online Behavioral Experiments with nodeGame - Stefano Balietti, Northeastern University

  • 1.
  • 2. Online Behavioral Experiments with NodeGame Stefano Balietti Network Science Institute, Northeastern University Harvard Institute for Quantitative Social Science D'Amore McKim School of Business, Northeastern University @balietti | @nodegameorg | stefanobalietti.com | nodegame.org
  • 3. 1. Become confident about the principles and the methodology behind social science scientific experiments 2. Get a quick-start with the software nodeGame to conduct experimental research online Goals of the Workshop
  • 7. What is an experiment?
  • 8. An experiment is a methodological procedure carried out with the goal of verifying, falsifying, or establishing the validity of a hypothesis. A test under controlled conditions that is made to demonstrate a known truth, examine the validity of a hypothesis, or determine the efficacy of something previously untried. An experiment is an empirical method that arbitrates between competing hypotheses. What is an experiment?
  • 9. Internal validity: The extent to which a causal inference based on a study is warranted by an experiment. What is an experiment?
  • 10. Control 3 Pillars of Experimental Design RandomizationIndependence
  • 11. Control 3 Pillars of Experimental Design RandomizationIndependence Deliberate choice of the variables that will be kept constants and those that will be varied: treatment variables
  • 12. Control 3 Pillars of Experimental Design Randomization Independence Treatment variables must not be correlated
  • 13. Control 3 Pillars of Experimental Design Randomization Independence Participants are randomly assigned to conditions Conditions are executed in random order Stratification might be required
  • 14. Internal validity: The extent to which a causal inference based on a study is warranted by an experiment. External validity: The extent to which the results of a study can be generalized or extended to others. What is an experiment?
  • 15. Internal validity: The extent to which a causal inference based on a study is warranted by an experiment. External validity: The extent to which the results of a study can be generalized or extended to others. What is an experiment?
  • 17. Galileo's hand-made drawing of the moon surface. Sidereus Nuncius (1610) External Validity
  • 18. Galileo's hand-made drawing of the moon surface. Sidereus Nuncius (1610) External Validity Telescope: From Land to Sky
  • 19. Galileo's hand-made drawing of the moon surface. Sidereus Nuncius (1610) External Validity Telescope: From Land to Sky Experiments: From Lab to Real Life
  • 20. Super-brief history of scientific experiments
  • 21. • Novum Organum (1620) • Scientific induction • Torturing Nature to extract her secrets Super-brief history of scientific experiments (1/3)
  • 22. • Novum Organum (1620) • Scientific induction • Torturing Nature to extract her secrets Super-brief history of scientific experiments (1/3) Ever heard of Phlogistons??
  • 23. “There is a property common to almost all the moral sciences, and by which they are distinguished from many of the physical; that is, that it is seldom in our power to make experiments with them” John Stuart Mill, 1836 Super-brief history of scientific experiments (2/3)
  • 24. “There is no laboratory in which economists can test their hypothesis” , 1993 Super-brief history of scientific experiments (2B/3)
  • 25. Nobel prize for Vernon Smith “for having established laboratory experiments as a tool in empirical economic analysis, especially in the study of alternative market mechanisms” 2002 Super-brief history of scientific experiments (3/3)
  • 26. The Puzzle of Cooperation
  • 28. The Ultimatum Game Rules: • 2 Players (A,B) • 100 $
  • 29. The Ultimatum Game Rules: • 2 Players (A,B) • 100 $ • Player A makes a proposal
  • 30. The Ultimatum Game Rules: • 2 Players (A,B) • 100 $ • Player A makes a proposal • Player B can accept or refuse the split.
  • 31. The Ultimatum Game Rules: • 2 Players (A,B) • 100 $ • Player A makes a proposal • Player B can accept or refuse the split. • If B accepts each one gets his/her share.
  • 32. The Ultimatum Game Rules: • 2 Players (A,B) • 100 $ • Player A makes a proposal • Player B can accept or refuse the split. • If B accepts each one gets his/her share. • If B refuses both players get nothing.
  • 33. The Ultimatum Game: How to Split 100$ Rules: • 2 Players (A,B) • 100 $ • Player A makes a proposal • Player B can accept or refuse the split. • If B accepts each one gets his/her share. • If B refuses both players get nothing.
  • 34. The Ultimatum Game: How to Split 100$ A B
  • 35. The Ultimatum Game: How to Split 100$ Proposer Respondent RationalRational
  • 36. The Ultimatum Game: How to Split 100$ Proposer Respondent I say 99 for me and 1 for you. RationalRational
  • 37. The Ultimatum Game: How to Split 100$ Proposer Respondent I say 99 for me and 1 for you. RationalRational I say OK.
  • 38. The Ultimatum Game: How to Split 100$ Human Being Human Being I say 99 for me and 1 for you.
  • 39. The Ultimatum Game: How to Split 100$ Human Being Human Being I say…$!!@** I say 99 for me and 1 for you.
  • 40. Nowak (2006) 5 rules for Cooperation
  • 41. Traditional Laboratory Research • Decision making tools, heuristics, models of human behavior
  • 42. Traditional Laboratory Research • Decision making tools, heuristics, models of human behavior • BUT
  • 43. Traditional Laboratory Research • Decision making tools, heuristics, models of human behavior • BUT • Small groups of individuals, generally 4-12 (bounded by uni. Lab)
  • 44. Traditional Laboratory Research • Decision making tools, heuristics, models of human behavior • BUT • Small groups of individuals, generally 4-12 (bounded by uni. Lab) • Behavior of individuals in social networks under-researched
  • 45. Traditional Laboratory Research • Decision making tools, heuristics, models of human behavior • BUT • Small groups of individuals, generally 4-12 (bounded by uni. Lab) • Behavior of individuals in social networks under-researched • Limited in the number of hypotheses that can be tested
  • 46. Traditional Laboratory Research • Decision making tools, heuristics, models of human behavior • BUT • Small groups of individuals, generally 4-12 (bounded by uni. Lab) • Behavior of individuals in social networks under-researched • Limited in the number of hypotheses that can be tested • Observations are limited in time
  • 47. Traditional Laboratory Research • Decision making tools, heuristics, models of human behavior • BUT • Small groups of individuals, generally 4-12 (bounded by uni. Lab) • Behavior of individuals in social networks under-researched • Limited in the number of hypotheses that can be tested • Observations are limited in time • Limited(?) external validity
  • 48. Traditional Laboratory Research • Decision making tools, heuristics, models of human behavior • BUT • Small groups of individuals, generally 4-12 (bounded by uni. Lab) • Behavior of individuals in social networks under-researched • Limited in the number of hypotheses that can be tested • Observations are limited in time • Limited(?) external validity • Generally high costs for an academic budget
  • 54. Install nodeGame 3.x 1. Go to http://nodegame.org 2. Click on the “Get Started” button 3. Follow instructions to install Development version 4. Keep following my talk!
  • 58. nodeGame 3.x Architecture Overview ~46.000 lines (including comments)
  • 59. Launch nodeGame 3.x Open a terminal and browse to the nodegame folder Start the server with the command: node launcher.js Open a browser and access the default ultimatum game at the url: localhost:8080/ultimatum Start an automated player (bot) at the url: localhost:8080/ultimatum?clientType=autoplay Access the administrator interface at the url: localhost:8080/ultimatum/monitor/
  • 60. Create a New Game cd nodegame/bin/ node nodegame create-game gamename <author> <email> Creates a new game in the games/ folder (usually nodegame/games/) Important! Windows users must install the nodegame-generator package manually from the git repository (or npm) git clone https://github.com/nodeGame/nodegame-generator.git cd nodegame-generator npm install
  • 61. Anatomy of a Game
  • 62. Anatomy of a Game Features: - Define game variables and treatments - Define the game sequence with the Stager API - Implement the game sequence into client types
  • 63. The Game Sequence and Client Types Game Sequence Client Types stager.stage("instructions") .step("instructions_1") .step("instructions_2") .step("instructions_3"); stager.stage("quiz"); stager.repeat("game", 3) stager.stage("questionnaire"); stager.extendStage("game", { steps: ["offer", "respond", . "display_results"] }); Code Snippet
  • 64. The Game Sequence and Client Types Game Sequence Client Types stager.stage("instructions") .step("instructions_1") .step("instructions_2") .step("instructions_3"); stager.stage("quiz"); stager.repeat("game", 3) stager.stage("questionnaire"); stager.extendStage("game", { steps: [ "offer", "respond", . "display_results" ] }); Code Snippet
  • 65. The Game Sequence and Client Types Game Sequence Client Types Client types implement the game sequence by extending its steps and stages.
  • 66. The Game Sequence and Client Types Game Sequence Client Types
  • 67. The Game Sequence and Client Types Game Sequence Client Types
  • 68. The Game Sequence and Client Types Game Sequence Client Types Code Snippet stager.setDefaultProperty("coins",100); stager.extendStage("game", { coins: 200 }); stager.extendStep("offer", { coins: 50 });
  • 69. The Game Sequence and Client Types Game Sequence Client Types Code Snippet stager.setDefaultProperty("coins",100); stager.extendStage("game", { coins: 200 }); stager.extendStep("offer", { coins: 50 }); node.game.getProperty("coins") returns 50 in step 'offer', 200 in steps 'respond' and 'display results' inside the 'game' stage, and 100 in any other step. Step/Stages Properties are hierarchical
  • 70. Some Built-in Step-Properties Property Description Type init Executed upon entering the step/stage function exit Executed upon exiting the step/stage function timer Sets the maximum execution time for step (ms) number timeup Executed if the timer expires function done Executed when the step terminates function cb The actual step execution function
  • 71. Logic Client Type Executed on the server, governs a game room - Makes groups - Keep track of game history - Handles disconnections and reconnections - Access to: - internal Database NDDB: node.game.memory - player list: node.game.pl - channel and registry object
  • 72. Player Client Types Executed on a client, e.g. a browser - Display/manipulate information on screen - Exchange messages with the server and other players - Respond to user events - Determine when the current step is finished (“done”) W (Window): manipulates information on screen and the behavior of user interface, e.g. disabling right click, locking screen, etc. At the end of each step, the game developer must call the method node.done, which triggers a procedure that advances the client to the next step.
  • 73. Inside a Step Callback Function Instructions Step - Player client type - No interaction with other players - No interaction with the page - No time limit - Simply click “Done” when finished reading and advance to next step
  • 74. Inside a Step Callback Function Instructions Step - Player client type - No interaction with other players - No interaction with the page - No time limit - Simply click “Done” when finished reading and advance to next step
  • 75. Inside a Step Callback Function stager.extendStep('instructions_1', { frame: "instr1.htm" }); Instructions Step - Player client type - No interaction with other players - No interaction with the page - No time limit - Simply click “Done” when finished reading and advance to next step
  • 76. Inside a Step Callback Function stager.extendStep('instructions_1', { frame: "instr1.htm" }); Widget Step - Player client type - No interaction with other players (at the moment) - Standardized interaction - With or without time limit - Register the mood of the participant using the PANAS method. Instructions Step - Player client type - No interaction with other players - No interaction with the page - No time limit - Simply click “Done” when finished reading and advance to next step
  • 77. Inside a Step Callback Function stager.extendStep('instructions_1', { frame: "instr1.htm" }); Widget Step - Player client type - No interaction with other players (at the moment) - Standardized interaction - With or without time limit - Register the mood of the participant using the PANAS method. Instructions Step - Player client type - No interaction with other players - No interaction with the page - No time limit - Simply click “Done” when finished reading and advance to next step
  • 78. Inside a Step Callback Function stager.extendStep('instructions_1', { frame: "instr1.htm" }); Widget Step - Player client type - No interaction with other players (at the moment) - Standardized interaction - With or without time limit - Register the mood of the participant using the PANAS method. Instructions Step - Player client type - No interaction with other players - No interaction with the page - No time limit - Simply click “Done” when finished reading and advance to next step stager.extendStep('instructions_2', { widget: "MoodGauge" });
  • 79. Roles (version 3.5 dev) stager.extendStep('bidder', { matcher: { // Available roles. roles: [ 'BIDDER', 'RESPONDENT'], // Each player is matched with a // partner and is assigned a role. match: 'roundrobin', // How to continue matching after // all combinations are exhausted cycle: 'repeat_invert' } }); Logic Client Type
  • 80. Roles (version 3.5 dev) stager.extendStep('bidder', { roles: { BIDDER: { frame: 'bidder.htm', cb: function() { // Bidder stuff. } }, RESPONDENT: { frame: 'resp.htm', cb: function() { // Respondent stuff. }}} }); Player Client Type stager.extendStep('bidder', { matcher: { // Available roles. roles: [ 'BIDDER', 'RESPONDENT'], // Each player is matched with a // partner and is assigned a role. match: 'roundrobin', // How to continue matching after // all combinations are exhausted cycle: 'repeat_invert' } }); Logic Client Type
  • 81. Inside the Step Callback Function // The respondent receives the offer, // displays it, and terminates the step. // On incoming data labeled "offer", // executes the function. node.on.data("offer", function(msg) { // Display offer using W. W.setInnerHTML("offer", msg.data); // End step. node.done(); }); // Player made a choice // and clicked the submit button. submit.onclick = function() { // Send offer to respondent. node.say("offer", "respondent", 1); // End step, store offer in server. node.done({ offer: 1 }); }; I say 99 for me and 1 for you. Proposer Respondent
  • 82. NDDB: Internal Database // The respondent receives the offer, // displays it, and terminates the step. // On incoming data labeled "offer", // executes the function. node.on.data("offer", function(msg) { // Display offer using W. W.setInnerHTML("offer", msg.data); // End step. node.done(); }); // Player made a choice // and clicked the submit button. submit.onclick = function() { // Send offer to respondent. node.say("offer", "respondent", 1); // End step, store offer in server. node.done({ offer: 1}); }; I say 99 for me and 1 for you. Proposer Respondent Logic Client Type NDDB database node.game.memory
  • 83. NDDB: Internal Database node.done({ offer: 1 }); // Set an object in memory explicitly. node.set({ foo: "bar" });
  • 84. NDDB: Internal Database { stage: { stage: 2, step: 1, round: 1 }, player: "respondent", timestamp: 1480336721939 offer: 1, // foo: "bar" // node.done specific. timeup: false, time: 4321, // from step. done: true }; node.done({ offer: 1 }); // Set an object in memory explicitly. node.set({ foo: "bar" });
  • 85. NDDB: Internal Database var m = node.game.memory; // NDDB instance. // Lazy loading. m.select("player", "=", "respondent"); m.and("stage.step", "=", 1) .and("offer") .fetch()[0]; // Use indexes. m.player["respondent"].last(); m.stage["2.1.1"].select("offer").fetch()[0]; node.done({ offer: 1 }); // Set an object in memory explicitly. node.set({ foo: "bar" }); { stage: { stage: 2, step: 1, round: 1 }, player: "respondent", timestamp: 1480336721939 offer: 1, // foo: "bar" // node.done specific. timeup: false, time: 4321, // from step. done: true };
  • 86. NDDB: Internal Database // Modify database items upon inserting them. node.game.memory.on("insert", function(item) { // Decorate item or save it somewhere else. }); // Disable internal database completely. // Remove default event listener. node.off('in.set.DATA'); // Add new one. node.on('in.set.DATA', function(msg) { // Save msg somewhere else, e.g. Mongo. }); Event Listener Manager node.game.events
  • 87. NDDB: Internal Database // Modify database items upon inserting them. node.game.memory.on("insert", function(item) { // Decorate item or save it somewhere else. }); // Disable internal database completely. // Remove default event listener. node.off('in.set.DATA'); // Add new one. node.on('in.set.DATA', function(msg) { // Save msg somewhere else, e.g. Mongo. }); Event Listener Manager node.game.events
  • 88. Events in nodeGame 3.x Internal: generated by the game or by the nodeGame engine. Incoming: triggered by incoming messages, 'in.[target].[action]', ‘in.set.DATA’
  • 89. Events in nodeGame 3.x Internal: generated by the game or by the nodeGame engine. Incoming: triggered by incoming messages, 'in.[target].[action]', ‘in.set.DATA’ // Registering an internal event listener. node.on('LOCAL_EVENT', function(a, b) { // This is local event. }); // Triggering a local event. node.emit('LOCAL_EVENT', 1, 2);
  • 90. Events in nodeGame 3.x Internal: generated by the game or by the nodeGame engine. Incoming: triggered by incoming messages, 'in.[target].[action]', ‘in.set.DATA’ // Registering an internal event listener. node.on('LOCAL_EVENT', function(a, b) { // This is local event. }); // Listening for incoming DATA msgs. node.on('in.say.DATA', function(msg) { // I got a data msg! }); // Listening for incoming "foo" DATA msgs. node.on.data('foo', function(msg) { // I got a data msg labeled "foo"! }); // Triggering a local event. node.emit('LOCAL_EVENT', 1, 2); // Triggering a local event. node.say('foo', "bar");
  • 91. Events in nodeGame 3.x Events are hierarchically organized, where you register your event matters!
  • 92. Events in nodeGame 3.x Events are hierarchically organized, where you register your event matters! // Listening for incoming "foo" DATA msgs. node.on.data('foo', function(msg) { // I got a data msg labeled "foo"! });
  • 93. Events in nodeGame 3.x Events are hierarchically organized, where you register your event matters! // Listening for incoming "foo" DATA msgs. node.on.data('foo', function(msg) { // I got a data msg labeled "foo"! }); Valid only in Quiz stage
  • 94. Events in nodeGame 3.x Events are hierarchically organized, where you register your event matters! // Listening for incoming "foo" DATA msgs. node.on.data('foo', function(msg) { // I got a data msg labeled "foo"! }); Registered in init or cb function of Step 3.3 Valid only in step 3.3 (any round).
  • 95. Events in nodeGame 3.x Events are hierarchically organized, where you register your event matters! // Listening for incoming "foo" DATA msgs. node.on.data('foo', function(msg) { // I got a data msg labeled "foo"! }); Registered in the init function of “Game” Valid throughout all steps of “Game” stage
  • 96. Events in nodeGame 3.x Events are hierarchically organized, where you register your event matters! How to register a listener valid throughout all the game?
  • 97. Events in nodeGame 3.x Events are hierarchically organized, where you register your event matters! stager.setInitCb(function() { // Listening for incoming "foo" DATA msgs. node.on.data('foo', function(msg) { // I got a data msg labeled "foo"! }); }); How to register a listener valid throughout all the game? In the init function of the game!
  • 98. Anatomy of a Game
  • 99. Topics Covered and To Cover
  • 100. Topics Covered and To Cover
  • 101. Recruiting Participants Free Platforms Psychological Research on the Net http://psych.hanover.edu/research/exponnet.html The Web Experiment List http://www.wexlist.net Online Social Psychology Studies http://www.socialpsychology.org/expts.htm Volunteer Science http://www.volunteerscience.com
  • 102. Recruiting Participants Commercial Platforms ODesk, Freelancer, Elance, Guru, CrowdFlower, Innocentive, SurveySampling, UpWork … Most used in research:
  • 103. How To Run a Game on AMT: The Big Picture 1. Upload nodeGame server + game to a server e.g. Heroku cloud: https://github.com/nodeGame/nodegame-heroku 2. Create a new HIT on Amazon Mechanical Turk (AMT), e.g. using the requester interface or other service API. 3. Use the nodegame-mturk package https://github.com/nodeGame/nodegame-mturk/ to handle: - Connection and authentication from AMT HIT page to nodeGame server. - Opening/expiring/extending HIT while running it. - Payments, bonuses and qualifications after HIT is done.
  • 104. Known Issues Conducting Synchronous Experiments on AMT 1. Not a survey or classification task, need to have DIFFERENT people at the same time on your platform
  • 105. Known Issues Conducting Synchronous Experiments on AMT 1. Not a survey or classification task, need to have DIFFERENT people at the same time on your platform 2. Btw, not too few, not too many
  • 106. Known Issues Conducting Synchronous Experiments on AMT 1. Not a survey or classification task, need to have DIFFERENT people at the same time on your platform 2. Btw, not too few, not too many 3. Waiting time in the waiting room should be limited and homogenous across participants
  • 107. Known Issues Conducting Synchronous Experiments on AMT 1. Not a survey or classification task, need to have DIFFERENT people at the same time on your platform 2. Btw, not too few, not too many 3. Waiting time in the waiting room should be limited and homogenous across participants 4. Demographics should be stratified as much as possible
  • 108. Known Issues Conducting Synchronous Experiments on AMT 1. Not a survey or classification task, need to have DIFFERENT people at the same time on your platform 2. Btw, not too few, not too many 3. Waiting time in the waiting room should be limited and homogenous across participants 4. Demographics should be stratified as much as possible 5. Participants should not re-take the same experiment again
  • 109. Known Issues Conducting Synchronous Experiments on AMT 1. Not a survey or classification task, need to have DIFFERENT people at the same time on your platform 2. Btw, not too few, not too many 3. Waiting time in the waiting room should be limited and homogenous across participants 4. Demographics should be stratified as much as possible 5. Participants should not re-take the same experiment again 6. Dropouts rate (non-completing the HIT) signigicantly affects the whole experiment, increasing costs $$ and time to complete it
  • 110. Known Issues Conducting Synchronous Experiments on AMT 1. Not a survey or classification task, need to have DIFFERENT people at the same time on your platform Pay minimum wage (at least). Make bonus dependent on performance
  • 111. Known Issues Conducting Synchronous Experiments on AMT 1. Not a survey or classification task, need to have DIFFERENT people at the same time on your platform 2. Btw, not too few, not too many Rule of thumb: 2.8 times desidered number of participants Expire HIT as soon as desired number of participant entered the experimental pipeline (+small buffer) 3x
  • 112. Known Issues Conducting Synchronous Experiments on AMT 1. Not a survey or classification task, need to have DIFFERENT people at the same time on your platform 2. Btw, not too few, not too many 3. Waiting time in the waiting room should be limited and homogenous across participants Rule of thumb: 2.8 times desidered number of participants Expire HIT as soon as desired number of participant entered the experimental pipeline (+small buffer) Dispose participants who waited too long (compensated)
  • 113. Known Issues Conducting Synchronous Experiments on AMT 4. Demographics should be stratified as much as possible Waiting room can group players based on features Collect some demographics features in a pre-experimental part Start 2 (or more) groups at the same time
  • 114. Known Issues Conducting Synchronous Experiments on AMT 5. Participants should not re-take the same experiment again Create one HIT (no group) with 3x rule Keep track of turker ids (nodegame-mturk) Assign qualification via AMT API (nodegame-mturk)
  • 115. Known Issues Conducting Synchronous Experiments on AMT 6. Rate of dropouts (non-completing the HIT) significantly affects the whole experiment, increasing costs $$ and time to complete it • Make sure waiting time is not too long (previous advices)
  • 116. Known Issues Conducting Synchronous Experiments on AMT 6. Rate of dropouts (non-completing the HIT) significantly affects the whole experiment, increasing costs $$ and time to complete it • Make sure waiting time is not too long (previous advices) • Inform about required time BEFORE and DURING experiment
  • 117. Known Issues Conducting Synchronous Experiments on AMT 6. Rate of dropouts (non-completing the HIT) significantly affects the whole experiment, increasing costs $$ and time to complete it • Make sure waiting time is not too long (previous advices) • Inform about required time BEFORE and DURING experiment • Design experiments that are robust to dropout (as much as possible). For example, use shares instead of fixed quantities.
  • 118. Known Issues Conducting Synchronous Experiments on AMT 6. Rate of dropouts (non-completing the HIT) significantly affects the whole experiment, increasing costs $$ and time to complete it • Make sure waiting time is not too long (previous advices) • Inform about required time BEFORE and DURING experiment • Design experiments that are robust to dropout (as much as possible). For example, use shares instead of fixed quantities. • Use requirements checkings.
  • 119. Known Issues Conducting Synchronous Experiments on AMT 6. Rate of dropouts (non-completing the HIT) significantly affects the whole experiment, increasing costs $$ and time to complete it • Make sure waiting time is not too long (previous advices) • Inform about required time BEFORE and DURING experiment • Design experiments that are robust to dropout (as much as possible). For example, use shares instead of fixed quantities. • Use requirements checkings. • Use “seriousness checks” and “warm-up” phases.
  • 120. How To Run a Game on AMT
  • 121. AMT How To Run a Game on AMT AMT HIT
  • 122. Not Just Experiments, also Gamification • Industry: lots of A/B testing and customer surveys • Gamification: applies elements of game playing to solve complex and simple problems • Increasing trend • Improve engagement and understanding • Fun • Generate More and Better Ideas • Train Machine Learning Algorithms (http://quickdraw.withgoogle.com)
  • 123. Contributions Welcome! • Using it, request features, report bugs • Help developing • Extremely well documented source code
  • 124. Contributions Welcome! • Using it, request features, report bugs • Help developing • Extremely well documented source code
  • 125. Thank You! @balietti | @nodegameorg | stefanobalietti.com | nodegame.org