SlideShare ist ein Scribd-Unternehmen logo
1 von 142
Downloaden Sie, um offline zu lesen
Modelling game economy ! 
with Neo4j
agenda
Hi, my name is Yan Cui.
1MDAILY 
ILLION USERS 
ACTIVE
250 
MILLION DAY 
REQUEST 
PER
location
500+ Spots
location 
episodic
London 2012
Nan Jing 2013
location 
episodic 
multi-player
herebemonstersgame.com 
iPad 
buddies
location 
episodic 
multi-player 
RPG
4000 Items
800 Recipes
1500+ Quests
100+ Monsters
game 
balancing
item 
Pricing
item 
Pricing
item 
Pricing
item 
Pricing
manual game 
balancing is SLOW
it is REPETITIVE
ERROR-PRONE! 
SUBJECTIVE
there must be a 
better way...
Hello, Neo4j 
The rabbit hole sounds pretty good right about now!
catching 
BIGFOOT
catch rate 
location bait 
attraction rate
as a graph in Neo4j
Bigfoot 
Alice Lake 
exists_in 
exists_in 
can_attract 
Alluring Goat 
Bigfoot Toenail Clippings 
Musket-teer Trap 
loots 
can_catch 
Omar Lake
Bigfoot 
Alice Lake 
exists_in 
exists_in 
can_attract 
Alluring Goat 
Bigfoot Toenail Clippings 
Musket-teer Trap 
loots 
can_catch 
Omar Lake 
Strength = 502! 
Speed = 201! 
Intelligence = 184 
Strength = 420! 
Speed = 210! 
Technology = 240
Bigfoot 
Alice Lake 
exists_in 
exists_in 
can_attract 
Alluring Goat 
Bigfoot Toenail Clippings 
Musket-teer Trap 
loots 
can_catch 
Omar Lake 
CatchRate = 0.774
Bigfoot 
Buy Price = 20BN! 
Sell Price = 482 Gold! 
Sellable Alice = Lake 
true! 

 
exists_in 
exists_in 
can_attract 
Alluring Goat 
Bigfoot Toenail Clippings 
Musket-teer Trap 
loots 
can_catch 
Omar Lake
DropRate = 0.1 
Bigfoot 
Alice Lake 
exists_in 
exists_in 
can_attract 
Alluring Goat 
Bigfoot Toenail Clippings 
Musket-teer Trap 
loots 
can_catch 
Omar Lake
Bigfoot 
Alice Lake 
exists_in 
exists_in 
can_attract 
Alluring Goat 
Bigfoot Toenail Clippings 
Musket-teer Trap 
loots 
can_catch 
Omar Lake
Bigfoot 
Alice Lake 
exists_in 
can_attract 
Alluring Goat 
Bigfoot Toenail Clippings 
Musket-teer Trap 
loots 
can_catch 
Omar Lake 
exists_in 
Yowie 
Yeti 
can_catch 
can_catch 
Apprentice’s Workshop 
can_make 
Goat 
Honey 
Yeti Fur 
requires 
loots 
makes 
Alluring Goat Recipe 
requires requires 
Beeswax 
loots 
Bee Hive 
harvests 
McDonald’s Farm 
sells 
loots 
Goat’s Milk 
harvests 
London 
exists_in 
requires 
Peryton Fawn Decoy Recipe 
Peryton Fawn Decoy 
makes
Bigfoot 
Alice Lake 
exists_in 
can_attract 
Alluring Goat 
Bigfoot Toenail Clippings 
Musket-teer Trap 
loots 
can_catch 
Omar Lake 
exists_in 
Yowie 
Yeti 
can_catch 
can_catch 
Apprentice’s Workshop 
can_make 
Goat 
Honey 
Yeti Fur 
requires 
loots 
makes 
Alluring Goat Recipe 
requires requires 
Beeswax 
loots 
Bee Hive 
harvests 
McDonald’s Farm 
sells 
loots 
Goat’s Milk 
harvests 
London 
exists_in 
requires 
Peryton Fawn Decoy Recipe 
Peryton Fawn Decoy 
makes
Bigfoot 
Alice Lake 
exists_in 
can_attract 
Alluring Goat 
Bigfoot Toenail Clippings 
Musket-teer Trap 
loots 
can_catch 
Omar Lake 
exists_in 
Yowie 
Yeti 
can_catch 
can_catch 
Apprentice’s Workshop 
can_make 
Goat 
Honey 
Yeti Fur 
requires 
loots 
makes 
Alluring Goat Recipe 
requires requires 
Beeswax 
loots 
Bee Hive 
harvests 
McDonald’s Farm 
sells 
loots 
Goat’s Milk 
harvests 
London 
exists_in 
requires 
Peryton Fawn Decoy Recipe 
Peryton Fawn Decoy 
makes
Bigfoot 
Alice Lake 
exists_in 
can_attract 
Alluring Goat 
Bigfoot Toenail Clippings 
Musket-teer Trap 
loots 
can_catch 
Omar Lake 
exists_in 
Yowie 
Yeti 
can_catch 
can_catch 
Apprentice’s Workshop 
can_make 
Goat 
Honey 
Yeti Fur 
requires 
loots 
makes 
Alluring Goat Recipe 
requires requires 
Beeswax 
loots 
Bee Hive 
harvests 
McDonald’s Farm 
sells 
loots 
Goat’s Milk 
harvests 
London 
exists_in 
requires 
Peryton Fawn Decoy Recipe 
Peryton Fawn Decoy 
makes
8000+ Nodes
40000+ Edges
game 
balancing 
(revisited)
impact analysis
What’s the 
impact of upping 
the price of 
“White Bread”?
ITEM ITEM 
CRAFTS 
RECIPE 
IS_USED_IN
MATCH! 
(wb:BaseItem { Name:"White Bread"})! 
-[rel:CRAFTS | IS_USED_IN*1..]! 
->(i:BaseItem)! 
RETURN i, rel, wb
MATCH! 
(wb:BaseItem { Name:"White Bread"})! 
-[rel:CRAFTS | IS_USED_IN*1..]! 
->(i:BaseItem)! 
Node-[rel]->Node 
RETURN i, rel, wb
MATCH! 
(wb:BaseItem { Name:"White Bread"})! 
-[rel:CRAFTS | IS_USED_IN*1..]! 
->(i:BaseItem)! 
RETURN i, rel, wb
MATCH! 
(wb:BaseItem { Name:"White Bread"})! 
-[rel:CRAFTS | IS_USED_IN*1..]! 
->(i:BaseItem)! 
RETURN i, rel, wb
MATCH! 
(wb:BaseItem { Name:"White Bread"})! 
-[rel:CRAFTS | IS_USED_IN*1..]! 
->(i:BaseItem)! 
RETURN i, rel, wb
MATCH! 
(wb:BaseItem { Name:"White Bread"})! 
-[rel:CRAFTS | IS_USED_IN*1..]! 
->(i:BaseItem)! 
RETURN i, rel, wb
MATCH! 
(wb:BaseItem { Name:"White Bread"})! 
-[rel:CRAFTS | IS_USED_IN*1..]! 
->(i:BaseItem)! 
RETURN i, rel, wb
scarcity analysis
How scarce is 
“Durian” 
compared to 
“Dragonfruit”?
FRUIT SPOT 
EXISTS_IN 
FORAGES 
FRUIT TREE
MATCH! ! 
(fruit)<-[:FORAGES]-(tree)! 
-[:EXISTS_IN]->(spot)! 
WHERE! ! 
fruit.Name=‘Durian’ OR! 
fruit.Name=‘Dragonfruit’! 
RETURN fruit, tree, spot
MATCH! ! 
(fruit)<-[:FORAGES]-(tree)! 
-[:EXISTS_IN]->(spot)! 
Node<-[WHEREr1]-! ! 
Node-[r2]->Node 
fruit.Name=‘Durian’ OR! 
fruit.Name=‘Dragonfruit’! 
RETURN fruit, tree, spot
MATCH! ! 
(fruit)<-[:FORAGES]-(tree)! 
-[:EXISTS_IN]->(spot)! 
WHERE! ! 
fruit.Name=‘Durian’ OR! 
fruit.Name=‘Dragonfruit’! 
RETURN fruit, tree, spot
quest lines
ITEM ITEM 
AWARDS 
QUEST 
REQUIRES 
UNLOCKS
What quests 
come after “Year 
of the Horse”?
MATCH! 
(q1:Quest { Name: “Year of the Horse” })! 
-[:UNLOCKS]! 
->(q2:Quest) ! 
RETURN q1, q2
How do you 
model quest 
progression?
2. Enrich Model 
1. Price Items 
3. “Price” Quests
monster hierarchy
Catch me first. 
No, catch ME first.
MONSTER ITEM 
IS_USED_IN 
LOOTS 
RECIPE 
CRAFTS 
MONSTER ITEM 
CAN_ATTRACT
MATCH! 
(monster1:Monster)-[:LOOTS]->(loot)! 
-[r:IS_USED_IN | CRAFTS*0..]->(bait)! 
-[:CAN_ATTRACT]->(monster2)! 
RETURN monster1, monster2
ÎŁ(Bait Price * Attraction Rate) 
Input = Output 
ÎŁ(Loot Price * Drop Rate) + Gold
MONSTER ITEM 
IS_USED_IN 
LOOTS 
RECIPE 
CRAFTS 
MONSTER ITEM 
CAN_ATTRACT
NEW monster ! 
= More competitor for bait! 
= Lower attraction rate for 
all monsters
getting data into 
NEO4J
version control 
Game Design data
What changed! 
When did it change! 
Why did it change! 
Who changed it
allow multi-user editing
GitFlow! 
! 
- branching strategy for Git! 
- used by all our developers!
Publisher 
- Validate! 
- Localize! 
- Publish
Publisher 
Flash iOS Server Neo4j
test data changes in 
isolation
preview changes on live
Localization
more text than first three 
Harry Porter books!
Step 1. ! 
ingest gettext file
Step 2. ! 
intercept string 
property setters
Step 3. ! 
replace string
Step 4. ! 
repeat for next language
intercept string 
property setters
intercept string 
property setters
replace string
replace string
target all DTOs!
auto-tuning 
trapping stats
Monster 
strength! 
speed! 
intelligence 
Trap 
strength! 
speed! 
technology
Monster 
strength! 
speed! 
intelligence 
Trap 
strength! 
speed! 
technology 
Catch Rate %
trial-and-error
error-prone 
trial-and-error 
laborious 
sub-optimal
genetic algorithms 
(in F#)
auto-tuning baits
auto-tuning baits
LONDON 2.0 
we rewrote the entire season 1 ! 
quests to make them better.
TWICE 
THE FUN
SEASON 1 
SEASON 1! 
(POST-REWRITE) 
SEASON 2
MORE STREAMLINED
QUALITY > QUANTITY
TWICE 
THE AMOUNT 
SUPPORT TO
Neo4j to the rescue!
Thank you!
theburningmonk.com 
@theburningmonk 
github.com/theburningmonk

Weitere Àhnliche Inhalte

Andere mochten auch

Andere mochten auch (8)

Kongregate - Maximizing Player Retention and Monetization in Free-to-Play Gam...
Kongregate - Maximizing Player Retention and Monetization in Free-to-Play Gam...Kongregate - Maximizing Player Retention and Monetization in Free-to-Play Gam...
Kongregate - Maximizing Player Retention and Monetization in Free-to-Play Gam...
 
Serverless in production, an experience report (codemotion milan)
Serverless in production, an experience report (codemotion milan)Serverless in production, an experience report (codemotion milan)
Serverless in production, an experience report (codemotion milan)
 
F# in the real world (NDC)
F# in the real world (NDC)F# in the real world (NDC)
F# in the real world (NDC)
 
7 ineffective coding habits many F# programmers don't have
7 ineffective coding habits many F# programmers don't have7 ineffective coding habits many F# programmers don't have
7 ineffective coding habits many F# programmers don't have
 
Serverless in production (O'Reilly Software Architecture)
Serverless in production (O'Reilly Software Architecture)Serverless in production (O'Reilly Software Architecture)
Serverless in production (O'Reilly Software Architecture)
 
Tame cloud complexity with F#-powered DSLs
Tame cloud complexity with F#-powered DSLsTame cloud complexity with F#-powered DSLs
Tame cloud complexity with F#-powered DSLs
 
Tour of language landscape
Tour of language landscapeTour of language landscape
Tour of language landscape
 
AWS Lambda from the trenches
AWS Lambda from the trenchesAWS Lambda from the trenches
AWS Lambda from the trenches
 

Ähnlich wie Modelling game economy with Neo4j

101 lecture 3
101 lecture 3101 lecture 3
101 lecture 3
Gale Pooley
 

Ähnlich wie Modelling game economy with Neo4j (9)

Modelling complex game economy with Neo4j by Yan Cui at Codemotion Dubai
Modelling complex game economy with Neo4j by Yan Cui at Codemotion DubaiModelling complex game economy with Neo4j by Yan Cui at Codemotion Dubai
Modelling complex game economy with Neo4j by Yan Cui at Codemotion Dubai
 
NUS iOS Swift Talk
NUS iOS Swift TalkNUS iOS Swift Talk
NUS iOS Swift Talk
 
Mistakes I Made Building Netflix for the iPhone
Mistakes I Made Building Netflix for the iPhoneMistakes I Made Building Netflix for the iPhone
Mistakes I Made Building Netflix for the iPhone
 
ScotRuby - Dark side of ruby
ScotRuby - Dark side of rubyScotRuby - Dark side of ruby
ScotRuby - Dark side of ruby
 
Be a library developer!
Be a library developer!Be a library developer!
Be a library developer!
 
101 lecture 3
101 lecture 3101 lecture 3
101 lecture 3
 
Long Live the Rubyist
Long Live the RubyistLong Live the Rubyist
Long Live the Rubyist
 
Web Audio Made Easy with Howler.js
Web Audio Made Easy with Howler.jsWeb Audio Made Easy with Howler.js
Web Audio Made Easy with Howler.js
 
Free The Enterprise With Ruby & Master Your Own Domain
Free The Enterprise With Ruby & Master Your Own DomainFree The Enterprise With Ruby & Master Your Own Domain
Free The Enterprise With Ruby & Master Your Own Domain
 

Mehr von Yan Cui

How serverless changes the cost paradigm
How serverless changes the cost paradigmHow serverless changes the cost paradigm
How serverless changes the cost paradigm
Yan Cui
 

Mehr von Yan Cui (20)

How to win the game of trade-offs
How to win the game of trade-offsHow to win the game of trade-offs
How to win the game of trade-offs
 
How to choose the right messaging service
How to choose the right messaging serviceHow to choose the right messaging service
How to choose the right messaging service
 
How to choose the right messaging service for your workload
How to choose the right messaging service for your workloadHow to choose the right messaging service for your workload
How to choose the right messaging service for your workload
 
Patterns and practices for building resilient serverless applications.pdf
Patterns and practices for building resilient serverless applications.pdfPatterns and practices for building resilient serverless applications.pdf
Patterns and practices for building resilient serverless applications.pdf
 
Lambda and DynamoDB best practices
Lambda and DynamoDB best practicesLambda and DynamoDB best practices
Lambda and DynamoDB best practices
 
Lessons from running AppSync in prod
Lessons from running AppSync in prodLessons from running AppSync in prod
Lessons from running AppSync in prod
 
Serverless observability - a hero's perspective
Serverless observability - a hero's perspectiveServerless observability - a hero's perspective
Serverless observability - a hero's perspective
 
How to ship customer value faster with step functions
How to ship customer value faster with step functionsHow to ship customer value faster with step functions
How to ship customer value faster with step functions
 
How serverless changes the cost paradigm
How serverless changes the cost paradigmHow serverless changes the cost paradigm
How serverless changes the cost paradigm
 
Why your next serverless project should use AWS AppSync
Why your next serverless project should use AWS AppSyncWhy your next serverless project should use AWS AppSync
Why your next serverless project should use AWS AppSync
 
Build social network in 4 weeks
Build social network in 4 weeksBuild social network in 4 weeks
Build social network in 4 weeks
 
Patterns and practices for building resilient serverless applications
Patterns and practices for building resilient serverless applicationsPatterns and practices for building resilient serverless applications
Patterns and practices for building resilient serverless applications
 
How to bring chaos engineering to serverless
How to bring chaos engineering to serverlessHow to bring chaos engineering to serverless
How to bring chaos engineering to serverless
 
Migrating existing monolith to serverless in 8 steps
Migrating existing monolith to serverless in 8 stepsMigrating existing monolith to serverless in 8 steps
Migrating existing monolith to serverless in 8 steps
 
Building a social network in under 4 weeks with Serverless and GraphQL
Building a social network in under 4 weeks with Serverless and GraphQLBuilding a social network in under 4 weeks with Serverless and GraphQL
Building a social network in under 4 weeks with Serverless and GraphQL
 
FinDev as a business advantage in the post covid19 economy
FinDev as a business advantage in the post covid19 economyFinDev as a business advantage in the post covid19 economy
FinDev as a business advantage in the post covid19 economy
 
How to improve lambda cold starts
How to improve lambda cold startsHow to improve lambda cold starts
How to improve lambda cold starts
 
What can you do with lambda in 2020
What can you do with lambda in 2020What can you do with lambda in 2020
What can you do with lambda in 2020
 
A chaos experiment a day, keeping the outage away
A chaos experiment a day, keeping the outage awayA chaos experiment a day, keeping the outage away
A chaos experiment a day, keeping the outage away
 
How to debug slow lambda response times
How to debug slow lambda response timesHow to debug slow lambda response times
How to debug slow lambda response times
 

KĂŒrzlich hochgeladen

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

KĂŒrzlich hochgeladen (20)

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)
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
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
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
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?
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
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
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 

Modelling game economy with Neo4j