Game Development for Mobile Phones

Published on May 2016 | Categories: Documents | Downloads: 34 | Comments: 0 | Views: 196
of 16
Download PDF   Embed   Report

Comments

Content

Game Development for Mobile Phones
CS536 Boris Rabkin

Background on Mobile Games Why develop games for mobile phones Availability of Games Gaming Platform Development Platform J2ME Intro Getting Started with J2ME J2ME and 3D Game Development Code examples Publishing Your Own Games References

Table of Content

Background on Mobile Games
‡ ‡

The past decade has seen mobile phones emerge as one of the fastest adopted technologies of all time Advances in technology
‡ Limited graphics, grey scale, low bandwidth ‡ Higher resolution , 256 colors, multiplayer ‡ More Features, 64K colors, higher bandwidth

‡

Huge potential market for mobile gaming - over 1 billion mobile phone users world wide

3 Common type of games for Mobile phones:
‡ ‡ ‡

Messaging Mobile Games ± Short Message Service (SMS) and Multimedia Message Service (MMS) Online Games ± WAP using WML Downloadable ± J2ME (Java 2 Micro Edition), BREW

Why develop games for Mobile Phones?
Rapid adoption and production
‡

Games on mobile phones are fast catching up with those being played on computers and consoles. Mobile phones have progressively improved in terms of their capabilities and network connectivity. Advances in mobile technology have created a strong marketplace for mobile entertainment and according to the ARC Group (2001), the market for mobile entertainment will reach 1.6 billion global users by 2006. In the future, the vision is for mobile games to be real time, multiplayer, and location sensitive.

y

y

y

Game Availability - network resident technologies
WAP The most common type of online games available in developed markets are currently based on the wireless application protocol (WAP) Visuals of most games are relegated to postage stamp-sized monochrome graphics accompanied by plain text.

NTT DoCoMo¶s iMode iMode is a similar technology to WAP, aside from a few major differences. The biggest difference is that iMode resides on a packet-switched network (pay by kilobit), as opposed to most WAP carriers¶ circuit switched technology (pay by minute). ‡ Uses HTML ‡ 26 million subscribers

Game Availability ± downloadable games
Most sophisticated games run under the Sun¶s slimmed-down version of Java, J2ME, and Qualcomm¶s BREW (Binary Runtime Environment for Wireless) environments. One of the major differences between BREW and J2ME is that BREW is compiled native code. Because you are operating closer to the hardware, it is possible to squeeze more performance out of BREW applets on chipsets similar in power to those on J2ME devices. BREW is also a proprietary standard. It relies on licensed compilers, registered developer programs, and other mechanisms familiar to those accustomed to developing on consoles from Sony and Nintendo. - SKD and emulator are available at no charge

Gaming Platform

± key mobile phone attributes

Development Platforms
y

BREW, Binary Runtime Environment for Wireless. - Platform SDK and distribution model developed by Qualcomm - Designed to address the new era of programmable mobile phones - Requires a BREW-equipped phone

y

Java, or the Java 2 Micro Edition (J2ME) platform to be precise, is identified as the most convenient for developing mobile games. Industry standard backed by all major handset makers Most new phones are Java-enabled J2ME is free and open platform Highly portable: ³write once run anywhere´ Optimized for small devices

J2ME ± MIDP 2.0
J2ME has the Mobile Information Device Profile (MIDP) API that is designed specifically for developing applications for mobile devices including mobile phones, keeping in mind their limitations and constraints. The latest MIDP version 2.0 itself dedicates a whole API to game development, making game development simpler and quicker. Most important feature of MIDP is the Game API. javax.microedition.lcdui.game Game API provides game developers with the readymade building blocks in shapes of classes for creating and controlling various game elements such as game canvas, sprites, layers, and so forth. MIDP 2.0 significantly reduces the time involved in game development.

Getting Set to Program with J2ME
To begin programming on this platform you will need:
1. 2.

3.

Java Development Kit (JDK), version 1.3 or newer. This kit can be downloaded from www.java.sun.com. The next thing that you need is a configuration. There are two Java platform configuration types: Connected Device Configuration (CDC), used in larger devices such as set top boxes and PDA¶s, and the connected limited device configuration (CLDC), which is used in cell phones. J2ME Wireless Toolkit (MIDP), also available at www.java.sun.com

Code Examples ± Basic MIDlet structure
import javax.microedition.midlet.*; public class MyMidlet extends MIDlet { public MyMidlet() { } public void startApp() throws MIDletStateChangeException { } public void pauseApp() { } public void destroyApp(boolean unconditional) { } }

3D Games with J2ME and M3G
y

A 3D graphics API is a prerequisite for easily developing 3D games. The Mobile 3D Graphics API, often called M3G, is an optional API that facilitates the display and manipulation of 3D graphics elements on mobile information devices. The actual M3G "3D engine" is usually implemented with the help of native libraries on the device. M3G classes are contained in the javax.microedition.m3g package. Other Graphics API¶s: OpenGL ES, Direct3D Mobile
Class AnimationController Appearance Camera Graphics3D Image2D Light Object3D World Loader Description Controls animation through the position, speed, and weight of an animation sequence. Controls the rendering attributes of 3D graphics. Is a camera to define the position of a viewer on a screen. Renders 3D graphics on a screen. Is a two-dimensional image. Represents the different sources of light used in 3D graphics. Acts as the base class for all objects used in 3D graphics. Is a top-level container to hold 3D graphics data in an application. Loads 3D graphics data from a .3mg file to a World object.

y

y

y

y

3D Games, how to with J2ME
The javax.microedition.m3g package contains all the 3D API classes. To render a single frame of 3D graphics, you need to follow these steps: Obtain the Graphics3D instance.
Graphics g = getGraphics();
y

Obtain a 2D Graphics instance (from Canvas, GameCanvas, etc.), which will be used to display the frame.
Graphics3D g3d = Graphics3D.getInstance();

y

Bind the Graphics3D instance to the 2D Graphics instance; the frame of the 3D image will be drawn onto the 2D context.
g3d.bindTarget(g);

y y

Use the M3G API to set up and update the 3D scene. Call one of the render() methods of Graphics3D to render a frame of the 3D scene.
g3d.render(...);

1. 2.

Call the Graphics3D's releaseTarget() method to flush the rendered image to the 2D Graphics. Call the 2D Graphic's flushGraphics() method to flush the drawing and update the visible component with the rendered frame.

3D Game example
Quake Mobile

Distribution
Publish your MIDlets yourself 1. need is a valid JAD (file that describes the MIDlet with such properties as its name, description, size, and other criteria) file 2. place the JAD and the JAR, which contains the MIDlet, on a web server 3. configuring the server with the proper MIME types. There are two types you need to install:
.jad text/vnd.sun.j2me.app-descriptor .jar application/java-archive

4. Point your phone¶s browser to the appropriate URL and it will download and install the JAR on the handset

Commercial Web Portals
Handango (www.handango.com) www.zingy.com www.microjava.com

References
y

Barnes, S., & Huff, S. (2003). Rising sun: i-Mode and the wireless Internet. Communications of the ACM, 46(11), 78±84. It's Alive. (2000). It's Alive launches world's first location-based mobile game. Retrieved January 26, 2005, from http://www.itsalive.com/page.asp?t=press&id=61 Nokia. (2003a). Introduction to the mobile games business, Version 1.0. Retrieved March 9, 2004, from http://www.forum.nokia.com/main/0,6566,050,00.html Nokia. (2003b). Nokia series 40 J2MEŒ game usability guidelines and implementation model, Version 1.0. Retrieved March 9,2004, from http://www.forum.nokia.com/main/0,6566,050,00.html Nokia. (2003c). Overview of multiplayer mobile game design, Version 1.1. Retrieved March 9, 2004, from http://www.forum.nokia.com/main/0,6566,050,00.html NTT DoCoMo. (2001). DoCoMo iMode service information. Tokyo: NIT DoCoMo. Unwiredfactory. (2005). TreasureMachine. Retrieved January 26, 2005, from http://www.unwiredfactory.com/pdf_documents/TreasureMachine.pdf WAP Forum. (2002). Wireless application protocol 2.0²technical white paper. Retrieved December 23, 2002, from http://www.wapforum.org

y

y

y

y

y y

y

Sponsor Documents

Or use your account on DocShare.tips

Hide

Forgot your password?

Or register your new account on DocShare.tips

Hide

Lost your password? Please enter your email address. You will receive a link to create a new password.

Back to log-in

Close