• Stars
    star
    260
  • Rank 157,189 (Top 4 %)
  • Language
    C++
  • License
    Other
  • Created almost 9 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Portable Half-Life SDK. GoldSource and Xash3D. Crossplatform.

Half-Life SDK for GoldSource and Xash3D Build Status Windows Build Status

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.

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 1, enable bunny-hop.
  • 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:

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):

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

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 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.

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

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

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.

Windows x86. Using Microsoft Visual Studio 6

Microsoft Visual Studio 6 is very old, but if you still have it installed, you can use it to build this hlsdk. There are no project files, but two .bat files, for server and client libraries. They require variable MSVCDir to be set to the installation path of Visual Studio:

set MSVCDir=C:\Program Files\Microsoft Visual Studio
cd dlls && compile.bat && cd ../cl_dll && compile.bat

hl.dll and client.dll will appear in dlls/ and cl_dll/ diretories. The libraries built with msvc6 should be compatible with Windows XP.

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.

Install schroot. On Ubuntu or Debian:

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 -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. On Ubuntu/Debian:

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

Building

cmake -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_C_FLAGS="-static-libstdc++ -static-libgcc"

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.

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
# 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 -B build-in-chroot -S .
schroot --chroot jessie -- cmake --build build-in-chroot

Android

TODO

Nintendo Switch

Prerequisites

  1. Set up dkp-pacman.
  2. Install dependency packages:
sudo dkp-pacman -S switch-dev dkp-toolchain-vars switch-mesa switch-libdrm_nouveau switch-sdl2
  1. Make sure the DEVKITPRO environment variable is set to the devkitPro SDK root:
export DEVKITPRO=/opt/devkitpro
  1. Install libsolder:
source $DEVKITPRO/switchvars.sh
git clone https://github.com/fgsfdsfgs/libsolder.git
make -C libsolder install

Building using CMake

mkdir build && cd build
aarch64-none-elf-cmake -G"Unix Makefiles" -DCMAKE_PROJECT_HLSDK-PORTABLE_INCLUDE="$DEVKITPRO/portlibs/switch/share/SolderShim.cmake" ..
make -j

Building using waf

./waf configure -T release --nswitch
./waf build

PlayStation Vita

Prerequisites

  1. Set up VitaSDK.
  2. Install vita-rtld:
    git clone https://github.com/fgsfdsfgs/vita-rtld.git && cd vita-rtld
    mkdir build && cd build
    cmake -DCMAKE_BUILD_TYPE=Release ..
    make -j2 install
    

Building with waf:

./waf configure -T release --psvita
./waf build

Building with CMake:

mkdir build && cd build
cmake -G"Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE="$VITASDK/share/vita.toolchain.cmake" -DCMAKE_PROJECT_HLSDK-PORTABLE_INCLUDE="$VITASDK/share/vrtld_shim.cmake" ..
make -j

Other platforms

Building on other architectures (e.g x86_64 or arm) and POSIX-compliant OSes (e.g. FreeBSD) is supported.

Prerequisites

Install C and C++ compilers (like gcc or clang), cmake and make.

Building

cmake -B build -S .
cmake --build build

Building with waf

To use waf, you need to install python (2.7 minimum)

(./waf configure -T release)
(./waf)

Build options

Some useful build options that can be set during the cmake step.

  • GOLDSOURCE_SUPPORT - allows to turn off/on the support for GoldSource input. Set to ON by default on Windows and Linux, OFF on other platforms.
  • USE_VGUI - whether to use VGUI library. OFF by default. You need to init vgui_support submodule in order to build with VGUI.

This list is incomplete. Look at CMakeLists.txt to see all available options.

Prepend option names with -D when passing to cmake. Boolean options can take values OFF and ON. Example:

cmake .. -DUSE_VGUI=ON -DGOLDSOURCE_SUPPORT=ON -DCROWBAR_IDLE_ANIM=ON -DCROWBAR_FIX_RAPID_CROWBAR=ON

More Repositories

1

xash3d-fwgs

Xash3D FWGS engine.
C
1,495
star
2

xash3d

DEPRECATED in favor of https://github.com/FWGS/xash3d-fwgs. Only bugfixes are accepted.
C
549
star
3

xash3d-android-project

Xash3D Android Project for NDK.
Java
222
star
4

nanogl

OpenGL 1.x to OpenGL ES 1.x wrapper (extracted from Quake 2 port)
C++
39
star
5

halflife

Half-Life 1 engine based games (deprecated. See hlsdk-xash3d repo)
C++
33
star
6

xash3d-deploy

Autobuilds
33
star
7

xash-extras

Extras files for Xash3D FWGS engine. Includes textures for WON-style menu, some recommended configs, etc
31
star
8

mainui_cpp

Main menu UI toolkit for Xash3D FWGS engine
C++
31
star
9

Husky

MOVED TO https://git.sr.ht/~captainepoch/husky
Kotlin
25
star
10

wsproxy

websocket tcp/udp proxy (based on websockify-c)
C
12
star
11

XashXT

XashXT Linux Port (WIP)
C++
10
star
12

xashds-android

Android dedicated server with x86 dynamic translator and dll support
Java
9
star
13

xashxt-fwgs

XashXT
C++
8
star
14

QuakeRemakeDevkit

Crossplatform port of Quake Remake game
C++
8
star
15

waifu

Waf build system with additional experimental tools by FWGS
Python
8
star
16

vgui-dev

vgui_support dependencies
C++
7
star
17

UMHLT

UnkleMike's VHLT (untested)
C++
7
star
18

SpiritOfHalfLife

Latest version of SoHL ported to Linux/Android
C++
7
star
19

paranoia_toolkit

Paranoia 1 Source Code fork
C++
7
star
20

pymaster

Master server written in Python. Replacement for HLMaster
Python
7
star
21

vgui_support

VGUI1 support module for Xash3D FWGS
C++
7
star
22

quakewrapper

C++
5
star
23

xash3d-android-tools-toolchain

Toolchain from gcc-termux. Removed termux dependency, but may still depend on android-5
C
5
star
24

stubserver

Pure stub server implementation
C
5
star
25

mod-sample

Sample android project for mod
Java
5
star
26

microndk

Makefile collection to emulate ndk on standalone toolchains for xash3d builds
C
4
star
27

filesystem_stdio_xash

Experiment to implement Valve's filesystem_stdio over Xash3D filesystem. USELESS, but fixes some problems with SC5.0
C++
4
star
28

regamelite

mirror of gitlab repo
C++
4
star
29

Xash3DArchive

Unkle Mike's archive of Xash3D builds from 2007 to it's final release in 2019. (and custom patches archive in branches)
C++
4
star
30

fwgs-artwork

Various artwork done by different artists for Flying With Gauss
4
star
31

fwgs.github.io_deprecated

CSS
3
star
32

SoHL-android

Android project files for Spirit of Half-Life port
Java
3
star
33

ndk-gcc13

Overlay for android-ndk-r10 with gcc-13 compiler (may be used standalone with waifu/xcompile)
C
3
star
34

xash3d-android-tools-gdb

GDB from AIDE NDK with lauch script
Shell
3
star
35

xash3d-sailfish

Xash3D FWGS SailfishOS port
2
star
36

libvinterface

Experiments with loading libraries with Valve's interface.
C++
2
star
37

xash3d-tizen-project

Tizen project for Xash3D FWGS engine
CMake
2
star
38

quakeremake

Crossplatform port of original Quake Remake mod with modern Xash3D FWGS build
C++
2
star
39

shtudio

A minimal MSVC6 compiler
2
star
40

vgui_support_bin

VGUI support backend binaries
1
star
41

xash3d-android-tools-sysroot

Basic sysroot to build xash3d on android (arm only)
C
1
star
42

fwgs.github.io

FWGS website
HTML
1
star
43

http-folder-uploader

Simple http server for managing data folder on restricted android environment
C
1
star
44

dllemu

DLL loader based on mplayer win32codecs code
C
1
star
45

libfontrenderer

An abstraction layer on the top of FreeType, Win32 API or stb_truetype, developed for mainui_cpp.
1
star
46

naturalselection

Natural Selection
C++
1
star