Giter VIP home page Giter VIP logo

hlsdk-portable's Introduction

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

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

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

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.

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

Android Studio

Open the project located in the android folder and build.

Command-line

cd android
./gradlew assembleRelease

Customizing the build

settings.gradle:

  • rootProject.name - project name displayed in Android Studio (optional).

app/build.gradle:

  • android->namespace and android->defaultConfig->applicationId - set both to desired package name.
  • getBuildNum function - set releaseDate variable as desired.

app/java/su/xash/hlsdk/MainActivity.java:

  • .putExtra("gamedir", ...) - set desired gamedir.

src/main/AndroidManifest.xml:

  • application->android:label - set desired application name.
  • su.xash.engine.gamedir value - set to same as above.

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 -DCMAKE_BUILD_TYPE=Release -B build -S .
cmake --build build

Force 64-bit build:

cmake -DCMAKE_BUILD_TYPE=Release -D64BIT=1 -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

Force 64-bit build:

./waf configure -T release -8
./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 x86 Windows and x86 Linux, OFF on other platforms.
  • 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.
  • 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

hlsdk-portable's People

Contributors

a1batross avatar agentagrimar avatar elinsrc avatar exstrim401 avatar fgsfdsfgs avatar fotmarut avatar freeslave avatar izarif avatar jedavies-dev avatar malortie avatar mittorn avatar moemod avatar nekonomicon avatar nillerusr avatar quaker762 avatar tyabus avatar valethevioletmote avatar velaron avatar vladislav4kz avatar w23 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hlsdk-portable's Issues

[Old Engine] MSVC Can't compile server library

I have some problems compiling server library in MSVC, it compiles just fine but the game does not load them now as the title says, I'm trying this on the Old Engine of Xash3D and 32-bit build (did not try 64-bit or the New Engine)

But for some reason, compiling on mingw32 does work as intended and has no problems, and if needed:
My Windows SDK is 10.0.18362.0
Platform Toolset is Visual Studio 2019 (v142 build tools)
MSVC Version is 16.7.3
xash_chop_2020-11-29_02-48-01

[The Gate] Sniper rifle displays a HUD scope texture when zoomed.

In the original The Gate, no HUD scope texture is displayed when zooming with the sniper rifle.

In the crossplatform release of The Gate, the sniper rifle displays a scope texture when zoomed in.

Steps to reproduce

  1. In the console, type the following commands:
sv_cheats 1
map t0a0
give weapon_crossbow
  1. Zoom using the secondary attack.

Expected behavior: No HUD scope texture.
Actual behavior: A HUD scope texture is displayed.

Failed to build Azure Sheep and Opfor server dll for GoldSrc (Cmake, MSVC)

When I tried to compile it using the compile.bat script, I added files from asheep folder there, I got some errors in the client.cpp file, that are below:

client.cpp(1671) : error C2039: 'm_flStartThrow' : is not a member of 'CBasePlay
erWeapon'
weapons.h(305) : see declaration of 'CBasePlayerWeapon'
client.cpp(1672) : error C2039: 'm_flReleaseThrow' : is not a member of 'CBasePl
ayerWeapon'
weapons.h(305) : see declaration of 'CBasePlayerWeapon'
client.cpp(1673) : error C2039: 'm_chargeReady' : is not a member of 'CBasePlaye
rWeapon'
weapons.h(305) : see declaration of 'CBasePlayerWeapon'
client.cpp(1674) : error C2039: 'm_fInAttack' : is not a member of 'CBasePlayerW
eapon'
weapons.h(305) : see declaration of 'CBasePlayerWeapon'
client.cpp(1675) : error C2039: 'm_fireState' : is not a member of 'CBasePlayerW
eapon'
weapons.h(305) : see declaration of 'CBasePlayerWeapon'
client.cpp(1766) : error C2039: 'ammo_9mm' : is not a member of 'CBasePlayer'
player.h(87) : see declaration of 'CBasePlayer'
client.cpp(1767) : error C2039: 'ammo_357' : is not a member of 'CBasePlayer'
player.h(87) : see declaration of 'CBasePlayer'
client.cpp(1768) : error C2039: 'ammo_argrens' : is not a member of 'CBasePlayer
'
player.h(87) : see declaration of 'CBasePlayer'
client.cpp(1769) : error C2039: 'ammo_bolts' : is not a member of 'CBasePlayer'
player.h(87) : see declaration of 'CBasePlayer'
client.cpp(1770) : error C2039: 'ammo_buckshot' : is not a member of 'CBasePlaye
r'
player.h(87) : see declaration of 'CBasePlayer'
client.cpp(1771) : error C2039: 'ammo_rockets' : is not a member of 'CBasePlayer
'
player.h(87) : see declaration of 'CBasePlayer'
client.cpp(1772) : error C2039: 'ammo_uranium' : is not a member of 'CBasePlayer
'
player.h(87) : see declaration of 'CBasePlayer'
client.cpp(1773) : error C2039: 'ammo_hornets' : is not a member of 'CBasePlayer
'
player.h(87) : see declaration of 'CBasePlayer'

What's wrong here?
The rest files compiled without errors.
also I could not find correct makefile to compile client dll in asheep branch.
I want to test it in game to look if what unfinished things are still left.
Upd: Compiled ok with cmake and msvc 2019.

[They Hunger] Friendly cops attack player for killing zombified cops.

In the original They Hunger, normal cops do not attack players for killing zombified cops.

In the crossplatform release of They Hunger, normal cops attack players for killing zombified cops.

A custom level bug_barney.zip is provided to allow for easier testing and debugging. It includes two cops - a normal cop and a zombie cop, as well as a glock at player spawn.

Steps to reproduce

  1. In the console, type the following commands:
map bug_barney
  1. Kill the zombified cop with the glock. Make sure the normal cop can see you.

Expected behavior: Normal cop should remain friendly to the player.
Actual behavior: Normal cop attacks the player.

Possible cause

According to the reverse engineered source code, there is an extra condition at the end of the line. Please, see the following below:

https://github.com/FWGS/hlsdk-xash3d/blob/1ffb009983ec7d36859e559e5dfbf0c478437846/dlls/talkmonster.cpp#L627-L628

This code is in the function EnumFriends, which is responsible for listing all 'friend' entities to this monster. The context in which the function is used is as follows: If a player kills a 'barney' monster, then it searches for every entity whose classname is part of the barney's friend array, and makes them enemy of the player.

The condition from the code snippet above determines if a friend entity must be skipped/ignored.

Normal cops and zombified cops use the same class, so to prevent zombified cops from making normal cops enemies of players whenever a player kills a zombified cop, the code above should probably rather be:

if( pFriend == this || !pFriend->IsAlive()
      // Skip if a zombie cop has been killed and the the target friend is a normal cop.
      || ( FBitSet( pev->spawnflags, SF_MONSTER_ZOMBIECOP )
      && !FBitSet( pFriend->pev->spawnflags, SF_MONSTER_ZOMBIECOP ) ) )
      continue;

[Half-Life: Visitors] Unable to look around when dead in 1st person.

In the original Half-Life: Visitors, the player's death is seen from a 'third person' perspective using a view slightly offset above the player, and slowly rotating.

It is still possible to have the player dead and remain in 1st person. This is done via the 'kill' command in the console. When dead in 1st person, the view rotates normally as in the original Half-Life.

In the crossplatform release of Half-Life: Visitors, when dead in 1st person, the view always remains fixed and the player is unable to look around.

Steps to reproduce

  1. In the console, type the following commands:
map t0a0
kill
  1. Try and look around.

Expected behavior: View should rotate freely.
Actual behavior: View remains fixed and the player is unable to look around.

Black screen on Goldsource

Using hlsdk-xash3d client with goldsource leads to the bug when screen is black on level loading. It's rendered after I enter menu (by ESC), but after I return to the game again, it does not update the frame.

Quick-save crashes echoes

Im not sure if this problem is with my device because i know echoes need atleast 2gb of ram, but in some areas where my fps tends to drop because alot of details/enemies/ on screen but when i quick-save in those areas the games crashes but the quick-save is there

Build systems drop discussion

I'm suggesting removal of Android.mk or moving it somewhere, pointing out that it's not supported anymore, nor by us, nor by NDK developers.

At this time, we have alternatives, that are actively used in hlsdk-xash3d development:

  1. CMake.
  • Pros:

    • Supported by Android NDK devs officially
  • Cons:

    • Doesn't support older NDKs with GCC and hardfp ABI.
  1. Waf with waifu's xcompile.py.
  • Pros:

    • We already using it for building new engine for Android.
    • xcompile.py supports older NDKs, GCC, hardfp ABI and even using host Clang for better optimizations.
  • Cons:

    • ?

However, I don't want to rush anyone and I can't call myself a maintainer of hlsdk-xash3d, so I can't decide for everyone here.

Casting everyone who develop their mods on hlsdk-xash3d. :)
@mittorn @nekonomicon @FreeSlave @AimlessWanderer @DrBeef @nillerusr

Upd: formatting

[They Hunger] Medkit weapon icon is not displayed on first time pickup.

Most of the Half-Life weapons display a weapon pickup icon when they are picked up for the first time.

In the original They Hunger, the medkit weapon displays a pickup icon.

In the crossplatform release of They Hunger, the medkit weapon does not display the pickup icon.

Steps to reproduce

In the console, type the following commands:

sv_cheats 1
map t0a0
give item_suit
give weapon_th_medkit

Expected behavior: Medkit weapon pickup icon shows up
Actual behavior: No weapon pickup icon is displayed

Possible solution

The missing behavior would probably have the following form in code:

int CWeaponEinarMedkit::AddToPlayer( CBasePlayer *pPlayer )
{
	if( CBasePlayerWeapon::AddToPlayer( pPlayer ) )
	{
		MESSAGE_BEGIN( MSG_ONE, gmsgWeapPickup, NULL, pPlayer->pev );
			WRITE_BYTE( m_iId );
		MESSAGE_END();
		return TRUE;
	}
	return FALSE;
}

Regarding updates of this repository (hlsdk)

This repository already contains a lot of fixes if you compare it to 2.3 sdk but as you may know,

  • Valve published hlsdk to github and after tons of issue reports and pull requests, It has now many fixes and It has some features which hlsdk-xash3d does not have. Maybe it is good to create a separate branch just for porting them?
  • A good developer (Solokiller) who was one of Sven Coop's developers is now making a project called HLEnhanced(https://github.com/SamVanheer/HLEnhanced) and it is so far so good. It is almost a rewrite of vanilla sdk and yet he fixed and implemented bunch of things such as cs 1.6 environment. We can ask him and port them for the sake of this project. This may be very useful for hlsdk-xash3d.
  • Porting things from open sourced mods and Regamedll_cs may also be useful.
  • Why there are two different hlsdk for xash3d ?
    https://github.com/FWGS/halflife/
    https://github.com/FWGS/hlsdk-xash3d/
    This is very confusing. If xash3d needs a separate one for its own purposes, can't we shrink it? But it would be very good if they get merged. But if this will not happen, please change names or add some description.

Black models

On map c4a1

Steam Half-Life:
c4a10000

Release build of the current master:
c4a10000

Undefined behavior.

On autoload when player is dead(fixed in 932d269):

==10158== Invalid read of size 4
==10158==    at 0x1823B2E2: CWorld::Precache() (world.cpp:631)
==10158==    by 0x18195AE5: DispatchRestore(edict_s*, saverestore_s*, int) (cbase.cpp:379)
==10158==    by 0xEDB9B5B: SV_LoadGameState (sv_save.c:1636)
==10158==    by 0xEF0EEB2: SV_LevelInit (sv_init.c:440)
==10158==    by 0xEF137A2: SV_NewGame (sv_init.c:775)
==10158==    by 0xE6FD402: Host_NewGame (host.c:125)
==10158==    by 0xEDC1B00: SV_LoadGame (sv_save.c:2180)
==10158==    by 0xEF666F8: SV_Load_f (sv_cmds.c:399)
==10158==    by 0xE6775F7: Cmd_ExecuteString (cmd.c:965)
==10158==    by 0xE67633C: Cbuf_Execute (cmd.c:217)
==10158==    by 0xE74F079: Host_InputFrame (input.c:801)
==10158==    by 0xE701470: Host_Frame (host.c:611)
==10158==  Address 0xbfbfc1b7 is not stack'd, malloc'd or (recently) free'd
==10158==
==10158== Invalid read of size 4
==10158==    at 0x709AF41: ??? (in /usr/lib32/libthr.so.3)
==10158==    by 0x709A2EA: ??? (in /usr/lib32/libthr.so.3)
==10158==    by 0x38073939: ??? (in /usr/local/lib/valgrind/memcheck-x86-freebsd)
==10158==    by 0x18195AE5: DispatchRestore(edict_s*, saverestore_s*, int) (cbase.cpp:379)
==10158==    by 0xEDB9B5B: SV_LoadGameState (sv_save.c:1636)
==10158==    by 0xEF0EEB2: SV_LevelInit (sv_init.c:440)
==10158==    by 0xEF137A2: SV_NewGame (sv_init.c:775)
==10158==    by 0xE6FD402: Host_NewGame (host.c:125)
==10158==    by 0xEDC1B00: SV_LoadGame (sv_save.c:2180)
==10158==    by 0xEF666F8: SV_Load_f (sv_cmds.c:399)
==10158==    by 0xE6775F7: Cmd_ExecuteString (cmd.c:965)
==10158==    by 0xE67633C: Cbuf_Execute (cmd.c:217)
==10158==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==10158==
==10158==
==10158== Process terminating with default action of signal 11 (SIGSEGV): dumping core

Singleplayer on amd64:

==11931== Source and destination overlap in memcpy(0x14ab3b38, 0x14ab3b38, 48)
==11931==    at 0x4C280AC: memcpy (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==11931==    by 0x12C096CD: CStudioModelRenderer::StudioDrawModel(int) (StudioModelRenderer.cpp:1163)
==11931==    by 0x12BF0400: R_StudioDrawModel(int) (GameStudioModelRenderer.cpp:73)
==11931==    by 0x6463845: R_DrawStudioModelInternal (gl_studio.c:3271)
==11931==    by 0x6464586: R_DrawStudioModel (gl_studio.c:3302)
==11931==    by 0x648DC9B: R_DrawEntitiesOnList (gl_rmain.c:1113)
==11931==    by 0x648E022: R_RenderScene (gl_rmain.c:1218)
==11931==    by 0x648F0B4: R_RenderFrame (gl_rmain.c:1330)
==11931==    by 0x6481780: V_CalcRefDef (cl_view.c:307)
==11931==    by 0x6481893: V_RenderView (cl_view.c:340)
==11931==    by 0x6482AFF: SCR_UpdateScreen (cl_scrn.c:476)
==11931==    by 0x64D95AB: Host_ClientFrame (cl_main.c:1808)
==11931==

==11931== Invalid read of size 4
==11931==    at 0x13FAB148: CGraph::FindNearestNode(Vector const&, int) (nodes.cpp:934)
==11931==    by 0x13F9B790: CBaseMonster::FGetNodeRoute(Vector) (monsters.cpp:2770)
==11931==    by 0x13F9B712: CBaseMonster::BuildRoute(Vector const&, int, CBaseEntity*) (monsters.cpp:1582)
==11931==    by 0x13F9D9F8: CBaseMonster::Move(float) (monsters.cpp:1913)
==11931==    by 0x64F8A26: SV_RunThink (sv_phys.c:205)
==11931==    by 0x64FD797: SV_Physics_Step (sv_phys.c:1655)
==11931==    by 0x64FDC74: SV_Physics_Entity (sv_phys.c:1712)
==11931==    by 0x64FD897: SV_Physics (sv_phys.c:1765)
==11931==    by 0x64EE92B: SV_RunGameFrame (sv_main.c:589)
==11931==    by 0x64EE9B4: Host_ServerFrame (sv_main.c:630)
==11931==    by 0x6599B79: Host_Frame (host.c:615)
==11931==    by 0x659B262: Host_Main (host.c:1121)
==11931==  Address 0x10 is not stack'd, malloc'd or (recently) free'd
==11931==
==11931== Syscall param sigprocmask(set) points to uninitialised byte(s)
==11931==    at 0x52043FA: _sigprocmask (in /lib/libc.so.7)
==11931==    by 0x5B0ADB4: ??? (in /lib/libthr.so.3)
==11931==    by 0x5B0A3AE: ??? (in /lib/libthr.so.3)
==11931==    by 0x38074467: ??? (in /usr/local/lib/valgrind/memcheck-amd64-freebsd)
==11931==    by 0x13F9B790: CBaseMonster::FGetNodeRoute(Vector) (monsters.cpp:2770)
==11931==    by 0x13F9B712: CBaseMonster::BuildRoute(Vector const&, int, CBaseEntity*) (monsters.cpp:1582)
==11931==    by 0x13F9D9F8: CBaseMonster::Move(float) (monsters.cpp:1913)
==11931==    by 0x64F8A26: SV_RunThink (sv_phys.c:205)
==11931==    by 0x64FD797: SV_Physics_Step (sv_phys.c:1655)
==11931==    by 0x64FDC74: SV_Physics_Entity (sv_phys.c:1712)
==11931==    by 0x64FD897: SV_Physics (sv_phys.c:1765)
==11931==    by 0x64EE92B: SV_RunGameFrame (sv_main.c:589)
==11931==  Address 0x7fefff2fc is on thread 1's stack
==11931==  Uninitialised value was created by a stack allocation
==11931==    at 0x644D87C: ??? (in /usr/local/lib/xash3d/libxash.so)
==11931==
Sys_Crash: signal 11, err 0 with code 1 at 0x10

Bug with crosshair

  1. Obtain 357 python and crossbow
  2. Select 357 python
  3. Select crossbow
  4. Use secondary attack (zoom)
  5. Use shortcut for "lastinv" command (usually Q)

357 python will have zoomed crosshair.

hev charging sound

sometimes when you next a wall and turned ur face a hev charging sound can be heard

Cthulhu mod

Cthulhu cannot be compiled. It breaks when it tries to include header from /dlls/weapons.h, revolver.h
When I copied all content from /dlls/cthulhu/ to /dlls/ it fails then on missing bmodels.h included in bmodels.cpp

[The Gate] Map gate18 fails to load.

In the crossplatform release of The Gate, the map gate18 fails to load.

Steps to reproduce

In the console, type the following commands:

map gate18

Expected behavior: The map should load as in the original mod.
Actual behavior: The game goes back to the menu and a message is displayed in the console:

PF_precache_model_I: Model 'sprites/yelflare1.spr' failed to precache because the item count is over the 512 limit.
Reduce the number of brush models and/or regular models in the map to correct this.

Gunman Chronicles

Hello, I have a question.
is it possible that someday a reverse engineering of gunman chronicles will be done?
I have already tried to imitate some, but rather with bad success :)

Lucas

[They Hunger] Gibbed enemy skeletons do not throw gibs.

In the original They Hunger, both kelly and baby kelly throw human gibs when killed.

In the crossplatform release of They Hunger, both kelly and baby kelly do not throw gibs.

A custom level gib_kelly.zip is provided to allow for easier testing and debugging. It includes a regular skeleton 'monster_alien_slave', a baby kelly skeleton 'monster_th_babykelly', and an umbrella at player spawn.

Steps to reproduce

  1. In the console, type the following commands:
map gib_kelly
  1. Damage both monsters using the umbrella until they gib.

Expected behavior: Both monsters should throw human gibs when killed.
Actual behavior: No gib is thrown.

Possible solution

According to the reverse engineered source code, there is an additional class: CLASS_SKELETON. Please see the following below:

https://github.com/FWGS/hlsdk-xash3d/blob/1ffb009983ec7d36859e559e5dfbf0c478437846/dlls/cbase.h#L106

https://github.com/FWGS/hlsdk-xash3d/blob/1ffb009983ec7d36859e559e5dfbf0c478437846/dlls/monsters.cpp#L2190

The methods HasHumanGibs and HasAlienGibs return whether or not a monster should emit human/alien gibs. The original mod behavior is probably one of the following cases:

A) The class CISlave implements HasHumanGibs.

BOOL CISlave::HasHumanGibs( void )
{
    return TRUE;
}

B) There should probably be a check for CLASS_SKELETON in the if statement below.

https://github.com/FWGS/hlsdk-xash3d/blob/1ffb009983ec7d36859e559e5dfbf0c478437846/dlls/combat.cpp#L257-L260

EDIT:

The file agibs.mdl is used for alien gib models. It appears the mod replaces this file with the same content as hgibs.mdl. This adds two additional possible cases:

C) The class CISlave implements HasAlienGibs.

BOOL CISlave::HasAlienGibs( void )
{
    return TRUE;
}

D) There should probably be a check for CLASS_SKELETON in the if statement below.

https://github.com/FWGS/hlsdk-xash3d/blob/1ffb009983ec7d36859e559e5dfbf0c478437846/dlls/combat.cpp#L271-L276

Crash when using func_tank

Program received signal SIGSEGV, Segmentation fault.
0xf7cad86b in CFuncTank::TrackTarget (this=this@entry=0x90a22f8) at func_tank.cpp:487

The reason is m_pController->pev becomes null:

(gdb) print  m_pController->pev
$1 = (entvars_t *) 0x0

I'm not sure how to reproduce it though. It just happens sometimes on my dedicated server.

Segfault on Mac: g_engfuncs interface is NULL in client.dylib

When I load certain maps (for example, bounce.bsp), using the game libraries built from this repo with the Xash3D engine, the game crashes when executing the code in the LINK_ENTITY_TO_CLASS macro for CWorld.

The exact crash I get is in the client's cbase.h:222 when executing operator new: the ALLOC_PRIVATE() macro that resolves to (*g_engfuncs.pfnPvAllocEntPrivateData) fails, because the g_engfuncs struct in the client is completely zeroed. As far as I can see, g_engfuncs isn't referred to from anything within the client library, so I'm a bit confused as to how the system is supposed to work.

The exact details of the crash are as follows:

Exception has occurred.
EXC_BAD_ACCESS (code=1, address=0x0)

[Unknown/Just-In-Time compiled code] (Unknown Source:0)
client.dylib!CBaseEntity::operator new(unsigned long, entvars_s*) (/Users/vesper/Desktop/hlsdk-xash3d/dlls/cbase.h:224)
hl.dylib!CWorld* GetClassPtr<CWorld>(CWorld*) (/Users/vesper/Desktop/hlsdk-xash3d/dlls/cbase.h:734)
hl.dylib!::worldspawn(entvars_t *) (/Users/vesper/Desktop/hlsdk-xash3d/dlls/world.cpp:446)
libxash.dylib!SV_AllocPrivateData (/Users/vesper/Desktop/xash3d/engine/server/sv_game.c:984)
libxash.dylib!SV_ParseEdict (/Users/vesper/Desktop/xash3d/engine/server/sv_game.c:4980)
libxash.dylib!SV_LoadFromFile (/Users/vesper/Desktop/xash3d/engine/server/sv_game.c:5071)
libxash.dylib!SV_SpawnEntities (/Users/vesper/Desktop/xash3d/engine/server/sv_game.c:5141)
libxash.dylib!SV_LevelInit (/Users/vesper/Desktop/xash3d/engine/server/sv_init.c:474)
libxash.dylib!SV_Map_f (/Users/vesper/Desktop/xash3d/engine/server/sv_cmds.c:279)
libxash.dylib!Cmd_ExecuteString (/Users/vesper/Desktop/xash3d/engine/common/cmd.c:1082)
libxash.dylib!Cbuf_Execute (/Users/vesper/Desktop/xash3d/engine/common/cmd.c:359)
libxash.dylib!Host_Main (/Users/vesper/Desktop/xash3d/engine/common/host.c:1374)
xash3d!Sys_Start (/Users/vesper/Desktop/xash3d/game_launch/xash.c:161)
xash3d!main (/Users/vesper/Desktop/xash3d/game_launch/xash.c:173)
libdyld.dylib!start (Unknown Source:0)
[Unknown/Just-In-Time compiled code] (Unknown Source:0)

This crash can be reproduced by taking the current master branches for the xash3d and hlsdk-xash3d repos and following these steps:

In the xash3d clone:

export CFLAGS="-m32"
export CXXFLAGS="-m32"
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Debug -DXASH_VGUI=off ..
make -j8

In the hlsdk-xash3d clone:

export CFLAGS="-m32"
export CXXFLAGS="-m32"
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Debug ..
make -j8

Copy relevant xash3d libraries into the same folder as the xash3d executable
Copy the valve folder from the Mac version of Half Life into this folder
Replace the default .dylibs with those built from the hlsdk-xash3d clone

Run:
export DYLD_LIBRARY_PATH=.
./xash3d -dev 5 -toconsole +map bounce

Срабатывание "stack smashing detected" при загрузке карты stalevar.

При попытке загрузить карту stalevar, игра крашится с "stack smashing detected".
При использовании старого клиента краша нету.
Сама карта. (Сменить расширение на .bsp.)
stalevar.zip
Backtrace:

Thread 1 "xash" received signal SIGABRT, Aborted.
0x00007ffff7b24701 in raise () from /lib64/libc.so.6
#0  0x00007ffff7b24701 in raise () from /lib64/libc.so.6
No symbol table info available.
#1  0x00007ffff7b0e2b6 in abort () from /lib64/libc.so.6
No symbol table info available.
#2  0x00007ffff7b659f1 in ?? () from /lib64/libc.so.6
No symbol table info available.
#3  0x00007ffff7be6c42 in __fortify_fail () from /lib64/libc.so.6
No symbol table info available.
#4  0x00007ffff7be6c20 in __stack_chk_fail () from /lib64/libc.so.6
No symbol table info available.
#5  0x00007ffff43082b7 in UTIL_FindEntityInMap (
    name=0x7ffff4318f0e "trigger_camera", origin=0x7ffff43475d4 <gHUD+5492>, 
    angle=0x7ffff43475e0 <gHUD+5504>) at ../cl_dll/hud_spectator.cpp:298
        n = <optimized out>
        found = <optimized out>
        keyname = "\000\000ÿÿÿ\177\000\000\000\000\000\000\000\000\000\000\001\200­ûÿ\177\000\000\200Íÿÿ\000\000\000\000ÿÿÿÿÿÿÿÿ\000\000\000\000\000\000\000\000\200Íÿÿÿ\177\000\000\226Íÿÿÿÿÿÿÿÿÿÿ\000\000\000\000\000D\tVF­f?ðÊÿÿÿ\177\000\000\200áÅ÷ÿ\177", '\000' <repeats 18 times>, "\030Ëÿÿÿ\177\000\000\060Ëÿÿÿ\177", '\000' <repeats 14 times>, "R\000\000\000@\020\216öÿ\177\000\000\200\030\216öÿ\177\000\000\060Ëÿÿÿ\177\000\000\233-ðöÿ\177\000\000\001\000\000\000R\000\000\000`´0÷ÿ\177\000\000\200\030\216öÿ\177\000\000"...
        token = "µ®\230µ®\230µ®\230µ®\230µ®\230µ®\230¼µ\236¼µ\236¼µ\236¼µ\236¼µ\236¼µ\236¼µ\236¶¯\231µ®\230µ®\230µ®\230µ®\230µ®\230µ®\230µ®\230¼µ\236¼µ\236¼µ\236¼µ\236¼µ\236¼µ\236»´\235¶¯\231µ®\230µ®\230µ®\230µ®\230µ®\230µ®\230µ®\230µ®\230µ®\230µ®\230µ®\230µ®\230µ®\230µ®\230µ®\230µ®\230µ®\230µ®\230µ®\230µ®\230µ®\230µ®\230µ®\230µ®\230µ®\230µ®\230µ®\230µ®\230µ®\230µ®\230µ®\230µ®\230µ®\230µ®\230µ®\230µ®\230µ®\230µ®"...
        pEnt = <optimized out>
        data = <optimized out>
#6  0xb899afb699afb699 in ?? ()
No symbol table info available.
#7  0x9eb5bc9eb5bc9bb1 in ?? ()
No symbol table info available.
#8  0xb5bc99afb599afb5 in ?? ()
No symbol table info available.
#9  0xbc9eb5bc9eb5bc9e in ?? ()
No symbol table info available.
#10 0x9eb5bc9eb5bc9eb5 in ?? ()
No symbol table info available.
#11 0xb5bc9eb5bc9eb5bc in ?? ()
No symbol table info available.
#12 0xbc9eb5bc9eb5bc9e in ?? ()
No symbol table info available.
#13 0x9eb5bc9eb5bc9eb5 in ?? ()
No symbol table info available.
#14 0xb5bc9eb5bc9eb5bc in ?? ()
No symbol table info available.
#15 0xbc9eb5bc9eb5bc9e in ?? ()
No symbol table info available.
#16 0x9eb5bc9eb5bc9eb5 in ?? ()
No symbol table info available.
#17 0xb5bc9eb5bc9ab0b7 in ?? ()
No symbol table info available.
#18 0xb69eb5bc9eb5bc9e in ?? ()
No symbol table info available.
#19 0x9eb5bc9eb5bc99af in ?? ()
No symbol table info available.
#20 0xafb69cb2b99eb5bc in ?? ()
No symbol table info available.
#21 0xb89ab0b79ab0b799 in ?? ()
No symbol table info available.
#22 0x99afb699afb69ab1 in ?? ()
No symbol table info available.
#23 0xafb699afb699afb6 in ?? ()
No symbol table info available.
#24 0xb699afb699afb699 in ?? ()
No symbol table info available.
#25 0x99afb699afb699af in ?? ()
No symbol table info available.
#26 0xafb699afb699afb6 in ?? ()
No symbol table info available.
#27 0xb699afb699afb699 in ?? ()
No symbol table info available.
#28 0x99afb699afb699af in ?? ()
No symbol table info available.
#29 0xafb699afb699afb6 in ?? ()
No symbol table info available.
#30 0xb699afb699afb699 in ?? ()
No symbol table info available.
#31 0x99afb699afb699af in ?? ()
No symbol table info available.
#32 0xafb699afb699afb6 in ?? ()
No symbol table info available.
#33 0xb699afb699afb699 in ?? ()
No symbol table info available.
#34 0x99afb699afb699af in ?? ()
No symbol table info available.
#35 0xafb699afb699afb6 in ?? ()
No symbol table info available.
#36 0xb699afb699afb699 in ?? ()
No symbol table info available.
#37 0x99afb699afb699af in ?? ()
No symbol table info available.
#38 0x3332005b5f38585b in ?? ()
No symbol table info available.
#39 0x3534180434331804 in ?? ()
No symbol table info available.
#40 0x00007fffffffda7c in ?? ()
No symbol table info available.
#41 0x0000555557056830 in ?? ()
No symbol table info available.
#42 0x0000555555cbc570 in ?? ()
No symbol table info available.
#43 0x3d3c1c0500000000 in ?? ()
No symbol table info available.
#44 0x0000555557056830 in ?? ()
No symbol table info available.
#45 0x00007fffffffd510 in ?? ()
No symbol table info available.
#46 0x00007ffff6eb237a in SV_FindTouchedLeafs (
    ent=<error reading variable: Cannot access memory at address 0x99afb69ab0b79e9d>, 
    node=<error reading variable: Cannot access memory at address 0x99afb69ab0b79e95>, 
    headnode=<error reading variable: Cannot access memory at address 0x99afb69ab0b79e8d>) at ../engine/server/sv_world.c:623
        sides = <error reading variable sides (Cannot access memory at address 0x99afb69ab0b79ea9)>
        leaf = <error reading variable leaf (Cannot access memory at address 0x99afb69ab0b79ead)>
Backtrace stopped: Cannot access memory at address 0x99afb69ab0b79ebd

BlueShift error changelevel

In the initial train ride of blue shift, it stops after about one minute complaining that changelevel doesn't have a valid spawn point

HUD margins

Add support of HUD margins, like Half-Life on PS1.

[The Gate] Gibbed attack dogs throw alien gibs instead of human gibs.

In the original The Gate, attack dogs throw human gibs when killed.

In the crossplatform release of The Gate, attack dogs throw alien gibs.

A custom level gib_dog.zip is provided to allow for easier testing and debugging. It includes an attack dog and a knife at player spawn.

Steps to reproduce

  1. In the console, type the following commands:
map gib_dog
  1. Damage the monster using the knife until it gibs.

Expected behavior: Monster should throw human gibs when killed.
Actual behavior: Monster throws alien gibs when killed.

Possible solution

The methods HasHumanGibs and HasAlienGibs return whether or not a monster should emit human/alien gibs. The original mod behavior is probably one of the following cases:

A) The class CHoundeye implements HasHumanGibs

BOOL CHoundeye::HasHumanGibs( void )
{
    return TRUE;
}

B) There should probably be a check for CLASS_ALIEN_MONSTER in the if statement below.

https://github.com/FWGS/hlsdk-xash3d/blob/e1a96b59f1b214639201bcb8931a100d3a6fa1e3/dlls/combat.cpp#L257-L260

Bug when using func_tank

If player disconnects from dedicated server while using tank and then connects again, func_tank still tries to copy player's camera movements even when player does not use it.

[Half-Life: Visitors] Missing effects when shooting at specific textures.

In the original Half-Life: Visitors, there are additional effects that occur when firing at brushes with specific textures.

These effects include, but might not be limited to:

  • Tiny smoke
  • Particles bouncing off wall

In the crossplatform release of Half-Life: Visitors, these effects are missing.

Steps to reproduce

  1. In the console, type the following commands:
sv_cheats 1
map vis24
impulse 101
  1. Select the MP5 (9mmAR).
  2. Shoot at the concrete walls around your current position.
  3. Shoot at the floor you are standing on.

3 - Expected behavior: Concrete particles should spawn randomly at the hit location.
Actual behavior: No concrete particles spawn.

4 - Expected behavior: Smoke should spawn at the hit location.
Actual behavior: No smoke spawns.

Additionally, shooting with the following weapons also casts these effects in the original mod release:

  • Glock
  • Python
  • Shotgun
  • Sniper rifle

Gibs and german version

Since Valve made the German version normal recently, should we change anything about it in SDK?
There're places in SDK that depend on LANGUAGE_GERMAN. Does sv_language even differ between countries?

Wrong thirdperson camera angles

Camera looks at player from the right side instead of looking from behind.
Btw the same bug exists in original HL on goldsource.

[They Hunger] Egon plays runoff sound when holstered.

In the original They Hunger, the egon 'flamethrower' does not play any sound during holster.

In the crossplatform release of They Hunger, the runoff sound is played during holster.

Steps to reproduce

  1. In the console, type the following commands:
sv_cheats 1
map t0a0
impulse 101
  1. Switch to egon.
  2. Switch to a different weapon.

Expected behavior: No runoff sound is played.
Actual behavior: Runoff sound is played.

Possible cause

It might be possible that the two lines of code were removed/commented in the original source code.

https://github.com/FWGS/hlsdk-xash3d/blob/1ffb009983ec7d36859e559e5dfbf0c478437846/dlls/egon.cpp#L228-L229

Failed to compile on VS2013

I used cmake and generated the files. Afterwards, I tried to compile the solution. It failed giving me some errors and warnings (P.S Sorry for the mess xP):

Error 1 error D8021: invalid numeric argument '/Wno-write-strings' D:\XASHSDLPROJECT\Source Codes\hlsdk-xash3d-master\project-files\cl_dll\cl client
Warning 2 warning D9025: overriding '/W3' with '/w' D:\XASHSDLPROJECT\Source Codes\hlsdk-xash3d-master\project-files\dlls\cl server
Warning 3 warning D9002: ignoring unknown option '-fno-exceptions' D:\XASHSDLPROJECT\Source Codes\hlsdk-xash3d-master\project-files\dlls\cl server
Error 4 error C2276: '&' : illegal operation on bound member function expression D:\XASHSDLPROJECT\Source Codes\hlsdk-xash3d-master\dlls\effects.cpp 413 1 server
Error 5 error C3083: '{ctor}': the symbol to the left of a '::' must be a type D:\XASHSDLPROJECT\Source Codes\hlsdk-xash3d-master\dlls\effects.cpp 1270 1 server

MinGW server binary fails to load

So, I got MinGW working and I was able to compile the Xash HLSDK. Client loads fine, but when trying to load up a map, Xash stops and gives an error saying that it couldn't load 'dll\hl.dll'

Here is the engine log:
engine.log

At first, engine can load the server binary, but then it runs into a problem (Line 140 in log):
[2018:04:01|23:05:30] SV_LoadProgs: failed to get address of GiveFnptrsToDll proc

Any ideas as to what the problem is?

Blue shift branch

Consider making Blue Shift branch (and probably for other mods) like you did in halflife repo. But first maybe it makes sense to wait for nekonomicon changes to be merged.

[They Hunger] Chaingun weapon icon is not displayed on first time pickup.

Most of the Half-Life weapons display a weapon pickup icon when they are picked up for the first time.

In the original They Hunger, the chaingun weapon displays a pickup icon.

In the crossplatform release of They Hunger, the chaingun weapon does not display the pickup icon.

Steps to reproduce

In the console, type the following commands:

sv_cheats 1
map t0a0
give item_suit
give weapon_th_chaingun

Expected behavior: Chaingun weapon pickup icon shows up
Actual behavior: No weapon pickup icon is displayed

Possible solution

Again, I am not knowledgeable about reverse engineering, but the missing behavior would probably have the following form in code:

int CWeaponEinarChaingun::AddToPlayer( CBasePlayer *pPlayer )
{
	if( CBasePlayerWeapon::AddToPlayer( pPlayer ) )
	{
		MESSAGE_BEGIN( MSG_ONE, gmsgWeapPickup, NULL, pPlayer->pev );
			WRITE_BYTE( m_iId );
		MESSAGE_END();
		return TRUE;
	}
	return FALSE;
}

[Azure Sheep] Alien slaves do not perform fast beam attacks in easy and medium skill levels.

In the original Half-Life, alien slaves perform beam attacks faster on skill 'hard' than on easy and medium.

In the original Azure sheep, alien slaves always do the fast beam attack, no matter the skill level. This is also the case for pink alien slaves 'monster_exp_alien_slave'.

In the crossplatform release of Azure sheep, alien slaves use the same behavior as in Half-Life.

A custom level bug_alien_slave.zip is provided to allow for easier testing and debugging. It includes one normal alien slave 'monster_alien_slave' and one pink alien slave 'monster_exp_alien_slave'.

Steps to reproduce

  1. In the console, type the following commands:
skill 1
map bug_alien_slave
god

Expected behavior: Alien slaves should do fast beam attack.
Actual behavior: Alien slaves do the normal beam attack.

  1. Disconnect and type the following commands:
skill 2
map bug_alien_slave
god

Expected behavior: Alien slaves should do fast beam attack.
Actual behavior: Alien slaves do the normal beam attack.

Possible cause

The following if statement was probably removed/commented in the original source code.

https://github.com/FWGS/hlsdk-xash3d/blob/c6ccf4e7145ddeba387afee421231568977a36f4/dlls/islave.cpp#L281

Sounds in momentary_door

When door starts to return to its initial position the stop sound plays repeatedly.
The stop sound should play once when the door reaches its initial position or the final destination of the whole move.

You can see a bug on maps c2a3a and c2a5 (underwater doors).

unresolved external symbol, opfor x64 vs2019

This is more of a comment than an issue because, AFAIK, building on Windows 10 64-bit with Visual Studio 2019 is not supported. It can, however, be built. See my brief blog post: build xash3d 64-bit Win10 vs2019.

The only issue I discovered relates to this error while building the "opfor" branch:

  Generating Code...
     Creating library D:/Dev/xash3d/gearbox/build/dlls/Release/opfor64.lib and object D:/Dev/xash3d/gearbox/build/dlls/
  Release/opfor64.exp
ctf_items.obj : error LNK2019: unresolved external symbol "char * __cdecl GetTeamName(int)" (?GetTeamName@@YAPEADH@Z) r
eferenced in function "private: void __cdecl CItemFlag::Capture(class CBasePlayer *,int)" (?Capture@CItemFlag@@AEAAXPEA
VCBasePlayer@@H@Z) [D:\Dev\xash3d\gearbox\build\dlls\server.vcxproj]
    Hint on symbols that are defined and could potentially match:
      "char const * __cdecl GetTeamName(int)" (?GetTeamName@@YAPEBDH@Z)
D:\Dev\xash3d\gearbox\build\dlls\Release\opfor64.dll : fatal error LNK1120: 1 unresolved externals [D:\Dev\xash3d\gearb
ox\build\dlls\server.vcxproj]

I understand it's related to ANSI/Unicode strings as mentioned here: Working with Strings

This patch resolves the issue:

diff --git a/dlls/gearbox/ctf_items.cpp b/dlls/gearbox/ctf_items.cpp
index ab38378..8f6bcb3 100644
--- a/dlls/gearbox/ctf_items.cpp
+++ b/dlls/gearbox/ctf_items.cpp
@@ -34,7 +34,7 @@ This contains the Flag entity information for the Half-Life : Opposing force CTF
 
 extern int gmsgCTFMsgs;
 
-extern char* GetTeamName(int team);
+const char* GetTeamName(int team);
 
 
 /*****************************************************

I have no idea why that works but only found one instance of extern char* and numerous const char* so it ended up being a guess. I suspect the change would be compatible with both GCC and the Microsoft compiler but don't really know.

I've built with VS2019 and GCC8 so this code is rolling forward nicely.

Help me

How to build half life sdk for android i want to add new weapons for xash 3d apk plz ?

[Azure Sheep] Map asmap02d crashes due to missing model.

In the crossplatform release of Azure sheep, the map asmap02d crashes upon loading due to missing model.

Steps to reproduce

In the console, type the following commands:

map asmap02d

Expected behavior: The map should load as in the original mod.
Actual behavior: An error message occurs:

Mod_NumForName: models/gordon.mdl not found

Possible cause

Below, I believe the model name would need to be changed to models/freeman.mdl.

https://github.com/FWGS/hlsdk-xash3d/blob/c6ccf4e7145ddeba387afee421231568977a36f4/dlls/barney.cpp#L811-L812

Question about reverse engineered mods.

A few months ago, I found the open source mods list and I saw that some mods have been reverse engineered.

Please note that I am not too knowledgeable with reverse engineering, but from my understanding, source code has likely been rewritten by using information from decompiled/disassembled DLLs. Because this reproduces almost if not exactly the experience of the original mods, I have been lately thinking of archiving my HL1 Steampipe patches - precisely the ones for which the original mod has been reverse engineered and has been made cross platform (see ModDB).

Here is the list of reverse engineered mods that have a cross platform release, and for which I had made a Steampipe patch:

  • Azure Sheep
  • Escape from the darkness
  • Half-Life: Visitors
  • The Gate
  • They Hunger

Please would it be possible to confirm if all mods listed above have been 100% reverse engineered?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.