• Advertisement
Sign in to follow this  

Web game - what language?

This topic is 2352 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
I'm kind of suprised by Javascript, it looks like decent programming language and I don't need to have installed anything to run the aplication in a browser, which is big plus.(correct me if I'm wrong)

Thanks for help guys.

Share this post


Link to post
Share on other sites

I'm kind of suprised by Javascript, it looks like decent programming language and I don't need to have installed anything to run the aplication in a browser, which is big plus.(correct me if I'm wrong)

Thanks for help guys.


No you don't have to install anything because it's interpreted by the browser, but it runs in the client side so you should use it only to show stuff, never to control the game in order to avoid easy cheating. I would recommend PHP with javascript to upload what you see every 2 or 3 seconds without having to refresh the page, but having the javascript code doing it for you.

Share this post


Link to post
Share on other sites

[quote name='MrProper' timestamp='1315602917' post='4859753']
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.
[/quote]

>>Plays DOFUS since 2006 and loves you for posting about it <3

Share this post


Link to post
Share on other sites
For now I think Flash+JavaScript is the best choice for client.
See how many successful social games in Flash, and use JavaScript to call platform API.

But I think HTML5 worth your time to start learning.

Share this post


Link to post
Share on other sites
I would definitely say, go with whatever your team has experience with.

You definitely do not want to go straight into a major game with a tech that your team is not familiar with.

Of course the game logic for such a game MUST be on the server-side (to prevent cheats etc), so bear that in mind. This is pretty obvious really.

Consider whether you are going to use server-push or polling to send the info to connected clients. Server-push is more difficult to implement on some platforms (e.g. with Javascript it is not necessarily easy if you don't have (for instance) Websockets).

Share this post


Link to post
Share on other sites

I would definitely say, go with whatever your team has experience with.

You definitely do not want to go straight into a major game with a tech that your team is not familiar with.

Of course the game logic for such a game MUST be on the server-side (to prevent cheats etc), so bear that in mind. This is pretty obvious really.

Consider whether you are going to use server-push or polling to send the info to connected clients. Server-push is more difficult to implement on some platforms (e.g. with Javascript it is not necessarily easy if you don't have (for instance) Websockets).


I've actually already created most of the game in java, but I found out that java might not be best fit fot this game.

I've never programmed in Javascript before, but so far it looks like it won't be any issue. Yes, I'm bit naive. lol

Share this post


Link to post
Share on other sites

Of course the game logic for such a game MUST be on the server-side (to prevent cheats etc), so bear that in mind. This is pretty obvious really.


Why would it have to be on the server side? Is there a way for people to edit javascript as its being sent to their browser via port 80 or 8080?

Maybe you are talking about predownloaded packages or something. If there is some hax way for people to edit live javascript code I'd like to hear about it.

Share this post


Link to post
Share on other sites

[quote name='markr' timestamp='1315815488' post='4860591']
Of course the game logic for such a game MUST be on the server-side (to prevent cheats etc), so bear that in mind. This is pretty obvious really.


Why would it have to be on the server side? Is there a way for people to edit javascript as its being sent to their browser via port 80 or 8080?

Maybe you are talking about predownloaded packages or something. If there is some hax way for people to edit live javascript code I'd like to hear about it.
[/quote]


Google: "edit javascript" ...

Basically the rule goes, anything you don't want modified without your permission should be server side. So if you don't want the player to be able to cheat, have the code that handles that function be server side. ... or implement server side checks.

-pickle

Share this post


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

  • Advertisement