Skip to content
Switch branches/tags
Go to file

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


To Compile/Run:
 - Install Lazarus Pascal IDE
 - Open each of the projects TurboRisk.lpi, TRSim.lpi and lhelp/lhelp.lpi and build them.
   (Or run `lazbuild TurboRisk.lpi` etc.)

Changes (By Nathan McNew)
This is a port of TurboRisk to Lazarus/Free Pascal.  It has been made multiplatform and tested on both Linux 
(Linux Mint 18) and Windows (Windows 7).  No features have been added, this is as close as possible to the 
version 2.0.5 originally released on Github.  One feature was removed: The ability to check for updates to the 
software, as that no longer seemed as relevant and was more difficult to port.  That feature could easily be 
added back again in the future

Some notes on the code:
 - In order to make it multiplatform, the "help" was moved from Windows help to the Lazarus lhelp program. As such 
the code for lhelp has been included as a subdirectory and can be compiled to produce the lhelp executable 
(required to view the help file in the game).

 - PascalScript defaults to treating division of ints as an int, rather than a float.  This behaviour can be 
changed by adding the preprocessor command {$DEFINE PS_DELPHIDIV} to the include file for PascalScript.  As this 
behavior breaks several trp players, PascalScript has been included as a subdirectory as well so that this include 
file can be changed, and the code recompiled with this flag.

 - the TCanvas.floodfill command (necessary for changing the color of territories on the map) is unimplemented in 
Lazarus in Linux, as documented in the forums.  As a result, a workaround proposed in the forums has been included 
as a separate file (floodfilltest.pas) which implements a (slower) floodfill so the program will still work in 
Linux.  When compiled for Windows TurboRisk will still use the original, functional TCanvas command.

 - A couple of players, notably Australian+.trp cause an "Access Violation" and are unplayable when used on Linux.  
This issue only seems to arise when only computer players (no humans) are present, and if no other games have 
already occurred.  The issue doesn't seem to be present in Windows.  

 - The player frank+.trp causes an "Error: Script Loading Failed" whenever it is used.  The reason for this is not 
currently known.

The original Readme follows.

TurboRisk notes for the developers
Mario Ferrari

Comments in sparse order

- In view of making the project open source, years ago I started translating the comments and the variable names 
from Italian into English. Unfortunately I never finished this job. With modern refactoring tools changing names
to the variables should be easy, fast and safe.
As for the comments... whenever you find a comment you don't understand and are not able to translate with online 
translators, just ask.

- The procedure Supervisor (unit Globals.pas) manages the turns and the phases of the games. 
The way the events manager of the Main window and the Supervisor pass each other the control of the application 
is a bit tricky :-)

- TR is made of many units and the source code is not trivial- though I think is well structured and commented. 

- To understand how TR handles the maps, read the topic "Making custom maps -> Creating the bitmaps -> Colors". 
To make the application multi-plataform we might need to change this architecture.

List of the units in the project

About.pas	          The About window
Attack.pas	        The Attack window
Cards.pas	          The Cards turn in window
CheckUpd.pas	      Unit to check online updates
Computer.pas	      Handles the turn of TRPs
ExpSubr.pas	        Procedure and function used by the TRPs (API)
Globals.pas	        Subroutines of general use
History.pas	        The History window
Human.pas	          Handles the turn of a human player
Log.pas	            The Log window
Main.pas	          The Main window
Map.pas	            The Map choice window
Move.pas	          The Troops Move window
NewGame.pas	        The New Game window
Players.pas	        The Player's property window
Pref.pas	          The Preference window
Programs.pas	      The TRP choice window
Readme.pas	        The Readme window
Rules.pas	          The Rules customization window
Sim.pas	            *** part of the TRSim simulator
SimCPULog.pas	      *** part of the TRSim simulator
SimGameLog.pas      *** part of the TRSim simulator, ignore this unit
SimMap.pas	        *** part of the TRSim simulator, ignore this unit
SimRun.pas	        *** part of the TRSim simulator, ignore this unit
SplashScreen.pas    The initial splash screen
Stats.pas	          The Stats window
Territ.pas	        Routines to handle territories
TRPError.pas	      The TRP error reporting window
UDialog.pas	        The dialog window invoked by the API function UDialog

Planned/requested changes

- I planned to move the code from Delphi to Lazarus/Free Pascal, because the second is free, open source 
and multi-platform (Win, OSX, Linux and more). Not yet approached, but shouldn't be too difficult.

- I also planned to convert maps to vector graphics to make them scalable, thus more suitable for mobile devices.

- Most requested feature is multi-player.