Inspiration

I learned to play Mahjong from some friends while living abroad in Singapore, and from the moment I saw the physical tiles, I was mesmerized and knew they'd be perfect for XR. Since I moved back to the US, it has been challenging to say in touch with friends who are spread out all over the globe, and VR has become a way to maintain these social connections and feel like I'm in the same room as my friends even if they're thousands of miles away.

What it does

Mahjong Space is a true multiplayer Mahjong game with support for up to 4 human players, as well as a rich tutorial & solo practice experience so you can learn and master the game. It supports two styles, Mahjong Competition Rules (MCR) and Sichuan Rules (SBR). You can play completely with your hands with natural input, and it's a delight to toss the tiles with a direct gesture, or use the table-anchored push button UI ornaments to more easily play in a confined setting like on an airplane. You are accompanied by a delightful tabletop animal companion who gives you helpful gameplay tips, and there's even a physics-based sandbox where you can have some "tile therapy" tossing tiles around the table.

How we built it

It was built with WebXR and defaults to the immersive-ar mode for passthrough, and uses scene plane understanding to optionally place the virtual table directly on your physical tabletop. I used the metavr CLI and skils along with the Immersive Web Emulator and debugger from the IWSDK to do agentic coding and give my agent the ability to rapidly iterate, introspect, debug issues, and optimize performance for the game.

Challenges we ran into

Hitting a smooth 72fps in WebXR with rich beautifully rendered tiles and fully rigged, animated custom multiplayer avatars took a ton of iteration and performance optimization. I also wanted to make sure tabletop placement was robust, so spent a lot of time thinking about and iterating on the UX of table placement with physical gripper & rotation knobs in a diegetic interface that feels delightful and natural to operate.

Accomplishments that we're proud of

I'm proud the game works smoothly using WebXR, and that I was able to squeeze in some fun decorative tile sets and a custom made avatar to suit the vibe of the game. I really love the delightful element of the tabletop companions, and their animations when you win a round along with the confetti which falls realistically on your real-world scene fill me with joy. It was truly magical to experience multiplayer with friends for the first time, when it all came together and started working.

What we learned

I learned so much about what's now possible with WebXR. I was genuinely blown away by all of the new capabilities that are available. It feels like you can finally build a native-quality experience thanks to all of the effort from the team at Meta to make a best-in-class WebXR experience on the Horizon OS platform. The IWSDK and emulation tooling (IWER) is awesome, and it saved me a bunch of time while iterating on the game. Certain effects like hand occlusion I genuinely thought wouldn't be possible at first with WebXR, so I was so happy when I got them working.

What's next for Mahjong Space

I'm going to keep adding support for more regional gameplay variants and rulesets to cover all of the most popular ones (next up is Richii, then Hong Kong style). I'm planning to localize the game to support more global audiences. I would love to even make the rules engine open ended so players can design their own house rules. I'm going to test and refine gaze-based input to make sure it shines on the Meta VR Glasses. I am also thinking about extending the game with cool new modes like a daily seeded challenge and daily high score leaderboard, achievements, and even a single-player story mode progression where you can unlock additional characters, special tile sets, and more tabletop/room decorative elements. Lastly, I'm thinking about online matchmaking and supporting competitive play, but trying to balance that against the goal of supporting casual games with friends first-and-foremost.

Built With

  • iwer
  • iwsdk
  • metaquest
  • metavr
  • webgl
  • webxr
Share this project:

Updates

Submission history