If you have children between the ages of 9 and 19, it’s increasingly likely that you’re familiar with Minecraft; if not, you can think of it as a kind of virtual Lego, an open-ended, blocky, sandbox where you can build, battle, and even farm. Minecraft is a gaming phenomenon, and part of its appeal is the opportunity to modify (‘mod’) the game, adding new materials, monsters, and even quantum physics to the ‘vanilla’ game.

Taking a break after Dreamforce 2013, it occurred to me that I could create a Minecraft mod to visualize business data in 3D, modeled on Neuromancer‘s cyberspace. Each Salesforce Account would be represented by a building, with rooms within each building representing Opportunities. Contacts would roam the space, interacting with you in response to events in the Salesforce environment. Close an Opportunity, and a Contact would find you and give you precious metals and gems.

A few days’ coding later, Forcecraft was born!

As you can see in the screenshots and video, this initial version implements the basic vision – you can explore Accounts, wandering between the rooms that represent Opportunities, seeing Opportunity status at a glance via signs and levers.

On startup, Forcecraft uses the Force.com REST API to retrieve Accounts, Opportunities and Contacts, generating buildings and creating Contact entities as the player explores the Forcecraft dimension. The connection is read-write – throw the lever for a different Stage and you’ll see that the Opportunity was updated in Salesforce (do NOT run this on a production org!). The mod also uses the Force.com Streaming API to receive notifications on data changes within the Salesforce environment; not only does changing an Opportunity’s Stage in Salesforce result in the lever position being updated ‘in game’, if the Opportunity’s Stage changes to ‘Closed Won’, a Contact from the relevant Account will appear before you and drop items (gold, diamonds etc) representing the Opportunity Amount. UPDATE: If the Opportunity’s Stage changes to ‘Closed Lost’, the weather changes to thunder and rain for a minute.

Take a look at Forcecraft in action:

//youtu.be/eb3GgM1o_8I

But, why even build this? Firstly, it’s a proof-of-concept for visualizing your Salesforce data. You can immediately see which Account has the most Opportunities, and dig deeper into the data in a very interactive way. It’s also a great demonstration of the richness of the Force.com APIs – you really can access every byte of your Salesforce data, and metadata, via the APIs and manipulate it in any app you choose. Finally, well, it was a lot of fun; I’ve spent some quality time with my boys combining their knowledge of the Minecraft world with my Force.com API skills to create possibly the most unlikely mashup you’ll see this year!

I have some ideas for extending Forcecraft, such as adding integration with Chatter so I can view and post to the Chatter feed for an Account, but I’m really interested in your ideas – leave a comment below. And, if you’re a Java developer looking for a fun side project, I’m very open to pull requests. Fork the Forcecraft project on GitHub and get hacking!

tagged , , Bookmark the permalink. Trackbacks are closed, but you can post a comment.
  • Gaurav Kheterpal

    Very cool, would be an icing on the cake to tie this up to an enterprise gamification platform such as BadgeVille!

  • Jeff Douglas

    Perhaps you can get your son on the payroll at Salesforce?

    • http://www.facebook.com/pandeyharshit Harshit Pandey

      good one

  • Zach McElrath

    This is the most compelling, innovative way to visualize business data I have ever seen. Bravo sir, bravo. So many possibilities.

    • Zach McElrath

      Extension ideas:

      Cases –> Creepers, mobs. With increasing Priority / Escalation / staleness, they morph into nastier creepers
      Contacts / Contact Roles —> different outfits!
      Lead Conversion —> capturing of animals / wild predators?
      Products / Assets —> stuff inside the Opportunity rooms

      • http://blog.superpat.com/ Pat Patterson

        Great ideas, Zach… Will have to noodle on those. In the meantime, I added an easy one: if the Opportunity’s Stage changes to ‘Closed Lost’, the weather changes to thunder and rain for a minute.

  • http://www.facebook.com/pandeyharshit Harshit Pandey

    Outstanding !

  • Daniel Ballinger

    Reminds me of Doom as a tool for system administration (http://www.cs.unm.edu/~dlchao/flake/doom/) and psDooM Mod http://psdoom.sourceforge.net/screenshots.html that created a *nix process monitor in Doom where “processes running on the system would be instantiated as monsters,and wounding and killing them corresponds to renicing and killing the processes.”

  • Benjamin Pirih

    Cyberspace. A consensual hallucination experienced daily by billions of legitimate operators, in every nation, by children being taught mathematical concepts… A graphic representation of data abstracted from banks of every computer in the human system. Unthinkable complexity. Lines of light ranged in the nonspace of the mind, clusters and constellations of data. Like city lights, receding…

    • http://blog.superpat.com/ Pat Patterson

      I need to point it at an org with more data to get that effect :-) Looks pretty cool at night, though…

  • TweetsMcG

    I love it! :)

  • Colm J Mitchell

    Hey, this is great! Reminds me of the 90′s movie ‘Hackers’ (and just about any other IT system displayed on TV / Movies) – the folders were all built up like sky scrapers: //www.youtube.com/watch?v=8wXBe2jTdx4&noredirect=1#t=81

  • Guest

    Interface it with “Her” – opens Friday – movie by Spike Jonze. Inspired by ALICE by pandorabots.com

  • ram_sj

    Looks Cool!, interesting hack!

  • Timothy Marcovecchio

    This is great! I’m only mad I didn’t think of it first. Consider the possibilities…how about MFGs running SF to manager their operations and production systems? It’s not outside the realm of possibility to extend this to modelling the mfg floor (even at a high albeit goofy level) using this concept. My 15 year old son is a Minecraft and Tekkit expert. Some of the things he’s built border on advanced engineering. Well done. Of course this gives new meaning to “Gamifying Sales Processes” in SF.

  • Wade Wegner

    Nicely done, Pat. This brings us one step closer to James Halliday’s vision for OASIS. =)

  • Richard Boyd

    Eh! and you get paid to do this!! :-) Where do I apply?

    • http://blog.superpat.com/ Pat Patterson
      • Richard Boyd

        I’ll get the kids to give me some lessons and add Minecraft to the Technologies section of my CV

  • Erin

    Finally! A way to engage at least one of my three boys! I can’t wait to share this with them to see what ideas spring forth. This is really cool.:)

  • Amanda Mcdonald

    so cool

  • Avinava Maiti

    Wow thats really cool. Taking the platform to the limits!

  • Sathya Atreyam

    Pat — this is great visualization concept. Question is the openness of typical SFDC users who are corporate America-isque and would not be interest in playing games during office hours. Would love to know your thoughts. Presently, I am taking a Gamification Course with UPenn and this article is so timely. So thanks once again and yes — looking forward to your thoughts on my Q.

    • http://blog.superpat.com/ Pat Patterson

      Hi Sathya – I don’t think typical SFDC users will really use this to interact with their production systems. It’s more of a proof-of-concept, and an illustration of the flexibility and power of the Salesforce APIs. Having said that, it could evolve into something that is valuable as a visualization – see hundreds of accounts at a glance, attributes such as building height, color, texture giving cues as to account status. And not just CRM data and buildings – it seems like Minecraft is pretty amenable to modeling pretty much anything – you could be showing more abstract data as a landscape with contours and colors providing information.

  • Bipin Nepani

    this is mindboggling cool.

  • k0an

    This is the best thing to ever happen with Salesforce.com. Can you please get this included as part of the certification test to make it a bit more enjoyable everytime I have to renew mine? :)

  • Chris

    This is crazy. A couple of questions: Could you potentially run this for Org62? What’s to stop anyone from doing this on prod data? Can anyone log into the Minecraft ‘world’ and see or interact with data?

    • http://blog.superpat.com/ Pat Patterson

      This isn’t a good place to discuss 62, so, if you’re an SFDC employee, ping me on Chatter there.

      Like any API-connected app, by default, anyone with API access can run this, so, yeah – it’s possible to run this against prod data, but I wouldn’t recommend it!

  • Paulo Orquillo

    forcecraft rules!

  • John Tobin

    Pat, this is a great idea, I love visualization of complex data!

    Just a few thoughts, if you ever add to this:

    - Have the buildings radiate around a central square, with the largest accounts or target account buildings closest to the center (perhaps it could read from a sales plan, for each user, to determine priorities).
    - Each lever representing the states in an opportunity should connect to a redstone block – this way more complete opportunities would give more light, and by having it always be night, you can see how far along opportunities are by the glow from each floor of a building.
    - Winning an opportunity could set off fireworks from the top of the building.
    - A slightly different architecture (such as ladders or gated rooms, iron doors, etc.) would be a way to keep villagers (contacts) in the account or opportunity that they were relevant to instead of wandering off.

    Anyhow, lot’s of fun to read about, thanks for doing this!

    • http://blog.superpat.com/ Pat Patterson

      Hi John, thanks for taking the time to share your thoughts – here are some of mine in response:

      - Since writing this entry, I reworked the layout code to put the buildings in a ‘discrete spiral’, which gives a nice town-like cluster. Would be easy to start the spiral at a given radius, and have a nice grass square in the middle, maybe some trees. I order the accounts by created date, so the oldest are in the middle, and new accounts get rendered at the edge. You can see the effect in this later video https://www.youtube.com/watch?v=mTe8YJOct3I . A problem with a different ordering is what to do when a new account is created – put it on the edge, or shuffle all the existing accounts around? Would welcome ideas!
      - Right now, the levers are standard, and the stone block behind them is a custom block & entity that implements the ‘radio-button’ logic. Interesting idea about the redstone light providing a visual cue to the opportunity state.
      - Fireworks – I like it!
      - One thing I always meant to revisit was the Contacts’ AI – right now, they are pretty much standard villagers, with the addition of a rule that has them cancel any movement and hang around for 30 seconds after they teleport to you on successful opportunity close. I think I could add some AI to have them wander around near their ‘home’ building, keeping them within a given radius.

      I’ll add your points as issues to the GitHub project so I can track them. I’m presenting the Minecraft work at the Glue Conference in Colorado in May, so I might revisit it between now and then.

      • John Tobin

        That all sounds great, thanks for replying! I like the new building layout (great minds and all that) and textures! I’d think wood vs. stone vs. gold would provide the most distinct visual differences, rather than cobble and smooth brick, by the way.

        The building ‘moving’ is difficult, but I think I would see this world regenerating as you connect to it to explore your data – as such it would be meant to be a ‘current model’ state, that would expire in terms of account size / location. Another option, if getting crazy, would be to co-opt a nether or other custom portal that you could walk through, that would zap you back to the current world, but with regenerated buildings. That sounds like a lot more Minecraft plugin code though :) I wonder if layout out the buildings in some kind of pseudo (scaled) geographic layout would be possible – a company I worked for had almost all of their sales accounts in one city, for example. Something covering America could have states laid out, and accounts located roughly appropriately in the right state. I guess it would depend on organization size and reach.

        In terms of the redstone block (lighting by opportunity state), by the way, those standard levers would activate the block so you could just place the redstone block above the the current lever location to get the light effect (there’s space), and remove the glowstone from the ceiling. A pressure pad wired to a lighting system could be a later addition to allow someone walking in to see the opportunity state signs even if there was no redstone light – but with the lights turning off when they leave the room so that the redstone lighting visualization could be seen through the windows from outside later.

        I think to keep it simple, just ‘locking’ the contacts (villagers) into a building via iron doors would be sufficient to keep them inside – only players can press the button to open an iron door, villagers can’t. Gates work too to keep them to a floor if you wanted to. Outdoors villagers could be contacts not associated to a an organization or account that has opportunities.

        Anyhow, I’ll stop as I’m sure I could go on like this for hours, especially as you’re doing all of the hard work :) Good luck at the conference, I hope the demo goes well!

        • http://blog.superpat.com/ Pat Patterson

          Thanks for your thoughts – it’s really helpful, getting another view on this stuff!

          On the textures – I was going for subtle. I thought of having more contrast between the opportunities, but wanted to keep the buildings looking more realistic. One thought I’ve had here is to pull stuff like the block IDs for the walls out into config, so you can decide whether you want wood/stone/gold/whatever.

          The underlying problem with the buildings moving is that once blocks are placed by the mod, and saved by Minecraft, the mod doesn’t really see them again. When the player revisits that chunk, Minecraft just renders the blocks it knows are there, so the mod doesn’t get an opportunity to get in the way. Will need to think about this some more and see what’s possible…

          Nice idea on the pressure plate/redstone lighting – I just updated the issue on Github!

          I like the idea of outdoor villagers being unassigned contacts, but I still think AI is the way to constrain their movement. Otherwise, the existing AI will decide the contact wants to go somewhere, and they’ll just wait inside the door.

          I have another request, to spawn new contacts when they are created in Force.com, so it looks like I might spend some quality time on this soon :-)

          BTW – you can post issues and/or comment on existing ones at https://github.com/metadaddy-sfdc/Forcecraft/issues