Advertisement

PHP or C++

Started by March 13, 2003 03:48 AM
6 comments, last by DroidZ 21 years, 8 months ago
I have played quite a few online word-based games and most are programmed with either php, cgi or visual basic. I havent seen any actually done with C++. Would C++ actually be better off then say PHP, and which is harder and more complex to learn, C++ or PHP?
you''re comparing apples with oranges here. php is interpreted language that''s designed and optimized for server-side web scripting. i imagine you could make a game with it, but since all php code is executed on the server, you''ll be hard pressed to have any kind of complicated interactive graphics (on every update, you''ll have to transfer the entire picture from the server over internet - bandwidth restrictions kick in).

with &#106avascript, you can have more interactivity on the client side. there''s a 5k wolf3d game written in &#106avascript somewhere &#111;n the net that proves the point.<br><br>c++ and vb are, &#111;n the other side, languages that produce standalone executables. most games use these or similar languages.<br><br>c and php have very similar syntax. php is simpler because it''s a scripting language, and thus doesn''t need i.e. pointers (security is also a factor here).
Advertisement
I think he means web-based games, in that case I would most probably use PHP, mostly because I''m not too sure of how to run an executable in apache. It''s possible though as PHP parses the .php files for C++ would be a lot faster though as it''s not interpreted. An idea: port it to C++ when you are starting to get a lot of users.
I have some experience developing PHP based web sites (not games mind you) and I think you would find a lot of frustration trying to do a game with PHP or C++ CGI program. I'm sure it can be done but I would recommend you use Java if you want to do a web based game. I don't have much experience with Java but since its client-side (running as a applet on a page) I would think you would have an easier time doing what you want to do.

Journal

[edited by - Garrland on March 13, 2003 9:07:34 AM]
Clientside stuff is never good for online things... memory editors...
unless you''re talking about games whose most output is text, or doesn''t change more than once every few seconds, you''ll be hard pressed to send it over the wire each time something happens.

i imagine you can implement a text mud in php, but it won''t be particularly suitable for real-time graphics anything.
Advertisement
Leffe, yes that is true to an extent. The key to any client/server game is security. There are ways to design a client so doesn''t make any decisions (as it should be) it just does that the server tells it to do. The only thing a client should tell the server is "I want to move foreward" or "I want to fire my weapon" and NOT "how fast I want to move" or "how much damage my weapon does". If designed properly then memory hacks should not be an issue. As for macro programs well, there isn''t really a way round them. You can decrease the impact of macro programs but you can''t eliminate them aside from looking for a known macro program running on the clients PC and killing the process.

Journal
I agree with niyaw, if you are doing a text based game with a server side solution it would work well. I bet you could even remake Oregon Trail. I really depends on what your goals are.

Journal

[edited by - Garrland on March 14, 2003 9:04:27 AM]

This topic is closed to new replies.

Advertisement