Fall 2020 Independent Study
Alexa Skill Programming
the concept
Create three Alexa Skills
Alexa, Amazon’s voice assistant or smart speaker, is a simple way to interact with a varied and powerful AI. From playing music and games, to arranging a shopping list, the device has become a standard part of many homes. This exploration combines my interests of coding with the challenges of designing for voice, instead of eyeballs.
Every day, Voice Technology coupled with Internet of Things (IoT) pull us toward a touchless future. Whether it is interaction with an Alexa or contacting a customer support interface with a chatbot, voice and chat technologies offer a growing design challenge. This independent study will explore the design contexts to use voice, use cases for voice, how voice fits into a consumer journey, specific design challenges, VUI/VUX, differences in voice interaction design and visual interaction design, narrative design and storytelling. Along the way, we’ll explore incorporating relevant datasets and determining what datasets make good candidates for voice particularly in a science communication context. The goal will be to create several varying voice applications (Alexa) exploring each of the above topics.
During the semester, I created three entertainment-related skills. The overall goal of all the skills is delight. Finding a skill that is different can be challenging. Creating any game that is delightful is an ultimate goal. Below, you can find a short description of the skill and my motivation for creating it. Each built on the previous in codebase but more importantly, the storytelling attributes increased in each iteration.
In the right-hand column, I will include a link to the finished skill when approved. A button to view the code is available as well. This is the node.js script included in the lambda that drives the immediate discourse. Behind the scenes are a series of Intents with corresponding Invocations.
Along with a strong storytelling aspect, the skills flirted with these topics
- What is voice
- Why voice
- Challenges of voice
- How does voice fit into consumer journey
- Use cases for voice
- Telling better stories with voice
- Good datasets for voice applications
- Conversational design/Conversational Interfaces
- Emotional design – what is the emotional side of voice. What to consider when designing a voice application!
- What is voice UX
- Voice UX design tips
- Voice and chatbot personalities
- Designing conversations
- Differences between Voice and Screen-based UX Design
- VUI / VUX
- VUX Research
- Narrative Design
- Script Writing
- Amazon Alexa Skills
- JavaScript & Node.js
Skill 1:
Medieval Insulter
Based on a similar theme as the French knight taunts in Monty Python and the Holy Grail. You would ask Alexa to insult you and she would return the favor, you spleeny, boil brained codpiece!
This idea seems an odd choice for an Alexa skill but should pass Amazon’s testers. The skill has not been submitted for review and approval yet. The skill is based somewhat on an activity I remember from grade school where three or four groups of words could be combined from separate lists. I reviewed Chaucer, Shakespeare, and Boccacio’s Decameron as well as other medieval texts for phrasing that sounded right. I chose a column that I thought the phrases would work in. Each column is contained in an array, I created another function that handles parsing out a random phrase from the list. These are then reassembled for some interesting phrasing in the InsultIntent and delivered as speech output for Alexa to deliver. This skill may be better using a male voice and perhaps in the english accented version but for now, I’ve left the original voice. If she only knew what she were really saying.
Gameplay Example
Alexa, open Medieval Insulter
Want to learn some wickedly funny medieval insults? Using this skill, you can get insulted or learn some zingers for your friends. Medieval Insulter contains mature content that some may not find suitable. Shall I continue?
yes
I’m glad to hear that, you dankish boil-brained bear-whelp. Would you like another?
bring it on
OH really, you venomed rude-growing hedge-pig. Would you like another?
yes
I bet you can’t handle this one, you crusty base-court imbossed carbunkle. Would you like another?
ok
OH really, you mumbling earth-vexing purified-cur. Would you like another?
no
Skill 2:
Courtly Talk
Self-help books and pamphlets exist from the Romantic and Victorian periods on how to talk to women (some to seduce and others to be poetic). Generally, Shakespeare was a good guide on how to compliment. You would ask the skill to compliment you and Alexa would talk nicely to you.The challenge of this skill was to try and make it all gender neutral and non-sexist. The pamphlets of women seducing men were extremely helpful in overcoming this challenge but the majority of literature is associated with the seduction of women.
The skill is similar in nature to Medieval Insulter. The impetus for this skill was to balance the Medieval Insulter. I felt better about creating one with the other. The skill is setup somewhat similar to the insulter in that three arrays of words are available for a random compliment to be drawn. One differentiator is more phrasing included to be less repetitive between compliments. For the insulter, that repeating seems perfectly normal but I wanted Courtly Talk to be more conversational. And I think the experiment works.
This skill has not been submitted to Amazon Alexa for approval. We’ll even see if it makes it through their censors. I think it should be approved but some of the comments are a bit bawdy which makes it even more fun to share.
Gameplay Example
No, I don’t want to talk, you candied weeping-ripe flower-of-all-things… More compliments?
You are even more beautiful. Bye.
Skill 3:
Camel Escape
Your camel is burning across the desert sands. The idea for Camel originally came from the Heath Users Group and was published in More BASIC Computer Games in 1979 but has never been ported to Alexa. I think it would be a popular game. The idea is to ride your camel across the desert while being chased. You need to manage your thirst, how tired the camel is, while keeping in mind your lead on the outlaws. It’s really hard to win. Because, the original game might have contained some culturally insensitive references and cannibalism, I worked to scrub this language and present a version that some parents might find suitable for their older kids. Certainly younger children can play the game. The camel can die due to lack of attention on the part of the player but at least it’s not eaten as part of a human/camel soup.
Adding storytelling elements to this game was most enjoyable. I tried to make the interactions humorous and related throughout the game. I hope that as one plays the game long enough that it becomes clear that certain situations, such as a camel hurting its hump and running across a group of dreaded Gobihari scorpions chasing an adventurer whose camel has hurt its hump, are related. I hope some even find it humorous.
The game is not quite done. As you can see from the sample game play below, that the death function is not quite working. But the game is close. I’m in bug finding with it.
-
“The scorching sun blazes overhead.”,
-
“Heat mirages rise from the burning desert.”,
-
“Harsh sunlight, buzzards and a blue sky are all that meet your eyes.”,
-
“You start your way across the winding dunes in the heat of the day.”,
-
“Dust devils swirl in the distance as you wipe gritty sweat from your brow.”,
-
“A dust devil swirls across the sand like a desert python.”,
-
“Faraway mountains shimmer as the heat of the day sets in.”,
-
“A hot wind dries your mouth instantly before you set your foot in your camel’s harness.”,
-
“A hot wind creates tiny dust devils at the feet of your camel before you set off.”,
-
“The hard, baked earth and miles of dunes meet your eye as you begin.”,
-
“Dusty, windy dunes engulf your senses as you look across the scorching landscape.”,
-
“Relentless sun and a barren landscape fill your sight as you set off across the great Gobihara.”,
-
“Gobihara scorpions the size of a plate skitter across the blazing sands as you set off.”,
-
“A pair of carrion eaters with black eyes, no doubt hoping for their next meal, follow your every move as you begin your journey.”,
-
“A hot, dusty wind raises dust devils in the shimmering distance as you set off on your journey.”,
-
“Crumbling rock, shifting sand and harsh sunshine are all that meet your eyes as you set off.”,
-
“Sandstone canyons and drifting dunes dominate the dusty landscape of the great Gobihara as you set off.”,
-
“A brown dusty pall darkens the sky as you set off across the hot baked earth of the Gobihara.”,
-
“All you wipe from your brow is hot dust as your camel races across the blazing sands.”
-
” Ahead moderate speed then. “,
-
” Your camel likes this pace. “,
-
” Your camel takes off at a nice trot. “,
-
” Your camel is trotting across the desert sands. “
-
” Full speed ahead. “,
-
” Your camel is burning across the desert sands. “,
-
” Your camel is blazing across the dunes. “,
-
” You are blazing across the sand. “,
-
” Your camel is galloping across the landscape. “,
-
” You are galloping across the desert sands. “
-
oasis: 75-80
-
Is it a mirage? You find an oasis! A lush patch of palm trees and a pool of cool, clear water meet your eyes! You fill your canteen as your camel munches on some figs. You could take a nap if not for the knowledge that the outlaws are out there, somewhere, hunting you.
-
-
sandstorm: 81-85
-
The sky becomes dark as a sandstorm engulfs you. You and your camel huddle under a blanket losing precious time. Just know…the outlaws have learned the art of traveling in wild sandstorms.
-
-
wildfolk: 86-90
-
Suddenly, out of the dunes, you are surrounded by the mythical wildfolk of the Gobihari. Luckily you speaka their language and tell them that outlaws are chasing you. Because of their intense hatred of the outlaws, they promise to delay them with a clever trap. You promise to return one day and open a school for riding sandworms.
-
-
quicksand: 91-93
-
Your camel pitches forward and throws you into hot quicksand. Luckily, you are able to grab a rope. It holds solid as you pull yourself out. You have no time to consider what the rope is attached to as your camel gives you a sloppy kiss, happy that you are alive. You lose some time as the outlaws draw ever closer.
-
-
giant Gobihari scorpions: 93-95
-
You and your camel squeal in terror as you crest a dune and see a pack of dreaded, giant Gobihari scorpions. Luckily for you, they are focused on chasing a poor adventurer whose camel hurt its hump.
-
-
hurt hump: 96-98
-
Your camel has hurt its hump. You hope that a pack of dreaded, giant Gobihari scorpions are not in the area as you limp your camel across the blazing sands.
-
-
aliens: 99
-
As you crest a high dune, you surprise a gathering of angelic aliens lounging on blankets in the hot sun. They explain that they have traveled a long time from a planet in a galaxy far away. They wonder if you have some water to spare. They take a drink and offer for you to sail away in their starship. The camel chooses to return to the last oasis, munch on splendid figs and ride with the mythical wildfolk of the Gobihari. Your camel gives you a parting kiss as you climb aboard their starship and head for the skies.
-
-
All others: all clear
-
“You died in the desert.”,
-
“You dirty rapscallion, you ran your poor camel to death “,
-
“The local chieftain uses your skull as a coin purse. “,
-
“Your body was eaten by vultures. “,
-
“Turkeys should fly, not ride camels. “,
-
“The Global Camel Union is boycotting your funeral. “
-
“Game over adventurer! The outlaws caught you. They take back their camel and turn you out into the blazing sands. Without water. Without a camel.”,
-
“The outlaws catch you near a pit lined with razor-sharp, wiggling roots. Then again, maybe they are tentacles. They walk you to the edge. This won’t end well. Game over!”,
-
“It’s game over, adventurer, as the outlaws catch up to you, they take back their favorite camel, throw sand fleas into your wild hair and set you loose into the wide Gobihari.”,
-
“The outlaws corner you in a box canyon. The leader mentions that your head will make a nice, new adventurer coin purse. Game over!”,
-
“The outlaws catch up with you and have time set an elaborate trap as you enter the narrow canyon. You hear what sounds like thunder, then you see the giant, round rock hurtling toward you. You turn to run but trip. There is no escape this time, adventurer.”
-
“The outlaws catch you. They take back their prized camel and start digging a pit. Once complete, they tell you to climb in. With just your head sticking out, the outlaws fill the hole. As the outlaws leave, kicking away a buzzard and a few dreaded Gobihari scorpions, a canteen falls to the ground just feet away. There may be no escape this time, adventurer.
Gameplay Example
Sandstone canyons and drifting dunes dominate the dusty landscape of the great Gobihara as you set off. You are galloping across the desert sands. Your thirst is 6 – Turkeys should fly, not ride camels. . Your canteen has 5 drinks left. Your camel tiredness 6 Your random encounter: 17 clear You traveled 12 miles. The natives traveled 8 miles. You are 39 miles ahead of the natives. Natives total: 50 You have traveled 89 miles total.
References:
With help and inspiration from these sources
- https://www.techrepublic.com/article/alexa-skills-cheat-sheet/
-
Multi-turn skills – https://developer.amazon.com/en-US/alexa/alexa-skills-kit/get-deeper/tutorials-code-samples/build-multi-turn-skills-with-alexa-conversations
-
-
Skill Challenge Alexa Conversations – https://alexaconversations.devpost.com/
-
Multiple values in slot: https://developer.amazon.com/en-US/docs/alexa/custom-skills/collect-multiple-values-in-a-slot.html
- https://developer.amazon.com/en-US/docs/alexa/conversations/about-alexa-conversations.html
- https://developer.amazon.com/blogs/alexa/post/f26e61af-82c5-426c-91f7-ed46e581dc48/getting-started-with-the-cake-walk-course-designing-the-voice-user-interface-vui-for-your-alexa-skill
- https://azumbrunnen.me/blog/my-chatbot-is-dead-%c2%b7-why-yours-should-probably-be-too
Timeline
-
-
-
“Welcome to Dinner Genie. Not sure what restaurant to eat at? I can help with that.”
-
“Welcome to dinner genie. How far do you want to travel to get something to eat.”
-
“Welcome to dinner genie. I can find you a place to eat even if you’re not sure what you want. How far do you want to travel?”
-
-
-
-
-
“content”: “This is dinner genie. Not sure what you want to eat? I can help with that.”,
-
-
-
-
-
generated phrases by cobbling together insults from medieval texts, old animal names and Monty Python sketches.
-
phrases are three arrays of text that another function called randomPhrase(phrase) will randomly choose a word. This is then assembled phrase1 + ” ” + phrase2 + ” ” + phrase3.
-
-
-
-
-
Need to refine the responses, ask user if they want more
-
-
-
-
-
Add reprompts and prompts for another
-
Added raspberry sound instead of goodbye
-
-
-
-
-
worked on finishing Medieval Insults. I wanted to add a raspberry sound when you quit but I’m having a problem playing the sound from my S3 bucket. Instead, I settled on good bye for now.
-
Game finished
-
Switched to Courtly Talke. This was renamed from Knightly Talk. One it sounds more gender neutral
-
Based on prior research into Shakespeare, Chaucer and other romantic texts (there are actually texts, booklets really, released during the Victorian age and Enlightenment on how to seduce a man or woman. Some things never change) This gave me some good language to assemble. Those are listed above and I worked them into the same framework as Medieval Insults. Though I found myself grumbling at some of the more sexist terms. I removed these, added an intro text randomizer and an exit text randomizer to give Alexa’s responses more variety. This has a bit more customization in that area than the Medival Insulter skill.
-
-
-
-
-
Finished Courtly Talke. Added the intro
-
‘Shakespeare, Chaucer, courtiers and courtesans perfected the art of flattery. And now you can fawn over your lover in courtly style. Courtly Talk contains mature content that some may not find suitable. I may even make your lover blush. Shall I continue?’
-
-
Even my wife smiled at the responses she was hearing.
-
-
-
-
-
Created Skill in Alexa called Camel Escape (since we cannot have one worked invocations, apparently)
-
Setup Intents for Yes, No, Help
-
-
11/5/2020 – coded basic invocations. Basic game working with fast, medium, rest, drink, status and quit
11/12/2020 – coded all storytelling elements for fast and medium speeds
11/13/2020 – coded basic random number generation for camel movement and outlaw movement
11/19/2020 – for camel and outlaw movement…had to create a scheme to store a additive score…challenge
11/20/2020 – continue creating scheme for additive scores
11/24/2020 – additive scores broken
11/25/2020 – additive scores still broken
11/27/2020 – additive score code breakthrough. Apparently you cannot have in node.js two variables with the same name even though they are not in the same scope with each other. Perhaps I’m doing something wrong but creating unique variable names fixed the problem. Pain in the butt.
12/2/2020 – coding thirst, camel health and death scenarios
12/3/2020 – coded encounter elements
12/4/2020 – Coded storytelling elements for random encounter elements
12/5/2020 – bug finding, refactoring, basic polish
12/6/2020 – more polish