Skip to content

godot-collective/gmbt

Repository files navigation

gmbt

gmbt is a MoonBit script language integration for Godot implemented as a real ScriptLanguageExtension/GDExtension, with a generated Godot SDK and a generated runtime bridge.

The repository is organized around a production-oriented goal:

  • author .mbt scripts directly in Godot projects
  • let Godot load them as a first-class script language
  • generate the Godot API surface from upstream data instead of hand-maintaining it
  • keep runtime facade, host ABI, and generated SDK in sync

Repository Layout

  • src/ C++ host, script language, resource loader/saver, runtime parser, compiler bridge, and generated host-runtime include integration.
  • tools/ API pipeline, runtime policy, script compiler, validation scripts, and build helpers.
  • generated/godot_api_pipeline/ generated API catalog, generated editor SDK, runtime manifests, and generated host runtime.
  • project/ example Godot project used for end-to-end validation.
    • project/mbt/: MoonBit example and probe scripts
    • project/gmbt/: generated dependency module consumed by the sample project
    • project/bin/gmbt.gdextension: extension manifest used by the sample project
  • docs/ pipeline notes, architecture notes, and working documentation.
  • godot-cpp/ upstream godot-cpp submodule.

Current Capabilities

  • real .mbt script resources loaded by Godot
  • #gmbt.base(...)
  • #gmbt.tool
  • #gmbt.class_name(...)
  • #gmbt.signal(...)
  • exported properties for Int, Double, Bool, String, Vector2, Vector3
  • runtime method ABI for:
    • Int
    • Double
    • Bool
    • String
    • Vector2 args/returns
    • Vector3 args/returns
  • generated Vector2/Vector3 operator support inside the supported MoonBit boundary:
    • +
    • -
    • *
    • /
    • unary -
    • equality/comparison traits

Build

Prerequisites

  • Godot 4.6-compatible source/docs available locally
  • MoonBit toolchain installed locally
  • Visual Studio C++ build tools on Windows
  • godot-cpp submodule initialized

Commands

Generate the Godot API pipeline and sync the sample project module:

python tools/build_godot_api_pipeline.py --godot-root C:/toolkit/godot --project-root D:/Dev/self/moonbitlang/gmbt/project --no-legacy-sdk

Build the extension:

scons platform=windows target=template_debug arch=x86_64

Validate the generated editor SDK with official MoonBit tooling:

python tools/validate_generated_editor_sdk.py

Validate the sample project module:

cd project
moon check

Example Project

The sample Godot project lives in project/.

Its default scene is project/main.tscn, which loads a real MoonBit script from project/mbt/main.mbt.

The repository also contains multiple headless probes used during development to validate runtime API calls, UI/control bindings, 3D bindings, reload behavior, script metadata, and method ABI coverage.

Generated SDK

Two generated SDK views are kept in the repository:

Pipeline notes live in docs/godot_api_pipeline.md.

GitHub Actions

  • ci.yml verifies representative builds on push and pull request.
  • make_build.yml produces cross-platform artifacts for release packaging.

License

gmbt is distributed under the Apache License 2.0.

See LICENSE.md.

Third-party code and submodules such as godot-cpp/ keep their upstream licenses.

About

MoonBit script language integration for Godot via GDExtension

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors