Inspiration
After the fun of building a 2D game for the previous Reddit hackathon, I was inspired to wander into pricklier territory: 3D multiplayer. For years, I've been fascinated by the creative potential of libraries like three.js, but the mental model always felt just out of reach. Tutorials and books only got me so far. The context switch was always jarring, and the webgl framework was both too designy and too mathy to be in my wheelhouse.
This hackathon felt like the perfect opportunity to try to build a new wheelhouse. I wanted to make an interactive, social 3D space for the Reddit community - a platform where users could build, connect and complete quests. I also wanted to try out Kiro, a tool I'd heard a lot about. My goal was to build a multiplayer 3D game or at least break through the wall I'd hit so many times before with 3D development.
What it does
BlockRift is a multiplayer 3D sandbox game built for the Reddit community. It’s a persistent, open-ended, multi-level world where users can build structures, explore creations by others, and connect with players in real-time. While different goals are possible at different levels, the current iteration (world #1) is simply creative and expansive.
The core experience is built around community and creation:
Persistent voxel world: A shared, endless world in every post, where every block placed by a user remains for others to see and (at least for short periods) build upon.
Real-time multiplayer: See other players in real-time, chat with them, form friendships and build plans.
Collaborative building: Friends can be granted permission to build and break blocks together, enabling true collaborative projects and quests.
Community showcase: In any region, you can toggle highlights to see who has built what. This allows you to see a specific user's contributions and "upvote" their work directly within the game, contributing to in-game leaderboards.
Snoo avatars: Players are represented by cute voxel avatars inspired by Reddit's own Snoo.
How I built it
BlockRift is built entirely with three.js for the 3D rendering and is integrated into the Reddit platform using Devvit. The real-time backend is powered by Redis and Devvit realtime handling player positions, chat, and block updates.
My development process was supercharged by Kiro. As a solo developer prone to getting lost down rabbit holes, Kiro's spec-driven development was my anchor throughout. I started by feeding Kiro existing three.js examples and voxel game code, using its chat to ask countless questions until I understood some critical concepts and parameters. I used specs for several things - from implementing core features like procedural world building and chunking to exploring experimental ideas like procedural cloud generation. This allowed me to sandbox new code, integrate it if it worked, or learn from it and set it aside if it didn't. Kiro's hooks kept my steering docs updated and consistently useful as the game evolved.
I also used Kiro to help me design a local mock backend powered by redis and websockets, based on devvit's realtime and redis APIs. Using vite I was able to switch between the two environments with a simple command switch: npm run dev:local and npm run dev. This was really key to being able to iterate quickly and test multiple players locally.
Challenges I ran into
Building the three.js world model: This was my initial, and largest, hurdle. It took a systematic approach, breaking down every concept into small, manageable specs, to finally gain a true understanding and build an unlimited world in three.js
Reddit constraints and quotas: It's quite challenging working within Reddit's development workflow, the sandbox constraints (e.g., no pointerlock controls for a perspective camera) and the backend limitations on messaging and db, so optimization and resourcefulness was needed at every level.
Real-time optimization: Building a performant multiplayer world is tough. A major challenge was optimizing an "endless" world, which led me to implement chunking for world generation and instance meshes to render blocks efficiently.
Backend design on redis: While powerful, redis is very open-ended. Designing a robust and scalable backend for player state synchronization and world data required planning and several iterations. Again, having a local dev environment was key to quick iterations and painless migrations.
Accomplishments that I'm proud of
Finally taming three.js: Going from feeling intimidated by 3D development to building a fully functional 3D game engine in a few weeks is an accomplishment I'm proud of.
The builder highlight feature: I think this is a powerful tool for fostering a positive and creative community, allowing users to directly view, reward and recognize individual builders.
The voxel snoos: Designing and implementing the Snoo-like player characters was quite fun. Syncing their camera and movements within the sandbox world was challenging but adds a uniquely "Reddit" feel to the game that I hope goes beyond being gimmicky and fosters community.
Building a robust local mock server: Given the multiplayer nature it was quite critical to iterate locally in a way that could transition seamlessly to Devvit's remote development. I hope the open source code of my game can help other redditors experiment with Devvit realtime without getting bogged down with interminable builds.
What I learned
Beyond 1) the technical skills of three.js, and 2) designing the real-time backend data architecture, my biggest lesson was in 3) the process. Thanks to Kiro's specs, I learned how to systematically tackle a technology that hitherto seemed impenetrable, and I’m never going back to the wilderness. As a solo dev, spec-driven development kept me focused and productive where I was most useful, allowing me to ship a complex project on a tight deadline.
What's next for BlockRift
BlockRift is set up to have unlimited worlds in unlimited levels, with different (fully seeded) terrains, textures and goals, but due to Reddit and realtime quotas it will be important to have only one or two active worlds at a time, with the rest available only for exploration and appreciation over an http connection.
For right now, the immediate next step is to see how the game performs with a larger community of players on different devices and networks. I'm keen to gather feedback and squash the inevitable bugs. From there, I have a wishlist of ideas including community events and deeper creator tools.
Thank you for checking out BlockRift!
Credits - Prior art and resources
Built With
- devvit
- kiro
- redis
- three.js
- typescript
Log in or sign up for Devpost to join the conversation.