[Guide] How to succesfully compile and run on windows.
This guide will tell you how to prepare, compile and run build game.
- Install visual studio 2017 or 2022 with vs 2017 build tools, git or github desktop and python 3
- Cloning a. clone with git: git clone https://github.com/nillerusr/source-engine.git --recursive b. clone with github desktop.
- Go into command prompt and run these commands: waf.bat configure -T release --prefix=hl2 --build-games=hl2 --disable-warns waf.bat build -p -v waf.bat install
- now you have a directory called "hl2" with all binaries
- copy hl2 and platform from your hl2 install (steam) (skip overwriting files) (if you build any other game also copy it's folder)
- double click on hl2_launcher.exe
OTHER IMPORTANT THINGS
- want voice chat? add --enable-opus to configure
- change build game? change --prefix and --build-games in configure hl1 = Half-Life 1: Source hl2 = Half-Life 2 // Default - This will be selected if you don't specify a game episodic = Half-Life 2 Episode 1 ep2 = Half-Life 2 Episode 2 // Do not build for ep2, use episodic instead. hl2mp = Half-Life 2: Deathmatch dod = Day of Defeat cstrike = Counter-Strike: Source portal = Portal
- black screen when starting a game? copy shaders from half-life 2 (#350)
- need 32 bit build? add --32-bits to configure
- need debug? change -T release to -T debug
- Make sure you uninstall visual studio 2022 and 2019
- Install visual studio 2017, git and python 3
But it can be succesfully built by VS2022, why we need VS2017?
from what i've seen, vs2022 gives errors. did you really manage a succesfull vs2022 build? if yes, please share the details.
from what i've seen, vs2022 gives errors. did you really manage a succesfull vs2022 build? if yes, please share the details.
that's very interesting... could it be because i was using vs 2022 proffesional? there were other people with the same problem - not being able to build with vs 2022. i've also seen a lot more warnings in your build.
i've also seen a lot more warnings in your build.
If my memory serves me, that warnings were even with VS2017 compilers
could it be because i was using vs 2022 professional?
Don't think that different types of VS provides different compilers
I have compiled CSS dedicated_server for Windows 32-bit, but I am unable to use metamod and sourcemod properly.SdkHooks and CStools cannot load properly, and many plugins cannot be used. Can you provide assistance in fixing this issue?
oh yeah, you might need to use an older version of these.
after i fixed my path and added a shit-ton of arguments it works?
updated it a bit
Any idea on how to build a solution file?
(nevermind, you need to use msvs to generate a VS2010 .sln)
what? we use waf. vpc got replaced years ago.
VS2010
Nope. It generates solution for the last version of VS on your PC
what? we use waf. vpc got replaced years ago.
.\waf msvs to generate a Visual Studio Solution
what? we use waf. vpc got replaced years ago.
as much as I would like to admit waf is better, unfortunately it doesn't have intellisense
it doesn't have intellisense
IntelliSense is Visual Studio, not waf or vpc
本指南将告诉您如何准备、编译和运行构建游戏。
- 安装 Visual Studio 2017 或 2022,附带 vs 2017 构建工具、git 或 github 桌面和 python 3
- 克隆 a. 使用 git 克隆:git clone https://github.com/nillerusr/source-engine.git --recursive b. 使用 github 桌面克隆。
- 进入命令提示符并运行以下命令: waf.bat configure -T release --prefix=hl2 --build-games=hl2 --disable-warns waf.bat build -p -v waf.bat install
- 现在你有一个名为“hl2”的目录,其中包含所有二进制文件
- 从你的 hl2 安装 (steam) 复制 hl2 和平台 (跳过覆盖文件) (如果你构建了任何其他游戏也请复制它的文件夹)
- 双击 hl2_launcher.exe
其他重要事项
- 想要语音聊天?在 configure 中添加 --enable-opus
- 更改构建游戏?在配置中更改 --prefix 和 --build-games hl1 = Half-Life 1: Source hl2 = Half-Life 2 // 默认 - 如果您不指定游戏,则会选择此项 episodic = Half-Life 2 Episode 1 ep2 = Half-Life 2 Episode 2 // 不要为 ep2 构建,而是使用 episodic。hl2mp = Half-Life 2: Deathmatch dod = Day of Defeat cstrike = Counter-Strike: Source portal = Portal
- 开始游戏时黑屏?从半条命 2 复制着色器(加载后黑屏 #350)
- 需要 32 位版本?添加 --32-bits 进行配置
- 需要调试?将 -T release 改为 -T debug
After successfully building the project in Windows, is the hl2 directory the root directory? For example, my build directory is C:\Users\Administrator\source-engine, so the hl2 you mentioned is in the directory C:\Users\Administrator\source-engine\hl2, right? Then put the steam css file C:\Program Files (x86)\Steam\steamapps\common\Counter-Strike Source directly into C:\Users\Administrator\source-engine\hl2. If you encounter files with the same name, don't choose to replace them, right? I tried it and it kept giving me an error.
@WZL203 Let me clarify it. You build the entire engine. What you should do is grab platform, hl2 and in your case cstrike and copy it over to the build engine. Do not touch the bin folder! In WAF change --build-games to reflect your game. Make a new text file, give it the .bat extension, open it and type this: hl2_launcher.exe -game cstrike. Run it. If the screen is black copy the hl2 directory from Half-life 2, not Counter-strike. Hope it helps!
This is on Windows, using Steam assets from the "pre-anniversary update" branch.
Looks like hl2/resource files issue
Can you check if there's everything required is in your build?
I did copy everything in hl2. Maybe I need a different version of the game? But this engine is pretty new, I would expect it to work with the recent game, since there weren't any major updates before the 20th anniversary (and everything else in-game seems to work well).
- black screen when starting a game? copy shaders from half-life 2 #350
This issue no longer appears to exist. Does anyone know how to do what this is referring to?
This issue no longer appears to exist. Does anyone know how to do what this is referring to?
In HL2:DM, there was a black screen in main menu.
The fix is: just copy the hl2_misc_*.vpk files from vanilla HL2 to hl2/ directory
I did copy everything in hl2. Maybe I need a different version of the game? But this engine is pretty new, I would expect it to work with the recent game, since there weren't any major updates before the 20th anniversary (and everything else in-game seems to work well).
Pre-20th anniversary steam version is required.
since there weren't any major updates before the 20th anniversary
False. There's a rendering issues with new assets
Figured out my issue from before, it's because I didn't copy the platform folder - didn't read the instructions closely enough.
The same procedure works on Raspberry OS perfectly, you just have to figure out a couple dependencies to apt install as reported by the configure tool.
- black screen when starting a game? copy shaders from half-life 2 black screen after loading #350
This issue no longer appears to exist. Does anyone know how to do what this is referring to?
@FlamedDogo99 i am the original creator of that Issue(tm)
it was basically me trying to compile the engine but i got a pure black window due to lack of shaders
this image is basically it
but it was hl2
when i try launching my built source engine i get this error when launching
when i try launching my built source engine i get this error when launching
what -game parameter did you add to hl2_launcher.exe?
when i try launching my built source engine i get this error when launching
what
-gameparameter did you add to hl2_launcher.exe?
Didn't try adding anything but will try adding -game hl2mp when i will be done building it again because i deleted it accidentally
when i try launching my built source engine i get this error when launching
what
-gameparameter did you add to hl2_launcher.exe?
Added the parameter didn't help
Can you translate the error?

