百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
H

hlsdk-portable

> 数据库
开源

便携式 Half-Life SDK。GoldSource 和 Xash3D。跨平台。

385 stars0 点赞3 次浏览
访问官网GitHub

工具介绍

便携式 Half-Life SDK。GoldSource 和 Xash3D。跨平台。

Half-Life SDK for GoldSource and Xash3D

Half-Life SDK for GoldSource & Xash3D with some bugfixes.

Changelog

  • Fixed an occasional bug when houndeyes stuck unable to do anything. Technical detail: now monster's Activity is set before the call to SetYawSpeed. Patch
  • Monsters now play idle sounds as it's supposed by the code. Technical detail: the problem was a check for a wrong variable. Patch
  • Fixed a bug that caused talk monsters (scientists and security guards) to face a wrong direction during scripted sequence sometimes. Patch
  • Fixed squad member removal. This bug affected houndeye attacks as their attack depends on percieved number of squad members. Patch
  • Scientists now react to smells. Patch
  • Tau-cannon (gauss) plays idle animations.
  • Tau-cannon (gauss) beam color depends on the charge as it was before the prediction code was introduced in Half-Life. Patch
  • Brought back gluon flare in singleplayer. Patch
  • Hand grenades don't stay primed after holster, preventing detonation after weapon switch. Patch
  • Fixed flashlight battery appearing as depleted on restore.
  • Fixed a potential overflow when reading sentences.txt. Patch
  • Fixed beam attachment invalidated on restore (that led to visual bugs). Patch
  • Fixed alien controllers facing wrong direction in non-combat state. Patch
  • Fixed weapon deploy animations not playing sometimes on fast switching between weapons. Patch Patch2
  • Fixed tripmine sometimes having wrong body on pickup Patch

Bugfix-related macros that can be enabled during the compilation:

  • CROWBAR_DELAY_FIX fixes a bug when crowbar has a longer delay after the first hit.
  • CROWBAR_FIX_RAPID_CROWBAR fixes a "rapid crowbar" bug when hitting corpses of killed monsters.
  • GAUSS_OVERCHARGE_FIX fixes tau-cannon (gauss) charge sound not stopping after the overcharge.
  • CROWBAR_IDLE_ANIM makes crowbar play idle animations.
  • TRIPMINE_BEAM_DUPLICATION_FIX fixes tripmine's beam duplication on level transition.
  • HANDGRENADE_DEPLOY_FIX makes handgrenade play draw animation after finishing a throw.
  • WEAPONS_ANIMATION_TIMES_FIX fixes deploy and idle animation times of some weapons.

HL25-related macros that can be enabled during the compilation:

  • SATCHEL_OLD_BEHAVIOUR old pre-HL 25th satchel's behaviour.
  • SPEAKABLE_TARGETS makes speakable cycler and func_button(and breaks amxmodx plugins).

Bugfix-related server cvars:

  • satchelfix: if set to 1, doors won't get blocked by satchels. Fixes an infamous exploit on crossfire map.
  • explosionfix: if set to 1, explosion damage won't propagate through thin bruses.
  • selfgauss: if set to 0, players won't hurt themselves with secondary attack when shooting thick brushes.

Note: the macros and cvars were adjusted in hlfixed branch (for further information read this). The bugfix macros are kept turned off in master branch to maintain the compatibility with vanilla servers and clients.

Other server cvars:

  • mp_bhopcap: if set to 0, disable bunny-hop restriction.
  • chargerfix: if set to 1, wall-mounted health and battery chargers will play reject sounds if player has the full health or armor.
  • corpsephysics: if set to 1, corpses of killed monsters will fly a bit from an impact. It's a cut feature from Half-Life.

Support for mods

This repository contains (re-)implementations of some mods as separate branches derived from master. The list of supported mods can be found here. Note that some branches are unstable and incomplete.

To get the mod branch locally run the following git command:

bash
git fetch origin asheep:asheep

This is considering that you have set FWGS/hlsdk-portable as an origin remote and want to fetch asheep branch.

Obtaining source code

Either clone the repository via git or just download ZIP via Code button on github. The first option is more preferable as it also allows you to search through the repo history, switch between branches and clone the vgui submodule.

To clone the repository with git type in Git Bash (on Windows) or in terminal (on Unix-like operating systems):

bash
git clone --recursive https://github.com/FWGS/hlsdk-portable

CI Builds

Fresh builds is always available in artifacts for most common platforms and you can download it if you logged in to github.

Builds for all branches and more platforms eventually updates into hlsdk-mega-build repository.

Build Instructions

Windows x86.

Prerequisites

Install and run Visual Studio Installer. The installer allows you to choose specific components. Select Desktop development with C++. You can untick everything you don't need in Installation details, but you must keep MSVC and corresponding Windows SDK (e.g. Windows 10 SDK or Windows 11 SDK) ticked. You may also keep C++ CMake tools for Windows ticked as you'll need cmake. Alternatively you can install cmake from the cmake.org and during installation tick Add to the PATH....

Opening command prompt

If cmake was installed with Visual Studio Installer, you'll need to run Developer command prompt for VS via Windows Start menu. If cmake was installed with cmake installer, you can run the regular Windows cmd.

Inside the prompt navigate to the hlsdk directory, using cd command, e.g.

bash
cd C:\Users\\username\projects\hlsdk-portable

Note: if hlsdk-portable is unpacked on another disk, nagivate there first:

bash
D:
cd projects\hlsdk-portable

Building

Сonfigure the project:

cmake -A Win32 -B build

Note that you must repeat the configuration step if you modify CMakeLists.txt files or want to reconfigure the project with different parameters.

The next step is to compile the libraries:

cmake --build build --config Release

hl.dll and client.dll will appear in the build/dlls/Release and build/cl_dll/Release directories.

If you have a mod and want to automatically install libraries to the mod directory, set GAMEDIR variable to the directory name and CMAKE_INSTALL_PREFIX to your Half-Life or Xash3D installation path:

cmake -A Win32 -B build -DGAMEDIR=mod -DCMAKE_INSTALL_PREFIX="C:\Program Files (x86)\Steam\steamapps\common\Half-Life"

Then call cmake with --target install parameter:

cmake --build build --config Release --target install

Choosing Visual Studio version

You can explicitly choose a Visual Studio version on the configuration step by specifying cmake generator:

cmake -G "Visual Studio 16 2019" -A Win32 -B build

Editing code in Visual Studio

After the configuration step, HLSDK-PORTABLE.sln should appear in the build directory. You can open this solution in Visual Studio and continue developing there.

Linux x86. Portable steam-compatible build using Steam Runtime in chroot

Prerequisites

The official way to build Steam compatible games for Linux is through steam-runtime.

Note: For RHEL-based distros you may be need to use system chroot or docker.

Install schroot. On Ubuntu or Debian:

bash
sudo apt install schroot

Clone https://github.com/ValveSoftware/steam-runtime and follow instructions: download and setup the chroot.

sudo ./setup_chroot.sh --i386 --tarball ./com.valvesoftware.SteamRuntime.Sdk-i386-scout-sysroot.tar.gz

Building

Now you can use cmake and make prepending the commands with schroot --chroot steamrt_scout_i386 --:

schroot --chroot steamrt_scout_i386 -- cmake -DCMAKE_BUILD_TYPE=Release -B build-in-steamrt -S .
schroot --chroot steamrt_scout_i386 -- cmake --build build-in-steamrt

Linux x86. Portable steam-compatible build without Steam Runtime

Prerequisites

Install C++ compilers, cmake and x86 development libraries for C, C++ and SDL2.

Ubuntu/Debian:

bash
sudo apt install cmake build-essential gcc-multilib g++-multilib libsdl2-dev:i386

RedHat/Fedora/CentOS:

bash
sudo dnf install cmake gcc gcc-c++ glibc-devel.i686 SDL2-devel.i686

Building

cmake -DCMAKE_BUILD_TYPE=Release -B build -S .
cmake --build build

Note that the libraries built this way might be not compatible with Steam Half-Life. If you have such issue you can configure it to build statically with c++ and gcc libraries:

cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -static-libstdc++ -static-libgcc" -B build -S .
cmake --build build

Alternatively, you can avoid libstdc++/libgcc_s linking using small libsupc++ library and optimization build flags instead(Really just set Release build type and set C compiler as C++ compiler):

cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=cc -B build -S .
cmake --build build

To ensure portability it's still better to build using Steam Runtime or another chroot of some older distro.

Linux x86. Portable steam-compatible build in your own chroot

Prerequisites

Use the most suitable way for you to create an old distro 32-bit chroot. E.g. on Ubuntu/Debian you can use debootstrap.

bash
sudo apt install debootstrap schroot
sudo mkdir -p /var/choots
sudo debootstrap --arch=i386 jessie /var/chroots/jessie-i386 # On Ubuntu type trusty instead of jessie
sudo chroot /var/chroots/jessie-i386
bash
# inside chroot
apt install cmake build-essential gcc-multilib g++-multilib libsdl2-dev
exit

Create and adapt the following config in /etc/schroot/chroot.d/jessie.conf (you can choose a different name):

[jessie]
type=directory
description=Debian jessie i386
directory=/var/chroots/jessie-i386/
users=yourusername
groups=adm
root-groups=root
preserve-environment=true
personality=linux32

Insert your actual user name in place of yourusername.

Building

Prepend any make or cmake call with schroot -c jessie --:

schroot --chroot jessie -- cmake -DCMAKE_BUILD_TYPE=Release -B build-in-chroot -S .
schroot --chroot jessie -- cmake --build build-in-chroot

Android

  1. Set up [Android Studio/Android SDK](h

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

C++crossplatformgoldsourcegoldsrchalf-life

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类数据库
定价开源

> 相关工具

P
PostgreSQL
功能强大的开源关系型数据库
R
Redis
内存数据结构存储,常用作缓存与队列
M
MySQL
广泛使用的开源关系型数据库