Skip to content

PlayEveryWare/eos_plugin_for_unity

stable
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
January 3, 2023 17:01
September 22, 2023 11:54
September 22, 2023 11:54

Lobby Screenshot

PlayEveryWare EOS Plugin for Unity




Table of Contents

  1. Overview
  2. Getting Started
  3. Plugin Support
  4. Source Code Contributor Notes
  5. FAQ

Overview


The PlayEveryWare EOS Plugin for Unity is a software development kit (SDK) used for integrating EOS into a Unity project. Bringing the free services that connect players across all platforms and all stores, to Unity in an easy to use package. Find more information on EOS here and Epic docs here.

The eos_plugin_for_unity repository contains the source code for development, samples and support for the PlayEveryWare EOS Plugin for Unity (UPM Package).

Plugin Features: (In Depth Details)

  • Social Overlay support across platforms.
  • Feature specific sample scenes, that include manager classes for common uses of EOS SDK API.
  • Custom Unity Tool for configuring EOS settings and saving to a JSON file.
  • Unity editor playback support, handled by reloading EOS SDK.
  • Most EOS features are accessible by players without an Epic Games Account.

Repo Contents:

  • Additional plugin Documentation can be found in the docs/ directory.
  • A Unity Project for development of feature managers and samples.
  • Native Source for DynamicLibraryLoaderHelper and GfxPluginNativeRender.
  • A Tool to build a Unity Package Manager compatible UPM.

Plugin Details:


Supported Platforms

The support level of each target platform in Unity as of the current release of the plugin.

Supported Preview Unsupported at Present
Unity Editor (No Social Overlay) Linux WebGL
Windows Standalone x64 MacOS Universal Windows Platform x86
Windows Standalone x86 Console Platforms Unity Web Player
Universal Windows Platform x64
Android (No Social Overlay Yet)
iOS (No Social Overlay Yet)

❗ Enable EOS_PREVIEW_PLATFORM to access Preview platforms.


Supported EOS SDK Features

The EOS Plugin for Unity will be updated over time to support the new content as the EOS SDK continues to release new features and functionality.

The support level of each EOS SDK features as of the current release of the plugin.

Supported
Achievements Authentication Ecommerce Friends
Leaderboards Lobby Lobby with Voice NAT P2P
Player Data Storage Presence Sessions Social Overlay/UI Interface (Not Supported in Editor or Mobile)
Stats Title Storage Reports Sanctions
Anti-Cheat Custom Invites Metrics User Info Interface
Connect Interface Logging Interface Platform Interface
Unsupported at Present
EOS Mod SDK Voice Trusted Server Progression Snapshot Interface

The EOS Features Shown by Sample
Sample Name EOS Features
- All Samples - Authentication, Social Overlay, User Info Interface,
Connect Interface, Logging Interface, Platform Interface
Achievements Achievements
Auth & Friends Friends, Presence
Custom Invites Custom Invites
Leaderboards Leaderboards, Stats
Lobbies Anti-Cheat, Lobby, Lobby with Voice
Metrics Metrics
Peer 2 Peer NAT P2P
Performance Stress Test
Player Data Storage Player Data Storage
Player Reports & Sanctions Reports, Sanctions
Sessions & Matchmaking Sessions
Store Ecommerce
Title Storage Title Storage
P2P Netcode NAT P2P
- -
None (Not Supported) EOS Mod SDK, Voice Trusted Server, Progression Snapshot Interface
The EOS Features Shown by Requirement of a Player Needing an Epic Games Account

EOS Game Services can be set up in your game without any requirement for your players to have an Epic Games account. As opposed to EOS Epic Account Services, Which will require your players to have an Epic Games account.

Not Required Required
Achievements Authentication
Leaderboards Ecommerce
Lobby Friends
Lobby with Voice Presence
NAT P2P Social Overlay
Player Data Storage User Info Interface
Sessions EOS Mod SDK (Unsupported)
Stats Progression Snapshot Interface (Unsupported)
Title Storage
Reports
Sanctions
Anti-Cheat
Custom Invites
Metrics
Connect Interface
Logging Interface
Platform Interface
Voice Trusted Server (Unsupported)

Getting Started


Prerequisites


Importing the Plugin

There are two options to install the package, from a tarball [Quickest to start], or from a GIT URL [Quickest for updates].

Adding the package from a tarball


  1. Download the latest release tarball, "com.playeveryware.eos-[version].tgz" here.

    ❗ If one uses the source download it will be missing all the git-lfs files (i.e. binaries, dynamic libraries).

  2. Move the downloaded tarball into your project folder, but outside of the Assets folder.

  3. From the Unity Editor, open the Package Manager.

    • Window -> Package Manager

      unity tools package manager

  4. Click the + button in the top left of the window.

    Unity Add Tarball Package

  5. Select Add package from tarball.

  6. Navigate to the directory containing the tarball, select and Open the tarball.

  7. After the package has finished installing, import the samples.

  8. Finally, configure the plugin.

❗ The Unity doc for adding a tarball can be found here.


Adding the package from a git URL


  1. Setup Unity for Git Dependency.

  2. Install git and git-lfs.

  3. From the Unity Editor, open the Package Manager.

    • Window -> Package Manager.

      unity tools package manager

  4. Click the + button in the top left of the window.

    Unity Add Git Package

  5. Select Add Package from Git URL.

  6. Paste in git@github.com:PlayEveryWare/eos_plugin_for_unity_upm.git or https://github.com/PlayEveryWare/eos_plugin_for_unity_upm.git.

  7. After the package has finished installing, import the samples.

  8. Finally, configure the plugin.

❗ The Unity doc for adding a git url can be found here.


Samples

Lobby Screenshot Achievements Storage Screenshot

The included samples show examples of fully functional feature implementation to validate client and dev portal configuration as well as help with EOS integration into your own project. The samples are a collection of scenes that are imported from the UPM package, and include a series of scripts that function as generalized managers for each supported EOS SDK feature and platform.

❗ The generalized managers are a great starting point for feature integration into your own project. They are named as EOS[Feature/Platform name]Manager.cs.


Importing the samples


  1. Select the PlayEveryWare EOS Plugin for Unity in the Package Manager window.

    Unity Install Samples

  2. Open the Samples dropdown.

  3. Select Import for each of the sample packs, to bring in the Sample scenes.

    ❗ The samples are placed in Assets/Samples for personal modification.

  4. In the Unity editor menu bar, open File->Build Settings.

  5. In the Project window, navigate to the scenes folders containing their respective sample scenes. \Assets\Samples\PlayEveryWare EOS Plugin for Unity\[Version #]\[Pack Name]\Scenes.

  6. Add the scenes to the Scenes In Build section of the Build Settings window. This can be done quickly by using the Shift key to select each scene at the same time, then dragging them into the proper area. Repeating for each sample pack folder.

    ❗ If you have other scenes already, and plan to look at the samples in a build, drag a sample scene to be the 0th scene in Build Settings before you build.


Running the samples

❗ The plugin must be configured for samples to be functional.

❗ Some Samples may not be accessible if the extra packs were not imported, or the scenes weren't added in the build settings.

Sample walkthroughs can be found here.

Steps to run a sample in editor

❗ The Social Overlay Feature is not supported in editor.

  1. In the Unity editor, open the desired sample scene from the imported Scenes folder.

  2. Press the play button at the top of the editor.

  3. Login with a selected authentication type.
    Account Portal and then PersistentAuth is easiest for the first time. Dev Auth can be used for quicker iteration, among other options described here, to explore features that don't require an Epic Games Account, or the options to choose for closer representation to the user experience on specific platform releases.

    Auth and Friends Screenshot

Steps to run a sample from a build

❗ Check the Prerequisites as there may be specific requirements for a player's computer. Windows, for instance, requires the players to have The latest Microsoft Visual C++ Redistributable installed on their computer in order to play any distributed builds.

  1. In the Unity editor menu bar, open File->Build Settings.

    ❗ If you have non-sample scenes, drag a sample scene to be the 0th scene in Build Settings before you build.

  2. Choose your desired platform, and settings, hitting Build as you normally would.

  3. Run your build.

    ❗ A Windows build, is started by running the EOSBootstrapper application in the resulting build, and not the game application itself. it is for this and similar reasons that the Build And Run button may not always function as it usually would.

  4. Login with a selected authentication type.
    Account Portal and then PersistentAuth is easiest for the first time. Dev Auth can be used for quicker iteration, among other options described here, to explore features that don't require an Epic Games Account, or the options to choose for closer representation to the user experience on specific platform releases.

    Auth and Friends Screenshot

❗ Additional info on login type options, implementation, and use cases can be found here.



Configuring the Plugin

To function, the plugin needs some information from your EOS project. Epic Docs on how to set up your project can be found here.

Configuration Steps

  1. In the Unity editor menu bar, open Tools -> EpicOnlineServicesConfigEditor.

    EOS Config Menu

  2. From the developer portal, copy the configuration values listed below, and paste them into the similarly named fields in the EOS Config Editor window, under the Main portion of the config:

    ❗ Addtional information about configuration settings can be found here.

    • ProductName
    • ProductVersion
    • ProductID
    • SandboxID
    • DeploymentID
    • ClientSecret
    • ClientID
    • Encryption Key

      ❗ Click the Generate button to create a random key, if you haven't already configured an encryption key in the EOS portal.
      The Encryption Key is Used for Player Data Storage and Title Storage, if you do not plan to use these features in your project or the samples, and don't want to create an Encryption Key, then the field must be left blank.

    EOS Config UI

  3. Press Save All Changes.

  4. Navigate to Packages/Epic Online Services for Unity/Runtime via the Project window.

  5. Add the EOSManager.prefab, to each of your game's scenes.

  6. Simply attach EOSManager.cs (Script) to a Unity object and it will initialize the plugin with the specified configuration in OnAwake().

    ❗ The samples already have this done!


Disable on selected platforms

See docs/disable_plugin_per_platform.md for this feature.


Plugin Support


PlayEveryWare EOS Plugin for Unity API Documentation can be found at https://eospluginforunity.playeveryware.com.

For issues related to integration or usage of the Unity plugin, please create a New Issue under the Issues tab in the github repo.

For issues related to Epic Online Services SDK, Epic Dev Portal or general EOS SDK information, please go to Epic Online Services Community Support.

Detailed descriptions and usage for EOS SDK Interfaces, can be found at EOS Developer Documentation: Game Services.


Source Code Contributor Notes


The following are guidelines for helping contribute to this open source project.

Contributor Prerequisites

  • Ensure At least Visual Studio 2017 is installed.
  • Ensure At least Unity 2020.1.11f1 is installed.
  • Ensure required Platform SDKs are installed (Windows, Linux, macOS, Android, iOS, Consoles).
  • The repository cloned locally https://github.com/PlayEveryWare/eos_plugin_for_unity.

Build steps For Native Libraries

Build the Visual Studio solutions for the native DLLs, extra platform specific instructions may be located in the docs for that platform.

  1. In your local repository, navigate to the DynamicLibraryLoaderHelper folder of your platform choice in NativeCode.

    ❗ These files are not included with the package imported via tarball or git url.

  2. Open and build the DynamicLibraryLoaderHelper.sln in Visual Studio.

    ❗ A successful build will place the correct binaries in the proper locations for Unity to initialize EOS SDK.

Coding Standards

See standards.md.

Class description

See docs/class_description.md.


FAQ


See docs/frequently_asked_questions.md.