One second and one hundred and fifty one milliseconds. That's the time
that it takes on a regular notebook to generate, build, and package a customized
variation of a simple Java 3-D game using a custom generator
based on SoProMach.
This article describes a lightweight, high-speed software production
process converting simple textual configuration parameters into
complete packages, each containing a complete mobile game. The sample
production process requires from the operator no programming skills.
Two recent articles on this website
introduced two other generators capable of producing
complete smartphone applications
(form editors in C++,
shopping lists in Java)
for the Series 60 Platform,
built on the Symbian OS, currently the leading smartphone
platform in the world.
The mobile game generator described in this article
builds 3-D maze-traversing games based on an example contained
in the Series 60 2nd Edition SDK for Symbian OS Supporting Feature
Pack 2 for MIDP.
Refer to appendix A of this article for detailed
information about the example.
By means of a textual configuration file defining four
parameters it is possible to produce 3-D maze games that differ
in look, size of the maze, and complexity of the maze structure.
A fifth parameter may also instruct the generator to compile,
package and run the generated application in the smartphone emulator,
thus allowing for an end-to-end serial production of the different
games.
The following pictures show some examples of
the configuration file and of the player's views
(front view, top view) in the generated games.
This configuration produces a maze with higher walls and less corridors
than the Starred Sky maze. This theme features a "Forget me
not" background and different wall and floor colors.
This configuration produces a maze with longer sides,
higher walls and more corridors
than the Starred Sky maze. The Get Out theme
features different floor and walls, and a beautiful sea landscape
(derived from a standard Windows 2000 wallpaper) surrounding the
maze. When exiting the maze the player gains
a complete view of the landscape.
The custom generator used for this article applies a
specified configuration at source-code level before compile time.
This is a different approach, compared to the most frequent approach
where applications configure themselves at run time, based on
external configuration files. What are the benefits of source-code
configuring?
The approach is language-independent: the same mechanism can be coherently applied for instance to C++ applications, thus providing a common configuration process across different application provision channels;
The application is simpler: less code is required, as the configuration logic can be exported to the production process; the application memory footprint and start-up time are also improved;
Specifically for Java mobile applications, a recent article on Sun Developer Network ("MIDP Application Properties") noted that application properties should always be defined consistently in the application descriptor and in the manifest, and recommended to not "stuff a lot of data in the descriptor, though, because some platforms limit the descriptor size". By pre-configuring the application before compile time the application properties can altogether be removed from both descriptor and manifest.
Note by the way that the two approaches may be used together.
The 3-D maze generator runs as a single command in a Windows 2000/XP
command window, and automatically builds, packages and starts the
produced application (if required in the configuration file). The picture
below shows the generator producing the Get Out maze.
As mentioned earlier in the article, the generator requires
less than one and a half second to generate the source code,
compile it, and produce a complete JAD (Java
Application Descriptor) file and the corresponding JAR file.
The reference development environment for this article is the
Series 60 2nd Edition SDK for Symbian OS Supporting Feature Pack 2 for MIDP.
Within the J2ME (Java 2 Mobile Edition) context,
MIDP stands for Mobile Information Device Profile: see
java.sun.com/products/midp for more information.
The Series 60 MIDP SDK is available
after registration on www.forum.nokia.com. It contains
several example applications, one of which is the 3-D Maze Example
used for the custom-made generator described in this article.
Quoting from the description of the example application in the
Series 60 MIDP SDK documentation, "This example application
demonstrates how to use Mobile 3-D Graphics API. The game
developed in this example is a maze-traversing game, where
the player looks at the world from a first-person point
of view. The game is intended as a demonstration to show
some of the features included in M3G API".
The following picture, also taken from the SDK documentation, shows
the Class Diagram of the application.