6.170 Software Studio | Spring 2012
Assignment 5: Adventure Game
Due: 1pm, Monday April 16, 2012

Purpose

The purpose of this assignment is to give you:

Background

One of the early genres of computer games was text-based Adventure Games such as Colossal Cave Adventure (1976) and Zork (1979). The user interacts with the game through a text-based terminal interface, moving through a maze of rooms and interacting with items in the game through simple verb/noun commands such as "go north", "take key", or "unlock door". Here is a modern web-based example from The Things That Go Bump In The Night:

You are in the small security office at the local smelting/refining plant. The office has windows that overlook the entrance and main road into the plant. Three sets of security monitors afford you camera views from different areas within and without the complex. The door to your office is open to the east.
You can see Three Security Monitors, A Hand Radio, Some Cabinets and A Telephone here.
You can go east.

> look monitors
You scan all the monitors closely and find no activity on any of them. After a little bit they start to switch madly between cameras. Back and forth flashing rapidly. (What the duece!) You thought you saw some kind of strange shape in one of them. (Nah.. must be some kind of a power glitch or something.)
After a minute or two the monitors suddenly go completely blank and the power suddenly goes out! Emergency lighting kicks in but the cameras remain blank.

> take radio
You pick it up.

> go east
You are in the foyer of the security building. Your office lies to the west. To the east is a hallway leading to some private offices. There is also a short hallway to the north. The main door to the outside parking area is here to the south.
You can go north, south, east or west.

Many more examples of text adventure games can be seen and played here.

Your task

Your task is to design and implement a simple web-based text adventure game.

The design of your program and the user interaction is up to you. At the very least, your game should let the user:

  1. Interact with the game through simple text-based commands entered in a browser;
  2. Move between locations, restricted by a predetermined map;
  3. Pick up items in a location, and see a current inventory of items available in that location;
  4. Use items to make progress, for example, by entering a room that is accessible only if a given item is held;
  5. Win the game by reaching some predefined objective (e.g., by finding the holy grail in the final locked chamber, or escaping from the haunted caves without being eaten by a grue).
  6. Play when other users are playing too, but not necessarily interact with them (or even see them).

The details of your implementation are also left up to you, but must meet some basic requirements:

  1. The browser should communicate with the server using asynchronous calls, so that there are no page reloads when a command is entered.
  2. The game configuration (eg, the map of rooms, initial placement of items) should not be hardcoded, but should be loaded from a configuration file.
  3. The game configuration and the current state should be stored using SQLite on the server side.
  4. You should use Flask (and possibly Jinja) for the back-end, and HTML/CSS/JavaScript/JQuery on the front-end.
  5. Your game should run on the csail deployment server, as the graders will use when they try to run your game themselves. It should also work if moved to a different directory, as the staff may need to copy the contents of the folder onto their local machine and run it there. See also the requirement to supply a script to set up the database in the What to Hand In section below.

Deliverables

Your solution to this assignment should include the standard components, as listed in the project checklist (and whose purpose is explained here).

In addition:

Handin

Follow the assignment guidelines for handing in your code. To deploy a live version of your site that will be used for grading, we recommend that you read our deployment tutorial.

Hints

Clarifications

None yet.