JAVAgam Games Programming in Java 2003 23pgs
JAVAgam Games Programming in Java 2003 23pgs
Andrew Davison
Dept. of Computer Engineering
Prince of Songkla University
HatYai, Songkhla 90112
E-mail: [email protected]
Draft: 14th January 2003, #2
Abstract
This article looks at the advantages and disadvantages of using Java and Java 3D for
games programming. It assumes the reader is familiar with Java, but presents short
overviews of gaming, the low-level APIs OpenGL and DirectX, and Java 3D. No
programming examples are included here, although links to online code are supplied.
1. Background to Gaming
Giving a definition for computer game is problematic, due to the wide range of
game types. For example, the ArcadePod site (http://www.arcadePod.com) divides its
hundreds of Java games into more than ten categories: 3D games, multiplayer, action,
classic, indoor sports, board, outdoor sports, card, mind, casino, educational, and the
useful miscellaneous catch-all. This makes it difficult to pin down the typical
content of a game, and highlights the range of design and programming skills required
to create one.
Another problem with giving a definition is that game platforms vary enormously,
including PCs, dedicated game consoles (e.g. the Sony PlayStation 2), arcade
machines, web-based games, hand-held consoles (e.g. the Nintendo Gameboy),
interactive TV, set-top boxes (as supplied by some cable networks), cellular phones,
and PDAs.
1.1. Revenue
PCs and game consoles account for almost all the income from games about 1/3
from PCs (dominated by Windows), and most of the rest from three games consoles
(Sonys PlayStation 2, Microsofts Xbox, and Nintendos GameCube) [Veronis
Suhler Media 2000].
In October 2002, consulting firm Strategy Analytics
(http://www.strategyAnalytics.com) predicted game console shipments to top 41.9
million units in 2002, an increase of 84% over the 2001 level. The PlayStation 2 is
expected to account for 63% of sales, followed by the GameCube with 21% and the
Xbox with 16%. These numbers highlight the domination of the PlayStation 2 which
has accounted for 72% of global cumulative shipments, compared to 16% for the
GameCube and 12% for the Xbox.
NPDFunworld (http://www.npdfunworld.com/) reported that console game sales in
2002 rose by about 20% over the record US$9.4 billion in 2001. Individual game
sales are also increasing: Grand Theft Auto: Vice City from Take Two Interactive sold
an estimated 3 million copies in its first month of release. This game is likely to
become the best selling title of 2002, and of all time.
1.2. Console Hardware
Since consoles are so central to gaming, it is interesting to consider their capabilities.
The PlayStation 2 processor runs with a clock speed of 294 MHz, has 32Mb of RAM,
and a separate graphics chip that can render about 66 million polygons per second.
The small amount of RAM is an important constraint upon games wishing to use
Java.
The introduction of the Xbox changed the game rules (so to speak), with its Pentium
III, 64Mb RAM, a 8Gb hard disk, and the ability to render 150-200 million polygons
per second.
Sony and Microsoft have recently released network adapters for their consoles,
highlighting the growing importance of multiplayer games.
Future console designs (e.g. the PlayStation 3 and Xbox 2) will bring PCs and
consoles even closer, and further emphasize online gaming. The PlayStation 3 (slated
to appear at the end of 2004) may use a 3GHz processor, 512Mb RAM, a 120Gb hard
disk, and render 2 billion polygons per second. The Xbox 2 (due at the end of 2006)
may employ a Pentium 4, a clock speed of 1GHz, 1Gb RAM, a 160Gb hard disk, and
render 2-3 billion polygons per second.
1.3. High and Low Profile Games
Marner distinguishes between high profile and low profile games [Marner 2002].
A high profile game is endowed with massive development costs (perhaps US$5
million or more), a generous advertising budget, a large development staff, and a very
visible presence for game retailers and magazines. To recoup the enormous upfront
expenses, high profile games tend to utilise cutting-edge graphics (which require high
hardware performance), and tie-ins with other media such as movies or books.
A low profile game is aimed at a smaller market, and may be limited to a single
platform, or user community. It may have been developed by a single person (or small
group), and be advertised in specialized newsgroups and mailing lists, leading to a
substantial reduction in costs. Low profile games may have less polish, use less
state-of the-art graphics, and place more emphasis on game design and
characterization.
2. Java for Games
In this section, we identify reasons for using Java for games programming, and look at
some of the popular arguments against it.
We focus on the Java language and its standard libraries (i.e. those found in J2SE
1.4); Java 3D will be considered in later sections.
2.1. Why use Java for Games?
The advantages of programming with Java are well known: object orientation, crossplatform support, code reuse, ease of development, the availability of tools, reliability
and stability, good documentation, continuing support from Sun Microsystems, low
development costs, the ability to use legacy code (e.g. C, C++), and increased
programmer productivity.
The portability of Java is sometimes overstated games in particular often require
some tweaking to improve their performance on different OSes/machines, such as in
the scheduling of threads, data structure and/or algorithm design, or the choice of GUI
components. Also, if legacy code written in a different language is utilised then
portability is frequently compromised.
Productivity is an important advantage, although hard to quantify. An old study from
1998 suggested that software written in pure Java instead of C++ results in a 25%
overall time/cost saving, corresponding to an overall productivity increase of 30%
(the increase for the code phase alone is 65%) [Quinn and Christiansen 1998]. It is
likely that these figures are greater today since the capabilities of the J2SE have
improved (e.g. the libraries are larger, tool speed is better).
2.2. Ways of Using Java in Games
There are several approaches to writing games with Java:
Applets. Usually the applet is a client for a multiplayer game, and communicates
back to its home host where the game server is located. A drawback of applets is
their security features, which need to be adjusted by the user before an applet can
save files or communicate with different hosts.
Dirty Java applications. Dirty Java programs use a mix of Java and other
languages (typically C or C++) by employing JNI, network links, or the Java
Communications API [Kreimeier 1999]. This opens up Java to code which may be
better optimized for the underlying hardware/OS, but affects portability.
Java as a scripting engine. This is a variant of the dirty Java idea, where the
majority of the application is implemented in another language. For example, C++
may be used to write the graphics rendering engine, image loaders, and the user
interface for joysticks. Java is utilised for tasks that are hardware independent
and/or less performance-oriented, such as user input validation and the game
logic.
2.3. Misconceptions
There are several misconceptions about Java and gaming:
No one writes serious games in Java. This rests on the definition of serious,
which normally means commercial, high profile games. Of course, there are
thousands of low profile, freeware/shareware Java games out on the Web.
Sun Microsystems is not really interested in making Java suitable for the games
industry.
First some history: JDK 1.0 was released early in 1996, JDK 1.1 in early 1997, and
Java 2 (JDK 1.2) at the end of 1998. Back then, there was a lot of hype promoting
Java as a perfect way of programming networked, graphical programs (i.e. as applets),
and this is reflected in the very large number of freeware game applets dating from
1996-1998.
Unfortunately, the early versions of Java were very slow, leading to disappointing
game play. Also, many programmers ignored the overheads of downloading large
code, images, audio, etc. Applet security restrictions and weaknesses in Javas media
APIs (graphics, sounds, etc) were further problems. All of this contributed to a
general feeling that Java was a toy language.
Recent versions of Java are quite different: speed is much improved, and APIs crucial
to gaming, such as graphics and audio, are of a high quality. Also, there has been a
move away from the use of applets towards the downloading of client-side
applications. Java applications require less configuration, and once downloaded they
dont need to be downloaded again.
Javas backward compatibility allows the applets from 1996-8 to be executed, and
they will often run quicker than originally. However, its probably best to steer clear
of these Java dinosaurs, and look for more modern code.
There are many Web sites with Java games. The emphasis of the following list are on
applications/applets for playing:
ArcadePod.com, http://www.arcadepod.com/java/
Over 700 Java games, nicely categorized.
jars.com, http://www.jars.com
This is a general Java site, but contains many games.
Programmers looking for source code should start elsewhere, as detailed below:
FreshMeat.com, http://freshmeat.net/
Freshmeat maintains thousands of applications, most released under open source
licenses. The search facilities are excellent, and can be guided by supplying game
category terms. The results include rating, vitality, and popularity figures for each
piece of software. A recent search for Java games returned over 100 hits.
SourceForge, http://sourceforge.net/search/
SourceForge acts as a repository, and management tool, for software projects,
many with source code. A recent search for Java games returned over 250 hits.
However, many of the projects are at the planning stage, with some inactive for
long periods.
will find further speed-ups. The Hotspot technology has the unfortunate side-effect
that program execution is often slow at the beginning until the code has been analyzed
and compiled.
A final point about speed is knowing what to blame when a Java program runs slowly.
An increasingly large part of the graphics rendering of a game is handled by hardware
or software outside of Java. For example, Java 3D passes all of its rendering down to
OpenGL or DirectX which may emulate hardware capabilities, such as bump
mapping. Often the performance bottleneck in network games is the network. Dirty
Java code passes control to libraries/functions which are quite independent of Java.
Java uses a large amount of memory at runtime, for two main reasons: it loads the
JVM and associated libraries into memory (about 5-10 MB), and Java objects are
stored on the heap rather than the stack [Hutchinson 2000]. Memory requirement is a
serious issue when porting Java to consoles. For instance, the PlayStation 2 only has
32MB of RAM. It is being addressed in the Java Game Profile, described below,
which uses the Java Micro Edition, so called because its memory needs are more
suited to hand-held devices. A longer term solution is to simply wait the memory
specifications for the next generation of consoles are more than sufficient to cope with
Java. However, waiting 2-4 years makes poor commercially sense.
2.3.4. Sun Microsystems isnt interested in Java games
The games market isnt a traditional one for Sun, and it will probably never have the
depth of knowledge of a Sony, Sega, or Nintendo. However, the last few years have
shown its increasing commitment to gaming.
J2SE has strengthened its games support: version 1.4 introduced full-screen imaging
and page flipping using hardware. Faster I/O, memory mapping, and support for nonblock sockets are all useful, the latter especially so in client/server multiplayer games.
Version 1.3. introduced a timer API that can be employed in animation, and improved
graphics and audio support. Recent Java extension libraries, such as Java 3D, the Java
Media Framework (JMF), Java Sound, the Java Communications API, Jini, and JAXP
(Javas peer-to-peer API) all offer something to games programmers.
At the 2001 Game Developers Conference, Sun announced a collaboration with
several other companies, including Sega and Sony, to develop a Java gaming API
called the Java Game Profile [JSR 134 2001]. It will be targeted at two markets: highend game devices (using J2ME) and desktop machines (using J2SE).
The proposal lists several advantages of Java over other languages: its superior
reliability, reduced time-to-market on games, device independence, platform
scalability, the prevention of lock-in to a particular platform, and a broader target
market.
It names several media API that may be useful, including Java 3D, JMF and Java
Sound, and suggests the creation of some new ones: APIs for physics modeling,
animation, and game marshalling. Companies involved in the project include Math
Engine (http://www.mathengine.com/), who developed the Karma rigid body
dynamics API, and GameSpy (http://www.gamespy.net/) who offer toolkits that allow
players to utilise various multiplayer game servers.
The proposal does not say how these extensions will be crammed into a typical game
console, which may explain why there hasnt been much activity in the last year.
7
Currently, the Java Game Profile specification is due out in the second quarter of
2003.
Part of the initiative was the creation of the JavaGaming.org website
(http://www.javagaming.org), which has recently become more active, and offers
some good forums on games programming.
2.4. When should Java be used for Games Programming?
Java is suited for programming high profile, commercial games, but in conjunction
with C or C++ so that legacy code, such as a proprietary game engine, can be utilised.
It should also be remembered that well-written Java code is approaching the speeds of
C/C++.
A serious issue is when Java will be available on consoles. It seems likely that Java
will appear on the PlayStation in the near future.
Java is more than adequate for low profile games on PCs,, and a quick search through
the sites mentioned in section 2.3.2 will confirm its popularity.
Windows Application
Direct3D
Retained Mode
Direct3D Immediate Mode
Direct3D Hardware
Emulation Layer (HEL)
Direct3D Hardware
Abstraction Layer (HAL)
Hardware
Figure 1. Direct3D Architecture
DirectX Audio: for game soundtracks with 3D sound positioning and effects;
Direct Setup: aids the installation of the DirectX components necessary for the
game application.
Naturally, the Xbox supports DirectX, but a somewhat different version from DirectX
for PCs. Some of the main changes are: a simpler approach to object creation on
screen, the replacement of DirectInput by a specialized game pad interface, and a new
streaming API instead of DirectShow.
Java and DirectX. There is no technical reason why Java cannot utilise DirectX since
JNI enables Java to call any C or C++ function, and in fact this approach has been
used with Java 3D.
Microsoft offers Microsoft SDK for Java, but it is limited to an insubstantial version
of Java and to DirectX 3.0 (http://www.microsoft.com/java/sdk/).
3.2. OpenGL
OpenGL is a software API for writing 3D (and 2D) graphics applications across a
wide range of hardware and OSes (http://www.opengl.org/). It is a low-level API
based around a graphics pipeline for pixel and vertex manipulation, similar in spirit to
DirectX Graphics. It offers relatively few functions (about 200), avoiding high-level
3D commands for geometry and scene control, and has no support for windowing or
input. The API has evolved slowly around a core set of features, but it is possible for
extensions to be added, a common occurrence among graphic card vendors so that
card-specific capabilities can be accessed.
The OpenGL specification is managed by the OpenGL Architecture Review Board
(ARB) made up of many key industrial players in the 3D graphics market.
10
GL4Java has been the basis of several good games, including Arkanae, a role-playing
fantasy game (http://arkanae.tuxfamily.org/), and Java is Doomed, a first person
shooter closely related to DOOM (http://javaisdoomed.sourceforge.net). Both games
utilised game engines to simplify the coding tasks.
3.3. DirectX versus OpenGL
A head-to-head comparison of DirectX and OpenGL isnt really fair: DirectX is a set
of APIs for graphics, audio, multimedia, networking, and others, whereas OpenGL is
aimed solely at the graphics domain. Even if we restrict the comparison to DirectX
Graphics and OpenGL, we must still decide whether to limit OpenGL to its core
features or to permit vendor-specific extensions.
In most technical areas, DirectX Graphics and OpenGL are almost equivalent, since
both are based on the same graphics pipeline architecture, and there is a strong flow of
ideas between the two. DirectX Graphics is aimed more towards game development,
including such things as programmable vertex and pixel control, but these features are
available as extensions to OpenGL on some platforms.
The most significant differences between the two APIs are unrelated to their
functionality. OpenGL is ported to a wide range of platforms and OSes, while DirectX
is limited to PCs running Windows, and the Xbox. DirectX is controlled by Microsoft
alone, while the OpenGL ARB allows input from many partners, and successful
extensions by vendors may be moved to the core in future releases. There is an open
source implementation of the OpenGL API, released by SGI
(http://oss.sgi.com/projects/ogl-sample/). The source for DirectX is not available.
4. Java 3D
The Java 3D API provides a collection of high-level constructs for creating,
rendering, and manipulating a 3D scene graph composed of geometry, materials
lights, sounds, and so on. Java 3D is being developed by Sun Microsystems and
currently at v.1.3.1. There are two variants: one implemented on top of OpenGL, the
other above DirectX Graphics. The low-level API handles the native rendering at the
vertex and pixel levels, while the 3D scene, application logic, and scene interactions
are carried out by Java code. This dual approach encourages application portability,
hardware independence, and high-speed rendering. Intended application areas include
visualization, CAD/CAM, virtual reality, simulation, and gaming.
4.1. The Scene Graph
Java 3Ds scene graph is a directed acyclic graph (a DAG), so there is a parent-child
relationship between most of its nodes, and the graph contains no loops. It is possible
for nodes to be shared in a graph, typically node properties such as geometry.
A simplified scene graph for an office is shown in Figure 2. The office group contains
three nodes for a desk and two chairs. Each node has a shape and colour (node
components), and the shape for the two chairs are shared.
11
The choice of symbols in Figure 2 is not arbitrary. The symbols in Figure 3 are
office
chair
desk
brown
shape
black
chair
shape
blue
commonly used to draw Java 3D scene graphs; they are explained below.
In true object oriented style, all the
nodes in a scene graph inherit from
a SceneGraphObject class, but are
subclassed in different ways.
Node Relationships
Virtual
Universe
Parent Child
Locale
Reference
Group
Leaf
Node
Component
Other Nodes
12
4.2. HelloUniverse
The standard first example for Java 3D programmers is HelloUniverse (it appears in
chapter 1 of the Java 3D tutorial). The program displays a rotating coloured cube, as
in Figure 4.
Locale
BG
BG
TG
TG
VP
Shape3D
Behavior
Geometry
BranchGroup
Nodes
TransformGroup
Nodes
View
Canvas3D
View Platform
Appearance
ColorCube
Locale acts as the location in the virtual world where the scene subgraph is situated.
In many programs there is only need for a single Locale, but it is possible to have
many.
Below the Locale node there are always two subgraphs the left branch is the content
branch graph, holding program-specific content such as geometry, lighting, textures,
and the background. The content-branch graph differs significantly from one
application to another.
13
The right hand branch below Locale is the view branch graph and specifies the users
position, orientation, and perspective as they look into the virtual world from the
physical world (e.g. from in front of a monitor). The ViewPlatorm node specifies the
viewers position in the virtual world; the View node states how to turn what the
viewer sees into a physical world image (e.g. a 2D picture on the monitor). The
Canvas3D node is a Java GUI component that allows the 2D image to be placed
inside a Java application or applet.
The VirtualUniverse, Locale, and view branch graph often have the same structure
across different applications since most programs use a single Locale and view the
virtual world through a 2D image on a monitor. For these applications, the relevant
nodes can be created with the SimpleUniverse utility class, relieving the programmer
of a lot of graph construction work.
4.3. Java 3D Strengths
Java 3Ds scene graph makes programming much easier for novices (and even for
experienced programmers) because it emphasizes scene design rather than rendering,
by hiding the graphics pipeline. The scene graph naturally supports complex graphical
elements such as 3D geometries, lighting modes, picking, and collision detection. At
the Java 3D implementation level, the scene graph can be used to group shapes with
common properties, carry out view culling, occlusion culling, level of detail selection,
execution culling, and behaviour pruning all optimizations which must be coded
directly by the programmer in lower-level APIs. Java 3D utilises Javas
multithreading to carry out parallel graph traversal and rendering, both very useful
optimizations.
Java 3D is designed with performance in mind, which it achieves at the high-level by
scene graph optimizations, and at the low-level by being built on top of OpenGL or
DirectX.
Some programmer-specified scene graph optimizations are available through the use
of capability bits to state what operations can/cannot be carried out at run time (e.g.
prohibiting a shape from moving). Java 3D also permits the programmer to bypass the
scene graph, either totally by means of the immediate mode, or partially by using a
combination of immediate and retained modes (called mixed mode). Immediate mode
gives the programmer complete control over rendering and scene management, and is
similar in style to coding in DirectX Graphics and OpenGL.
Java 3Ds view model separates the virtual and physical worlds (through the
ViewPlatform and View nodes). This makes it straightforward to reconfigure an
application to utilise a range of output device, from a monitor, to stereo glasses, to
room-sized caves.
Virtual world behaviour is coded with Behaviour nodes in the scene graph, which are
triggered by events. Among other things, this offers a different style of animation,
instead of the usual update-redraw cycle, by employing multithreading to execute
behaviours as events occur.
The core Java 3D API package, javax.media.j3d, supports basic polygons and
triangles within a scene graph, while the com.sun.j3d packages add a range of utility
classes including SimpleUniverse, mouse and keyboard navigation behaviours, audio
device handling, and loaders for some 3D file formats.
14
Java 3Ds sound support is based on the Java Sound API and allows 2D and 3D audio
output, ambient and spatialized sound.
Geometry compression is possible, often reducing size by an order of magnitude.
When this is combined with Javas NIO and networking, it facilitates the ready
transfer of large quantities of data between applications such as multiplayer games.
Java 3D is integrated with Java and its other libraries. This brings the benefits of
object orientation (classes, inheritance, polymorphism), threads, exception handling,
and APIs such as JMF and JAI.
Java 3Ds reliance on Java and OpenGL/DirectX gives it a high degree of portability,
with related advantages such as reduced development time and cost.
4.4. Java 3D Weaknesses
Java 3Ds scene graph is often considered an unreasonable overhead, especially by
programmers with experience of OpenGL and DirectX. Although it does introduce
overheads, they should be judged against the optimizations which the scene graph
allows. These can be implemented in a low-level API by an experienced programmer,
but at what cost in time and maintainability? Also most large OpenGL and DirectX
applications need a data structure like a scene graph anyway, in order to manage code
complexity.
The high-level nature of the scene graph makes Java 3D code harder to tune for speed,
unlike OpenGL/DirectX. However, a programmer does have the option of moving to
the mixed or immediate modes of coding if absolutely necessary.
Similarly, the hiding of the low-level graphics API makes it harder for a programmer
to code around bugs in the APIs or the drivers.
Since Java 3D is available on top of OpenGL and DirectX, it is forced to offer a
common denominator of features from both APIs. For example, this is why vertex and
pixel shading is absent. However, Java 3D version 1.4 is scheduled to allow
extensions to its core features, in a similar vein to extensions in OpenGL.
Java 3D requires the installation of Java and a graphics API, which can easily amount
to 10-20MB on a hard disk. This is a serious concern when attempting to port Java 3D
to consoles, but a problem that will disappear in a few years as the next generation of
consoles appear.
The amount and diversity of software required for Java 3D makes it difficult to
automatically install everything along with the application. Sun Microsystems needs
to develop an API similar to DirectSetup to simplify this process. Currently a
developer must utilise software like InstallAnywhere (http://www.zerog.com/) or
JExpress (http://www.denova.com/).
It is interesting to examine how successful 3D multiplayer games, such as EverQuest
(http://everquest.station.sony.com/), handle installation issues. Most of the EverQuest
software comes on a large set of CDs, requiring as much as 1Gb of disk space. Also,
when a EverQuest client logins to a server, it may download additional player data.
This indicates the need for two forms of installation: CD-based for the majority of the
application (e.g. via InstallAnywhere) and network-based for updates, perhaps by
using Java Web Start (http://java.sun.com/products/javawebstart/).
15
16
performance;
console support;
the availability of existing Java 3D games.
6.1. Performance
Performance data on Java 3D is scarce only the Marner study has seriously
considered Java 3Ds performance against one of its rivals, OpenGL [Marner 2002].
At present, performance figures seem mostly based on hearsay. A common example
is to give DirectX 10/10, OpenGL 7.5/10, and Java 3D 3/10.
Java 3D performance is often equated with Java performance: the perceived slowness
of Java demonstrates the slowness of Java 3D. In fact, since Java 3D relies on
OpenGL or DirectX for rendering, much of the graphics processing speed of Java 3D
is independent of Java.
History suggests that performance will become a less important consideration as the
base speed of hardware keeps increasing. Even today, most low profile games rely
less on dazzling 3D special effects, more on gaming characterization and story. High
profile games will always need performance, but the real bottleneck will not be the
platform but the network, as multiplayer games begin to dominate.
Performance should be considered alongside issues such as code complexity,
productivity, maintainability, and portability. These criteria strongly influence a move
towards higher-level API, as typified by Java 3D.
6.2. Console Support
17
The lack of a console implementation for Java 3D is rather ironic considering Javas
write once run anywhere slogan. As mentioned earlier, the Java Game Profile [JSR
134 2001] may eventually address the problem on the Sony PlayStation 2 (or 3).
6.3. Existing Java 3D Games
The existence of games is important mainly for its psychological influence of
developers and players: commercially successful games, which are fun and exciting to
play, and implemented with Java 3D, would go a long way to persuading developers
to start using Java 3D, and reassure users that they are not riding around in a Model T
Ford.
It is true that Java 3D has been employed in many fewer gaming examples than
OpenGL or DirectX. Nevertheless there are several excellent high profile games and
many low profile examples.
High Profile Games
Java 3Ds main weakness, and a serious one, is the lack of a console version.
References
Doederlein, O.P. 2002. The Java Performance Report, November,
http://www.javalobby.org/
Hutchinson, R. , 2001. The Evolution of Performance on the Java Platform: A Panel
Discussion. JavaOne 2001. http://java.sun.com/javaone/javaone2001/pdfs/2647.pdf
Huebner, R. 2000. Postmortem of Nihilistic Softwares Vampire: the Masquerade
Redemption, Game Developer Magazine, July,
http://www.gamasutra.com/features/20000802/huebner_01.htm
Java Specification Requests (JSR) 134, 2001. Java Game Profile,
http://jcp.org/jsr/detail/134.jsp
Kreimeier, B, 1999. Dirty Java Using the Java Native Interface within Games,
Game Developer Magazine, July,
http://www.gamasutra.com/features/19990611/java_01.htm
Ladd, S.R. 2003. Linux Number Crunching: Benchmarking Compilers and
Languages for ia32, Coyote Gulch Productions, January,
http://www.coyotegulch.com/reviews/almabench.html
Marner, J. 2002. Evaluating Java for Game Development, Dept. of Computer
Science, Univ. of Copenhagen, Denmark, March,
http://www.rolemaker.dk/articles/evaljava/
Patrizio, A. 2000. Dreamcast Gets Java Jolt, Wired News,
http://www.wired.com/news/culture/0,1284,36810,00.html
Strategy Analytics. 2002. Games Console Sales To Hit 41.9m Units In 2002,
http://www.strategyanalytics.com/press/PR00023.htm, December
Upton, B. 2000. Postmortem: Read Storms Rainbow Six, Game Developer
Magazine, May, http://www.gamasutra.com/features/20000121/upton_01.htm
Veronis Suhler Media Merchant Bank, 2000. Entertainment Industry Segment
Performance, http://www.veronissuhler.com/filmed/segment.html
Quinn, E. and Christiansen, C. 1998. Java Technology Pays Positively, IDC
Bulletin, #W16212, May.
19
The source code for the Java 3D utility package com.sun.j3d.utils is available in the
file java3d-utils-src.jar, which is usually to be found in the Java SDK folder. The code
for geometry like Sphere and Cylinder, and behaviours like OrbitBehaviour and
MouseTranslate can be a useful source of ideas.
Java 3D API Jump-Start, Aaron E. Walsh, Doug Gehringer, Prentice Hall; ISBN:
0-1303-4076-6, 2001
The Walsh and Gehringer text is an excellent overview, using code snippets rather
than page after page of listings. This is a good book to read in conjunction with the
tutorial.
The Selman book is more advanced and has some very sophisticated examples. For
the games enthusiast, there is a DOOM-like 3D world using first-person perspective,
which covers keyboard navigation, world creation from a 2D map, including walls,
bookcases, pools of water, flaming torches, and animated guards.
A complete online version of the book was available for free at the Manning Web site
(http://www.manning.com/selman/), but has lately been replaced by an ebook version
which costs money. However, the full source code is still available, and two sample
chapters and errata.
A.4. Help and Advice
The Java3D interest mailing list is the best place to go for answers. It can be searched
from http://archives.java.sun.com/archives/java3d-interest.html; subscription is also
possible from that site. A searchable-only interface can be found at
http://www.mail-archive.com/[email protected]/
There is a newsgroup for Java 3D, comp.lang.java.3d, which can be conveniently
searched and mailed to from Googles Groups page http://groups.google.com/groups?
group=comp.lang.java.3d
The official source for all things Java 3D is Suns site
http://java.sun.com/products/java-media/3D/, which has links to demos, a basic FAQ,
and links to several interesting application sites such as the Virtual Fishtank.
The best independent Java 3D Web site is j3d.org (http://www.j3d.org), which is
actively maintained, has a great FAQ, and a growing collection of tutorials, utilities
and a code repository.
The JavaGaming.org site (http://www.javagaming.org) has some good discussion
forums.
21
A.5. Tools
Shareware and freeware tools that can help when programming Java and Java 3D.
EditPlus (http://www.editplus.com)
A text editor with syntax highlighting for a number of languages, including Java
and HTML. It can be configured to use the Java compiler and JVM.
Jad (http://kpdus.tripod.com/jad.html)
A decompiler for Java class files. A decompiler can help reveal the programming
techniques behind examples that come with no source code.
J-Sprint (http://www.j-sprint.com/)
A shareware Java profiler which can help detect slow spots in your code.
Fraps (http://www.fraps.com/)
A simple-to-use frame counter which can be used to measure the animation speed
of code.
ESS-Model (http://www.essmodel.com/)
A UML modeling tool which also extracts class diagrams from existing Java code.
This is a good way of getting an overview of other peoples programs.
ac3d (http://www.ac3d.org/)
A 3D model editor and viewer; useful for preparing content for Java 3D
applications.
JCreator (http://www.jcreator.com/)
A good, simple programming environment for Java, recommended by many Java
3D programmers. Details on how to set it up can be found in
http://www.j3d.org/faq/editors.html at j3d.org.
Micro Java Game Development, David Fox, et al. Addison Wesley Professional,
April 2002. ISBN: 0-6723-2342-7. Uses J2ME.
3D Games: Real-time Rendering and Software Technology, Alan Watt and Fabio
Policarpo, Vol. 1, Addison-Wesley, 2001.
22
Computer Graphics Principles and Practice, James Foley, Andries van Dam,
Steven Feiner, and John Hughes, Addison-Wesley, 1990, ISBN: 0-2018-4840-6.
OpenGL Game Programming, Kevin Hawkins and Dave Astle, Prima Pub., 2001,
ISBN: 0-7615-3330-3
The Zen of Direct3D Game Programming, Peter Walsh, Prima Pub., 2001, ISBN:
0-7615-3429-6.
23