coltonw / sensors-are-down

:alien: Alexa game involving space combat using some simple card game mechanics
0 stars 0 forks source link

Alexa sdk sucks. Move to our own more generic solution. #20

Open coltonw opened 7 years ago

coltonw commented 7 years ago

Alexa SDK is weird and mostly useless and confusing. I think it would be a good idea to come up with our own thing that can more generically be used for other smart home systems.

The only nice thing we get from the Alexa SDK is the session management, so we would need to replicate some of that logic in our new code.

coltonw commented 7 years ago

One thing I do not like about the Alexa sdk is that whenever you are emitting a message, it is one command that emits one possibly giant ass message.

coltonw commented 7 years ago

This was partially started in #22 as a speeches.js file which all take state as input and output a valid speech unit such as an array of speech units, a speech object which is a just an object consisting of output and reprompt strings, another speech, or just a bare string. Then there is an unstackSpeech.js file which takes a speech unit of any type and converts it to a speech object which can be used for replying with Alexa.

What I would like to add is a way to take a mapping of intent ids to functions that return speech objects, then some Alexa handler automatically would give the right handler response to Alexa itself. We could establish patterns for three types of intents:

coltonw commented 7 years ago

The next step here is to pull the remaining Alexa state into redux. The between-games state is still tracked by Alexa SDK and should be moved to redux. Validation would be using the between game state for the CLI or another platform (!!!).

mturley commented 7 years ago

This seems pretty actionable. I vote that Google Home is the second platform candidate. Mostly because I just pre-ordered the Pixel 2 and it comes with a coupon for a Google Home Mini so I'll have one of those soon.