Project 2012: make Tyrant multilingual

Project 2012: make Tyrant multilingual


Tyrantis a game of heroic adventure, where you pit your wits and cunning against a fearsome array of monsters and Þendish puzzle in your attempt to gain fame and fortune.

Tyrant is a graphical Roguelike fantasy adventure game in the tradition of many other great games such as the original Rogue, Nethack, Angband and ADOM. It features intricate randomly generated landscapes, towns and dungeons. These games emphasize addictive gameplay and randomly generated universes to create an immersive and imaginative game that looks deceptively simple yet contains a great deal of detail and strategic depth.

It is written in Java with a highly extensible game engine.


As a reengineering team, you are asked to restructure the architecture and implementation of Tyrant such that Tyrant can easily be released as a multilingual game.

Thus, the choice of the natural language for the GUI and the messages to the user of a certain Tyrant-release, should become an implementation detail. Note: languages like Hebrew and Arab - written from the right to the left - should also be supported. 

More specifically, we ask you to perform the following activities, and report about these in your project report:

[Design recovery]

  1. Describe the current design of the implementation of Tyrant. Clearly indicate how this design is located in the architecture of the project.


    1. Compose a generic design that describes how the userinterface functionality can be extracted from the current design, and that gives insight in how the design handles the interaction with the user. This interface should clarify that the choice for a specific language to communicate with the user is merely an implementation detail. It will be necessary to redesign the test suite in such a way that it can cope with a multilingual game.


      1. Estimate the effort required for (i) refactoring towards the new userinterface; and (ii) changing/extending the tests.


      1. Refactor the current implementation of Tyrant such that it can handle multilinguality.

      2. Adjust/extend the tests of the project to preserve their effectiveness and coverage during and after refactoring.

You will be required to perform a number of techniques presented during the lab sessions. These are:

  • Analyse:
    • Duplicated Code Analysis
    • Mining Software Repositories
    • Metrics and visualization
  • Restructuring:
    • Testing
    • Refactoring

This project emphasizes the sound, systematic analysis of the presented problem, the associated solution space and the chosen solution(s). The software reengineering sessions are composed in such a way as to prepare you for such a project. We stimulate you to assess the benefits and drawbacks of the techniques presented in the lab sessions, and ask you to exploit the analysis techniques wisely. You are free to use alternative analysis techniques.

What concerns the refactoring-part, we emphasize the use of tests. Our minimum requirements are:

  • Determine the extent to which the current tests provide feedback on your future refactoring-steps. Quantify this.
  • Compose an argument discussing why the tests are (in)adequate for your chosen refactoring scenario, and adjust the tests in case this is required. Be efficient with regard to the time invested in testing.


To show that you have passed the assignment, you will have to demonstrate the following:

  • You have made a selection of analysis techniques (e.g., duplicated code analysis, mining software repositories, metric and visualization as seen in the lab sessions, but others are allowed as well), and have applied these techniques in a sound, systematic manner. You have indicated clearly (using screenshots, results of the interpretation of the output of the techniques) how you have used the results of these analysis techniques.

  • You have performed the above 5 activities (decomposed into (i) Design Recovery; (ii) Design; (iii) Management; and (iv) Refactoring) and discussed them in your project report.

  • The restructurings you have applied are behavior preserving.

    • You can demonstrate the mapping between each of the classes from the original structure with the new structure.
    • The compilation process succeeds flawlessly.
    • The tests run without flaws, and demonstrate clearly that the new userinterface is implemented correctly.
  • The introduction of the new design clearly indicates the project is ready to be released in a language of choice. You are not supposed to carry out the refactoring process completely. Select and execute a set of refactorings that sufficently illustrate your proposed solution.


Aspects that we typically like to see addressed in the report are:

  • Context: Briefly discuss the context in which you are running your project.
  • Problem at hand: Clarify the problem at the base of the project, and indicate its intrinsic difficulties.
  • Project management:Demonstrate how you have organized the work, and how you are controlling it (instead of the work controlling you!)
    • Scope: What are the boundaries of your project? What is not included in the project?
    • Risks: Which risks were envisioned, and which have been mitigated? What is the priority of the risks that still need to be migitated? E.g., which external dependencies might have an affect on your outcome? Which alternatives have you prepared in case this risk instantiates?
  • Software reengineering:
    • Tests: How can you verify that you satisfy the requirements? Which testing strategy have you selected, and what are the arguments for this selection? How confident are you that your solution satisfies the requirements?
    • Quality assurance: What are the non-functional requirements? E.g., how do you differentiate between a good and a bad solution?


Two UA-students started in 2005 with refactoring Tyrant in order to seperate the engine from the GUI. They documented their findings and committed an (incomplete?) version of their report to a branch in the CVS repository. You can consider their work as available documentation. But as good software reengineers you should validate their findings before using them in your own reengineering process.

Note: similar to previous years, it is once again possible to submit your own project proposals. These proposals will be approved in case they provide a well-structured exercise on the reengineering techniques presented in the lab sessions. E.g., you can always propose to reengineer another software system, for instance the software system used in your thesis, or written for another case.

Questions by Students

Question by Ronald DK


I started looking at the project.  First I had issues getting the source using the following inputs:
Repository path:/cvsroot/tyrant
User: anonymous
Connection type: pserver
I could not connect to the server (connection refused error message) so I downloaded the tarball and imported that into an empty project in eclipse.
I set the compiler to version 1.7 and installed JRE 7 as the documentation described.  After refactoring the imported packages back to what I believe they should be I have the following issue,
import mikera.tyrant.util.Maths;
import mikera.tyrant.util.Rand;
Gives compilation issues as I don’t seem to have these classes in the mikera.tyrant.util package.  They are not in the tarball (I don’t know if they are in the cvs as I cannot seem to access that)
This is not a major issue as I can replace these 2 classes with the standard Java math classes, but this will be a change to the application not directly tied to our assignment.
Is it ok for me to do this?
Please let me know if I have gone completely wrong and am the only one experiencing these issues.

Answer by Jan V.

Your workaround is ok with me.  Other students can report their experiences on this issue by sending an email to jan.vlegels[at]

Answer by Simon VM

I did not have any problem checking out the code from the CVS server. However, it seems you already fixed this problem by downloading the tarball.

I also had the problem regarding the missing classes Maths and Rand. The solution you propose, however, will not work. Tyrant uses some methods (like the r method in Rand) that are not present in the standard Java classes. On top of that, all source files would need changing to replace those classes by their default Java implementations... Not a very pleasant job.

The correct solution is to checkout mikeralib from The tyrant project depends on this one, and if it's present in your workspace all errors will be fixed. This was tested in Eclipse, by the way.