Inspiration

Music trivia can be a blast when everyone listens at the same time and takes shots at the right answer. We wanted to make getting the same vibe easy: just one shared screen plays the music while everyone connects via their phone or web browser and keeps competing by buzzing in.

What we built

Kittune is a real-time multiplayer music-guessing game. A host creates a room, selects songs, and then begins playing short previews on the main screen for others to hear. The players enter the game either by using a room code or through the public lobby.

The player who buzzes first will be given 15 seconds to identify the song. A correct guess will give a point, an incorrect guess or timeout will result in loss of points. Players can vote together to skip a song, reaching -3 points eliminated players who then cannot vote, and the player running out of points becomes out of the game.

The game includes Top 1000, Nursery Rhymes, Movie Soundtracks, 2010s Hits, and K-Pop song lists.

How we built it

The web client is built using React and TypeScript, and Vite is used to create local / production builds and for development. The back end is implemented as a Rust module compiled into WebAssembly and deployed by the SpacetimeDB server.

SpacetimeDB stores information about rooms, players, points scored, songs, and the ongoing state of the round. buzzing, guessing, and voting to skip are validated actions in reducers. Clients subscribe to views of the room data, and each user can see information regarding the state of his/her room.

Song search uses the iTunes Search API. The catalogs store track metadata and preview and artwork URLs; the audio and images are served by Apple.

Challenges and what we learned

One challenge was dealing with players who disconnect from the game at any point. Each connection is tracked separately from the room membership, so a player may show as offline but still have their score. This means that skip voting will only count eligible players that are online so that the disconnected players won't be blocking the game.

We also learned to keep important rules on the server. Upon receiving a request for an action from the user, its permission is checked and the result of the action and changes of the game state are applied. This allows all players to play using the same authoritative game state.

What works now

Kittune is a playable prototype with private and public rooms, multiple song lists, live player status and scoring, buzzer turns, skip voting, timeouts, elimination, and game-over screens.

Song search and previews depend on iTunes results and available preview clips. Search results can include alternate recordings, and some previews may be short or generic. The current search presents five results and promotes the round’s matching track when it appears in that result set.

Built with Add these as separate tags:

  • SpacetimeDB
  • Rust
  • WebAssembly
  • React
  • TypeScript
  • Vite
  • Cloudflare Pages

Built With

Share this project:

Updates

Submission history