Top Banner
J2ME & BREW Game Design Code running on the handset (at last) Greg Costikyan www.ungames.com www.costik.com costik @costik.com
21

J2ME & BREW Game Design Code running on the handset (at last) Greg Costikyan [email protected] [email protected].

Dec 14, 2015

Download

Documents

Colt Cleavenger
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: J2ME & BREW Game Design Code running on the handset (at last) Greg Costikyan   costik@costik.com costik@costik.com.

J2ME & BREW Game Design

Code running on the handset (at last)

Greg Costikyan

[email protected]

Page 2: J2ME & BREW Game Design Code running on the handset (at last) Greg Costikyan   costik@costik.com costik@costik.com.

What is BREW?

Binary Runtime Environment for Wireless

Tied to CDMA (in practice, if not theory)Strongly supported by Verizon, AlltelKorean carriers, KDDI in Japan, Bell Mobility in Canada

Like Java, runs in a virtual machine (on the hardware)

Qualcomm is the Gatekeeper

Write apps in C, C++, or Java

Page 3: J2ME & BREW Game Design Code running on the handset (at last) Greg Costikyan   costik@costik.com costik@costik.com.

What is J2ME?

Java 2 Micro Edition (for small device CLDC: Connected Limited Device Configuration MIDP: Mobile Information Device Profile

Runs on a virtual machine (KVM, <80k)

Java-enabled phones available in Japan, Korea, Europe, through Nextel; major commitment by Sprint, support from all major manufacturers

Carriers are the Gatekeepers (but Motorola for Nextel)

Page 4: J2ME & BREW Game Design Code running on the handset (at last) Greg Costikyan   costik@costik.com costik@costik.com.

Which Should You Use?

Little difference in technical capability

Largely a business decision

Likely to be a larger installed base of J2ME-enabled handsets

Page 5: J2ME & BREW Game Design Code running on the handset (at last) Greg Costikyan   costik@costik.com costik@costik.com.

Why Develop J2ME/BREW Games?

Run apps on the handset (not all logic has to be on the server side)

Much better control over UI

Small User Base at Present (but likely to grow fast)

An area of carrier focus

Page 6: J2ME & BREW Game Design Code running on the handset (at last) Greg Costikyan   costik@costik.com costik@costik.com.

How it Used to Work

a. Download applet to your PC over the Internet.

b. Hotsynch your phone to install applet.

c. Can’t install applications over the air network.

d. In Asia, applets can’t communicate over the network—soloplay only.

Page 7: J2ME & BREW Game Design Code running on the handset (at last) Greg Costikyan   costik@costik.com costik@costik.com.

How it Now Works

a. User makes a network connection, browses carrier’s list of midlets, chooses one.

b. HTTP request goes out over air network, is routed to remote server on the Internet.

c. Server sends midlet to handset, where it is installed.

d. Network sockets are exposed to J2ME on the handset, so midlets can send and receive data with remote servers.

Page 8: J2ME & BREW Game Design Code running on the handset (at last) Greg Costikyan   costik@costik.com costik@costik.com.

Technical Limitations

Midlets must be <50k (or so)

No simultaneous key presses

No support for image transparency

Cannot edit bitmaps on the fly, no blittingCan’t assume any audio supportNo floating point mathNo JNI or AWT

Page 9: J2ME & BREW Game Design Code running on the handset (at last) Greg Costikyan   costik@costik.com costik@costik.com.

What We Can Rely OnHigh-Level UI Features:

PNGs & bitmaps Text Entry Select lists (radio buttons) & Multiple select lists (check boxes) Bar graphs Support for standard phone keys (0-9, *, #, arrows) Abstracted game controls

Low-Level UI Features: Canvas Graphics

HTTP

Page 10: J2ME & BREW Game Design Code running on the handset (at last) Greg Costikyan   costik@costik.com costik@costik.com.

Latency > WAP?

With WAP, latency = air network + Internet latency

With J2ME, add HTTP handshaking

UDP is supported but not mandatory

but exists on Motorola/iDen handsets (Nextel)

An area of carrier focus

Page 11: J2ME & BREW Game Design Code running on the handset (at last) Greg Costikyan   costik@costik.com costik@costik.com.

Keep Network Access Sessions Short

People pay by the minute—but YOU get nada

5-10 minute sessionsoffline as well as online components—simove, deck

construction

Page 12: J2ME & BREW Game Design Code running on the handset (at last) Greg Costikyan   costik@costik.com costik@costik.com.

Network Still Unreliable

Irrelevant for soloplay

If connection is intermittent, game needs need to sense network failureIf connection continuous, handle drops gracefully

Page 13: J2ME & BREW Game Design Code running on the handset (at last) Greg Costikyan   costik@costik.com costik@costik.com.

Dealing with the 50k Limit

Keep text short

Use (& reuse) small number of graphicsUse a code obfuscator

Minimize the number of inner classesCollapse the class hierarchyMaximize use of pre-installed classesConsider using multiple midlets

Page 14: J2ME & BREW Game Design Code running on the handset (at last) Greg Costikyan   costik@costik.com costik@costik.com.

Making the Most of Graphics

No inherent support for layers

Tiled Backgrounds (or images at discrete locations on blank background)Limit number of sprites & behaviors

Page 15: J2ME & BREW Game Design Code running on the handset (at last) Greg Costikyan   costik@costik.com costik@costik.com.

Thinking About UI

Handset is similar to a console controller

Motion for a single actor: arcade-style, RPGsSelect an actor, select a destination—simple strategy gamesSelect-lists = menus

11 buttons: NetHack-style UI

Page 16: J2ME & BREW Game Design Code running on the handset (at last) Greg Costikyan   costik@costik.com costik@costik.com.

What Kinds of Games Can We Do?

Primitive skill-and-action games (retro arcade)

Classic board & card

Console-like games with simple controls (gold, driving)

Levelware

Networking is STILL where mobile phones have an advantage

Page 17: J2ME & BREW Game Design Code running on the handset (at last) Greg Costikyan   costik@costik.com costik@costik.com.

Jamdat Bowling

www.jamdatgames.com

Page 18: J2ME & BREW Game Design Code running on the handset (at last) Greg Costikyan   costik@costik.com costik@costik.com.

Diamond Mine

www.jamdatgames.com

Page 19: J2ME & BREW Game Design Code running on the handset (at last) Greg Costikyan   costik@costik.com costik@costik.com.

Micro Nitro

www.morpheme.co.uk

Page 20: J2ME & BREW Game Design Code running on the handset (at last) Greg Costikyan   costik@costik.com costik@costik.com.

Froggy

www.perimind.com

Page 21: J2ME & BREW Game Design Code running on the handset (at last) Greg Costikyan   costik@costik.com costik@costik.com.

URLs

Obfuscators:www.alphaworks.ibm.com/tech/JAX/retrologic.com

J2ME Wireless Toolkit:java.sun.com/products/j2mewtoolkit/

Useful Articles:wireless.java.sun.com/midp/articles/www.gamasutra.com/resource_guide/20010917/fox_01.htm