33
Distributed Gaming using J2ME By Rekha Vaddepalli

Distributed Gaming using J2ME - SJSU Computer Science ......PDAs using J2ME, Servlets, JDBC and MySQL Acquire game borrows ideas from old computer game “Mule” Game world consists

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Distributed Gaming using J2ME - SJSU Computer Science ......PDAs using J2ME, Servlets, JDBC and MySQL Acquire game borrows ideas from old computer game “Mule” Game world consists

Distributed Gaming using J2ME

By Rekha Vaddepalli

Page 2: Distributed Gaming using J2ME - SJSU Computer Science ......PDAs using J2ME, Servlets, JDBC and MySQL Acquire game borrows ideas from old computer game “Mule” Game world consists

Agenda

IntroductionRequirementsTechnologies UsedDesign and ImplementationExperiments and ResultsConclusion

Page 3: Distributed Gaming using J2ME - SJSU Computer Science ......PDAs using J2ME, Servlets, JDBC and MySQL Acquire game borrows ideas from old computer game “Mule” Game world consists

Introduction

Mobile devices usage is increasingrapidlyIn tandem, mobile games developmentis increasingDevelopment platforms

J2ME, C++ etc

Page 4: Distributed Gaming using J2ME - SJSU Computer Science ......PDAs using J2ME, Servlets, JDBC and MySQL Acquire game borrows ideas from old computer game “Mule” Game world consists

RequirementsPurpose

To develop a distributed, multi-player gamewith a central server to simulate certaineconomic scenarios.Sample scenarios tested

Making a certain product tougher to produce and alsomaking it costlier than the other productsChoosing to produce a certain product benefits theplayerSimulation of real world issues

It can also be viewed as a regular strategygame by the people more interested instrategy games

Page 5: Distributed Gaming using J2ME - SJSU Computer Science ......PDAs using J2ME, Servlets, JDBC and MySQL Acquire game borrows ideas from old computer game “Mule” Game world consists

Requirements (contd..)Scope

To implement Acquire game for J2ME-enabledPDAs using J2ME, Servlets, JDBC and MySQL

Acquire game borrows ideas from oldcomputer game “Mule”Game world consists of number of plot areascomprising of nine sub plots

Each plot has 3 propertiesMine ValueFarm ValueEnergy Value

Page 6: Distributed Gaming using J2ME - SJSU Computer Science ......PDAs using J2ME, Servlets, JDBC and MySQL Acquire game borrows ideas from old computer game “Mule” Game world consists

Requirements (contd..)

Game consists of 4 stagesSelection of plot areasConfiguration of plot areasProductionAuction

RulesIf the player satisfies critical resources limits of all typeof products, can go for another round of selectionThe player must finish the auction that he started in theprevious round to start the auction in the next round

Page 7: Distributed Gaming using J2ME - SJSU Computer Science ......PDAs using J2ME, Servlets, JDBC and MySQL Acquire game borrows ideas from old computer game “Mule” Game world consists

J2ME (Java 2 Micro Edition)

Two key componentsConfiguration

JVM for each kind of deviceDefines the Java Runtime Environment and coreclasses that operate on each deviceEx: CLDC & CDC

ProfileConsists of Java classes that enable implementationof features for a particular device or group of devicesEx: MIDP, Foundation Profile etc.

Page 8: Distributed Gaming using J2ME - SJSU Computer Science ......PDAs using J2ME, Servlets, JDBC and MySQL Acquire game borrows ideas from old computer game “Mule” Game world consists

J2ME Concepts (contd..)

User Interface ClassesUsed Form class for all the screensUsed CustomItem class for game worldrepresentation

Persistent StorageUsed for storing intermediate values inConfiguration stage

Generic Connection FrameworkUsed for communicating with the server

Page 9: Distributed Gaming using J2ME - SJSU Computer Science ......PDAs using J2ME, Servlets, JDBC and MySQL Acquire game borrows ideas from old computer game “Mule” Game world consists

MIDP Applications (MIDlets)Introduction of Verification step afterCompilation

Divided into two stepsPre-verification is done off the deviceSimple second verification step on the device

DeploymentUsing MIDlet suites

JAR fileManifest File (included in JAR)Application Descriptor (outside JAR)

Page 10: Distributed Gaming using J2ME - SJSU Computer Science ......PDAs using J2ME, Servlets, JDBC and MySQL Acquire game borrows ideas from old computer game “Mule” Game world consists

Other technologies used

Java ServletsJava Database Connectivity (JDBC)MySQL Database

Page 11: Distributed Gaming using J2ME - SJSU Computer Science ......PDAs using J2ME, Servlets, JDBC and MySQL Acquire game borrows ideas from old computer game “Mule” Game world consists

Operating Environment

Application OperatingEnvironment

Game Client J2ME Wireless Toolkit,Windows CE/ME

Game Server Java 1.4.1 or higherinstalled on Windows

Database Oracle 9i / MySQL

Page 12: Distributed Gaming using J2ME - SJSU Computer Science ......PDAs using J2ME, Servlets, JDBC and MySQL Acquire game borrows ideas from old computer game “Mule” Game world consists

Design and ImplementationSystem Architecture

Server

J2ME devices

Server

Database

HTTP

JDBC

Page 13: Distributed Gaming using J2ME - SJSU Computer Science ......PDAs using J2ME, Servlets, JDBC and MySQL Acquire game borrows ideas from old computer game “Mule” Game world consists

Server Design

Register & LoginCreate New Game WorldUpdate

On SelectionOn ConfigurationOn Role DeclarationOn TradeOn Transfer Of UnitsOn Log off

Get Score

Page 14: Distributed Gaming using J2ME - SJSU Computer Science ......PDAs using J2ME, Servlets, JDBC and MySQL Acquire game borrows ideas from old computer game “Mule” Game world consists

Selection

Configuration& Production

Declare Roles

Rule 1

Rule 1: Produce >= critical limit (for each type of the product)Rule 2: Finished auction started in the previous round

Auction

Trade

Rule 2

Game Design

Page 15: Distributed Gaming using J2ME - SJSU Computer Science ......PDAs using J2ME, Servlets, JDBC and MySQL Acquire game borrows ideas from old computer game “Mule” Game world consists

Logging in

Page 16: Distributed Gaming using J2ME - SJSU Computer Science ......PDAs using J2ME, Servlets, JDBC and MySQL Acquire game borrows ideas from old computer game “Mule” Game world consists

Selection Phase

Page 17: Distributed Gaming using J2ME - SJSU Computer Science ......PDAs using J2ME, Servlets, JDBC and MySQL Acquire game borrows ideas from old computer game “Mule” Game world consists

Configuration/Production

Page 18: Distributed Gaming using J2ME - SJSU Computer Science ......PDAs using J2ME, Servlets, JDBC and MySQL Acquire game borrows ideas from old computer game “Mule” Game world consists

Auction Stage

Page 19: Distributed Gaming using J2ME - SJSU Computer Science ......PDAs using J2ME, Servlets, JDBC and MySQL Acquire game borrows ideas from old computer game “Mule” Game world consists

Local Auctions

Game 1, 2 & 3 canbe seen as 3different localauctionsA is involved in bothGame 1 & 2So, A can transferunits between thetwo local auctions

Game OneGame Two

Game Three

A BA

C

D E

F

Page 20: Distributed Gaming using J2ME - SJSU Computer Science ......PDAs using J2ME, Servlets, JDBC and MySQL Acquire game borrows ideas from old computer game “Mule” Game world consists

ExperimentsRealization of local auctions

Game One

0

2000

4000

6000

8000

10000

12000

14000

1 2 3 4 5 6 7 8 9 10

Before & After Transfer Of Units

Pro

du

cti

on

Va

lue

s &

Sc

ore

A

B

M F E R S M F E R S

Game Two

0

2000

4000

6000

8000

10000

12000

1 2 3 4 5 6 7 8 9 10

Before & After Transfer of units

Pro

du

cti

on

Va

lue

s a

nd

Sc

ore

A

C

M F E R S M F E R S

Page 21: Distributed Gaming using J2ME - SJSU Computer Science ......PDAs using J2ME, Servlets, JDBC and MySQL Acquire game borrows ideas from old computer game “Mule” Game world consists

Configuration file on theServer

Helps to create different scenariosThis file contains

Several initial parametersInitial mine units, food units etc.Time slots for Selection, Configuration etc.

Expenditure FormulaeProduction FormulaeScore formula

Page 22: Distributed Gaming using J2ME - SJSU Computer Science ......PDAs using J2ME, Servlets, JDBC and MySQL Acquire game borrows ideas from old computer game “Mule” Game world consists

Test Case OneDescription

Making one product tougher to producecompared to other products and that particularproduct is sold at a higher priceFor this test case, I chose mines to be thetougher to produce product.Machinery Expenditure formula is modified sothat less mines are produced.

Production = (Type_Of_Product * Appropriate_Property_Value)

MachineryExpenditure = 10 * (Sum of Property Values)

Page 23: Distributed Gaming using J2ME - SJSU Computer Science ......PDAs using J2ME, Servlets, JDBC and MySQL Acquire game borrows ideas from old computer game “Mule” Game world consists

Test Case One: With 2 playersResults

Test Case One: 2 Players

0

500

1000

1500

2000

2500

3000

3500

0 1 2 3 4

Average Mine Value

Sc

ore

Round 1

Round 2

Round 3

A

B

A

B

A

B

Page 24: Distributed Gaming using J2ME - SJSU Computer Science ......PDAs using J2ME, Servlets, JDBC and MySQL Acquire game borrows ideas from old computer game “Mule” Game world consists

Test Case One: With 4 playersResults

Test Case One: 4 Players

AC

D

B

AD

C

B

-100

0

100

200

300

400

500

600

0 200 400 600 800 1000 1200

Rokda Units

Min

e U

nit

s

Round1

Round3

Size ofbubble :Score

Page 25: Distributed Gaming using J2ME - SJSU Computer Science ......PDAs using J2ME, Servlets, JDBC and MySQL Acquire game borrows ideas from old computer game “Mule” Game world consists

Test Case TwoDescription

Just deciding to produce a particularproduct will increase the scoreFor this test case, I chose that if the playerchooses to mine, he would have a betterscore

Score = (Mine_Count * 10) + (Farm_Count *2) + (Energy_Count * 2)

Page 26: Distributed Gaming using J2ME - SJSU Computer Science ......PDAs using J2ME, Servlets, JDBC and MySQL Acquire game borrows ideas from old computer game “Mule” Game world consists

Test Case Two:With 2 playersResults

Mining Count Chart

012345678910

1 2

Rounds

Min

e C

ou

nt

A

B

Scores

0

20

40

60

80

100

120

140

1 2

Rounds

Score A

B

Page 27: Distributed Gaming using J2ME - SJSU Computer Science ......PDAs using J2ME, Servlets, JDBC and MySQL Acquire game borrows ideas from old computer game “Mule” Game world consists

Test Case Two:With 4 PlayersResults

Test Case Two: 4 players

0

50

100

150

200

250

300

0 2 4 6 8 10

Mining Count

Sc

ore

Round1

Round2

Round3

Round4AB&C

D

B

B

B

Page 28: Distributed Gaming using J2ME - SJSU Computer Science ......PDAs using J2ME, Servlets, JDBC and MySQL Acquire game borrows ideas from old computer game “Mule” Game world consists

Test Case Three

DescriptionThe worker and land expenses are higher forproducing mines than for farming or energyproduction.

WorkerExpensesForMining=(10*(Sum Of Property Values))LandExpensesForMining=(10*(Sum Of Property Values))

WorkerExpensesForFarming=(2*(Sum Of Property Values))LandExpensesForFarming=(2*(Sum Of Property Values))

WorkerExpensesForEnergy=(3*(Sum Of Property Values))LandExpensesForEnergy=(3*(Sum Of Property Values))

Page 29: Distributed Gaming using J2ME - SJSU Computer Science ......PDAs using J2ME, Servlets, JDBC and MySQL Acquire game borrows ideas from old computer game “Mule” Game world consists

Test Case Three: With 2 PlayersResults

Score Comparisons in the two rounds

0

5000

10000

15000

20000

25000

30000

35000

1 2

Round 1 & 2S

co

re A

B

Comparison Chart

0200400600800100012001400160018002000

1 2 3 4 5 6 7 8

Rounds 1 & 2

Pro

du

cti

on

/ U

nit

s

A

B

M F E R M F E R

Page 30: Distributed Gaming using J2ME - SJSU Computer Science ......PDAs using J2ME, Servlets, JDBC and MySQL Acquire game borrows ideas from old computer game “Mule” Game world consists

Test Case Three: 4 PlayersResults

Comparison Chart

0

500

1000

1500

2000

2500

3000

1 2 3 4 5 6 7 8

Round 1 & 2

Pro

du

cti

on

/Un

its

A

B

C

D

M F E R M F E R

Comparison of Score values

0

5000

10000

15000

20000

25000

1 2

RoundsS

co

re

A

B

C

D

Page 31: Distributed Gaming using J2ME - SJSU Computer Science ......PDAs using J2ME, Servlets, JDBC and MySQL Acquire game borrows ideas from old computer game “Mule” Game world consists

ConclusionPossible applications of this project

Economic simulationsStrategy game

Similar ApplicationsThe Economics classes are generally passive andapplications like these will help in the betterunderstanding of the Economics concepts

http://www.people.virginia.edu/~cah2k/programs.htmlhttp://www.irean.vt.edu/research_workshop_april2003/03_Goad.pdf (Wireless Interactive Training Solutions)

They claim that they had good success using PDAsin the classrooms for their experiments

Page 32: Distributed Gaming using J2ME - SJSU Computer Science ......PDAs using J2ME, Servlets, JDBC and MySQL Acquire game borrows ideas from old computer game “Mule” Game world consists

Future EnhancementsBetter security features.More types of products can beintroduced to make it more realistic.Implementation of more types ofauctions that are possible in the realworld.

Page 33: Distributed Gaming using J2ME - SJSU Computer Science ......PDAs using J2ME, Servlets, JDBC and MySQL Acquire game borrows ideas from old computer game “Mule” Game world consists

Questions?