RPGX is a lightweight, modular, and extensible RPG game engine written in Rust, designed for flexibility and ease of use. It provides a rich grid-based architecture with layered maps, tile effects, pathfinding, and entity movement logic.
Built with modern Rust paradigms, RPGX is distributed both as a native Rust crate and as a WebAssembly (WASM) module via wasm-bindgen, making it seamlessly integrable into Node.js environments and browser applications.
RPGX is fully compatible with Dioxus, a powerful Rust-based UI framework, enabling smooth rendering and interactive frontend experiences for games built on top of the engine.
This combination of Rust’s performance, WASM’s portability, and Dioxus’s reactive UI system provides a robust foundation for developing cross-platform RPG games that can run natively, on the web, or in hybrid contexts.
Install the core engine crate:
cargo add rpgxOr add it manually in your Cargo.toml:
[dependencies]
rpgx = { git = "https://github.com/LorenzoRottigni/rpgx", package = "rpgx" }Docs: https://crates.io/crates/rpgx
Install the WebAssembly driver for use in JS/TS:
npm install @rpgx/js
# or
yarn add @rpgx/js
# or
pnpm install @rpgx/jsDocs: https://www.npmjs.com/package/@rpgx/js
🚧 Planned: A C++-friendly wrapper using wasm-bindgen-cxx or cxx, to allow integration with C++ game engines and UIs like Qt or Unreal.
Requirements:
-
Rust (with
wasm32-unknown-unknowntarget) -
cargo install wasm-bindgen-cli
-
cargo install --locked dioxus-cli
Clone the repo and initialize your environment using the provided Makefile.
make dev-vue- Builds the
rpgx-wasmdriver bundle. - Generates JS bindings using
wasm-bindgen. - Launches the Vue.js playground.
make dev-node- Builds and binds the WASM module.
- Starts the Node.js script using TypeScript.
make dev-dioxus-web # For web browser rendering
make dev-dioxus-desktop # For native desktop appRun all unit tests for the Rust core and WASM crates:
make test-core # Tests for core engine (rpgx)
make test-wasm # Tests for WASM driver (rpgx-wasm)make cleanThis removes compiled files, WASM output, and node_modules from playgrounds.
make build-coremake build-wasmmake build-vuemake build-dioxus-web
make build-dioxus-desktopRPGX is licensed under the MIT License. You are free to use, modify, and distribute it under the terms of this license.
