Train Simulator Book++ Project

Train Simulator Book++ Project

Madelaine Fischer-Bernhut, Ola Soszynski, Vijaei Posarajah

Book: Trains: Classics of Transportation


Group Work Breakdown:

Ola – PubNub and p5.js sketches and implementation (coal shovel and whistle for mobile)

Madelaine – research into and final path creation (with BG Curves and dynamic speed implementation), final game build and scripting in unity with PubNub, basic 3D models of train, terrain (map), station, and collision detection of train and station

Vijaei – research into path creation, Project context research, documentation compiling, shovel acquisition, unique asset design (trees, diverse coloured train stations – unfortunately, were not able to be implemented in the presented build)


Project Description:

Our project aimed to enhance the reading experience about classical 19th century trains by providing the participants a simulated experience of operating a steam engine train through teamwork. The train simulator game works with a laptop displaying a train on a route with train stations to stop at. The participants  are tasked with operating the train by using a phone mounted on a toy shovel to shovel coal using a shaking or shoveling motion allowing the train in the game to move forward. Another participant will have a whistle used as a button to supply the the coal shovelers with more coal. The main goal within the game is to move the train along the track and complete it’s route consisting of train stations. The participants have to work together as a team to operate the train. Our original inspiration was to replicate a train simulator type game with cooperative play in mind with multiple devices used to operate the train but instead of a modern train players would operate a steam engine train along with the devices associated with its operation. Our final project was a scaled down yet functioning version of our original concept.

The original concept involved tasks such as:

-Checking statistics (speed, supplies, engine)

-Shoveling coal into the steam engine, depleting supply, increasing speed

-Communicating with a station for supplies, increasing supplies

-Releasing steam, needs to be done or engine overheats

-Conducting the train, depleting speed

-Slowing down is required to receive supplies

-Going too fast will cause a collision, ending the simulation

-Running out of supplies results in the train stopping, ending the simulation

-Forgetting to release steam results in the engine overheating, ending the simulation



P5 Buttons and Controllers:

Train Simulator Unity game:





Computer display – output of players actions (world and train representation in Unity. In the presented build we used one display, but in the future we can imagine having multiple displays to represent different views from the train. In unity, multiple cameras pointing in different directions were added  to support a multi display experience. Displays would be placed in a formation similar to an actual train.

Mobile display – input player actions, two were used for the presentation, although this can be increased so multiple players could be in charge of shoveling and “blowing” the whistle to restock coal. At least one coal shoveler and whistleblower are need to play the game.


Programs Used:

Our project used Unity to create the main train simulator game which involved assets such as the train referenced from our book, train stations, railway signs, trees and terrain. WIthin the Unity we used a pathway system for the railway track as well as systems for acceleration and collision. We used P5.JS for the steam whistle button interface as well as the coal shovel controller used to accelerate the in game train. To have our mobile devices communicate between each other as well as the gem we used Pubnub to establish a network. The steam whistle button communicates with the coal shovel by sending coal to the shovel to be used, and in turn the shovel communicates with the game to accelerate the train forward or stopping the trains movement by not shoveling. Ideally our system would allow one steam whistle user, one train simulator game display and multiple users for shoveling coal.


Project Context:

For real world references we looked at simple versions of existing train simulator games found online such as Train simulator 3d ( which uses the acceleration and braking mechanic as simple sliders to operate the train. We also took note of the optional fixed camera views provided by the game as a feature to implement in our own game. For the Cooperative multiplayer aspect of our game we looked at available and relevant games in the current market such as Space team (  by Henry Smith, which allows multiple players to simulate a spaceship bridge by commanding players to press buttons and switches according to a sequence provided in the game. Here players are reliant on other players to follow through on their sequence so they can contribute as team and progress in the game as a whole ( . Where Space team is reliant on multiple individual devices, we used Artemis Spaceship Bridge Simulator (  by Incandescent Workshop LLC as a reference to how our game would work reliant on a single game world with multiple devices used as controllers to play a single sequence game. Here each participating player is in charge of a single aspect of operating the spaceship and rather than being told by the game what to do, they have to react to the game world as a team to survive encounters ( . We also used “Game Mechanics for Cooperative Games ( ),” by Jose Bernardo Rocha, Samuel Mascarenhas, and Rui Prada to understand the variety of cooperative game mechanics that can be implemented into our cooperative simulator game.



Group meeting sketches used to flush out our concepts for a simulator type game



2019-01-17-1 2019-01-23-6

Trying the pathing asset by Surge. Madelaine was unable to implement dynamic speed values using this component.


The final asset used for pathing was the spline creator BG Curves.


Madelaine’s attempt at creating a bezier curve system from scratch.

20190122_131405 tree-assets

Unity game development process including modeling game assets, train paths, and terrain

20190122_131520 screenshot_20190117-125603_chrome screenshot_3

Development process for steam whistle button, coal shovel controller, and Pubnub network



The biggest issue that we had to overcome was getting the different devices to communicate with each other. All the devices were able to publish information, but the mobile devices were unable to communicate with unity. After a lot of troubleshooting and help (thank you Nick) we realized that PubNub was getting confused with all the different data being published to one channel. The creation of subchannels for each data type, solved the issue (ie. A separate channel for the coal values from the speed channel).



img_20190124_114208678 img_20190124_112603794


Experiment 1: Interactive Audio Visualizer

Vijaei Posarajah                                                                                                                              3163608


Github link:

(Issues running in chrome, run HTML file in Firefox or MS.Edge)

Programming Language: JavaScript(p5.js and sound.min.js)

For this project, I had decided to expand upon the Atelier tutorials, focusing on the implementation of p5.js. I goal was to create an interactive audio visualizer where the user can input their own tracks and interact with the visuals.

Project Description: 

The very beginning of the project focused on the in-class tutorial based around  circle visualizer  and a circular graph tutorial I found on Youtube:

What led to the final design was based on a tutorial by Yannis Yannakopoulos, where he further explains the p5.sound library and the use of the FFT (Fast Fourier Transform) algorithm.

Creative Audio Visualizers


This eventually leads to the current iteration of the Interactive Audio Visualizer, which is composed of three rings of dots of various sizes that focus on the bass, mid, and treble of the audio track. Much like the circle visualizer, the three rings change in size according to the level of bass, mid, or treble in the audio track. On top of this, a fourth circle composed of lines focused on the bass which is interactive based on the user’s mouse position on the canvas. The lines mimic a camera shutter motion that rotates in place. Below the audio visualizer is a play and pause button, along with an upload button to allow the user to upload their own track to have visualized. The design theme around the visualization is based around a spring bloom concept with regards to colors and floral motifs.

Sketch Documentation:


visualizer-2 visualizer-3 visualizer-4

Code Documentation: 

code-1 code-2 code-3 code-4


Creative Audio Visualizers by: Yannis Yannakopoulos

7.10: Sound Visualization: Radial Graph – p5.js Sound Tutorial