Summary | Networked game: exploit the game by modifying the client code, or protect the server from nefarious clients. |
Topics | Socket communication, game design, code reading. |
Audience | Operating systems or other upper-level course. |
Difficulty | Variable, based on student interest. The server defense is more difficult than the client attacks. The client attacks vary in sophistication. |
Strengths | This assignment is fun and a good stress relief before final exams. It requires some creative thinking on the best way to take advantage of the existing system. It allows the instructor to partition the class into different roles to take advantage of differences in student ability and interest. |
Weaknesses | Only a few important concepts (server defense) are covered. Not all students see the big picture. |
Dependencies | This project is based in Java,
though it could be adapted to other environments. Requires fairly good code reading writing skills to be competetive. Does not require students to know how to write threaded code, but that knowledge is helpful when working on the server. Some knowledge of game programming is helpful for the client programmers, but the instructor can provide suggestions. |
Variants | The instructor can create any type of networked game instead of this collection game. |
The motivation for this assignment was an opportunity for the students to improve their code reading and writing skills in the context of a networked Java program. This was the last lab activity in the semester for a course in operating systems and networking.
The program is a simple collection game (see screenshot). Each player moves an avatar around the screen collecting exclamation points (representing knowledge). The player earns one point per collect. The game is networked so that several players are competing simultaneously. The players run client programs that communicate game state with a server program.
The real point of this assignment is not to have the students play the game, but to encourage them to "cheat" by rewriting the client code to make their client superior to the others. Any time the client disconnects, the player's current score is stored on the server, so experimentation is encouraged.
The students had a fun time with this lab activity. I put it at the end of the term for stress relief before final exams.
The class is split into two groups: students working individually on clients, and students working together on the server. (In my class I had 5 clients and 2 students on the server.) The clients try to exploit the system by improving their client, and the server admins try to block the exploits by patching the server.
Some students get caught up trying to improve their skill at the game. They have to be given a nudge by the instructor to try to come up with a better exploit.