Source Thread Fix

If you have a high-end sys­tem with some­where around 32 CPU threads or more, you may en­counter this er­ror when at­tempt­ing to launch older ver­sions of a few dif­fer­ent Source games:

Out of thread ids. Decrease the number of threads or increase 
MAX_THREADS_SUPPORTED.

This tool aims to solve this is­sue on Win­dows by trick­ing the en­gine into think­ing it’s run­ning on a lower core-count sys­tem.

Copyright and disclaimer

If you want to bundle cop­ies of this tool with something, or re­use some of its code, please refer to the LICENCE file in­cluded in the down­load to know what you can and can­not do, leg­ally speak­ing.

Also, keep in mind that this soft­ware has ab­so­lutely NO WAR­RANTY! There’s no reas­on it should break any­thing, but that’s not a leg­al guar­an­tee. De­tails of that are also writ­ten out in ex­cru­ci­at­ing le­galese in the in­cluded LICENCE file. You’re as­sumed to have read that le­galese be­fore at­tempt­ing to use this tool for any pur­pose!

Downloads

The cur­rent ver­sion is 1.2 and can be down­loaded here.

At the time of writ­ing, this tool ba­sic­ally just works and is un­likely to ever need ma­jor up­dates. However, if you run into is­sues with it in the re­l­at­ively dis­tant fu­ture, do check back here just in case there’s a new­er one.

For techie people:If you want to build the wrap­per ex­ecut­able from source code, or fiddle with the code your­self, the de­vel­op­ment re­pos­it­ory is pub­lished here. You can git clone it from that URL too. If you want to clone over oth­er pro­to­cols or get a slightly fan­ci­er browser, it’s also mirrored on both GitLab and GitHub. This re­lease is built from Git tag v1.2 (which points at com­mit 7051e068d3250c44a47b7ea14d911c104696b6fa). In theory, you should be able to pro­duce a bit-for-bit identic­al copy of the ex­ecut­able us­ing Clang from LLVM 16.0.5 and ver­sion 10.0.22000.0 of the Win­dows 10 SDK. Good luck!

How to use

Place the hl2.wrap.exe ex­ecut­able along­side your hl2.exe. If your game has a dif­fer­ent ex­ecut­able name (for ex­ample left4dead.exe) then re­name the wrap­per ac­cord­ingly.

Then, simply ex­ecute the wrap­per in­stead of the game. If you have something like a batch file or short­cut passing launch para­met­ers to your game, you can keep passing those same op­tions to the wrap­per in­stead. Everything should Just Work.

WARN­ING: if your game is VAC-en­abled, do not join any serv­ers un­less you are sure that they were launched with the -insecure flag. This wrap­per starts the cli­ent in in­sec­ure mode as a pre­cau­tion, but in some ver­sions of some games this does not pre­vent you from join­ing a VAC-se­cured serv­er and pos­sibly get­ting banned. You have been warned!

Thanks, and have fun!