Java Game Development


Broadband is coming to a computer near you and with it sites are developing new interactive elements. Some sites are developing in Shockwave, but if you want to make sure you can deploy reliably to all users there is no substitute for client-side Java. At Discovery Channel Online, I create interactive games and infograpics to enhance our online programming. These interactive elements and stunning graphics are what sets Discovery Online apart from a typical web site. Discovery's programming lends itself to investigation and to simulations on the web. Allowing users to immerse themselves in a simulation leads to greater understanding and provides an experience that can't be duplicated on TV. With the advent of broadband Discovery will be able to combine its unique video assets with its online content to produce a much richer online experience.

Java and the web are not a good medium for "twitch" games. I tend to focus on interface and playability as the most important elements. Interfaces need to be simple enough to invite play, experimentation and learning. I generally produce two kinds of experiences; infographics and full-blown games. Infographics are animated interactive experiences that help to expand on the text surrounding it. An example would be our Humpbacks of Madagascar story. This simple rollover helps to explain the anatomy of whales. The interactives that are most effective are the full-blown games. The most recent game is a drag and drop interactive where the user drags dinosaur bones into place and rebuilds a full animal from bones. Once completed the animal is shown as it appeared in life. Another completion game was in a story on Antartica where the user attempted to recreate the Antarctic food chain. The most popular game I have produced at Discovery was allowing the user to build their own rollercoaster.

The secret to building games on the web is using rapid development tools. While I could build these games from scratch it would be time and cost prohibitive. Thus, I create in two different environments.

My favorite rapid development tool is mBed Interactor. For developers used to working in Macromedia Director this tool will come very naturally. It deals in sprites and has a Lingo-like scripting language. It even has timelines, though this is not as central to Interactor as it is to Director. I use Interactor for creation of games that require animation and drag and drop game play. Interactor maintains an external data file and media so that updating is quite easy. The external data file closely resembles XML and can be generated on the fly using CGI programs or ASP pages. The largest drawback is its lack of mathematical calculation. This can be overcome by its integration with Javascript. I often pass complex calculations back and forth between the game and Javascript. Interactor uses already compiled classes and is rock stable under Java 1.0.2.

A second tool I use for less interactive games is Sun's Java Studio. This environment is better suited for more calculation intensify games such as "mind games" where the user tries to guess answers or has to engage in lots of text interaction. This GUI program allows the developer to quickly and visually connect Java beans to create games or other applications. IBM also posts new beans on a regular basis or if you feel like it, you can write your own beans to work in the development environment.

Performance can be a big issue with online Java games. Older browsers such as Netscape 3.0 can only work with 8-bit graphics. If you include more colors the JVM must dither the graphics to 8-bit before working with them. This destroys performance. These two rapid development environments produce games that work well on Pentium 150s or faster. The Java classes are somewhere around 100K for Interactor and somewhat less for Java Studio. Until Broadband becomes a reality these downloads will allow all users to enjoy interactive games without plug-ins.

Jeff Rule is a principal at RuleWeb Development specializing in Interactive TV, Broadband Web Development, DHTML, SMIL, and Java-based games. His first book, Dynamic HTML: The HTML Developer's Guide was published in January 1999 by Addison Wesley Longman.