Skip to content

Windows Build Instructions

lnx00 edited this page Nov 14, 2023 · 34 revisions

DISCLAIMER: If you are not a developer, building the game from source is not what you want. Use the pre-built Releases. Also, building this on Linux, while possible, is not covered here. Please let us know if you get it to work!

Building

  1. Requirements:
    • Have the following set:
      • Environment variables:
        Name Value
        PreferredToolArchitecture x64
      • Registry keys:
        Path Name Type Data
        HKLM\SOFTWARE\WOW6432Node\Microsoft\VisualStudio\10.0\Projects\{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942} DefaultProjectExtension string (REG_SZ) vcproj
    • curl (included with Windows 10 build 17063 or later)
    • Visual Studio 2022. The required installation components are:
      • Desktop development with C++
      • C++ MFC for latest v143 build tools (x86 & x64)
  2. Open Developer Command Prompt (or PowerShell) for VS 2022.
  3. Clone the repository. For example, with git:
    git clone https://github.com/mastercomfig/tf2-patches.git --recurse-submodules
    
    • If you already cloned the project and forgot --recurse-submodules, you can clone them by running git submodule update --init.
  4. cd into team-comtress-2/src.
  5. Run the following commands:
    .\download_libs.bat
    
    .\createprojects.bat
    
  6. Open .\everything.sln.
  7. Build the VS solution.
  8. The executables are placed at:
    Project Path
    Client (TF) ..\game\hl2.exe
    Server (TF) ..\game\srcds.exe

Running and Debugging

  1. Copy the contents of the game_clean/copy folder into game/.
  2. Copy your current TF2 installation to ..\game (relative to your repository, outside of it), skip replacing files.
  3. To setup debugging in Visual Studio:
  • Client (TF) (hl2.exe):
    1. Right click Client (TF), go to Properties > Configuration Properties > Debugging, and set the following:
      Command $(SolutionDir)..\game\hl2.exe
      Command Arguments -steam -game tf -insecure -allowdebug
      Working Directory $(SolutionDir)..\game
      • Note: Paths here are relative to your copy of the repository (same place where games.sln is located).
    2. Right click Client (TF) and choose Set as Startup Project.
  • Server (TF) (srcds.exe):
    1. Right click Server (TF), go to Properties > Configuration Properties > Debugging, and set the following:
      Command $(SolutionDir)..\game\srcds.exe
      Command Arguments -game tf -console -nomaster -insecure -maxplayers 32 +sv_lan 1 -allowdebug
      Working Directory Same as Client (TF).
      • Note: Paths here are relative to your copy of the repository (same place where games.sln is located).
    2. Right click Server (TF) and choose Set as Startup Project.

See the Valve Developer Wiki for another explanation of the last two steps.

Other launch options to consider:

Option Description
-sw Force windowed mode. (Same as -startwindowed, -window, and -windowed)
-border Enable window borders.
-w WIDTH -h HEIGHT Set the resolution. (Same as -width and -height)
+map MAPNAME Automatically launch a map on startup.