Spring 2003
Programming Assignment 1: Renaldo: A simple Multi-player Game
Due: Friday, Feb 28th noon
(for off-campus students - 15 days after viewing Lecture 6)
This project has two purposes: first to get you familiarize with sockets/RPCs/RMIs, processes, threads; second to learn the design of multi-player games.
You can be creative with this project. You are free to use any programming languages (C, C++, Java, etc) and any abstractions such as sockets, RPCs, RMIs, threads, events, etc. that might be needed.
In this project, you need to design a simple multi-player game based on a centralized architecture (in a later assignment, we will make this game fully distributed).
In this assignment you will implement a multi-threaded multiplayer game
server. Renaldo is a new graduate student in the Computer Science department.
Key to Renaldo's survival is obtaining adequate nourishment throughout the
course of his tenure at UMass Computer Science. Fortunately for Renaldo,
after various talks and functions throughout the department, leftovers are
often put out for general consumption.
Renaldo's world is a 100x100 grid representing a floor plan of the Computer Science department. This grid (see figure) has walls (the shaded blocks in the figure) and a doorway (the darkened block in the figure). New players may enter the game at any time. A new player enters the game through the doorway. If multiple players attempt to enter the game at the same time, these players must wait in line to enter Renaldo's world. Each player is identified in the game by the letter "R" concatenated with a number. For example "R1" is the identifier for the first player to enter the game. Subsequent players are identified by R2, R3, etc. Renaldo maintains a counter representing his energy level. Renaldo may execute an action to move up, down, left or right. Each time Renaldo moves, his energy level is decremented by 1. If Renaldo bumps into a wall, his energy level is decremented by 1 and he makes no forward progress.
As Renaldo navigates through his world, a number of leftovers will randomly appear in unique random locations in the grid. You are to have 3 each of the following food items at all times during the game:
You are to have 2 each of the following items at all times during the game...
Deploy a game server with multiple players. They can be setup on the same machine or different machines.
Do a simple experiment study to study the scalability of your game. Measure the response time of user moves with varying number of players. Does the response time degrade with a larger number of players? (since it may not be feasible to have actual players play the game for these measurements, you can write a client that emulates an actual player by making random moves, and measure the resulting response times). If needed, plot a graph showing measured response times to support your conclusions.
When you have finished implementing the complete assignment as described above, you will submit your solution in the form of printouts.
Each program must work correctly and be documented. You should hand in:
- A seperate (typed) document of approximately two pages describing the overall program design, a description of "how it works", and design tradeoffs considered and made. Also describe possible improvements and extensions to your program (and sketch how they might be made). The writeup should include discussion of communication/RPC mechanism, protocol(s), synchronization/locking, concurrency.
- A program listing, neatly formatted, containing in-line documentation.
- A seperate description of the tests you ran on your program to convince yourself that it is indeed correct. Also describe any cases for which your program is known not to work correctly.
- Performance results.
Let us not waste a lot of trees. So, if any of the above turn out to be large, just save the relevant information in a file, leave it on your EDLAB account and submit the name of the file.
Grading:
- Program Listing
- works correctly ------------- 50%
- in-line documentation -------- 15%
- Design Document
- quality of design ------------ 15%
- understandability of doc ------- 10%
- Evaluation, Thoroughness of test cases ---------- 10%
Grades for late programs will be lowered 12 points per day late.