Inspiration

We were inspired by Tamagotchi and the idea of taking care of something over time. We wanted to take that same feeling of responsibility and apply it to something much bigger: our environment.

Our idea was to make taking care of the Earth feel rewarding and engaging. Instead of simply asking people to throw their waste in the correct bin, we wanted to show them the impact of that action. What if every piece of properly sorted waste could directly contribute to building a better community?

This led us to create a collaborative, location-based city-building game where everyday waste becomes a resource for developing a virtual city.

What it does

Our project combines a physical automated waste-sorting system with a collaborative city-building game.

Each location starts with a randomly generated map containing flat terrain and rivers. As people dispose of waste, the system identifies the waste category and converts it into resources that contribute to the city's current construction project.

There are four main resource types:

Recycling → Building Materials: Used to construct foundations, walls, and buildings. Compost → Fertilizer: Used to grow gardens, trees, and other vegetation. Paper → Exterior Details: Used for signs, decorations, public art, and other visual features. Garbage → Energy: Used to power infrastructure such as streetlights and illuminated buildings.

The game supports both passive and active participation. Someone can simply dispose of their everyday waste and automatically contribute to their community, while active players can choose which buildings and infrastructure projects their city should prioritize.

Every day, a new selection of projects is generated with different resource requirements. Daily quests provide additional rewards that can be used to upgrade the city and encourage players to return.

As resources are collected, players receive immediate visual feedback. Buildings gradually develop at 25%, 50%, 75%, and 100% completion, allowing everyone to see how their contributions are transforming the city.

If a project receives more resources than it needs, the excess carries over to the next project. Once all of the day's projects are completed, additional waste contributions can improve the surrounding environment with landscaping, decorations, and other enhancements.

The goal is to turn an everyday action that people already perform into a collaborative experience where small individual contributions add up to something much larger.

How we built it

We divided the project into several areas, with team members focusing on hardware, 3D modeling, game development, and backend development while working together to integrate everything.

The physical system uses a Raspberry Pi, motors, sensors, and a camera to identify and sort waste. We initially planned to send camera data wirelessly, but during development we realized that we could transfer the image data directly over a wired UART/USB connection, making the system simpler and more reliable.

We developed the motor-control system and ESP code alongside the game. At the same time, we created the city-building game, backend server, and public web hosting infrastructure so that different locations could share their progress.

We also designed and 3D modeled the physical system before manufacturing it. This allowed us to plan how the components would fit together and determine what materials needed to be cut or printed.

For waste recognition, we incorporated the Gemini API to analyze camera images and determine the appropriate waste category. The resulting classification is sent back to the game, where it becomes a resource that contributes toward the active construction project.

Challenges we ran into

One of our biggest challenges was getting the physical hardware to work reliably.

Our 3D-printed parts had tolerance issues that caused components to fit differently than expected. At one point, we even questioned whether we had selected the wrong motors because the mechanism was not behaving as expected. After troubleshooting, we determined that the mechanical tolerances were a major factor. We improved the fit by tightening the tolerances and using hot glue to secure certain components.

We also had difficulties determining the correct specifications and operating parameters for our stepper motors. Getting the motors to move consistently required a lot of experimentation and troubleshooting.

On the software side, we ran into collision issues and inconsistencies with AI-generated sprites. Cleaning up generated sprites and making sure different assets had a consistent visual style took more time than expected.

Debugging AI-generated code was another challenge. Generated code could provide a useful starting point, but integrating it into our existing system often introduced unexpected bugs that we had to understand and fix ourselves.

We also encountered manufacturing issues caused by human error. Parts sometimes had to be remade or adjusted, which made us realize how important careful measurements, tolerances, and verification are when building a physical system under a tight deadline.

Accomplishments that we're proud of

We are proud that we were able to combine hardware, computer vision, game development, backend infrastructure, and physical manufacturing into one working system.

We built a physical waste-sorting mechanism that connects to a game where the results of physical actions have a direct impact on the virtual world.

We are especially proud of the connection between passive and active gameplay. A person does not have to understand the game or actively participate to contribute. Simply disposing of their everyday waste can help their community progress, while players who want a deeper experience can actively manage their city's development.

We also successfully hosted our server publicly, allowing the game to maintain shared progress and support the idea of multiple locations competing and collaborating through their cities.

Most importantly, we created a system that makes sustainability feel less like a chore and more like a collective game.

What we learned

This project taught us a huge amount about building a complete system from the ground up.

On the hardware side, we learned how to work with Raspberry Pis, stepper motors, sensors, cameras, and physical mechanisms, as well as how to troubleshoot problems involving motors, mechanical tolerances, and manufacturing.

We learned how to build and host a backend server on a public domain and connect it to our game and physical hardware. We also learned how to transfer camera data between devices and integrate an API for image analysis.

On the software side, we gained experience with game development, sprite creation, collision systems, backend programming, and debugging AI-generated code.

Perhaps the biggest lesson was learning how interconnected every part of a physical computing project can be. A problem that appears to be an electrical or software issue can actually come from a mechanical tolerance, and a small manufacturing mistake can affect the entire system.

This project gave us experience not just with individual technologies, but with bringing many different technologies together into one working product.

What's next for Trash Royale

There are a lot of directions we would like to take this project if we continued developing it.

First, we would like to improve the physical sorting system to make it faster, more reliable, and capable of handling a wider variety of waste. We would also like to improve the computer vision system so that it can recognize objects more accurately under different lighting conditions and from different angles.

On the game side, we would like to expand the city-building system with more buildings, upgrades, environmental events, and different types of infrastructure. We could also introduce leaderboards and competitions between different locations, allowing communities to see how their sustainability efforts compare with others.

We would also like to make the daily quests and progression system more engaging, giving players more reasons to return and contribute to their community over time.

Ultimately, our goal would be to move beyond a hackathon prototype and create a system that could be deployed in real communities. By connecting physical waste disposal with a shared virtual city, we hope to make sustainable habits more visible, rewarding, and fun.

Built With

Share this project:

Updates

Submission history