2
\$\begingroup\$

I'm working on a simple round&web-based multiplayer game. The idea of the game is very simple: The players get an array of audio files which they listen to and write the transcripts for in 5 minutes. the player who sends in the most right transcripts gets the most points. its fairly simple and i was able to implement it locally. at the moment i have the .php file which lets me do all this but only in single player. what i'm trying to say is that whenever a player logs him/herself in, the page is loaded anew. what i want to do is to start the game from the server everytime 3-5 players log themselves in, so that the players can play at the same time and their results can be compared at the end of the round.

the thing is, i don't know how to start with this session or server/client model for a multiplayer game. i have read that php isn't ideal for web based multiplayer games because real time data exchange could be problematic, but since that is not really the case here i don't think that should be a major problem. i googled my problem but i have failed to find a solution. any help or advice would be much appreciated. cheers.

edit: is a node.js server what i'm looking for here?

\$\endgroup\$
1
  • \$\begingroup\$ all that i can fine via google was with socket.io but i don't really need it do i? i mean there should not be any real time interaction, the players should only start at the same moment and get the same array. \$\endgroup\$
    – Revangelis
    Commented Jan 20, 2013 at 12:12

1 Answer 1

2
\$\begingroup\$

Socket.io/node.js is precisely what you want. If you want to start a tad simpler, you could use ajax and an timeout to poll the server every 30 seconds or whatever time period to get a response concerning other players around. So really either take the active approach with socket "The server has just told me someone joined, someone answered, etc" or the passive ajax approach "Let me ask the server if anything has happened."

\$\endgroup\$
2
  • \$\begingroup\$ thanks a lot. one small question, could i use websockets node instead of socket.io? \$\endgroup\$
    – Revangelis
    Commented Jan 20, 2013 at 21:05
  • \$\begingroup\$ Oh, absolutely, which implementation you use doesn't matter, although socket.io has some nice fallback options (using flash to mimic sockets all the way down to doing the aforementioned ajax polling) so it's a fairly complete package \$\endgroup\$
    – user25397
    Commented Jan 20, 2013 at 21:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .