|
| Microforum, a Canadian-based mobile games developer and publisher, outline some of the issues they faced when developing their Mobile Java 3D game Rodent Panic. They explain how they used Sony Ericsson Developer World J2ME resources and share five things to keep in mind when starting to develop a Mobile Java 3D game. |
 |
Mobile Java 3D opportunities
When the first Java 3D enabled-mobile phones came to market Microforum were amazed with the range of possibilities that opened up before them. Finally they could develop immersive environments without having to fall back on 2D projections such as isometric to simulate 3D depth, or non-real 3D engines.
However, Microforum also saw two key problems: not all mobile devices yet support Mobile Java 3D and creating a 3D game involves a different graphical approach, as you need to create 3D models and textures, instead of typically using pixel-arted animation frames.
|
"Things get even worse because of the lack of support from most handset manufacturers, who seem to be scared of releasing Mobile Java 3D-compliant phones, and when they do, they usually provide very incomplete specifications of their devices," observed Giovanni Simotti, Lead 3D Programmer at Microforum. "Sony Ericsson, on the other hand, has effectively taken the lead by massively supporting Mobile Java 3D, even on mid-priced phones, both using Mascot Capsule v3 and JSR 184, and releases complete and in-depth specifications," Giovanni Simotti continued.
"Browsing the Sony Ericsson Developer World web portal, we found very useful and complete technical documentation - it reminds me of the kind of extensive support and documentation that video chipset manufacturers provide for developers." |

Giovanni Simotti, Lead 3D Programmer at Microforum. | Developing Rodent Panic
About Rodent Panic
|
With their maze game Rodent Panic, Microforum created a Mobile Java 3D game that was both impressive and easy to pick up and play.
Microforum felt that many existing maze games give a "claustrophobic" game-play feel, with players trying to strictly measure each step to avoid falling between platforms. With Rodent Panic, the player finds spacious gaming levels that must be run through at high speed. The player controls a transparent ball with a squirrel inside, and as the squirrel runs, the ball rolls and moves accordingly. As the player quickly moves and turns the ball, the screen tilts and rolls, giving the player of Rodent Panic a sense of speed and freedom. The player does not have to learn difficult input setups as everything can be controlled by simply using the phone joystick, with no need for additional keys. |
 |
"The sense of speed is further enhanced by the special 'rotate screen' option to enable a landscape view: the player rotates the phone and plays Rodent Panic using a familiar horizontal screen, even on phones that don't directly support it," explained Giovanni Simotti.
Considering frame rate
| Rodent Panic was constructed with frame rate in mind as the ball rolls fast, so it's very important to get a good sense of speed.
For example, the maze's mesh uses m3g files just for special items, like the "Start" and "Goal" signs. The rest of the level is built generating the mesh files "on-the-fly", according to the power of the mobile device. This allows both less space inside the JAR file and better scalability on less powerful mobile phones. The screen shot to the right and the code snippet below illustrate this general programming strategy. |

Mesh objects generated "on-the-fly" to improve the frame rate. |
int i, j, n=0; Group maze; Mesh m, mesh[200];
// Generate the standard floor (using a simple mono mesh) if(LowDetailMaze){ mesh[n]=CreateMaze_CreateMainSimpleFloor(); m=mesh[n]; maze.addChild(m); n++; } else{ // Generate the full complex floor with borders for(i=0; i<map.x_size; i++){ for(j=0; j<map.y_size; j++){ Cx.mesh[n]=CreateMaze_CreateComplexFloorBlock(i, j); m=Cx.mesh[n]; maze.addChild(m); n++; } } }
|
Using textures
Wherever possible, Microforum created flat geometry and used textures in a clever way.
"Many times we used a semi-standard bill boarding technique with 'fake' animated textures. You always keep the same texture attached to the mesh, which is just a stupid square created with two triangles, but by varying texels over it, you can get very interesting animation effects for free," said Giovanni Simotti.
This is illustrated by the ball texture images below and the accompanying code sample. |
 |
int i, x1, y1, d=333;
i=k-((int)(Math.abs(chara_distance_traveled)/5.0f))%(k+1); x1=d*(i%3); y1=d*(i/3); SetTexel((short)(x1), (short)(y1), (short)(x1+d), (short)(y1+d), vtx_flat_block_texel, 0); // chara_ball_texel_array.set(0, vtx_flat_block_texel.length/2, vtx_flat_block_texel); // We set mesh's new texels
Using Sony Ericsson's J2ME SDK Microforum used Sony Ericsson's J2ME SDK during the Rodent Panic development process, and found the 3D emulation a great help.
According to Giovanni Simotti, "What really impressed me were the J2ME Developers' Guidelines - something that shouldn't be missed by any serious J2ME developer."
"But the most interesting part of the Sony Ericsson J2ME SDK was the emulator. We consider it to be one of the best currently available as it accurately resembles the behavior of a real device."
Microforum found specific components of the J2ME Developers' Guidelines document very useful. For example, detailed information about font pixel height and the different multimedia audio formats supported by Sony Ericsson Mobile Java 3D-enabled phones.
Most useful of all for Microforum was the comprehensive information about memory usage when allocating images and raw data.
"Memory management information is something that cannot be retrieved in a detailed way from Java and some phone manufacturers can be very vague about it," Giovanni Simotti explained. "Sony Ericsson have really done something invaluable by providing developers with in-depth specs of how their Java Virtual Machines work."
Microforum's Mobile Java 3D development tips Learning from their experiences with Rodent Panic, Microforum share five top tips to consider when starting to develop in Mobile Java 3D:
1. Always use real devices Emulators are a great aid but they may differ from physical handsets, both in speed and general behavior. And always use different real devices: performances, specifications, screen size, screen font, and so on typically vary.
2. "Don't be clever - keep it simple, stupid!" If you are thinking of doing something complex (hundreds of polygons, hi-res textures or particular effects), then think again. If you can do something similar using less time and resources, then do so. Typically when you look over a product, you might find that some special effects take up a lot of space and don't really add much game-play value.
3. Double check your original ideas If you have a clever idea, assume that someone else has had it before you (there are too many good developers out there!). Take a look at how they developed it. If it seems that your idea is original, it may be just an idea that someone else discarded due to technical limitations, so first think about the problems you might encounter before wasting lines of code. It is possible to be original but it is much harder than it seems.
4. Learn about the tools your team are using Even if you're a programmer, learn the basics of the "creative" tools that your team are using (e.g. Photoshop, 3DsMax, and so on). This will give you much better understanding of what you're doing and the limitations that both you and the graphic artists have.
5. 3D light sources And finally, about 3D: forget about light sources, even directional lights use a lot of resources. Think instead of creating your textures as if their object were illuminated.
Summary and outlook Microforum are already developing a new Mobile Java 3D futuristic racing game, with other games in the design development phase.
"We learned a lot of things creating Rodent Panic, and we firmly believe that Mobile Java 3D games will very soon become a must," Giovanni Simotti concluded.
About Microforum Microforum is a privately held company founded in 1984 and based in Toronto, Canada. Towards the end of the 1980's, the company gained a prominent role in the multimedia production area, particularly with the creation of video, audio and animations, and the publishing and distribution of multimedia products such as games and software utilities.
With its history and knowledge of software development and distribution, Microforum entered the mobile games and applications market at the end of 2002. In just two years, Microforum created a portfolio of over twenty-five J2ME games and utilities that are currently sold worldwide under the Microforum brand. Microforum's distribution network includes leading mobile operators, mobile Internet portals, and content aggregators.
More information:
|