Google Assistant Trivia Template

Leon Nicholls
6 min readJun 20, 2017

--

Nandini Stocker and I just launched a template tool to create trivia games for the Google Assistant. The template turns your questions and answers from a spreadsheet into a fully functioning game without writing any code.

You can try out a few games we built with the template on your own Google Home, eligible Android phones, and the iPhone. Using the Google Assistant, just say: “talk to seven of nine trivia” or “let’s talk to trivia template”.

So, why are we doing this? We want to make it super easy for everyone, regardless of design experience or technical aptitude, to bring quality content to life in apps users will love. Now you can with the trivia template!

5 Steps to Fun

It only takes a few minutes to turn your content into a high-quality conversational experience. And we also host everything for you at no cost to you!

The template has 5 steps for testing and submitting your app:

  1. Pick a Persona. We have 3 personas for you to select from: Mr. Montgomery, the teacher; Caroline, the regal queen; and Tracy, the trivia bot. Each have their own prompts and sounds.
  2. Enter Your Data. Make a copy of our template Google Sheet and enter your own questions and answers. We support both multiple choice and true/false questions. For multiple choice, we recommend no more than 3 answers to each question for the best user experience. Also, update the welcome title for your game in the configuration tab. Here’s where you can add some interest to the opening!
  3. Set up Your Project. Create a project for your app in the Actions Console.
  4. Test Your App. Reference your project when configuring the template app. Try it out on your devices with the Google Assistant or on the Web Simulator.
  5. Submit Your App! After you’ve tested your app and want make it available to other Google Assistant users, go ahead and submit it. Once it launches, get the app directory listing URL in your project settings and share it with your friends!

Under the Hood

The Persona

Starting the design of an app with a persona is an important part of the Actions on Google design principles.

Let us introduce to you to one of our game host personas:

Mr. Montgomery, a teacher, is encouraging, kind, wants to help you do your best and become the best version of yourself you can be.

For our trivia template, we used this persona to drive the design of the prompts we use during the game. We did a design walkthrough to explore the expected dialogs for various user input and game conditions.

In the course of the conversation, we are going for an experience that threads together prompts that establish our persona as the kind of high school teacher they make movies about.

The Technology

Our template is powered by API.AI. After the questions and answers are read from your sheet using the Google Sheets API, we create an API.AI agent for your app and populate it with the necessary intents for your content. The intents handle the various responses the user could provide during the game.

The “game.choice.answer” intent handles the answers the user provides to the questions. The intent uses an “answer” entity which is configured with all the possible answers:

The entity also has synonyms for each of the possible answers. We automatically generate synonyms for parts of the answers — for example, for names, we generate synonyms for first names and last names. You can provide synonyms in the Google Sheet by separating the answer values with the pipe ‘|’ character.

We highly recommend the use of synonyms to make the conversation more natural. For example, if an answer is “USA”, then good synonyms would be “United States” and “US” since it is likely that the user could answer with those too.

The agent is configured to use our shared fulfillment that we host in Google Cloud. The fulfillment handles the question selection and game logic.

When the user invokes the template app with your invocation name, the matching API.AI agent is invoked. As the user responds, the API.AI agent intent will then use the fulfillment to provide a response to the user. You can track the analytics of the users of your template app in the Actions Console.

We broke up the conversation into prompt types for each persona that we could glue together to create the game dialog dynamically in fulfillment.

For each of the prompt types we designed multiple prompts. For example, for the first-time user welcome prompt, we have:

  • Glad you’re up for %s. This is going to be fun. I’m here with you every step of the way.” (‘%s’ is a placeholder for dynamic text)
  • Let’s put our heads together for some %s.

We did the same for all of the other prompt types. The more variations in prompts, the more natural the conversation feels; some of our prompt types have over 50 variations! These prompts are selected randomly during the game, making sure we don’t repeat prompts sequentially.

Our dialogs make use of SSML to play audio tracks and sound effects to create an engaging and fun experience (see our post on using SSML for Actions on Google). Our sound designer has created over 20 custom sounds for each of the personas. For most of the sounds we have multiple versions that we randomly pick during the game:

Let the Games Begin

We plan to add more “avatars” or personas for the trivia template. And other templates are in the works too.

In the meantime, now that it’s super easy to create your own app for the Google Assistant, we’d love to see the great trivia games you create!

[Update 7/13/7: We have open sourced the trivia game so you can add your own features].

[Update 10/4/2017: Templates are now part of the Actions Console for Google Assistant developers. We are launching with trivia, flash cards and personality quiz templates.]

Thanks to Nandini Stocker, Google’s Head of Conversation Design Advocacy, who co-authored this post.

--

--

Responses (10)