docs/docs/00100-intro/00300-tutorials/00500-godot-tutorial/00200-part-1.md
import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem';
Need help with the tutorial? Join our Discord server!
A completed version of the game we'll create in this tutorial is available at:
https://github.com/clockworklabs/SpacetimeDB/tree/master/demo/Blackholio
In this section, we will guide you through the process of setting up a Godot Project that will serve as the starting point for our tutorial. By the end of this section, you will have a basic Godot project and be ready to implement the server functionality.
SpacetimeDB supports Godot version 4.6.2 or later. See the overview for more information on specific supported versions.
Open Godot and create a new project by selecting "+ Create" from the Project Manager.
// TODO: THIS IMAGE MUST BE UPDATED
For Project Name use blackholio. For Project Location select a directory that you can navigate to via the CLI because we will need to do so in part 2.
Any Renderer will work.
Click "Create" to generate the blank project.
We will add the SpacetimeDB SDK using NuGet. Godot does not initialize a C# Project when creating a new Godot project, so we need to create a C# Script first to initialize our Godot C# Project.
New Script.C# in Lanugage and name it GameManager. We will use this script later to put the high level initialization and coordination logic for our game.SpacetimeDB.ClientSDK NuGet package using Visual Studio or Rider NuGet Package Manager or via the .NET CLI:dotnet add package SpacetimeDB.ClientSDK.Godot
The SpacetimeDB Godot SDK provides helpful tools for integrating SpacetimeDB into Godot, including a connection update manager which will synchronize your Godot client's state with your SpacetimeDB database in accordance with your subscription queries.
Rename the Node:
right-click -> rename) and rename it to Main.Attach the GameManager Script:
GameManager script from the Scene dock onto the Main Node in the Scene window.You will see a warning saying This inspector might be out of date. Please build the C# project.. This is because Godot doesn't automatically compile our C# project and we need to run the game for the compilation to take place. Let's do that.
Save current Scene:
Ctrl + S (or Cmd + S on Mac) to save the current scene. Name it main.tscn.Scene -> Save Scene As.Run Project and build C# Project:
F5 (or Cmd + B on Mac) to run the project, click on Select Current to select the current scene as the main one.Our Godot project is all set up! If you press play, it will show a blank screen, but it should start the game without any errors. Now we're ready to get started on our SpacetimeDB server module, so we have something to connect to!
We've now got the very basics set up. In part 2 you'll learn the basics of how to create a SpacetimeDB server module and how to connect to it from your client.