Skip to content

How to build pinball high score with Azure DevOps

Our company Adafy decided to have a pinball machine in Techdays Finland event, because pinball machines have flashing lights and they make loud noise, so they are perfect human magnets into events. To maintain the high score table during the event, I decided to build an Azure DevOps demo which would hold all the players and their scores. With Azure DevOps queries I could create high score lists and get different kind of statistics from play entries. Azure DevOps UI for creating work items (high scores) is just bit too clumsy for event like this, so I decided to also create PowerApps application which integrated into Azure DevOps. I will write blog post about that shortly, but let’s now focus on using Azure DevOps as high score system.

Overview

Our high score system consists from three different entities. Player which is self explanatory, play which is state and entry at the same time and the score of one play. Player, play and score are modeled as one work item and play is also a state in our devops process.

Setup Azure DevOps

First step is to create a new Azure DevOps project and custom process for it. In custom process disable all the existing work item types and create new one called “Play”. I preferred that cool “Trophy” icon to describe this work item type.

Our play work item consist of four different fields. Title (which is mandatory), player name, score and company/organization. For scores use decimal data type, because integer is restricted to 32-bit (max value is
2 147 483 647)

Our custom process has four different states:

  1. Ready to play (players that have signed up)
  2. Playing
  3. Waiting for verification (we want to verify scores before they are accepted into board)
  4. Closed (after verification, work items are closed and appear in high score)

Playing state is restricted to only one work item at the time, because we have only one pinball machine. Other states can have as many work items as wanted.

To avoid empty work items from getting into “Waiting for verification” state. Create new rule, which demands that points, name and company info must be filled before submitting work item into waiting for verification state.

We don’t want to have all of those Azure DevOps services visible on left menu, so remove all others except Boards under project settings. Menu items can be toggled on and off any time and they won’t delete any existing data. For example if I had some test in this project, toggling Test Plans off wouldn’t delete any old data.

Now we have a Azure DevOps project, new process to handle playing, new work item suitable for scores and tided-up UI. Next lets create a “Play backlog” which shows current status of play entries: Which one are waiting for playing, who is playing currently and which ones are waiting for verification. At this backlog page we want to see the player name, score and state of the work item. To achieve this we need to customize Play work item to show those fields in boards view.

Looks nice and simple!

Now the basic work item handling is done. We can create new play work items, see their progress and move them to “Closed” state after the player submitted score is verified. However this is not enough, because work items in backlog are in “random” order and this is not what we want. We want to see the high score table sorted by scores. Luckily Azure DevOps has a dashboard feature which supports custom queries. Queries are created from Boards > Queries page and they can be converted into charts, tables and lists at dashboard.

High score query needs to have two columns: name and score. All results must be “Play” type of work items and their state must be closed (score is verified). Remember to add score as Sorted By column (top menu selection). Note that queries must be saved as “Shared query” to be usable at dashboard.

Now we just need to build our dashboard to show all kind of cool statistics from plays. For example high scores which is query result widget, amount of players, wiki info about pinball game, table about latest plays and so forth.

Here is a picture what we had on the dashboard.

Five tips and tricks to catch

  1. Azure DevOps can be used for different kind of scenarios, not just for software development.
  2. Work items and process can be almost fully customized
  3. Work items can be defined to have maximum number of items in certain state
  4. Remember to use rules to guard your work items data
  5. Use dashboard as your monitor. Toggle it into full screen mode with full screen mode browser.