The Pardot Ping Pong Service


Home

What it does

A TV is in the corner with an RFID badge reader attached. Scanning your badge puts you into a game lobby. Clicking start when your friends have joined yields a new screen. Fighting game backgrounds animate the backdrop. As you serve, your partner hits the taunt button. As your opponent is about to swing, the TV erupts with the Trolololol song. They miss. You score a point and slap the arcade button drilled into the table on either side. Your score increments and your opponent's health goes down.

As the game draws to a close, you are the victor. Hitting the score button restarts the game. Leaving will end it in 10 seconds. As you leave the room, the TV reminds you that winners don't do drugs.

You are the winner

How it works

In the room, we have several components:

External to the room, we are running the application itself on heroku

The Table

We have attached 3 buttons on each side of the table. 2 on the sides control each team's score, while the one in the center allows for taunting sound clips to be played.

These 6 buttons are then attached to a Particle Photon, which is a development board with integrated wifi and allows for over-the-air code updates. The Photon is programmed similarly to an Arduino. While the taunt button is just a link to an API callout, the increment/decrement button is a bit more complex. For quick taps, we send an incrememt to the specified team, while for longer holds (~1 second) we send a decrement.

The Computer in the Room

The computer in the room serves as the user's interface for user registration, game creation, viewing scores, and being told when to switch serving teams

When users first arrive in the room, they are prompted with the following screen:
new game screen
From here, users may "badge in" to the system. If the badge is recognized, then the player is added to the game. Otherwise, the player is prompted to create a new user, by entering a Name, Pin, and having a picture taken:
player's picture
Once all players are in, they can choose to start the game, or "Balance the Teams". Balancing the teams will try to make the teams even, skill wise. Behind the scenes, we use the ELO algorithm to do this.

Once the game is started, this screen will appear:
play screen
Input from the table will be shown, sounds will play at certain points ("Change Places!"), health will decrement from each side, and eventually there will be a winner. From there, a new game can be made from the existing players by clicking a score increment button or the game will time out and go back to the main menu.

The Server

For this project, we used heroku because it was free to us. All logic occurs there based on the inputs from the table and client-computer. We keep track of player rankings from historical games, and can determine handicaps per game. Ranking data can be viewed from a client:
leaderboard
and can be drilled down by player:
player data
and even further for actual game data if desired (not shown).

A relatively new feature is the ability to have "seasons" of play. These allow us to, on a regular basis, reset the leaderboard while keeping the past data available for nostalgia. The biggest advantage to this is to make it so the players no longer with us aren't in the number 1 slot.

Credits

Please see https://github.com/jusroberts/pingpong-web-server/graphs/contributors for a full list of contributors and their contributions. be a winner