Inspiration
We were inspired by games like GeoGuessr and FoodGuessr that facilitate fun, healthy competition and teach us more about the world.
What it does
MovieGuessr asks you to guess a movie's title based on gradually revealed hints like cast, release year, and director. A perfect round score is 5000 and 1 hint used; you lose 1000 points for each extra hint until you hit 0. But never fear: we've enlisted Google Gemini to give you extra nudges in the right direction if you're really stuck. After you play a 5-round game (for a maximum score of 25000), you can enter a username to save your score to the leaderboards and see how you stack up. You can also choose to play in a specific genre and compete just on that genre's leaderboard.
How we built it
MovieGuessr is a Vite + TS + React web app deployed using Render. Leaderboard data is stored in Firebase Firestore. We utilize the TMDB API to fetch movie data and the Google Gemini API to provide extra hints and mark a user's guess as correct if it's semantically similar enough to the real movie title.
Challenges we ran into
One challenge we faced was ensuring that you don't get shown duplicate movies within the same game. After researching React state and ref variables and experimenting with our logic, we figured out that we could wrap the MovieGuessr page in another component and save the IDs of each movie we've shown so far; if our random movie fetch returns a duplicate, we refetch until we have a unique movie to display to the user. Another challenge was finding the right prompt to give the Gemini model. We wanted it to consistently say the user is correct if all they have wrong is a spelling error or missing punctuation. The best way we found to do this is to instruct it to just return "true" in this case. Otherwise, it should give the user a slight hint towards the real movie title. We learned through testing that we had to tell Gemini not to give away the answer or be too obvious.
Accomplishments that we're proud of
We're proud that our game is fully functional and dynamically fetches new movies to show, so the game will never feel stale. We're also proud of our user-friendly leaderboard system that doesn't ask the user to sign up or enter any personal information in order to play. Also, be sure to pick Horror as a genre to see a special, on-theme Easter egg!
What we learned
This was our first time incorporating the Gemini API into a real project, and we learned a lot about how to prompt and use it effectively.
What's next for MovieGuessr
We would love to add a more robust leaderboard system with filtering by date ranges, or even Wordle-style sharing functionality that you could use to share your guesses with your friends. We've also considered adding authentication so you can track your leaderboard placements over time, but for now we love our system's simplicity.
Log in or sign up for Devpost to join the conversation.