Inspiration
I used to play wiki races, where you start on one Wikipedia page and try to reach another using only the links. What I liked most was what I picked up on the way. Racing through pages meant reading about things I'd never have looked up. I wanted to make that for Reddit. In Subhop you travel through communities instead of articles, and you end up in parts of Reddit you didn't know were there.
What it does
Every day there's one journey, like r/batman → r/knitting. You start in r/batman and see six exits, which are communities where Batman commenters also comment. Tap one and you get that community's six exits. Keep going until you reach r/knitting. Fewest hops wins, and time breaks ties.
The shortest route for that one is batman → cosplay → sewing → knitting. Everyone plays the same journey, so you can compare routes in the comments.
When you arrive you get:
- your hops against par, your time and rank, and the shortest route
- the player one place ahead of you ("1 hop behind u/name")
- a passport stamp for every community you passed through. There are 500 to collect, and you keep them from day to day.
- a button that posts your result as a comment. It says how your run went ("4 hops, par 3. 2 wrong turns, stepped back once.") but doesn't name the communities, so it can't spoil the route.
- a vote on tomorrow's journey. Anyone can propose one, and the winner is posted with "picked by u/name" in the title.
Finishing a daily sets your user flair to "Subhop · N-day streak", unless you already have flair of your own. Mods of any subreddit can also add their community to the map, so that daily journeys start or end there.
How we built it
Subhop is a Devvit Web app. The post runs React and Tailwind, the server runs Hono and tRPC, and Redis stores the runs, leaderboards, passports and votes. Each daily is an interactive post: a small card in the feed that opens into the full game. A scheduled job posts the next journey at midnight UTC.
The client only tells the server which exit you tapped, and the server checks every hop, so scores can't be edited in the browser. Devvit Journeys tracks each run from start to finish, including progress after every hop and the final hop count as the score.
The map comes from anvaka's open Map of Reddit dataset, which links communities by how many commenters they share. I took 500 of the biggest communities, gave each one six exits from its strongest links, and sorted them into 17 topics.
The game looks like a travel passport. The pages are cream paper, exits are ticket stubs, and every community is an ink stamp made from its real icon. The font is Reddit Sans.
Challenges we ran into
The real data is clumpy. Gaming subs mostly link to other gaming subs, sports subs to sports subs. My first build had dead ends and journeys up to 17 hops long. I didn't want to invent links, so I connected the big general subs to the main community of each topic, and each main community to the smaller ones in its topic, using real links wherever the data had one. Now you can get from any community to any other.
Difficulty was harder. A lot of puzzles had a short route that nobody could find without seeing the whole map. I wrote a simulated player that only sees what a real player sees (the exit names and their topics) and had it play every candidate puzzle 24 times. If it usually couldn't get close to par, I cut the puzzle. About 29,000 candidates went in and around 2,000 came out, which is still years of dailies.
Accomplishments that we're proud of
I'm happiest with the map. About nine in ten exits are direct links from the commenter data, and most of the rest go through one community the two share, so when a route works it's because those communities really do overlap. I'm also pleased with how fair the puzzles ended up. On the final set of dailies, my simulated player finishes within one hop of par about two thirds of the time just by following topics, and random tapping does it about 2% of the time.
What we learned
The main thing I learned is that I can't judge difficulty by playing my own puzzles, because I already know the map. A route that looks obvious once you know the answer isn't obvious from the start screen. The simulated player was the first thing that gave me a number I could trust.
What's next for Subhop
Publish the app after the hackathon, so any subreddit can install it and run its own daily journeys.
Built With
- hono
- node.js
- react
- redis
- tailwindcss
- trpc
- typescript
- vite