Beat the trend - a bus company simulator game
I was asked to convert an ancient MS-DOS based version of a bus company simulator game to something more modern and engaging for students. The game is used in a transport economics module to help teach about elasticties. So I decided to use the opportunity to learn about Shiny. This was my first Shiny App and was completed a couple of years ago.
In the game, you are the financial director of the Domino Bus Company, which operates two services. Your problem is that every year your costs are increasing and your passenger numbers are decreasing. At the beginning of each financial year you can change the quality of service offered (equivalent to miles of route operated) and/or the fares charged on each service. The two services have different elasticities with respect to fares and mileage. You must decide what management action to take at the beginning of each year, in order to continue running a good bus service. If you do nothing you will be bankrupt within four years. The idea is to maximise the company's balance by the end of the 25 year period - unless you go bust before that! But beware, as excess profits are penalised.
The app gui is divided into 3 main sections.
- On the left-hand side you can set the desired change to fares and route mileage for each service and then click "Simulate next year". You can also start over by clicking on "Restart".
- On the right-hand side you have a top area where key financial indicators are shown, along with some useful tips and warnings.
- Below the financial indicators is a tabbed region. This can either show instructions; a data table of results that can be downloaded as a CSV file for further analysis; or a set of graphs showing key measures. The data table and the graphs get updated after each year, so you can choose which tab to display as you complete the game.