Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

601 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

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.

Getting Started

Full documentation at 2dog.dev.

Existing Project (Recommended)

2dog preserves your existing game content, and there is no tool installation step. Please make backups, but most of its changes are optional additions, not modifications.

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

Run dnx 2dog again any time to add another host.

New Project

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

The same content is also 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.1-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: win-x64, linux-x64, osx-arm64, browser-wasm
  • Packages available on NuGet and GitHub

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.

Releases

Used by

Contributors

Languages