Header Sep
Latest News
My Rating Score
Login to rate page

May 24, 2005
Developer case study:
Digital Chocolate, early adopter of mobile Java 3D

[Back]

 

  So far Digital Chocolate has released three Java 3D titles for Sony Ericsson mobile phones - 3D Extreme Air Snowboarding, 3D Beach Mini Golf and Mini Golf: Castles - with a fourth title about to go live. Three titles were developed in-house and one title made by an external developer.

The reason for developing 3D games is simple: Digital Chocolate wants to be at the leading edge when it comes to new technologies which improve the user experience. With these titles and the experience gained from them Digital Chocolate has proven to be one of the leading developers of mobile Java 3D games.

Working with new technology
Digital Chocolate's development of their first three titles started before the target devices were available on the market. Being an early adopter of new technology has its disadvantages: support from other developers is hard to find and you often have to rely on trial and error to find solutions to problems. So it really helps to have people with a deep knowledge of 3D game development onboard. Some of Digital Chocolate's team members have experience of writing their own software 3D engines and this knowledge was very useful in dealing with the new technology.

"When we started our first 3D projects we got great help from Sony Ericsson Developer World through early access to Java 3D-enabled phones and emulators. They also gave us the opportunity to meet HI Corporation, the Japanese developers of the Mascot Capsule v3 API. All parties gained a lot from this collaboration," said Henrik Enqvist, Technical Lead 3D at Digital Chocolate.

"Now, almost a year after the launch of the first Java 3D-enabled mobile phones the scene has matured," Henrik continues. "Many developers actively participate in various discussion forums to share their experiences. Phone manufacturers are also pushing the information out to the masses; the Sony Ericsson Developer World website offers a lot of information for both beginners and advanced developers."

The 3D games

When Digital Chocolate first started with 3D development they ran a pilot project for a device manufacturer and some in-house research projects. The first real titles were a big learning experience. The first 3D games they launched were Ferrari Experience 3D and 3D Extreme Air Snowboarding. Both of these titles were 3D versions of older 2D games in Digital Chocolate's portfolio. Very little of the code or graphical assets could be reused in the new versions, so everything had to be rewritten from scratch with 3D in mind.

When developing these titles, Digital Chocolate focused on trying to merge the new 3D technology with the mobile experience already within the company. Even if a mobile phone is capable of running 3D, it does not mean that it is a mobile games console: the lack of an analog game pad is a good example.

 
 3D Extreme Air Snowboarding

For Ferrari Experience 3D, Digital Chocolate decided that the game should be playable with only three buttons: left, right and brake. The game was designed so the need to use the brake button would be rare enough to give the game a casual feel. For this, Digital Chocolate implemented an auto brake system common in console car game simulators. In 3D Extreme Air Snowboarding, they decided to go with same key controls as with the earlier 2D version. The 2D version controls had already received good response and Digital Chocolate felt that gamers would be familiar with the controls even if the full numeric keypad was used for turning, jumping and doing tricks. The physics for both games were completely rewritten from scratch.

Challenges: supporting both JSR-184 and Mascot Capsule v3 APIs
The biggest technical challenge for Digital Chocolate was that they needed to support both JSR-184 and Mascot Capsule v3 APIs. 

"There was a lot of discussion about writing wrappers to solve the issue but there were large architectural differences between the APIs which made the wrapper design tricky," Henrik Enqvist said.

"The tight project deadlines were also a factor which left us with no time to design a full wrapper. We decided to hide some of the code behind wrapper interfaces but still separate the Mascot Capsule v3 and JSR-184 projects from each other. We were working with a new technology with a lot of uncertain factors such as firmware changes and pending launch dates. By concentrating on making one of the profiles ready first, we could play safe and tackle one problem at a time."

Supporting both APIs turned out to be harder than Digital Chocolate expected. Not only did parts of the code need to be re-engineered but also the 3D assets for the game had to be redesigned. This caused headaches for Digital Chocolate's artists who found it difficult to grasp the special requirements of both APIs, especially when the exporters for Mascot Capsule v3 and JSR-184 treat the 3D models differently.
 
 Members of the Digital Chocolate team

Learning from these projects, Digital Chocolate decided that the best way of supporting both APIs is to run both versions simultaneously and use wrappers for the most common elements. In parts where the APIs differ significantly, small pieces of custom code can be written for each profile. On the graphical side, Digital Chocolate's artists design the art within the limitations of the restrained API and scripts are used to convert assets from one platform to another.

Supporting both 2D and 3D mobile gamers

"An essential key to success in the mobile market today is handset support," explains Henrik Enqvist. "You won't get far with a great looking game full of eye-candy if it only runs on high-end 3D phones. You must always remember that the majority of users play on low-end, budget phones and we must make sure the gaming experience is as fun on low-end as on high-end devices."

Digital Chocolate pushed this idea even further by making versions of the 3D game for 2D phones as well. The feasibility of creating both 2D and 3D versions is taken into account early in the game planning process. Neither the 2D version nor the 3D version should be a bad copy of each other.
 
A good example of this is Digital Chocolate's new "Mini Golf: Castles" game. The game physics and levels are identical between all versions - the only thing that differs is the visual representation of the game. The 3D version is an extension of the 2D version, with sleek 3D characters and polished camera handling. This means that gamers with any handset can compete against each other.
 
 Mini Golf: Castles

Tips and tricks for camera implementation
One of the major differences between JSR-184 and Mascot Capsule v3 is camera implementation. JSR-184 supports camera handling with a matrix stack, i.e. the camera can be moved by using regular transform objects. Mascot Capsule v3 relies on a "look-at" method which is common in several 3D APIs. The look-at method creates a camera transform matrix from a position, a look-at direction and an up vector. To ease the porting between Mascot Capsule v3 and JSR-184, Digital Chocolate adopted the Mascot Capsule v3 camera design and wrote a wrapper to support it in JSR-184.

Check out their JSR-184 code sample for camera implemenation>>

More information:

About Digital Chocolate:

Digital Chocolate develops entertainment, problem-solving, and social networking software for mobile phones, and publishes games under the Sumea brand. The company is based in San Mateo, California with its European headquarters in Helsinki, Finland. More information>>

 

 

My Rating Score
Login to rate page