60 likes | 218 Views
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.
E N D
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 Player1 Inputs Player2 Inputs Player2 Updates Player1 Updates Player1 Player2 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.
Communication Details • 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
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.
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