Here is my Steamworks integration for Netcode for Entities and Transport. Use as you like.

Hi guys,

I don’t really have time to write up a well documented set of instructions for this, but I keep seeing this be asked about and I don’t want to leave everyone hanging, so here is a dump of my Networking assembly which implements an integration of Steamworks in unity Netcode/Transport. Everything works as usual, but instead of transport sending packets through UDP ports, it sends it through the Steamworks socket network with SteamId for the address.

On top of that, there is side channel messaging service/tool/thing that lets you send messages/data to steam IDs directly, completely bypassing Netcode/transport. I needed this for voxel world streaming, which Netcode is not suited for.

This was done at the end of 2023, and there might be some further changes to Netcode and Transport that might make a few workaround unnecessary. E.g. when I had left it, I had a fork of Transport to change the max packet size const, but I believe it is customisable now.

Anyway, I have since deleted it and converted my game to single player (lol…), so it would be nice if some people can benefit from the work.

For more detail on the code here is a bunch of instructions I provided over discord to someone who was asking. Sorry for the formatting, it really is just a copied discord chat with very minor adjustments.

Hope it helps!

9707627–1386686–Networking.zip (49.1 KB)

14 Likes

Got a question about facepunch, and support for network lanes. Steam supports lanes, but I think I had to add those to facepunch myself because it didn’t have them in its latest version or something… memory a little hazy on this. But here is my version of facepunch with the lanes support.

The reason I added support for lanes was to support my side channel to send messages directly to other steam users bypassing netcode and transport.

If you want to use this code, your choices are: 1. Use my version of facepunch here, 2. add lanes support to whatever version you have, 3. remove lanes functionality from my networking library code because you don’t need a steam direct side channel in your project.

9742741–1393858–Facepunch.zip (656 KB)

4 Likes

Hi @Shinyclef
Thanks for sharing your work on this.
I have now had a bit of time to look through it to get some inspiration, however there are a number of unresolved assembly references, which makes it hard to use. They are also Guids in the asmdefs, so no easy way to determine what they are.
9932634--1437534--upload_2024-7-10_10-51-4.png

Specifically there is some code from BovineLabs (Tertle) which I cannot find anywhere in his publicly available libraries, and therein the use of a CodecService for compression, which also eludes me.

If you have the time to give a few pointers, to what the missing references are, and where to find them, that would be much appreciated.

2 Likes

Sorry about the difficulty.

I’m pretty sure everything here should be available except DigiGame.Common but what’s missing from there is probably not hard to figure out as it’s mostly just utils and extensions or general stuff like that. But in case there’s something that’s confusing, I’ve attached the common assembly as well as screenshots of all assembly defs with rider’s hints showing assembly names (I’ve since moved off guids!).

I do use some non-public bovine labs stuff, but I’m pretttyyy sure none of that is in networking… CodecServices can be found in BovineLabs.Core.Utility. I was about to write my own LZ4 compression stuff when, as often happens, tertle alerted me to the fact that it’s already in core.

If you have any specific questions, I can try my best to answer them. And anyone who gets benefit from this, feel free to improve the knowledge in this thread for others too :).

9933318–1437690–Common.zip (59.6 KB)
9933318–1437705–Assemblies.zip (446 KB)

3 Likes

Thank you for sharing your work on this!!

I have been going through everything and it went really nicely until I reached the “DirectMessageSendSystem.cs” and holy lord is there some custom extension stuff going on in there! :smiley:

If I understand this framework correctly, I assume that I need to have that system regardless if I’m going to use multiple lane connections with custom packets, so I would just want to ask if you could give us some hints on how to sort that class out since these extensions are not found among the files you posted here?

Thanks once again for sharing this!

I think he depends on some of my extensions in Core Tim (tertle) / com.bovinelabs.core · GitLab

1 Like

Hi ko0zi, it’s been some time, but tertle is right, I use his extensions.
In the post above yours, there is an attachment showing the referenced assemblies per project. BovineLabs.Core.Extensions is almost certainly where the missing extensions are. Check out tertle’s library, it’s full of gems :).

1 Like

I’ve been trying to integrate this into a project but to no avail. I have the matchmaking and Steam IDs to use. Still, I have no idea whether I have to use Unity’s Netcode Connection Flow or to use some other mechanism.

If I understand correctly, the NetworkStreamConnectionRequest should take the Steam ID and pass it to the SteamworksDriverContructor which passes it to the Steamworks(Client/Server)NetworkInterface? Yet it keeps yelling “Custom IP Family is not supported.” etc etc…

Otherwise, this is amazing and I hope I can get it working soon.

I’m also very interested in this.

(There’s probably an opportunity for someone to implement the Steamworks Transport and wrap up in an easy to use, plug and play way, and publish it on the Asset Store.)