-
-
Notifications
You must be signed in to change notification settings - Fork 250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Official WebAssembly / WASM support #1226
Comments
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
<FWGS/xash3d#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
<#1226>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAYQTAIHR3SXOPMSGF7HNIDWURTD7ANCNFSM6AAAAAAUJKLKWY>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Maybe in the future, I will try again to make a port on Emscripten |
It seems others have revived the "Xash3d on the web" topic and have a working version (client+server): https://play-cs.com/ |
Meh, they are probably not going to contribute anything back and they still use old engine version. |
I'm closing this issue, because ports are better be discussed when there is already work done. |
Annoying as hell someone ported it and didn't give back, especially when it is based on this project. Nightmare for preservation and modernization. I would stop having to launch slow software (preferring Wine to linux port) if it were in the web. Clearly there is a market for it. I've used emscripten to port stuff in the past, so I'll take a look over the next few months. No idea what I'm looking at yet in terms of complexity. |
Not really, all these web-sites use old engine which had an official emscripten port, you can maybe use that as reference |
Any updates on it? i want to run my own cs 1.6 client in browser. I don't have a lot of experience with WASM, but if someone need some help, I can |
You can either work on this yourself, either sponsor it: https://github.com/FWGS/xash3d-fwgs/blob/master/Documentation/donate.md |
Yeah WASM opens many opportunities to web, but yet not everyone uses or knows it. We can port not only cs 1.6 but much better games. Recently I'm looking at Thymen which is reverse-enginered source code of C&C Generals to port it to emscripten. As for this issue, I'm ready to help to start modern WASM build. Someone interested in? |
Yeah I am. Though my idea of modern may be behind yours. I'm not sure. I'll have to find you on discord. Speaking of web tech... You may be interested in another project, too. I've integrated NodeJS into a Metamod plugin. Statically linked. It runs my benchmark fine, which demos event emitters, two way communication, callbacks. Have to implement the actual engine interface next, but excited to see what I can do with it. |
My discord username is the same as GitHub one, @firsturdiev, plus on all other platforms. We can discuss |
We experimented some time ago, but Node.js there is pretty outdated. And we didn't figured out how to build recent version. https://github.com/TheEVolk/xash3d-nodemod Do you did the similar project? That would be good, since our implementation is far from usable. |
Looks like I have a few new groups to join. Yes, it's Node 24. Had no idea someone else was doing it too. Nice! |
Maybe someone has some public chat on Discord about this? Or have to create it, I am very interested on this topic. I guess it will be better to communicate instead PM or gh issues :) |
Discord is proprietary and unindexable by search engines, and I do not recommend putting anything useful there. Keeping discussion in the open helps people actually see if there is or has been any progress on this topic. Well, you still could join our FWGS discord server, we have special channels dedicated to engine development there. |
@Antom91 can I ask why you so desperate about web port? Why not just play on your machine and have all the mods, actually have working Ctrl+W (because browsers still struggle with it) and just have more performance? I'm just curious. |
Hello. I want to create some personal internal webclient to play from different OS's (Mac, ubuntu, win arm64, etc) I know that I can compile native c++ code, but I love something like portable solutions—one client for all platforms. I know the issue around CTRL +W, but how it work in https://play-cs.com/ ? they fix this issue |
Why compile if we provide all binaries anyway? Are you switching between computers that often? Well, there is no win arm64 port yet, but I don't think it's too hard to add one. |
Webclient is more better than native client :) but more slowly |
Something tells me you all want your own https://play-cs.com/ (or want to upgrade it because old engine just sucks to work with) because they're quite successful at stealing other's work and commercializing it. |
Oh no, I am not related to Play-Cs. And yes, I want to create something like Play-Cs, but just for me and my friends, just for nostalgia, so as not to download anything. I want to play on an office PC, where there are strong restrictions around downloading something on it. Only for this, not for commercial and public usage. but I agree with you, as I know, play-cs use old emscripten project and implements some changes on it. But guys, it will be a good chance to play cs in the browser without downloading it. why not? to play vanilla cs without mods and so on, I really feel that this is a good idea |
Well, I'm really afraid of history being repeated. While old Emscripten port was created purely for fun, it doesn't take too much effort to just take the port and build your own VIP Premium account selling gaming service based on stolen/pirated stuff preying on people's nostalgic feels and gaming urges. :) |
I'm deeply sorry for this rant here, play-cs is a hard topic for us, especially that we know the history behind it. |
Yes, for me the same, i hate such projects like cs-play, that have donations and based on opensource codes like this. |
Very impressed by this response by a maintainer. Others may have considered it clutter and nuked the thread (yeah I have not so great past experiences). I have zero commercial ambition for this as mentioned in later comments. It's why I was so willing to work with anyone else. I personally am disgusted by colleagues who abandon principles in search of illegal profits. There is no enforcement anymore, it seems, so we must police ourselves. Maybe this isn't a good idea to resurrect for that very reason. Those idiots would just steal our new work and bastardize it for profit we would never see. I've had it happen before - even had someone copy my work and rebrand it as their own, and it absolutely disgusts me. |
Sorry for the spam, but just thought of something. What if we did make it into a closed source project, except completely free and funded by us? If IP is an issue (I don't know valve's stance here), we could require proof of ownership via steam API and do it responsibly. Ideally we completely crush their profits and tank their cynical and insidious project with a free alternative like that. Alternatively, release something so easy to deploy anyone could do it with a few clicks. Flooding the market also destroys value. |
I don't think it will happen. They are monopolists now, but if everyone can launch and play CS in a browser, then there will be no point in paying them money for the game. It will be the same as with the client desktop CS, the donation will go to the server side and not the client as it is with Play-CS |
I admit I am completely ignorant of their business model. So maybe what I'm saying doesn't make sense cause of that. Sorry for that!! If we are okay with donations to support server side only, then yeah it should exist that way. Servers cost money. I wasn't aware they had been giving players who pay some kind of leg up. That's even worse. I'm still not sure what the right thing to do here is with respect to IP. |
Everything is okay, thank you for your work I'm not sure about intellectual property either, but I think there's nothing new here, unlike the C++ code. Because it's essentially the same code that's from the main repository, just adapted for WASM. |
@a1batross It's crystall-clear that play-cs.com used your work and made some money. At least did they contact you and give some donation to FWGS? |
The engine is still by most part is derived from GPL (ignoring the fact that GPL applies the whole work, licensing is quite tricky here). It shouldn't be closed source.
I don't think they're quite happy with us at this point. Though, Valve never really said anything to us. We don't condone piracy and that's it. :) Making it as accessible as possible sounds interesting to me. Not only making it easier to set up your own client by slapping it on some static webpage hosting but also making it easier to connect existing servers. However, I can't imagine how could this be done, nor WebSockets, nor WebRTC are pure UDP, and that's what Xash3D and GoldSrc servers want. @firsturdiev nope, they never donated to the project. What should I mention though, I once joined their Discord server and asked for crediting Xash3D and cs16-client on their website, and they did that, on a separate page which is probably buried somewhere deep these days. |
That's... interesting. Old port used WS proxy to UDP, but I didn't know it's still online! It's probably @mittorn's proxy. |
this is just public emscripten project https://github.com/btarg/Xash3D-Emscripten but with updated master server proxy https://github.com/btarg/Xash3D-Emscripten/blob/master/xash.html#L499 not sure who is owner of this master server |
Looks like no, this is not @mittorn's proxy As I know, @mittorn `s proxy was wsproxy://the-swank.pp.ua:3000/ (but not sure) I guess we can implement something like @mittorn 's Proxy, why not ? It will be great! |
Do you have plans to open source your implementation at some point? That would be cool, because our implementation is pretty rough. Would be amazing to have the actual and usable implementation. |
Of course. I'm a bit embarrassed by it though, I had to write some hacks to get Node to compile and link as a 32bit target, which I forked from the node code base. That use case is specifically not tested by them. And there's a lot of code I made just for tests that I need to turn into a class. I'm still thinking about how I want the actual communication layer to work, since I have a ton of control there. The point is, the communication works both ways and I get instant event notifications even when a Promise is not scheduled. That was a huge problem for me to overcome. And this is recent. Last week I managed to get it to work right. So I'm still actively developing it, it's not black holed. If you want to assist, fantastic. Maybe we can collaborate. I have commands invoking node code. It's mostly relatively trivial except for my custom event loop where I had to override libuv internals from within node. |
Yeah, I agree. Such tool will be incredibly useful since AMX Mod X is pretty outdated and locked to x86 architecture because of JIT. I think we can discuss more details little bit later and somewhere else rather than this issue 👍🏼 |
didn't get, you mean xash3d-nodemod ? (something like amxmodx ?) |
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.The text was updated successfully, but these errors were encountered: