Skip to content

refactor(gdk)!: rename GDK* classes to Xbox* to avoid collisions with console-capable Godot forks (v0.3.0) - #156

Merged
James Lenell (jameslen-atg) merged 8 commits into
mainfrom
feature/xbox-class-rename
Aug 18, 2026
Merged

refactor(gdk)!: rename GDK* classes to Xbox* to avoid collisions with console-capable Godot forks (v0.3.0)#156
James Lenell (jameslen-atg) merged 8 commits into
mainfrom
feature/xbox-class-rename

Conversation

@jameslen-atg

@jameslen-atg James Lenell (jameslen-atg) commented Aug 17, 2026

Copy link
Copy Markdown
Member

refactor(gdk)!: rename GDK* classes to Xbox* (v0.3.0)

Warning

Breaking change. Every script-visible GDK* type is renamed to Xbox*. No deprecated aliases ship — this is a hard break.
The engine singleton is still named GDK. GDK.initialize() keeps working unchanged.

Migration guide: docs/gdk/migration-v0.3.md
Automated codemod: pwsh -File tools/migrate_gdk_to_xbox.ps1 -Path <your-project> -WhatIf

This revives the work from #143 (closed unmerged) on top of current main, and adds the release deliverables that were missing from it: a migration guide, a codemod, a CHANGELOG, and a version bump to 0.3.0.

Why this rename

This rename exists to let the addon enable console support inside compatible Godot forks. Console-capable forks supply the console platform layer and register their own types, and the GDK* prefix collided with names those forks already use. Godot registers extension classes in a single flat ClassDB namespace, so two providers exposing the same name cannot coexist in one project.

Moving this addon's script-visible types to the Xbox* prefix keeps them distinct, so the addon can be dropped into such a fork and light up console scenarios there rather than being blocked by a name conflict.

A single binary covers both PC and console. There is no separate console compilation, build preset, or conditional define — godot_gdk.gdextension declares only the windows.*.x86_64 libraries, and a console-capable fork loads those same binaries. One build of the addon, both targets.

Important

Godot itself is unchanged by this. The engine's console support comes from those forks, not from this repository. Within this repo the rename is a naming change only — no runtime behavior changed.

The one gotcha

The ClassDB class name and the engine singleton name are now different strings:

GDK.initialize()                 # unchanged — the singleton is still `GDK`
GDK.is_class("GDK")              # now false
GDK.is_class("Xbox")             # now true
Engine.has_singleton("GDK")      # unchanged — still true

Only type references move. Anything that reflects on the class name by string needs updating.

Usage — GDScript

# before
var users: GDKUsers = GDK.users
var achievements: GDKAchievements = GDK.achievements
var result: GDKResult = await achievements.update_achievement_async(user, "ach-1", 100)

# after
var users: XboxUsers = GDK.users
var achievements: XboxAchievements = GDK.achievements
var result: XboxResult = await achievements.update_achievement_async(user, "ach-1", 100)

Note that only the type annotations changed — the GDK.users / GDK.achievements accessors are untouched.

Signal payloads and is/as/extends positions move the same way:

# before
func _on_user_changed(user: GDKUser) -> void:
    if user is GDKUser:
        ...

# after
func _on_user_changed(user: XboxUser) -> void:
    if user is XboxUser:
        ...

Usage — C#

The C# binding is a matching GdkXbox prefix swap, and the namespace moves GodotGdkGodotXbox. The assembly name and csproj (GodotGdkCSharp) are unchanged, so existing <ProjectReference> entries still resolve.

// before
using GodotGdk;
GdkResult result = await Gdk.Users.AddDefaultUserAsync();
Gdk.Users.UserChanged += (GdkUser user, string change) => GD.Print(change);

// after
using GodotXbox;
XboxResult result = await Xbox.Users.AddDefaultUserAsync();
Xbox.Users.UserChanged += (XboxUser user, string change) => GD.Print(change);

Xbox is a static facade (Xbox.Users, Xbox.Achievements, …) — there is no .Instance.

Deliberately NOT renamed

These are product/plumbing names, not script-visible types, and stay as-is:

  • the GDK engine singleton, and the addons/godot_gdk folder + godot_gdk.gdextension
  • gdk/runtime/* and gdk/packaging/* Project Settings keys
  • the gdk export feature tag, GDKPKG_* env vars, gdkpkg forwarders
  • cmake/GDKDependencies.cmake, GDK_VERSION, gdk_edition.h
  • GodotGdkCSharp assembly/csproj name
  • all PlayFab* and GameInput* types (out of scope for this release)

Codemod

tools/migrate_gdk_to_xbox.ps1 rewrites an explicit list of 48 GDScript API names and 54 C# API names. It does not touch a consumer's own Gdk-prefixed identifiers by default (opt in with -RenameProjectGdkNames), and it never rewrites a bare GDK (that's the singleton).

pwsh -File tools/migrate_gdk_to_xbox.ps1 -Path C:\my-game -WhatIf   # preview
pwsh -File tools/migrate_gdk_to_xbox.ps1 -Path C:\my-game           # apply

It was validated by replaying it over main's pre-rename sample/ tree and diffing against this branch's hand-renamed version: 121 of 122 files came out byte-identical. The single remainder is a private method named OnGdkRuntimeError (Gdk infixed rather than prefixed), which is correctly out of scope for automation and is called out in the migration guide.

Also in this PR

  • CHANGELOG.md — first changelog in the repo, seeded with v0.1.0 / v0.2.0 and this release
  • addon versions bumped 0.1.0-dev/0.1.00.3.0 across all four plugin.cfg files; <Version>0.3.0</Version> added to both C# csproj files
  • straggler doc fixes: GDKResult in docs/gdk/api-reference.md, GDKExportPlatform in docs/gdk/editor-tools.md
  • migration guide linked from README.md and docs/README.md

Validation

All run locally against Godot 4.6.2-stable from this branch:

Gate Result
tools/check_gd_scripts_headless.ps1 pass
tools/run_all_tests.ps1 474 tests, ~17k asserts, 0 failed (gdk 330 / playfab 84 / gameinput 60)
C++ doctest (gdk_unit_tests.exe) pass
13 bootstrap mini-runners pass
tools/run_csharp_tests.ps1 107 / 107
tools/package_addons.ps1 -Configuration Both -Reconfigure pass (154 files, 15.44 MiB)
tools/export_samples.ps1 pass, all 4 tutorial tracks
dotnet build × 4 C# tutorial projects pass
doc_classes ↔ ClassDB parity 47 documented / 48 registered — identical to main's baseline

Live coverage

Live tier was run, with writes enabled, against sandbox PlayFab title 10D176:

pwsh -File tools/run_all_tests.ps1 -Live -AllowLiveWrites `
  -PlayFabTitleId "10D176" -PlayFabCustomId "godot-gdk-ext-live-smoke" `
  -PlayFabMatchmakingQueue "godot_gdk_ext_live_smoke_queue"

Every stage passed except the PlayFab Multiplayer orchestrator (46 / 61 scenarios). These failures are not caused by this PR:

  • tests/godot/mp_orchestrator/ is byte-identical to main on this branch (git diff public/main...HEAD -- tests/godot/mp_orchestrator is empty) and contains zero GDK* / Xbox* type references.
  • All 15 failures are confined to PlayFab Lobby / Party / Match surfaces, which this rename does not touch.
  • The orchestrator is known-flaky against live services. Two back-to-back runs produced 15 and 14 failures respectively, overlapping on 14.

Version matrix

Only Godot 4.6.2 is installed on this machine, so the 4.5.x (gut-4.5) and 4.7.x legs are deferred to the CI PR gates.

Migration for consumers

  1. Read docs/gdk/migration-v0.3.md.
  2. Run tools/migrate_gdk_to_xbox.ps1 -WhatIf, review, then apply.
  3. Grep for any remaining is_class("GDK") / get_class() == "GDK" string comparisons — those must become "Xbox".

Copilot AI added 7 commits August 10, 2026 10:37
…name

Renames every script-visible GDK type to the `Xbox*` prefix while leaving the
engine singleton registered under the name `GDK` by default. Forks already
written against the `GDK` global keep working; only type names change.

The ClassDB class name and the engine singleton name are now different
strings. Anything that class-checks the singleton must compare against
`"Xbox"`, not against the singleton name.

Renamed:
- 46 registered classes (`GDKUser` -> `XboxUser`, `GDKResult` -> `XboxResult`,
  ...), plus the abstract root `GDK` -> `Xbox` and `GDKXboxServices` ->
  `XboxServices`.
- C++ sources `src/gdk_*.{cpp,h}` -> `src/xbox_*.{cpp,h}` with `XBOX_*_H`
  include guards; internal namespaces `gdk_internal` -> `xbox_internal` and
  `gdk_request_parsing` -> `xbox_request_parsing`.
- `doc_classes/GDK*.xml` -> `doc_classes/Xbox*.xml`.
- Bootstrap autoload `GDKBootstrap` -> `XboxBootstrap`.
- C# facade: namespace `GodotGdk` -> `GodotXbox`, static class `Gdk` ->
  `Xbox`, and 47 `Gdk*.cs` -> `Xbox*.cs`.
- Packaging forwarder env vars `GDKPKG_*` -> `XBOXPKG_*`.

Deliberately unchanged: the `addons/godot_gdk` folder, `godot_gdk.gdextension`,
the `gdk_addon_init` entry symbol, `gdk/runtime/*` Project Settings, the
default singleton name `"GDK"`, `cmake/GDKDependencies.cmake`,
`GodotGdkCSharp.csproj`, `gdk_edition.h`, and prose referring to the Microsoft
GDK product.

No deprecated `GDK*` class aliases are provided.

GDScript:

    var init: XboxResult = GDK.initialize()
    if not init.success:
        push_error(init.message)
        return

    var res: XboxResult = await GDK.users.add_default_user_async()
    var user: XboxUser = res.data
    print(user.gamertag)

    GDK.runtime_error.connect(func(r: XboxResult) -> void: push_error(r.message))

C#:

    using GodotXbox;

    XboxResult init = Xbox.Initialize();
    XboxResult res = await Xbox.Users.AddDefaultUserAsync();
    XboxUser user = res.DataAs<XboxUser>();
    GD.Print(user.Gamertag);

Validation (local, in-worktree):
- tools/check_gd_scripts_headless.ps1: pass
- tools/run_all_tests.ps1: Overall pass (gdk 292, playfab 81, gameinput 60,
  C++ doctest, all bootstrap runners). Offline tier only -- live tests were
  skipped (no -Live), and -AllowLiveWrites was not used.
- dotnet test tests/csharp/FacadeParity.Tests: 105/105 pass
- doc_classes <-> ClassDB parity verified: 46 registered, 46 documented, no
  drift in either direction.

doc_classes, spec/gdext-gdk.md, docs/, samples, tests, and the path-scoped
agent instructions were all reconciled in this change.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…rename

Calls out at the top of the README that every script-visible type moved to
the Xbox* prefix (and the C# facade to GodotXbox/Xbox), that no deprecated
GDK* aliases exist, and that the GDK singleton name is unchanged so
GDK.initialize() and friends keep working.

Also notes the consequence that the ClassDB class name (Xbox) and the
singleton name (GDK) are now different strings, so is_class("GDK") no
longer matches.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…name

# Conflicts:
#	addons/godot_gdk/src/register_types.cpp
#	addons/godot_gdk/src/xbox_multiplayer_activity.cpp
#	addons/godot_gdk/src/xbox_presence.cpp
#	addons/godot_gdk/src/xbox_privacy.cpp
#	addons/godot_gdk/src/xbox_social.cpp
#	addons/godot_gdk/src/xbox_stats.cpp
#	addons/godot_gdk/src/xbox_user.cpp
#	addons/godot_gdk/src/xbox_user.h
#	addons/godot_gdk_csharp/Services/GdkUsers.cs
#	docs/gdk/api-reference.md
#	spec/gdext-gdk.md
#	tests/godot/gdk/tests/test_users.gd
Reconciles main's game-save quota threading fix (#145 / #152) and the
XBOX-on-PC export delegation fix (#144 / #151) with the GDK* -> Xbox*
class rename.

Conflict resolutions:
- xbox_game_save.{h,cpp}: took main's async XAsyncProvider-backed
  get_remaining_quota_async(), renamed to XboxGameSave/XboxResult/
  XboxRuntime/XboxPendingSignal/XboxSignalXAsyncContext/XboxUser. The
  resurrected gdk_game_save.h was dropped.
- XboxGameSave.cs: took main's Task<XboxResult> GetRemainingQuotaAsync();
  the resurrected GdkGameSave.cs was dropped.
- gdk_editor_plugin.gd / gdk_export_features_plugin.gd: kept main's new
  export-features plugin, renamed its preload consts to Xbox*.
- README.md: kept both main's badges/tagline and the branch's breaking-
  change warning.
- doc_classes/XboxGameSave.xml, docs/gdk/api-reference.md,
  spec/gdext-gdk.md, tests/godot/gdk/tests/test_game_save.gd: took main's
  updated Connected Storage / async-quota prose with Xbox* type names.

Validation: check_gd_scripts_headless.ps1 clean; run_all_tests.ps1 overall
pass (471 GUT tests, 0 failed; live tier skipped, no -Live/-AllowLiveWrites).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… version bump

Release prep on top of the GDK* -> Xbox* rename. No addon behavior changes.

- docs/gdk/migration-v0.3.md: full old -> new mapping for the 46 renamed
  classes, the C# facade (namespace GodotGdk -> GodotXbox, static Gdk -> Xbox),
  the GDKBootstrap -> XboxBootstrap autoload, and the GDKPKG_* -> XBOXPKG_*
  packaging env vars. Leads with the ClassDB-vs-singleton gotcha: the singleton
  is still named GDK while its class is now Xbox, so class checks must compare
  against "Xbox".
- tools/migrate_gdk_to_xbox.ps1: codemod for consumer projects, with -WhatIf.
  Rewrites only the renamed API surface by explicit name list; a project's own
  Gdk-prefixed names need -RenameProjectGdkNames. Bare GDK is left alone (it is
  still the singleton) and genuinely ambiguous type positions and class checks
  are reported for manual review. All matching is case-sensitive so lowercase
  godot_gdk paths are never touched.
- CHANGELOG.md: new, seeded with v0.1.0 / v0.2.0 and a v0.3.0 section led by
  the breaking rename.
- Addon versions 0.1.0 / 0.1.0-dev -> 0.3.0 across the four source plugin.cfg
  files; the sample/ and tests/ mirrors are gitignored and regenerated by the
  CMake sync. Added <Version>0.3.0</Version> to both C# facade csproj files.
- Fixed two stragglers the rename missed: a GDKResult reference in
  docs/gdk/api-reference.md and GDKExportPlatform in docs/gdk/editor-tools.md.
- README and docs/README.md now link the migration guide.

Validation (local, in-worktree, Godot 4.6.2-stable):
- tools/check_gd_scripts_headless.ps1: pass
- tools/run_all_tests.ps1: Overall pass (gdk 330, playfab 84, gameinput 60;
  16983 asserts; C++ doctest; all bootstrap runners). Offline tier only.
- tools/run_csharp_tests.ps1: 107/107 pass
- tools/package_addons.ps1 -Configuration Both -Reconfigure: pass (154 files)
- tools/export_samples.ps1: all four GDScript tracks export
- dotnet build of all four C# tutorial projects: pass
- doc_classes <-> ClassDB parity: 48 registered / 47 documented, identical to
  main's baseline; the undocumented one is the internal XboxPendingSignal.
- Codemod verified by replaying it over main's pre-rename sample/ tree: 121 of
  122 files byte-identical to the hand-renamed branch. The one difference is a
  private method named OnGdkRuntimeError, where Gdk is infixed rather than
  prefixed - out of scope for an automated codemod.

Live tier not run here; see the PR body for the live-coverage decision.
Godot 4.5.x and 4.7.1 legs are left to the CI PR gates (only 4.6.2 is
installed locally).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: b371b3be-8e04-4791-83c7-4ee613005e10
@jameslen-atg
James Lenell (jameslen-atg) requested review from a team and a lite review from Copilot August 17, 2026 21:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

Copilot AI review requested due to automatic review settings August 17, 2026 21:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

State the motivation for the GDK* -> Xbox* rename in the three places a
consumer is likely to hit it first: the README breaking-change banner, the
v0.3.0 CHANGELOG entry, and the migration guide.

The rename exists so this addon can enable console support inside compatible
Godot forks. Those forks supply the console platform layer and register their
own types, and the GDK* prefix collided with names they already use. Godot
registers extension classes in a single flat ClassDB namespace, so two
providers exposing the same name cannot coexist in one project. The Xbox*
prefix keeps this addon's script-visible types distinct so it can be dropped
into such a fork instead of being blocked by a name conflict.

Each location also notes that Godot itself is unchanged by this: engine
console support comes from those forks, not from this repository, and within
this repo the rename carries no runtime behavior change.

The docs also state that a single binary covers both PC and console: there
is no separate console compilation, build preset, or conditional define.
godot_gdk.gdextension declares only the windows.*.x86_64 libraries, and a
console-capable fork loads those same binaries.

Docs-only change; no .gd files touched, so the parse gate does not apply.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: b371b3be-8e04-4791-83c7-4ee613005e10
Copilot AI review requested due to automatic review settings August 17, 2026 21:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

@jameslen-atg James Lenell (jameslen-atg) changed the title refactor(gdk)!: rename GDK* classes to Xbox* for addon console compatibility (v0.3.0) refactor(gdk)!: rename GDK* classes to Xbox* to avoid collisions with console-capable Godot forks (v0.3.0) Aug 17, 2026
@jameslen-atg
James Lenell (jameslen-atg) merged commit 6aa211c into main Aug 18, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants