Skip to content
/ 2dog Public

.NET front-end for #GodotEngine, using libgodot

License

Notifications You must be signed in to change notification settings

outfox/2dog

Repository files navigation

How do you pronounce Godot ? 🦴

2dog logotype, a white stylized dog with the negative space around its leg forming the number 2, and a playful font spelling the word dog

"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.


What is 2dog?

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
}

What does this mean?

  • 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

Features

Current

  • Godot as an embedded library (libgodot)
  • Full GodotSharp API access
  • Custom .NET-first project structure
  • File-centric architecture

Planned

  • 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.


Quick Start

Prerequisites

  • .NET SDK 8.0 or later
  • Python (with uv)

Build & Run

  1. Clone and initialize submodules
   git submodule update --init --recursive
  1. Build Godot (required on fresh checkout)
   uv run build.py
  1. Build NuGet packages (required on fresh checkout)
   dotnet build platforms
   dotnet build twodog -c Debug
   dotnet build twodog -c Release
   dotnet pack
  1. Run the demo
   dotnet run --project demo

Note: The project uses solution filters to manage build order. packages/packages.slnf builds the core twodog library and platform packages first. After actual nuget packages exist in ./packages/, you can build the full solution with dotnet build.

Currently tested on Linux and Windows only. OSX support is WIP™


Join the Pack

Questions? Ideas? Want to teach 2dog new tricks?

Discord


Acknowledgements

Inspired by and built upon Ben Rog-Wilhelm's libgodot_example.
You're the GOAT. Or a DIESEL HORSE. Same difference!


No squirrels were harmed in the making of this README.

About

.NET front-end for #GodotEngine, using libgodot

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages