Learn how to make real-time game skills on the Alexa platform using the Alexa Game Engine an other serverless components. Create new innovative skills that engage users in a less screen intensive experience. Math Contest - Online multiplayer is one of the first real-time gaming skills released in the Alexa Store and this presentation takes a look under the hood at the design and learnings from the build.
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Â
Real-time Gaming on Alexa : Math Contest - Alexa skill breakdown
1. And the making of
Math Contest â Online multiplayer
An Alexa Skill
Real-time Gaming on Alexa
bowdenCloud.com
2. The opportunity
Imagine being able to play against
other Alexa users all around the
world at the same time
Alexa Skill breakdown Math Contest â Online multiplayer
bowdenCloud.com
3. The problem
How to get multiple Alexa devices
tuned in and interacting with the
same game at the same time
Alexa Skill breakdown Math Contest â Online multiplayer
bowdenCloud.com
4. The constraints
⢠Not many ways to push data into a skill session at
a specific time
⢠Keeping multiple skill sessions from drifting apart
is problematic
⢠Most players do not have a visual interface for
guidance
⢠Working with external event sources
⢠Serverless architecture and distributed runtimes
Alexa Skill breakdown Math Contest â Online multiplayer
bowdenCloud.com
5. A solution that works
⢠Using the intra-session timeout
functionality of the Alexa Game Engine
⢠Running a central game controller to
process the inputs and inform the output
Alexa Skill breakdown Math Contest â Online multiplayer
bowdenCloud.com
6. Basic Example â A math contest
⢠A new maths question is announced to all players approx.
every 30 seconds
⢠Everyone gets the same question
⢠Player answers the question and the time is recorded
⢠If the player gets it right then they get a point plus another
point for every player they beat
⢠Alexa summarises the results and leaderboard status
before the next question arrives
⢠Rinse and repeat ď
Gameplay
Alexa Skill breakdown Math Contest â Online multiplayer
bowdenCloud.com
7. Basic Example â Math Contest
High level design
Storage
Game Agent
Skill Skill
Alexa Game Engine Alexa Game EngineAlexa Game Engine
Skill
Synchronize Run the Quiz Synchronize
Skill
User answer
Time
Alexa Skill breakdown Math Contest â Online multiplayer
bowdenCloud.com
8. Storage
Game Agent
Skill Skill
Alexa Game Engine Alexa Game EngineAlexa Game Engine
Skill
Synchronize Run the Quiz Synchronize
Skill
User answer
Time
1
1 Customer launches skill, skill calculates sync timeout to next question.
2 Game engine is launched and the timeout sends a failed response to skill.
2
3 Skill launches, customer given question, each player is enrolled into the game (storage) and âthinking timeâ timeout sent to game engine.
3
4
4 The Game Agent (a single long running Lambda function) is kicked off and waits until just before the question âthinking timeâ is over.
5
5 The user answers the question, correct answers are saved into storage along with the timestamp.
Alexa Skill breakdown Math Contest â Online multiplayer
bowdenCloud.com
9. Storage
Game Agent
Skill Skill
Alexa Game Engine Alexa Game EngineAlexa Game Engine
Skill
Synchronize Run the Quiz Synchronize
Skill
User answer
Time
1
6 Game agent collates the enrolled players and correct answers. It then calculates scores and leaderboard positions and saves to storage.
7 Game Engine times out and invokes the skill. Results are now in. Skill gets the results and reads them to user, then calculates the sync time
2
8 Game Engine is launched and the timeout sends a failed response to skill which kicks starts the next qustion.
3
4
9 Repeat from Step 3
5
6
7
8
9
Alexa Skill breakdown Math Contest â Online multiplayer
bowdenCloud.com
10. Lessons learned
⢠To avoid certification issues, ensure that Echo buttons are
appropriately catered for in the skill since we are leveraging
the button input handler functionality
⢠Set aside plenty of time for debug and testing since there are
so many steps and moving parts, you also have to use a Beta
tester account to simulate multiple players
⢠Think about scaling issues and Lambda concurrency, since
real-time often involves multiple simultaneous invocations.
⢠Use the Game Agent function to do grunt work that would
otherwise be duplicated in the Skill functions (e.g. preparing
leaderboards etc.)
Alexa Skill breakdown Math Contest â Online multiplayer
bowdenCloud.com
11. Cool tricks
⢠The Game Engine timeout feature as a callback to a skill session is by far the coolest
trick you can take away from this
⢠Using a Lambda Game Agent reduces cost since it only runs when players are using
the game. If operating large consistent loads then consider using 24/7 instances to
manage the games.
⢠Setting the Lambda concurrency to a value of 1 enables the Game Agent function to
be invoked by the first player to enrol in the game and subsequent players canât
trigger new Game Agents.
⢠The Math Contest questions are derived from the hash of question group time plus a
salt. You could also do this for randomizing an array lookup position for trivia
questions.
Alexa Skill breakdown Math Contest â Online multiplayer
bowdenCloud.com
12. Future ideas
⢠This method can easily be applied to trivia questions, I
only did math because it was easier to automate
questions.
⢠With enough players, groups and tournaments can be
created to enable a âlast-person-standingâ type of
competition
⢠This methodology could also be used to enable one-on-
one battles back and fourth between players all over
the world
Alexa Skill breakdown Math Contest â Online multiplayer
So get creative and bring new types of games to Alexa!
bowdenCloud.com
13. Please check out
Math Contest â Online multiplayer
In the Alexa Skill Store
Thankyou
https://amzn.to/2QIhraX
bowdenCloud.com