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()
- xash3d-fwgs: Core engine build for WebAssembly.
- hlsdk-portable: Portable Half-Life SDK game logic.
- cs16-client: Counter-Strike 1.6 client build for the web.
- webxash3d-mserver: WebXash3D MServer written in TypeScript for in a game server list.
git clone --recurse-submodules https://github.com/yohimik/webxash3d-fwgs.git
cd webxash3d-fwgs
npm install
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
To build and run a project, go to the examples/ folder and choose the example that matches the game or setup you want.
Cannot be supported at this moment (wait for freevgui
).
Need help? Want to share your project or ideas? Join our Discord community to connect with others!
Support connection to servers (only xash3d-fwgs dedicated server).
Enable touch support at the engine level.
Requires isNeedTouch
engine function support.
Text inputs are not rendered as standard HTML input fields, which makes text input impossible on mobile devices.
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.
Support GLES3Compat batching and fix Vertex buffer is not big enough for the draw call.Understand this warning
warning.
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")))
.