Page 1 of 1

Web Programming - Java | PHP

Posted: Wed Sep 16, 2009 12:19 am
by Silicone_Milk
This is a question I'm hoping somebody such as misantropia would be able to answer.

I've recently became interested in web programming, more specifically, making games that run through the web browser.

Let's say the game is a turn-based mud (5 players per dungeon).. something relatively simple.

Would I be able to get away with using PHP and MySQL to handle delivery of content to players and even executing the game logic or would I be better off learning Java?

With Java, from what I understand, I'd be able to have the client code execute on the client's machine rather than on my server which is a huge plus for me. Another plus is the fact that it runs in a virtual machine so it *should* run the same regardless of browser architecture.

However, I'm being a lazy bastard and not wanting to learn Java (although that really wouldn't be a bad thing in the long run) but... I just don't want to do it right now.

The answer seems a bit obvious, and I really am leaning to biting the bullet and learning Java (shouldn't be overly difficult with C++ and C# under my belt) but is there any reason why maybe PHP might be the better path to take?

Thoughts? Suggestions?

Thanks :)

Re: Web Programming - Java | PHP

Posted: Wed Sep 16, 2009 9:26 am
by MKJ
not knowing how you envision the game to be, you could look into Ajax/PHP as an alternative.

Re: Web Programming - Java | PHP

Posted: Wed Sep 16, 2009 10:47 am
by ^misantropia^
Client-side Java code (in a browser) runs either as an applet or a Web Start application. Both are hardly used because it requires the user to have the Java runtime + browser plugin installed. It's fine for intranet applications, I suppose, but if you want to reach a broad audience, you're probably best off learning Flash and use Flash remoting to interact with the server. The server-side language doesn't really matter, pick whatever you are comfortable with. If you are going with PHP, be sure to check out Zend_Amf.

Re: Web Programming - Java | PHP

Posted: Thu Sep 17, 2009 12:22 am
by Silicone_Milk
Brilliant. Thanks for the response guys. I knew it was a good idea to double check with people more knowledable about this kind of stuff than I am.


I've investigated doing the game purely with PHP and Ajax but it looks like it would become an unmanagable mess of javascript, html, and xml in short order.

Flash with Zend_Amf looks very promising. It almost seems like it's exactly what I need for a simple 2D micro online roleplaying game. (max of 5 clients per "server" (virtual server within the physical server)).

I'm going to play around with this tonight after uninstalling Tomcat.

Re: Web Programming - Java | PHP

Posted: Fri Sep 18, 2009 11:15 pm
by Silicone_Milk
Doesn't seem like there's much support for flash development on linux.

I'm looking at Flash For Linux (f4l) but it seems like it's a discontinued project. The best bet appears to be running Macromedia Flash 8 through Wine but... that involves forking over some cash or putting on a peg leg and eye patch...

And if I'm going to go through all that trouble, I'd run Macromedia Flash on my Windows XP machine rather than bother running it through Wine...

Re: Web Programming - Java | PHP

Posted: Sat Sep 19, 2009 4:26 am
by Silicone_Milk
EDIT: Discovered that Python can be used in Apache via the mod_python module. Im going to have php deliver the goods to the client and build the guts of the game with python since I'm more experienced with that than php.

Installed the PHP plugins for Eclipse and finally fixed the bugginess and pisisness of the program by changing the permissions to 777 on the installation folder. Apparently only root could write to the files whlie my user account was only able to read the files so it was causing funkiness in the workspace.

On that note, I have never loved an IDE more than now after working years ago on content management systems armed with nothing more than notepad and now using Eclipse to work on the php files. The "intellisense" and syntax highlighting makes me a super happy camper.

Re: Web Programming - Java | PHP

Posted: Sun Sep 20, 2009 11:53 am
by ^misantropia^
If you want to go the experimental route (perhaps that is the wrong word for it; let's call it 'non-mainstream'), you could give haXe a spin. The benefit: you write all your code, be it server-side or client-side, in one language and have haXe compile it to PHP, Flash or Javascript. In benchmarks, it came out faster than Adobe's own AS3 compiler. =)

Re: Web Programming - Java | PHP

Posted: Sun Sep 20, 2009 9:14 pm
by Silicone_Milk
interesting.

I'm going to play around with that (not that I have a problem typing up php but working in a higher level language sounds nice to me)

The haXe language kind of reminds me of C# from what I've seen so far.

Thanks for that link :)

Re: Web Programming - Java | PHP

Posted: Wed Sep 23, 2009 3:59 pm
by Silicone_Milk
Was tinkering last night and have a basic php/mysql login/registration page up and running now. I need to figure out how to install applications on Debian and not have them be completly locked down (permissions-wise) and end up crashing/not starting due to their permissions.

Had to chmod PHP5 and PhpMyAdmin to eliminate run-time problems.

PHP isn't nearly as tedious to use as I had remembered it being though :owned:

Re: Web Programming - Java | PHP

Posted: Wed Sep 23, 2009 7:12 pm
by ^misantropia^
Why would you have to chmod anything? The web server only needs to read the files, not write them, right?

Re: Web Programming - Java | PHP

Posted: Wed Sep 23, 2009 8:39 pm
by Silicone_Milk
A good question indeed. I was wondering the exact same thing.

Re: Web Programming - Java | PHP

Posted: Wed Nov 24, 2010 8:36 pm
by bitWISE
He probably had to open up the config files. I'm pretty sure phpMyAdmin comes with a setup wizard now.