Web game development with source control and unit tests?
February 21, 2010 1:17 PM   Subscribe

What software development technologies (languages and plugins) exist for writing real-time games that can run inside web browsers? Bonus points for 1) playing well with source control, 2) being amenable to unit tests, and 3) having dev tools that run on both Windows and OS X.

I (running Windows) like to write video games in my free time with a friend (running OS X). This has been a lot of fun, but we're kind of tired of pushing executable files to our friends when we update our games with new features, and our friends are tired of downloading executable files before running the games. So we're hoping to start writing games that can run in the browser. We'd also really like to be able to run automated unit tests against our code and use source control (we currently use and like git hosted on GitHub).

There are some options for developing and deploying web games that I'm already aware of, but have some problems that make me rather not use them.
  1. Actionscript running on the Flash plugin
  2. C#, javascript, or Boo running on the Unity plugin
  3. javascript manipulating SVG or Canvas elements
Options 1 and 2, to the best of my knowledge, have binary bits to their project files that make them not play well with source control. Option 3, again to the best of my limited knowledge, will not be fast enough for action games except on Chrome, and I can't really expect everyone to use Chrome.

Are there other options out there? Are there compelling reasons for me to accept one of the options I've already listed, or perhaps could I have been misinformed regarding their drawbacks?

We would like to keep using git and GitHub, and ideally be able to unit test our code, but if these are just not possible in this newfangled web world, then so be it.
posted by a snickering nuthatch to Computers & Internet (12 answers total) 2 users marked this as a favorite
 
I code in ActionScript, 100% in notepad. Any standard source versioning/control software will work as well as any other for this. I think a lot of folks assume all AS3 must be written inside the timeline, which is not true.

If I need to import graphics libraries, I use SWC files (as compiled from a standalone FLA); well, graphical assets are going to be binary no matter what you use.

I don't have experience with other languages, but I do what you're asking with mine. :) Check out:

FlashDevelop (open source, free dev environment)
Flex SDK (open source, free, Adobe-built compiler)
posted by weasel at 1:54 PM on February 21, 2010


(with some easy scripting and root control on a server, you can also recompile the resulting .SWF from your browser and not need to FTP compiled products around, too)
posted by weasel at 1:56 PM on February 21, 2010


Best answer: I don't have experience developing games, but what about Java? I think Java Web Start will let anyone start your game from within any browser, as long as they have Java installed.
posted by gorillawarfare at 2:02 PM on February 21, 2010 [1 favorite]


I was coming in here to suggest Java as well. Obviously it doesn't work where no JVM is installed, but I that's easily rectified (installing a JVM isn't any different from installing flash, really). You can write your games as applets or as gorillawarfare suggests, as applications run over JWS. And of course you can unit test java.
posted by axiom at 2:15 PM on February 21, 2010 [1 favorite]


Chrome is faster then firefox but not by all that much. For example this DOOM style game runs fine in Firefox. I get like 25-35 FPS in 'large' mode in Firefox and about 42-48 FPS in chrome.

So most modern browsers will be able to handle decent game play with Javascript and Chrome. And your game will even work on mobile phones that don't feature flash support.
posted by delmoi at 2:39 PM on February 21, 2010


Best answer: Java is the language you're looking for. It's very widely used with source control, nearly universal, and specifically designed to run on anything. It's a bytecode-compiled language, and massively faster than JavaScript.
posted by Xezlec at 3:41 PM on February 21, 2010 [1 favorite]


Seasoned Flash developer here. If you want total separation of art and code with Flash, it's really easy to do that sort of thing. Flex makes it even easier in a lot of ways, plus if you stick with the command-line tools, it's essentially free. (Download the trial of Flex Builder, it comes with mxmlc, which is the command line compiler. Flex Builder itself will expire, but mxmlc won't.)

The best thing about Flash is not having to write your own display, sound or animation libraries, leaving you pretty free to concentrate on gameplay.
posted by fnerg at 3:43 PM on February 21, 2010


If your games use graphics, you're going to have binaries in source control... unless of course you want to write code to draw every visual element, which I'm assuming you don't. If you code in an FLA, you're going to be checking that in and out, which sucks. But if you put your graphics in a library (as mentioned above), you don't touch it again unless you need to change the graphics. You only touch the code.

Java is fast but between it, Flash and SL, I think it mostly depends on where your skills are. They're all good.
posted by klanawa at 4:25 PM on February 21, 2010


Response by poster: Thanks for all the answers!

delmoi- your link seems to be broken. Could you repost it?

To clarify, the issue with binaries is not just "binaries in source control". The issue is "binary project files in source control".

Think of it this way. If your choice of language, IDE, and deployment target involves project files (files that specify which other files or assets are involved in the compilation of the project), those files are likely to be edited a lot by different people, and therefore committed a lot by different people, and therefore require merging a lot. They get touched every time someone adds any new files used in compilation. This is not the case with media files- any given media file is not going to be under heavy contention, and if there is a conflict, it will be resolved with "use my version" or "use their version".

So, yes, almost any game development is going to involve checking binaries in, but not all game development requires checking binary project files in.
posted by a snickering nuthatch at 6:36 PM on February 21, 2010


Just something to add, and another pro for Flex - no binary project files. Just XML (MXML technically.) and plain-text .as files, unless you want to use Flash for vector art, but then, that's the same issue you'll face with any art.
posted by fnerg at 12:19 PM on February 22, 2010


FlashDevelop does have a project file, but it only contains a bit of configuration information; how wide and tall the game is, what color the background should be, what folder your optional libraries are in, etc.. it hasn't been touched since I first started my current project. I wouldn't worry about it, and that's using a project platform.

My last project was entirely editing .AS files in notepad, with no central control file whatsoever. It might make things a smidgen easier on your source file handling, but in the end it's probably in your best interest to use something a bit more complex than notepad.exe.

I'd honestly be more concerned with the constant checking-in-and-out of your Main Loop file, whatever that will be. I always seem to be making edits there, though that could be my programming style. :)
posted by weasel at 12:46 AM on February 23, 2010


delmoi- your link seems to be broken. Could you repost it?

Oops, here you go. I actually tried it out on my G1 and it worked, but the there was no way to trigger the direction keys :P
posted by delmoi at 7:50 PM on February 24, 2010


« Older Programming/Logic for a 6-year-old?   |   UK SciFI and Comedy TV recommendations Newer »
This thread is closed to new comments.