The Burning Monk  reveals how Neo4j helps catch Bigfoot and makes the Alluring Goat

One of the more mature and most widely used graph data­base today is Neo4j, and whilst graph data­bases are most fre­quently asso­ci­ated with social data (friends, fol­low­ers, etc.) thanks to the promi­nence of com­pa­nies that are oper­at­ing in that space, but they’re actu­ally very pow­er­ful and scal­able ways to store and query any form of highly con­nected and/or com­plex data in gen­eral and have use cases beyond mod­el­ling social data, includ­ing fraud detec­tion and net­work man­age­ment. 

Dis­clo­sure : my employer, Gamesys, already uses Neo4j for a num­ber of social fea­tures in our real money gam­ing busi­ness so the choice of using Neo4j was an obvi­ous one since we already have both oper­a­tional knowl­edge as well as site license within the com­pany. I didn’t go through a care­ful vent­ing process to decide which graph db to go with.

If you rep­re­sent every item in the game, ever loca­tion, recipe, mon­ster, fish, etc. as nodes on a graph and link­ing them with rela­tion­ships such as:

  • item A drops item B as loot
  • item A is avail­able at loca­tion X
  • mon­ster A can be lured by item B
  • mon­ster A can be caught by item B

you end up with some­thing along the lines of:

This dia­gram illus­trates the highly con­nected and com­plex nature of the data we’re deal­ing with, the result of us mak­ing a game where every­thing you can do and every item you find has a pur­pose and can be used for some­thing else.

Each node and rela­tion­ship also has a set of meta­data asso­ci­ated with it, for instance the can_catch rela­tion­ship con­tains the prob­a­bil­ity (or catch rate) whilst the Musket-teer Trap node con­tains the buy/sell price as well as stats of the trap and many more.

This dia­gram is also by no means an uncon­nected sub­set of the over­all graph, for sim­plic­ity sake I have omit­ted many types of rela­tion­ship and con­nected nodes. Visu­al­iz­ing the 5000+ nodes and around 25000 rela­tion­ships in Gephi (using a Neo4j plu­gin), with the colour and size of the nodes rep­re­sen­ta­tive of the num­ber of con­nec­tions it has, this is what the inter­nal data model for Here Be Mon­ster looks like from afar:

Read the full article.