If one
half of the actual production of a cell game is art assets, the other
half which actually executes and implements the game is coding. This
constitutes of functionality and AI (Artificial
Intelligence).
Watch your weight!
 |
|
The J2ME team
at Paradox Studios |
Just like in graphics, the code developers for Mobile games have
to watch their weight (File size).
Also logic, the primary essential
of coding comes into play here with an even greater force. Spotting
repetitive strings or a similar task, and micro sizing the code is
necessary.
Speaking to Animation 'xpress, Jaideep, the
programming and coding incharge at Paradox, and Amit Suri, the Brew lead
shared that "Van Damme
Kickboxing had a big pre devlopment phase and a lot of research was
carried out in both departments, Graphics and Coding in
tandem"
Jaideep added,"We initially look at the feasibility of
executing the demands of the game. The mobile platform proves to be
challenging due to a vast array of limitations the programming team has
to work under. These include API
Limitation,API defines the complete methods by which a programmer
can access and control the given system. API limitation indicates at a
limited amount of functionalities (relative)
Application Size Limitation, Heap
Memory LimitationMemory that is dynamically allocated by the
system. Unlike stack memory, heap memory can be allocated or
de-allocated at any point during program execution. Heap Memory
Limitation indicates limited availability of the heap memory.
and Processor speed etc"
API
limitation:
The standard set of APIs available for
development on a mobile platform is limited. The Math library is very
primitive; attributes like floating point calculations and trigonometric
functions are not available. Though this will improve with newer
versions, as of now, these modules have to be created.
 |
Application size limitation:
There is a cap on the file size for mobile games. This could be
either due to device limitation or carrier limitation (for OTA download).
Heap memory limitation:
Heap memory is the
runtime memory available for an application to run. It is generally very
low for mid-end and low-end devices. Due to this, issues like
fragmentation occur, which make it difficult for a game to hold more
assets. This affects both game quality and gameplay.
Processor speed:
The processors in mobile
devices are relatively slow, this ends up significantly affecting the
speed and responsiveness of a game. To get a better output, complex
calculations need to be avoided during runtime. Instead, programmers
have to use other optimization techniques like approximation arrays and
tables to achieve high speed.
"While writing the code, we target
the hi end devices first, this enables us to give the game its full
features, along with all the eye candy and sound fx" said
Jaideep.
Even as we target the hi end devices first, at the same
time we have our definitions ready for all devices. As opposed to first
writing code for a low end device, this approach works better because it
helps increase our productivity and efficiency" he
added.
"Besides coming down to a lower device is easier than
scaling up once the base code is created." he added.
Mobile game
developers define a set of devices as Goldmaster devices, Paradox has a
defined set which comprises of 3 handsets each for Brew and J2ME. Once
the code is tested on the Goldmaster, they begin porting to the other
devices.
" While porting we have options like outsourcing the
work to porting houses but then that would limit the involvement of our
proprietary code" shared Jaideep.
 |
|
Paradox
Wireless Manager Jaideep Hotha |
While
working on Van Damme Kickboxing the team began with a proto
(Alpha) which staged a fight with one opponent. Once this was cleared
the team used the same base engine to define functionality for the other
enemies. The defined AI for each character however had to be
specifically created.
During the
development phase there are many code modules that are used for
prototyping the game. Apart from this, there are some redundant or
repetitive modules in the code. After the alpha version is ready, the
redundancy is removed by modularising the code. In case of Van Damme
Kickboxing, a different approach was used – The file size was
reduced by using the body-part technique. Here, the character animation
frames were created by segregating different body parts; each frame was
constructed using six parts viz., head, torso, left hand, right hand,
left leg and right leg.
The
advantage of this technique was that the common body parts from many
frames could be eliminated. This reduced the file size, allowing for a
few more key frames to be included, which helped in creating smoother
and more detailed animations.
Another thing that has to be kept in mind is that a mobile game
has to port onto 100s of mobile and wireless devices which have varying
screen sizes, aspect
ratiosThe relationship between the width and the height of an
image. To avoid distortion this ratio must be kept constant when
displaying an image on different screens. and technical
specifications. Jaideep quipped, "Ensuring similar gameplay across
devices and operating systems is one of the most important things a
project manager has to monitor. To achieve this, the programming team of
Van Damme Kickboxing constructed a code architecture during the
analysis phase, where even the most minute details like modules and data
structures were defined. Even the naming convention was consistent
throughout, making it easier to port the game"
Speaking
about the challenges in Van Damme Kickboxing Jaideep and Amit
Suri shared,"We had 2 main challenges for Van Damme Kickboxing.
One was the inclusion of as many enemies and the other was maximum
possible game modes to help increase
gameplay.
To achieve this, the body-part technique was used,
(already explained above). Another smart solution was the usage of
similar torsoes for 2 characters while any one element such as head gear
or color of trousers etc was modified to create a new different
character. The same sets of legs, torso and hands were used for Van Damme and
Tornado, an opponent. Another technique of palette swapping was used to
get variation in colours of the characters’ attires"
Dirty
Rectangle Technique
"The other challenge was the constantly
changing backgrounds and environments for variety. This was achieved
through the Tiling technique, which despite being highly efficient, was
processor intensive. To deal with this, the ‘Dirty Rectangle’ technique
was used, where instead of rendering the entire backdrop every time, a
few selected modified tiles were rendered"
System
Fonts
Elaborating more on the techniques and approach involved,
Jaideep and Amit stated,"There are two code modules, which have to be
modified in porting a mobile game. These are the modules concerning The
graphics for different screen size and The game speed for a different
processor"
"Usually,
the co-ordinate values used in Paint (a Rendering module) are soft coded
and all the co-ordinates are calculated from the screen resolution
(Width x Height) of the handset. The parts that give trouble in porting
are the text displays – messages, score and help" the duo
continued.
"To address this, system fonts are used instead of images for
text messages since this helps during localisationLocalisation
refers to customizing the game for a particular country. It includes the
translation of menus and messages into the native spoken language as
well as changes in the user interface to accommodate different alphabets
and culture of the game. Each device has its own
library of system fonts, which vary drastically. Thus, to make the
porting process seamless, all textual messages are rendered on the
screen using the individual device screen size & font size values"
shared the duo.
"For Van
Damme Kickboxing, the coding team faced a problem in porting the
game for low-end devices like Nokia S40, S30 and Kyocera SE 47, which
have very low heap and jar size. The team had to cut down on the number
of enemies and backdrops for these ports, maintaining the gameplay by
not compromising on the combat moves" they further added.
Some of the
other challenges that the programming and coding team faced
were
1. Collision Detection
This was one of
the most important modules of Van Damme Kickboxing. The
‘Rectangular Collision’ technique was used for collision detection and
was enhanced upon by detecting collision between body parts. Key frames
of animations were mainly considered for collision detection.
2.
Sound Synchronisation
The sound effects had highly improved
the gameplay of Van Damme Kickboxing. Sounds for pain and moves
were implemented brilliantly. The pain sounds were played during body
collisions and so on. Synchronisation was tackled by using
device-specific APIs. The volume of the sound could also be controlled
using this API.
All this
for the functionality, now we move to the AI...
*(Animation 'xpress case studies are now enabled
with Text Tips. Hover your mouse over a technical term to read its
definition. All Text Tips are highlighted)