Git Product home page Git Product logo

xash3d-fwgs's Introduction

Xash3D FWGS Engine Xash3D FWGS icon

builds.sr.ht status GitHub Actions Status FreeBSD Build Status Discord Server
Download Stable Download Testing

Xash3D FWGS is a game engine, aimed to provide compatibility with Half-Life Engine and extend it, as well as to give game developers well known workflow.

Xash3D FWGS is a heavily modified fork of an original Xash3D Engine by Unkle Mike.

Donate

Donate to FWGS button
If you like Xash3D FWGS, consider supporting individual engine maintainers. By supporting us, you help to continue developing this game engine further. The sponsorship links are available in documentation.

Fork features

  • Steam Half-Life (HLSDK 2.4) support.
  • Crossplatform and modern compilers support: supports Windows, Linux, BSD & Android on x86 & ARM and many more.
  • Better multiplayer support: multiple master servers, headless dedicated server, voice chat and IPv6 support.
  • Multiple renderers support: OpenGL, GLESv1, GLESv2 and Software.
  • Advanced virtual filesystem: .pk3 and .pk3dir support, compatibility with GoldSrc FS module, fast case-insensitivity emulation for crossplatform.
  • Mobility API: better game integration on mobile devices (vibration, touch controls)
  • Different input methods: touch and gamepad in addition to mouse & keyboard.
  • TrueType font rendering, as a part of mainui_cpp.
  • External VGUI support module.
  • PNG & KTX2 image format support.
  • A set of small improvements, without broken compatibility.

Installation & Running

  1. Get Xash3D FWGS binaries: you can use testing build or you can compile engine from source code.
  2. Copy engine binaries to some directory.
  3. Copy valve directory from Half-Life to directory with engine binaries. If your CPU is NOT x86 compatible or you're running 64-bit version of the engine, you may want to compile Half-Life SDK. This repository contains our fork of HLSDK and restored source code for some of the mods. Not all of them, of course. You still needed to copy valve directory as all game resources located there.
  4. Run the main executable (xash3d.exe or AppImage).

For additional info, run Xash3D with -help command line key.

Contributing

  • Before sending an issue, check if someone already reported your issue. Make sure you're following "How To Ask Questions The Smart Way" guide by Eric Steven Raymond. Read more: http://www.catb.org/~esr/faqs/smart-questions.html
  • Issues are accepted in both English and Russian
  • Before sending a PR, check if you followed our contribution guide in CONTRIBUTING.md file.

Build instructions

We are using Waf build system. If you have some Waf-related questions, I recommend you to read https://waf.io/book/

NOTE: NEVER USE GitHub's ZIP ARCHIVES. GitHub doesn't include external dependencies we're using!

Prerequisites

If your CPU is x86 compatible, we are building 32-bit code by default. This was done to maintain compatibility with Steam releases of Half-Life and based on it's engine games. Even if Xash3D FWGS does support targetting 64-bit, you can't load games without recompiling them from source code!

If your CPU is NOT x86 compatible or you decided build 64-bit version of engine, you may want to compile Half-Life SDK. This repository contains our fork of HLSDK and restored source code for some of the mods. Not all of them, of course.

Windows (Visual Studio)

  • Install Visual Studio.
  • Install latest Python OR run cinst python.install if you have Chocolatey.
  • Install latest Git OR run cinst git.install if you have Chocolatey.
  • Download SDL2 development package for Visual Studio.
  • Clone this repository: git clone --recursive https://github.com/FWGS/xash3d-fwgs.
  • Make sure you have at least 12GB of free space to store all build-time dependencies: ~10GB for Visual Studio, 300 MB for Git, 100 MB for Python and other.

GNU/Linux

Debian/Ubuntu
  • Enable i386 on your system, if you're compiling 32-bit engine on amd64. If not, skip this

$ sudo dpkg --add-architecture i386

  • Install development tools
    • For 32-bit engine on amd64:
      $ sudo apt install build-essential gcc-multilib g++-multilib python libsdl2-dev:i386 libfontconfig-dev:i386 libfreetype6-dev:i386
    • For everything else:
      $ sudo apt install build-essential python libsdl2-dev libfontconfig-dev libfreetype6-dev
  • Clone this repostory: $ git clone --recursive https://github.com/FWGS/xash3d-fwgs

Building

Windows (Visual Studio)

  1. Open command line
  2. Navigate to xash3d-fwgs directory.
  3. Carefully examine which build options are available: waf --help
  4. Configure build: waf configure -T release --sdl2=c:/path/to/SDL2
  5. Compile: waf build
  6. Install: waf install --destdir=c:/path/to/any/output/directory

Linux

If compiling 32-bit on amd64, you may need to supply export PKG_CONFIG_PATH=/usr/lib/i386-linux-gnu/pkgconfig prior to running configure.

  1. Examine which build options are available: ./waf --help
  2. Configure build: ./waf configure -T release (You need to pass -8 to compile 64-bit engine on 64-bit x86 processor)
  3. Compile: ./waf build
  4. Install(optional): ./waf install --destdir=/path/to/any/output/directory

xash3d-fwgs's People

Contributors

a1batross avatar agentagrimar avatar exstrim401 avatar fgsfdsfgs avatar fotmarut avatar glebm avatar hgojf avatar izarif avatar jeefo avatar kungfulon avatar lewa-j avatar lilmayofuksu avatar m0rf30 avatar malortie avatar mittorn avatar mr0maks avatar nekonomicon avatar nillerusr avatar snmetamorph avatar sofakng avatar timschumi avatar tyabus avatar valethevioletmote avatar velaron avatar vladislav4kz avatar w23 avatar weimzh avatar xav101 avatar xdettlaff avatar zgdump 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xash3d-fwgs's Issues

Stencil shadows.

Valve disabled stencil shadows in the latest WON and steam HL releases for no apparent reason.
Stencil shadows was disabled in Xash3D too, because some mods inject GL_StudioDrawShadows function in game libraries.
An example:
https://github.com/nekonomicon/hlsdk-xash3d/blob/zombie-x/cl_dll/hud.cpp#L363
https://github.com/nekonomicon/hlsdk-xash3d/blob/zombie-x/cl_dll/StudioModelRenderer.cpp#L36
https://github.com/nekonomicon/hlsdk-xash3d/blob/zombie-x/cl_dll/StudioModelRenderer.cpp#L1754

But this hack will work only on x86 windows.
What about other platforms?

Issues with MIPS (big endian) architecture

I tried to launch xash3d-fwgs engine on my router (latest commit, big endian), but it seems to be almost broken on this architecture.

Issues list:
map loading dosen't work (first, the engine says that map has invalid format, then it says that map dosen't have a valid spawn point, after commenting that checks, the engine crash at the map load)
wads loading dosen't work

The issues list is not full, because i still can't resolve the map loading issue

[LINUX] Can't compile simple program. Check your path to vgui-dev repository

here's the terminal output, compiling on Ubuntu 16.04 amd64 with x86 support enabled, compiling for x86

(xenial)saiko@localhost:~/xash3d-fwgs$ ./waf configure --build-type=release --vgui=vgui-dev
Setting top to                           : /home/saiko/xash3d-fwgs 
Setting out to                           : /home/saiko/xash3d-fwgs/build 
Build type                               : release 
Checking for 'gcc' (C compiler)          : /usr/bin/gcc 
Checking for 'g++' (C++ compiler)        : /usr/bin/g++ 
Checking git hash                        : 245533d 
Checking if 'gcc' can target 32-bit      : no 
...trying with additional flags          : yes 
NOTE: will build engine for 32-bit target
Checking for library dl                  : yes 
Checking for library m                   : yes 
Checking for library pthread             : yes 
--> engine                               : in progress 
Checking for library SDL2                : yes 
Checking for library SDL2 sanity         : yes 
<-- engine                               : done 
--> game_launch                          : in progress 
<-- game_launch                          : done 
--> mainui                               : in progress 
Checking if 'gcc' supports C++11         : no 
...trying with additional flags          : no 
Checking for program 'pkg-config'        : /usr/bin/pkg-config 
Checking for 'freetype2'                 : yes 
Checking for 'fontconfig'                : yes 
<-- mainui                               : done 
--> vgui_support                         : in progress 
Configuring VGUI by provided path        : yes: [':vgui.so'], ['/home/saiko/xash3d-fwgs/vgui-dev/lib'], ['/home/saiko/xash3d-fwgs/vgui-dev/include'] 
Checking for library VGUI sanity         : no 
Can't compile simple program. Check your path to vgui-dev repository.
(complete log in /home/saiko/xash3d-fwgs/build/config.log)

Проблемы с мультитачем в xash3d & cs16client

Здравствуйте, возможно кто-то сталкивался с подобным или же алмины знают решение данной проблемы.
Поставил кеш, который использовался ранее без нареканий, скачал из маркета xash3d & cs16client, во время первой же игры заметил, что игра не воспринимает более 2 нажатий, при попытке превысить "лимит" нажатия полностью сбрасываются.
Для полного понимания проблемы просьба просмотреть прикреплённое видео(извиняюсь за качество, но суть видна).
vk.com/video209996335_456239331
Заранее спасибо!

Аппарат Redmi Note 3 Pro
Havoc 9.0

Check library dependency on Win32

We need to check if client.dll actually have direct dependency on SDL2. If so, we can assume that this game uses HLSDK2.4 input code and we may enable SDL2 relative mouse mode.

keyboard.cfg

Should we keep this feature?

Pros:

  • Easy to revert settings in menu.
  • Separated from everything else.
  • ...?

Cons:

  • Isn't reverse-compatible to original Xash3D engine.
  • May be not intuitive to old players, who knows that everything can be found in "config.cfg" always.

Enhancement request: Make GAME_PATH a waf option

game_launch/game.cpp defines this:
#define GAME_PATH "valve" // default dir to start from
Can you make this a waf configure option so that users can build custom game launchers without editing the sources?

Attempting to create a LAN game while no network is present quits back to main menu

I've been trying to test a multiplayer map in my own fork, and was attempting to do this on my laptop without network connectivity. I only needed to run up a local server with me in it, so actual connectivity was not required.

If I go through the main menu to the multiplayer section and attempt to create a LAN game in this instance, I get the following error:

[17:51:01] Scanning for servers on the local network area...
[17:51:01] Host_Error: NET_SendPacket: Network is unreachable to 100.221.255.191:27015

Because of the host error, I then get taken back to the main menu and am unable to proceed in creating the local server. (Note that I'm running with -dev 5 - I dunno if the same would happen without that option).

My first thoughts on remedying this would be to allow an option to be passed to NET_SendPacket (and the other functions that the local server calls through to) to specify whether failures should be critical. Is this something that would be considered? I could put together a pull request for it if so.

Enhancement request: auto-gen player's name

As many players don't change their name in configurations, how about reading the current user name and use it as default?
For example,

BOOL GetUserNameA(LPSTR lpBuffer,LPDWORD pcbBuffer ); // for Windows
NSString * NSUserName(void); // for macOS

Windows 10: xash.dll "cannot be found" in latest build from master

I'm having issues running xash3d.exe when compiled on either of my Windows 10 machines, in either debug or release. When I run the executable I get the error:

Unable to load the xash.dll: The specified module could not be found.

I vaguely remember having issues with this before, so I tried to use Dependency Walker to see whether I could deduce what was wrong. Unfortunately when I try and profile the executable, Dependency Walker hangs (apparently indefinitely) after the implicit modules plus IMM32.dll have been loaded.

The engine build works as expected on my Ubuntu machine.

New library naming scheme proposal

I propose a new library naming scheme, which will allow to distribute mods and games in single archive to different operating systems and CPUs:

Legend:

  • $os -- Q_buildos() return value, in lower case.
  • $arch -- Q_buildarch() return value, in lower case.
  • $ext -- OS-specific extension: dll, so, dylib, etc.

The scheme will be:

  1. Client library:
  • client.$ext for Win/Lin/Mac with x86.
  • client_$arch.$ext for Win/Lin/Mac with NON-x86.
  • client_$os_$arch.$ext for everything else.
  1. Menu library:
  • menu.$ext for Win/Lin/Mac with x86.
  • menu_$arch.$ext for Win/Lin/Mac with NON-x86.
  • menu_$os_$arch.$ext for everything else.
  1. Server library:
  • On Win/Lin/Mac with x86, it MUST use the raw gamedll name for corresponding OS field from gameinfo.txt.
  • On Win/Lin/Mac with NON-x86, it MUST use the raw gamedll name for corresponding OS field from gameinfo.txt, but append _$arch before file extension. Like: hl_amd64.so or cs_e2k.so.
  • On everything else, it must use gamedll name from gamedll_linux field, but append _$os_$arch before file extension. Like: hl_haiku_amd64.so or cs_freebsd_armhf.so.
    Why gamedll_linux and not gamedll? Because it looks more logic that way, most operating systems are *nix-like and share code with Linux, rather than Windows.
  1. Refresh library: not needed, as RefAPI is not stable and it's not intended to distribute with mods.

For any libraries distributed with engine, naming scheme should be used more convenient for OS port.

Issue #0. Inconsistency between ABI and Q_buildarch.
Resolution: Change Q_buildarch return value to use Debian-styled architectures list: https://www.debian.org/ports/, which includes a special naming for big/little-endian and hard/soft-float ARM.

Issue #1: Build-system integration.
Resolution: extend MACRO_TO_DEST_CPU and MACRO_TO_DESTOS from Waf: https://gitlab.com/ita1024/waf/blob/master/waflib/Tools/c_config.py#L1002, if needed.

Moving renderer from engine to standalone library

$subj.

I don't know how to connect them to custom renderers in client.dll: studio renderers, Paranoia-way or RenderAPI.

  • For Paranoia-like or studio renderers we should restrict only for default renderer. The issue is in detecting when client.dll have custom renderer and when does not.
  • For RenderAPI based we should:
  1. Provide same functionality, so game creators can get custom renderer features just by copy-pasting DLL.
    1.1. How this must be compatible with original engine?
    1.2. How this can be compatible with already existing mods?
  2. Or do nothing. Let them available only for default renderer, like for Paranoia-way.

P.S.

  • Paranoia-way custom rendering is just to disable engine renderer with "clientonly" boolean in refdef and draw everything in HUD_DrawNormal/TransparentTriangles, maybe with opengl32.dll wrapper.
  • StudioModelRenderer can override rendering studio models just by drawing them by client.dll and skipping some engine calls.

Список багов в некоторых модах.

Дубль FWGS/xash3d#323
Общее:

  • Не отображается Muzzleflash у Alien Grunt'ов(спрайт muz4.spr). Это немного затрудняет прохождение Afraid of Monsters: Director's Cut, так как в этом моде Alien Grunt'ы имеют прозрачные модели, а при стрельбе из hivehand должна отображаться улыбающаяся физиономия.(исправлено)
  • Отображается Muzzleflash на Holster-анимации оружия.(Исправлено)
  • Не работает на клиенте(с тач-управлением проблема не воспроизводится)(исправлено)
  • Монстры не видят сквозь окна, вроде и не фатально, но ломает прохождение Azure Sheep на карте asmap04c(ученый не может открыть дверь, потому что не видит игрока).(исправлено)
  • Монстров на движущихся платформах трясет во все стороны.
  • Не отображаются прозрачные кастомные декали(Например из trusty pack или мода Echoes)(исправлено, но возможно проблема VBO)
  • Не игнорируется bottom-left-ориентация tga-текстур.(исправлено)
  • He отображается белый текст в меню в некоторых модах(только на Android).

Adrenaline Gamer:

  • Красный флаг имеет синюю текстуру.
  • Мерцание текстуры ctf_base на карте agctf_bootcamp под некоторым углом обзора.

Battlegrounds:

Big Scientists:

  • Не отображаются большие модели под некоторым углом обзора.(Исправлено)

Deathmatch Classic:

  • Неверный размер хуллов, из-за чего модели игроков проваливаются ногами в текстуры и возможны застревания на спауне.
  • При падении в лаву игрок не получает урон, пока в ней не движется.(исправлено)
  • Не отображается анимация lightninggun'а при cl_lw 1.(исправлено)
  • Не отображается панель выбора оружия при cl_lw 0.(не баг)

Decay:

  • Не отображаются анимации у лап вортигонта при cl_lw 1.

Echoes:

  • Срабатывает assert на карте echoes21 при включеном VBO.(связан с VBO)

Sweet Half-Life:

  • Вылет при стрельбе из плазмагана(в движке имеется assert для этого бага)(исправлено)

They Hunger:

  • На загрузке сохранений глушитель у глока появляется не сразу(похоже GoldSrc имеет ту же проблему, но репредиктинг в оригинальном xash3d build 3598+ решает проблему)(возможно не баг)
  • На загрузке сохранений пропадает зеленый фильтр у прицела снайперской винтовки.(возможно не баг)
  • Не раскрывается пламя у огнемета(в оригинальном They Hunger и моем декомпиле, в версии от malortie оно реализано не через TE_PROJECTILE)(исправлено)
  • На одной из карт поезд проходит сквозь цистерны
  • На одной из последних карт вертолет, который должен обстреливать зомби, просто висит в воздухе.

ThreeWave CTF:

  • Не отображается фон из fallback_dir(воспроизводится только на android)

Residual Life:

  • Зависает скрипт в этом месте и охранник с зомби не двигаются пока игрок не убьет зомби.(исправлено)

Poke646 и Poke646: Vendetta:

  • Из-за обнуления таймера глобального времени отрисовки HUD при смене карты, HUD может длительное время не отрисовываться.(не связано с движком)
  • Не отображается прицел у арбалета( Не отрабатывает вызов HUD_DrawTransparentTriangles ).(не связано с движком)
  • Заедание звука открытия двери на карте po_intro в Poke646.(исправлено)

Blue Shift:

Cleaner's Adventures:

  • Баг с водой(связан с VBO)
  • Отображение черно-розовых квадратов вместо текстур при частых загрузках сохранений(исправлено)

Top-Down:

  • Вместо модели player в синглплеере используется модель gordon или любая другая модель, выбранная для мультиплеера.(воспроизводится только с включенным режимом разработчика)
  • Не меняется body-модель у модели игрока(воспроизводится только с включенным режимом разработчика)

Opposing Force:

  • Черный экран при переходе с карты of0a0 на карту of1a1

Ошибка в R_CheckLightMap

https://github.com/FWGS/xash3d-fwgs/blob/master/ref_gl/gl_rsurf.c#L2913

maps == MAX_LIGHTMAPS

В цикле идёт проверка на то что maps меньше MAXLIGHMAPS ( 4 )

for( maps = 0; maps < MAXLIGHTMAPS && fa->styles[maps] != 255; maps++ ) { if( tr.lightstylevalue[fa->styles[maps]] != fa->cached_light[maps] ) { is_dynamic = true; break; } }

maps == MAX_LIGHTMAPS будет не правдимым в любом случае, так как MAX_LIGHMAPS равен 256

Video playback support

  • For modern Android we can use MediaCodec available in NDK since even 5.0. It provides low-level access to audio/video decoders/encoders and almost perfectly fits for our needs. OpenMAX AL is completely useless.
  • For generic support we still should provide GStreamer or FFmpeg backend.
  • And obviously stub for those who don't want a dependency.

I don't think we really need hardware decoder here, as playing just short intros and logos in menu isn't a complicated task for modern CPUs. One exception is videos in XashXT, but AFAIK nothing uses them, except demo.

Help is still needed here. :)

Inclusion of cross-platform ZHLT compile tools?

I'm probably going to swap my own fork from the original Xash3D engine to this one, so that I have the opportunity of adding stuff upstream that would be more useful here than in the other engine.

My first question is: would a cross-platform set of compilation tools be considered valuable? I've found a set of the ZHLT compile tools that compiles successfully for me on Linux: https://github.com/tyabus/zhlt-linux

I'm probably going to be adding these to my own fork because, in my seemingly eternal pursuit of importing Nightfire maps, it's proving a better course of action to recompile existing maps with a slightly modified textures lump than to attempt to convert compiled BSPs to be compatible with Half-Life. I wanted to check here first, in case they'd be a useful addition upstream. It would require me learning how to use Waf, though.

xash doesnt output nothing at all on armhf linux

Hi, I cant make xash3d to make even run!!

ive put all the libs and the executable on the same folder and with

LD_LIBRARY_PATH=. ./xash3d
or
LD_LIBRARY_PATH=. ./xash3d --help

it doesnt output anything at all!
hope you could give me a clue

pi@raspberrypi:~/Desktop/xash3d-fwgs $ ./waf configure -T release --prefix=/home/pi/Desktop/xash3d-fwgs/build
Setting top to                           : /home/pi/Desktop/xash3d-fwgs 
Setting out to                           : /home/pi/Desktop/xash3d-fwgs/build 
Build type                               : release 
Checking for 'gcc' (C compiler)          : /usr/bin/gcc 
Target OS                                : linux 
Target CPU                               : arm 
Target binfmt                            : elf 
Checking for 'g++' (C++ compiler)        : /usr/bin/g++ 
Target OS                                : linux 
Target CPU                               : arm 
Target binfmt                            : elf 
Checking git hash                        : 8f47596 
Checking for program 'strip'             : /usr/bin/strip 
Checking if 'gcc' can target 32-bit      : yes 
Checking for library SDL2                : yes 
Checking for library SDL2 sanity         : yes 
Checking for library dl                  : yes 
Checking for library m                   : yes 
Checking for library pthread             : yes 
--> public                               : in progress 
<-- public                               : done 
--> game_launch                          : in progress 
<-- game_launch                          : done 
--> ref_gl                               : in progress 
<-- ref_gl                               : done 
--> mainui                               : in progress 
Checking if 'gcc' supports C++11         : yes 
Checking for program 'pkg-config'        : /usr/bin/pkg-config 
Checking for 'freetype2'                 : yes 
Checking for 'fontconfig'                : yes 
<-- mainui                               : done 
--> vgui_support                         : in progress 
Does this architecture support VGUI?     : no 
vgui is not supported on this CPU: arm
<-- vgui_support                         : done 
--> engine                               : in progress 
Checking for library SDL2                : yes 
Checking for library SDL2 sanity         : yes 
<-- engine                               : done 
'configure' finished successfully (1.626s)

Gamma/brightness is incorrect on Windows

I've been looking at this for the last couple of days but haven't had any success in tracking down the cause yet, so I thought I'd put some details down here in case they're helpful for diagnosis.

The Windows build looks very washed-out: https://media.discordapp.net/attachments/548621970187616268/589464898925232128/windows.png?width=1896&height=1133

Compare this to the Linux build, where the brightness seems more correct: https://media.discordapp.net/attachments/548621970187616268/589464938913988618/linux.png?width=2002&height=1133

I've determined that this is not due to the brightness/gamma settings tied to the console variables in the engine - they use the built gamma table, and if I set this to identity values or bypass it completely, there is still no change at all on Windows. With the table active, I can change the gamma and brightness and they do seem to affect the on-screen picture, but they only seem to be able to make it more washed-out, and never less so than in the above screenshot.

As an aside, the gamma table is currently being built every frame when running the main menu, because R_BeginFrame checks if FCVAR_CHANGED is set on the gamma and brightness cvars, but doesn't reset this flag once the table has been rebuilt. This doesn't fix the washed-out issue, but it's worth noting nonetheless.

I've also tried running with various video modes and OpenGL modes on Windows, but none of these has made any difference.

pfnSetModel does not warn about missed precaches in most cases

Just quickly noting this down before I forget, as I'm in the middle of other things.

I discovered today that I was forgetting to precache a model in some of my own game code, but only after having stepped through pfnSetModel in the debugger. Specifically, the following code seems to be to be incorrect:

// check to see if model was properly precached
for( i = 1; i < MAX_MODELS && sv.model_precache[i][0]; i++ )
{
    if( !Q_stricmp( sv.model_precache[i], name ))
        break;
}

if( i == MAX_MODELS )
{
    Con_Printf( S_ERROR "no precache: %s\n", name );
        return;
}

i incremented past the last precached model (which in my case was index 100), so the model returned was null. Instead of hitting the error log and returning, it silently set a blank model on my entity because i was still within the entire list bounds.

If there's a count for how many models have been precached in sv.model_precache, I think checking against this instead of MAX_MODELS would fix the issue.

Drop of OSX/iOS support

We won't support OSX/iOS anymore because of destructive decisions Apple make.

Yesterday they removed 32-bit and ok, it's was kinda understandable.
Today they will remove OpenGL for no reason.
Tomorrow they will remove possibility of running native code.

Originally, OSX/iOS support was added because it was easy to maintain, but when it rеquires more action from us, I don't think we can support it without a dedicated maintainer for this platforms.

Platform code will not be removed, so someone can take it and continue support but I will remove OSX/iOS ports from autobuilds, will not provide them in releases, close all rеlated issues as WONTFIX and finally remove it from list of supported ports.

So, Apple, f*ck you.

Certain sounds are registered incorrectly on client in multiplayer

I understand that the multiplayer mode is still largely untested and a bit buggy, so I was hoping to find out some more information about the following:

Some of my weapon sounds, when tested in multiplayer, ended up being completely different sound files to what was expected. I've narrowed it down to the fact that S_FreeSound is being called prematurely on the list of sounds created on precache, so sounds that are loaded in later take the place of the precached sounds in the s_knownSfx list.

The reason that sounds are being freed is that S_BeginRegistration/S_EndRegistration are being called more than once. Each time begin is called, s_registration_sequence is incremented. When end is called, any sounds whose sequence number doesn't match the current s_registration_sequence are freed. This seems to be what happens to all of my precached sounds.

The first time begin is called is on receipt of an svc_resourcelist message:

libxash.dylib!S_BeginRegistration (/Users/vesper/Documents/afterburner-game/dependencies/afterburner-engine/engine/client/s_load.c:293)
libxash.dylib!CL_PrecacheResources (/Users/vesper/Documents/afterburner-game/dependencies/afterburner-engine/engine/client/cl_main.c:3161)
libxash.dylib!CL_BatchResourceRequest (/Users/vesper/Documents/afterburner-game/dependencies/afterburner-engine/engine/client/cl_parse.c:543)
libxash.dylib!CL_StartResourceDownloading (/Users/vesper/Documents/afterburner-game/dependencies/afterburner-engine/engine/client/cl_parse.c:632)
libxash.dylib!CL_ParseResourceList (/Users/vesper/Documents/afterburner-game/dependencies/afterburner-engine/engine/client/cl_parse.c:1682)
libxash.dylib!CL_ParseServerMessage (/Users/vesper/Documents/afterburner-game/dependencies/afterburner-engine/engine/client/cl_parse.c:2274)
libxash.dylib!CL_ReadNetMessage (/Users/vesper/Documents/afterburner-game/dependencies/afterburner-engine/engine/client/cl_main.c:2766)
libxash.dylib!CL_ReadPackets (/Users/vesper/Documents/afterburner-game/dependencies/afterburner-engine/engine/client/cl_main.c:2802)
libxash.dylib!Host_ClientFrame (/Users/vesper/Documents/afterburner-game/dependencies/afterburner-engine/engine/client/cl_main.c:3524)
libxash.dylib!Host_Frame (/Users/vesper/Documents/afterburner-game/dependencies/afterburner-engine/engine/common/host.c:544)
libxash.dylib!Host_RunFrame (/Users/vesper/Documents/afterburner-game/dependencies/afterburner-engine/engine/common/host_state.c:144)
libxash.dylib!COM_Frame (/Users/vesper/Documents/afterburner-game/dependencies/afterburner-engine/engine/common/host_state.c:194)
libxash.dylib!Host_Main (/Users/vesper/Documents/afterburner-game/dependencies/afterburner-engine/engine/common/host.c:1034)
bond!Sys_Start() (/Users/vesper/Documents/afterburner-game/dependencies/afterburner-engine/game_launch/game.cpp:134)
bond!main (/Users/vesper/Documents/afterburner-game/dependencies/afterburner-engine/game_launch/game.cpp:146)

And the second time appears to be because of the condition cls.signon == SIGNONS && cl.lastresourcecheck < host.realtime in CL_ReadPackets:

libxash.dylib!S_BeginRegistration (/Users/vesper/Documents/afterburner-game/dependencies/afterburner-engine/engine/client/s_load.c:293)
libxash.dylib!CL_PrecacheResources (/Users/vesper/Documents/afterburner-game/dependencies/afterburner-engine/engine/client/cl_main.c:3161)
libxash.dylib!CL_BatchResourceRequest (/Users/vesper/Documents/afterburner-game/dependencies/afterburner-engine/engine/client/cl_parse.c:543)
libxash.dylib!CL_ReadPackets (/Users/vesper/Documents/afterburner-game/dependencies/afterburner-engine/engine/client/cl_main.c:2819)
libxash.dylib!Host_ClientFrame (/Users/vesper/Documents/afterburner-game/dependencies/afterburner-engine/engine/client/cl_main.c:3524)
libxash.dylib!Host_Frame (/Users/vesper/Documents/afterburner-game/dependencies/afterburner-engine/engine/common/host.c:544)
libxash.dylib!Host_RunFrame (/Users/vesper/Documents/afterburner-game/dependencies/afterburner-engine/engine/common/host_state.c:144)
libxash.dylib!COM_Frame (/Users/vesper/Documents/afterburner-game/dependencies/afterburner-engine/engine/common/host_state.c:194)
libxash.dylib!Host_Main (/Users/vesper/Documents/afterburner-game/dependencies/afterburner-engine/engine/common/host.c:1034)
bond!Sys_Start() (/Users/vesper/Documents/afterburner-game/dependencies/afterburner-engine/game_launch/game.cpp:134)
bond!main (/Users/vesper/Documents/afterburner-game/dependencies/afterburner-engine/game_launch/game.cpp:146)

Is there a reason that sound registration should be performed more than once, or is this incorrect behaviour?

Форматирование сообщений сломано

[17:20:55] map: crossfire [17:20:55] num score ping name lastmsg address [17:20:55] —- —-— —---— —-----------— —---— —-----------------— —---- [17:20:55] 0 [17:20:55] 0 [17:20:55] Connect[17:20:55] Mr0maks[17:20:55] [17:20:55] [17:20:55] [17:20:55] [17:20:55] [17:20:55] [17:20:55] [17:20:55] [17:20:55] [17:20:55] [17:20:55] [17:20:55] [17:20:55] [17:20:55] [17:20:55] [17:20:55] [17:20:55] [17:20:55] 57.1995 [17:20:55] ip_here[17:20:55] [17:20:55] [17:20:55] [17:20:55] [17:20:55] [17:20:55] [17:20:55] [17:20:55] [17:20:55] [17:20:55] 28683[17:20:55] [17:20:55]

[Help] missing SDL2 sanity library

System: Deepin (debian)

I have installed libsdl2-dev libsdl2-2.0 via apt, then also tried compiling SDL2 from source, but still missing SDL2.

I have searched what is SDL2 sanity but nothing found.

Here is the output:

$ ./waf configure --build-type=release --vgui=vgui-dev
Setting top to                           : /home/mr/Workspace/xash3d-fwgs 
Setting out to                           : /home/mr/Workspace/xash3d-fwgs/build 
Build type                               : release 
Checking for 'gcc' (C compiler)          : /usr/bin/gcc 
Checking for 'g++' (C++ compiler)        : /usr/bin/g++ 
Checking git hash                        : f2c9279 
WARNING: will build engine for 32-bit target
Checking if 'gcc' can target 32-bit      : no 
...trying with additional flags          : yes 
Checking for library SDL2                : yes 
Checking for library SDL2 sanity         : no 
Checking for library dl                  : yes 
Checking for library m                   : yes 
Checking for library pthread             : yes 
--> public                               : in progress 
<-- public                               : done 
--> engine                               : in progress 
Checking for library SDL2                : yes 
Checking for library SDL2 sanity         : no 
SDL2 not availiable! If you want to build dedicated server, specify --dedicated
(complete log in /home/mr/Workspace/xash3d-fwgs/build/config.log)

Sorry for bothering you.

Sources not recognised when debugging in VS Code on Windows

I hate to raise another issue, but I've been attempting to solve this for most of the day and haven't been able to get anywhere.

When I launch a debug build of the engine in the VS Code debugger, breakpoints are ignored and the stack frames are listed with "unknown source". The only way I've been able to debug on Windows is by using waf msdev and opening a full Visual Studio project, which isn't ideal as I have VS Code all set up on my own fork for various tasks.

My configure call is:

python waf configure --build-type=debug --prefix=build/install --sdl2=C:\Users\Vesper\Documents\SDL2-2.0.9 --vgui=C:\Users\Vesper\Documents\GitHub\vgui-dev

When I run waf build install, the compile calls then look like:

[128/231] Compiling game_launch\game.cpp
07:26:59 runner ['C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.21.27702\bin\HostX86\x86\CL.exe', '/nologo', '/nologo', '/nologo', '/D_USING_V110_SDK71_', '/Zi', '/FS', '/Od', '/Igame_launch', '/I..\game_launch', '/Icommon', '/I..\common', '/I..\..\..\..\..\..\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.21.27702\ATLMFC\include', '/I..\..\..\..\..\..\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.21.27702\include', '/I..\..\..\..\..\..\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um', '/I..\..\..\..\..\..\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt', '/I..\..\..\..\..\..\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared', '/I..\..\..\..\..\..\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um', '/I..\..\..\..\..\..\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt', '/I..\..\..\..\..\..\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt', '/DXASH_BUILD_COMMIT="37181e4-dirty"', '..\game_launch\game.cpp', '/FC', '/c', '/FoC:\Users\Vesper\Documents\GitHub\xash3d-fwgs\build\game_launch\game.cpp.1.o']

And the link calls look like:

[143/231] Linking build\game_launch\xash3d.exe
07:27:01 runner ['C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.21.27702\bin\HostX86\x86\LINK.exe', '/nologo', '/MANIFEST', '/nologo', '/MANIFEST', '/nologo', '/MANIFEST', '/DEBUG', '/subsystem:WINDOWS,5.01', 'game_launch\game.cpp.1.o', 'game_launch\game.res', '/OUT:C:\Users\Vesper\Documents\GitHub\xash3d-fwgs\build\game_launch\xash3d.exe', '/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.21.27702\ATLMFC\lib\x86', '/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.21.27702\lib\x86', '/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\x86', '/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\ucrt\x86', '/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x86', '/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.21.27702\ATLMFC\lib\x86', '/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.21.27702\lib\x86', '/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.21.27702\lib\x86\store\references', '/LIBPATH:C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.18362.0', '/LIBPATH:C:\Program Files (x86)\Windows Kits\10\References\10.0.18362.0', '/LIBPATH:C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319', 'user32.lib', 'shell32.lib']

However, when linking I get a lot of suspect spam about PDB files (one message per object, in all sub-projects):

game.cpp.1.o : warning LNK4099: PDB '' was not found with 'game.cpp.1.o' or at ''; linking object as if no debug info

I suspect this is related, but I'm not sure what in the build process would cause the PDB path to show up as blank like this.

I know that my version of VS Code is capable of debugging applications because I've done so with other projects - one that I know works uses compile flags /MDd /EHsc /ZI /FS and link flags /DEBUG:FASTLINK /MACHINE:X64. I've tried swapping some of the compile flags in the Xash build script to see what would happen (for example, adding /MDd and removing /O1), but nothing has succeeded so far.

Is there any reason that this may be happening?

Android: Bugs from new Xash3D FWGS engine

  1. The "disconnect" button works as a restart.
  2. Water bug on both gles renderers like there
    Screenshot_20191016-173147
  3. Black screen after minimizing engine
  4. Black bars instead of text in the console when playing hazard course (64bit version only)
    Screenshot_20191020-121028

C99

I suggest moving to C99 standard.
We actually never supported old compilers, so it shouldn't be a problem.

Instead we get:

  • possibility to define variables not only at start of the block.
  • VA_ARGS(supported in msvc, but support is still partial and may be buggy)
  • better inline
  • stdint.h
  • restrict keyword
  • compound literals(msvc sucks here)
  • designated initializers.
  • more UB
  • ...

Yes, it's hard to implement C99 fully in compilers, but standards are theoretical(especially C99) and anyway we can still use implemented subset of C99.

3DS port

The original Xash3DS was available for the 3DS, is that planned here?

[OSX] No 32-bit SDL2 library found

image

Tested with latest binary release and macOS 10.14.2
Where can I get the required 32-bit SDL2?
I can't build 32-bit SDL2 with current Xcode because i386 arch is deprecated now by Apple.

No text for env_message

In my standalone mod based on XashXT 0.81, the main asset directory is base, and localised assets are in mw_en (for English) and mw_ru (for Russian). In base/gameinfo.txt, gamedir is set to "mw_en".
Both mw_en and mw_ru contain a titles.txt file, and there is no titles.txt in base.
When I launch the game without the -game parameter, env_message entities don't show any text. However, when I launch it with -game mw_ru, the messages work fine.
With the original Xash3D, they work as expected in both cases.

License issues

I really do like the idea of a GPL gldsrc clone, however after some research I've discovered a bit of an issue.

The engine is somewhat notorious for making use of leaked source code, and indeed Valve as supposedly remarked that the engine as it stands is illegal (though I have yet to personally corroborate that.) This is troublesome because I want to use xash3D for a commercial project, so as it currently stands that dream is unworkable. But what if it wasn't?

I turned to the codebase and I've picked out all the obvious files that violate Valve's copyright:

  • common/weaponinfo.h
  • common/beamdef.h
  • common/entity_state.h
  • common/net_api.h
  • common/r_studioint.h
  • common/demo_api.h
  • common/r_efx.h
  • common/kbutton.h
  • common/const.h
  • common/netadr.h
  • common/con_nprint.h
  • common/usercmd.h
  • common/studio_event.h
  • common/pmtrace.h
  • common/cvardef.h
  • common/ref_params.h
  • common/wadfile.h
  • common/screenfade.h
  • common/event_args.h
  • common/mathlib.h
  • common/qfont.h
  • common/triangleapi.h
  • common/cl_entity.h
  • common/event_flags.h
  • common/event_api.h
  • common/dlight.h
  • common/hltv.h
  • common/particledef.h
  • common/entity_types.h
  • common/ivoicetweak.h
  • engine/alias.h
  • engine/studio.h
  • engine/keydefs.h
  • engine/customentity.h
  • engine/anorms.h
  • engine/custom.h
  • engine/edict.h
  • engine/cdll_int.h
  • engine/progdefs.h
  • engine/shake.h
  • engine/sprite.h
  • engine/eiface.h
  • pm_shared/pm_defs.h
  • pm_shared/pm_movevars.h
  • pm_shared/pm_info.h

I'm not sure about any snippets of code that might violate Valve's copyright, so I'll perform a more indepth analysis to check if any exist. I doubt much if any such snippets exist, so barring that; If we rewrite these headers, the legal and licensing issues associated with this project should be resolved and full GPL compliance will be achieved.

Optimisation level causes odd crash on MacOS

I noticed that when running the Mac version of the engine, the call to Mod_LoadModel when loading a map crashes when returning from the Mem_Free call at the end of the function. The debugger reports a 0x0 address access, but it's not immediately clear where (or why) this actually happens.

I've narrowed the issue down to being introduced in commit 741fcfb202f81b1468403ad6cf4b70c10d2ce2d2, which modifies the compiler flags. The only real relevant difference is that the optimisation flag -O0 get changed to -O1 for clang. If I change this back to -O0, the crash disappears.

I'm not sure how to go about solving this.

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.