Math Adventurer is a game I built partially to help my kids become more confident with their math skills. The other inspiration was the Amazon Alexa Skills Challenge: Kids competition. I've wanted to create a game for so long, and I've wanted to make something to help my kids learn. This contest gave me the motivation to pull the trigger and do it!
What it does
Math Adventurer helps kids gain confidence with their basic math skills (addition as of submission). Players go on a journey to retrieve their villages stolen treasure from a math dragon. In order to do so, the player must enter the dragon's lair and make their way to the dragon's keep. There are 10 rooms in the lair, and each room has 3 treasure chests and a locked door. To open the door, players must get a key from the chest. To get a key from the chest, they must open a chest by correctly solving a math problem.
In addition to making math fun, the game also allows parents to help their kids overcome the math problems that are challenging to them. At the end of the game, the app will output a card to the parent's Alexa app displaying any math problems that the player got wrong, or skipped, because they didn't know the answer. The idea here is to get parents involved a bit more in the fun game that their kids are playing and help them when they face challenges.
How I built it
I built this Alexa skill using the Alexa Skills SDK for node.js. My code is stored in a bitbucket repo which deploys the skill code to a Lambda function as the skill endpoint. I also implemented a save game feature using DynamoDB so that players can pick back up where they left off if they need a break or if the skill times out.
Also, lots and lots of caffeine and sleepless nights.
Challenges I ran into
Oh man, where do I start. Every day that I worked on this project was a huge challenge.
Saving State I had to figure out how to handle state between Skill invocations because I found out that Alexa skills are stateless (I also had to learn about state).
** Intent Handlers** I discovered that unlike what I'm used to in web development, I couldn't just jump from function to function to function. Each handler has an event loop that persists until the user initiates a new intent to handle.
Keep the session alive Figuring out the voice design was tricky too. I wanted the experience to be a rails experience for kids, not giving them too many choices to overwhelm them, but still make it fun. To do that I had to figure out how to make the skill in such a way that kids could play the game all the way through without the session ending, and if it did end allow the kids to start back where they left off. This is particularly tricky when you can't redirect to new handlers and update event information...and when timing out of a session breaks the experience for kids.
Complete Content Rewrite I submitted my skill 3 times for certification. The second time, it was rejected because the content in the app was deemed as "mature content" for kids. In the original version, players would attack and defeat the dragon...I play tested with my 6 year old twins, and they loved the concept, but I can see how Amazon might not want to publish a skill that has any violence in it. In order to pass certification, I had to completely rewrite the game dialog, removing any references to "attack", "fight", or "defeat". If the players could no longer fight the dragon, or give and take damage, then that also meant that I had to change three of the items player would acquire in the game (sword, shield, potion). Fortunately, I was able to get things changed enough to meet certification!
Accomplishments that I'm proud of
Sooo stinking much. I wasn't sure that I could build a skill. And when I first started this project 2 weeks ago, I was so overwhelmed I almost didn't know where to start. But the late nights, and challenges I've overcome have all been worth it when I get to see my kids play the game that I made for them!
What I learned
Oh man, again, not sure where to start.
I learned how to manage state between sessions with dynamodb. I learned that lambda functions can store global variables for around 15 minutes...which can really mess you up when testing. I learned about event loops. I learned some node
What's next for Math Adventurer
After the Amazon Alexa Skills Challenge: Kids is over, I'm hoping to add more material and adventures. Right now, the game only handles addition math problems. I'd love to add subtraction, multiplication, and division. Each with their own unique adventures to take kids on.
Log in or sign up for Devpost to join the conversation.