Category: Entertainment

Inspiration

I frequently visit duck parks where I see many ducks abandoned by their owners. Often, people buy ducklings for Easter and abandon them when they realize they are actually extremely high maintenance pets. I came up with the idea to make a game that asks trivia about raising ducks as a fun way to learn more about owning pet ducks.

As for the inspiration for my project decisions such as displaying the same question to all users every 5 minutes, most of my ideas came from games like Kahoot and Wordle. I liked the idea of team-work , which is why everyone “raises” the same duck, Mr. Silly. To further cultivate a “team-like” experience where everyone is on the same page, I made every question the same for all users.

What it does

After making an account, users are automatically in the game. The duck, Mr. Silly and questions displayed on screen are the same for all players. Mr. Silly loses some health every 5 minutes. To combat this, users can answer 1 question every 5 minutes to heal Mr. Silly. However, answering incorrectly will cause him to lose even more health. Inspired by Kahoot, users can see the question results as more and more players answer.

After answering the question, users go on cooldown until the next question is ready to be released. This works similarly to Wordle where you can only play 1 game per day, except for Communal Pet Duck, it’s one question every 5 minutes.

How I built it

I built Communal Pet Duck by heavily utilizing web-sockets for multiplayer compatibility. Since questions and Mr. Silly’s state needed to be updated and shared in real time, I needed to use a client-server architecture. Web-sockets are perfect for this because you can both send and receive broadcasts/updates from every connected client.

As a solo developer, I decided to go light for the front end. The app is relatively simple and did not need external libraries or frameworks to meet my use case, so I went with vanilla HTML, JS, and CSS.

For deployment, I used docker to run a container on AWS using a free tier EC2 instance. I am too broke to get a decent domain so a public IPV4 address will be sufficient for demo purposes.

Challenges I ran into

My main challenge was learning how to use Docker and AWS for deployment. I’ve actually never deployed something on my own before, so I was worried I would not be able to get a working app launched in time. Running the project purely on localhost would ruin the whole point of the game which is to have lots of people join at once and try to keep Mr. Silly alive.

Another challenge I ran into was planning how to get questions and Mr. Silly’s health to sync across all players. I had to spend a lot of time drawing out arrow diagrams and deciding what to update on both client and server side to make sure health and questions were synced correctly.

Accomplishments that I'm proud of

One thing I’m very proud of is how much I learned during this hackathon. I'm happy I finally learned AWS and Docker. This was a great opportunity to pick up 2 new skills.

I’m also proud of designing every part of the game myself, including the sprites. At least to me, it gave the project a nice personal touch.

What I learned

I learned how to set up an EC2 instance to run a docker container on AWS. To do this, I first had to learn the basics of docker to build an image for my application then run it on localhost. After ensuring it ran, I learned how to transfer my project source and docker image to the EC2 box where I ran it on the cloud.

What's next for Communal Pet Duck

I have some more ideas for my game. I want to add more depth by adding an economy where users can buy food/power ups to further heal Mr. Silly. I also want to add a leaderboard which will track the Silliest Fans.

Share this project:

Updates