FUTURE


vrml | games | consumer devices |

Last updated: April 1998

Java's Write-Once-Run-Anywhere philosophy gives new life to an old dream. Visionaries imagine a time when it will possible to write code without ever thinking of the underlying hardware, which will lead to a world of virtual objects mapped onto real-life devices - smartcards, set-tops, toasters, potentially even cars and factory machines. Furthermore objects may be represented graphically using 3D rendering techniques, and it is already possible for people to interact with virtual worlds using VRML-enabled browsers. The coming xDSL bandwidth will make it easier for people to interact with these distant 3D worlds; and with fast Java chips and JIT compilers it will be possible for action computer games to be played as smoothly over the Internet as if they were on the user's PC.




vrml

The VRML (Virtual Reality Modelling Language) Standard was derived from SGI's Open Inventor Standard and has been heavily influenced by SGI and Sony ever since the first draft of the specification was made in late 1994. VRML 1.0, specified in 1995, allowed the user to do little to move around a virtual world and click on objects to go to URLs. In 1996 VRML 2.0 added interactivity by attaching scripts to objects. The current version is VRML97.

A VRML world's description is called a scene graph and it is written in a file with the .wrl extension. Objects are called nodes, their attributes are called fields, and activities are called behaviors. Nodes are arranged hierachically - e.g. Finger is subordinate to Hand which is subordinate to Arm. There are two types of nodes: sensor nodes, which initiate events when the user interacts with the environment, and interpolation nodes, which change gradually over time - e.g. a door swinging shut. The fields (attributes) of a node have different degrees of accessibility, similar to the way Java data can be public, protected, or private. Fields in different nodes can influence each other once a connection is established with the ROUTE command. Events are scripted inside Script nodes using VRMLscript.

VRMLscript can be used to implement simple behaviors, but Java is necessary for more complex systems. VRML's node-field-behaviour model works well with Java's class structure. If an applet is included in a HTML file and a .wrl file containing a scene graph is embedded in the same document then a VRML-enabled browser like SGI's CosmoPlayer will be able to use the Java code in the virtual world of the VRML. The three key packages used for Java VRML coding are java.vrml, java.vrml.node, and java.vrml.field.

RESOURCES

The VRML Repository - a comprehensive list of links to VRML browsers, software development tools, and sounds, textures, and objects that can be used.

Specifications from the VRML Consortium

CosmoCode - Java IDE from SGI.




games

Central to games programming is the idea of Movable Object Blocks (MOBs) which can be moved around a scene. These are pictures which are loaded from files and controlled by a graphics engine written in a language such as C++ or Java. When these images are rendered they must not have any backgrounds of their own - fortunately when Java loads images it retains all transparency information so characters can be drawn cleanly against the game's own background. MOBs are typically stored in chains which can be linked lists of characters and objects.

Disadvantages to games programming in Java at the present time are:

  1. Games loaded over the net are constrained by bandwidth. One practise is to load a game level by level as needed.
  2. Java tends to render graphics slowly.
  3. With the JDK 1.0 and 1.1 there is poor support for sound. The programmer must rely either on the elementary java.applet.Audio class or the unsupported sun.audio.* classes.

    RESOURCES

    Gamelan's list of Java games

    Tutorial on Java games programming

    Atomic Spiders, one commercial maker of Java games




consumer devices

Java's simplicity and strong security model make it a good choice not just for general microcomputer programming but also for embedded systems - scaled down computer systems tailored to particular electronic devices. Sun Microelectronics and JavaSoft (both divisions of Sun Microsystems) have co-operated to create:

  1. Special chips optimized for Java. The core specification is called picoJava; an actual microprocessor called microJava adds I/O, memory, communications and control; and UltraJava is the advanced microprocessor including Sun's VIS (Visual Instruction Set) for graphics.
  2. A small operating system called JavaOS which can run the Java VM. A tiny version on an electronics device can work with less than a megabyte of memory. The full version for the JavaStation (Sun's NC) uses 8M. (Extra memory is needed to run Hot Java Views, the JavaStation environment).
  3. PersonalJava, a Java API and Application Environment for consumer devices.
Apart from the JavaStation what are the primary electronic devices that will use Java?
  1. As of writing (March 1998) cellphones with embedded Java have been demonstrated and are expected to be in production shortly.
  2. Set-tops (devices which allow the television viewing experience to be customized) are expected to follow cellphones closely. One configuration coming out of Sun's deals with TCI involves running PersonalJava on top of Windows CE, Microsoft's stripped-down OS.
  3. Smartcards - cards with embedded chips that hold financial information - may also use the Java VM. The prime example is Schlumberger's Cyberflex Java Smart Card. The Java security model is useful because it can isolate and run different applications - financial, network access, health care - on a single card, and only admit signed applications.
    Also, it is possible to write Java code to interface with an IBM 5948 card terminal which can be plugged into the serial port of a PC.
  4. Independent companies have written VMs for PDAs (Personal Digital Assistants).

RESOURCES

Java smart cards - a tutorial from JavaWorld December 1997

Java chips from Sun Microelectonics

The Java OS