i just recently learn CakePHP and do inspired a lots by it's AJAX framework. i wonder is PHP suitable for browser based realtime strategy game? Even though there is no fancy 3D graphic, but if there is 5K concurrent user playing the games, and the server refresh their HP/MP or other statistic every second (realtime), can the web server support? Is this the reason why people use Game server for gaming? Thanks for all your input coz i really hope to do some research before really go in depth in design the PHP Browser game
It's today, I've realised that lot's of PHP enjoy playing browser based games. I think the web server can handle that.
I don't quite understand the question. PHP does not have support for real-time games. All the games you play on the web are mostly developed in Flash. People run their games on specially formatted servers (game-servers) because they are accessable to the public (unlike their home PC's usually are) and they are built to handle the user load. I don't know where you have been seeing PHP used as a way to play browser based games, but perhaps you are thinking more of how sites like addictinggames.com display and organize their games on their site. You would be able to refresh data on a page every second or so by posting and retrieving information with ajax, but I feel like that would be excrutiatingly slow and very inefficient. If I am mistaken then please correct me, but I have never seen PHP used for the actual development of games.
The reason PHP is not really used for games, is because its limited, you can create text based games (like the common RPG, Mafia etc.) - but their not as fun as the real thing which is why people tend to use other languages as they have extensive support for such task.
Those browser based RTS games you're talking about are most likely made in Flash or Java. The website it's hosted on probably uses PHP, but the game itself is most likely not developed in PHP, unless it's text-based.
Yes, that was what i mean, coz Ajax allow callback server with N seconds. Let say i set it to 1 seconds refresh a portion, it could be nearly realtime. So we could refresh you HP while you character hit by another user, stuff like that Instead of REFRESH via F5 tht's the problem coz i hv no idea how slow it's if my game is going to have this kinda callback every few seconds with thousand of concurrent user Mafia and those Vampire games in Facebook are in PHP. Let's forget bout how lousy PHP can support on graphic, but in term of Numbering Game (Strategy game) with simple images, is it able to create a simple game and yet can attract user and wont crash with 5K concurrent user in one web server? We are talking bout how well PHP and web server can go in gaming industry
I haven't really played some of the more detailed games on facebook, but those games tend to be more just images with text on top of them showing relavent information. It would be possible to do something like this and have the browser refresh every-time data needs to be changed (aka. the user updates something). I wouldn't consider this a "real-time" game, but the concept you are talking about is used all over facebook.
i know for sure PHP cant beat Game engine, IDE development But can you give some points that PHP + AJAX + JS cant do in a browser based game compare to Java? What Java has and PHP + AJAX + JS doesn't in develop a browser based game? (eg. a turn based game)
Flash can actually work with php to store data I believe so you might want to look into that as a possible improvement
With the use of AJAX, PHP can be used for gaming but not that really good and not very interactive...