A trasport layer for Unity Netcode for Game Objects implemented using Epic Online Services' P2P Sockets
- Open Package Manager window (Window > Package Manager)
- Click the
+
button in the upper-left of the window, and select "Add package from git URL..." - Enter the following URL and click
Add
button
https://github.com/linkoid/EpicTransport-for-UnityNGO.git?path=/netcode.transport.epic
This reposity only provides the transport layer that uses Epic Online Services.
The EOS SDK will need to be downloaded and set up manually.
- Install the EpicTransport-for-UnityNGO package (see above).
- Add the EOS C# SDK to the project.
- Download the EOS CSharp SDK. (Make sure to select C# from the dropdown.)
- Unzip the downloaded zip file.
- Create a new folder in the project's Assets folder named Plugins, and then a new folder named EOSSDK inside of the Plugins folder.
- Copy the SDK/Bin folder and SDK/Source folder from the unzipped folder into Assets/Plugins/EOSSDK/Bin and Assets/Plugins/EOSSDK/Sourc
- Create an assenbly definition for the EOSSDK named Epic.OnlineServices.
- Inside the Assets/Plugins/EOSSDK folder, (Right click > Create > Assembly Definition).
- Rename the newly created assembly definition file to "Epic.OnlineServices".
- Delete files that won't be used on your platform from the Assets/Plugins/EOSSDK/Bin folder.
- For Widows, you would delete everything in the Bin folder except
EOSSDK-Win64-Shipping.dll
. - If you intend to support multiple platforms later, you can read about configuring plugin platforms here: Import and configure plug-ins.
- For Widows, you would delete everything in the Bin folder except
- Continue following the steps for creating the
EOSSDKComponent
and Initializing the SDK on the EOS C# Example Documentation.- The EOS documentation might show a different folder structure, but keep the folder structure specified in this README.
- A simple but complete implementation of the
EOSSDKComponent
can be copied from the Epic Transport Example Project.
The EpicTransport component works with the NetworkManager component. The EOS SDK needs to be intialized and a user must be logged in before attempting to use EpicTransport. You can find an example of this process in the Epic Transport Example Project.
- Setup a NetworkManager to use EpicTransport.
- Create a new game object and add a NetworkManager component to it.
- In the NetworkManager component, there should be a "select transport" dropdown.
Select
EpicTransport
from that dropdown.
- Set the
PlatforInterface
andLocalUserId
of the EpicTransport component after the user has logged in.- There are multiple different ways of doing this, but it is recomended to use the
IPlatformInterfaceProvider
andILocalUserIdProvider
- A good place to implement these interfaces is on the
EOSSDKComponent
. An example of this can be seen in the Epic Transport Example Project.
- There are multiple different ways of doing this, but it is recomended to use the
- Set the
HostUserId
of EpicTransport if you are connecting to a host.- This will most likey have to be done using a string, in which case use
EpicTransport.SetHost()
.
- This will most likey have to be done using a string, in which case use
- Finally, start the NetworkManager as normal.