About me

Vladimir Nabokov

Books
Programming
Biochemistry
Aim | Communicate

Search
 


 

 

   
Letters from Terra - Life in water warmed by sunlight
 
 

     
 
 

     
Trooper II in action - click for more screenshots
 
 
     

Trooper II Source

The source for Trooper II, written exclusively in Pascal 6.0, has been available for some time, and I decided that it will still serve as a reference to my game for anyone who is interested in the development of a similar project. A note should be included her as to the structure of the source code. The game proper consists of three files; the general resource file, Edtools.PAS, which contains definitions of all the objects used by the game engine, the graphics engine and much of the underlying code, as well as some simple routines for the level editor; LevelEd.PAS, containing the main body of the editor, and Trooper2.PAS, which contains the graphics and game engines, and much of the more basic code. If the game is to be recompiled, then the last file is to be used as the main program, linked to the other two files. In addition, all three of these files are linked to a multitude of smaller units, which consist of libraries for the graphics routines (Images.PAS and GraphV1.PAS are my general MCGA graphics engine, but other units are probably employed), fonts, memory routines powering the XMS and EMS loading routines, as well as Sound and music libraries. I have attempted to include all of these in the download, since it is very difficult to establish whether a unit is missing when compiling on a system that already has the compiled units stored as TPUs. Much of the code is also highly repetitious, and far from instructive, particularly that included in the LevelEd.PAS unit, and I wouldn't recommend using any of that shell to construct your own editors. The game engine code for the game is remarkably intact and straitforward, however, and the image loading and graphics routines are comparatively compact and easy to extract. It should be noted that the game will not start without the full complement of graphics files and palettes, which can be extracted from the main game when downloaded. As noted above, there are around 17,000 lines of Pascal code, and in order to compiled the full game you will have to give Pascal as much memory as possible, and avoid building all the units from scratch. You may have to experiment with the directory structure as indicated in the constant section of the three main source files, since I compile the game in a system where images and exe files are stored in seperate folders. I hope some of it makes sense,

Download Trooper II source (84 Kb, zipped) | Back
 
 
Letters from Terra | Updated 15th December 2004 | By Jonathan Ayling