Microsoft Teams Dice App
Microsoft Teams is taking the world by storm with over 115 million daily active users (as of 2020). I decided it would be fun to build my very own Microsoft Teams app! Call it a COVID-19 side project.
Looking around it seems most Teams apps are geared towards business use cases. Where's the fun in that? I thought it was time to bring a little fun to Teams so I built a dice rolling app!
However, I took it a step further...I built something much more than a simple dice rolling bot. I really pushed the limits of the Microsoft Teams platform, the Bot Development Framework and Adaptive Cards to build an app capable of multiplayer interactive dice games completely inside of Teams! Basically I put Adaptive Cards and Bots on steriods to turn them into mini-applications that run inside of Teams. I used a number of creative and innovative techniques that I beleive are the first of their kind for a Teams app.
I started with a couple of well known dice games: "Pig" and "Midnight". I may add more games like "Poker Dice" (if I can find the time).
I also built a generic dice rolling game board and called it "Open Play". This is a flexible game board designed to allow a group of people to play any game that requires dice rolling.
Get the App
After a month long conversation with Microsoft to get the Dice App published into official Microsoft Teams App Store (called "AppSource"), it turns out they are not currently accepting apps with gaming functionality.
Therefore, I’ve decided to distribute the Dice App directly from my website.
All you need to do is:
Download the app which is just a ZIP file. The ZIP file contains the app manifest and a couple of images (there’s no actual code in the ZIP file, all the code runs on my servers).
Then upload the app (the ZIP file) directly into Teams.
See the Microsoft documentation for instructions on how to upload apps manually in Teams.
How to use the App
The Dice App for Microsoft Teams is a fun and versatile app that brings dice rolling and interactive games to Teams! Roll dice using dice notation. Play multiplayer dice games in a team or group chat with the power of interactive game boards that work completely within your chat!
It offers several features depending on your needs:
Ad-hoc dice rolling based on dice notation. This option is great if you’d like dice rolls to be part of an active chat stream. Just instruct the bot to roll dice using the "roll" command and it will return a card with the results of your roll!
Roll dice using an interactive "Open Play" game board. This option is perfect if you’d like an interactive game board that allows multiple players to roll dice by clicking buttons and also see the roll history all in one place. Just ask the bot for an Open Play game board using the "play open" command and it will return a card that all people in the chat can interact with!
Play built-in multiplayer interactive "Pig" and "Midnight" dice rolling games. In this case the app will control the game play by enforcing the game rules, directing player turn and keeping track of scores! Just ask the bot for a Pig or Midnight game board using the "play pig" or "play midnight" command and it will start the game!
Note: The Dice app is designed to be used in a team or group chat context. It is not designed for the personal context or playing games vs. a bot.
The app supports three commands:
- roll --> Use the 'roll' command to roll dice based on dice notation
- play --> Use the 'play' command to play an interactive dice game
- help --> Use the 'help' command for basic help and examples
To invoke the Dice app, you need to "at mention" it using @Dice
- @Dice roll
- @Dice play
- @Dice help
The 'roll' command can be used to instruct the app to roll any dice based on dice notation
The app will respond with a card showing the rolled dice. Also, the card has a button that allows any person in the team/group chat to roll again using the same dice notation.
Roll Command Examples:
- roll --> Roll 1 6-sided die (this is the default when you don't specify a dice notation)
- roll d10 --> Roll 1 10-sided die (1 die is the default if you don't specify)
- roll 4d6 --> Roll 4 6-sided dice
- roll 3d12 --> Roll 3 12-sided dice
- roll 5d6+4 --> Roll 5 6-sided dice and adds 4 to the total
- roll 6d12-8 --> Roll 6 12-sided dice and subtracts 8 from the total
The app supports rolling up to 25 dice with up to 100 sides. The max modifier is +/-100000.
Here's an example card in response to @Dice roll 4d6
Here's an example card in response to @Dice roll 6d12-8
The 'play' command can be used to instruct the app to start an interactive game.
- play --> Show a card listing all the supported games to play
- play open --> Start an "Open Play" game
- play pig --> Start a game of Pig
- play midnight --> Start a game of Midnight
Here's an example card in response to @Dice play
When starting the "Open Play" game, the app will go straight to the Open Play game board card. Since it is an "open" game, anyone in the team/group chat can interact with the card to participate in the game. There's no need to explicitly join the game.
For the Pig and Midnight games however, the app will need to control the game play. For example, the app controls player turn, ensures only the current player can click buttons, keeps track of score and chips, etc. For these games, the app must collect the list of players before constructing the game board and starting the game.
Therefore you'll first see the "Join Game" card when starting these games. Anyone in the team/group chat can click the "Join" button to join the game. As people join, the "Join Game" card will automatically update with the list of players.
The person who originally started the game via the play
command will be known as the "Game Manager"
. The Game Manager takes on the responsibility of "running" the game by having access to buttons that show up under the "Game Manager" section on various game cards.
For example, the Game Manager is responsible for clicking the "Start Game" button in the "Join Game" card once he/she is happy with the list of joined players.
Note that other players can see the buttons under the Game Manager section, but only the Game Manager can invoke action by clicking them. The Game Manager concept is necessary since everyone in a team/group chat can see the card, but the app needs to prevent multiple people from clicking buttons at the same time.
So in a way, it's an approach to ensure buttons like "Start Game" is only clicked once. Also, it prevents a rouge player from clicking the "Delete" button if they're losing!
The "Delete" button completely deletes the card from the chat stream. It could be useful if you want to clean up your chat stream, or hide the fact that you're playing games while on the job from your boss!
Open Play is flexible dice rolling game board designed to allow a group of people to play any game that requires dice rolling.
For example, you could play Dungeons and Dragons, Yahtzee or Farkle dice games. Unlike the other games boards like Pig and Midnight, the Open Play game board doesn't enforce any rules but rather simply tracks a history of dice rolls.
There are no constraints on who rolls, how many times a player rolls, how many dice can be rolled or the number of sides on the dice. Each roll can be customized, including selecting the number of dice, the number of sides, and the option of adding a total modifier.
Open Play requires the players to coordinate who's turn it is as it does not protect against multiple players trying to roll at the same time. It also requires the players to keep track of game info (e.g. score, etc).
Note: You can also use the bot "roll" command to roll dice based on dice notation.
Open Play Game Board Screenshot
The object of the game is to score 100 points before your opponents.
The Pig dice game comes from family of jeopardy dice games. Players are allowed to go for bigger gains by taking a risk which also can result in not making any gain at all!
A player begins play by rolling two dice. After each roll the dice value is added to their score for that turn. After each roll the player can decide whether to stop rolling and claim the total turn score or continue rolling.
If the player rolls a single 1 then they lose all points scored for that turn and play is then passed to the next player. This has no impact on their overall score.
If the player rolls two 1's then they lose all points scored in the game and play is then passed to the next player. In other words, their overall score is reset to zero!
If a player decides to stop rolling, they get the points scored so far which is added to their overall score.
The first player to score 100 points wins the game.
Pig Game Board Screenshot
The object of the game is to win the pot of chips by rolling the highest score compared to the other players. Players must roll a 1 and a 4 in order score.
With a 1 and a 4, a player’s score is the total amount on the remaining four dice. The best score possible is 24 (all four dice are 6's).
Each players starts the game with 3 chips and must ante 1 chip to in order to play each round. A player is out of the game when out of chips.
A player begins play by rolling all six dice. After a roll, the player must keep at least one die but can keep more if wanted. After deciding the dice to keep, a player will roll the other dice. Again, a player must keep at least one die after a roll but can keep more.
Once a player has kept all six dice, the player's score is calculated and recorded. Play moves to the next player who will begin by rolling all six dice.
The player with the highest score after all players have had their turn wins the round and all the chips in the pot.
Rounds will continue until one player collects all the chips and wins the game!
The qualifying dice of 1 and 4 can be rolled and kept at any time during your turn. They do not need to be rolled and kept before the scoring dice.
If the qualifying dice of 1 and 4 are not rolled by the end of a player’s turn, the player scores zero. Once a dice is kept it cannot be rolled again during that turn.
Midnight Game Board Screenshot
Help and Support
I've made this free to avoid creating a sense of obligation that I'll provide support. I don't guarentee it will work in every scenario or that I'll provide support when it doesn't work. With that said, if you do have a problem that you think I can help with shoot me an email and I'll reply if I can.
Also note that it cost money to run the web services to power the app. I pay for this myself...in other words, this is a money losing venture. Don't expect miracles or assume I'm getting rich off of this. I do accept donations which help offset the many hours put towards building, improving and supporting this software.
I can be reached at my support email address: email@example.com
- Version 1.0 - 01/22/2021 - Initial Release