Inspiration
I've been building Sand Court Volleyball, a 3D beach-volleyball game for the browser. Its daily challenge turned out to be the part players came back for: one small goal a day, the same for everyone, and a streak for every day in a row. On the web that streak is a private number in your browser. On Reddit it can belong to a community: everyone in the subreddit plays the same goal on the same day, sees how many others made it, and talks about it in the comments of that day's post.
What it does
Each day at midnight UTC the app posts a new Sand Court Daily post to the subreddit, with one challenge for everyone. Some examples from the rotation:
- Serve 3 aces in a match
- Win a rally that lasts 14 seconds
- Dig 6 balls in a match
- Win with the CPU on 6 points or fewer
- Silence the crowd: win the match with a spike nobody touches
There are 13 kinds of challenge on a 21-day rotation. Easier ones come round more often and the same kind never falls on two days in a row. Each challenge comes in two sizes: matches on a phone go to 7 points and on a computer to 11.
In the feed, the post is a light card with the day's challenge, your streak, how many players met it today (for example "41 of 97 players made it today"), the longest streaks on the board, and one button: Play today's match.
In the game, the post opens into the full 3D match: a stadium with a crowd, wind, a commentary booth with two voices, and touch or keyboard controls. A first-time player goes straight into a short match against a gentle CPU, with no setup screens. When the match ends, the result card tells you whether you met the challenge, your streak, your place on today's board, and how the rest of the subreddit did, with a button back to the post's comments.
Streaks and boards are kept on the app's server (Devvit Redis), so they follow your Reddit account across devices. The server re-checks every result against the day's challenge itself. Older posts can still be played for fun, but only today's post counts toward a streak. Logged-out players can play everything, and the game asks them to log in only to keep a streak.
How to play
- Move: WASD or the arrow keys, or drag on the left of the screen on a phone.
- Hit: F or click as the ball drops to you, or tap HIT when it lights up. Your side gets three touches: pass, set, attack.
- Jump: Space, or tap JUMP, to spike or block at the net.
- Meet the day's goal in one match against the CPU.
How I built it
- Devvit Web with an Express server:
/api/dailyfor the post's challenge, your streak and the board, and/api/daily/resultfor a finished match. Streaks, tries and the board live in Devvit Redis. - The scheduler posts each new day at midnight UTC; the install trigger and a moderator menu item can post it too, and every day has exactly one post.
- Two entrypoints: an inline splash card for the feed (no 3D, so it is quick for everyone scrolling past) and the expanded game.
- The game is three.js and TypeScript, built with Vite. The same source runs the web game and the Reddit post; one build flag switches the Reddit version over.
- Devvit Journeys: App.Ready when the game is interactive, Journey.Start and Journey.End around each match, and Journey.Progress from the server when a daily result is recorded (challenge met or missed).
- The challenge and streak rules are shared code, so the client and the server read and check a challenge exactly the same way.
What I built during the hackathon
Sand Court Volleyball existed before the hackathon as a web game. Everything that makes it a Reddit daily game was built during the submission period:
- the whole Devvit app: posts, server, Redis storage, scheduler, install trigger, moderator menu
- one shared daily post and challenge for the whole subreddit, instead of a private per-browser challenge
- streaks kept on Reddit accounts, the day's board, and "X of Y players made it" counts
- the feed card, and the Reddit result card with the way back to the comments
- Devvit Journeys analytics
- a Reddit-safe build of the game: no outside requests (fonts bundled, online play and the web API switched off), with the 3D models compressed to keep the download small
In the same period I also worked on the game itself: a road from club to world champion, country teams, a second commentator, new kinds of spike challenges, and smoother play on weaker phones.
Challenges I ran into
- A post can only talk to its own server. The web game used a separate API, online multiplayer and Google Fonts. On Reddit all of those are out of reach, so the Reddit build bundles its own fonts, leaves online play out, and gets everything daily from its Devvit server.
- Browser storage resets on every app update (each version runs at a new address), so streaks had to move from the browser to Redis.
- Size: the stadium, players and crowd are 3D models. Compressing them with meshopt and WebP textures cut the models from 36.6 MB to 19 MB.
- Fairness across devices: phone matches are shorter than computer matches, so each challenge has a smaller version for short matches, and the server checks results against the right one.
Accomplishments I'm proud of
- A full 3D sports game running inside a Reddit post, with a new player in a match straight after pressing Play.
- The daily loop is one tap from the feed into a match, and one tap back to the comments to talk about it.
- Zero outside network requests from the post.
What I learned
How Devvit Web splits work between the inline card and the expanded view, and how much a daily game gains from being shared: the same goal, the same day, and the same comment thread.
What's next
- A weekly cup on top of the daily challenge, with flair for the longest streaks
- Sharing your result as a comment in the post
- Daily challenges against a given rival team, venue or weather
Built With
- devvit
- express.js
- node.js
- redis
- three.js
- typescript
- vite