xash3d-fwgs
Version:
Xash3D-FWGS emscripten port
63 lines (44 loc) โข 2.59 kB
Markdown
# Xash3D-FWGS Emscripten TypeScript
[](https://discord.gg/cRNGjWfTDd)
A powerful TypeScript wrapper and extension layer for the [Xash3D FWGS](https://github.com/FWGS/xash3d-fwgs) engine compiled with Emscripten.
This project enables seamless integration of the engine into modern web and cross-platform environments with **zero dependencies**, **network protocol abstraction**, and **JavaScript bindings for direct engine console script execution**.
---
## ๐ Features
- โ
**TypeScript-first**: Strong typings and developer-friendly tooling.
- ๐ **Zero Dependencies**: Lightweight and modular. No external runtime libraries required.
- ๐ **Pluggable Network Layer**: Abstracted networking stack compatible with any protocol (WebSocket, WebRTC, custom).
- ๐งฑ **Emscripten Integration**: Wrapper for compiled Xash3D WASM build using Emscripten's `MODULARIZE` & `EXPORT_NAME`.
- ๐ **Extended Engine APIs**: Optional patches and hooks to extend or override engine behavior from TypeScript.
- ๐ ๏ธ **Custom I/O Bindings**: Integrate with custom file systems or asset streams.
- ๐งช **Testing-Friendly**: Clean architecture with clear separation between engine, I/O, and network logic.
---
## ๐ Discord Community
Need help? Want to share your project or ideas?
**[Join our Discord community](https://discord.gg/cRNGjWfTDd)** to connect with others!
---
## ๐งฉ Usage
To get started quickly, check out the [examples/](https://github.com/yohimik/webxash3d-fwgs/tree/main/packages/examples) folder for real-world usage with:
* WebRTC transport
* File system mount
* Minimal startup with in-memory assets
* Multiplayer setup demo
```typescript
import { 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()
```
## ๐ฆ SDKs
The following SDKs are available to run specific mods or games:
* [hlsdk-portable](https://www.npmjs.com/package/hlsdk-portable): Run Half-Life and compatible mods.
* [cs16-client](https://www.npmjs.com/package/cs16-client): Run Counter-Strike 1.6 and its based mods.
## ๐ Changelog
See [CHANGELOG.md](https://github.com/yohimik/webxash3d-fwgs/tree/main/packages/xash3d-fwgs/CHANGELOG.md) for a full list of updates and release history.