"Godot, or to dog... is it even a question?"
This libary lets your C# application code start and pump Godot's MainLoop - not the other way around.
2dog is a .NET/C# front-end for Godot Engine that inverts the traditional architecture. Instead of having Godot's process and scene tree drive your application, you now control Godot as a library.
Think of it like this: Godot is your loyal companion that follows your lead, learns new tricks, and does exactly what you tell it to. All this while still having all the capabilities of the full engine.
// Program.cs
using Engine = twodog.Engine;
using var engine = new Engine("game", "project");
using var godot = engine.Start();
while (!godot.Iteration())
{
// .... and we're off the leash!
// you can access the SceneTree via engine.Tree
}- ✨ Everything Godot can do, 2dog can do
- 🎯 Plus direct control over engine initialization, lifecycle, and integration
- 🔧 Plus freedom to structure your project however you want
- 🚀 Plus first-class .NET tooling and workflows
- Godot as an embedded library (libgodot)
- Full GodotSharp API access
- Custom .NET-first project structure
- File-centric architecture
- TRS transforms using the fennecs entity-component system
- Novel approach to scene and material definitions
- and more tricks to teach this dog...
Note: Massively WIP! Once Godot 4.6 releases, the local build requirements should be simplified.
- .NET SDK 8.0 or later
- Python (with uv)
- Clone and initialize submodules
git submodule update --init --recursive- Build Godot (required on fresh checkout)
uv run build.py- Build NuGet packages (required on fresh checkout)
dotnet build platforms
dotnet build twodog -c Debug
dotnet build twodog -c Release
dotnet pack- Run the demo
dotnet run --project demoNote: The project uses solution filters to manage build order.
packages/packages.slnfbuilds the coretwodoglibrary and platform packages first. After actual nuget packages exist in./packages/, you can build the full solution withdotnet build.
Currently tested on Linux and Windows only. OSX support is WIP™
Questions? Ideas? Want to teach 2dog new tricks?
Inspired by and built upon Ben Rog-Wilhelm's libgodot_example.
You're the GOAT. Or a DIESEL HORSE. Same difference!