Shiny app: https://sparktuga.shinyapps.io/ShinyDecisions/
RStudio Cloud: https://rstudio.cloud/project/1083040
Authors: Pedro Coutinho Silva
Working with Shiny more than 1 year
Abstract: A game about making the best of terrible choices! In shiny decisions your goal is to last as long as possible while making decisions that affect the wealth, population and environment quality in the world. If any of those metrics reaches zero, its game over! How long can you last?
A game about making the best of terrible choices
In shiny decisions your goal is to last as long as possible while making decisions that affect the wealth, population and environment quality in the world.
If any of those metrics reaches zero, its game over! How long can you last?
Some of the packages included in this project are currently only available on github. This includes
shiny.blank. To install them locally remember to run on your machine the following commands:
library(devtools) install.packages(devtools) devtools::install_github('pedrocoutinhosilva/shiny.grid') devtools::install_github('pedrocoutinhosilva/shiny.blank')
Starting a game
From the start game screen you will be able to start a new in any difficulty (Easy, medium or hard).
You can also toggle the tutorial on and of if you already know the basics of the game.
During the game
The game UI has 3 main areas:
Displays the current value of the different metrics you need to manage. Those metrics include:
- Karma: Being too bad or too good wont lose you the game, but might have some hidden effects...
- Wealth: Things cost money. No money no fun
- Public opinion: If no one likes you, you probably wont last long in power!
- Environment: If the world is beyond saving, whats the point?
The game metrics:
The karma meter:
A visual representation of what effects your actions are having in the world. Icons and the map color with change depending on how high or low some metrics are.
Your next task and the way you can move forward in the game. Above the task you can also see the current week in game. Every task you complete will move the game forward 1 week.
Card colors reflect the card pool and severity of the current card. The darker the card the more severe the task is, and more change it will have on the metrics. Currently 3 cards pools are implemented:
- Bad cards (Cards that will have mostly negative consequences, red background)
- Good cards (Cards that will have mostly good consequences, green background)
- Special cards (Cards that will have unique consequences, purple background)
If you want to know more about all the possible cards and options available, you can check the google spreadsheet containing all possibilities at:
Each task as 2 possible decisions, left or right. Simply drag and hold the card to each side to see what decisions you can take. while holding the card the names of the metrics that will be affected by that decision will also blink. Drag and release to commit to your decision.
when one of the metrics reaches zero, the game is over and you will be taken to the end game screen. Here you can see how many weeks you lasted, as well as return to the initial screen in case you want to go again.
Shiny.decisions takes full advantage of modules and R6 classes for managing the code complexity.
Most of the project is broken down into R6 managers that take care of specific parts of the workflow:
The brain being the game flow. It manages all game dependencies and is responsible for high level actions that drive the state of the game.
Connects and exposes all external data required by the app. This includes the main data storage regarding task cards, game options and game modes loaded from a google spreadsheet.
Most options and cards can be added or tweaked without code changes directly on the spreadsheets.
The current live spreadsheet can be found at:
Stores information regarding the current state of the game. This includes the current value of the different metrics, map markers and state checks for specific game phases.
Responsible for displaying the current state metrics on the UI.
Responsible for displaying map information according to the the current state metrics on the UI.
Responsible for creating cards according to the game state and switching between card pools depending on the current game phase.