An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

# ![](godot/icon.svg) 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

- ![](godot/addons/stag_toolkit/icons/icon_stagtoolkit_monochrome.svg) **[StagTest](docs/stagtest.md)** test framework for simulating gameplay and performing benchmarks
- ![](godot/addons/stag_toolkit/icons/icon_islandbuilder.svg) **[IslandBuilder](https://alanocull.com/island_builder.html)**\* tool for instantly converting whiteboxes into game-ready terrain
- ![](godot/addons/stag_toolkit/icons/icon_simulatedropebinding.svg) [**SimulatedRope** and **SimulatedRopeBinding**](docs/simulatedrope.md)\* nodes for performing and interacting with rope simulations
- ![](godot/addons/stag_toolkit/icons/icon_queuefloat.svg) **QueueFloat**\* class for handling and analyzing float buffers with minimal allocations
- ![](godot/addons/stag_toolkit/icons/icon_stagtoolkit_monochrome.svg) **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.

![](docs/images/godot-internal-docs.png)

## 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