FWGS / xash3d-fwgs

Xash3D FWGS engine.
1.52k stars 228 forks source link

Official WebAssembly / WASM support #1226

Closed steren closed 1 year ago

steren commented 1 year ago

As a big Half Life fan and former mod creator, I am very glad to see this project, giving a new life to these games on modern platform. Thanks for your work.

I noticed that the archived codebase had some basic instructions for compiling to JavaScript with Emscripten and these were discussed in this issue. I believe this work was led by @mittorn. The only trace of Xash3d for the browser that I have found are a copy of the built code here, playable here. I have used this code to revive an old fun mod I worked on long ago

A lot happened since then in the space of running C++ software in the browser: WebAssembly (Wasm) is now supported in all major browsers and can run C++ software at near-native speed. And Emscripten now uses it by default

I know this project has been focusing a lot on mobile and desktop. Enabling compiling for the browser would really lower the barriers to adoption (users would only need to open a URL to play a mod) and enable the preservation of many Half Life mods.

What does the dev team think of offering WebAssembly as a compilation target, similar to Android support?

I'm not talking about multiplayer. Being able to run single player maps would already be a big achievement.

Unfortunately, I am neither familier with xash3d (I tried building it but get an error when running waf), nor with Emscripten expert.

a1batross commented 1 year ago

Working with Emscripten in old engine was fun, and that's it. Some of the code carried over to new engine but it's probably long broken.

I don't mind having Emscripten support, but I don't have time to work on it myself. As @mittorn very much absent from engine development (and I understand why), I don't know who else can start working on it.

сб, 28 янв. 2023 г., 03:39 Steren @.***>:

As a big Half Life fan and former mod creator, I am very glad to see this project, giving a new life to these games on modern platform. Thanks for your work.

I noticed that the archived codebase had some basic instructions for compiling to JavaScript with Emscripten https://github.com/FWGS/xash3d/blob/0.19.x/README.emscripten.md and these were discussed in this issue https://github.com/FWGS/xash3d/issues/328. I believe this work was led by @mittorn https://github.com/mittorn. The only trace of Xash3d for the browser that I have found are a copy of the built code here https://github.com/icrazyblaze/Xash3D-Emscripten/, playable here https://icrazyblaze.github.io/Xash3D-Emscripten/xash.html. I have used this code to revive an old fun mod I worked on long ago https://parpaing-1337-krew.github.io/hl-parpaing-web/

A lot happened since then in the space of running C++ software in the browser: WebAssembly (Wasm) is now supported in all major browsers https://caniuse.com/wasm and can run C++ software at near-native speed. And Emscripten now uses it by default https://emscripten.org/docs/compiling/WebAssembly.html

I know this project has been focusing a lot on mobile and desktop. Enabling compiling for the browser would really lower the barriers to adoption (users would only need to open a URL to play a mod) and enable the preservation of many Half Life mods.

What does the dev team think of offering WebAssembly as a compilation target, similar to Android support?

I'm not talking about multiplayer. Being able to run single player maps would already be a big achievement.

Unfortunately, I am neither familier with xash3d (I tried building it but get an error when running waf), nor with Emscripten expert.

— Reply to this email directly, view it on GitHub https://github.com/FWGS/xash3d-fwgs/issues/1226, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAYQTAIHR3SXOPMSGF7HNIDWURTD7ANCNFSM6AAAAAAUJKLKWY . You are receiving this because you are subscribed to this thread.Message ID: @.***>

SNMetamorph commented 1 year ago

I don't know who else can start working on it.

Maybe in the future, I will try again to make a port on Emscripten

steren commented 1 year ago

It seems others have revived the "Xash3d on the web" topic and have a working version (client+server): https://play-cs.com/

a1batross commented 1 year ago

Meh, they are probably not going to contribute anything back and they still use old engine version.

a1batross commented 1 year ago

I'm closing this issue, because ports are better be discussed when there is already work done.