Inspiration

I used to play this game with my elder brother in childhood while walking back from school. We will take turns saying country names starting with the last letter of the previous country name spoken until none of us can think of one. It was fun, competitive and educational. My vocabulary of country names is certainly better in adulthood as a result. When 'Amazon Alexa Kids Skill Challenge' was announced, it was all but natural for me to implement this game with added features to help current generation of kids build their vocabulary of country names and learn interesting country facts.

What it does

'Country Game' helps kids and adults alike to build their vocabulary of country names and teaches them interesting facts about countries in a fun, competitive and exciting way.

The user alternates with Alexa to say country names adhering to two constraints - Country name must start with the ending letter of the previously spoken country name, and no country name previously spoken can be spoken again. This goes on until the user or Alexa cannot think of a country name. At that point, game ends.

The skill awards points to users for saying country games successfully in a game. It maintains their scores and worldwide ranking that they can query for.

The skill creates dynamic interactions by randomizing the greeting and using re-prompts.

How I built it

The skill backend is hosted as a Lambda function (in Node.js) on AWS and interfaces with Amazon DynamoDB for persistence. The Lambda function is using the Alexa Skill Kit SDK for Node.js. Speech icons are extensively used to create emotion-heavy interactions with kids. Country facts, session and scores/ranking are persisted in DynamoDB. Cloudwatch is used for logging, monitoring and debugging.

Challenges I ran into

Persistence was the number one challenge I ran into. I had written numerous skills previously but none required persistence. This skill requires persistence because the score needs to be updated when in a session and/or retrieved when the user desires to and session variables like used country names needed to be persisted to check for duplicates in user responses for countries. With no prior knowledge of DynamoDB, it was a bit of learning curve but in the end I cracked it.

Accomplishments that I'm proud of

  • implement scoring via DynamoDB persistence using tables.
  • creating emotion-rich interactions by combining speechicons and normal phrases.
  • dynamic greeting (have Alexa respond to a different greeting message each time the skill is invoked using open/play/start).

What I learned

  • how to persist data via amazon dynamodb and do CRUD (create, read, update, delete) operations in dynamo via lambda node.js function.
  • learnt about user/session ids.
  • create conversational interactions as opposed to single Q&A type interaction.

What's next for Country Game

  • 2 player mode Right now the game is b/w Alexa and Player. It will be nice to have it among two Human players via Alexa. So, Player 1 starts country names, Alexa validates and then Player 2 says a country name, so on and so forth.
  • hints When user gets stuck and can't think of a country name starting with the current letter, he/she will be able to ask for hint and Alexa can respond back by giving the capital of the country and deducting a few points from user's score for using the hint.
  • Card The skill can have an image for every country and when it responds with a country name, it can respond with a card containing that image so that that kids can see the image in Alexa app and learn some more about the country spoken.
  • Videos/Echo Show The skill may respond back with educational videos about countries.
  • When the last remaining country with a given letter has been spoken for and ends in the same letter, game ends. It will be nice to continue the game at that point and then randomly pick another letter to say a country name with.
  • Currently, if a user cannot answer, game abruptly ends (because of the response timeout). Skill should handle intents like "I don't know" etc at which point it can issue a hint.
Share this project:

Updates