Skip to content

Windows Build Instructions

Lauri Räsänen edited this page Oct 24, 2021 · 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 Mac/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
        VALVE_NO_AUTO_P4 1
        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 2019 Community Edition. The required installation components are:
      • Desktop development with C++
      • C++ MFC for latest v142 build tools (x86 & x64)
  2. Open Developer Command Prompt (or PowerShell) for VS 2019.
  3. Clone the repository. For example, with git:
    git clone https://github.com/mastercomfig/team-comtress-2.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
    
    msbuild /m /p:Configuration=Debug   thirdparty\protobuf-2.6.1\vsprojects\libprotobuf.vcxproj
    msbuild /m /p:Configuration=Release thirdparty\protobuf-2.6.1\vsprojects\libprotobuf.vcxproj
    
    (alternatively, you can open the project in VS and build both the Debug and Release configuration for the project)
    • For Release:
      .\creategameprojects_dev.bat
      
    • For Debug:
      .\creategameprojects_debug.bat
      
  6. Open .\games.sln.
  7. Select all projects. Go to Properties > C/C++ > Language > C++ Language Standard and set language standard to C++17.
    • Make sure they are set for All Configurations.
    • Configuration needs to be changed to Release if you want to build for Release.
  8. Build the VS project.
  9. 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 -novid -nojoy -nosteamcontroller -particle_fallback 2 -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 +sv_pure 0 -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.

Clone this wiki locally