Project 6: MUD Game

6.005 Elements of Software Construction
Fall 2007
Due: Tuesday, December 11, 5:00 PM

Problem
Purpose
Architecture
Specification
Tasks
Deliverables and Grading
Hints
References
No Late Project 6 Submissions

Because of the proximity to the semester's end, the staff will not be able to accept late Project 6 submissions. Please plan accordingly, and start work well in advance.

Problem

In this project, you will design and implement a text-based multiplayer game, commonly known as a MUD (Multi-User Domain). Players will be able to connect to the game using their web browser, and play by entering commands into an interactive web application. Traditionally, the world of a MUD consists of a graph of interconnected rooms, as well as items and characters. Using text commands, players control characters, which interact with the world around them. Your system will include both the back-end world of the MUD, and the web server that provides a text interface to clients.

Examples of MUDs can be found at Top MUD Sites.

Purpose

The purpose of this project is to give you experience developing a program with a rich, relational state, and in particular:

You will also become familiar with the fundamental architecture of a web server, and with the use of XML as a machine-readable interchange format.

Architecture

Your MUD will be played in a web browser, which means your game world will function as a component in a web server. The MUD game's user interface will be interactive, continually accepting the commands of clients, and dynamically update their browser pages with new messages. One standard way to do this is to design an AJAX web application (Asynchronous JavaScript And XML) that uses JavaScript code running in each client's browser window to send and receive messages after the page has been loaded. With this technique, the user's web browser becomes the interface for an interactive web application, with the web server acting as the backend.

We've provided you with the essential code for a web server infrastructure, which you have experimented with in the project lab. You are free to use this code in your project, modifying it in any way you please. You may also reimplement the infrastructure if you prefer (but we do not recommend that you do).

Specification

Server/Game Interface

Your project will consist of two components: a MUD game, and a web server that lets users play the game using a web browser. The design of both components is entirely unconstrained. However, an important criterion that will be used to judge your design is how well you have decoupled the game and server components so that it would be possible to reuse the game component with a different server (and perhaps not even in a web context).

Text Interface

The text interface should provide the functionality of the game to its players in a helpful and understandable manner. Players should be able easily to determine which actions apply at a given time, and should be notified of important events in an informative and entertaining way. Erroneous input should be handled gracefully.

The MUD World

You have complete freedom to determine the content and behaviour of the MUD world. To ensure that your MUD is sufficiently challenging to design and implement, it should include at least these elements:

XML Configuration

The structure and function of the game world should be configurable with an XML file that is read on initialization of the game. For example, the XML file might specify the layout of rooms and their interconnections, and an initial placement of items and bots. At least one XML file that results in an interesting configuration should be provided.

Synchronization

The provided web server will create a new thread to handle every request it receives, meaning that if you use the provided infrastructure, multiple threads will be calling the ApplicationServer's methods. In fact, you should not only assume that multiple clients may make concurrent requests, you should also assume that a single client may make multiple simultaneous requests. (One way this might happen is if a user enters a message at the same time that the page is requesting new messages to render.) Therefore, your MUD application must have a synchronization model to ensure correctness.

MUD Fair and Staff Awards

On the final day of class we will be holding an exhibition in which you will have the opportunity to show your group's MUD to your classmates and to see what other groups did. The staff will award two prizes: one for best software design, and the other for best gameplay experience.

Milestone Meetings

Since no extensions will be permitted on this project, and the project is expected to be challenging, you will have to start early. Two required milestones have been established to help you and your partner get started:

Tasks

  1. Define. Decide on the rules and objects in your MUD, and construct a problem object model that captures your design.

  2. Design. Construct a code object model that shows how your problem object model will be realized as Java classes, and draw a dependency diagram showing what dependences you expect between the classes. Your code object model need not include existing classes in the web server component, but your dependence diagram should show how the web server and game components are connected.

  3. Implement. Divide your MUD's functionality into sets of dependent features, implementing and testing one set at a time. Start with the most basic set of features, and move on to the next set only when the current set is complete and tested. You will likely want to review and update your design models as you refine the design.

  4. Test. Design and implement a test strategy for the game as a whole.

  5. Configure. Construct at least one interesting XML configuration file that shows off the features of the MUD.

  6. Demonstrate. Record an interesting and representative transcript of a user playing your MUD. Though the transcript should be from the perspective of only one player, other players can be present on the server to present a more complete view of the game.

Deliverables and Grading

Your deliverables for the project are:

  1. The code for your system as a compilable Eclipse project, along with JUnit test cases and Javadoc for all your classes. All classes should have a rep invariant and abstraction function, explained informally and implemented in code.
  2. At least one configuration file.
  3. A text file named transcript.txt that provides a transcript of a user playing your MUD.
  4. A text file named readme.txt that briefly describes the following:
  5. PDF diagrams of your problem object model, code object model, and dependency diagram.

All files should be in plain text or PDF with appropriate filename extensions.

90% of your grade will be allotted to the software design and implementation, of which 50% will be allotted to code (half for structure and half for correctness), 20% to the design models, and 20% to the testing strategy, test cases, and test output. The remaining 10% will be allotted to the quality of your game design, with an emphasis on uniformity, elegance and power rather than domain-specific creativity.

Hints

References