This project is a dispat-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-clientimport { Xash3D } from "xash3d-fwgs"
const x = new Xash3D({
canvas: document.getElementById('canvas'),
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()Special thanks to the people who made this project possible:
- @ololoken — graphics, WebGL2, and resolving many issues
- @ludufre — Metamod and AMX Mod X support, and Docker images
- 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.
Ready-to-deploy Docker images for Counter-Strike 1.6 and Half-Life web servers:
- cs-web-server: Vanilla CS 1.6 web server with client and dedicated server
- cs-web-server-metpamx: CS 1.6 web server with Metamod-P & AMX Mod X pre-installed
- hl-web-server: Vanilla HLDM web server with client and dedicated server
- hl-web-server-metpamx: HLDM web server with Metamod-P & AMX Mod X pre-installed
All servers support browser-to-server networking and are fully Dockerized for easy deployment.
git clone --recurse-submodules https://github.com/yohimik/webxash3d-fwgs.git
cd webxash3d-fwgspnpm installYou must provide your own game files (e.g., from Steam):
steamcmd +force_install_dir ./hl +login your_steam_username +app_update 70 validate +quitTo 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 WebRTC/UDP proxy (webxash3d-mserver).
Metamod proxy plugin webxash-metamod
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.










