{"id":20313468,"url":"https://github.com/fwgs/hlsdk-portable","last_synced_at":"2026-04-01T21:57:50.483Z","repository":{"id":37285018,"uuid":"52468951","full_name":"FWGS/hlsdk-portable","owner":"FWGS","description":"Portable Half-Life SDK. GoldSource and Xash3D. Crossplatform.","archived":false,"fork":false,"pushed_at":"2026-01-14T22:20:51.000Z","size":23665,"stargazers_count":346,"open_issues_count":46,"forks_count":158,"subscribers_count":26,"default_branch":"master","last_synced_at":"2026-01-15T04:45:13.806Z","etag":null,"topics":["crossplatform","goldsource","goldsrc","half-life","halflife","xash3d"],"latest_commit_sha":null,"homepage":"https://xash.su","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FWGS.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2016-02-24T19:34:05.000Z","updated_at":"2026-01-14T22:17:27.000Z","dependencies_parsed_at":"2023-02-09T15:16:22.954Z","dependency_job_id":"d1bbe823-3909-448d-b3b9-5a37bb27d997","html_url":"https://github.com/FWGS/hlsdk-portable","commit_stats":null,"previous_names":["fwgs/hlsdk-xash3d"],"tags_count":44,"template":false,"template_full_name":null,"purl":"pkg:github/FWGS/hlsdk-portable","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FWGS%2Fhlsdk-portable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FWGS%2Fhlsdk-portable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FWGS%2Fhlsdk-portable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FWGS%2Fhlsdk-portable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FWGS","download_url":"https://codeload.github.com/FWGS/hlsdk-portable/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FWGS%2Fhlsdk-portable/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28479033,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crossplatform","goldsource","goldsrc","half-life","halflife","xash3d"],"created_at":"2024-11-14T18:11:10.976Z","updated_at":"2026-04-01T21:57:50.476Z","avatar_url":"https://github.com/FWGS.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Half-Life SDK for GoldSource and Xash3D [![Build Status](https://github.com/FWGS/hlsdk-portable/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/FWGS/hlsdk-portable/actions/workflows/build.yml) [![Windows Build Status](https://ci.appveyor.com/api/projects/status/github/FWGS/hlsdk-portable?svg=true)](https://ci.appveyor.com/project/a1batross/hlsdk-portable)\n\nHalf-Life SDK for GoldSource \u0026 Xash3D with some bugfixes.\n\n\u003cdetails\u003e\u003csummary\u003eChangelog\u003c/summary\u003e\n\u003cp\u003e\n\n- 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](https://github.com/FWGS/hlsdk-portable/commit/467899b99aa225a95d90222137f18c141c929c86)\n- Monsters now play idle sounds as it's supposed by the code. Technical detail: the problem was a check for a wrong variable. [Patch](https://github.com/FWGS/hlsdk-portable/commit/9fc712da019a1ca646171e912209a993e7c43976)\n- Fixed a bug that caused talk monsters (scientists and security guards) to face a wrong direction during scripted sequence sometimes. [Patch](https://github.com/FWGS/hlsdk-portable/commit/3e2808de62e479e83068c075cb88b4f177f9acc7)\n- Fixed squad member removal. This bug affected houndeye attacks as their attack depends on percieved number of squad members. [Patch](https://github.com/FWGS/hlsdk-portable/commit/b4502f71336a08f3f2c72b7b061b2838a149a11b)\n- Scientists now react to smells. [Patch](https://github.com/FWGS/hlsdk-portable/commit/2de4e7ab003d5b1674d12525f5aefb1e57a49fa3)\n- Tau-cannon (gauss) plays idle animations.\n- Tau-cannon (gauss) beam color depends on the charge as it was before the prediction code was introduced in Half-Life. [Patch](https://github.com/FWGS/hlsdk-portable/commit/0a29ec49c8183ebb8da22a6d2ef395eae9c3dffe)\n- Brought back gluon flare in singleplayer. [Patch](https://github.com/FWGS/hlsdk-portable/commit/9d7ab6acf46a8b71ef119d9c252767865522d21d)\n- Hand grenades don't stay primed after holster, preventing detonation after weapon switch. [Patch](https://github.com/FWGS/hlsdk-portable/commit/6e1059026faa90c5bfe5e3b3f4f58fde398d4524)\n- Fixed flashlight battery appearing as depleted on restore.\n- Fixed a potential overflow when reading sentences.txt. [Patch](https://github.com/FWGS/hlsdk-xash3d/commit/cb51d2aa179f1eb622e08c1c07b053ccd49e40a5)\n- Fixed beam attachment invalidated on restore (that led to visual bugs). [Patch](https://github.com/FWGS/hlsdk-xash3d/commit/74b5543c83c5cdcb88e9254bacab08bc63c4c896)\n- Fixed alien controllers facing wrong direction in non-combat state. [Patch](https://github.com/FWGS/hlsdk-portable/commit/e51878c45b618f9b3920b46357545cbb47befeda)\n- Fixed weapon deploy animations not playing sometimes on fast switching between weapons. [Patch](https://github.com/FWGS/hlsdk-portable/commit/ed676a5413c2d26b2982e5b014e0731f0eda6a0d) [Patch2](https://github.com/FWGS/hlsdk-portable/commit/4053dca7a9cf999391cbd77224144da207e4540b)\n- Fixed tripmine sometimes having wrong body on pickup [Patch](https://github.com/FWGS/hlsdk-portable/commit/abf08e4520e3b6cd12a40f269f4a256cf8496227)\n\nBugfix-related macros that can be enabled during the compilation:\n\n- **CROWBAR_DELAY_FIX** fixes a bug when crowbar has a longer delay after the first hit.\n- **CROWBAR_FIX_RAPID_CROWBAR** fixes a \"rapid crowbar\" bug when hitting corpses of killed monsters.\n- **GAUSS_OVERCHARGE_FIX** fixes tau-cannon (gauss) charge sound not stopping after the overcharge.\n- **CROWBAR_IDLE_ANIM** makes crowbar play idle animations.\n- **TRIPMINE_BEAM_DUPLICATION_FIX** fixes tripmine's beam duplication on level transition.\n- **HANDGRENADE_DEPLOY_FIX** makes handgrenade play draw animation after finishing a throw.\n- **WEAPONS_ANIMATION_TIMES_FIX** fixes deploy and idle animation times of some weapons.\n\nHL25-related macros that can be enabled during the compilation:\n\n- **SATCHEL_OLD_BEHAVIOUR** old pre-HL 25th satchel's behaviour.\n- **SPEAKABLE_TARGETS** makes speakable cycler and func_button(and breaks amxmodx plugins).\n\nBugfix-related server cvars:\n\n- **satchelfix**: if set to 1, doors won't get blocked by satchels. Fixes an infamous exploit on `crossfire` map.\n- **explosionfix**: if set to 1, explosion damage won't propagate through thin bruses.\n- **selfgauss**: if set to 0, players won't hurt themselves with secondary attack when shooting thick brushes.\n\n*Note*: the macros and cvars were adjusted in [hlfixed](https://github.com/FWGS/hlsdk-portable/tree/hlfixed) branch (for further information read [this](https://github.com/FWGS/hlsdk-portable/wiki/HL-Fixed)). The bugfix macros are kept turned off in `master` branch to maintain the compatibility with vanilla servers and clients.\n\nOther server cvars:\n\n- **mp_bhopcap**: if set to 0, disable bunny-hop restriction.\n- **chargerfix**: if set to 1, wall-mounted health and battery chargers will play reject sounds if player has the full health or armor.\n- **corpsephysics**: if set to 1, corpses of killed monsters will fly a bit from an impact. It's a cut feature from Half-Life.\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eSupport for mods\u003c/summary\u003e\n\u003cp\u003e\n\nThis repository contains (re-)implementations of some mods as separate branches derived from `master`. The list of supported mods can be found [here](https://github.com/FWGS/hlsdk-portable/wiki/Mods). Note that some branches are unstable and incomplete.\n\nTo get the mod branch locally run the following git command:\n\n```\ngit fetch origin asheep:asheep\n```\n\nThis is considering that you have set **FWGS/hlsdk-portable** as an `origin` remote and want to fetch `asheep` branch.\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n# Obtaining source code\n\nEither clone the repository via [git](`https://git-scm.com/downloads`) 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.\n\nTo clone the repository with git type in Git Bash (on Windows) or in terminal (on Unix-like operating systems):\n\n```\ngit clone --recursive https://github.com/FWGS/hlsdk-portable\n```\n\n# CI Builds\n\nFresh builds is always available in [artifacts](https://github.com/FWGS/hlsdk-portable/actions) for most common platforms and you can download it if you logged in to github.\n\nBuilds for all branches and more platforms eventually updates into [hlsdk-mega-build](https://github.com/FWGS/hlsdk-mega-build/releases/tag/continuous) repository.\n\n# Build Instructions\n\n## Windows x86.\n\n### Prerequisites\n\nInstall and run [Visual Studio Installer](https://visualstudio.microsoft.com/downloads/). 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](https://cmake.org/download/) and during installation tick *Add to the PATH...*.\n\n### Opening command prompt\n\nIf **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`.\n\nInside the prompt navigate to the hlsdk directory, using `cd` command, e.g.\n```\ncd C:\\Users\\username\\projects\\hlsdk-portable\n```\n\nNote: if hlsdk-portable is unpacked on another disk, nagivate there first:\n```\nD:\ncd projects\\hlsdk-portable\n```\n\n### Building\n\nСonfigure the project:\n```\ncmake -A Win32 -B build\n```\nNote that you must repeat the configuration step if you modify `CMakeLists.txt` files or want to reconfigure the project with different parameters.\n\nThe next step is to compile the libraries:\n```\ncmake --build build --config Release\n```\n`hl.dll` and `client.dll` will appear in the `build/dlls/Release` and `build/cl_dll/Release` directories.\n\nIf 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:\n```\ncmake -A Win32 -B build -DGAMEDIR=mod -DCMAKE_INSTALL_PREFIX=\"C:\\Program Files (x86)\\Steam\\steamapps\\common\\Half-Life\"\n```\nThen call `cmake` with `--target install` parameter:\n```\ncmake --build build --config Release --target install\n```\n\n#### Choosing Visual Studio version\n\nYou can explicitly choose a Visual Studio version on the configuration step by specifying cmake generator:\n```\ncmake -G \"Visual Studio 16 2019\" -A Win32 -B build\n```\n\n### Editing code in Visual Studio\n\nAfter the configuration step, `HLSDK-PORTABLE.sln` should appear in the `build` directory. You can open this solution in Visual Studio and continue developing there.\n\n## Linux x86. Portable steam-compatible build using Steam Runtime in chroot\n\n### Prerequisites\n\nThe official way to build Steam compatible games for Linux is through steam-runtime.\n\n*Note*: For RHEL-based distros you may be need to use system chroot or docker.\n\nInstall schroot. On Ubuntu or Debian:\n\n```\nsudo apt install schroot\n```\n\nClone https://github.com/ValveSoftware/steam-runtime and follow instructions: [download](https://github.com/ValveSoftware/steam-runtime/blob/e014a74f60b45a861d38a867b1c81efe8484f77a/README.md#downloading-a-steam-runtime) and [setup](https://github.com/ValveSoftware/steam-runtime/blob/e014a74f60b45a861d38a867b1c81efe8484f77a/README.md#using-schroot) the chroot.\n\n```\nsudo ./setup_chroot.sh --i386 --tarball ./com.valvesoftware.SteamRuntime.Sdk-i386-scout-sysroot.tar.gz\n```\n\n### Building\n\nNow you can use cmake and make prepending the commands with `schroot --chroot steamrt_scout_i386 --`:\n```\nschroot --chroot steamrt_scout_i386 -- cmake -DCMAKE_BUILD_TYPE=Release -B build-in-steamrt -S .\nschroot --chroot steamrt_scout_i386 -- cmake --build build-in-steamrt\n```\n\n## Linux x86. Portable steam-compatible build without Steam Runtime\n\n### Prerequisites\n\nInstall C++ compilers, cmake and x86 development libraries for C, C++ and SDL2.\n\n#### Ubuntu/Debian:\n```\nsudo apt install cmake build-essential gcc-multilib g++-multilib libsdl2-dev:i386\n```\n\n#### RedHat/Fedora/CentOS:\n```\nsudo dnf install cmake gcc gcc-c++ glibc-devel.i686 SDL2-devel.i686\n```\n\n### Building\n\n```\ncmake -DCMAKE_BUILD_TYPE=Release -B build -S .\ncmake --build build\n```\n\nNote 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:\n```\ncmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=\"${CMAKE_CXX_FLAGS} -static-libstdc++ -static-libgcc\" -B build -S .\ncmake --build build\n```\n\nAlternatively, 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):\n```\ncmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=cc -B build -S .\ncmake --build build\n```\nTo ensure portability it's still better to build using Steam Runtime or another chroot of some older distro.\n\n## Linux x86. Portable steam-compatible build in your own chroot\n\n### Prerequisites\n\nUse the most suitable way for you to create an old distro 32-bit chroot. E.g. on Ubuntu/Debian you can use debootstrap.\n\n```\nsudo apt install debootstrap schroot\nsudo mkdir -p /var/choots\nsudo debootstrap --arch=i386 jessie /var/chroots/jessie-i386 # On Ubuntu type trusty instead of jessie\nsudo chroot /var/chroots/jessie-i386\n```\n\n```\n# inside chroot\napt install cmake build-essential gcc-multilib g++-multilib libsdl2-dev\nexit\n```\n\nCreate and adapt the following config in /etc/schroot/chroot.d/jessie.conf (you can choose a different name):\n\n```\n[jessie]\ntype=directory\ndescription=Debian jessie i386\ndirectory=/var/chroots/jessie-i386/\nusers=yourusername\ngroups=adm\nroot-groups=root\npreserve-environment=true\npersonality=linux32\n```\n\nInsert your actual user name in place of `yourusername`.\n\n### Building\n\nPrepend any make or cmake call with `schroot -c jessie --`:\n```\nschroot --chroot jessie -- cmake -DCMAKE_BUILD_TYPE=Release -B build-in-chroot -S .\nschroot --chroot jessie -- cmake --build build-in-chroot\n```\n\n## Android\n1. Set up [Android Studio/Android SDK](https://developer.android.com/studio).\n\n### Android Studio\nOpen the project located in the `android` folder and build.\n\n### Command-line\n```\ncd android\n./gradlew assembleRelease\n```\n\n### Customizing the build\nsettings.gradle:\n* **rootProject.name** - project name displayed in Android Studio (optional).\n\napp/build.gradle:\n* **android-\u003enamespace** and **android-\u003edefaultConfig-\u003eapplicationId** - set both to desired package name.\n* **getBuildNum** function - set **releaseDate** variable as desired.\n\napp/java/su/xash/hlsdk/MainActivity.java:\n* **.putExtra(\"gamedir\", ...)** - set desired gamedir.\n\nsrc/main/AndroidManifest.xml:\n* **application-\u003eandroid:label** - set desired application name.\n* **su.xash.engine.gamedir** value - set to same as above.\n\n## Nintendo Switch\n\n### Prerequisites\n\n1. Set up [`dkp-pacman`](https://devkitpro.org/wiki/devkitPro_pacman).\n2. Install dependency packages:\n```\nsudo dkp-pacman -S switch-dev dkp-toolchain-vars switch-mesa switch-libdrm_nouveau switch-sdl2\n```\n3. Make sure the `DEVKITPRO` environment variable is set to the devkitPro SDK root:\n```\nexport DEVKITPRO=/opt/devkitpro\n```\n4. Install libsolder:\n```\nsource $DEVKITPRO/switchvars.sh\ngit clone https://github.com/fgsfdsfgs/libsolder.git\nmake -C libsolder install\n```\n\n### Building using CMake\n```\nmkdir build \u0026\u0026 cd build\naarch64-none-elf-cmake -G\"Unix Makefiles\" -DCMAKE_PROJECT_HLSDK-PORTABLE_INCLUDE=\"$DEVKITPRO/portlibs/switch/share/SolderShim.cmake\" ..\nmake -j\n```\n\n### Building using waf\n```\n./waf configure -T release --nswitch\n./waf build\n```\n\n## PlayStation Vita\n\n### Prerequisites\n\n1. Set up [VitaSDK](https://vitasdk.org/).\n2. Install [vita-rtld](https://github.com/fgsfdsfgs/vita-rtld):\n   ```\n   git clone https://github.com/fgsfdsfgs/vita-rtld.git \u0026\u0026 cd vita-rtld\n   mkdir build \u0026\u0026 cd build\n   cmake -DCMAKE_BUILD_TYPE=Release ..\n   make -j2 install\n   ```\n\n### Building with waf:\n```\n./waf configure -T release --psvita\n./waf build\n```\n\n### Building with CMake:\n```\nmkdir build \u0026\u0026 cd build\ncmake -G\"Unix Makefiles\" -DCMAKE_TOOLCHAIN_FILE=\"$VITASDK/share/vita.toolchain.cmake\" -DCMAKE_PROJECT_HLSDK-PORTABLE_INCLUDE=\"$VITASDK/share/vrtld_shim.cmake\" ..\nmake -j\n```\n\n## Other platforms\n\nBuilding on other architectures (e.g. x86_64 or arm) and POSIX-compliant OSes (e.g. FreeBSD) is supported.\n\n### Prerequisites\n\nInstall C and C++ compilers (like gcc or clang), cmake and make.\n\n### Building\n\n```\ncmake -DCMAKE_BUILD_TYPE=Release -B build -S .\ncmake --build build\n```\n\nForce 64-bit build:\n```\ncmake -DCMAKE_BUILD_TYPE=Release -D64BIT=1 -B build -S .\ncmake --build build\n```\n\n### Building with waf\n\nTo use waf, you need to install python (2.7 minimum)\n\n```\n./waf configure -T release\n./waf\n```\n\nForce 64-bit build:\n```\n./waf configure -T release -8\n./waf\n```\n\n## Build options\n\nSome useful build options that can be set during the cmake step.\n\n* **GOLDSOURCE_SUPPORT** - allows to turn off/on the support for GoldSource input. Set to **ON** by default on x86 Windows and x86 Linux, **OFF** on other platforms.\n* **64BIT** - allows to turn off/on 64-bit build. Set to **OFF** by default on x86_64 Windows, x86_64 Linux and 32-bit platforms, **ON** on other 64-bit platforms.\n* **USE_VGUI** - whether to use VGUI library. **OFF** by default. You need to init `vgui_support` submodule in order to build with VGUI.\n\nThis list is incomplete. Look at `mod_options.txt` to see all available options and their default values.\n\nPrepend option names with `-D` when passing to cmake. Boolean options can take values **OFF** and **ON**. Example:\n\n```\ncmake .. -DUSE_VGUI=ON -DGOLDSOURCE_SUPPORT=ON -DCROWBAR_IDLE_ANIM=ON -DCROWBAR_FIX_RAPID_CROWBAR=ON\n```\n\nTo add new build options for your mod, you can add them to `mod_options.txt` file in the following format:\n```\n\u003cdefinition name\u003e=\u003cdefinition value\u003e # \u003cdescription\u003e\n```\nIf `definition value` set to `OFF` or `ON`, it will be considered as a boolean value. Otherwise it will be a string. Nor `definition name` nor `definition value` can have whitespace characters.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffwgs%2Fhlsdk-portable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffwgs%2Fhlsdk-portable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffwgs%2Fhlsdk-portable/lists"}