Prof. Pier Luca Lanzi
Data-Driven Game Design
Pier Luca Lanzi & Daniele Loiacono
testing
production
pre
production
Version Concept/Design AlphaVersion BetaVersion Gold Master/ReleaseVersion
initiation
beta release
http://www.gamesradar.com/best-atari-2600-games-all-time/
http://kotaku.com/5957989/the-atari-2600-et--video-game-is-still-terrible-even-when-its-finished-in-less-than-30-seconds
Pier Luca Lanzi & Daniele Loiacono
However, smaller studios …
•  Have shorter development windows
•  Fewer chances of extensive playtesting
•  What about early access?
9
Pier Luca Lanzi & Daniele Loiacono
Mobile Game Development
•  Several companies follow the same development used for traditional
platforms and invest 1-2 years on large projects
•  However the approach is infeasible for most mobile/indie companies
which cannot sustain such a “long” cycle
•  Success in the mobile market appears not to follow established criteria
•  Long projects are perceived as too risky
•  Recent strategies favor the rapid exploration of new ideas
and follow only the more successful ones
§  Development 2-3 months (4-6 applications per year)
§  Follow up only to the most successful ones
10
video
game
sales
in-app
purchases
user data
gameplay
data
playing
habits
modding
social
networks
collect
game data
release
developmentgame design
analyze
game data
initiation
design
developanalyze
data
Data Mining Basics
Exploratory Data Analysis
Clustering
Classification
Graph Mining
Examples
Predicting Churn
Pier Luca Lanzi & Daniele Loiacono
Predicting Churn in Aion (Dmitry Nozhnin)
•  Can we predict new players' churn the day
they logged in for the last time?
•  Churn = inactivity for 7 days
•  Variables considered
§ Playtime at current level, previous
level, and total during lifetime
§ Mobs killed per minute
(current/previous/lifetime)
§ Quests completed per minute (same)
§ Average playtime per play day
§ Days of play
§ Absenteeism rate (number of days skipped during the seven day free trial)
21
Player Modeling
Pier Luca Lanzi & Daniele Loiacono
Player Modeling in Tomb Raider Underworld
(Tobias Mahlmann & c.)
•  Analysis on 1365 players that completed the game (over 25250 players)
•  Clustering with Self Organizing Maps of players based on several statistics
§ Causes of deaths (environment, opponents, and falling)
§ Total deaths
§ Completion Time
§ Help on demand
•  Four types of players identified
§ Veterans
§ Solvers
§ Pacifists
§ Runners
23
Gaussian kernel. The learning rate is set to 0.7 but is
reased linearly during training reaching the value of 0.1 at
end of the 100 training epochs used. The training samples
presented in a randomly permuted order at each epoch
he algorithm.
n order to minimize the effect of non-deterministic se-
ion of initial weight values we repeat the training 20
es — using dissimilar initial weight vectors — and select
Research
Player Modeling in Quake Live
players’ social network
geographical distribution
friendship relations
gaming relations
player modeling
playing preferences
player groups
…
Collecting Data
221,857 users over 211 nations
Pier Luca Lanzi & Daniele Loiacono
Some findings
•  When considering 221,857 users
§ 40% of users has at least one friend from their own country
§ 22% of users has only friends from their own country
§ Only 5% of users ever played with their friends
•  In Quake Live there are 1713 clans,
§ 4% of the players belong to a clan
§ 70% of users has clan-mates also as friends
§ 70% of clans are formed by users all from the same country
§ 30% of users ever played with clan mates
30
Clustering Quake Live data based on (i) preferred match type, (ii)
weapon of choice, hours played, etc.
Expert Strategic
Lone Novice
0
0.5
1
1.5
2
Expert Strategic Lone Novice
win/loss kill/death kill per min
53%
17%
15%
78%
11%
8%
Expert Players
76%
13%
10%
75%
9%
6%
Strategic Players
87%
5%
4%
73%
14%
7%
Lone Players
48%
29%
12%
56%
21%
10%
Novice Players
Rapid Playtest and Analysis
the task
develop one video game for Windows Phone
to participate in the 2012 Microsoft Imagine Cup
the challenges
short development (four months from start to end)
small user base (almost nobody had a Windows Phone)
variety of platform with rather different features
secrecy! the app could not be distributed before submission
our approach
instrument the application code
to trace almost everything the users could do
perform very short play testing sessions (1-2 days)
apply data mining to the collected data to
extract typical users’ behavior to evaluate gameplay
check users’ behavior on different platforms
Pier Luca Lanzi & Daniele Loiacono
Bad Blood – A Serious Game About Diseases
•  Casual game for Windows phones developed during the
Videogame Design and Programming course at the
Politecnico di Milano
•  Bad Blood aims at spreading the knowledge about human
diseases through a series of games settled in blood
vessels, in the respiratory system, and in the brain
•  Five continents, in which players can select a specific
region (e.g., West Australia) that also corresponds to a
disease and thus to a specific scenario
•  Four game mechanics: attack, tap, survive and puzzle
39
Pier Luca Lanzi & Daniele Loiacono
Pier Luca Lanzi & Daniele Loiacono
Collecting Game Data
•  Our analysis focused on the two game modes with the highest interactivity
(attack and tap)
•  Code was instrumented to collect any possible information (raw data) about
user behavior every 200ms
•  The raw data were then elaborated to compute several variables including
§ length and direction of the swipe gesture
§ center position of the players’ cells during collisions
§ number of opponents in every screen
§ the number of hits and misses in every seconds
§ the positions of the hits and misses
§ …
41
Pier Luca Lanzi & Daniele Loiacono
Attack Mode: Trajectory of Users’ Swipes 42
Pier Luca Lanzi & Daniele Loiacono
Good Taps & Bad Taps 43
Pier Luca Lanzi & Daniele Loiacono
Our Flawed Gameplay 44
Pier Luca Lanzi & Daniele Loiacono
How We Solved the Issue in
Time for Submission
•  We modified the gameplay before the final
submission to the competition
•  Each level in attack mode has a random instant
mini boss fight involving bigger bacteria and
viruses
•  The users has to instantly increase the firing
rate to be able to destroy the enemy before it
can hit the player or disappear at the bottom
of the screen
45
Pier Luca Lanzi & Daniele Loiacono
Take-Home Message
•  We would never make the submission with a more traditional approach to playtesting
•  Instrumenting the code helped us getting the best out of the relatively few users we
could test our game with
•  The analysis of the collected data helped us
§ Improving the touch interface (and colliders’ placement)
§ Discovering a major design flaw that would have made the game boring
•  We did not win the Microsoft Imagine Cup 2012! L But we won “Share Care” a major
national competition for serious games devoted to blood donation and a special prize
for innovation J
46
Mining Design Patterns
Pier Luca Lanzi & Daniele Loiacono
Level Design in First Person Shooters
•  Level design involves
§ Map geometry
§ Navigation meshes
§ Pickup locations
§ Key areas (e.g. flags)
•  Level design affect players’ experience in
terms of challenge, pace, strategy, team-
play, etc.
49
Pier Luca Lanzi & Daniele Loiacono
Level Design
•  Rely on the designer’s experience
•  Trial and error process
•  There are several books and studies but a little
consolidated knowledge
•  Several heuristics and trick of the trade
•  Abstraction and generalization are not obvious
50
research question
Can we collect meaningful data from maps?
Can we apply data mining to learn interesting design patterns?
What do players/modders like?
Can we use this patterns to support design process?
How discovered patterns affect gameplay?
Pier Luca Lanzi & Daniele Loiacono
Unreal Tournament III (UT3)
•  “Old school” competitive FPS
§ several maps available
§ parameterized AI
§ easily customizable
§ already used for research
•  Different game modes
•  Several weapon types
§ Flak Cannon (short range)
§ Rocket Launcher (medium range)
§ Shock Rifle (medium range)
§ Sniper Rifle (long range)
52
Extended Game Server
Data Filtering Backend (Java)
Gephi Graph
Manipulation
Software
Custom Bots
(e.g., fixed weapons,
explorer)
Weka Open Source
DataminingTool
Pier Luca Lanzi & Daniele Loiacono
Collected Data (1)
•  A graph representation of the maps
is obtained by the navigation mesh
•  Nodes features include
§ Type (Powerup/Ammo/Weapon/
Navigation)
§ Position
§ In/Out Degree
§ Closeness Centrality
§ Betweennes Centrality
§ Clustering Coefficient
54
Pier Luca Lanzi & Daniele Loiacono
Collected Data (2)
•  More statistics are computed with
a breadth first exploration using a bot
•  Edge features include
§ Traveling time
§ Length
§ Special actions/items
§ Jumps
§ Edge morphology (raycast)
55
Team Deathmatch Maps vs Duel Maps
Node Classification
Weapon-Map Relationship
Weapon Pickup Distribution
Ammo Pickup Distribution
Pier Luca Lanzi & Daniele Loiacono
Node Classification
Authority
Betweenness Centrality
Degree
classification of c
Algorithm ammo pickups w
Majority Guess 62.90
Naive Bayes 42.32 ± 4.15
Decision Trees (J4.8) 67.89 ± 5.45
Classification Rules (JRip) 69.75 ± 5.58
Logistic Regression 69.54 ± 6.31
TABLE IV: Prediction of the node’s type (navigation node, ammo p
different algorithms applied to classify the nodes of all the maps, of D
Guess always predicts the most frequent class in the dataset and is r
Algorithm All Maps Du
Majority Guess 70.44 6
Naive Bayes 46.34 ± 4.26 46.3
Decision Trees (J4.8) 70.18 ± 2.75 70.1
Classification Rules (JRip) 71.59 ± 1.71 71.5
Logistic Regression 69.85 ± 1.07 69.8
classification of c
Algorithm ammo pickups w
Majority Guess 62.90
Naive Bayes 42.32 ± 4.15 4
Decision Trees (J4.8) 67.89 ± 5.45
Classification Rules (JRip) 69.75 ± 5.58 5
Logistic Regression 69.54 ± 6.31 6
TABLE IV: Prediction of the node’s type (navigation node, ammo p
different algorithms applied to classify the nodes of all the maps, of D
Guess always predicts the most frequent class in the dataset and is r
Algorithm All Maps Due
Majority Guess 70.44 6
Naive Bayes 46.34 ± 4.26 46.3
Decision Trees (J4.8) 70.18 ± 2.75 70.1
Classification Rules (JRip) 71.59 ± 1.71 71.5
Logistic Regression 69.85 ± 1.07 69.8
59
0
2
4
6
8
10
12
14
16
18
20
BioHazard
Idoma
Liandri
DeckFPS
Diesel
Penetrated
SalvationFearless
Hypoxia
RisingSunF
Sanctuary
Sentinel
Subterranee
Flak Cannon vs Rocket Launcher
Pier Luca Lanzi & Daniele Loiacono
Conclusions
•  This is a preliminary work…
•  … but this framework could be used to discover, analyze and
understand interesting patterns in FPS maps
•  Future works include:
§ Further investigation of gameplay dynamics
§ Better visualization of game dynamics on the maps (e.g.,
heathmap of deaths on the map)
§ Use the framework to allow what-if analysis and map
annotation
Balancing Gameplay
Pier Luca Lanzi & Daniele Loiacono
Balancing Multiplayer First-Person Shooters
•  Providing the “right amount” of challenge is very important. Multiplayer games
are more difficult to balance
•  Balance depends on the players’ skill, the playing strategies, the game
environment, the weapons, etc.
•  How can we evaluate if an FPS is balanced? It is mainly subjective! However,
the distribution of kills/scores among players could be a good proxy
•  For example, in a 2-players match best player should kill the opponent less
than twice the time it has been killed
64
Balancing multiplayer games is both
a design and a matchmaking problem
design match making
research question
How the map affect the match balancing?
Can we automatically design map to improve balancing?
f=0.92 f=0.96
BOT1 SKILL
BOT2SKILL
BOT1 SKILL
BOT2SKILL
EVOLUTION
>84% 66%-84% 50%-66% 33%-50% 16%-33%
f=0.93 f=0.98
Pier Luca Lanzi & Daniele Loiacono
Take-Home Message
•  Good News
§ Maps can be evolved to improve balancing
§ It works (even better) with players with different weapons
§ It can be combined with other balancing approaches
•  Bad News
§ Bots are used to measure balancing (i.e., accuracy bias)
§ Requires modeling of player
72
Pacing the Gameplay
Pier Luca Lanzi & Daniele Loiacono
Data-Driven Game Design
•  Video games can generate and collect huge amount of data
•  These data contain potentially useful information that can help
improving the design or inspiring new designs
•  Advanced data mining methods are required to analyze such data
so as to produce models and knowledge to support designers
79
http://www.polimigamecollective.org
http://www.facebook.com/polimigamecollective
http://www.youtube.com/PierLucaLanzi
pierluca.lanzi@polimi.it
Pier Luca Lanzi & Daniele Loiacono
References
•  Churn
§  http://gamasutra.com/view/feature/170472/predicting_churn_datamining_your_.php?page=1
§  http://www.gamasutra.com/view/feature/176747/predicting_churn_when_do_veterans_.php?print=1
•  Player Modeling
§  http://julian.togelius.com/Mahlmann2010Predicting.pdf
81

Data Driven Game Design

  • 1.
    Prof. Pier LucaLanzi Data-Driven Game Design Pier Luca Lanzi & Daniele Loiacono
  • 4.
    testing production pre production Version Concept/Design AlphaVersionBetaVersion Gold Master/ReleaseVersion initiation beta release
  • 5.
  • 6.
  • 9.
    Pier Luca Lanzi& Daniele Loiacono However, smaller studios … •  Have shorter development windows •  Fewer chances of extensive playtesting •  What about early access? 9
  • 10.
    Pier Luca Lanzi& Daniele Loiacono Mobile Game Development •  Several companies follow the same development used for traditional platforms and invest 1-2 years on large projects •  However the approach is infeasible for most mobile/indie companies which cannot sustain such a “long” cycle •  Success in the mobile market appears not to follow established criteria •  Long projects are perceived as too risky •  Recent strategies favor the rapid exploration of new ideas and follow only the more successful ones §  Development 2-3 months (4-6 applications per year) §  Follow up only to the most successful ones 10
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
    Pier Luca Lanzi& Daniele Loiacono Predicting Churn in Aion (Dmitry Nozhnin) •  Can we predict new players' churn the day they logged in for the last time? •  Churn = inactivity for 7 days •  Variables considered § Playtime at current level, previous level, and total during lifetime § Mobs killed per minute (current/previous/lifetime) § Quests completed per minute (same) § Average playtime per play day § Days of play § Absenteeism rate (number of days skipped during the seven day free trial) 21
  • 22.
  • 23.
    Pier Luca Lanzi& Daniele Loiacono Player Modeling in Tomb Raider Underworld (Tobias Mahlmann & c.) •  Analysis on 1365 players that completed the game (over 25250 players) •  Clustering with Self Organizing Maps of players based on several statistics § Causes of deaths (environment, opponents, and falling) § Total deaths § Completion Time § Help on demand •  Four types of players identified § Veterans § Solvers § Pacifists § Runners 23 Gaussian kernel. The learning rate is set to 0.7 but is reased linearly during training reaching the value of 0.1 at end of the 100 training epochs used. The training samples presented in a randomly permuted order at each epoch he algorithm. n order to minimize the effect of non-deterministic se- ion of initial weight values we repeat the training 20 es — using dissimilar initial weight vectors — and select
  • 24.
  • 25.
  • 27.
    players’ social network geographicaldistribution friendship relations gaming relations player modeling playing preferences player groups …
  • 28.
  • 29.
    221,857 users over211 nations
  • 30.
    Pier Luca Lanzi& Daniele Loiacono Some findings •  When considering 221,857 users § 40% of users has at least one friend from their own country § 22% of users has only friends from their own country § Only 5% of users ever played with their friends •  In Quake Live there are 1713 clans, § 4% of the players belong to a clan § 70% of users has clan-mates also as friends § 70% of clans are formed by users all from the same country § 30% of users ever played with clan mates 30
  • 31.
    Clustering Quake Livedata based on (i) preferred match type, (ii) weapon of choice, hours played, etc. Expert Strategic Lone Novice 0 0.5 1 1.5 2 Expert Strategic Lone Novice win/loss kill/death kill per min
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
    the task develop onevideo game for Windows Phone to participate in the 2012 Microsoft Imagine Cup the challenges short development (four months from start to end) small user base (almost nobody had a Windows Phone) variety of platform with rather different features secrecy! the app could not be distributed before submission
  • 38.
    our approach instrument theapplication code to trace almost everything the users could do perform very short play testing sessions (1-2 days) apply data mining to the collected data to extract typical users’ behavior to evaluate gameplay check users’ behavior on different platforms
  • 39.
    Pier Luca Lanzi& Daniele Loiacono Bad Blood – A Serious Game About Diseases •  Casual game for Windows phones developed during the Videogame Design and Programming course at the Politecnico di Milano •  Bad Blood aims at spreading the knowledge about human diseases through a series of games settled in blood vessels, in the respiratory system, and in the brain •  Five continents, in which players can select a specific region (e.g., West Australia) that also corresponds to a disease and thus to a specific scenario •  Four game mechanics: attack, tap, survive and puzzle 39
  • 40.
    Pier Luca Lanzi& Daniele Loiacono
  • 41.
    Pier Luca Lanzi& Daniele Loiacono Collecting Game Data •  Our analysis focused on the two game modes with the highest interactivity (attack and tap) •  Code was instrumented to collect any possible information (raw data) about user behavior every 200ms •  The raw data were then elaborated to compute several variables including § length and direction of the swipe gesture § center position of the players’ cells during collisions § number of opponents in every screen § the number of hits and misses in every seconds § the positions of the hits and misses § … 41
  • 42.
    Pier Luca Lanzi& Daniele Loiacono Attack Mode: Trajectory of Users’ Swipes 42
  • 43.
    Pier Luca Lanzi& Daniele Loiacono Good Taps & Bad Taps 43
  • 44.
    Pier Luca Lanzi& Daniele Loiacono Our Flawed Gameplay 44
  • 45.
    Pier Luca Lanzi& Daniele Loiacono How We Solved the Issue in Time for Submission •  We modified the gameplay before the final submission to the competition •  Each level in attack mode has a random instant mini boss fight involving bigger bacteria and viruses •  The users has to instantly increase the firing rate to be able to destroy the enemy before it can hit the player or disappear at the bottom of the screen 45
  • 46.
    Pier Luca Lanzi& Daniele Loiacono Take-Home Message •  We would never make the submission with a more traditional approach to playtesting •  Instrumenting the code helped us getting the best out of the relatively few users we could test our game with •  The analysis of the collected data helped us § Improving the touch interface (and colliders’ placement) § Discovering a major design flaw that would have made the game boring •  We did not win the Microsoft Imagine Cup 2012! L But we won “Share Care” a major national competition for serious games devoted to blood donation and a special prize for innovation J 46
  • 47.
  • 49.
    Pier Luca Lanzi& Daniele Loiacono Level Design in First Person Shooters •  Level design involves § Map geometry § Navigation meshes § Pickup locations § Key areas (e.g. flags) •  Level design affect players’ experience in terms of challenge, pace, strategy, team- play, etc. 49
  • 50.
    Pier Luca Lanzi& Daniele Loiacono Level Design •  Rely on the designer’s experience •  Trial and error process •  There are several books and studies but a little consolidated knowledge •  Several heuristics and trick of the trade •  Abstraction and generalization are not obvious 50
  • 51.
    research question Can wecollect meaningful data from maps? Can we apply data mining to learn interesting design patterns? What do players/modders like? Can we use this patterns to support design process? How discovered patterns affect gameplay?
  • 52.
    Pier Luca Lanzi& Daniele Loiacono Unreal Tournament III (UT3) •  “Old school” competitive FPS § several maps available § parameterized AI § easily customizable § already used for research •  Different game modes •  Several weapon types § Flak Cannon (short range) § Rocket Launcher (medium range) § Shock Rifle (medium range) § Sniper Rifle (long range) 52
  • 53.
    Extended Game Server DataFiltering Backend (Java) Gephi Graph Manipulation Software Custom Bots (e.g., fixed weapons, explorer) Weka Open Source DataminingTool
  • 54.
    Pier Luca Lanzi& Daniele Loiacono Collected Data (1) •  A graph representation of the maps is obtained by the navigation mesh •  Nodes features include § Type (Powerup/Ammo/Weapon/ Navigation) § Position § In/Out Degree § Closeness Centrality § Betweennes Centrality § Clustering Coefficient 54
  • 55.
    Pier Luca Lanzi& Daniele Loiacono Collected Data (2) •  More statistics are computed with a breadth first exploration using a bot •  Edge features include § Traveling time § Length § Special actions/items § Jumps § Edge morphology (raycast) 55
  • 56.
    Team Deathmatch Mapsvs Duel Maps Node Classification Weapon-Map Relationship
  • 57.
  • 58.
  • 59.
    Pier Luca Lanzi& Daniele Loiacono Node Classification Authority Betweenness Centrality Degree classification of c Algorithm ammo pickups w Majority Guess 62.90 Naive Bayes 42.32 ± 4.15 Decision Trees (J4.8) 67.89 ± 5.45 Classification Rules (JRip) 69.75 ± 5.58 Logistic Regression 69.54 ± 6.31 TABLE IV: Prediction of the node’s type (navigation node, ammo p different algorithms applied to classify the nodes of all the maps, of D Guess always predicts the most frequent class in the dataset and is r Algorithm All Maps Du Majority Guess 70.44 6 Naive Bayes 46.34 ± 4.26 46.3 Decision Trees (J4.8) 70.18 ± 2.75 70.1 Classification Rules (JRip) 71.59 ± 1.71 71.5 Logistic Regression 69.85 ± 1.07 69.8 classification of c Algorithm ammo pickups w Majority Guess 62.90 Naive Bayes 42.32 ± 4.15 4 Decision Trees (J4.8) 67.89 ± 5.45 Classification Rules (JRip) 69.75 ± 5.58 5 Logistic Regression 69.54 ± 6.31 6 TABLE IV: Prediction of the node’s type (navigation node, ammo p different algorithms applied to classify the nodes of all the maps, of D Guess always predicts the most frequent class in the dataset and is r Algorithm All Maps Due Majority Guess 70.44 6 Naive Bayes 46.34 ± 4.26 46.3 Decision Trees (J4.8) 70.18 ± 2.75 70.1 Classification Rules (JRip) 71.59 ± 1.71 71.5 Logistic Regression 69.85 ± 1.07 69.8 59
  • 60.
  • 61.
    Pier Luca Lanzi& Daniele Loiacono Conclusions •  This is a preliminary work… •  … but this framework could be used to discover, analyze and understand interesting patterns in FPS maps •  Future works include: § Further investigation of gameplay dynamics § Better visualization of game dynamics on the maps (e.g., heathmap of deaths on the map) § Use the framework to allow what-if analysis and map annotation
  • 62.
  • 64.
    Pier Luca Lanzi& Daniele Loiacono Balancing Multiplayer First-Person Shooters •  Providing the “right amount” of challenge is very important. Multiplayer games are more difficult to balance •  Balance depends on the players’ skill, the playing strategies, the game environment, the weapons, etc. •  How can we evaluate if an FPS is balanced? It is mainly subjective! However, the distribution of kills/scores among players could be a good proxy •  For example, in a 2-players match best player should kill the opponent less than twice the time it has been killed 64
  • 65.
    Balancing multiplayer gamesis both a design and a matchmaking problem
  • 66.
  • 67.
    research question How themap affect the match balancing? Can we automatically design map to improve balancing?
  • 68.
  • 70.
  • 71.
  • 72.
    Pier Luca Lanzi& Daniele Loiacono Take-Home Message •  Good News § Maps can be evolved to improve balancing § It works (even better) with players with different weapons § It can be combined with other balancing approaches •  Bad News § Bots are used to measure balancing (i.e., accuracy bias) § Requires modeling of player 72
  • 73.
  • 79.
    Pier Luca Lanzi& Daniele Loiacono Data-Driven Game Design •  Video games can generate and collect huge amount of data •  These data contain potentially useful information that can help improving the design or inspiring new designs •  Advanced data mining methods are required to analyze such data so as to produce models and knowledge to support designers 79
  • 80.
  • 81.
    Pier Luca Lanzi& Daniele Loiacono References •  Churn §  http://gamasutra.com/view/feature/170472/predicting_churn_datamining_your_.php?page=1 §  http://www.gamasutra.com/view/feature/176747/predicting_churn_when_do_veterans_.php?print=1 •  Player Modeling §  http://julian.togelius.com/Mahlmann2010Predicting.pdf 81