Announcement: The Alexa Skills Community Is Moving To Stack Overflow

For improved usability and experience, Alexa skills related forum support will be transitioned to Stack Overflow. Effective January 10, 2024, the Amazon Developer Forums will no longer be available. For continued Alexa skills support you can reach out to us on Stack Overflow or via Contact Us.

question

Amazon Customer avatar image
Amazon Customer asked

The Hitchhiker's Guide to the Galaxy

Well, this demo is a lot more fun if you get to play it, so here goes. If my server gets overloaded I'll have to take it down, but it should be fun in the meantime! Also, please don't hack my site, I'm sure I missed something. Of course nobody can actually deploy this app, since it's copywritten. Let me know if you find bugs, and be specific. Every once in a while something seems to jump around, like around the bar, not sure what the cause is, since playing the game takes so damn long! Say "reset" to start over. Reply to this thread with more Utterances if you need them, I haven't gotten to "babel fish" yet. (That killed me back in 1984!) App Endpoint: https://www.piettes.com/cgi-bin/nph-hitch.cgi Intent: { "intents": [ { "intent": "Command", "slots": [ { "name": "Verb", "type": "LITERAL" }, { "name": "Subject", "type": "LITERAL" } ] } ] } Utterances: Command {move|Verb} {North|Subject} Command {go|Verb} {North|Subject} Command {go|Verb} {North East|Subject} Command {go|Verb} {North West|Subject} Command {go|Verb} {South|Subject} Command {go|Verb} {West|Subject} Command {go|Verb} {East|Subject} Command {reset|Verb} Command {look|Verb} Command {look|Verb} {out window|Subject} Command {turn on|Verb} {Light|Subject} Command {take|Verb} {dressing gown|Subject} Command {take|Verb} {toothbrush|Subject} Command {take|Verb} {analgesic|Subject} Command {take|Verb} {mail|Subject} Command {take|Verb} {towel|Subject} Command {read|Verb} {mail|Subject} Command {put on|Verb} {dressing gown|Subject} Command {look in|Verb} {pocket|Subject} Command {look around|Verb} Command {inventory|Verb} Command {talk to|Verb} {prosser|Subject} Command {talk to|Verb} {ford|Subject} Command {talk to|Verb} {ford about house|Subject} Command {lie down|Verb} Command {wait|Verb} Command {get up|Verb} Command {use|Verb} {screwdriver|Subject} Command {throw|Verb} {screwdriver|Subject} Command {say to ford|Verb} {ford what about my home|Subject} Command {say to prosser|Verb} {ford what about my home|Subject} Command {drink|Verb} {beer|Subject}
alexa skills kitshowcase
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

jjaquinta avatar image
jjaquinta answered
Hey! I've been working on a very similar concept. I've got as far as writing an API that wraps a whole slew of telnet-playable games. Do you want to collaborate?
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Matt Kruse avatar image
Matt Kruse answered
Yes, I think this is a common idea! I wanted to connect Alexa to a "choose your own adventure" style book, where you have options of how to proceed. I looked for public-domain content that I could use, but didn't find anything good, so I didn't pursue the idea. I asked my 5-yr-old if she would like to have a princess story where she could decide what happens, and that excited her a lot. So maybe I need to write my own script...
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

jjaquinta avatar image
jjaquinta answered
There are tons to be found on the Interactive Fiction Database ( http://ifdb.tads.org). Many of them are "freeware". They're doing a hack-a-thon in Boston in a week or two and I had wanted to hook Echo up to a library of interactive fiction. I thought it would be an interesting business model if IF writers could make their works available for purchase on Echo. Also plays to Amazon's core strength of selling books. The problem I've run into is diversity in formats and a lack of good programmatic APIs to process them. There's lots of viewers. But very little code that's not embedded into a viewer. I tried hacking ZPLet to provide a stateful API to any ZCode work, but the code got ugly. That's why I pivoted to telnet-style games. I've managed to wrap an API around that and can now surface several hundred. But the fact Echo wants a static vocabulary I think will make it hard to play. With the present state of the API it might just be better to pick a single work, and tailor it to that. I'm just, randomly, looking at "Creatures Such as We" ( https://www.choiceofgames.com/creatures-such-as-we/#utm_medium=web&utm_source=redirectIFDB) which was a runner up in an IntFic contest. Looks like it's the sort of "pick your choice" thing you were looking for. Kind of cumbersome to read it to them and then ask them to say "A", "B", etc. But that would work with the restrictive vocabulary.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

justin avatar image
justin answered
Great conversation here guys. I can imagine a catch-all API for interactive stories would be quite an undertaking, but there's no doubt that there's a value to something like this! Good to hear you'll be at the Amazon Developer Day in Boston, too! It'll be a great place to reach out to some Amazonians if you have any ideas or questions on implementation.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

jjaquinta avatar image
jjaquinta answered
Hey Justin. Oh, I've got ideas all right. :-) Putting the more concrete simple extensions onto the Feature Request forum. :-) As far as Interactive Fiction, there are a managably small number of formats. So it isn't as big a deal as you might think The real constraint is that Echo wants to know the vocabulary up-front. For the hack-a-thon I'm toying between just pre-working it out and doing a proof-of-concept with a single input (such as Colossal Cave, or a ChoiceScript work), and just doing a more straightforward app like a Grocery List. I think there's a real win for Amazon now that they own the stack from content creator, through marketing, down to the enhanced reader in breaking away from the printed-words-on-paper model that's dominated publishing so far. But that's another argument for another forum. But I think Echo has a place in that. Imagine if you could have any book you bought in Amazon read to you via the Echo? Anyway, time for another feature request...
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

CHRISTOPHER M SZURGOT avatar image
CHRISTOPHER M SZURGOT answered
For what it's worth, I have a .NET version of frotz working with state (Had to be able to save state to tombstone properly :) ) I've tried several games and things get sent properly, but as most of you have figured out, it can't easily handle the necessary vocabulary for an extended session of the game. I'll think I'll finish up the app with a simple choose-your-own-adventure game, and keep an eye on the state of the API and speech parser.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

The Stig avatar image
The Stig answered
How were you able to get the save state working?
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

CHRISTOPHER M SZURGOT avatar image
CHRISTOPHER M SZURGOT answered
(Solution based on Frotz code) I added a hook to the processing engine, and when it's sees that a readline command is next, it serializes all the important fields to a file.Then on startup, there's another hook to restore the state directly before calling the process loop, and then it falls into the process loop, and continues on. It's important to do it before the readline is pulled off the stack so everything is just right for process to be called next.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Matt Kruse avatar image
Matt Kruse answered
Someone needs to hook up Zork to Alexa. I looked into it a bit and it looks pretty complicated to execute. But I think it would be popular :)
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Amazon Customer avatar image
Amazon Customer answered
My Hitchiker's Guide uses the Frotz engine. I just execute Frotz in a shell in python and pipe the (scrubbed) commands in. Then I save the state using the built-in Frotz save-game command. The save game name is based on the UserID. Then when an existing UserID sends a command, it re-loads that game. A lot of overhead, but it works. "Fake it till you make it." Honestly the hardest part was refomatting the text out of Frotz to remove all of the vt-100 screen formatting code. For my current word list I took a walkthrough and generated the wordlist automatically. From what I hear in the forums that's what most people are doing- writing tools to auto-generate the wordlist from dictionaries. The unique thing in my code was that I only broke the commands into two parts- the verb and the subject. In many cases the verb or the subject are actually two (or more) words. It seems to work pretty well. "give" "sandwich to dog". I've also found that new words, that aren't on my wordlist, are usually passed through very nicely. I really only need the wordlist to get the really difficult words. "babel fish" :) Honestly, though, from the playability perspective, it's hard to play. When you die you have to start over, and boy does that get old FAST. You have to sit and wait for Alexa to re-read everything that you've already heard. The games that we're developing need to be structured differently. Rule #1 of the new V(oice)RPG: No repeating text. I think that basically means: No starting over when you die. Even the "reprompt" that I use when I don't get an understandable command gets old fast.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.