Jump to content
  • Advertisement
Sign in to follow this  
MrProper

Web game - what language?

This topic is 2445 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Im trying to find out which language would be best for my game.

game is
- running in browser
- 2D graphics
- multiplayer
- turn based(board turn based)

I was thinking that PHP could be able to deal with it easily, but I'm no PHP programmer, so I have my doubts here.
Java could do this as well, but I don't think its ideal.

Are there any better options. Im kinda noob when it comes to web technologies.

Share this post


Link to post
Share on other sites
Advertisement
I would say "use flash!" right away. But I honestly havent made more than single player flash games, so I'm not able to talk about the viability of the multiplayer part of your question.

And php is a web language, I would be surprised if you could make a 2d game with it (really surprised, but someone can come here and surprise me, making me feel like an idiot, lmao)

Share this post


Link to post
Share on other sites
You are asking about the server side component of the game, right? For the client, you're pretty much going to have to be using Javascript.

I've never written any server side Java code for something like this, and have written a lot of PHP for similar uses, so my opinion is probably a bit biased. I would recommend PHP in this case.

PHP will provide a lot of things out of the box that you will need for this sort of thing, such as session handling, database connectivity (assuming you want to store user info or gameplay state snapshots), JSON parsing (very useful when communicating with Javascript in a browser) and tons of online resources.

Don't be worried about performance, PHP is more than suited for something like this.

Java could probably do this just as well, but I would at least suspect it would be more work to get it set up communicating with a Javascript client than PHP.

And php is a web language, I would be surprised if you could make a 2d game with it (really surprised, but someone can come here and surprise me, making me feel like an idiot, lmao) [/quote]

You'd be surprised. I don't think it's mainstream at all and probably not supported any more, but there was an OpenGL bindings extension for it PHP at least once. It wouldn't run in a browser of course, but you could launch the script as a standalone program. Other than that, you could use a console and a curses style library to do ASCII games.

Share this post


Link to post
Share on other sites
But as far as making a web game, with 2d graphics, wouldnt the first choice to use Flash? I mean, honest question, because this is one thing I thought was a given. Im a web developer, but I wouldnt even try to use asp.net to develop a 2d game for the web, but flash.

Share this post


Link to post
Share on other sites
I actually havent seen many multiplayer games in flash if any, but I'll consider this option as well.

I like PHP+Javascript option so far.

Share this post


Link to post
Share on other sites
I have already played several flash multiplayer games, including multiplayer bomberman and other stuff. So I have to say its possible, and as far as game making, flash is much more used and with more examples available that php would be.

Share this post


Link to post
Share on other sites
There's a huge array of options, no single choice is really best but here are options:

frontend:
-Java applet
-GWT (Java code compiled to javascript)
-javascript
-flash

backend:
-php
-java servlet
-ruby on rails
-google appengine (hosts java servlets/python/Go code. Also provides an easy to use interface with GWT)
-generic TCP/UDP server (coded in any plethora of languages, you'll need a java applet or flash to connect to it thought)

There's plenty of options/combinations and even more than I've listed. I've found (being a java programmer) that GWT is really easy to use without knowing a great deal of javascript (you still need to learn some as you go though). Originally I used appengine but google is changing the pricing model so I switched to PHP and everything has gone smoothly for me.

edit: on a side note, remember that HTML5, although not finalized, is supported well enough by latest versions of browsers for you to be able to use features of it like canvas, embedded SVG, audio, and video. Eventually there'll be full websocket support (probably not for a while) and you'll be able to use javascript to connect straight to a server.

Share this post


Link to post
Share on other sites
A quick google of "flash multiplayer tutorial" brought up lots of good stuff on the subject and the first link even has about turn based games. Also working in flash and actionscript is very fun!

Share this post


Link to post
Share on other sites

I actually havent seen many multiplayer games in flash if any, but I'll consider this option as well.

I like PHP+Javascript option so far.

Dofus is a good example of a professional flash mmo.

And of course a Java applet is a great option, the must example is Runescape.

Share this post


Link to post
Share on other sites
Client Side:
My current preference is JavaScript. I've also done projects in Flash, and it's viable as well.

Flash has to be compiled (which will require software -- I used the free command-line compiler from Adobe), while JavaScript will run "out of the box" in a modern browser.
Flash also depends on one company (Adobe) vs. several browser vendors for JavaScript (Mozilla, Google, Microsoft, Apple, Opera, etc.).

On the other hand, browsers still fall behind Flash when it comes to sound (in my opinion). Simple sound playback is manageable (but cumbersome) with HTML5, but you'll run into limitations and browser discrepancies quickly (unless something recently changed without my noticing).


Server Side:
Currently I'm in love with using Socket.io on top of Node.js to handle multiplayer browser games (using server-side JavaScript). These are relatively new technologies, and you could perhaps argue over how "battle-tested" they are, but I find them quite a joy.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!