Skip to content

Godot SDK and Blackholio tutorial#4920

Open
lisandroct wants to merge 12 commits intomasterfrom
lisandro/godot-blackholio
Open

Godot SDK and Blackholio tutorial#4920
lisandroct wants to merge 12 commits intomasterfrom
lisandro/godot-blackholio

Conversation

@lisandroct
Copy link
Copy Markdown
Contributor

@lisandroct lisandroct commented Apr 30, 2026

Description of Changes

Very small additions to the C# SDK specific for Godot.
I wrote the Godot Blackholio tutorial and updated the Unity one.
I added the image assets necessary for the tutorial.
I added the files for the Godot demo.

API and ABI breaking changes

No breaking changes.

Expected complexity level and risk

  1. There's really no risk for current systems or projects, it's all new additions to support nicely(-ish) Godot, new Blackholio demo for Godot and updates to the tutorials.

Testing

  • Follow the tutorial and verify everything works.
  • Build for Windows and verify it works.
  • Build for Mac and verify it works. (Will do this once I'm back home)
  • Build for Linux and verify it works. (Will do this once I'm back home)
  • Build for Android and verify it works. (Will do this once I'm back home)
  • Build for iOS and verify it works. (I don't own any iOS devices)
  • Build SDK
  • Publish to Nuget

@lisandroct lisandroct marked this pull request as draft April 30, 2026 14:29
@lisandroct lisandroct changed the title Lisandro/godot blackholio Godot SDK and Blackholio tutorial Apr 30, 2026
@lisandroct lisandroct marked this pull request as ready for review April 30, 2026 14:37
Copy link
Copy Markdown
Contributor

@rekhoff rekhoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was only able to get part-way through docs/docs/00100-intro/00300-tutorials/00500-godot-tutorial/00300-part-2.md before hitting a blocker with the implementation.
The tutorial so far it looks good with only some minor nits, but the NuGet package issue will need to get addressed before I can finish reviewing.

import TabItem from '@theme/TabItem';


![Unity Tutorial Hero Image](/images/unity/part-1-hero-image.png)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update this with a screenshot of the Godot implementation, or removed it from the tutorial for now.


### Step 1: Create a Blank Godot Project

SpacetimeDB supports Godot version `4.6.2` or later. See [the overview](.) for more information on specific supported versions.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this link is broken. Also, when going to download Godot 4.6.2, for Windows, macOS, and Linux, there is a Standard and a .NET install. I don't see all call out to use the .NET (on the download page it does say ".NET builds offer support for C# as a scripting language.", but it might be good to call out the .NET version, unless either will work.


![Create 2D Scene](/images/godot/part-1-godot-create-2d-scene.jpg)

2. **Rename the GameObject**:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
2. **Rename the GameObject**:
2. **Rename the root Node**:

}
}
}
#elif GODOT
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe this will work to allow Godot to have code only relevant to it within the NuGet packages. Unity is able to get away with unique build flags because we have Unity developers Import the SpacetimeDB SDK using the C# SDK repo. This means for Unity developers, the original code is intact and constants like UNITY_5_3_OR_NEWER and UNITY_EDITOR are evaluated locally. Only the SpacetimeDB.BSATN.Codegen.dll and SpacetimeDB.BSATN.Runtime.dll are pre-built head of time.

When we publish the NuGet packages for the general C# developers, that will strip out the GODOT build flag because it's not included as a constant during compilation. If we did include it, that would make it available to all SDK users (which of course would break things since it's specifically imports using Godot.

We'll likely need another approch than using GODOT build flags, or would need to make a custom target framework specifically for this.

For additional context, if we follow the tutorial, but point at a local NuGet package build from the lisandro/godot-blackholio branch, we'd get the errors like:

GameManager.cs(43,23): Error CS0117 : 'AuthToken' does not contain a definition for 'TryGetToken'
GameManager.cs(49,9): Error CS0103 : The name 'STDBUpdateManager' does not exist in the current context

And again, this is because the code is getting stripped out.

* * This class is only used in Godot projects.
* *
*/
#if GODOT
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my other note about this getting stripped out from the NuGet package during compilation.

Comment on lines +22 to +23
#elif GODOT
new GodotDebugLogger();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, see my other note about this getting stripped out from the NuGet package during compilation.

@@ -0,0 +1,110 @@
#if GODOT
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And one more: see my other note about this getting stripped out from the NuGet package during compilation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants