how to develop a two person card game for web?
May 29, 2011 3:54 PM   Subscribe

what technology is involved in developing a web card game (or any game) so that users can see each others screens?

This isn't online gambling or anything like that, but rather an ethnic and esoteric card game that two people can play after logging into a web site. The fact that it is a card game is relevant only because each person should be able to see the other person's cards in real time.

Although I develop web sites as part of my job, my development is more corporate, or interacting with a database, not two people interacting real-time with each other via the Web. I confess I have no idea even how to start, or what would be entailed in creating this two person scenario. I am not sure what technology would be best suited for this.

I'd be fine outsourcing this, but I still would like a handle on what would be necessary for this to work.

So where to begin?
posted by xetere to Computers & Internet (5 answers total) 3 users marked this as a favorite
 
You'll want some sort of Websocket technology or something similar.

Basically, you want some kind of streaming connection/long polling communications via javascript to update the player's screens in real time.
posted by ndfine at 4:02 PM on May 29, 2011


I started playing around with this for a personal project and found that it needs quite a mix of technologies. Comet, Orbited and STOMP are some keywords you can use to get a lot of info.

Do you develop mostly in Windows or Linux?
posted by Gomez_in_the_South at 4:08 PM on May 29, 2011


Well, you could just do it as a Java applet with basic server and client applications. It's actually pretty simple if you're a programmer. Some basic socket programming using threads to handle the connections.. It's basically an over-glorified chat client that uses a really simple server to pass messages between the clients. Then the clients interpret the messages and use them to choose what to display to the user.

I wrote a few basic online multiplayer board games like this earlier this year, so feel free to pm with any specific questions. I did mine in Java, but I'm sure it could have been done in 1000 ways.
posted by Raichle at 6:27 PM on May 29, 2011


Just to expand on ndfine's post, the point is that basic browser communication (HTTP) is not meant for pushing information from the server to the browser. There are esoteric solutions around this. (this is what meebo.com uses to allow chatting through the browser).

Another alternative is to use Flash which has the raw-socket capabilities.
posted by fennokin at 6:48 PM on May 29, 2011


Do you mean 'see their cards' as in see what they have, or 'see their cards' as in see a realtime pixel-perfect VNC-like reproduction as they move and arrange them? If the former I don't see why you would need anything esoteric like sockets or client/server features. The server knows what each player's hand contains since it dealt it to them, so it can just display both hands to both people. The client just tells the server its move (extremely simple in standard jQuery/ajax) and the server relays that gamestate update to the other player, who polls for updates every second or so (again, simple in jQuery/ajax) while waiting.
posted by Rhomboid at 4:34 AM on May 30, 2011


« Older Having a buyer's agent - necessity or not?   |   Resurrect My Friend's Amazon Seller Account! Newer »
This thread is closed to new comments.