Assignment 1: Server-based Two-player Pong


In this assignment, you are to implement a two-player Pong game in Java using client/server architecture to improve the consistency of the game and make the game playable in the presense of network delay.

Due Date:

1 October, 2007



You should do this assignment in a team of 1-2 person. Note that Assignment 2 will be a continuation of Assignment 1. Switching team is strongly discourage.

Grading Criteria


The source code of a one-player Pong game is given to you (See below). Your task is to turn it into a networked, two-player, Pong game. In a two-player Pong, each player controls a paddle, one at the top and the other at the bottom of the screen. The goal of a player is to return the ball to the other side. When a player fails to return the ball, the opponent gains a point. To implement this two player Pong, you need to implement the communication component of the client, the server (from scratch), and whatever synchornization/compensation/prediction techniques you think is necessary to make the game states more consistent in the presence of large delay. You need not limit yourself to the techniques taught in class. You may use any Pong-specific techniques, or new methods that you come up with. This is an open ended project.

To simulate network delay, your server should include two command line arguments that specify the delay between the server and each of the player. Your server will then delay the processing of the packets received according to the delay, in order to simulate the network with large delay. (Note that this artificially induced delay is NOT the same as the lag induced by the server to improve fairness).

It is important to justify the techniques that you choose. For example, if you want to sacrifice responsiveness in favour of consistency, you should justify that, back it up with evidence (for example, a small scale subjective tests among your friends).

You are encouraged to discuss your approach with the instructor or among yourselves on the IVLE forum.

You may improve upon the game as you see fit (for example, fancy UI, sound effect, visualization of the states at the server). If you need to change the rules of Pong game, however, you need to ask for permission from instructor (This is to prevent, say, you make the game into turn-based two player Pong).