A gdnative plugin for Godot's UWP export to add xbox live integration

Overview

GodotXbox

Current instructions for setting up DLL, steps to setup project for contributing/modifying are coming soon.

It should be noted that Godot's UWP export is currently not in a stable state. There are work-arounds for many of the problems, but you may encounter some bugs that do not have workarounds. Please report such issues to Godot's official repository.

Setup

  1. Add the godot_xbox dll to your project.
  2. Setup a gdnlib file to link to the dll.
  3. Setup a gdns file fo both the Xbox class and ConsoleCloser class.
  4. Create instances of nodes for both classes. These can be autoloads or instanced in a scene that wont be going away.

GodotXbox will attempt to sign in silently once the node hits its _ready(). If a silent sign-in fails you will be required to tell the DLL to sign in manually.

Reference

Methods

  • void SignInManually() Call this to tell windows to attempt to sign you in manually. If you are not already signed in, this should create a popup asking you to sign in.
  • bool IsSignedIn() Returns whether the current user is signed in. If there is no user, returns false.
  • String GetGamertag() Returns the currently signed in user's gamertag if a user is signed in, otherwise returns an error message.
  • void SetStat(String statName, Variant statValue) Set the currently signed in user's stat. Use the leaderboard stat ID created in Partner Center. Valid value types for statValue at this time are floats and integer.
  • void DeleteStat(String statName) Deletes the user's current stat.
  • void QueryLeaderboard(String statName, int maxItems = 0) Try to fetch the leaderboard with the given name. Setting maxItems a number higher than 0 will limit the amount of returned leaderboard values to that amount.
  • void QueryLeaderboardSkipToRank(String statName, int rank, int maxItems = 0) Try to fetch the leaderboard with the given name and skips to rank in leaderboard. Setting maxItems a number higher than 0 will limit the amount of returned leaderboard values to that amount.
  • void QueryLeaderboardSkipToSelf(String statName, int maxItems = 0) Try to fetch the leaderboard with the given name and skips to current user's position. Setting maxItems a number higher than 0 will limit the amount of returned leaderboard values to that amount.
  • void QueryLeaderboardForSocialGroup(String statName, String socialGroup, int maxItems = 0) Try to fetch the leaderboard with the given name and xbox live social group. Setting maxItems a number higher than 0 will limit the amount of returned leaderboard values to that amount.
  • Array GetLeaderboardEntries() Returns the most recently queried leaderboard entries as an array of dictionaries. Each dictionary represents an entry with keys "gamertag", "score", "rank", and "ID". Every value for these keys are strings except for rank, which is an int.
  • Variant GetStat(String statName) Gets a user's stat and returns it as a Godot Variant. Returns -1 if user isn't signed in or if there is an error. Returns "undefined" if the stat hasn't been set.

Signals

  • signed_out Called when the user gets signed out.
  • signed_in Called when the user successfully signs in.
  • signin_failed Called when the signin fails. This would be when you have to handly signing in manually if a silent sign in fails, for instance.
  • leaderboards_ready Called when a leaderboard query has completed. Passing in a Dictionary with a single key "entries" and value of type Array. The Array is an Array of Dictionary entries. See GetLeaderbaordEntries() for info on these entries.
  • stat_user_added Called when the local user is added to the xbox live stats manager. Don't attempt to query leaderboards or update/get stats for a player before this is called.
  • stat_user_removed Called when the local user is removed from the xbox live stats manager. Don't attempt to query leaderboards or update/get stats for a player after this is called.
  • player_stats_updated Called when a SetStat() has completed successfully and player's stats are updated on the leaderboard.

Exporting

Currently the steps to export are a bit convoluted due to issues with Godot's UWP export, but to do so:

  1. Export to UWP from godot with x64 set and in Debug mode.
  2. Take the resulting appx and run the following command with 7zip: 7z x YourAPPX.appx -oYourAPPX.
  3. Delete the old appx package.
  4. You will see that your DLL has been deleted in the unzipped file. Godot deletes DLL files as it assumed that they will be placed next to the binary like with normal windows export. Take the DLL from your project and paste it into the same path as it was in your original project, but relative to the game folder of the unzipped Appx file.
  5. Place an xboxservices.config file in the root of the unzipped appx file. The contents of the config file should be as follows.
{
	"TitleId" : "YOUR_TITLE_ID",
	"PrimaryServiceConfigId" : "YOUR_SCID",
	"Sandbox ID" : "YOUR_SANDBOX_ID",
	"XboxLiveCreatorsTitle" : true
}

Grab the title, scid, and sandbox ID from your partner center panel, where you configure your game. If you aren't familiar with that you should read up on the Docs.

  1. Use MakeAppx.exe to pack up the contents of your unzipped package with the command MakeAppx pack /d YourAPPX /p YourAPPX.appx.
  2. Use signtool to sign the package with a trusted .pfx certificate SignTool sign /fd SHA256 /a /f TrustedCert.pfx /p 111 YourAPPX.appx.
  3. Install your appx after enabling your sandbox and test environment on the partner center and you should be able to sign in.

ConsoleCloser?

The ConsoleCloser class is currently used for a workaround to a known issue with the UWP export. It doesn't help with authentication or xbox live integration.

Currently exported Release UWP application crash on startup no matter what due to a longstanding issue with Godot's UWP export using subsystem/WINDOWS. To work around this on a release build, you can use EDITBIN on your unzipped appx file with the command EDITBIN /subsystem:CONSOLE godot.uwp.exe. This will convert the subsystem with godot to work off the CONSOLE subsystem, and circumvent the problem. Unfortunately, this also causes the console to open when running the appx and remain open. ConsoleCloser fixes this by calling FreeConsole on its init(). Just add ConsoleCloser to an autoload scene and the console should close on release builds shortly after booting without problem. This class will be removed as soon as that bug is fixed, but since it has been a problem for a long time, this seemed necessary.

Demo

There is a minimal demo included in the demo folder that contains everything you should need to get started on your project, including both authentication and leaderboards. To use the demo you will first need to setup a game on the Xbox Partner Center and enable Xbox Live Services for it. You will also need to add a leaderboard called "HighScore" with an integer format and click the "Test" button on the bottom of the Xbox Services page. Afterwards, just open the game in godot and fill in the export settings using the information from your Partner Center dashboard, including your game's unique name, publisher ID, publisher display name, and GUID. Then export as described above. To test you will need to open up your Windows Developer Settings, enable developer mode and connect to the device portal. In the device portal you can go to the Xbox Live tab and enter in the sandbox ID found on your partner center dashboard in the xbox services section. Once in your sandbox you should be able to to test on PC. To test on Xbox you will need to activate developer mode on your Xbox and follow the instructions dev mode gives you to test your game there.

You might also like...
A blender import/export system for Defold

defold-blender-export A blender import/export system for Defold Setup Notes There are no exhaustive documents for this tool yet. Its just not complete

(C++) Integrity dynamic link library made in C++ that you can export to C#

C-Integrity-Library ✔ (C++) Integrity dynamic link library made in C++ that can export to C# C# Exports [DllImport("Exports.dll")] public static exter

a convergence of ideas. read-only fossil export

MNOLTH A convergence of ideas. Mnolth is the core environment I use for composing computer music, as well as the multimedia that occasionally accomp

A tool to convert Call of Duty XBIN/EXPORT files to and from each other.

exportxbin exportxbin is an enhanced version of export2bin included in the Call of Duty: Black Ops III Mod Tools. Its main goal is to provide users wi

This repo contains example software for the Kernelcon 2021 Hack Live! badge - the Hacker HotKey.
This repo contains example software for the Kernelcon 2021 Hack Live! badge - the Hacker HotKey.

Hacker HotKey This repo contains example software for the Kernelcon 2021 Hack Live! badge - the Hacker HotKey. Default Hotkey Mapping Hacker Hotkey is

WIP - Material para uma live stream que estou preparando

C para devs PHP ATENÇÃO: Este projeto ainda está em progresso. A estrutura e conteúdo aqui provavelmente ainda estão muito confusas. Eu não recomendo

A demo of the relevant blog post: Hook Heaps and Live Free
A demo of the relevant blog post: Hook Heaps and Live Free

LockdExeDemo A demo of the relevant blog post: Hook Heaps and Live Free DEMO Explanation There are 2 compile types. The first is an EXE. The EXE requi

Wtf Riot? I just want to close League of Legends and live my life. Leave me alone. F*ck corporate adware.

RiotKiller Wtf Riot? Anyways... This application launches League of Legends by calling RiotClientServices.exe --launch-product=league_of_legends --lau

Live wallpapers for the X window system
Live wallpapers for the X window system

xlivebg - live wallpapers for the X window system About xlivebg is a live wallpaper framework, and collection of live wallpapers, for the X window sys

Comments
  • How to compile?

    How to compile?

    I need to add some more stuff, but I can't get self-compiled dll to work on Xbox. It does work on PC, and dll provided does work on both, but I get Error 126: The specified module could not be found. on Xbox with my own dll.

    opened by TimPhoeniX 2
Releases(1.0)
  • 1.0(May 14, 2021)

    This release adds the ability to use Leaderboards, changes the previous "SignIn" class to "Xbox" since it is no longer used for only signing in, and has a few quality of life improvements. Check documentation/readme for info on how to get started.

    Source code(tar.gz)
    Source code(zip)
    godot_xbox.dll(12.46 MB)
  • v0.1-alpha(May 3, 2021)

Owner
Cregg Hancock
Junior Developer at Simutronics and founder/developer of Lostlight Studio
Cregg Hancock
Collection of DLL function export forwards for DLL export function proxying

dll-exports Collection of DLL function export forwards for DLL export function proxying. Typical usecase is for backdooring applications for persisten

Magnus Stubman 58 Dec 6, 2022
Pure Data patch export to lv2 plugin using heavy compiler + dpf example

Pure Data patch export to lv2 plugin using heavy compiler + dpf example Work in progress - Takes an audio input and writes to a 0.5 seconds buffers. 4

Qwrtst 3 Dec 27, 2022
A draft C++ app to run Linux files, made in UWP for my own learning experiment

FLinux : Uncompleted port of FLinux to UWP... About A draft C++ app to run Linux files, made in UWP for my own learning experiment What is it? As a wa

Media Explorer 1 Jan 26, 2022
This plugin enables the use of Live++ by Molecular Matter inside of Cryengine.

Live++ // CRYENGINE This plugin enables the use of Live++ by Molecular Matter inside of Cryengine. Live++ allows for easy hot-reloading and on the fly

Philipp Gehring 5 Dec 4, 2019
Dump the ROM from an Original Xbox DVD Movie Playback IR Dongle

Dongle Dumper. Dump the firmware off a Original Xbox DVD Movie Playback Dongle straight from the console. The dongle contains a ROM with an XBE which

null 13 Dec 29, 2022
Sea of Thieves - Advanced ESP /w ImGui for XBox Version (Steam has to be written)

??‍☠️ Sea of Thieves - External Tool Premium Sea of Thieves - Advanced ESP /w ImGui for XBox Version (Steam has to be written) How to: Check latest ga

Kamil 12 Sep 21, 2022
Use Nintendo Switch JoyCons as a virtual Xbox 360 controller in Windows

XJoy XJoy allows you to use a pair of Nintendo Joy-Cons as a virtual Xbox 360 controller on Windows. XJoy is made possible by ViGEm and hidapi. Suppor

DuroSoft 357 Jan 3, 2023
📃 Export WeChat chat histories to HTML files.

wechat-export Export WeChat chat histories to HTML files. Preview This script generates a HTML file for each contact's chat history. Currently it supp

Zihua Li 607 Dec 15, 2022
Unix pager (with very rich functionality) designed for work with tables. Designed for PostgreSQL, but MySQL is supported too. Works well with pgcli too. Can be used as CSV or TSV viewer too. It supports searching, selecting rows, columns, or block and export selected area to clipboard.

Unix pager (with very rich functionality) designed for work with tables. Designed for PostgreSQL, but MySQL is supported too. Works well with pgcli too. Can be used as CSV or TSV viewer too. It supports searching, selecting rows, columns, or block and export selected area to clipboard.

Pavel Stehule 1.9k Jan 4, 2023
Get air quality & CO2 data from SM300D2 & Senseair S8 with ESP32, and export as OpenMetrics (Prometheus exporter) via WiFi.

ESP Air Sensor Get air quality & CO2 data from SM300D2 & Senseair S8 with ESP32, and export as OpenMetrics (Prometheus exporter) via WiFi. I used to h

Shell Chen 4 Feb 6, 2022