modelling game economy with neo4j

142
Modelling game economy with Neo4j

Upload: yan-cui

Post on 20-Aug-2015

21.351 views

Category:

Technology


6 download

TRANSCRIPT

Page 1: Modelling game economy with Neo4j

Modelling game economy !with Neo4j

Page 2: Modelling game economy with Neo4j

agenda

Page 3: Modelling game economy with Neo4j

Hi, my name is Yan Cui.

Page 4: Modelling game economy with Neo4j
Page 5: Modelling game economy with Neo4j

1MILLION USERS

ACTIVEDAILY

Page 6: Modelling game economy with Neo4j

250MILLION DAY

PERREQUEST

Page 7: Modelling game economy with Neo4j
Page 8: Modelling game economy with Neo4j

location

Page 9: Modelling game economy with Neo4j
Page 10: Modelling game economy with Neo4j
Page 11: Modelling game economy with Neo4j
Page 12: Modelling game economy with Neo4j

500+ Spots

Page 13: Modelling game economy with Neo4j

locationepisodic

Page 14: Modelling game economy with Neo4j

London 2012

Page 15: Modelling game economy with Neo4j

Nan Jing 2013

Page 16: Modelling game economy with Neo4j

locationepisodicmulti-player

Page 17: Modelling game economy with Neo4j

herebemonstersgame.com

iPad

buddies

Page 18: Modelling game economy with Neo4j

locationepisodicmulti-playerRPG

Page 19: Modelling game economy with Neo4j

4000 Items

Page 20: Modelling game economy with Neo4j

800 Recipes

Page 21: Modelling game economy with Neo4j
Page 22: Modelling game economy with Neo4j

1500+ Quests

Page 23: Modelling game economy with Neo4j
Page 24: Modelling game economy with Neo4j

100+ Monsters

Page 25: Modelling game economy with Neo4j
Page 26: Modelling game economy with Neo4j
Page 27: Modelling game economy with Neo4j

gamebalancing

Page 28: Modelling game economy with Neo4j

itemPricing

Page 29: Modelling game economy with Neo4j

itemPricing

Page 30: Modelling game economy with Neo4j

itemPricing

Page 31: Modelling game economy with Neo4j

itemPricing

Page 32: Modelling game economy with Neo4j
Page 33: Modelling game economy with Neo4j

manual game balancing is SLOW

Page 34: Modelling game economy with Neo4j

it is REPETITIVE

Page 35: Modelling game economy with Neo4j

ERROR-PRONE!SUBJECTIVE

Page 36: Modelling game economy with Neo4j

there must be a better way...

Page 37: Modelling game economy with Neo4j

Hello, Neo4jThe rabbit hole sounds pretty good right about now!

Page 38: Modelling game economy with Neo4j

BIG

FOO

Tca

tchi

ng

Page 39: Modelling game economy with Neo4j

location baitattraction rate

catch rate

Page 40: Modelling game economy with Neo4j

as a graph in Neo4j

Page 41: Modelling game economy with Neo4j

Bigfoot

Alice Lake

exists_in

Alluring Goat

can_attract

Bigfoot Toenail Clippings

Musket-teer Trap

lootscan_catch

Omar Lake

exists_in

Page 42: Modelling game economy with Neo4j

Bigfoot

Alice Lake

exists_in

Alluring Goat

can_attract

Bigfoot Toenail Clippings

Musket-teer Trap

lootscan_catch

Omar Lake

exists_in

Strength = 502!Speed = 201!Intelligence = 184

Strength = 420!Speed = 210!Technology = 240

Page 43: Modelling game economy with Neo4j

Bigfoot

Alice Lake

exists_in

Alluring Goat

can_attract

Bigfoot Toenail Clippings

Musket-teer Trap

lootscan_catch

Omar Lake

exists_in

CatchRate = 0.774

Page 44: Modelling game economy with Neo4j

Bigfoot

Alice Lake

exists_in

Alluring Goat

can_attract

Bigfoot Toenail Clippings

Musket-teer Trap

lootscan_catch

Omar Lake

exists_in

Buy Price = 20BN!Sell Price = 482 Gold!Sellable = true!…

Page 45: Modelling game economy with Neo4j

Bigfoot

Alice Lake

exists_in

Alluring Goat

can_attract

Bigfoot Toenail Clippings

Musket-teer Trap

lootscan_catch

Omar Lake

exists_inDropRate = 0.1

Page 46: Modelling game economy with Neo4j

Bigfoot

Alice Lake

exists_in

Alluring Goat

can_attract

Bigfoot Toenail Clippings

Musket-teer Trap

lootscan_catch

Omar Lake

exists_in

Page 47: Modelling game economy with Neo4j

BigfootAlice Lake

exists_in

Alluring Goatcan_attract

Bigfoot Toenail Clippings

Musket-teer Trap

loots

can_catch

Omar Lakeexist

s_in

Yowie

Yetican_ca

tch

can_catch

Apprentice’s Workshop

can_make

GoatHoney

Yeti Fur

requires

loots

makes

Alluring Goat Recipe

requires requires

Beeswax

loots

Bee Hiveharvests

McDonald’s Farm

sells

loots

Goat’s Milk

harvests

London

exists_in

Peryton Fawn Decoy Recipe

requires

Peryton Fawn Decoy

makes

Page 48: Modelling game economy with Neo4j

BigfootAlice Lake

exists_in

Alluring Goatcan_attract

Bigfoot Toenail Clippings

Musket-teer Trap

loots

can_catch

Omar Lakeexist

s_in

Yowie

Yetican_ca

tch

can_catch

Apprentice’s Workshop

can_make

GoatHoney

Yeti Fur

requires

loots

makes

Alluring Goat Recipe

requires requires

Beeswax

loots

Bee Hiveharvests

McDonald’s Farm

sells

loots

Goat’s Milk

harvests

London

exists_in

Peryton Fawn Decoy Recipe

requires

Peryton Fawn Decoy

makes

Page 49: Modelling game economy with Neo4j

BigfootAlice Lake

exists_in

Alluring Goatcan_attract

Bigfoot Toenail Clippings

Musket-teer Trap

loots

can_catch

Omar Lakeexist

s_in

Yowie

Yetican_ca

tch

can_catch

Apprentice’s Workshop

can_make

GoatHoney

Yeti Fur

requires

loots

makes

Alluring Goat Recipe

requires requires

Beeswax

loots

Bee Hiveharvests

McDonald’s Farm

sells

loots

Goat’s Milk

harvests

London

exists_in

Peryton Fawn Decoy Recipe

requires

Peryton Fawn Decoy

makes

Page 50: Modelling game economy with Neo4j

BigfootAlice Lake

exists_in

Alluring Goatcan_attract

Bigfoot Toenail Clippings

Musket-teer Trap

loots

can_catch

Omar Lakeexist

s_in

Yowie

Yetican_ca

tch

can_catch

Apprentice’s Workshop

can_make

GoatHoney

Yeti Fur

requires

loots

makes

Alluring Goat Recipe

requires requires

Beeswax

loots

Bee Hiveharvests

McDonald’s Farm

sells

loots

Goat’s Milk

harvests

London

exists_in

Peryton Fawn Decoy Recipe

requires

Peryton Fawn Decoy

makes

Page 51: Modelling game economy with Neo4j
Page 52: Modelling game economy with Neo4j

8000+ Nodes

Page 53: Modelling game economy with Neo4j

40000+ Edges

Page 54: Modelling game economy with Neo4j
Page 55: Modelling game economy with Neo4j
Page 56: Modelling game economy with Neo4j

gamebalancing(revisited)

Page 57: Modelling game economy with Neo4j

impact analysis

Page 58: Modelling game economy with Neo4j

What’s the impact of upping

the price of “White Bread”?

Page 59: Modelling game economy with Neo4j

CRAFTS

RECIPE

ITEMITEM

IS_USED_IN

Page 60: Modelling game economy with Neo4j

MATCH!

(wb:BaseItem { Name:"White Bread"})!

-[rel:CRAFTS | IS_USED_IN*1..]!

->(i:BaseItem)!

RETURN i, rel, wb

Page 61: Modelling game economy with Neo4j

MATCH!

(wb:BaseItem { Name:"White Bread"})!

-[rel:CRAFTS | IS_USED_IN*1..]!

->(i:BaseItem)!

RETURN i, rel, wb

Node-[rel]->Node

Page 62: Modelling game economy with Neo4j

MATCH!

(wb:BaseItem { Name:"White Bread"})!

-[rel:CRAFTS | IS_USED_IN*1..]!

->(i:BaseItem)!

RETURN i, rel, wb

Page 63: Modelling game economy with Neo4j

MATCH!

(wb:BaseItem { Name:"White Bread"})! -[rel:CRAFTS | IS_USED_IN*1..]!

->(i:BaseItem)!

RETURN i, rel, wb

Page 64: Modelling game economy with Neo4j

MATCH!

(wb:BaseItem { Name:"White Bread"})!

-[rel:CRAFTS | IS_USED_IN*1..]!

->(i:BaseItem)!

RETURN i, rel, wb

Page 65: Modelling game economy with Neo4j

MATCH!

(wb:BaseItem { Name:"White Bread"})!

-[rel:CRAFTS | IS_USED_IN*1..]! ->(i:BaseItem)!

RETURN i, rel, wb

Page 66: Modelling game economy with Neo4j

MATCH!

(wb:BaseItem { Name:"White Bread"})!

-[rel:CRAFTS | IS_USED_IN*1..]!

->(i:BaseItem)!

RETURN i, rel, wb

Page 67: Modelling game economy with Neo4j
Page 68: Modelling game economy with Neo4j

scarcity analysis

Page 69: Modelling game economy with Neo4j

How scarce is “Durian”

compared to “Dragonfruit”?

Page 70: Modelling game economy with Neo4j

EXISTS_IN

FRUIT TREE

SPOTFRUIT

FORAGES

Page 71: Modelling game economy with Neo4j

MATCH! !

(fruit)<-[:FORAGES]-(tree)!

-[:EXISTS_IN]->(spot)!

WHERE! !

fruit.Name=‘Durian’ OR!

fruit.Name=‘Dragonfruit’!

RETURN fruit, tree, spot

Page 72: Modelling game economy with Neo4j

MATCH! !

(fruit)<-[:FORAGES]-(tree)!

-[:EXISTS_IN]->(spot)!

WHERE! !

fruit.Name=‘Durian’ OR!

fruit.Name=‘Dragonfruit’!

RETURN fruit, tree, spot

Node<-[r1]-Node-[r2]->Node

Page 73: Modelling game economy with Neo4j

MATCH! !

(fruit)<-[:FORAGES]-(tree)!

-[:EXISTS_IN]->(spot)!

WHERE! ! fruit.Name=‘Durian’ OR! fruit.Name=‘Dragonfruit’!RETURN fruit, tree, spot

Page 74: Modelling game economy with Neo4j
Page 75: Modelling game economy with Neo4j
Page 76: Modelling game economy with Neo4j
Page 77: Modelling game economy with Neo4j

quest lines

Page 78: Modelling game economy with Neo4j

AWARDS

QUEST

ITEMITEM

REQUIRES

UNLOCKS

Page 79: Modelling game economy with Neo4j

What quests come after “Year of the Horse”?

Page 80: Modelling game economy with Neo4j

MATCH!

(q1:Quest { Name: “Year of the Horse” })!

-[:UNLOCKS]!

->(q2:Quest) !

RETURN q1, q2

Page 81: Modelling game economy with Neo4j
Page 82: Modelling game economy with Neo4j
Page 83: Modelling game economy with Neo4j

How do you model quest progression?

Page 84: Modelling game economy with Neo4j

1. Price Items

2. Enrich Model

3. “Price” Quests

Page 85: Modelling game economy with Neo4j

monster hierarchy

Page 86: Modelling game economy with Neo4j

Catch me first.

No, catch ME first.

Page 87: Modelling game economy with Neo4j

IS_USED_IN

ITEMMONSTERCAN_ATTRACT

ITEMMONSTERLOOTS

RECIPECRAFTS

Page 88: Modelling game economy with Neo4j

MATCH!

(monster1:Monster)-[:LOOTS]->(loot)!

-[r:IS_USED_IN | CRAFTS*0..]->(bait)!

-[:CAN_ATTRACT]->(monster2)!

RETURN monster1, monster2

Page 89: Modelling game economy with Neo4j
Page 90: Modelling game economy with Neo4j
Page 91: Modelling game economy with Neo4j

∑(Bait Price * Attraction Rate)

Input = Output∑(Loot Price * Drop Rate) + Gold

Page 92: Modelling game economy with Neo4j

IS_USED_IN

ITEMMONSTERCAN_ATTRACT

ITEMMONSTERLOOTS

RECIPECRAFTS

Page 93: Modelling game economy with Neo4j

NEW monster !

= More competitor for bait!

= Lower attraction rate for

all monsters

Page 94: Modelling game economy with Neo4j

getting data into NEO4J

Page 95: Modelling game economy with Neo4j
Page 96: Modelling game economy with Neo4j

version control Game Design data

Page 97: Modelling game economy with Neo4j

What changed!When did it change!Why did it change!Who changed it

Page 98: Modelling game economy with Neo4j

allow multi-user editing

Page 99: Modelling game economy with Neo4j

GitFlow!!- branching strategy for Git!- used by all our developers!

Page 100: Modelling game economy with Neo4j

Publisher- Validate!- Localize!- Publish

Page 101: Modelling game economy with Neo4j

Publisher

Flash iOS Server Neo4j

Page 102: Modelling game economy with Neo4j

test data changes in isolation

Page 103: Modelling game economy with Neo4j

preview changes on live

Page 104: Modelling game economy with Neo4j

Localization

Page 105: Modelling game economy with Neo4j

more text than first three Harry Porter books!

Page 106: Modelling game economy with Neo4j

Step 1. !ingest gettext file

Page 107: Modelling game economy with Neo4j

Step 2. !intercept string property setters

Page 108: Modelling game economy with Neo4j

Step 3. !replace string

Page 109: Modelling game economy with Neo4j

Step 4. !repeat for next language

Page 110: Modelling game economy with Neo4j
Page 111: Modelling game economy with Neo4j

intercept string property setters

Page 112: Modelling game economy with Neo4j

intercept string property setters

Page 113: Modelling game economy with Neo4j

replace string

Page 114: Modelling game economy with Neo4j

replace string

Page 115: Modelling game economy with Neo4j

target all DTOs!

Page 116: Modelling game economy with Neo4j

auto-tuning trapping stats

Page 117: Modelling game economy with Neo4j

Monsterstrength!speed!

intelligence

Trapstrength!speed!

technology

Page 118: Modelling game economy with Neo4j

Monsterstrength!speed!

intelligence

Trapstrength!speed!

technology

Catch Rate %

Page 119: Modelling game economy with Neo4j

trial-and-error

Page 120: Modelling game economy with Neo4j

trial-and-errorlaborious

error-prone

sub-optimal

Page 121: Modelling game economy with Neo4j

genetic algorithms(in F#)

Page 122: Modelling game economy with Neo4j
Page 123: Modelling game economy with Neo4j
Page 124: Modelling game economy with Neo4j
Page 125: Modelling game economy with Neo4j
Page 126: Modelling game economy with Neo4j
Page 127: Modelling game economy with Neo4j
Page 128: Modelling game economy with Neo4j
Page 129: Modelling game economy with Neo4j
Page 130: Modelling game economy with Neo4j

auto-tuning baits

Page 131: Modelling game economy with Neo4j

auto-tuning baits

Page 132: Modelling game economy with Neo4j
Page 133: Modelling game economy with Neo4j
Page 134: Modelling game economy with Neo4j

LONDON 2.0we rewrote the entire season 1 !

quests to make them better.

Page 135: Modelling game economy with Neo4j

TWICETHE FUN

Page 136: Modelling game economy with Neo4j

SEASON 1

SEASON 1!(POST-REWRITE)

SEASON 2

Page 137: Modelling game economy with Neo4j

STREAMLINEDMORE

Page 138: Modelling game economy with Neo4j

QUALITY > QUANTITY

Page 139: Modelling game economy with Neo4j

TWICETHE AMOUNT

SUPPORTTO

Page 140: Modelling game economy with Neo4j

Neo4j to the rescue!

Page 141: Modelling game economy with Neo4j

Thank you!

Page 142: Modelling game economy with Neo4j

@theburningmonk

github.com/theburningmonk

theburningmonk.com