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
- Source code
- A 5-page report (single spacing, 11 point font) detailing your implementation. You should justify the techniques you choose to use in your implementation
- A demo and presentation
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.
- Correctness (50%) -- correct implementation of what you claimed, use the right choice of properly justified techniques.
- Achivement (20%) -- amount of work done, novel techniques used, effort in UI improvements etc.
- Source code (5%) -- well structured, properly formatted and documented
- Report (10%) -- well structured and well written.
- Demo/Presentation (15%) -- explain clearly, able to answer questions etc.
The source code of a one-player Pong game is given to you (See Pong.java 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).