Velaron / tf15-client

Team Fortress Classic reverse-engineered.
Other
70 stars 17 forks source link

cmake doesn't generate tfc_arm64.so #39

Open nickbailuc opened 10 months ago

nickbailuc commented 10 months ago

Hello. I'm trying to compile tf15 and cs16 for my M1 Macbook Air running Linux. I can play the regular HLSDK mods via Xash perfectly, but could not get tf15 or cs16 working. Upon inspection it seems this SDK doesn't generate the necessary tfc_arm64.so which the regular fwgs/hlsdk generates for each game.

Using the regular one that comes from Steam of course doesn't work as it is 32-bit and for x86 not ARM.

How do I compile tfc_arm64.so ?

nekonomicon commented 10 months ago

Server library not implemented yet. And repo named *-client. You can use client to connect to existing servers hosted on x86.

nickbailuc commented 10 months ago

Server library not implemented yet. And repo named *-client. You can use client to connect to existing servers hosted on x86.

that's what i mean (i'm not trying to start a server on my macbook air), I want to try playing the regular game through Xash3D, but upon starting any game or connecting to an online server, the engine complains that tfc_arm64.so is missing, and when I compile this repo i can't find this file being compiled.

AruMoon commented 10 months ago

Server library not implemented yet. And repo named *-client. You can use client to connect to existing servers hosted on x86.

that's what i mean (i'm not trying to start a server on my macbook air), I want to try playing the regular game through Xash3D, but upon starting any game or connecting to an online server, the engine complains that tfc_arm64.so is missing, and when I compile this repo i can't find this file being compiled.

That's the server library and it should not ask you for it to work

nickbailuc commented 10 months ago

Server library not implemented yet. And repo named *-client. You can use client to connect to existing servers hosted on x86.

that's what i mean (i'm not trying to start a server on my macbook air), I want to try playing the regular game through Xash3D, but upon starting any game or connecting to an online server, the engine complains that tfc_arm64.so is missing, and when I compile this repo i can't find this file being compiled.

That's the server library and it should not ask you for it to work

ok that makes sense (it was because i was trying to create my own LAN server technically, really just trying to open any map locally on my computer)

Joining one of two only internet servers that appear, I get no HUD at all, cant select team or character, cant view multiplayer scores. It's just a spectate mode but I cant move around only mouse look, but I do have all my key bindings configured. Console doesn't report anything useful after joining. Am I missing something (like a menu so or vgui or something)? I'm assuming the cmake generates what's required.

In case I misplaced the compiled .so files, I placed all .so files generated by cmake in every directory that may have them (cl_dlls, dlls, 3rd party).

Also the cmake seems to make a directory called cl_dll without the 's' at the end, this may be a bug

AruMoon commented 10 months ago

Server library not implemented yet. And repo named *-client. You can use client to connect to existing servers hosted on x86.

that's what i mean (i'm not trying to start a server on my macbook air), I want to try playing the regular game through Xash3D, but upon starting any game or connecting to an online server, the engine complains that tfc_arm64.so is missing, and when I compile this repo i can't find this file being compiled.

That's the server library and it should not ask you for it to work

ok that makes sense (it was because i was trying to create my own LAN server technically, really just trying to open any map locally on my computer)

Joining one of two only internet servers that appear, I get no HUD at all, cant select team or character, cant view multiplayer scores. It's just a spectate mode but I cant move around only mouse look, but I do have all my key bindings configured. Console doesn't report anything useful after joining. Am I missing something (like a menu so or vgui or something)? I'm assuming the cmake generates what's required.

In case I misplaced the compiled .so files, I placed all .so files generated by cmake in every directory that may have them (cl_dlls, dlls, 3rd party).

Also the cmake seems to make a directory called cl_dll without the 's' at the end, this may be a bug

Yes, you have missed vgui. I don't know how to install it correctly, I hope devs will answer here how to install it

nickbailuc commented 10 months ago

Server library not implemented yet. And repo named *-client. You can use client to connect to existing servers hosted on x86.

that's what i mean (i'm not trying to start a server on my macbook air), I want to try playing the regular game through Xash3D, but upon starting any game or connecting to an online server, the engine complains that tfc_arm64.so is missing, and when I compile this repo i can't find this file being compiled.

That's the server library and it should not ask you for it to work

ok that makes sense (it was because i was trying to create my own LAN server technically, really just trying to open any map locally on my computer) Joining one of two only internet servers that appear, I get no HUD at all, cant select team or character, cant view multiplayer scores. It's just a spectate mode but I cant move around only mouse look, but I do have all my key bindings configured. Console doesn't report anything useful after joining. Am I missing something (like a menu so or vgui or something)? I'm assuming the cmake generates what's required. In case I misplaced the compiled .so files, I placed all .so files generated by cmake in every directory that may have them (cl_dlls, dlls, 3rd party). Also the cmake seems to make a directory called cl_dll without the 's' at the end, this may be a bug

Yes, you have missed vgui. I don't know how to install it correctly, I hope devs will answer here how to install it

I have the libvgui.so compiled but dont know where to place it (regular xash with hlsdk doesnt have it under valve/cl_dlls nor valve/dlls, however I used to have it in the root directory where the xash binary sits (along with libxash.so and so on).

It would be great if the devs put instructions in the readme for where to place the actual compiled .so files. So far, compiling it creates: client.so libvgui.so menu.so

nekonomicon commented 10 months ago

Also the cmake seems to make a directory called cl_dll without the 's' at the end, this may be a bug

No, it's not.

It would be great if the devs put instructions in the readme for where to place the actual compiled .so files. So far, compiling it creates:

Half-Life has vgui in root directory and client/gameui in cl_dlls directory, so what instructions needed yet?

Also, you need to compile engine with vgui_support. Without vgui loader library you are loaded Half-Life client probably.

nickbailuc commented 10 months ago

Also the cmake seems to make a directory called cl_dll without the 's' at the end, this may be a bug

No, it's not.

Seems any hl1 game/mod i look at has the directory named cl_dlls not cl_dll. Are they interchangeable?

It would be great if the devs put instructions in the readme for where to place the actual compiled .so files. So far, compiling it creates:

Half-Life has vgui in root directory and client/gameui in cl_dlls directory, so what instructions needed yet?

Also, you need to compile engine with vgui_support. Without vgui loader library you are loaded Half-Life client probably.

Xash seems to compile with vgui support by default, and the repo depends on vgui.

I've placed libvgui.so into the root folder where the Xash binary and libs sit, but it didn't change anything. The changeclass menu never appears when joining a server

nekonomicon commented 10 months ago

Seems any hl1 game/mod i look at has the directory named cl_dlls not cl_dll. Are they interchangeable?

HLSDK historically has cl_dll folder. And you can say make install to instal libraries to right directory.

Xash seems to compile with vgui support by default, and the repo depends on vgui.

And do you have vgui_support.so library?

nickbailuc commented 10 months ago

Maybe it's something with the server I'm joining if they're running some mod or something. The only 2 servers I see listed are: TFC 1.5 | North America with IP 155.248.229.151 TFC 1.5 | Central Europe with IP 135.125.188.162

Since there is no tfc_arm64.so I can't create a LAN game (or even launch a map through the console via map 2fort)

nickbailuc commented 10 months ago

And do you have vgui_support.so library?

I don't, and I'm not sure how to get it. I think I used to some time ago and forgot where I got the file, but recently I recompiled everything fresh.

FWGS has like 5 repos related to vgui, I couldn't compile any of them. Velaron/vgui_support gives me cpp errors:

vgui_support/vgui_main.h:36:10: fatal error: vgui_api.h: No such file or directory
   36 | #include "vgui_api.h"

Is vgui_support.so different from the vgui.so found under hlsdk-portable/vgui_support ? Because I have vgui.so from hlsdk, and also vgui.so and libvgui.so from this repository. Every vgui I tried from fwgs gives me some kind of cpp error. Digging through the files, the headers always expect some odd library I've never heard of (probably something created for the game, not a system wide library)

Also make install tries to put it in /usr/local/tfc which is very odd. I'm unable to force a local directory on that script

$ make install
CMake Error at cl_dll/cmake_install.cmake:52 (file):
  file cannot create directory: /usr/local/tfc/cl_dlls.  Maybe need
  administrative privileges.
nekonomicon commented 10 months ago

You need to compile engine with vgui support. Check waf --help.

nekonomicon commented 10 months ago

Also make install tries to put it in /usr/local/tfc which is very odd. I'm unable to force a local directory on that script

You can set custom PREFIX.

nickbailuc commented 10 months ago

You need to compile engine with vgui support. Check waf --help.

Based on what the waf --help says, vgui is supported by default:

  VGUI options:
    --disable-vgui      disable vgui_support [default: False]
    --vgui=VGUI_DEV     path to vgui-dev repo [default: /home/nick/Downloads/xash3d-fwgs/3rdparty/vgui_support/vgui-dev]
    --skip-vgui-sanity-check
                        skip checking VGUI sanity [default: True]
nekonomicon commented 10 months ago

Ok. Do you clone FWGS/xash3d-fwgs repo with --recursive option? If so you must have vgui_support library after compilation.

nickbailuc commented 10 months ago

Ok. Do you clone FWGS/xash3d-fwgs repo with --recursive option? If so you must have vgui_support library after compilation.

yes, i clone every repo with --recurse-submodules Xash comes with the regular vgui.so not vgui_support not sure if thats the same or not

nekonomicon commented 10 months ago

Xash comes with the regular vgui.so not vgui_support not sure if thats the same or not

No, It's not.

nickbailuc commented 10 months ago

Xash comes with the regular vgui.so not vgui_support not sure if thats the same or not

No, It's not.

so where can I get vgui_support.so not vgui.so (this should also be mentioned in the README)

Velaron commented 10 months ago

It is bundled with xash3d-fwgs?

nickbailuc commented 10 months ago

It is bundled with xash3d-fwgs?

no its not theres only vgui.so under xash3d-fwgs/3rdparty/vgui_support/vgui-dev/lib but @nekonomicon is saying its not the same

I just redownloaded xash3d-fwgs and compiled to confirm

Velaron commented 10 months ago

My bad, are you sure you installed tf15-client into tfc/cl_dlls? Sounds like you are playing with a client.dll from Half-Life.

nickbailuc commented 10 months ago

My bad, are you sure you installed tf15-client into tfc/cl_dlls? Sounds like you are playing with a client.dll from Half-Life.

The only .so's I got from compiling this repo are client.so libvgui.so menu.so There was no tfc_arm64.so

If you mean did i copy these objects into tfc/ instead of valve/, yes I put them in tfc/

Are you guys able to play the game on a platform that isn't Windows x86 32-bit?

Velaron commented 10 months ago

tfc_arm64.so is not supposed to compile, I haven't reverse-engineered the server binary yet. Using cmake install command should put the binaries where they are supposed to be.

a1batross commented 10 months ago

It is bundled with xash3d-fwgs?

no its not theres only vgui.so under xash3d-fwgs/3rdparty/vgui_support/vgui-dev/lib but @nekonomicon is saying its not the same

I just redownloaded xash3d-fwgs and compiled to confirm

a1batross commented 10 months ago

(Actually, internal_vgui_support 1 shouldn't be important. Engine will fall back to it, in case of missing vgui_support.so alongside engine)

nickbailuc commented 10 months ago

tfc_arm64.so is not supposed to compile, I haven't reverse-engineered the server binary yet. Using cmake install command should put the binaries where they are supposed to be.

cant get cmake install to work, i've tried

cmake install bin
cmake --install dir
cmake --install-prefix dir

they all seem to expect that this was defined previously in cmakelists or something can you give me the exact command for cmake install? I've run the 2 commands from the README under Linux

nickbailuc commented 10 months ago

I've looked at your precompiled builds, and now I see that the two .so's that get compiled both go only in cl_dlls so I recompiled tf15, found the compiled client.so and menu.so. Realizing in the amd64 version they have the arch in the name just like other HLSDK builds, I renamed them to client_arm64.so and menu_arm64.so, put them inside cl_dlls and launched the game.

I get 2 errors, one shorter and one longer (and the engine crashes whereas before I guess it tried to boot tfc/cs16 with valve assets).

The short error I get is this:

nick@MacBook:~/Games/Half-Life$ ./xash3d -console -game tfc
Ver: Xash3D FWGS 0.20 (build 3209-2af0adb6, linux-arm64)
Crash: signal 11 errno 0 with code 1 at (nil) (nil)
Ver: Xash3D FWGS 0.20 (build 3209-2af0adb6, linux-arm64)
Crash: signal 11 errno 0 with code 1 at (nil) (nil)
Stack backtrace:
Stack backtrace:
 1: 0xfffedc248170 <_ZN4vgui9TextImage7getFontEv+32> (/home/nick/Downloads/tf15-client/build/3rdparty/vgui_dll/libvgui.so)
 1: 0xfffedc248170 <_ZN4vgui9TextImage7getFontEv+32> (/home/nick/Downloads/tf15-client/build/3rdparty/vgui_dll/libvgui.so)
Stack dump:

long-error.txt

The longer error I'll attach as a file. It randomly spits the short or the long error without me changing anything. This happens both if I launch xash3d and select TFC in "Custom Games" or if I launch xash3d directly with the -game tfc option.

Yashar1991 commented 4 months ago

Friends you are all should be xash3d FWGS download this is true Xash3d FWGS(Test) is false!

a1batross commented 4 months ago

@Yashar1991 🤡