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.

    Click here for detailed advice and instructions for contributing to Open Rails.

  • Version Control System

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

    From your PC, you can simply view the repository from a web browser. GitHub.com provides the GitHub Desktop program to interface between GitHub.com and your PC (for 64-bit Windows only). Other Windows programs are SourceTree and TortoiseGit and also Visual Studio includes a Git tool.

    The main folders in the repository are:

    • Addons - accessory files shipped with the installation package
    • Architecture - an incomplete experiment in restructuring the program
    • Documentation - operations manual and other documentation
    • Program - empty space for executables once they are compiled
    • Source - the principal source code files
    • Website - source for this website
  • 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.
  • 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 Policy for code changes and Policy for blueprints.