Inspiration

I was inspired by, as the title implies, Tamagotchis. The prospect of owning a virtual pet in preparation for a real one was always fascinating to me. It taught young kids responsibility and compassion for living beings albeit in a very relaxed way. However, Tamagotchis have become out of style due to the advent of smartphone technology. I thought it'd be interesting to use Alexa's AI in order to simulate a Tamagotchi. This way, kids can intuitively take care of their virtual pets while making use of the technology behind Alexa's voice recognition.

What it does

It emulates most of the game mechanics in Tamagotchi. There are five needs that the player must meet for their pet(s), happiness, health, hunger, energy, and cleanliness. The goal is to keep your pet(s) alive for as long as possible. Alexa's voice recognition is used to listen to a user's voice and determines the user's intent. Through that intent, Alexa will interact with virtual pets based on the given intent.

How I built it

I used Java 11.0.8 JRE for most of the code and Maven for dependency management. For hosting my code, I used AWS Lambda to integrate with the Alexa Skill Kit. I then used the kit to configure the Intents to which Alexa will listen to. The IDE I used was Eclipse. First, I organized all of the Java classes into three packages: game, main, and handlers. The main package is designated to the StreamHandler which will pipe all of the classes in the handlers package into the Alexa Skills application. The handlers serve to bridge communications between the game package and Alexa's responses to our voice commands. The game package is meant to structure the Tamagotchi game.in a format that Alexa can communicate over. I wrote custom handlers for showering, checking one, checking all, playing with, feeding, and medicating pets. On AWS, I ran a Lambda function connected to the Alexa Skills kit app in order to run my Java code to Alexa's voice recognition. Through the Alexa Skills kit app, I created custom intents for the custom handlers and gave them slots in order for users to send inputs from Alexa to the Game class.

Challenges I ran into

I wasn't too familiar with Alexa skills development, so a majority of my time was figuring that out. Also, the Alexa Skill Kit was not configured to support multithreading, so I had to synchronously code a way to track the time elapsed between commands. This is in order to simulate the change of a pet's stats in realtime, which was a huge trade-off in emulating a Tamagotchi.

Accomplishments that I'm proud of

Overall, the project suited my vision very well. There were a lot of features that I had to cut from the original Tamagotchis, but I found my finished product very simplistic for kids to get into. The only mechanics are to interact with their pets, as opposed to the different minigames and hidden mechanics that normal Tamagotchis had. Using Alexa's voice recognition was very intuitive and made managing pets easy.

What I learned

I learned a lot about Alexa and AWS. For AWS, I found Lambda to be a very convenient tool that I may use for another project. Its codeless server hosting makes it very appealing for me to create projects that utilize web servers. The most important thing I learned from AWS would have to be using the CloudWatch logging service. It saved me from many deadends during production.

What's next for Tamagotchi on Alexa

I want to bring all of the features from Tamagotchi into Alexa. There are features such as Disciplining and Minigames that I would've loved to add during this hackathon. I also want to use an AI-powered description generator to create descriptions for the pets. It would add an extra layer of emotional attachment, but the technology is not readily available yet.

Share this project:

Updates