Inspiration
I've been working on assistant-based programming for over 15 years now. Also back then, my partner Kelli and I came up with a road trip game that worked like a combination of 20 questions and a verbal crossword puzzle for famous people's names. The two passions have come together to create That's Obvious, and here we have the latest flavor: A Trivial Dilemma!
What it does
Trivial Dilemma is a gameshow with 5 rounds. Each round has a secret famous name that the player(s) are trying to figure out. Each round starts off with an impossible clue and gives you more and more clues. Each clue makes it more obvious AND doubles the current pot (so even if you know the answer, you may want to hold out for more $$$). The player who gets the secret name wins the round's pot, and whoever has the most $$$ at the end of the game wins. BUT! Each round can pit a player with a moral dilemma, where she must make a tough decision between winning the game and winning friends.
How I built it
I started making Alexa Skills when the first gen Echo came out. The current nodeJS libs didn't exist back then, so building on top of the initial plain-vanilla JS "Trivia" skill template, I developed my own Alexa Skills framework in TypeScript called ask-gib to create a strongly-typed framework. It's evolved over the years, and this skill gave me the chance to include & test the ISP workflow. I leveraged the vscode build task awesomeness to have the build/deploy process as a single command/keystroke, which builds, zips and deploys the skill to the AWS lambda function (the $LATEST alias). Then I made use of the Developer Console's new Alexa Simulator and Voice & Tone awesomeness, both of which have vastly sped up the debug cycle compared to testing on the physical device as before. I also used the console to create an ISP product, which was very straight-forward and well-documented. For debugging, I still have been using logging and CloudWatch, but I'm looking forward to incorporating the new client-side proxy for debugging locally.
Challenges I ran into
Aside from the normal (tough) challenges of programming in general, my main challenge was in reconciling the pay-to-play aspect of In Skill Products and my desire to make it available and fully functional to those who are unable to afford any products. That's how I came up with the PayItForwardIntent invoked by "Pay It Forward". This sets a flag in code that indicates that all packs are available. When checking for available content, the code checks for entitled products or this flag. So the skill works exactly as if the user paid for the product. When she is ready to support me, she can say "Pay It Back" which toggles the flag off and gives her the list of available products.
This is actually why I've kept away from ISP in the first place, but I think this is a good solution to the issue.
Accomplishments that I'm proud of
In addition to the above Pay It Forward solution (which I'm most proud of!) and getting the skill working in general, I'm also proud of the variety of speech involved with the skill. I am able to accomplish this with my lex-gib library, which works both as i18n and idiomatic alternatives. So in addition to having a single translation into other languages, this allows for multiple translations in multiple languages with single line of calling code. So in code I can write a single line calling for the "bye" speech (text and/or ssml), and depending on language/weighting and other options, I'll get speech like "Bye", "Bye-Bye", "Later", "Ciao", "Arrivaderci", "Tschuss", etc. In combination with other features of the library, this provides robust dynamism in the voice interaction.
What I learned
I've learned to use some of the new tools made available for testing Alexa Skills, as well as the nice ISP workflow. This includes how to create a product, how to get a list of products and entitlements for the user, how to form the ISP directive and give flow control over to the Alexa Service and how to resume control flow after a purchase is accepted/declined.
What's next for That's Obvious: A Trivial Dilemma
There are always so many small improvements to make, but the main thing to do now is to create more free and ISP expansion content! Also I have ideas for when to prompt the user with an UPSELL and overall get more dynamic interaction with respect to available content and other updates. Ultimately an open-data expansion pack system to go along with the open-source skill itself would create the absolute best experience for the consumers. This way, those who are good at generating the trivia (and dramatic dilemmas!) can do their thing and those who are good at generating the code can do theirs...what an experience that could be!
Built With
- ask-cli
- ask-gib
- aws-lambda
- typescript
Log in or sign up for Devpost to join the conversation.