Categories

See More
Popular Forum

MBA (4887) B.Tech (1769) Engineering (1486) Class 12 (1030) Study Abroad (1004) Computer Science and Engineering (988) Business Management Studies (865) BBA (846) Diploma (746) CAT (651) B.Com (648) B.Sc (643) JEE Mains (618) Mechanical Engineering (574) Exam (525) India (462) Career (452) All Time Q&A (439) Mass Communication (427) BCA (417) Science (384) Computers & IT (Non-Engg) (383) Medicine & Health Sciences (381) Hotel Management (373) Civil Engineering (353) MCA (349) Tuteehub Top Questions (348) Distance (340) Colleges in India (334)
See More

php multiplayer game - server&client model

General Tech Bugs & Fixes

Max. 2000 characters
Replies

usr_profile.png

User

( 5 months ago )

 

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?

usr_profile.png

User

( 5 months ago )

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."

what's your interest


forum_ban8_5d8c5fd7cf6f7.gif