download powerpoint presentation

31
Taking Tiger Woods Java Golf Online Taking Tiger Woods Java Golf Online Phil Sorger Robert Burnett GAMEDevelopers Conference 2000

Upload: sammy17

Post on 29-Jun-2015

352 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Download PowerPoint Presentation

Taking Tiger Woods Java Golf OnlineTaking Tiger Woods Java Golf Online

Phil Sorger

Robert Burnett

GAMEDevelopers Conference 2000

Page 2: Download PowerPoint Presentation

What We’ll CoverWhat We’ll Cover

EA San DiegoJava Perceptions and RealitiesCyberViewerPGA TOUR Golf OnlinePorting C++ to Java

Page 3: Download PowerPoint Presentation

It takes an InternetIt takes an Internet… the new platform!… the new platform!

Page 4: Download PowerPoint Presentation

It takes an InternetIt takes an Internet… the new platform!… the new platform!

• Old Audience – GamersQuake, Wing Commander, Command & Conquer, Ultima, Madden Football, MS Flight Simulator

• New Audience – EveryoneBass Fishing, Barbie, Bargain Product, Millionaire

• The BrowserExplorer 3, 4, 5Netscape 3, 4, 5AOL 4, 5

• The LanguageJava – SunJava - Microsoft

Page 5: Download PowerPoint Presentation

It takes an InternetIt takes an Internet… the new platform!… the new platform!

• The client machinewide variety of architectures

- Macintosh- PC- Unix ...

200 to 1000 megahertzvideo accelerationconnection speed

- AOL users - 28.8 (56k connected at 14.4)- Cable, DSL - heavy users, influencers

• Our Audience "Golf Fans“Men and WomenMultiplayer, chat orientedlots of disposable income, well educated

Page 6: Download PowerPoint Presentation

Java as a PlatformJava as a Platform

PerceptionsSurprises ProblemsRealitiesPortingRecommendations & Alternatives

Page 7: Download PowerPoint Presentation

Java PerceptionsJava Perceptions

Multi-platform – PC, Mac, Unix … Portable Easy to Code and Port from C++ Secure Supported Efficient

Page 8: Download PowerPoint Presentation

Java SurprisesJava Surprises

Builds even a big project *very* fast Easy to publish patches Generates reasonably small code Hard to crash a machine, leak memory or

scribble on the screen Hugely scaleable Language very flexible

Page 9: Download PowerPoint Presentation

Java ProblemsJava Problems

Slow execution speedNo hardware access (acceleration)

– 2D/3D video, audio, inputLimited Multimedia APIsBuilt-in support stops at 1.1.xMemory Management and Garbage

Collection

Page 10: Download PowerPoint Presentation

Java – Perceptions vs. RealityJava – Perceptions vs. Reality

Multi-platform not even Multi-Browser Portable VJ++ vs VisualCafe vs Sun Easy to port from C++ No enum

no primitive pointersno implicit constructionno right click

Secure Code validation causes slow startup

Supported Microsoft vs Sun Efficient The Internet Sucks

Page 11: Download PowerPoint Presentation

The ChallengeThe Challenge

Objective: allow users to follow (view) golfers in official EA Golf tournaments.

Maximize audience Browser based

Simplify development 100% Pure Java

Page 12: Download PowerPoint Presentation

The Solution - CyberViewerThe Solution - CyberViewer

Showcase EA SPORTSTiger Woods 99PGA TOUR Golf

Anyone with the retail game can compete

Multi-roundprofessional format

Cash prizes“$65,000 purse”

Archive winning performances

Page 13: Download PowerPoint Presentation

CyberViewer ComponentsCyberViewer Components

ShotHunter and ShotServer ServersJava Shotlist Replay Engine Website (previous screen)

Page 14: Download PowerPoint Presentation

ShotHunter and ShotServerShotHunter and ShotServer

Responsible for creating shot assetsHunter waits for new shotsServer replays shot and posts:

– Tee and Snap background jpegs– ReplayBuffer– Z Buffer– Shotlists

Page 15: Download PowerPoint Presentation

Java Engine ComponentsJava Engine Components

DASH Library/API– Display Animation Sprite Handler

Ported EA Code– Golf specific classes and routines

Main Game Control– User Interface

Page 16: Download PowerPoint Presentation

DASH and DARTDASH and DART

DART Animation Editor– DASH Animation Render Tool

Double-buffered Display– built-in Restore(), Blit() and Flip()

Generic Handlers– File I/O, Audio, Security, Version

Management, Animation, Debugging, Network I/O, 3D Cameras, etc.

Page 17: Download PowerPoint Presentation

Ported EA CodePorted EA Code

GolferGolfBall and GOLF_BALL_STATETGame, TPlayer, and ShotOverhead, Scoreboard, LiemeterReplay and ReplayBufferZBuffer, Camera and TGolfView

Page 18: Download PowerPoint Presentation

Sneak Preview Sneak Preview PGA TOUR OnlinePGA TOUR Online

Fully interactive Multi-player Golfers Courses Physics Web / Chat

Page 19: Download PowerPoint Presentation

Porting C++ to JavaPorting C++ to Java

I. Array of Objects or References?

II. Stack Object or just a Reference?

… watch out for “=“

III. The stdio and WINAPI Class

IV. Callbacks

V. Globals

Page 20: Download PowerPoint Presentation

Array of Objects or References?Array of Objects or References?

class BrainCell extends Point { }

class Brain {

public static final int kBrainCells = 100;

private BrainCell[] brainCells;

public Brain(){

brainCells = new BrainCell[kBrainCells];

brainCells[0].x = 0; // !NULL POINTER EXCEPTION!

brainCells[0] = new BrainCell();

brainCells[0].x = 0; // now it’s ok!

boolean[] bInUse = new boolean[kBrainCells];

bInUse[0] = true; // OK, primitive type!

}

Page 21: Download PowerPoint Presentation

Stack Object or just a Reference?Stack Object or just a Reference?

Point WorldToScreen(Vector3 ballV)

{

Point screenPt; //! Just makes a pointer (ref)

Vector3 v; //! same thing, just a pointer!

v.x = ballV.x; //!NULL POINTER!

v = new Vector3();

v.x = ballV.x // now it’s ok!

v = ballV; // not a Copy constructor!

// what happened to old v.x???

}

Page 22: Download PowerPoint Presentation

The stdio classThe stdio class

public static char[] strcpy(char[] dest, char[] src){

System.arraycopy(src, 0, dest, 0, src.length);

return dest;

}

public static String strcpy(char[] dest, String src){

src.getChars(0, src.length(), dest, 0);

return src;

}

public static String strcpy(String dest, char[] src){

dest = new String(src);

return dest;

}

//etc, etc, etc…

Page 23: Download PowerPoint Presentation

The WINAPI classThe WINAPI class

public static long time() {

return new Date().getTime();

}

public static MSG PeekMessage(int wRemoveMsg) {

if(messageQ.size()==0) return null;

MSG lpMsg = (MSG)messageQ.firstElement();

if(wRemoveMsg==PM_REMOVE)

messageQ.removeElement(lpMsg);

return lpMsg;

}

// etc, etc, etc...

Page 24: Download PowerPoint Presentation

CallbacksCallbacks

interface AcceptorCallback {

public void OnAccept(Socket s);

}

class CSock extends Socket implements AcceptorCallback{

void OnAccept (Socket s) { }

}

CSock cs = new CSock();

ServerSocket ss = new ServerSocket();

Socket acceptSocket = ss.accept();

((AcceptorCallback)cs).OnAccept(acceptSocket);

Page 25: Download PowerPoint Presentation

GlobalsGlobals

class Game

{

public static int gNumPlayers; // global

public static final int MAX_PLAYERS=4; // const

public static void PrintNumPlayers() { // method

System.out.println(“players=“ + gNumPlayers);

}

}

if(Game.gNumPlayers <= Game.MAX_PLAYERS)

Game.PrintNumPlayers();

// ALL GLOBALS BELONG IN THEIR OBJECT’S CLASS!!

Page 26: Download PowerPoint Presentation

RecommendationsRecommendations

Design the experience appropriately Limit real-time requirements Maintain focus on main applet Port standard C++ routines

– strcpy, memcpy, WININET, Peek/PostMessage, rand, fopen

Consider “dirty” Java– Blend pure and DirectX

Page 27: Download PowerPoint Presentation

Alternatives & ConsiderationsAlternatives & Considerations

ActiveX Execution Speed

Netscape Plug-In Support

Flash vs. Ease of development

C++ Application Size Requirements

Java Script “Time to Play”

HTML / ASP Asset conversion

Page 28: Download PowerPoint Presentation

Design IssuesDesign Issues

Pacing of the experience- Keep the user occupied

readingplayingwatchingchatting

- Keep the user informed load timeswalk away time (advertising)

Page 29: Download PowerPoint Presentation

Design IssuesDesign Issues Single or Multiplayer

Manage wait - Turn based multi-player can get very slow

Group players based on …experienceinterestperformanceregion

Audience

Simplicity of operation

Page 30: Download PowerPoint Presentation

Information on JavaInformation on Java

Presentation materials available at www.easandiego.com

CyberViewer at tiger99.easports.net/viewer

Java information from Sun java.sun.com

Sun - JavaOne Moscone Center, SF. June 6-9, 2000.

Java programming tech shops developer.com

Page 31: Download PowerPoint Presentation

QuestionsQuestions