/godot-go

Go bindings for Godot 4 GDExtension API

Primary LanguageGoMIT LicenseMIT

Build Status


godot-go: Go bindings for Godot 4

Go bindings for the Godot Game Engine cross-platform game engine. godot-go integrates into Godot through the Godot GDExtension API through cgo.

The project is currently under heavy development. The API should be considered EXPERIMENTAL and is subject to change. The API is expected to become more stable as we get closer to a 1.0 release.

Current State of the Project

Although the tests confirm positive results, the godot-go bindings are currently not useable until the blocker reference counting issue is fixed. Further development won't make much sense until this is addressed.

Getting Started

Requirements:

  • clang-format
  • gcc
  • go 1.19.x

TODO

Building Godot-Go

In order for godot-go to work correctly, you must make sure the godot_headers are in sync between your godot binary and godot-go. Development is built and tested off of Godot 4 stable snapshot.

# exports the latest gdextension_interface.h and extension_api.json from the godot binary
GODOT=/godot_folder_path/bin/godot make update_godot_headers_from_binary

# generates code for wrapping gdextension_interface.h and extension_api.json
make generate

# build godot-go
make build

Test

Once the project successfully builds, run the following commands to generate cached files for the test demo project for the first time (don't be concerned if it fails):

make ci_gen_test_project_files

From here on out, you will just need to run the following command to iteratively test:

make test

This will run the demo project in the test directory.

Contact

I'm happy to help out anyone interested in the project. Please leave a message in the Discussion boards or you can add me (surgical#3758) as a friend on the Godot Engine Discord servers. I primarily frequent the gdnative-dev room.

References

Credit

  • Inspiration for the project was taken from ShadowApex's earlier project: godot-go
  • Inspiration also from godot-cpp