Contribute > Developing Code

  • Private Changes

    Anyone can download the source code for Open Rails and make changes to suit themselves and create a personal version.

  • Public Changes

    If your changes might be useful to others, then we encourage you to submit them for inclusion into the product. We will respond to all submissions and give credit in the project record for submissions that are included.

  • Version Control System

    The Open Rails project uses Subversion (SVN) as the versioning and revision control system for our software. Revisions are archived in a repository and can be compared, restored and merged, so that versions are safe and several developers can work independently without (too much) conflict.

    The Open Rails source code is managed on our Subversion server. Read-only access is provided from the guest login:

    • Username: orpublic
    • Password: orpublic

    From your PC, you can use an Subversion client such as TortoiseSVN to access the files, or simply view the repository from a web browser.

    P.S. - Our thanks to for donating the Subversion server space and admin services.

  • Accessing The Code With TortoiseSVN

    If you are not familiar with Subversion, please study the TortoiseSVN help first.

    1. From Windows Explorer, choose a folder to hold the project code.
    2. Right click on the folder, select SVN Checkout...
    3. In the Checkout dialog box, enter the URL of repository :
    4. Enter username  orpublic
    5. Enter password  orpublic
    6. Check that the Checkout directory shows the folder where you want the files extracted to - e.g. C:\Users\Wayne\Desktop\openrails
    7. Click OK.

    The main folders in the repository are:

    • Addons - accessory files shipped with the installation package
    • Architecture - an incomplete experiment in restructuring the program
    • Archive - abandoned code
    • Documentation - operations manual and other documentation
    • Program - empty space for executables once they are compiled
    • Source - the principal source code files
    • SVNTesting - sandbox for training new users on SVN
  • Compiling the Open Rails Project

    To compile and debug the Open Rails source code, ensure you have the following Microsoft products installed:

    After you have downloaded the code:

    1. Open folder Source
    2. Double click on file ORTS.sln to launch Visual Studio with the Open Rails project
    3. From the Visual Studio menu, select Build > Rebuild Solution
    4. In the status bar (lower left), wait for the message 'Rebuild All succeeded'

    The executable files have now been built and placed in the Program folder.

  • Running the RunActivity.exe Code in Debug Mode

    Note: When debugging you will bypass the normal start menu and must specify an activity on the command line.

    On the Visual Studio menu,

    1. Select View > Solution Explorer
    2. In the Solution Explorer box (on the right), right click on RunActivity > Properties
    3. Use the Debug tab (on the left) to open the Debug Window.
    4. Into the "Command line arguments", enter the path of the activity that you want to run: e.g. "c:\personal\msts\routes\lps\activities\ls1.act". Use quotes if the path has spaces in it.
    5. Below this, check the checkbox for "Enable native code debugging"
    6. Press F5 to run RunActivity.exe using your activity.
  • Submitting A Change

    A change is best packaged as a "patch" file - a file which contains instructions to alter the current version of Open Rails code to include your changes. Patches are short and readable. Subversion will usually apply your patch successfully even after code has been changed by someone else.

    If you are offering a fix to a Bug Report, then simply attach your patch file to the Bug Tracker explaining what you have done.

    If you are offering an improvement or a new feature, then attach your file to a post on the Elvas Tower forum Open Rails Discussion. It would be helpful to post a message before you start work to give us some idea of your intentions.

    We cannot promise that your changes will make it into the code, but show us what you can do and then we can talk about it.

  • Policy for Code Changes

    To allow many people to contribute directly to Open Rails successfully, we have a policy in place to keep tabs on where changes come from and which changes are allowed. The policy is as follows:

    1. All changes must be one of:
      • Simple bug fixes, with a link to the bug
      • Targeted bug fixes, with a link to the bug
      • Approved blueprints, with a link to the blueprint
      • Documentation or localisation updates (kept separate from code changes)
    2. Simple means no more than a few lines changes and no uncertainty over the logic change.
    3. Targeted means "Milestone" is set to the next planned stable version.
    4. Approved means "Direction" is "Approved", "Milestone target" is unset or set to the next planned stable version, and at least 7 days of discussion has taken place.

    For members of the Development Team, these policies are defined in more detail in New policy for code changes and New policy for blueprints.