Skip to content

Latest commit

Β 

History

713 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

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

Discord Invite NuGet CI

🦴 2dog is Godot... just backward!

Godot normally loads .NET, now .NET loads Godot.

2dog packages Godot as a library (a slightly modified libgodot) hostable by .NET applications. Doing it like this enables browser publishing, ordinary dotnet tooling, and many automations like unit testing.

Pre-built native libraries are available for speed and convenience.

Oh btw., this means you can export Godot C# to the web using 2dog.

Getting Started

Full documentation at 2dog.dev.

Existing Project (Recommended)

2dog adds nested .NET hosts without moving your existing Godot project.

cd path/to/MyGame
dnx 2dog add                  # pick the hosts you want, then confirm
dotnet run --project MyGame.2dog

Run dnx 2dog add again to add another host.

New Project

dnx 2dog new MyGame
cd MyGame
dotnet run --project MyGame.2dog

The package also provides a dotnet new template: dotnet new install 2dog && dotnet new 2dog -n MyGame.

In either case, the familiar Godot workflow still works:

godot-mono --editor . # or Godot_v4.7.2-stable_mono_win64.exe, etc.

Exporting for the Web

The generated .NET app can also be published to browser-wasm (HTML5 / Web Browser)

dotnet workload install wasm-tools
dotnet tool install --global dotnet-serve
dotnet publish MyGame.web
dotnet serve --directory MyGame.web/AppBundle

See Web / Browser for the development loop, deployment options, and current limitations.

Project Structure

2dog mainly adds subdirectories with additional "hosts" that can run your Godot project. These use libgodot instead of the normal export templates or editor executable.

MyGame/                       Godot project and solution root
β”œβ”€β”€ project.godot             Scenes, scripts, assets, project settings
β”œβ”€β”€ MyGame.csproj             Godot C# game assembly
β”œβ”€β”€ MyGame.2dog/              Desktop .NET host
β”œβ”€β”€ MyGame.web/               Browser WebAssembly host
└── MyGame.tests/             Headless xUnit host

The nested hosts carry .gdignore, so Godot ignores them. The game project remains clean and editor-friendly while each host gets its own entry point and dependencies.

Requirements and Status

  • .NET SDK 10.0 or later, with the wasm-tools workload
  • Godot 4.7.x official .NET editor (only when you want to edit scenes visually)
  • Supported build platforms: win-x64, linux-x64, and osx-arm64
  • Supported RIDs for published builds: win-x64, linux-x64, osx-arm64, browser-wasm
  • Packages available on NuGet and GitHub

Dogs and Robots are Nice

🦴β™₯οΈπŸ‘Ύ 2dog is proudly made by human maintainers and contributors. We permit extensive use of LLMs:

  • Forked libgodot features/fixes consist of similar amounts of human-written and machine-written code
  • Commits/PRs are reviewed & gated by both humans and machines (over 90%/90%) and signed by humans
  • .NET Host applications are mostly human-written, while boilerplate assets (e.g. XAML) are mostly machine-written
  • Configurations, tools, smoke tests, CSS, MSBuild XML, and CI workflows are overwhelmingly LLM-maintained
  • Documentation aims to be human-authored, but new feature docs are generated and later gradually rewritten
  • Releases on NuGet use Trusted Publishing and may only be invoked via direct human interaction

Teach 2dog New Tricks

Want to work on 2dog itself? Clone with submodules, then build the native and .NET packages:

git clone --recursive https://github.com/outfox/2dog
cd 2dog
uv run poe build-all

Run the showcase with dotnet run --project demos/showcase/showcase.2dog and the tests with dotnet test twodog.tests.

Join us at the Dog Park

We've got a dedicated channel for 2dog, say hello!

Discord Invite


No squirrels were harmed in the making of this README.