Tested on: Windows and Linux
Disclaimer: This project is NOT affiliated with Epic Games Inc or Godot Engine. It doesn't endorse Epic Online Services. This project and sample Godot scenes is provided solely for educational purposes and may or may not comply with Epic Games' Design Guidelines, if you plan to release a game make sure you read the Guidelines and any other steps needed to release a public game like asking for user consent, option to delete user data, website with privacy policy and license, etc.
This project wraps the Epic Online Services C# SDK so that it can be easily used in Godot using GDScript, C#, etc with similar class hierarchy and static type support. It makes use of signals for sending events like user login, logout, achievement unlock, etc.
You need to have the Mono version of Godot to make use of this project. This doesn't mean you have to code in C#. You can code in any language that Godot supports.
-
Mono version (C# support) of Godot Engine (Get it here Godot Engine Download)
Easily convert a GDScript project to Mono (Project menu -> Tools -> C# -> Create C# Solution)
-
EOS C# SDK (Download from Epic Developer Portal)
-
Make sure you have accepted the Terms for Epic Online Services
-
A product registered with Epic Games Services (Make one for free Epic Developer Portal)
-
Download/clone the repo and copy the
EOS
folder to your own Godot project folder. -
Download the
EOS C# SDK
, extract it, and copy and paste theSource
andBin
folders to theEOS
folder in step 1. The EOS folder should look something like this:
-
Open the file,
res://EOS/Source/Core/Config.cs
and paste the following lines at the top and save the fileYou may get a permission warning saying that the file is Readonly. Make sure that the file gets saved/overwritten
#if GODOT_WINDOWS || GODOT_64 #define EOS_PLATFORM_WINDOWS_64 #elif GODOT_X11 #define EOS_PLATFORM_LINUX #elif GODOT_OSX #define EOS_PLATFORM_OSX #elif GODOT_IOS #define EOS_PLATFORM_IOS #elif GODOT_ANDROID || __ANDROID__ #define EOS_PLATFORM_ANDROID #else #error "Godot could not set the EOS target platform." #endif
-
Add the
IEOS.cs
file present inEOS
folder as an autoload (Project Settings -> Autoload). -
You can now use the methods/signals from the
EOS
class in Godot.Minimal Starting Boilerplate (See
Main.gd
andLogsView.gd
for sample)func _ready(): # Initialize the SDK var init_options = EOS.Platform.InitializeOptions.new() init_options.product_name = "PRODUCT NAME HERE" init_options.product_version = "PRODUCT VERSION HERE" var init_result: int = EOS.Platform.PlatformInterface.initialize(init_options) if init_result != EOS.Result.Success: print("Failed to initialize EOS SDK: ", EOS.print_result(init_result)) return # Create platform var create_options = EOS.Platform.CreateOptions.new() create_options.product_id = "PRODUCT_ID HERE" create_options.sandbox_id = "SANDBOX_ID HERE" create_options.deployment_id = "DEPLOYMENT_ID HERE" create_options.client_id = "CLIENT_ID HERE" create_options.client_secret = "CLIENT_SECRET HERE" create_options.encryption_key = "ENCRYPTION_KEY HERE" # Enable Social Overlay on Windows if OS.get_name() == "Windows": create_options.flags = EOS.Platform.PlatformFlags.WindowsEnableOverlayOpengl var create_result: bool = EOS.Platform.PlatformInterface.create(create_options) if not create_result: print("Failed to create EOS Platform") return # Setup Logs from EOS EOS.get_instance().connect("logging_interface_callback", self, "_on_logging_interface_callback") var res: int = EOS.Logging.set_log_level(EOS.Logging.LogCategory.AllCategories, EOS.Logging.LogLevel.Info) if res != EOS.Result.Success: print("Failed to set log level: ", EOS.print_result(res)) func _on_logging_interface_callback(msg): msg = EOS.Logging.LogMessage.from(msg) as EOS.Logging.LogMessage print("SDK %s | %s" % [msg.category, msg.message])
The sample Godot project is located in the Sample folder
Copy the credentials (Product Id, Sandbox Id, Deployment Id, Client Id, Client Secret) for your product from the Dev Portal and paste them in Main.gd
script in the relevant EOS.Platform.CreateOptions
. The encryption key is a random 64 character long string. These credentials need to be kept as private as possible. One way is to make sure to encrypt all scripts when exporting the final game. (See Compiling with script key encryption)
Then configure your Product on the EOS Dev Portal with the following configuration:
-
In the Client Policies section in Product Settings, enable all the features except Connect (Disabled by Epic)
-
In the Permissions section of Epic Account Services, enable all three: Basic Profile, Online Presence and Friends.
-
(Optional if you want some pre-made achievements)
In the Achievements section in Game Services, use the Bulk Import option and import the
HelloProduct.zip
file located atres://HelloProduct.zip
Making this project took a lot of time and effort, reading the EOS documentation countless times and testing each method in Godot. I would really appreciate if you could support the project in any way.
Join the Discord server for discussing suggestions or bugs: 3ddelano Cafe
- Auth Interface
- Implementation
- Sample
- Achievements Interface
- Implementation
- Sample
- Connect Interface
- Implementation
- Sample
- CustomInvites Interface
- Implementation
- Sample
- Friends Interface
- Implementation
- Sample
- Stats Interface
- Implementation
- Sample
- UserInfo Interface
- Implementation
- Sample
- Leaderboards Interface
- Implementation
- Sample
- KWS Interface
- Implementation
- Sample (No general access yet)
- Lobby Interface
- Implementation
- Sample
- Metrics Interface
- Implementation
- Sample
- Mods Interface
- Implementation
- Sample
- P2P Interface
- Implementation
- Sample
- PlayerDataStorage Interface
- Implementation
- Sample
- Presence Interface
- Implementation
- Sample
- ProgressionSnapshot Interface
- Implementation
- Sample
- Reports Interface
- Implementation
- Sample
- RTC Interface
- Implementation
- Sample
- Sanctions Interface
- Implementation
- Sample
- Sessions Interface
- Implementation
- Sample
- TitleStorage Interface
- Implementation
- Sample
- UI Interface
- Implementation
- Sample
- Ecom Interface
- Implementation
- [] Sample (Needs Epic Games Store access)
- AntiCheatServer Interface
- Implementation
- Sample
- AntiCheatClient Interface
- Implementation
- Sample
- Version Interface
- Implementation
- Sample