Page 1 of 1
Online game maintenance with php. Can it be done?
Posted: Wed Oct 17, 2007 6:58 am
by Sindarin
I was thinking about creating an online game for Windows. As you know online games mainly consist of a client executable which the players use, and a server executable which needs to be executed from the server in order for the players to login. Now about the exec php command, can it execute the server executable for me? (Windows .executable (*.exe)) and the game requires DirectX 8.0, so it must be installed on the server right?
Posted: Wed Oct 17, 2007 8:52 am
by Maugrim_The_Reaper
You need to research these topic online. A lot depends on how the client interacts with the server, the technologies used on each end, and your server platform. In general I'd avoid PHP executing from the shell - you'd be better off with an actual daemon server running on a separate port.
Our own Feyd has game development experience so he'll know far more on the area. I'd guess DirectX is only a client requirement to handle sound and graphics. The actual server would be a dusty boring old data collector - a hub capturing user actions and rebroadcasting them to other players.
Posted: Wed Oct 17, 2007 9:53 am
by Josh1billion
Some MMORPG servers do use MySQL databases to store all/most of their data. If you choose to use MySQL for yours, you should be able to browse your database with phpMyAdmin.
For running applications on your managed hosting server, you should take a look at CGI*. You know the "cgi-bin" folder typically found in your hosting account? That's where you would put the applications, but they'd of course need to be built for the same OS as your server. Regardless of your client's OS, you'll probably want to have the server application compiled-for and run-on Linux.
*If you're going to be running a client-based online game, I wouldn't suggest running the application from your web server if you're going to be on managed hosting. Instead, set the (preferably Linux) machine up yourself, run the server application you wrote on it (which, if you follow my advice above, should be compiled for Linux, so it'll be a Linux binary, not Windows .exe). Then have MySQL/etc. on there if you're going to use that for the databases-- or, if you're going to use raw text files for the data, you can do that, too, and have PHP read those files through its normal reading functions.
To answer your question about whether your server will need DirectX.. if you're using DirectX for graphics/sound/input in the client, your server won't need any of that. If you're using DirectX for network routines (DirectPlay), I'm not sure (as I've never used DirectPlay before), but I'd be very surprised if there wasn't a way to receive the data on Linux without emulating the DirectX library itself.