Hello all!
This is a Mirror Transport for Epic Online Service (EOS) originally created by FakeByte. Unfortunately, our dear friend is no longer at Mirror, so the transport was left abandoned. But no worries! This transport will be supported as long as my project uses it!
For a quick tutorial on how to get set up, feel free to follow this Video Tutorials
- PC
- MacOS
- Android
- iOS
- Mirror (Documentation)
- Epic Online Services C# SDK (Documentation)
You'll need these keys to access the Services! If you have them already, then ignore this step
- Login to the Epic Games Dev Portal with an Epic Games Account
- Create a new Product
- Go to Product Settings -> Clients and add a new Client Policy
- Name your Client Policy and set the Client Policy Type to Peer2Peer, then Save & Exit
- Add a new Client
- Name your Client and set the Client Policy to the Client Policy you just created, then Save & Exit
- Go to Epic Account Services -> Configure Application
- Set Application Name to what you want your users to see when signing in with the Account Portal, then Save Draft
- Go to Permissions and set all permissions to Required, then Save
- Go to Clients and set the Client to the Client you just created, then Save
- Go back, then click Back to Organization
- Go to SDK -> SDK Credentials -> Get Credentials
- Copy and paste all of your credentials into the EOS API Key Asset once your project is set up
- Install Mirror into your project
- Install Mirror Asset Store Page
- Import Mirror into your project
- (Window -> Package Manager -> Packages: My Assets -> Mirror -> Download)
- Import the EOSTransport into your project
- Download the EOSTransport project onto your desktop
- Unzip it
- Copy the following directories into your Assets Folder (merge with already existing folders)
- Mirror
- Plugins
- Sample_Transport (optional)
- Create your EOS API Key
- Right click in the Project View and create an EOS API Key Asset (Create -> EOS -> API Key)
- Fill out all the SDK keys on the EOS API Key Asset, you can find them in the Epic Online Services Dev Portal (SDK -> SDK Credentials -> Get Credentials)
Provided to you in the Sample_Transport directory is a scene that shows you what is needed on a gameobject in order for this transport to work.
Please note that you'll need two devices to test this transport!
-
Start the lobby as a Host Player
- On your first computer, open the Sample_Transport/SampleScene
- Click on the _NetworkManager object
- Scroll down to the EOSSDK Component and be sure to set the Api Keys slot to the one you set in Step 2.3
- Click play
- When the game starts, click "Host"
You will see in the log the following message: "EOS User Product ID: 00020000000000000000000000000" That long string is your PID! That's the number your second device will use to connect to this Host Player!
-
Join the lobby as a Client Player
- On your second computer, open the Sample_Transport/SampleScene
- Perform the same steps as above but thsi time, instead of clicking "Host", fill out the text field with the Host Player's PID and click "Client"
- If successful, you should be connected to the Host Player
- Press the "A" to move left, "D" to move right on both computers to see the player moving on the screen
- Install the Android Module through Unity Hub
- In File -> Build Settings, switch platform to Android
- In Unity -> Edit -> Project Settings... -> Player -> Android -> Other Settings -> Identification set Minimum API Level to Android 6.0 'Marshmallow' (API Level 23) as required by the EOS Android SDK
- (Optional) Install Android Logcat through Package Manager to see logs when running on Android device over USB (Window -> Package Manager -> Packages: Unity Registry -> Android Logcat -> Install) then open with Alt+6 or Window -> Analysis -> Android Logcat
Source: https://www.youtube.com/watch?v=Z-gija1aAhw
- Unity
- Install the iOS Module through Unity Hub
- In File -> Build Settings, switch platform to iOS
- Set up your Player Settings - iOS to whatever you need it to be (it is simpler than Android)
- Build the project
- XCODE application
- Open XCODE app on your Mac
- Open the folder where your Unity IOS build is
- When the project is opened in XCODE, click the top folder in the hierarchy (mine says: "Unity-iPhone")
- CLick Signing & Capabilities
- At the top-center of XCODE, be sure your connected iPhone is selected, not your Mac!
- Check Automatically manage signing
- Set your Team
- Click the Play button and Xcode will compile the project, sign it, and deploy it onto your device.
Change the Auth Interface Credential Type and Connect Interface Credential Types on the EOSSDKComponent to suit the needs of your project
Running multiple instances of your game on one device for testing requires you to have multiple epic accounts. Even if your game doesn't use epic accounts you will need them for testing.
- Add all epic accounts you want to test with to your organization in the dev portal
- On the EOSSDKComponent under User Login set Auth Interface Login to true
- Choose 'Developer' as Auth Interface Credential Type
- Choose 'Epic' as Connect Interface Credential Type
- Open the epic transport folder with a file explorer and go into the DevAuthTool folder
- Create a folder that ends with ~ e.g. Tool~, this makes unity ignore this folder
- Unzip the dev auth tool for your OS (Mac/Win) into the folder you created in step 5.
- Run the dev auth tool
- Enter a port in the dev auth tool
- Login to your epic account and give the credential a name
- Repeat step 9 for as many accounts you want to use
- On the EOSSDKComponent set the port to the one you used in the dev auth tool
- On the EOSSDKCOmponent set Dev Auth Tool Credential Name to the named you chose in the tool
Note: In the editor after logging in with the dev auth tool you cant change the credential name as the sdk stays initialized even after finish playing. You either have to restart unity or the dev auth tool. For builds it is useful to set delayed initialization on the EOSSDKComponent to true and then provide a user input field to set the dev tool credential name and then calling EOSSDKComponent.Initialize().
FakeByte: "Big thanks to erikas-taroza aka TypicalEgg for his help in improving and extending this transport!"
Me: "Big thanks to FakeByte for creating this transport, which I simply just updated and expanded on