CSCI 1321 (Principles of Algorithm Design II), Spring 2010:
Project Description


Contents

Overview

The assignments for this course are all parts of a single project that spans the entire semester. For this project you will write code that integrates with code written by Dr. Lewis. His code forms a framework for arcade-style games, but is flexible enough to allow for a lot of variation, so you have considerable freedom with regard to exactly what kind of game you want to create. This page outlines the game framework and describes other requirements common to all the assignments.

The game that you will be writing is what you might call a screen-based or arcade-style game. Your game will have a ``player'' character controlled by the human player. The player moves around a playing field consisting of one or more two-dimensional ``screens''; the screens can be linked together such that when the player moves to a particular part of a screen it automatically jumps to another screen. Each screen is composed of a regular grid of blocks; blocks represent different things that the player character can interact with -- floor, walls, ladders, etc. You can have as many or as few kinds of blocks as you need for your game; blocks represent things that do not move but can change based on the player's actions (though this imposes other restrictions). In addition to the human-controlled player character, the playing field can be populated by other characters or entities. These entities can move around the playing field and interact with the player and each other. You can have as many or as few kinds of entities as you need for your game. It is simplest to make each entity (and the player) one grid cell in size, but the framework allows some flexibility in this regard. You will have access to two tools, a ``screen editor'' program program to lay out the playing field and an ``image editor'' program to create graphics for your blocks, player, and other entities. (Be advised, however, that you can also use graphics files created with other programs.)

The state of the game advances roughly 20 times each second; we'll call this interval a ``tick''. Each entity (including the player) has a method that gives the next tick in which it wants to be updated and a method that describes how it should be updated. Using these methods, on each tick the game framework identifies all the entities (player and others) that want to be updated in that tick and then updates them.

You should note that there is a lot of flexibility here, and you have significant control over exactly what you produce in the end. I encourage you to be creative, but remember that you need to be able to implement your design, and it will probably be more satisfying to finish something not too complicated than to tackle something overly ambitious and not be able to finish it. If you want to try something ambitious, try to think of a way it can be scaled back into something still playable if the original design turns out to be more difficult than anticipated. I also encourage you to focus your creativity on functionality rather than appearance; your grade will be based mostly on functionality, and I think you will learn more by making your game do interesting things than by focusing too much on the details of appearance.

The game framework

To write your game, you will need to create subclasses of several interfaces defined as part of Dr. Lewis's game framework. If you do this, your code will fit together neatly with the framework code that defines the main GUI for the program and provides the 20-updates-per-second functionality, The main interfaces for which you need to write code are as follows. Refer to the project framework API for details.

General requirements

Each assignment consists of two phases, design and code. For each phase, you will turn in something by e-mail, which you should just send to my regular e-mail address (bmassing@cs.trinity.edu). When you do this, please use a subject line that mentions the course number/name and which assignment you're turning in (e.g., ``csci1321 hw1 design'' or ``PAD II hw1 design''). Assignments are due at 11:59pm on the date given on the ``Lecture topics and assignments'' page; I will use the timestamp on the e-mail to determine whether they are on time.

I strongly encourage you to do the assignments using Eclipse, though you can use some other tool(s) if you prefer. I also encourage you to create a new project for each assignment, and to put your code in a package named according to the Java conventions for packages (edu.cs.trinity.yourusername.yourgame, where yourgame is something descriptive of your game -- e.g., pacmanclone). For all the assignments except the first one, once you have created a new project you can simply copy into it the package from the previous assignment.

Design

You will be turning in design documentation prior to every assignment for this class. You will also turn in modified/finalized designs when you turn in each of the assignments. This sounds like it might be a lot of work, but with Java documentation comments and Eclipse it is pretty easy. When you write your code, you will include documentation comments (``Javadoc comments''); you can then use Eclipse's built-in feature or the javadoc command to turn these comments into HTML. (The API for the project framework was generated in this way.)

To make it easy for me to find everyone's documentation, I want you to put yours in a specific place in your home directory on the department's Linux file and Web server, where it can be accessed via a Web browser. (You can have Eclipse put it there directly, or you can copy it there later.) Anything you put in Local/HTML-Documents in your home directory can be accessed from the Web (assuming it is world-readable). So: Within this directory, create a subdirectory CSCI1321. Documentation for individual assignments will go in subdirectories of this directory -- HW1 for Homework 1, HW2 for Homework 2, etc. Within each of these subdirectories there should be a subdirectory Design containing documentation generated in the design phase and a subdirectory Final containing documentation generated in the code phase. (Usually these will be pretty similar, but maybe not always.) So, for example, your documentation for the design phase of Homework 1 should go in Local/HTML-Documents/CSCI1321/HW1/Design. Notice that case is significant on UNIX systems (e.g., Design and design are different).

Step-by-step instructions for each assignment

Notice that unless you want your code to also be world-readable (which I think you don't at this point), you probably should not put it in Local/HTML-Documents.

A final note about the format of the documentation comments: Since they will be turned into HTML, you can use HTML tags to do any formatting. For example, if you want multiple paragraphs, you can get this by enclosing each paragraph in <p> and </p> tags. If you know more HTML, you can incorporate additional formatting such as tables, if you think that will make your meaning clearer.

Code

For the code phase of each assignment, you will be turning in code and also generating a final (for that assignment) version of your documentation. To turn in code, I want you to e-mail all the relevant files to me -- the .java files that contain your source code, plus any image or other files needed to run your game, as described below.

Step-by-step instructions for each assignment

Assignments

This section summarizes what you will do in each assignment. Follow the links for more complete descriptions.

Hints and tips

Eclipse

Creating a project using Eclipse was demonstrated in class. Some things to keep in mind:

File transfer

If you plan to install Eclipse on your own computer and work on your game there, at some point you will need to transfer files from your computer to your home directory on the lab machines, and possibly vice versa. There are several ways to do this:

If you want to be able to work on your game on your own machine and also on the lab machines, you could use any of these approaches to simply copy all needed files back and forth. The files you would need to copy are the .java files from your Eclipse workspace, plus any other files (e.g., images) needed to run your game. Or you could use CVS, described below.

CVS

As noted above, if you want to be able to work on your game on your own machine and also on the lab machines, you can just copy needed files back and forth. A less tedious and more professional approach is to use CVS; the drawback of this approach is that it is somewhat more work to set up. The idea of CVS (and other similar tools) is that you have a master copy of your files in one centralized place (a ``repository''), and then you have local copies on every machine where you want to work on them, which you ``check out'' from the repository before starting to make changes, and ``check in'' to update the master copy. Below is a short overview of using CVS with Eclipse -- far from complete or comprehensive, but perhaps enough to get you started.

Command-line Java tools

Remember, too, that you can compile and run Java programs and even generate HTML documentation using command-line tools, if for whatever reason you can't or don't want to use Eclipse. See Java Without an IDE for details. If you do this, the next time you open the project with Eclipse, it should pick up any changes you made with other tools. (If it doesn't seem to, right-click on the project name and select Refresh.)

Project tools

Dr. Lewis has written two programs that you may find helpful, a ``screen editor'' program program to lay out the playing field and an ``image editor'' program to create graphics for your blocks, player, and other entities. To run one of these programs, you have two options:



Berna Massingill
2010-04-29