https://github.com/arocull/stag-toolkit
Toolsuite and docs for Godot game development
https://github.com/arocull/stag-toolkit
gamedev godot plugin rust techart
Last synced: 3 months ago
JSON representation
Toolsuite and docs for Godot game development
- Host: GitHub
- URL: https://github.com/arocull/stag-toolkit
- Owner: arocull
- License: bsd-3-clause-clear
- Created: 2024-11-10T03:12:21.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-04-18T22:57:57.000Z (about 1 year ago)
- Last Synced: 2025-04-23T11:17:16.176Z (about 1 year ago)
- Topics: gamedev, godot, plugin, rust, techart
- Language: Rust
- Homepage: https://alanocull.com
- Size: 8.8 MB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
#  Stag Toolkit
[Godot](https://godotengine.org/) addon and [Rust library](#as-a-rust-library) for real-time 3D games, art, and simulations.
Currently equipped for Godot **4.5**+ on Windows and Linux (gdextension), or all platforms (without gdextension).
> [!WARNING]
> Areas of this addon are highly experimental and frequently subject to change based on personal needs.
> These changes will sometimes require usage to be updated accordingly.
> Use at your own risk!
> Check for `@experimental` in docs to help identify unstable features.
*If this tool has helped you, feel free to [send a Kofi](https://ko-fi.com/stagmath) my way, or to anyone listed in the [credits](#credits)*!
## Feature List
-  **[StagTest](docs/stagtest.md)** test framework for simulating gameplay and performing benchmarks
-  **[IslandBuilder](https://alanocull.com/island_builder.html)**\* tool for instantly converting whiteboxes into game-ready terrain
-  [**SimulatedRope** and **SimulatedRopeBinding**](docs/simulatedrope.md)\* nodes for performing and interacting with rope simulations
-  **QueueFloat**\* class for handling and analyzing float buffers with minimal allocations
-  **StagLogger** (wraps [Logger](https://docs.godotengine.org/en/stable/classes/class_logger.html)) for error catching and granular logs
- **Simple LOD** importer for hands-free importing of scenes with custom LODs and collision siblings
- [**Texture/Material** importer](docs/ironpress.md) for [`.ironpress`](https://github.com/arocull/IronPress) material imports
- **[Shader includes](godot/addons/stag_toolkit/utils/shader_includes)** and debug shaders
\* *Requires the built-in gdextension.*
Some features can be toggled on/off via the Project Settings under `addons/stag_toolkit`. May require an plugin reload or editor restart.
## Projects
These projects use StagToolkit! Feel free to contribute your own.
- **Abyss**, a tower-defense platformer ( [itch.io](https://stagmath.itch.io/abyss-demo) )
## Installation
The latest stable plugin versions are published in the [releases tab](https://github.com/arocull/stag-toolkit/releases). Download and extract the zip archive, and copy the `addons/stag_toolkit` directory into your project's `addons` directory.
### As a Rust Library
The [`stag-toolkit` crate](https://crates.io/crates/stag-toolkit) can also be used as a library for your own Rust projects: `cargo add stag-toolkit`
Or, in your `Cargo.toml`, add:
```toml
[dependencies]
# ...
stag-toolkit = "0.5.3"
```
## Documentation
For the most up-to-date API documentation, use Godot Editor's internal "Search Help" feature (hotkey F1) to see internal class documentation.
The `master` branch API is also hosted on [GitHub pages](https://arocull.github.io/stag-toolkit/), although the GDExtension docs are not properly generated yet.
Guides are manually documenated in the [docs](docs/) folder.

## Building Manually
1. Ensure [Godot](https://godotengine.org/download/archive/) (using version as specified above) and [Rust](https://www.rust-lang.org/) (I use the `stable` version) are installed
2. Clone this repository
3. `cd` into this repository and run `cargo fetch`
4. Run `$ make` if on Linux, or `$ build.cmd` if on Windows
5. Open the addon project in Godot to verify that it works: `cd godot/ && godot project.godot`
6. Copy the `godot/addons/stag_toolkit/` directory into your project as `addons/stag_toolkit/`
If desired, you can run `$ make derust` on Linux to remove any Rust-dependent stuff from the addon.
### Cross Compiling
Make use of Rust's target system!
- Install for key x86_64 platforms: `$ rustup target add x86_64-unknown-linux-gnu x86_64-pc-windows-gnu`
- Get a list of [all platforms](https://doc.rust-lang.org/nightly/rustc/platform-support.html): `$ rustup target list`
- Ensure you have the proper linker installed [to make use of cargo](https://stackoverflow.com/a/62853319)
These platforms currently are not supported, but may be supported in the future, in order of priority:
1. Web Export `wasm32-unknown-emscripten` with threads
2. Web Export `wasm32-unknown-emscripten` without threads
3. Linux 32-bit
4. Windows 32-bit
5. Mac `x86_64-apple-darwin`
#### On Linux
Install the proper linkers!
- Ubuntu: `$ sudo apt-get install mingw-w64`
- Fedora: `$ sudo dnf install mingw64-gcc`
### Development
You may need to install additional toolchains for pre-commit hooks.
- `$ pip install pre-commit gdtoolkit` - Installs pre-commit hooks and a linting/formatting toolchain for GDScript.
- `$ pre-commit install` - Initialize pre-commit hooks.
## Contribution
This repository is mirrored from a private git server, but if you're interested in contributing, let me know!
My roadmap is based on personal needs.
### Bug Reports
Feel free to file an issue ticket on [GitHub](https://github.com/arocull/stag-toolkit/issues) with your issue.
## Credits
- **[godot-rust](https://godot-rust.github.io/)** is used to hook StagToolkit into Godot Engine
- **[Fast Surface Nets](https://github.com/bonsairobo/fast-surface-nets-rs)** for converting Signed Distance Field data to initial triangle meshes
- **[Godot Engine](https://godotengine.org/)** where the plugin resides