Alexa Blogs

Alexa Blogs

Want the latest?

alexa topics

Recent Posts

Archive

Showing posts by David Markley

July 10, 2015

David Markley

While working with the Alexa platform over the last few months, it occurred to me that some of my favorite text games could be made more accessible to today’s game players through voice control. There has been a resurgence of text based, narrative gaming; and access by voice takes the experience to a whole new level of interaction. Successful video games have solid characters and background stories that are driven by conflict. Text based games rely even more heavily on their story. And the voice interaction enabled by Alexa provides for an extremely intimate dialogue between the gamer and the game.

Watch the Alexa adventure game on YouTube here.

Voice User Interface

Dialogue is the User Experience for voice based games and so it is where you will spend most of your time when designing the game interactions. While the speech-to-text capabilities of the Alexa platform are impressive, it is important to simplify the customer controls so the game can not mistake the gamer’s instructions. As part of developing an Alexa skill, you define the syntax and provide sample utterances. Syntax defines the available customer intents and the sample utterances help the Alexa platform map speech to those intents.

Making Choices

Suppose you want to interact with the gamer through simple choices. You can present the gamer with a set of multiple choices and enable them to select one of them. This is the simplest form of control and leaves very little chance of getting the gamer’s selection wrong. Let’s say that you’ve written your voice response to be:

Alexa: “You are standing on a dusty road with a large, vibrant lake to one side and a dark forest to the other.

Would you like to:

1.       Walk north along the road?

2.       Walk south along the road?

3.       Dive into the lake?

4.       Enter the forest?”

Gamer: “Choose 1”

The most straightforward user experience enables the gamer to simply say “1,” “2,” “3,” or “4” and have game play progress based on that choice. To define this Voice User Interface (VUI) with Alexa, I create a choice intent and sample utterances such as:

{

      "intent": "ChoiceIntent",

      "slots": [

                {

                    "name": "ChoiceValue",

                    "type": "LITERAL"

                } ]

    }

And some sample utterances to map to that schema:

ChoiceIntent   {a|ChoiceValue}

ChoiceIntent   {b|ChoiceValue}

ChoiceIntent   {c|ChoiceValue}

ChoiceIntent   {d|ChoiceValue}

ChoiceIntent   {one|ChoiceValue}

ChoiceIntent   {two|ChoiceValue}

ChoiceIntent   {to|ChoiceValue}

ChoiceIntent   {too|ChoiceValue}

ChoiceIntent   {three|ChoiceValue}

ChoiceIntent   {four|ChoiceValue}

ChoiceIntent   {next|ChoiceValue}

ChoiceIntent   {continue|ChoiceValue}

ChoiceIntent   choose {a|ChoiceValue}

ChoiceIntent   select {b|ChoiceValue}

ChoiceIntent   option {c|ChoiceValue}

ChoiceIntent   try {d|ChoiceValue}

ChoiceIntent   choose {e|ChoiceValue}

ChoiceIntent   select {one|ChoiceValue}

ChoiceIntent   option {two|ChoiceValue}

ChoiceIntent   try {three|ChoiceValue}

ChoiceIntent   choose {four|ChoiceValue}

ChoiceIntent   select {first one|ChoiceValue}

ChoiceIntent   try {last one|ChoiceValue}

ChoiceIntent   choose {first|ChoiceValue}

ChoiceIntent   select {last|ChoiceValue}

Direction Commands

A more advanced interface would enable the gamer to give commands like “Go North,” “Enter the Forest,” or other simple commands. And a more open-ended style of play would only give the gamer the situation and not the option. The last style is much more in line with many text-based games:

Alexa: “You are standing on a dusty road with a large, vibrant lake on one side and a dark forest to the other.”

Gamer: “Jump in the lake.”

Alexa: “You drown. Would you like to be revived and try again?”

Clearly the game needs to understand where the gamer’s directional command will take them and handle an invalid choice appropriately or in some entertaining manner. In this case, I really don’t want the lake to be an option, so if you go into it you are sure to drown. For the other options, the game will take the gamer to the next scene and change the state of the game.

To handle direction commands within my games, I have defined the direction intent with this simple schema:

{

      "intent": "DirectionIntent",

      "slots": [

                {

                    "name": "DirectionVerb",

                    "type": "LITERAL"

                },

                {

                    "name": "Direction",

                    "type": "LITERAL"

                },

                {

                    "name": "Destination",

                    "type": "LITERAL"

                } ]

    }

The sample utterances are key to defining what the Alexa platform will identify as a directional intent from the gamer. These are some of the ones I use:

DirectionIntent   {north|Direction}

DirectionIntent   {south|Direction}

DirectionIntent   {east|Direction}

DirectionIntent   {west|Direction}

DirectionIntent   {go|DirectionVerb} {east|Direction}

DirectionIntent   {go|DirectionVerb} {home|Destination}

DirectionIntent   {go|DirectionVerb} to the {west|Direction}

DirectionIntent   {go|DirectionVerb} {northeast|Direction} to {house|Destination}

DirectionIntent   {move|DirectionVerb} {southeast|Direction} to {castle|Destination}

DirectionIntent   {head|DirectionVerb} {northwest|Direction} to {mountain|Destination}

DirectionIntent   {travel|DirectionVerb} {southwest|Direction} to {stronghold|Destination}

DirectionIntent   {go|DirectionVerb} {down|Direction} to the {river|Destination}

DirectionIntent   {move|DirectionVerb} {up|Direction} to the {riverbank|Destination}

DirectionIntent   {head|DirectionVerb} {sideways|Direction} to the {ocean|Destination}

DirectionIntent   {travel|DirectionVerb} {left|Direction} to the {lake|Destination}

DirectionIntent   {go|DirectionVerb} {right|Direction} toward {cave|Destination}

DirectionIntent   {move|DirectionVerb} {around|Direction} toward {spider|Destination}

DirectionIntent   {head|DirectionVerb} {quickly|Direction} toward {chair|Destination}

DirectionIntent   {travel|DirectionVerb} {slowly|Direction} toward {table|Destination}

DirectionIntent   {go|DirectionVerb} {directly|Direction} toward the {desk|Destination}

DirectionIntent   {move|DirectionVerb} {north|Direction} toward the {terminal|Destination}

DirectionIntent   {head|DirectionVerb} {south|Direction} toward the {computer|Destination}

DirectionIntent   {jump|DirectionVerb} {up|Direction} toward the {beer|Destination}

DirectionIntent   {crawl|DirectionVerb} to {house|Destination}

DirectionIntent   {slither|DirectionVerb} to {park|Destination}

DirectionIntent   {wander|DirectionVerb} to {door|Destination}

DirectionIntent   {saunter|DirectionVerb} to {box|Destination}

DirectionIntent   {sprint|DirectionVerb} to the {chest|Destination}

DirectionIntent   {race|DirectionVerb} to the {portal|Destination}

DirectionIntent   {dance|DirectionVerb} to the {tree|Destination}

DirectionIntent   {travel|DirectionVerb} to the {rock|Destination}

DirectionIntent   {go|DirectionVerb} toward {monster|Destination}

DirectionIntent   {move|DirectionVerb} toward {vampire|Destination}

DirectionIntent   {head|DirectionVerb} toward {balrog|Destination}

DirectionIntent   {travel|DirectionVerb} toward {orc|Destination}

DirectionIntent   {go|DirectionVerb} toward the {elf|Destination}

DirectionIntent   {move|DirectionVerb} toward the {dwarf|Destination}

DirectionIntent   {head|DirectionVerb} toward the {wraith|Destination}

DirectionIntent   {travel|DirectionVerb} toward the {sun|Destination}

DirectionIntent   {dive|DirectionVerb} into the {lake|Destination}

DirectionIntent   {jump|DirectionVerb} in the {pond|Destination}

DirectionIntent   {enter|DirectionVerb} the {forest|Destination}

Combat Commands

So far the gamer can move around in the game, and that can be enough if we’re taking them through a multiple ending story where they are limited to specific storylines. If they want to interact with other characters or perhaps fight monsters, they will need to be able to give commands that tell the game what they want to fight (combat target), what they want to use (combat weapon), and how they want to use it (combat verb). This is how I have developed the schema for my combat intent:

{

      "intent": "CombatIntent",

      "slots": [

                {

                    "name": "CombatVerb",

                    "type": "LITERAL"

                },

                {

                    "name": "CombatTarget",

                    "type": "LITERAL"

                },

                {

                    "name": "CombatWeapon",

                    "type": "LITERAL"

                } ]

    }

And the sample utterances for any set of combat I may want to support in my game:

CombatIntent   {hit|CombatVerb} {monster|CombatTarget} with {sword|CombatWeapon}

CombatIntent   {stab|CombatVerb} {dragon|CombatTarget} with the {knife|CombatWeapon}

CombatIntent   {poke|CombatVerb} {balrog|CombatTarget} with a {stick|CombatWeapon}

CombatIntent   {insult|CombatVerb} the {mugger|CombatTarget} with {rocks|CombatWeapon}

CombatIntent   {slap|CombatVerb} the {orc|CombatTarget} with the {arrow|CombatWeapon}

CombatIntent   {flick|CombatVerb} the {fairy|CombatTarget} with a {stare|CombatWeapon}

CombatIntent   {kick|CombatVerb} {dwarf|CombatTarget}

CombatIntent   {slaughter|CombatVerb} {pig|CombatTarget}

CombatIntent   {strike|CombatVerb} the {vampire|CombatTarget}

CombatIntent   {smack|CombatVerb} the {dog|CombatTarget} with a {donut|CombatWeapon}

CombatIntent   {taunt|CombatVerb} the {cat|CombatTarget} with a {shoe|CombatWeapon}

CombatIntent   {annoy|CombatVerb} the {bear|CombatTarget} with a {branch|CombatWeapon}

Game Text Recognition Heuristics

The important thing to your game is that the correct intent is identified and that each slot has a value that it can recognize and respond to. The more sample utterances you provide, the better the recognition quality becomes through the Alexa platform. Until the quality reaches a certain level, game play can become quite frustrating for the gamer. Make sure to test the utterances you are most likely to expect from the gamer and do what you can to accept words that are close enough.

If the gamer says, “Hit the ogre with rocks,” it is possible that Alexa hears “Hit the ogre with rock.” The very subtle difference between “rocks” and “rock” should be handled by your game.

You may need to employ more advanced forms of recognition heuristics within your game in order to account for these variances in the speech to text mapping from Alexa. The Alexa platform is also continually improving its audio recognition heuristics and improves over time as more complex speech is presented to it. In just a few weeks of using some of my basic games, I have found that recognition has improved significantly.

New Game Developer Opportunities

With the launch of the Alexa Skills Kit you have a unique opportunity to create new Alexa gaming skills customers can teach their Alexa enabled devices, like the Amazon Echo. By submitting your Alexa skill today you will be ready when we launch the first new capabilities built using ASK later this year. We can’t wait to see what you create!

To get more details on how to get started, check out this Introduction to Amazon Echo and the Alexa Skills Kit by Dave Isbitski.

You may also want to check out these additional Alexa developer resources:


++David (@PlusDavid)

Want the latest app and game news delivered to your inbox? Stay in the loop on the latest industry best practices, Amazon promotions, and new launches by subscribing to our weekly blog summary here.

 

Want the latest?

alexa topics

Recent Posts

Archive