Hi, I want to start a project for facebook and the application will be like real-time multiplayer chess game. The problem I'm having is I have no idea how to store the data when a player moves one piece and update the new position in player2 browser. I'm gonna use PHP, MySQL for server side and jQuery for Client Rendering. The simplest idea is to store the data in XML or MySQL and re-generate the result to player2 browser. But I know that when thousand of players are playing, it will not be an efficient way. Since I don't have time to study new language for this project, I'm gonna have to stick with PHP. I'm not going to use flash either because I want my client side light-weight and flash-free. So is there any way that will solve my problems?
+1
A:
I guess going through a server is your only option. That is to store the game status is xml or a sql db. And than the clients need to frequently poll this status, e.g by jquery ajax. Having the clients to communicate directly p2p is not possible with standard web components.
PHP_Jedi
2010-05-11 22:27:15
+2
A:
you would have to be polling server for update every.. maybe 2 seconds, depends on server load. If you used flash, there would be another option - to use sockets, it's much more suitable for multiplayer games, but i don't think you could make it without some third-party runtime.. HTML5 has some kind of websockets, but it's very bad when it comes to cross-browser compatibility
praksant
2010-05-11 22:27:51
That's a good idea to space out the requests at longer intervals at times of high server load. That way you can set it to be extra responsive at times when the load is light.
Syntax Error
2010-05-12 01:07:50