Em Lazer-Walker | Cloud Advocate



I was approached by my colleague, Jen Looper, in early Fall to lead on an interactive experience dubbed “Azure Mystery Mansion.” She had heard of a previous project which had been a hit, Power Animal Quiz, and was on the hunt for a new and cool project to engage developers.

Jen and her colleague, Chris, had started thinking about the type of project that they could create that would both be fun and innovative to build and that would engage developers in a cool, retro way. A scavenger hunt? A “choose-your-own-adventure” clickable game? They settled on a text-based game that would be entirely clickable to proceed, something like the old-school games we used to play in Middle School. The premise would be to wander through an old house, picking up objects and solving puzzles along the way. The first prototype that they used was a library I discovered on GitHub with art likewise borrowed from the internet. It looked like this:

As the project progressed and Halloween approached, they pivoted slightly both with the folks who were involved in the project and its overall atmosphere. Dubbed the “Azure Mystery Mansion”, the project started integrating custom art and new puzzles:

Chris had to turn his attention to other projects, and I was asked if I could lead. I’ve had experience working on text based games in the past, and decided to introduce a new architecture to the project: Twine, “an open-source tool for telling interactive, nonlinear stories”.

Building a Text-Based Game with Twine

If you’ve never tried Twine, you can download it for free. Using Twine 2, you are given a graphical interface where you craft your users’ pathways. For example, from a front porch, a person can enter a foyer, from which several rooms branch off; the user can wander into a library, a salon, a dining room, or go upstairs to the bedroom.

You can style your app using basic CSS, and you write your logic in one of several possible game engines that come with markup formats. We used Harlowe, which looks like this:

In this sample, the inventory array is initialized and the items in the chest are assigned to it. Then the inventory is printed out.

To progress in the game, you write the narrative and then enhance it with arrays, variables and macros.

In the above example, you explore a space, pick up items and perform tasks such as opening a chest to view its contents.

Using Twine, we created a spooky mystery mansion experience where folks can solve problems in each room, like entering codes into an old rotary phone to open hiding places. Twine exports the entire game to a flat html file, which you can then commit to GitHub to be picked up by Azure Pipelines to complete the CI/CD process and build out the game’s website.

Game Analytics with PlayFab

You may have written a blockbuster game, but it won’t do you any good unless you have analytics behind it to show you your users and their paths. We are lucky to have a Microsoft-owned game platform called PlayFab that serves as a robust and easy to configure and manage game PAAS. PlayFab can provide a scalable backend for large-scale online multiplayer games, handling everything from matchmaking to in-game economy to social features. It provides a backend for the Mystery Mansion, even though it’s a much smaller game that’s not using any of those features. We’re only using it to gauge numbers of visitors and to gather some basic analytics data about how players are doing:





We’re using basic PlayFab login to track how many daily users we have, and where in the world they’re coming from. We’re also using the real-time PlayStream events API to log whenever players do things like solve a puzzle, so we can get a clearer sense of questions like how much time people spend on the game, what percentage of players beat it, and which puzzles are stumping people. Integrating PlayFab into our Twine game only took a few minutes!

Dare To Play!

Do you want the deeds to the Azure Mystery Mansion? Solve the puzzles, collect 8 keys in the rooms, and climb to the attic for your prize. Then tweet about your experience to spread the word!

Click here to enter the Mystery Mansion!