Skip to main content
gamedev.net
🔒 Locked

Browser game techniques

Started by Codedummie 11 replies 1.4k views
Original Post
Codedummie
Codedummie
Hi, I want to write a browser game. At first I want to sort out the techniques that are available to integrate a game to the browser. What techniques do you know (like JavaApplet or Flash) and what are your opinions on them? Thanks in advance
bobbias
bobbias
I'd suggest Flash, since it's well known, has good graphic capabilities, and on a while doesn't take too much to load. But of course, I've tried messing with the language, and HATED it with a passion. (I tried to make a button go to the next frame, the problem was it didn't stop after only 1 frame...) and it was generally a pain in the ass to learn that code. javascript should NOT be used, but that's just my opinion (I really hate it, and Flash is more flexable and portable)
Kelly G
Kelly G
Java is free. Flash costs $500. I'd use java, especially if you already know java or C++. Java and javascript are not the same thing, by the way.
psae0001
psae0001
Well, if you just start I think Java is probably easier.

But remember, IT IS NOT WRITE ONCE RUNS EVERYWHERE ! :p
PaulCesar
PaulCesar
Actualy, for the most part java should be.. provided their VMs are up to date. Im not going to lie and say particular optimizations will work the same, but with proper coding practices it should be fine. I should say, in the context of game development, without non-java based extensions, that cross platform is easily obtained.
markr
markr
The other options which people haven't suggested:

- Use server-side code, (typically, in ASP, ASP.NET, PHP, Java, Perl, Python etc), and have all the game logic on the server, using the browser as an interface only. This approach has been succeesfully used by many web games.
- Use client-side javascript to form a major part of the game - this technique has been used somewhat.<br><br>Both of these options are suitable for games which don't need fancy moving graphics. They lend themselves to nice complicated user interfaces which would be harder to make with f.e. Java.<br><br>The advantage is that neither of these approaches requires any plugins or downloads in order to make them work, hence it's ideal for the "casual" gamer, even in office or corporate environments where Java, Flash etc are sometimes restricted.<br><br>Mark
jbadams
jbadams
Quote:
Original post by bobbias
javascript should NOT be used, but that's just my opinion (I really hate it, and Flash is more flexable and portable)<!--QUOTE--></td></tr></table></BLOCKQUOTE><!--/QUOTE--><!--ENDQUOTE--><br>javascript is <i>not</i> Java, and definately isn't suitable for producing a game.<br><br>Serverside languages are great for turn-based games. If you want any kind of realtime display or the like you'll probably want to consider Java or Flash.<br><br>Flash is very good if you've got the money to spend. Unlike bobbias, I found ActionScript (Flash's scripting language) pretty easy to use, and as long as you're happy with vector graphics or can premake your graphics with another package you can make some very good things. It can also do some very nice interfaces and the like, and a lot of people are used to flash games by now.<br><br>Java as mentioned is free, which is always a plus. Sometimes it can be a little slow, although it's not all that bad these days, but there can be the occasional problems arising from people not having the latest VM if you aren't careful about what features you make use of.<br><br><!--QUOTE--><BLOCKQUOTE><span class="smallfont">Quote:</span><table border=0 cellpadding=4 cellspacing=0 width="95%"><tr><td class=quote><!--/QUOTE--><!--STARTQUOTE--><i>Original post by markr</i><br>- Use client-side javascript to form a major part of the game - this technique has been used somewhat.<!--QUOTE--></td></tr></table></BLOCKQUOTE><!--/QUOTE--><!--ENDQUOTE--><br>Although that's a viable option, a complete game implemented using javascript isn't really a good idea. I'd personally advise keeping it to provide small pieces of functionality if anything.
- Jason Astle-Adams
markr
markr
Quote:
Original post by Kazgoroth
javascript is not Java, and definately isn't suitable for producing a game.


I think it is (suitable for producing a game).

True, you can't really do realtime graphics terribly well in client-side javascript, but you can still use it to make a game if that is not a requirement.<br><br><!--QUOTE--><BLOCKQUOTE><span class="smallfont">Quote:</span><table border=0 cellpadding=4 cellspacing=0 width="95%"><tr><td class=quote><!--/QUOTE--><!--STARTQUOTE--><br>Although that's a viable option, a complete game implemented using javascript isn't really a good idea. <!--QUOTE--></td></tr></table></BLOCKQUOTE><!--/QUOTE--><!--ENDQUOTE--><br><br>I totally fail to see why, however.<br><br>It's certainly possible to create quite a lot of functionality in javascript. Browsers support scrolling, which is helpful for those large tile-maps.<br><br>The only point at which I struggle is having server-push for multiplayer games (this *IS* available in Mozilla, but not other browsers).<br><br>Mark<br><br>
jbadams
jbadams
Well, it tends to load/run somewhat slowly, as you'll see if you load some work by Benryves for example. However, with broadband becoming much more prevalent and computers having a lot more memory available I suppose it's not really the problem that it used to be, as demonstrated by my own example; that loaded in well under a second for me.

So yeah, now that I consider it you're right really, apart from multiplayer it is indeed a viable option these days. I'd suggest being sure to get yourself something to aid in debugging however if you wanted to try it.
- Jason Astle-Adams
Fnord
Fnord
I strongly suggest Flash. It's really easy to use, and you can do almost anything with it. If you want a button to move you to the next frame and STOP, you need to call goToAndStop! Don't forget to STOP, lol. Once you figure out what you're doing with actionscript, it's really easy to make games. Flash player version 8 has lots of neat blending options too, and they look really nice. You probably wouldn't want to do something 3D in Flash, but most 2D games are suitable. If you want some tutorials, try http://www.gotoandplay.it , or if you want a great book to walk you through the learning process, pick up a copy of "Macromedia Flash MX 2004 Game Programming" by Craig S. Murray and Justin Everett-Church (ISBN 1-59200-036-3). javascript could be used also. I have seen many nice little games that used javascript. You could even use dhtml. If you're really tricky, you could even make some little puzzles with some CSS, but it would have to be pretty basic.<br><br>Fnord!
ProgramMax
ProgramMax
No one has suggested ActiveX components yet. Maybe because they aren't portable. Nevertheless you get a ton of speed, can use a ton of languages, etc.

Are there security restrictions on ActiveX components?
kaelari
kaelari
It depends entirely on what you want to do. you could make a game in straight html. it just wouldn't be very complicated. i.e. you could have an imagemap and if you click the right place on the image you go to a page that says "you found me" or some such.
If your looking for more arcade/action type games flash works well, there are lots of game sites that use this option. I don't use flash myself so i don't know how good it is really.
Or you can use some form of server side system that just uses the browser as an interface. my games all do that(well my browser based ones anyways). I use perl/cgi with a mysql database. it works fairly well. but you are somewhat limited in what you can do in terms of action. but for a strategy game it's great, no downloads. everyone already has a browser. and it's not hard to make it compatible with everything.
If your intrested in the third route i have games on my site that are open source and could make a good base atleast to get an idea of how to do things.
Codedummie
Codedummie
Thanks for your comments so far. I want to develop a full featured game (no server-side techniques) and can program already in C/C++/Java or whatever. I'm basically interested in the integrating aspect. So that would make the list as now Flash (Actionscript), JavaApplet, ActiveX and browser plugin. Does anyone know another one?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.