Here's the whole story

What it does

Peril! VR Trivia is a voice-enabled, virtual reality game show experience that you can enjoy from your own home.

Features

  • Each game features a random set of categories and questions sourced from Open Trivia DB.
  • Answer questions and interact with the AI game show host with your voice.
  • Custom Amazon Lex chatbot supports 11 categories and can scale up to 10,000 questions.
  • AI game show host reacts with gestures and speech powered by Amazon Sumerian and the Lex chatbot.
  • AI competitors speak with unique voices powered by Amazon Polly.
  • In-game TV displays categories and questions.

How I built it

  • Amazon Sumerian: Game client
  • Amazon DynamoDB: NoSQL data store for trivia questions, game states
  • Amazon API Gateway: REST API for game logic and Lex model generation
  • Amazon Lambda: Handlers for game logic REST API, handler for Lex model generation, validation hook for Lex bot
  • Amazon Lex: Chatbot for validating category and answer input from players

Challenges I ran into

  • Sending metadata from Sumerian to Lex: The Sumerian state machine doesn't support passing metadata in the built-in Lex actions. This was solved by integrated with the Lex postContent and postText APIs programatically to attach metadata like the game state.
  • Lex model constraints: Modeling the data using one question per intent was not scalable as Lex only supports 100 intents per bot. This problem was solved this by modeling the intents after categories with slot types as questions.
  • Multiplayer: Websockets integration was attemptedbut I ran into latency issues.

Accomplishments that I'm proud of

  • Squeezing the juice out of Lex model: The bot model can support up to 10,000 trivia questions the way the data is currently modeled.
  • Cloud native: API Gateway + Lambda REST APIs are used for a portion of the game logic, meaning the client doesn't need to be republished.
  • Debugging with visual state machine: The way the logic is modeled in the Sumerian client makes it easy to debug.

What I learned

This was my first time working with:

  • API Gateway
  • Websockets
  • Lex
  • Sumerian

What's next for Peril! VR Trivia

  • Multiplayer
    • Co-presence powered by Websockets
    • Live chat powered by WebRTC
  • A larger trivia database
  • Use a buzzer to opt in for the question
  • Better visuals

Compatibility Notes

Tested on Google Chrome version 71.0.3578.98 with hardware acceleration enabled.

Share this project:
×

Updates