CS494, Spring 05: HW4
Open-source Software: the game Tyrant

"Tyrant is a graphical roguelike fantasy adventure game. It features intricate randomly generated landscapes, towns and dungeons. It is written in Java with a highly extensible game engine."

How to Import Tyrant into Eclipse

Importing is always an adventure, but this seems to work best. (Email me problems or comments, please!)
This has been tested with and documented for Eclipse 3.0.1.

  1. Determine the directory for your Eclipse workspace (i.e. the folder where it will put your project files).
  2. Download the tyrant zip file and the forms-1.0.5.jar from above.
  3. Extract the the Zip file above into that directory, making sure it unzips all files and keeps the subfolder names. So, if your workspace is in C:\MyFiles\eclipse\ then you should now see a directory C:\MyFiles\eclipse\Tyrant1\ with all the Tyrant files below that.
  4. Now start Eclipse, and start the process of creating a new Java Project.
  5. In the first window that comes up (labeled Create a Java Project), type the name Tyrant1 as the project name. Note that the message that says: The specified external location already exists. If a project is created in this location, the wizard will automatically try to detect existing sources and class files and configure the classpath appropriately. Ooh, that's sound lovely, eh? There's one thing though -- this package points to where the required junit and forms jar files are on my computer. So hit Next and go to the next screen.
  6. On this screen, Java Settings, you should see a message at the top that says "2 build path entries are missing." We'll first remove them and then add them back with the right values. Go to the Libraries tab. Remove the entries for both the junit and forms jar files.
  7. On that same tab, hit Add External Jar. Find the junit.jar file on your system; it will be in the org.junit_3.8.1 folder in the plugins folder under your Eclipse install folder
  8. On that same tab, hit Add External Jar again. Find the forms-1.0.5.jar file you downloaded (see earlier) and add it.
  9. Now click Finish. You should see Eclipse building your project in the bottom-right corner of the main window. When it completes, there should be no red-icons next to the Tyrant1 project, and only one thing listed in the Project view (an unused import).

Make sure you can work with your project. First, make sure the tests run. Under Tyrant1, right-click on mikera.tyrant.test and choose Run->JUnit Test. Tests start to run -- click on the JUnit view and see if the green-bar appears for the 212 test-cases.

Can you run the game? Right-click on mikera.tyrant and choose Run -> Java Application. Two files in this package have main() methods, so when it asks choose to run QuestApplication. See the game appear? You'll also see some things dumped to the Console -- I think you can ignore those.

For HW4, what you want to do with this system is up to you! Refactoring or design recovering are things you can do. Note there are a lot of classes in the major packages, so creating class diagrams from these would be pretty messy. You might want to think about moving classes into new packages first, perhaps based on what we learned about package design.

As you do your work on HW4, be sure to write up what you're doing and why. We'll use this to grade what you did as much as we'll grade the final set of Java files.