Skip to content

yohimik/webxash3d-fwgs

Repository files navigation

Xash3D-FWGS Emscripten Web Ports Monorepo WebXash3D icon

Join our Discord

This project is a Lerna-managed monorepo for running and compiling WebAssembly builds of Xash3D-FWGS, an open-source reimplementation of the GoldSource engine, in the browser using Emscripten.


npm install xash3d-fwgs hlsdk-portable cs16-client
import { Xash3D } from "xash3d-fwgs"

const x = new Xash3D({
    canvas: document.getElementById('canvas'),
    module: {
        arguments: ['-game', 'cstrike'],
    }
})
await x.init()
x.main()
x.Cmd_ExecuteString('map de_dust2')
x.Cmd_ExecuteString('sv_cheats 1')
x.Cmd_ExecuteString('noclip')
x.Cmd_ExecuteString('kill')
x.quit()

Included Packages

Getting Started

Clone the repository

git clone --recurse-submodules https://github.com/yohimik/webxash3d-fwgs.git
cd webxash3d-fwgs

Install Dependencies

npm install

Game Content

You must provide your own game files (e.g., from Steam):

steamcmd +force_install_dir ./hl +login your_steam_username +app_update 70 validate +quit

Compile and run

To build and run a project, go to the examples/ folder and choose the example that matches the game or setup you want.

hlsdk

Screenshots (black frames - mac book camera, blue frames - browser active outline)

hlsdk screenshot 0 hlsdk screenshot 1 hlsdk screenshot 2 hlsdk screenshot 3 hlsdk screenshot 4

cs16

Screenshots (black frames - mac book camera, blue frames - browser active outline)

cs16-client screenshot 0 cs16-client screenshot 1 cs16-client screenshot 2 cs16-client screenshot 3

tf15-client

Cannot be supported at this moment (wait for freevgui).

WebRTC Online Mod

Screenshots

webrtc screenshot 0

Discord Community

Need help? Want to share your project or ideas? Join our Discord community to connect with others!

TODO

Online

Support connection to servers (only xash3d-fwgs dedicated server).

Engine Touch Support

Enable touch support at the engine level. Requires isNeedTouch engine function support.

Fix Text Inputs

Text inputs are not rendered as standard HTML input fields, which makes text input impossible on mobile devices.

Async/lazy loading (potentially)

Patch the FS module to load only the currently required game files using fetch, instead of loading all files into RAM. Requires EAGAIN support from the engine.

WebGL improves (potentially)

Support GLES3Compat batching and fix Vertex buffer is not big enough for the draw call.Understand this warning warning.

Scripts (potentially)

Some scripts stop working after saving and loading (eg. the guard doesn't open the train door). Potentially related to #define EXPORT __attribute__((visibility("default"))).