Hacker News new | past | comments | ask | show | jobs | submit login
Multiplayer Deck of Cards (of.cards)
190 points by pkstn on June 1, 2019 | hide | past | favorite | 73 comments



Very cool idea!!! You can basically play ANYTHING with this. The only feature missing that each player should be able to look their cards only in a way that others can't see it.

Edit: Oh wow, it's not missing! If you put the card in top of the player icon, only that player can reveal it, nice!!


I didn't see the player icons until I tried zooming out. That was confusing! (1280x900 standard 13" rMBP resolution)


Yeah, I’ll make that better..


What would be nice to really be able to play anything with it, would be a selection of used cards. That would mean for example choosing if the deck goes from Ace to King, or from 7 to King, or even if it contains jokers. Even more advanced would be allowing multiple copies of cards, the game Doppelkopf for example is commonly played with two cards each of (9)/10/J/Q/K/A for every suit.


I will add possibility to create more decks and jokers..

The old version actually gives you jokers when you click all kings in a row (easier to do if you click ”by suit” first)


You can actually do that right now by putting unused cards aside, but it is a little bit cumbersome, because shuffle will put it back.


I mean game editor, I will add that :D


I will make shuffle to only shuffle the deck and add ”Collect” button this evening..


> You can basically play ANYTHING with this.

That is very clever indeed! A long while ago I started thinking about how to turn Klondike solitaire into a multiplayer game. I wrote a bit of code. Put it aside for a while. Wrote more code. Bought a domain. Wrote a little bit more code. And then stopped.

The problem in my case is that I still haven't decided quite how to make it multiplayer.

Kudos to pkstn for being clever and executing the idea well too.

By the way, if anyone has any ideas for how multiplayer solitaire could work, let me know in a reply to this comment :)

I've had two different possible ideas in mind so far:

1) Do it similar to "Twitch plays Pokemon". Everyone can input the next move. And I think the action taken should be consensus-based. Even then someone could try and ruin it though by just controlling a lot of players. With Twitch plays Pokemon they were able to complete the game eventually even with the people working against the goal. But with a short game like Klondike solitaire it will be very easy for someone to ruin it for everyone. Even if the game has undo.

2) Everyone plays alone but they compete in real-time against others. However, bots would likely beat everyone and ruin the fun of that.

So I think neither of the two initial ideas I had were good enough. I think something clever needs to be done.

I suppose that one could incorporate Klondike as part a bigger overarching world where you do Klondike "battles" against either other players or against individual NPCs by yourself, or as a team against NPCs or something. But then the question becomes what is the motivation for having Klondike be part of the game at all? And the problem of bots being able to beat everyone would still be hard to get rid of I think.

Here is the site I put up for mine: https://klondike-mmo.com/. None of the buttons on my site do anything, heh :P


I will open source it soon here: https://github.com/pakastin/deck-of-cards


What about speed or spit sometimes it's called, they are kinda like multiplayer solitaire.


Yeah, that’s how it work! Will need to add help/tutorial there..


Nicely done. Drag and click works well on my iPhone with my fat fingers. Zoom also. I found the invisible boundary a little annoying. I laid out a Canfield base, but found the invisible boundary only when I moved a card up to the foundation. Grrr.

FWIW. Made me think, why have a boundary at all? Even better, why not have a snap-to grid you can toggle? A preset layout (save option?) which best lays out your gameplay.

Great job.


Layout editor is something I've had in mind too – will work it!


This would be amazing to use when playing absolutely any card game with friends who don't live close enough for a real game.

If this would be open-source and there was an easy way to modify some of the actions to fit the most common operations to a particular game, it would likely start as an engine for tons of other games/websites (Pokémon, Magic the Gathering, Star Realms,...).


Cockatrice is okay for Magic: the Gathering, though it could certainly be improved a lot (I feel like XMage is really of the same flavor).

It’s a shame playing Magic requires a lot more features than, say, Bridge — this is hardly exhaustive but in addition to needing to be able to put dice on cards, you need to be able to select and reveal cards at random from all zones, manipulate the top of your deck, create token cards, and tap/untap cards. I feel that this presents a large UX problem.


I will open source it soon!


I made a very similar project: https://cardtables.online

It also offers chat communication and webcam over webrtc!


Cool wow, yeah! I’ve thought about chat feature..


Cool idea. I see some weird rendering issues on my retina Mac. Is that a known issue? https://www.dropbox.com/s/uq18mm1q9braipa/Screenshot%202019-...

Mainly what I see is the face cards are rendered HUGE and the pips in the centers of the cards seem jumbled.

I tried playing solitaire, but gave up when it came time to flip through the deck 3 cards at a time. Going through the first time would be OK. Resetting for subsequent passes would be really painful.


Wow, that’s really weird, need to look on that..

I will create different game modes, solitaire is definitely one of the first ones!


Pretty sure it was a caching issue. Does it work now?


If someone plays a game with me with this, I'm totally going to be spending time between every turn in the Dev console figuring out a one-liner to reveal as-yet unturned cards...


Not possible, client-side doesn’t have the information


Flip the card really quickly (single animation frame), get data, boom. Maybe you'll get noticed, but probably only by someone who's equally sophisticated in detecting tricks.


I will add a chat which will show game log..and probably a optional turn "token" too


It could be done that server doesn't send the information what card it is until absolutely necessary, so you could not do that.


Cryptographers are really interested in card games as a model of information problems, so there are pre-existing algorithms for how to do stuff for card games in which different players have different information about the state, but everybody can prove to their satisfaction that the others aren't cheating - without a trusted server at all.

https://en.wikipedia.org/wiki/Mental_poker


Server is the single-source-of-truth and only share the info about card value/suit when clicking your own card or common cards


It is done on server-side


Love it! Is there a way to select which cards to shuffle? I tried to play solitaire (with house rules) but got stuck when I wanted to reshuffle the draw deck.


Oh, just the deck without picked cards? I could add ”Collect” button next to ”Shuffle”.

It’s easy to do, but I’m on mobile now – will do today.


Hmm.. that would actually require some kind of game editor / custom game mode – let's see..


I was actually thinking about a designated shuffling area on the board. All cards moved to the shuffling area would be shuffled but the rest would be kept untouched. The area could surround the deck by default.


Excellent! I've wanted to make something just like this for our family. Are you going to work to make the site self-sustaining or is this just for fun?


Both

I have lots of ideas how to make it even more fun! And will open source it also soon..


Nice been waiting for something like this. Maybe some ideas can be borrowed from TabletopSimulator eg. Custom cards etc to allow a larger selection of games.


I will open source this – let's hope people will create customized cards/decks!


That's an awesome domain name! I've tried house.of.cards and it redirects to deck.of.cards ;-)


Haha yeah, I was lucky to get that


Nice but I think I found you a little bug. Some of the figures are displayed with numbers in the corners. It looks like it's the number of the pips on the preceding or following card.

Frex, my last draw of three cards was: Ace of space, King of hearts, 8 of diamonds, but the king had an 8 instead of a K in the corners.

Edit: Aw. HN markup removes suit symbols :(

Further edit: It looks like some of your cards are drawn with one image superimposed on another. So actually the figures that have the numbers in the corner are a figure with another card that is not a figure on top.

Should be a quick fix :P

Last edit I promise: It looks like this:

https://imgur.com/a/I9CJqGG


Oh damn, I’ll fix that ASAP


Great idea! The card graphics don't look as nice for me as they did in your blog post, though: https://imgur.com/a/RrjMifa


I’m pretty sure that has been some kind of a caching issue, does it work already?


Haha, need to investigate that..



Like the animations. Nice simple website.



This is a really cool idea! I'm making a browser poker app just to play with friends but idea was to have it specific to poker with a similar UI to pokerstars, 888 etc.

Never considered emulating actually just having a deck of cards on the page, using the same level of trust you have between people irl. Any plans to add stuff like chips or scoring?


Maybe, let’s see..


Awesome! Another vote for (a simple way) to do chips.

I've wanted to have poker games with my team (which is distributed) for a long time. This is 90% of the way there.

Update - I just found pokerchips.io. Check it out; it has a simple interface which does everything you'd need.


Others have requested chips too, so will add. But first need to open source


I'm sure others have reported this, but there's some kind of odd bug:

https://www.solipsys.co.uk/images/OddPlayingCards.png

Pretty sure it's wrong to have numbers and Kings on the same card.


Haha, wow that's crazy – fixing this now!


heh, ya I missed two aces because of that bug :P


Whoops, sorry about that – fixing now!


Fixed!


Fixed now!


Today I learned that .cards is a TLD


Haha, yeah


Weird. It always yields the same card - shuffling just changes which card


Move the card off the top of the deck. You are turning only the top card face up and face down.


I did that. At one point I had like 10 aces of heart lying on the table.


That's weird. It might've had a bug. Now enhanced a lot and should work so much better!


I changed the design of faces, the previous font had too similar 3 and J


I completely redesigned the card faces – 3 and J was hard to distinguish..

https://deck.of.cards


Fisher Yates for shuffle?

What is the key scheduling used for multiplayer?


Fisher yates yeah! Server is the single-source-of-truth, so no way to peek cards


Nice! I am only missing a way to move a pile of cards.


That's actually something I've already tested out, so probably coming soon! Hit test + long-press-and-drag should do it!


Now make a forum where to read replies you have to organize paper on a table.


What backend you are using ?


node.js + express + MongoDB + socket.io




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: