bluelinden / podium

The Free Online Trivia Night, built on WebRTC.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Podium: The Free Live Trivia Game


Podium is a free, interactive trivia game to play with your friends, classmates, really whoever can stand to have a good time without being bugged to create an account.

Games are joined with a five-character join code made up of letters and numbers.

TODO:

  • Create connection mechanisms
  • Allow game transfers so that one player can 'take over' if the host decides to allow them.
  • Create a Game class

Game creation:

  1. Create a new Host
  2. Ask for a JSON file with the questions and game setup
  3. Create a Game object with it
  4. Wait for user join signals with the Host name.
  5. If there's a whitelist, compare the User ID to it.
  6. When a user joins, signal to them that they've joined a game and let them verify that they've joined the right game.
  7. Once they've verified, either assign a random name to them or let them choose a name.
  8. Check the name against any rules the host has set up.
  9. Once joined fully, put them on a waiting screen. Send the client details on the game.

Game joining:

  1. Create a User.
  2. Ask the user for a code.
  3. When the code is fully input, make a connection request to the host username.
  4. If that was a valid code and the host responds with a test signal, ask the user for their name. Or, if it was randomly generated by the host, skip to step 6.
  5. Send the name to the host. If denied, ask for the name again and cite the reason.
  6. When the name is approved, put the user on a waiting screen and wait for details of the game in order to customize its appearance.

Game transfer - host:

  1. Have the host elect a user to transfer hosting to.
  2. Send a transfer verification request to the elect, so they can confirm or deny it.
  3. If confirmed, send them a message allowing them to create a new Host, along with the entire Game object if chosen.
  4. Wait for the elect to send back the new ID.
  5. Tell all players that the Host ID has changed and to connect to the new Host. If any deny, their client resets.

Game transfer - Host-elect:

  1. Receive a host transfer verification request. Prompt the user to confirm or deny it.
  2. Wait for a message from the host allowing transfer of the game. Receive and store the Game object included within.
  3. Create a new Host and send the ID to the current host.
  4. Switch to Hosting mode upon receiving the message telling all players to switch over.

How the thing works:

Users connect to a specific Host. Games are "shared experiences" that are managed by the Host. The user does not connect to a Game, they connect to a Host managing a Game.

Data structures:

User

  • Name
  • PeerJS User
  • Host of game
    • Game object
  • Player of game
    • Player object

Hosted Game

  • Name - done
  • Question set - partial!
  • Game mode (Trivia or Game Show) - done
  • Custom dialogue and behavior - done
    • Custom JavaScript URL - done
    • Custom win/loss text for whole game - done
    • Custom CSS URL - done
    • Custom Logo URL - done
  • Game Show mode information
    • Question boards
      • Columns
        • Text
        • Rows
          • Question
            • Text
            • ID
  • Metadata - done
    • Author
    • Description
    • Tags
    • Date created
    • Age rating (Everyone, Teen, Mature)
    • Max number of players
    • Copyright
    • License
    • Version
    • Game ID
    • Level created in (JSON, Web Builder, etc.)

Player of Game (player-side)

  • Name
  • Score
  • Rank
  • Custom dialogue and behavior
    • Custom JavaScript code
    • Custom win/loss text for whole game
    • Points system code (if not default)
    • Display logic
    • Name vetting logic
  • Custom appearance and style
    • Custom CSS
    • Custom Logo
  • Metadata

Question (host-side)

  • Question text - done

  • Answer (Options or correct text)

    • Text
    • ID
    • Correct?
    • Order if in drag'n'drop question
  • Answer type - done

    • buzzer
    • Select one
    • Select all
    • True/False
    • Fill in the blank
    • Short answer
    • Drag and drop
    • None
  • Answer order - done

    • Random
    • Ordered by position in array
  • Timers

    • Answer countdown
    • Answer submission close
    • Reveal duration
    • Ranking duration
  • Answer points

  • Partially correct points

  • Answer penalty

  • Timeout penalty

  • Question media

    • Media type
      • Type
      • Image
      • Video
      • Audio
      • None
    • Media display
      • Before question (bool)
      • During question (bool)
      • After answered (bool)
      • During scoring (bool)
      • On player devices? (bool)
      • On host devices? (bool)
  • Feedback

    • Right answer
    • Partially right answer
    • Wrong answer
  • Answer display

    • Multi-choice blocks
    • True/false blocks
    • Text
    • Image
    • None (save for end of game)

Question (player-side)

  • Question text
  • Potential answers
  • Answer type
    • LIVE!
    • Multiple choice
    • True/False
    • Fill in the blank
    • Short answer
    • Drag and drop
    • None
  • Answer countdown
  • Answer time
  • Answer points
  • Partially correct point multiplier
  • Answer penalty
  • Question media
    • Media type
      • Type
      • Image
      • Video
      • Audio
      • None
    • Media display
      • Before question (bool)
      • During question (bool)
      • After answered (bool)
      • During scoring (bool)

Anti-cheat

In a large enough game, there's bound to be someone who modifies the client. My approach to anti-cheat is designed to respect the user. Trust but verify.

About

The Free Online Trivia Night, built on WebRTC.


Languages

Language:JavaScript 48.2%Language:Sass 38.9%Language:Handlebars 12.9%