wireless pong on the nokia 770

6
Wireless Pong on the Nokia 770 Jason Waterman EE194-WIR April 27th, 2006

Upload: anakin

Post on 13-Jan-2016

43 views

Category:

Documents


0 download

DESCRIPTION

Wireless Pong on the Nokia 770. Jason Waterman EE194-WIR April 27th, 2006. Platform and Game Choices. Why Pong? Pong is a classic video game Not turn based, so interesting to implement Why Nokia 770? I own one It runs Linux Possible to do most development on a desktop. Game Server. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Wireless Pong on the Nokia 770

Wireless Pong on the Nokia 770

Jason WatermanEE194-WIR

April 27th, 2006

Page 2: Wireless Pong on the Nokia 770

Platform and Game Choices

•Why Pong?

•Pong is a classic video game

•Not turn based, so interesting to implement

•Why Nokia 770?

• I own one

• It runs Linux

• Possible to do most development on a desktop

Page 3: Wireless Pong on the Nokia 770

Under the Hood

• Client server architecture

• Clients connect to server at known port to start

• Written in Python

• Uses pygame which is based on SDL

• Very portable, runs on Linux, Macs, PCs.

GameGameServerServer

Player1Player1 Player2Player2

Player1Inputs

Player2Updates

Player2Inputs

Player1Updates

Page 4: Wireless Pong on the Nokia 770

•Players talk to server via TCP socket connection

•Every time a player moves the paddle, an update message is sent to server

•Server will relay this new position to the other player

•Only one message format is used to simplify the design

• Message contains ball position, ball angle, paddle position, timestamp, and event (Update, Hit, Miss, Launch)

• Data is transfered over the network using Python’s marshaling functions called pickle

Communication Details

Page 5: Wireless Pong on the Nokia 770

Dead Reckoning and Time Synchronization

•Ball position is calculated using dead Reckoning

•Each player locally calculates ball position for each frame, but it is possible that local calculations can get out of sync with server

•So, server occasionally sends ball status and players can update with that information

•Players clocks must be synchronized with the server for this to work.

Page 6: Wireless Pong on the Nokia 770

Conclusions

•Nokia 770 is a good platform for mobile networked games

•Python and SDL and run fine on the 770 and allows one to quickly develop games

•UDP is better then TCP for realtime updates

•Time synchronization is very important for dead reckoning