Multi-User MIDP Game Design

Similar documents
Chapter 3. Technology Adopted. 3.1 Introduction

Mobile Station Execution Environment (MExE( MExE) Developing web applications for PDAs and Cellphones. WAP (Wireless Application Protocol)

Wireless Medium Access Control and CDMA-based Communication Lesson 15 i-mode

Outline. CS5984 Mobile Computing HTTP. HTTP (especially 1.0) Problems 1/2. Dr. Ayman Abdel-Hamid, CS5984. Wireless Web.

IP Mobility vs. Session Mobility

Wireless Internet: layers 3,4,5. Wireless Internet: Layers 3,4,5 Case Study: WAP. WAP: Wireless Application Protocol

Last Time. Internet in a Day Day 2 of 1. Today: TCP and Apps

Wireless Access Protocol(WAP) architecture

JSR 248: Taking Java Platform, Micro Edition (Java ME) to the Next Level

Overview. M-commerce vs. E-commerce

University of Southampton. Department of Electronics and Computer Science. What is the Future of Mobile Multimedia?

Mobile Application Ecosystems

Network Communications Standards. Applied Information Technology

4. B2C,B2E Systems: Concepts and Architectures

Internetworking Models The OSI Reference Model

Computer Networked games

Networking Presented by: Marcin Chady

CS 3516: Advanced Computer Networks

Whither the Mobile Internet: Storage and Mobile Internets

The Transmission Control Protocol (TCP)

CSCI Computer Networks

CSC 4900 Computer Networks: End-to-End Design

Part 17: Networking Technology for Virtual Environments

M.SARAVANA KARTHIKEYAN

ITP 140 Mobile Applications Technologies. Networks

CS 326: Operating Systems. Networking. Lecture 17

GRAPHICAL SIMULATION OF WIRELESS APPLICATION PROTOCOL

Software Development & Education Center. Java Platform, Micro Edition. (Mobile Java)

Introduction to LAN/WAN. Application Layer (Part III)

Session Management and State Handling using HTTP connection on GPRS enabled mobile phone devices: A New Communication Model

Minne menet, Mobiili-Java?

CS 3516: Advanced Computer Networks

in Wireless Application Protocol World

Mobile Services for Java-enabled Devices on 3G Wireless Networks. 1 Introduction

Chapter 2 Application Layer. Lecture 4: principles of network applications. Computer Networking: A Top Down Approach

CMPE 150/L : Introduction to Computer Networks. Chen Qian Computer Engineering UCSC Baskin Engineering Lecture 4

CMSC 322 Computer Networks Applications and End-To- End

Load Balancing Technology White Paper

Airo National Research Journal October, 2016 Volume V, ISSN:

CS519: Computer Networks. Lecture 1 (part 2): Jan 28, 2004 Intro to Computer Networking

Chapter 5.6 Network and Multiplayer

AT&T SD-WAN Network Based service quick start guide

AT&T Collaborate TM. Network Assessment Tool

WIRELESS TRANSMISSION

AT&T Collaborate TM. Network Assessment Tool

Interactive Graphical Systems HT2006

IPv6 Market Drivers. Opening The Door For Wireless Peer-Peer Device Revenue Generation in the Home

LAB-6340: Advanced Java ME Programming - Streaming Video From Server to Your Device

WAP. Bringing the internet to you. Cynthia Luk Marianne Morris Harvey Wong. 4 April, 2002 CMPUT 499

EEC-484/584 Computer Networks

ITP 140 Mobile Applications Technologies. Networks

WAP via ORBCOMM. Andrew R Cardoza, Sias Mostert.

INTRODUCTION TO LTE. ECE MOBILE COMMUNICATION Monday, 25 June 2018

Java Technology for the Mobile Mass Market

CSE 461: Computer Networks John Zahorjan Justin Chan Rajalakshmi Nandkumar CJ Park

A common issue that affects the QoS of packetized audio is jitter. Voice data requires a constant packet interarrival rate at receivers to convert

Chapter 2: Application Layer. Chapter 2 Application Layer. Some network apps. Application architectures. Chapter 2: Application layer

Internet Protocol (IP) TCP versus UDP

Chapter 7 Multimedia Networking

Yealink VCS Network Deployment Solution

November 2017 WebRTC for Live Media and Broadcast Second screen and CDN traffic optimization. Author: Jesús Oliva Founder & Media Lead Architect

IT 341: Introduction to System

Lecture 11. Transport Layer (cont d) Transport Layer 1

Wireless Personal Area Networks & Wide Area Networks

Configuring Asynchronous Serial Traffic over UDP

Network Layering CS 118

416 Distributed Systems. Networks review; Day 2 of 2 Fate sharing, e2e principle And start of RPC Jan 10, 2018

Goal and A sample Network App

Bluetooth Scatternet Application. Sun Code for Freedom

Announcements. IP Forwarding & Transport Protocols. Goals of Today s Lecture. Are 32-bit Addresses Enough? Summary of IP Addressing.

Page 1. Goals for Today" Discussion" Example: Reliable File Transfer" CS162 Operating Systems and Systems Programming Lecture 11

Summary of Data Communications

BrickNet (cont d) Other Academic Projects

Multimedia Networking

CS 640: Introduction to Computer Networks. Today s Lecture. Page 1

Introduction to the Application Layer. Computer Networks Term B14

Module 2 Overview of Computer Networks

Module 2 Overview of. Computer Networks

CS 457 Multimedia Applications. Fall 2014

! " Lecture 5: Networking for Games (cont d) Packet headers. Packet footers. IP address. Edge router (cable modem, DSL modem)

Chapter 9. Multimedia Networking. Computer Networking: A Top Down Approach

EE 122: IP Forwarding and Transport Protocols

Frequently Asked Questions

Lecture 11C Mobile Commerce

Developing Games for J2ME Technology- Enabled Mobile Devices

Mobile Middleware Course. Introduction and Overview Sasu Tarkoma

Configure Transmission Control Protocol (TCP) and User Datagram Protocol (UDP) Service Settings on a Switch

Network Configuration Guide

Islamic University of Gaza Faculty of Engineering Department of Computer Engineering ECOM 4021: Networks Discussion. Chapter 1.

OSI Transport Layer. Network Fundamentals Chapter 4. Version Cisco Systems, Inc. All rights reserved. Cisco Public 1

Distributed Gaming using J2ME. By Rekha Vaddepalli

TCP/IP protocol suite

Ch.16 - Wireless WAN System Architectures

Introduction to Troubleshooting TCP/IP Networks with Wireshark

USER MANUAL. VIA IT Deployment Guide for Firmware 2.3 MODEL: P/N: Rev 7.

Chapter 5 Advanced Configuration

( A ) 1. WAP is a (A) protocol (B) hardware (C) software (D) network architecture

OSI Layer OSI Name Units Implementation Description 7 Application Data PCs Network services such as file, print,

COMS Introduction to Computers. Networking

Number: Passing Score: 750 Time Limit: 120 min File Version: 1.0. Microsoft Exam Name: Identity with Windows Server 2016 (beta)

Transcription:

Multi-User MIDP Game Design David Price, Principal Software Engineer Jyri Salomaa, Program Manager, Games Nokia Research Center, Helsinki 1 NOKIA Multi-User MIDP Game Design Price/Salomaa

Contents Examples of Multi-Player Games MIDP 1.0 Multi-Player Game Communication Technologies MIDP 2.0 Multi-Player Game Communication Technologies MIDP Optional Package Game Communication Technologies Resulting Game Design Options Community-Building Features Conclusions Resources Q&A 2 NOKIA Multi-User MIDP Game Design Price/Salomaa

Offline Examples of Multi-Player Games Card games: Poker, Bridge, Rummy, Uno generally 2..4+ players, turn-based Board games: Monopoly, Scrabble, generally 2..6+ players, turn-based Sports: Football (all kinds ), Ultimate Frisbee, Athletics 2..many players, often teams generally continuous activity sometimes measured individual activity (e.g. time-trials) often long-term scoring: leagues etc. Online Competitions: Quake, Racing Simulations discrete games, often leagues, sometimes virtual teams Virtual Worlds: Everquest, Ultima Online continuous simulation, new win criteria 3 NOKIA Multi-User MIDP Game Design Price/Salomaa

MIDP 1.0 Multi-Player Game Communication Technologies Phone sharing HTTP 4 NOKIA Multi-User MIDP Game Design Price/Salomaa

Phone Sharing I.e. pass one phone between players Supports many players, but only one plays at once Reliable support in every phone! 5 NOKIA Multi-User MIDP Game Design Price/Salomaa

HTTP Mobile Network Internet HTTP Server Many players at once (client-server only) Supported already in MIDP 1.0, but considerations with e.g. mobile gateway conversions Server-side: use Servlets, JSP, ASP, CGI, 6 NOKIA Multi-User MIDP Game Design Price/Salomaa

HTTP: Latency & Bandwidth Latency (round-trip time) is typically a couple of seconds, but can vary greatly Bandwidth depends on the networking technology: 2G GSM 14.4 kbps 1990s D-AMPS, PDC 9.6 kbps 2.5G GPRS up to 50 kbps today HSCSD up to 43 kbps cdmaone up to 64 kbps CDMA 1XRTT up to 144 kbps 3G EDGE up to 473 kbps coming WCDMA up to 2 Mbps 7 NOKIA Multi-User MIDP Game Design Price/Salomaa

HTTP: IP or Gateways? MIDlet Server HTTP HTTP TCP TCP IP Wireless IP Router IP Wireless Wireless Wired Wired MIDlet WAP Gateway Server WSP WSP HTTP HTTP WAP 1.x WTP WTP TCP TCP WDP WDP IP IP Wireless Wireless Wired Wired Don t rely on HTTP streaming, delayed response tricks 8 NOKIA Multi-User MIDP Game Design Price/Salomaa

MIDP 2.0 Multi-Player Game Communication Technologies All of MIDP 1.0 technologies, plus: HTTPS (secure HTTP) Optionally: UDP datagrams TCP sockets TLS secure sockets serial cable infra-red 9 NOKIA Multi-User MIDP Game Design Price/Salomaa

HTTPS Only new mandatory networking protocol in MIDP 2.0 From programming point of view, no difference to using HTTP May be useful for games involving money, e.g. gambling games Server-side: use Servlets, JSP, ASP, CGI, etc 10 NOKIA Multi-User MIDP Game Design Price/Salomaa

UDP Mobile Network Internet UDP Server Lightweight, unreliable datagram protocol Many players at once (client-server only, due to considerations with NATs) Wide support likely Server-side: use J2SE, write your own server (consider NIO), or buy a third-party server 11 NOKIA Multi-User MIDP Game Design Price/Salomaa

Proportion of total 0.16 0.14 0.12 0.1 0.08 0.06 0.04 0.02 0 500 700 UDP Latency over GPRS 900 1100 1300 Depends on network technology, operator, time of day, Results above were made using a GPRS connection with a local operator in Helsinki, during office hours We saw no out-of-order packets, and only 2 lost out of 4000 1500 1700 1900 Round-trip Latency (ms) 2100 2300 2500 12 NOKIA Multi-User MIDP Game Design Price/Salomaa

TCP Mobile Network Internet TCP Server Reliable, bi-directional connection-oriented protocol Many players at once (client-server only, due to considerations with NATs) Wide support likely Server-side: use J2SE, write your own server (consider NIO), or buy a third-party server 13 NOKIA Multi-User MIDP Game Design Price/Salomaa

TCP Latency over GPRS 0.12 Proportion of total 0.1 0.08 0.06 0.04 0.02 0 800 1000 1200 1400 1600 1800 2000 2200 2400 2600 2800 3000 3200 3400 3600 3800 Round-trip Latency (ms) Depends on network technology, operator, time of day, Results above were made using a GPRS connection with a local operator in Helsinki, during office hours Similar to UDP, long tail due to rare lost packet 14 NOKIA Multi-User MIDP Game Design Price/Salomaa

Game Design for Latency Latency is a fact of life there is no magic solution Design your game so that it is not affected by latency Don t try to do mobile multi-player Quake it won t work over mobile networks Some strategies: slow action games (e.g. Napoleonic ship battle) make latency part of the game (e.g. remote-controlled machines) make players actions unaffected by others actions (see example later) server is master, but clients predict movement and update predictions when info arrives from server 15 NOKIA Multi-User MIDP Game Design Price/Salomaa

Network Address Translators / Firewalls Mobile Network NAT Internet TCP/UDP Server Phone Mapped Server a1:p1 a1:p2 a2:p1 nat:q1 nat:q2 nat:q3 b1:r1 b1:r2 b1:r1 Mapping contains both client & server: {a1:p1, b1:r1 q1} 16 NOKIA Multi-User MIDP Game Design Price/Salomaa

Network Address Translators / Firewalls (2) May not allow incoming TCP connections May not allow incoming UDP packets, except from hosts (& ports) who ve been sent packets recently May discard UDP mappings after just a minute or so 17 NOKIA Multi-User MIDP Game Design Price/Salomaa

Example: ChatWorld Proto Multi-user graphical MUD (eventually) Client-side is MIDP 2.0 MIDlet Server-side gamelet deployed into generic gamelet container Client-server protocol is a combination of: TCP sockets for things that must be reliable (e.g. logging in) UDP datagrams for messages that can be unreliable (e.g. move, face left) Caveats: Work in progress! not yet tested on phones not yet tested on real networks 18 NOKIA Multi-User MIDP Game Design Price/Salomaa

ChatWorld Protocol Client 1 Server Client 2 open TCP UDP UDP login(username/pw) login-ok(session-id, avatar, level) nop(session-id) move(session-id, x, y, dir) arrive(avatar, x, y, dir) move(avatar-name, x, y, dir) TCP close leave(avatar-name) 19 NOKIA Multi-User MIDP Game Design Price/Salomaa

TLS Secure sockets (TLS is based on SSL) Relevance to games may depend on whether encrypting slows things down too much No data yet Server-side:? 20 NOKIA Multi-User MIDP Game Design Price/Salomaa

Serial Cable Two-player games Optionally supported in MIDP 2.0 through SerialPortConnection Phone-phone cables generally not available though Probably not a practical option 21 NOKIA Multi-User MIDP Game Design Price/Salomaa

Infra-Red Two-player games Sensitive to phone orientation Also IR port placement differs between models Optionally supported in MIDP 2.0 through SerialPortConnection Trading collectible cards etc. Probably not a practical option for rapidly interactive gaming 22 NOKIA Multi-User MIDP Game Design Price/Salomaa

Optional Package Multi-Player Game Communication Technologies Bluetooth (JSR-82, Java APIs for Bluetooth) SMS (JSR-120, Wireless Messaging API 1.0) MMS (JSR-205, Wireless Messaging API 2.0) SIP (JSR-180, SIP API for J2ME) 23 NOKIA Multi-User MIDP Game Design Price/Salomaa

Bluetooth (JSR-82) Several players at once (8 max) Short-range radio, up to about 10 metres Bandwidth up to ~700kbps, latency about 50ms No known products support JSR-82 yet 24 NOKIA Multi-User MIDP Game Design Price/Salomaa

SMS (JSR-120) Mobile Network SMSC Game Server Several players at once (peer-peer or client-server) Latency: several seconds..24 hours Mandatory in JTWI 1.0 Too expensive for rapidly interactive games, but play-by-mail turns OK? Server-side can use SAMS API (JSR-212) in future 25 NOKIA Multi-User MIDP Game Design Price/Salomaa

MMS (JSR-205) Multi-media equivalent of SMS: include pictures and/or audio clips MMS is under the cover a combination of SMS & HTTP MIDP games probably should just use SMS or HTTP directly Server-side can use SAMS API (JSR-212) in future 26 NOKIA Multi-User MIDP Game Design Price/Salomaa

SIP (JSR-180) SIP is Session Initiation Protocol Could be used for initiating peer-to-peer games See: BOF-1847: Building MIDlets with SIP API for Java, Thursday 9:30-10:20pm, Metropolitan III TS-1846: SIP API for J2ME, Friday 12:15-1:15pm, Room 121 27 NOKIA Multi-User MIDP Game Design Price/Salomaa

Resulting Game Design Options We ll use the categories Greg Costikyan defined in Introduction to Mobile Game Development [Forum Nokia]: Multi-Player Solo-Play Games Turn-Based Games Round-Robin Games Simultaneous Movement Games Act Whenever Games Slow Update Games 28 NOKIA Multi-User MIDP Game Design Price/Salomaa

Multi-Player Solo-Play Games During a round, each player plays a single-player game, then their scores are compared at the end of the round No networking during play, so play can be fast and interactive HTTP is mostly enough, if you accept a little polling to see whether the other players have finished SMS works fine Client-server TCP is ideal Bluetooth allows local peer-to-peer 29 NOKIA Multi-User MIDP Game Design Price/Salomaa

Turn-Based: Round-Robin Games Like Chess, Poker, Bridge: players take turns to play Some games (e.g. Chess) can be done just by sharing a phone Using HTTP requires polling: is it my turn yet? SMS works fine, but can be expensive if there are lots of turns Client-server TCP is ideal Bluetooth allows local peer-to-peer What happens if one player loses their connection? 30 NOKIA Multi-User MIDP Game Design Price/Salomaa

Turn-Based: Simultaneous Movement Players all take their turn at the same time, e.g. Stone, Paper, Scissors Same implementation issues as round-robin 31 NOKIA Multi-User MIDP Game Design Price/Salomaa

Act Whenever Games Game runs continuously over a long period, continuously simulated world User can enter the game any time and perform some actions If no real-time action (e.g. stock-market game), HTTP is suitable If actions are infrequent, SMS may be suitable If real-time action (e.g. massively multiplayer on-line game), TCP and/or UDP are best, but mobile network latencies still present problems 32 NOKIA Multi-User MIDP Game Design Price/Salomaa

Slow Update Games Again continuous, but in these the player s agent in the game plays continuously (e.g. resource-management games) Player can log in any time, view the game status, and change the agent s behaviour HTTP is probably sufficient, as latency is not typically a factor 33 NOKIA Multi-User MIDP Game Design Price/Salomaa

Leader boards Tournaments Community-Building Features Chat (slow with phone keyboards, but remember success of SMS) Item trading (on-line or via infra-red) User-created levels (using MIDlet, or web application?) 34 NOKIA Multi-User MIDP Game Design Price/Salomaa

Conclusions Client-server games can be built today (using HTTP, SMS) Peer-to-peer games can be built today (using SMS) Rapid, interactive client-server games are coming (using UDP, TCP) Rapid, interactive peer-to-peer games are coming (using Bluetooth, SIP) Future mobile network technologies (e.g. 3G) will reduce network latencies Mobile phones are communication devices multi-player is the future of mobile games 35 NOKIA Multi-User MIDP Game Design Price/Salomaa

Resources: Internet java.net game section (http://community.java.net/games) Sun s game developer site, active discussion groups Gamasutra.com (http://www.gamasutra.com) General game developer site Forum Nokia Game Section (http://www.forum.nokia.com/games) Articles, example code, discussion groups, support, Greg Costikyan s site (http://www.costik.com) Articles on game design, blog, links 36 NOKIA Multi-User MIDP Game Design Price/Salomaa

Resources: Books Micro Java Game Development David Fox & Roman Verhovsek Addison-Wesley, 2002; ISBN: 0672323427 still the only MIDP game book available, covers MIDP 1.0 Wireless Java: Developing with J2ME, Second Edition Jonathan Knudsen Apress, 2003; ISBN: 1590590775 covers MIDP 2.0, including its new game API Networked Virtual Environments Sandeep Singhal & Michael Zyda Addison-Wesley, 1999; ISBN: 0-201-32557-8 great practical book on technologies for networked virtual reality Java Network Programming, 2 nd Edition Elliote Rusty Harold O Reilly, 2000; ISBN: 1-56592-870-9 great practical Java networking book, but doesn t cover NIO 37 NOKIA Multi-User MIDP Game Design Price/Salomaa

38 NOKIA Multi-User MIDP Game Design Price/Salomaa