Hacker News new | ask | show | jobs
Show HN: Monochess – A chess variant with rule-bending action cards (monochess.pages.dev)
3 points by h4ch1 20 days ago
Hey HN,

A while back I saw a video[0] of people playing chess but using action cards to modify the rules mid-game (skip turns, reverse, draw 2, etc.). It looked incredibly chaotic and really fun to play, so I decided to actually build it as a playable online game. A small difference in Monochess is there's no need to call out a phrase if you just have one piece. I noticed while testing with the mrs. it became really annoying to keep doing this every move.

That also gave me a really good reason to build on Cloudflare using their entire stack, something I've been meaning to get my hands dirty with for quite some time. The app is built using SvelteKit and hosted on Pages, there's a Durable Object worker-backed game server, and D1 as the database layer for accounts/games.

This project included:

- A Custom Engine: Standard chess engines panic when forced into illegal board states. The engine wraps standard chess logic to allow for mid-turn state changes—handling concepts like rolling back a completed move, processing skip turns, etc.

- Custom State Serialization: Standard PGN breaks the moment an action card is played. Monochess uses a custom JSON-based serialization schema that deterministically records both the chess moves and the card actions. This allows the game state to be completely reproducible for history, replays, and validation.

- Durable Objects Game Server: Real-time multiplayer is handled entirely on the Edge via Cloudflare Durable Objects. The DO acts as the single source of truth, managing WebSocket connections, verifying actions against the ruleset, handling disconnects, and running the turn timers.

- D1 Persistence & Matchmaking: Using Cloudflare D1 to store the serialized game records, manage player authentication, and track ELO via a custom Glicko-2 rating implementation.

It's free to play here: https://monochess.pages.dev

Would love to hear what you think, or if you manage to find any absolutely broken card/move combos. There's also a feedback/bug report form on the site itself (writes to CF KV and a worker runs to email it to me (I swear I'm not sponsored by CF xd)).

LLM aid was minimal, but Gemini 3.5 Flash is pretty good for small UI enhacements, and generally organizing components in Svelte. Was pleasantly surprised.

[0] https://www.youtube.com/watch?v=vzkKs_b5css

2 comments

Nice job. When I was a kid, we tried to merge our two favorite things: Magic: The Gathering and chess, combined into one ridiculous hybrid game. It takes a game that’s normally one of perfect information and adds in the indeterminism of the random draw, which makes for a nice change of pace.
That sounds really interesting. Would love to know more about it.
Sure. So basically we took the non-creature cards in MTG and adapted them to chess. Instead of two decks, it was a communal deck, and you could forgo a turn to draw another card. Then we just adapted Enchantments/Sorceries/Instants to be more "chess-flavored".

One of the tricky parts we discovered in playtesting was that you can’t let a card’s effect trigger immediately. Instead, when a player plays a card, it goes into a sort of “escrow” state. They declare the card, everyone knows it’s coming, but it doesn’t take effect until the next round.

So the flow is: a player commits to playing a card this turn, and then on their next turn that card’s effect resolves.

Without this delay, instant effects made it too easy to pull off cheap wins for example, using a teleportation or transposition card to immediately force a checkmate with no chance for the opponent to react.

That's really cool, might implement it someday since the engine I wrote handles arbitrary card play and turn combinations. Let me know if you'd be interested in a playable version of this variant, would love to pick your brain.

My e-mail's on my profile!

Cool project! I used to work with a guy who played serious chess and he knew all these fun variants—we would always try to come up with even whackier ones. Adding action cards mid-game definitely takes the cake for chaos, though!
Thank you! Because of the randomness with action cards, sometimes I just play entire games by myself while testing xd.