Sign in to follow this  
Fenryl

[web] php for games...

Recommended Posts

Most definately. In fact, many online web-based games use PHP primarily as its backend. I recently took a quick look through PHP Game Programming by Matt Rutledge and he has you design a lemonade stand multiplayer game at the end of the book. You could pick that one up. Hope it helps.

Share this post


Link to post
Share on other sites
ok thx! i was wondering a long time how i could make multiplayer games on web. is it also maybe posible to make massa multiplayer, and does it support 3D gfx ?

Share this post


Link to post
Share on other sites
Quote:
Original post by Fenryl
but is it possible to make a massa multiplayer game with 2D gfx and music with PHP?


No. As I said before, PHP is server-side but the things you want to achieve have to be done client-side.

[edit]Added the quote.

[Edited by - Pipo DeClown on May 29, 2005 3:20:22 AM]

Share this post


Link to post
Share on other sites
Absolutely possible to make games using PHP.

Because of how it's used (i.e. typically server-side), it generally lends itself to turn-based strategy / resource management games, played over the web.

These usually have only simple graphics (for instance, those created inside the web browser, or simple images created server-side). If you plan on doing something that uses realtime 2d or 3d graphics, I recommend that you use something else.

That doesn't mean you can't use PHP for other parts of your game.

Mark

Share this post


Link to post
Share on other sites
PHP is typically used for browser based games and things that can only be rendered with HTML. However like the above poster said, you can use PHP for other parts of your game. I've seen some pretty cool things done with people storing highscores and users in a MySQL database and then being able to have a PHP administrator so they can keep tabs on their game without nessisarily needing an administrative client.

Share this post


Link to post
Share on other sites
Yes, typically PHP can be used serverside for web based games, but I, if I wanted to, could download PHP and Pear, and use it to make client end games. No, I am not saying in the browser. I am saying on the user's computer, without the browser involed.

PHP is already being used for commandline applications, and with libraries like GTK, it may, depending on how people use it, also grow into a graphical app based langauge.

So no, you can do it on the client end... just it is a complete mess to setup, and makes distribution of games a little harder.

Share this post


Link to post
Share on other sites
You need to be more specific about what type of game you want to make.

You aren't going to get any high-performance graphics on the client-side unless you use something like .NET - and then it will rely on

- Client using Internet Explorer
- Client having the right .NET framework version
- Security settings on the client browser / firewalls etc, permitting that kind of app

Which to be quite honest, is not really a web application at all - you may as well use a fat-client application (i.e. just distribute the .exe)

---

You can use Java or Flash - with better client support - but the client still has to have the right versions of the libraries installed - and you won't have 3d acceleration (but still fast enough for some games).

Popcap.com use Java for most of their games, and ActiveX for some - I don't think they use hardware 3d for anything though.

The ActiveX games of course, need to be signed and trusted by the client. And are specific to Windows and IE.

Mark

Share this post


Link to post
Share on other sites
Quote:
Original post by markr
You can use Java or Flash - with better client support - but the client still has to have the right versions of the libraries installed - and you won't have 3d acceleration (but still fast enough for some games).


You can use Java with 3D hardware acceleration. This is the most likely the best way to do it. Just tell me, why the hell do you want to create a multiplayer game that depends on the browser??

Share this post


Link to post
Share on other sites
You can use 3d hardware in Java, BUT not from an Applet, and not on most peoples' machines without additional software. So you're back to square one.

With Flash you can use a HTTP network object of some sort, to make HTTP requests. But it's not ideal for realtime games, because of high latency.

We use it on some non-realtime games (like, really simple stuff). I'm not directly involved in it, so I don't know how it works exactly, but it sends a HTTP POST to a PHP script which processes & stores the results, and sends something back.

We only use it to store details like player name, score etc, not the actual game.

Mark

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I thought J3D's samples (for DirectX & OpenGL) had all their examples as an Applet and as an Application? It seems to work like that for me.

Share this post


Link to post
Share on other sites
@vNistelrooy: We need to know what exactly you have planned for a game before we can tell you what language is best suited for it.

If you plan for something like what Net Nexus Does, sure. You just need to decide between ASP, CGI or JSP for the framework. Than after that, choose the language you want to do, ASP/Jscript, ASP/VBscript, ASP/Perl, ASP/Python, CGI/Perl, CGI/Bash, CGI/Lisp, CGI/Python, CGI/PHP, CGI/Ruby, JSP/Java or JSP/Jython. (I suggest starting with CGI/PHP then moving to CGI/Python, but others are free to disagree--I'm not here to start a language war). If this is what you want, it is nolonger an MMO you plan to do, but what is known as a Browser Game.

If you plan to do something like Everquest using a web browser... forget it.

edit: sorry, a forum that actually competantly accepts and interprets decent HTML code (and catches exploits) is still foriegn to me.

Share this post


Link to post
Share on other sites
lol, no i'm not gonna try making something like everquest...
i just want to know whats the best way to make an MMO that works from a webbrowser, I want to make a simple MMORPG first, it doesnt need nice 3D gfx, i'm happy with 2D. I was first thinking on Java

Share this post


Link to post
Share on other sites
A clear-cut answer does not exist. It depends fully on what game you want to make (and no, saying MMORPG isn't enough). You'll want to mix-and-match to get the best out of each part. Probabely Java or Flash for the front-end, PHP/Perl/Python for the backend. Probabely a database (MySQL? Postgress?) sitting there as well and possibly even shell scripts.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this