Skip to content

Building OpenRCT2 on Windows

Matt edited this page Apr 24, 2025 · 28 revisions

Requirements

  • Windows 7, 8, 10 or 11
  • Visual Studio 2022 (Enterprise, Professional, or Community (Free))
  • Latest Visual Studio updates installed
  • At least 5 GB free disk space

Checking Out the Code

  1. Create a directory on a drive with at least 5 GB free space (e.g., cd C:\GitHub\OpenRCT2).
  2. Navigate to the new directory.
  3. Clone the repository using GitHub Desktop or other tools.

Building with Visual Studio

  1. Navigate to the directory where the code was cloned (e.g., cd C:\GitHub\OpenRCT2).
  2. Open openrct2.sln in Visual Studio.
  3. In Visual Studio, select Build > Build Solution from the top menu. The first build will fetch all required dependencies.
  4. Run the game: bin\openrct2.

Building with MSBuild

  1. Navigate to the directory where the code was cloned (e.g., cd C:\GitHub\OpenRCT2).
  2. Open a Developer Command Prompt for VS 2022 and navigate to the repository (e.g., cd C:\GitHub\OpenRCT2).
  3. Run one of the following:
    • For 64-bit: msbuild openrct2.proj /t:Build /p:Platform=x64 /p:Configuration=Release
    • For 32-bit: msbuild openrct2.proj /t:Build /p:Platform=Win32 /p:Configuration=Release
    • Both choices will work but it is recommended to select the platform that you are using.
  4. Run the game: bin\openrct2.

After running MSBuild once, you can continue development in Visual Studio by opening openrct2.sln.

Additional examples

set platform=x64
msbuild openrct2.proj /t:Clean
msbuild openrct2.proj /t:Rebuild /p:Configuration=Release
msbuild openrct2.proj /t:BuildG2

Configurations and Platform

Choose a Platform matching your system (e.g., x64 for 64-bit systems). Available configurations:

  1. Debug
    • All optimizations are disabled for easier debugging. Fast build times but poor runtime performance.
  2. Release
    • Recommended for development. Most optimizations enabled, supports fast incremental builds, and balances build time and runtime performance. Debugging may be limited.
  3. ReleaseLTCG
    • This configuration uses Link Time Code Generation also known as Whole Program Optimization, this enables additional optimizations but will result in longer build times. This configuration is used for all our releases as it will provide the best possible performance but is not ideal for development.

Notes

  • If you encounter build errors or graphical glitches, rebuild the project to update dependencies.
  • For Visual Studio debugging:
    1. Open openrct2.sln.
    2. In Solution Explorer, right-click openrct2-win and select Set as Startup Project.
Clone this wiki locally