Platform Implementation for EOS

Guidelines and references for implementing EOS SDK on consoles

5 mins to read

To run the Epic Online Services (EOS) SDK, you must follow several prerequisite steps in your project's linking, packaging, and loading processes to ensure that your target platform loads and runs the EOS run-time. This page provides generic information about those processes, while the pages listed under Platform-Specific Documentation provide more specific information about each platform's needs. This page also includes information about how to use the Unreal Build System with EOS SDK.

For documentation regarding the EOS SDK and consoles (PlayStation, Xbox, Nintendo Switch, etc), you must configure your organization access and the documentation will be part of the SDK drop after First Party approval.

Console Platform Versions

The current EOS SDK supports the following console platform versions:

Console Platform Latest Version Minimum Version
PlayStation 4 Orbis v10.008.001 Orbis v9.508.001
PlayStation 5 Prospero v6.00.00.38 Prospero v5.00.00.33
Xbox GDK June 2022 QFE2 (220602) March 2022 QFE1 (220301)
Nintendo Switch 14.3.0 13.3.2_4.6.6

Thread Safety

The EOS SDK is not considered thread safe.

You should make all calls on the same thread. Some functions assert and crash if called from different threads.

Building

All EOS SDK headers include the eos_base.h header, but some platforms need additional setup before you can call eos_base.h. Each platform needing additional setup mentions this within the Platform-Specific Documentation and has a <Platform>/eos_<Platform>_base.h file for this additional setup.

Using eos_platform_prereqs.h

The EOS SDK provides the eos_platform_prereqs.h header to support cross-platform development. To use eos_platform_prereqs.h, add the EOS_BUILD_PLATFORM_NAME macro when building applications that need to include a specific platform.

Include the eos_platform_prereqs.h header before any other EOS SDK headers.

For example, if you are using the Unreal Build System, add the following code to your <Project>.Build.cs file:

Add the following #includes when using the different EOS interfaces:

For eos_[interface]_types.h, replace [interface] with the interface you are using:

Custom Cross-Platform Example

If eos_platform_prereqs.h doesn't fit with the project's build system, it can reference macros provided by custom compilers. For example:

Single Platform Example

When a single platform needs additional #includes for the EOS Friends Service, use the following:

For eos_[interface]_types.h, replace [interface] with the interface you are using:

Linking

When linking your project, you need to add the link-time library for EOS SDK to the link command for your project. For most platforms, the run-time library will need to be loaded manually as well.

Linking with Unreal Build System

If you are using Unreal Engine, the Unreal Build Tool will manage the linking and packing of your library if you follow these steps in the <Project>.Build.cs file:

  1. Add the library link-time name to PublicAdditionalLibraries.
  2. Add the library link-time file to RuntimeDependencies.

As an example, your <Project>.Build.cs file should include code similar to the following:

Packaging

In most cases, placing the run-time library for EOS SDK in the same directory as the game executable will ensure that the game can find it at run-time. Some platforms have specific directories you need to place their libraries in. Review the platform-specific pages for more details.

Loading

Some platforms require you to load the dynamic module for EOS SDK explicitly at runtime. Refer to the platform-specific pages for details on how to do this with each platform. If no process is noted, then explicit loading is not necessary.

Loading with Unreal

As long as you use the Unreal Build Tool to set up the packaging of your game, the same process can be used on all platforms. Use FPlatformProcess::GetDllHandle to load the module and FPlatformProcess::FreeDllHandle to unload the module.

Memory Functions

The EOS SDK can use any memory management system you develop when you provide custom allocators through EOS_InitializeOptions. If allocators are not provided, the EOS SDK uses standard allocators, such as malloc, free, and realloc.

However, consoles are the exception and require custom allocators. Memory management on consoles is a complex and highly platform-dependent process. To prevent any unexpected behavior, consoles are required to provide these custom allocators to ensure all memory management is by the application. For a detailed explanation of how memory management works for your current platform, please refer to the first party SDK documentation.

Memory Functions with Unreal

When using Unreal Engine with the EOS SDK, the allocators provided to EOS_InitializeOptions can be mapped to FMemory::Malloc, FMemory::Realloc, and FMemory::Release.

Platform-Specific Documentation

The following links provide guidelines for the above processes on specific platforms:

Using EOS SDK on Android

How to implement EOS SDK in an Android project with Android Studio

Using the Android SDK Samples

An overview of the Android login sample

Using EOS SDK on iOS

How to implement EOS SDK in an iOS project using Xcode

Using the iOS SDK Samples

An overview of the iOS samples and Apple login flow

Using EOS SDK on Linux

Reference information for implementing EOS SDK on Linux

Using EOS SDK on Mac

Reference information for implementing EOS SDK on MacOS

Using EOS SDK on Windows

Reference information for implementing EOS SDK on Windows

Using EOS SDK on Playstation 4

Reference information for implementing EOS on Playstation 4

Using EOS SDK on PlayStation 5

Reference information for implementing EOS on PlayStation 5

Using EOS SDK on Nintendo Switch

Reference information for implementing EOS on Nintendo Switch

Using Epic Online Services (EOS) with the Xbox XDK

Reference information for implementing EOS on Xbox One

Using EOS SDK on Xbox GDK

Reference information for implementing EOS with the Xbox GDK