Thursday, October 23, 2014

Notes on working with Source SDK 2013 Singleplayer Base

I've been working with Source SDK 2013 base for the past few months, and I thought I'd share some notes on workflow for any future modders who google to this post:
  • If you are making a simple mod that uses default Half-Life 2 features, then you do NOT have to compile your own binaries. You can just tell Steam to use the ones that come pre-compiled by Valve from the already included "sourcetest" mod instead. Steam automatically downloads the correct binaries for the client's platform when they download the Source SDK 2013 Base -- which means you presumably get free and painless Windows / OSX / Linux support, as well as any new changes Valve merges into the codebase... As far as I can tell, most of the basic Half-Life 2 entities work in sourcetest, though env_screeneffect seem to be broken due to some missing shaders.
  • FacePoser, and technically all the other SDK tools, require you to manually set the VPROJECT path in a .BAT file. In the past, you had to load tools through the Source SDK launcher, which would configure the Windows environmental variable "VPROJECT" game path which tells all the Source tools which gameinfo.txt and files to use. In SDK 2013, the launcher and vconfig have been abolished in favor of batch files. If you have to use the model viewer or FacePoser, you will probably need to manually set the correct VPROJECT path. (Hammer has its own config system.) Go to SteamApps\common\Source SDK Base 2013 Singleplayer\bin and open set_sdk_env.bat in a text editor, and type in the path to your SourceMod mod, kinda like this:
    @echo off
    echo Configuring Source SDK environment variables for MySourceMod
    :: Set local environment variable that will only persist in processes
    :: created by the current command processor shell
    SET VPROJECT=E:\Steam\SteamApps\sourcemods\MySourceMod
    When you're done, you can run FacePoser by running the Faceposer.bat file, which will automatically invoke set_sdk_env.bat for you before running FacePoser.
  • Phoneme extraction / auto lip-syncing in FacePoser might be possible on Windows 7; it is almost definitely impossible on Windows 8+. Tom Edwards re-wrote the FacePoser phoneme extractors to use Microsoft Speech API (SAPI) 5.4 to replace Valve's reliance on SAPI 5.1, which was only available for Windows XP or older. (If you already have SAPI 5.1 installed, don't worry, it is compatible with SAPI 5.4) It seems SAPI 5.4 is now packaged within the entire platform SDK for Windows 7... but I wouldn't know, I can't actually install it because Windows 8.1 won't let me. In SDK 2013, Valve seems to have replaced this dependency with something called "IMS" but I can't find any reference to it on the internet, and it just gives me errors of not being able to find "talkback" files in bin\bin\lipsinc_data?... Anyway, what a huge mess.
  • Remember that Nem's Photoshop VTF file format extensions do NOT work in any 64-bit Photoshop. To get textures from Photoshop into Source, I've had have to cobble together something where I paste images into VTFEdit. Or you can do that whole \materialsrc\ TGA workflow, but personally I find that unwieldy.
  • To buildcubemaps, you need to use this modded VBSP.exe that does not automatically package default cubemaps upon map compile. Currently, SDK 2013 engine does not properly overwrite the default cubemaps packed into the BSP, which means any attempt to buildcubemaps will fail and the default cubemaps will just stay there in your BSP, unchanged.