This is a community maintained repo forked from RayStorm.
Mirror docs and the official community Discord.
FizzySteamworks brings together Steam and Mirror . It supports both the old SteamNetworking and the new SteamSockets.
FizzySteamworks is obviously dependant on Mirror which is a streamline, bug fixed, maintained version of UNET for Unity.
FizzySteamworks relies on Steamworks.NET to communicate with the Steamworks API, so you will need that installed and initalized properly before you can use this transport.
You have two options to solve this dependency
You can use Heathen's Steamworks Foundation which is an open source Unity Asset that integrates Steamworks.NET into the Unity engine handling most things for you.
B) Raw Steamworks.NET
You can install Steamworks.NET your self and use your own code to initlaize and manage it. Note Steamworks.NET is a C# wrapper around the Steamworks API, not a plug-n-play asset for integrating Steam API.
Steamworks.NET is just a C# wrapper, It does not handle configuraiton, initalization or other aspects around the use of Steam API for you.
Steamworks Foundaiton has its own documentation, discord support, etc. if you have questions on its use please ask them.
Steamworks.NET Requires .Net 4.x so be sure to update your project settings for that
You have two options when installing the transport.
- Open the package manager and click the '+' (plus) button located in the upper left of the window
- Select
Add package from git URL...
when prompted provide the following URL:
https://github.com/Chykary/FizzySteamworks.git?path=/com.mirror.steamworks.net
If you have issues with Unity's Package Manager check out this article on Heathen's Knowledge Base it might help you resolve.
More error prone and subject to being out of date with the latest changes:
- Download the latest unitypackage from the release section.
- Import the package into Unity.
This assumes you have your dependencies installed, configured and working correctly
- Install FizzySteamworks from package manager as discribed in the above Install step.
- In your "NetworkManager" object replace "KCP" with "FizzySteamworks".
When running a server build you need build your server build and it needs to initalize Steam Game Server. NOTE Steam's server APIs are a different set of APIs than those used when running a Client build. To learn more about this please consult Valve's documentation on the subject. If your using Heathen's Steamworks Foundaiton they have documentaiton and discord support for this topic
To have your game working with Steam Networking you need to make sure you have Steam running in the background and that the Steam API initalized correctly. You can then call StartHost and use Mirror as you normally would.
To connect a client to a host or server you need the CSteamID of the target you wish to connect to this is used in place of IP/Port. If your creating a Peer to Peer architecture then you would use the CSteamID of the host Steam User, this is Steam user ID as a ulong value. If you are creating a Client Server architecture then you will be using the CSteamID issued to the Steam Game Server when it logs the Steam API on. This is an advanced use case supported by Heathen's Steamworks but requires additional custom code if your using Steamworks.NET directly.
You cannot test a connection on 1 machine and or with 1 Steam account. To test Steam P2P Networking you must have two machines, two steam accounts and they must both own a license to the game in question.
- Send the game to your buddy.
- Your buddy needs the host or game server steamID64 to be able to connect.
- Place the steamID64 into "localhost" then click "Client"
- Then they will be connected to your server be that your machine as a P2P connection or yoru Steam Game Server as a Client Server connection.
You cant connect to yourself locally while using FizzySteamworks since it's using Steams Networking which runs over Steam Client and addresses its connection based on the unique CSteamID of each actor. If you want to test your game locally you'll have to use "Telepathy Transport" instead of "FizzySteamworks".