How To Make A Steam Multiplayer Game in Unity - Hosting & Joining Lobbies
HTML-код
- Опубликовано: 22 май 2024
- In this video I will be showing you how to get your unity project set up. How to host lobbies and how other people can join them. In the next episodes I will be going over how to display users, sync movement, create character cosmetics and much more. So make sure your subscribed to not miss out. :)
-----Tutorial Links-----
Mirror: assetstore.unity.com/packages...
FizzySteamworks: github.com/Chykary/FizzySteam...
Steam Docs: partner.steamgames.com/doc/home
Source Code: / 61232061
-----My Personal Links-----
Discord: / discord
Instagram: / gabzxd
Twitch: / officialzyger
Twitter: / zygerdesigns
➤WISHLIST MY GAME:
store.steampowered.com/app/16...
----Time Stamps-----
0:00 - Intro
0:09 - Initial Project Setup
0:49 - Network Manager
2:16 - Steam Lobby Setup
4:45 - Lobby Created Callback
7:26 - Lobby Request Join Callback
8:09 - Lobby Entered Callback
10:00 - Start Method
11:20 - Host Function
12:11 - Unity UI Setup
12:41 - Testing The Project
14:09 - Outro - Развлечения
Took me 3 hours to implement this into my project and voila its coop now. I really appreciate how fast you are writing/explaining.
scrolled through about 50 tutorials on this, yours is the only one that i could really understand, looking forward to the next part!
Mirror is need of more recent tutorials like this. It's a really good networking solution but I think it scares off a lot of beginners.
Underrated, I've actually been dreading doing a multiplayer game beyond just messing around with friends because I assumed Steam would make it effing impossible. You've shown me it's actually doable so I might actually give it a go.
What an awesome video over here! Very simple to follow up and easy to understand with your explanations!!! Keep it up!
Wonderful, short and concise, exactly the information you need to get a game working through steam, thanks a bunch!
Thank you for this! I made a game using only mirror and this makes it way easier for my friends to join.
Phenomenal tutorial, great introduction into steam multiplayer!
been scouring youtube looking for p2p multplayer unity tutorials, really appreciate it!!
Very nice, thanks! Looking forward to the follow up videos!
Can't wait for your next video for Steam multiplayer!
tsym for making these because I followed Dapper Dinos mirror tutorials and implemented steam into the lobby system myself using some of his steam tutorials which took ages and i already forgot how i did it.
In 1:43 when you removed Kcp Transport and added Fizzy Steamworks, you forgot to mention that we also NEED to select Fizzy Steamworks as Transport in our Custom Network Manager, under Network Info.
Spent two hours trying to figure out why am I doing the exact same thing as you, but I get errors. This was the problem :) Quick and nice video though, thank you!
completely forgot to mention. for me it automatically got assigned which is why I didn't mention it but ill make sure not to miss anythign like this next time! thank you !
@@ZygerGFX No worries! Keep up the good work, looking forward to next videos :)
@Adenashi Comix lmao, no problem. Glad it helped!
thank you thank you thank you thank you :)
Thank you, Sir.
Nice vid! Ima check this out on unity for my game!
Thank you for this wonderful tutorial && your beautiful voice)
Fantastic tutorial, thank you so much!
Glad I found your tutorial, you make it so simple and clear, and helped me alot!
Glad it helped!
Thank you so much! Very informative
Super helpful! Thank you!
I just did something similar in Unreal, surprised how straight forward it was. Of course I will give this a go too! Just what I was looking for really!
ey that's awesome. I still to this point don't understand how multiplayer works in unreal. So ill need to read up on that just out of interest. also thank you !
Goddamn, this was a fantastic tutorial!
Great tutorial!
thank you for this video
Nice Tutorial
There is no Steam App ID in FizzySteamworks version 5.0.1. Where should I set it?
!! INPORTANT !! If you are getting errors saying "There was no active transport when calling NetworkServer..." Or "Must set the Network Address field in the manager" Go to your networkManager and under the custom Network manager script set "transport" under "Network info" to the networkManager game object. This should fix it.
Thank you!!!! Saved me hours of debugging.
@@BigMintyMitch no problem
THANK YOU VERY MUCH, HOLY MAN! I wonder why people like you haven't been recorded in the Bible yet. I tried to create a lobby in different ways (according to tutorials), it didn't work out correctly anywhere, then the lobby panel itself is not instantiated, then something else. There are 3 errors that came out (2 that you described, and another one caused by the fact that the manager's address is let), I was already desperate, I thought that's it, and I will leave my projects at the levels of creating multiplayer. And here you are... you saved my nerves, thank you!
long life to my savior
Thanks!!
Great video :D
Thank you 😁
Thank you so much
Any idea as to why I'm not getting "Server started listening" in my debug log? Everything else shows up. Could it be because I took the latest version of FizzySteamworks instead of the one shown in your video?
Hey i cant add fizztsteamworks cause i just get an error "There is no argument given corresponds to the required formal parameter"
the steam works version doesn’t work anymore with the latest version of mirror, what’s ur suggestion?
At the end of this tutorial series can you make something releated to cosmetics from steam market place, that would be awesome!
i will see what i can do. i myself haven't tried that stuff out yet but will try to do so.
@@ZygerGFX Ok cool!
Hi, first of all thank you for this tutorial series, it's helping me a lot on my game project right now and it's really well explained!
I'm having an issue though, I wanted to test it out with my girlfriend today and she couldn't reach the lobby. After testing with a debug console we got this error on her side: "Must set the Network Address field in the manager". The build version has "localhost" in the inspector field for this, but I don't know what I am supposed to change it too so it can work on Steam when we try to play it. I tried rewatching the videos anew but I don't see what I missed, and everything else works correctly (at least when I tested it by myself with one account....).
Thanks in advance for your help!
Hi, I had the same issue which I managed to fix.
If you followed the tutorial exactly as I did then this will be the path:
In NetworkManager (GameObject) > CustomNetworkManager (Script) - Network Info - Transport, set this from "None" to "NetworkManager (Fizzy Steamworks)".
Hopefully this will fix the issue.
@@Sam-by3jq Thanks for your answer, however I already put the Network manager(Fizzy Steamworks) in there since I had read the comments after watching the tutorial... The issue is still present..
Did you ever find the fix? I've noticed that as soon as I press the 'Host Game' button, it wipes clear the 'Network Address' field in the Custom Network Manager. I do not know why though.
@@roxigo5764 Unfortunately I did not find any fix for it yet...
@@Sam-by3jq Thanks man I was trying to fix this for an 1 hour, I can finally go to bed
nice, when second part?
If you encounter Steam not showing the overlay / not able to host when starting your game throught steam, try starting steam as administrator.
This was published a year ago and I'm wanting to implement this, is this still relatively the same or should I look for a more updated video?
Hey, Gabi! Are there any costs for making a peer-to-peer game with Steamworks multiplayer?
Hi,
I have a question i hope you can be able to answer me😊
2th client movement freeze issue , and is it global or should be in same WLAN ?
Thank you in advance 😽
Hey, I'm having an issue with hosting a lobby. When I click the button I get a error callback called 'k_EResultAccessDenied' does anyone know the cause of this?
Can you please do an updated Version of this, I was following your tutorial and found out a lot of options were changed, I also dont think there are other tutorials showing the newer versions
Why am ii getting Steam errors when installing Fizzy?
what a lovely work👏👏 I have just one question, should I invite my friends to join the lobby , can't make them search for a match and find it without sending invite?
You can either invite them or they can join you by right clicking and pressing join via steam. But if you checkout my channel I recently made a new tutorial on how to browse online lobbies and join through a join button within the game.
@@ZygerGFX That's what I want,
really thank you
Hello, If anyone is getting invoke errors change invoke to DynamicInvoke
My hero
Hero
man you type fast as hell. Not a bad thing though love the video
Is this still possible with later versions of Mirror and FizzySteamworks? And if so which releases? Thank you and great video!
yep still possible a few things to note: You will now need to individually install steamworks, fizzy steamworks and mirror. Before steamworks was included but now you have to do it individually.
The app id can no longer be entered in the inspector. Instead in your build folder you need to create a txt file ( one will usually be made automatically) called "steam_appid" where you want to type "480" and save it.
Everything else should be the same,.
@@ZygerGFX Should I use raw steamworks or steamworks foundation?
@@quackncheese just normal steamworks: github.com/rlabrecque/Steamworks.NET/releases
@@ZygerGFX Thank you, that note was very helpful
thanks for the tutorial babe
while in the unity debug log,there isnt any errors, but i am unable to join on any computer, everything work from the icon, name and lobby name it sends the request to join but doesnt join anything
Hey! Thanks for making this tutorial, its really been helping but I've been getting this error only in my built game.
No reader found for Mirror.SceneMessage. Use a type supported by Mirror or define a custom reader
This isn't present in the Editor and I can't seem to find a fix.
Im using Mirror Version: 40.0.9 and FizzySteamworks: 4.4.1
I know these are outdated but I wanted to follow the tutorial as closely as possible in order to prevent errors.
can you please do a tutorial on generating server ids and sending them to people so they join through a ui that says Input Lobby ID: Kinda like Among us, were you can send a lobby id. I would greatly appreciate that!
as soon as I import fizzy steamworks, an error (There is no argument given that corresponds to the required formal parameter 'arg3' of 'Action.Invoke(int, TransportError, strin) pops up. Any idea how to fix this issue?
Changed Invoke method to DynamicInvoke and seems to be working.
I've been following your tutorials and they are absolutely awesome, very clear and simple. However
I've been running into an issue where when I try and join the lobby of my other steam account, but it asks to install spacewar and then goes into that application instead of my game. I've added the game to steam the way that you did in the video. I've seen one other comment on this where they just added the game to steam and got their own steam app ID but I was hoping there would be a better solution than that.
same thing happens to me can anyone help?
@@vvixell4580 I got something to work. I just made the "host button" a play button. It asks steammatchmaking for a list of lobbies and then tries to join all the ones that have a network identity on them. So I can now join and create lobbies but this still isn't fixed. If you want to find all the SteamMatchmaking functions just go to the steamworks API documentation
Quick question, is there any way that other steam users (not on the friends list) can join these lobbies as well or no because in order to add friends on steam, you need to have at least purchased $5 USD in the store so I'm pondering if this is the best online solution for a game like Push Me? Also would joining through a room code be possible or no?
Hi. yes you can most definitely join lobbies without being friends with the host. this can be done in lots of way. one could be just having a list of open lobbies and allow players to join that way. as for a room code you could also do that. For this you'd have to name the lobby the room code, code and then join the lobby through its name. not sure if that makes sense but in a future video I could demonstrate it.
@@ZygerGFX Ahh I see. if you have any resources about joining through room code and if you can post the link I think that should be fine but I mean its ur choice if you want to include it in a future vid but I do think joining through a room code is traditional for online multiplayer games.
@@jakepatel3698 i think the best way to do it is to name your room the room code. then join the lobby under that name. i probably will try to make something and show it in a future video as I agree its a thing most people like to have in a game.
In the newer versions, there is no SteamManager class, so can't call SteamManager .Initialized. Do you know what should I call instead?
Well you need Steamworks, Mirror and FizzySteamworks in your Unity project and you might need to add a using Steamworks at the top of your file (some IDEs do this automaticdally, others don't) in which you want to use SteamManger.Initialized
Hey, I ran into the same problem did you find a solution for it?
hmmm I wonder if my issue is with not using steam transport. was trying to use steam lobbies with unity relay service.....I have the call backs implemented, so I guess I will try that. Wanted to say thanks for making the tutorial.
Have you implemented GetLaunchCommandline to allow players to join the lobby prior to launching the game. Still running into the same issue.
So do you NEED to pay the 100€ before you can start development for a game using steamworks?
Or are you able to just go ahead and start using the steamworks for testing and then later you can pay when you are ready with an actual game that works?
@Limeify ah awesome!
Thank you for clarifying that 🙂
"Persist Network Manager to Other Scenes" is not appearing in the inspector. Its just not there, I did everything exactly though?
DId you find a fix?
She used FizzySteamworks 4.4.1, I think they removed it in 5.x
@@xyoxus No it's tied to mirror, and yes they did remove it, its automatic now to sync through the other scenes.
Hello, I know this is like 2 years late, but do I really need 2nd steam account just to test the multiplayer system? Or is there workaround? Thank you for your tutorial, it helped me alot!
hey yeah unfortunately you need 2 steam accounts because its using steam as the server host. You can get around it a little bit by getting a virtual machine and running it on your main setup, or alternatively use like a laptop
No too sure if it will cause issues later, but I am not getting the last debug log message that you have where it says "Server Started Listening", I only get to "Starting Server [SteamSockets]" and then nothing
same
did you find any solution to this?
Complete noob question, Im trying to make a game where each lobby has like 6 players, would I be able to use this approach to have one of the users host the server for their friends or random people so that I can get out of paying for servers or is paying for servers unavoidable?
When using steam they host for you. So as along as someone opens a host its running of of steamworks but also of the user that hosted. So it's not exactly the same like some other games have it. With this approach things like host migration are impossible among other aspects. So if you want the full server experience you will need to purchase servers. Although this method is better in my opinion since its free, and also I'd only consider buying servers if my game is already doing well and getting big.
So a quick answer is yes you can.
I get this error: error CS0246: The type or namespace name 'Text' could not be found (are you missing a using directive or an assembly reference?) can you help me pls?
make sure at the top of the script you have "using UnityEngine.UI;"
question. I have a multiplayer game that I'll be releasing on steam. I can't find a clear answer anywhere. Does steam provide us with the use of their servers? Or do I have to pay for 3rd party servers and implement it to be used in steam?
@Zyger please answer this.
hello Zyger I am having compatibly issues with current mirror with 4.41
Assets\Mirror\Runtime\Transport\FizzySteamworks\LegacyServer.cs(27,71): error CS7036: There is no argument given that corresponds to the required formal parameter 'arg3' of 'Action.Invoke(int, TransportError, string)' i am getting this error when i add fizzysteamworks and also i am not getting kcp transport automatically and nor persist functon
i am also getting the same error
you can change the invoke into a dynamicinvoke that worked for me (for now)
Hey so I have a question, whenever I import fizzworks (im using the most recent mirror version and im using fizzysteamworks 6.0) theres a bunch of errors. importing mirror is fine but whenever i import fizzysteamworks i get errors mainly relating to steamworks thingsl like "the expression steamworks does not exist in this context" and whatnot. these tutorials seem great but if i could just fix this one issue it would mean the world :)
Hey I think I’ve seen this error online before so id reccomend giving it a search. But try and import the steamworks sdk too. So in total you’ll have mirror, fizzysteamworks and steamworks sdk.
@@ZygerGFX ahh that makes sense. thank you!
I can't find the build of my game it just dosent show up in its folder please help
Great video! For some reason my network manager is getting destroyed and when i try and starthost it gives me a null exception
Solved, had two instances of SteamManager. Also Mirror multiplexer can be used to listen out for lan and online requests
👍
This tutorial is wonderful but I've been having some slight issues, I've installed Unity 2021.1.5f1 and followed the instructions exactly but when I import the FizzySteamworks package I get 2 errors pertaining to the 'Invoke' commands in 2 scripts, changing them to 'DynamicInvoke' fixed those errors but then when I create my Custom Network Manager the settings I get in the Unity Explorer are a bit different and I don't get the Kcp Transport automatically added. From here when I try to create the SteamLobby script - for some reason - none of the variables I try to add seem to work or even end up being color coded such as the Callbacks; I've been trying to wrap my brain around what I'm doing wrong for days now. @w@
I just commented it out after a few hours of fruitless debugging. My project works (so far)
@@jacobmello2933 Yeah, I didn't realize I hadn't selected the proper script assemblies but a friend was able to point me in the right direction
@@TrevorTheHyena what did you do to fix the errors
@@MrIapk changing the "Invoke" to "DynamicInvoke" seems like working
hello is there a way to see all the hosted lobbies in a sort of browse lobbies menu ? or this is a feature that cant be implemented wiht self hosted lobbies
oh my bad just saw that you made a tutorial on this topic ! thanks for the quality content !
For some reason when i import the two packages, i get errors. How do i fix this?
braba demais
why not using FizzyFacepunch? :D Think it's more beginner friendly. Also, they use the steam relay, so people do not leak their IP adress?
Does anyone know how to add my project into steam? I'm very confused.
I press the hostlobby button but there is no interaction HELP
Now I am confused how to make your inventory be shown in the steam inventory, searched everywhere didn't found. Can someone help me with this please
Hi, my friends are trying to join my game, however they are unable to. When I try to join their lobby I also cant. The steam_appid is correct, what could be the problem besides the appid?
When I try to join I get the following error: Client Transport Error: DnsResolve: Failed to resolve host: number. This is fine. UnityEngine.Debug:LogWarning (object)
is there a difference between this and steamworks v2? they both from my understanding connect unity to steam. I just saw that steamworks was in the unity store and i didnt see this one
nvm saw that it wasnt on unity anymore. What i get using my small outdated knowledge lol
I always reccomend using the official steamworks api directly from steam since its authorised and updated regularly. If it was on the unity store its probabably somebody re uploading it which would eventually be taken down.
@@ZygerGFXwould you happen to know how to get my code to sinc up? Im using visual studio code but it doesnt ever give me errors or the drop down boxs for options. It has happened on other projects before and never knew how to fix it
my host button is not working after i leave the lobby, how can i solve it
First off, your tutorial is very nice.
I'm new in this domain, but is it possible to host a game and None friend can join you without invitation ( Public without buying a server) IF possible is it possible to see some lobbies for joining one of them ?
Sorry if it doesn't seems clear.
yes you can make lobbies that are invite only. and yes you can display current open lobbies and allow people to join them.
@@ZygerGFX could you specify a little bit more on how you can display a room list of lobbies publicly using unity? please i've been searching for days on the internet :(
have you found out how to do it ?
I have many errors after import FizzySteamWorks
hey that text didint show up on my test alone or with an alt
I imported Mirror and FizzySteamworks in a fresh unity 2021.1.5f project and there is 84 errors all about it not thinking steamworks exists, have I forgotten to do something? Thanks
make sure you have steamworks installed. those errors occur when steamworks isnt properly installed. either get it from fizzy steamwokrks with the right version. or get it directly from steam. just search steamworks untiy sdk.
@@ZygerGFX awesome! it works now, thank you for the help! I must have missed the part that you need steamworks as well as fizzysteamworks and mirror! keep up the amazing work, Zyger!!!
Something to be careful about. Sometimes you can get an error where this happens because you installed steamworks before, and then you installed fizzysteamworks that came with another steamworks installation and the two collide.
hi, i have an error that says "no player prefabs" but i did exacly like you...
I'm getting an error when i try to download fizzysteamworks 4.4.1. When I import it I get errors saying "Assets\Mirror\Runtime\Transport\FizzySteamworks\NextServer.cs(42,71): error CS7036: There is no argument given that corresponds to the required formal parameter 'arg3' of 'Action.Invoke(int, TransportError, string)'" does anyone know how to fix this? I am using Unity 2021.3.11f1 and downloaded Mirror 2022.9.15. Mirror is the only thing I have in my project currently.
I get the same error :( Im searching everywhere please tell me if you find a solution.
I have the same error do you know how to fix it Then please tell it me.
Hello, unsure if it is a permanent or temporary fix, but the way I fixed it was by replacing
s.OnReceivedError += (id, exception) => transport.OnServerError.Invoke(id, exception);
with
s.OnReceivedError += (id, error, reason) => transport.OnServerError.Invoke(id, error, reason);
Then going through each instance of OnReceivedError.Invoke and making it OnReceivedError.Invoke(connectionId, TransportError.Unexpected, "ERROR Unknown Connection");
@@ImmortalTimothyM can you tell a bit more.... does it still work?
@@larsmaas07 I am sorry, but I ran into other problems down the line so I eventually just switched to a different multiplayer solution.
Do you know how we could leave a lobby we have entered to go back to the list of all lobbies?
To leave the Steam lobby you can use SteamMatchmaking.LeaveLobby()
partner.steamgames.com/doc/api/ISteamMatchmaking#LeaveLobby
this is a bit late not sure if anyone will see this, but I'm having an issue where my gf can't join my game. spacewar is installed on her laptop steam, but when she joins the game wont open. everything works fine on the host side.
Assets\Mirror\Runtime\Transport\FizzySteamworks\LegacyServer.cs(27,77): error CS7036: There is no argument given that corresponds to the required formal parameter 'arg3' of 'Action.Invoke(int, TransportError, string)'
Can u help me
Sorry but this is not something that I show in the tutorial. I can see you used some sort of invoke here. Best case is too google it. sorry that I cant help.
I’m having the same problem
Hello, unsure if it is a permanent or temporary fix, but the way I fixed it was by replacing
s.OnReceivedError += (id, exception) => transport.OnServerError.Invoke(id, exception);
with
s.OnReceivedError += (id, error, reason) => transport.OnServerError.Invoke(id, error, reason);
Then going through each instance of OnReceivedError.Invoke and making it OnReceivedError.Invoke(connectionId, TransportError.Unexpected, "ERROR Unknown Connection");
This is because Mirror changed there something in the Listeners. There is no Exception anymore instead there is a TransportError -> enum and a string -> reason message
After adding the program to steam, it wants me to install spacewar whenever I try to hit play. If I install Spacewar it then opens something entirely different, is there anyway around this without setting up a store page?
I am running into the same issue, any help would be greatly appreciated
@@sotofpv I just ended up paying the $100 to get a steam app id
I actually did the same, going through the process now, :P
@@sotofpv Do you know of a better way?
Hy Thank you for your video. So do I need to pay steam to use this or make my game work through steam?
At the beginning no. You can use this without paying. But if you are wanting to release your game then yes
@@ZygerGFX Thanks a lot☺️. I guess that will do
How, or where, did you learn all this?
I love your voice!!
Hi, i have a question. When i create CustomNetworkManager script and then save, i dont have avaible options like you, just emty script with name.
did you inherit the network manager ? like the default mirror one ?
@@ZygerGFX if u mean this:
public class CustomNetworkManager : NetworkManager
{
}
then yes ,all is in one line
using Mirror;
is added too as well as all others
@@ZygerGFX Well, after 4h i found solution just delete Mirror files, and then again import > start from scratch and it works now...
i thought that this may occur beacuse im using VS code, i tryed it with VS comunity 2019 and it works same, so no issues there, and autosentecing actually started picking up the reference of inheritence
Is anyone else having an issue where once they put their game in steam the host game button does not work? I already went through the entire tutorial series but this issue happened once I sent the game to a friend.
Your friend shouldn't be hitting the button. Only the host does. If it works for you but not them, maybe they just don't have steam open
@@thepancakeexpert Sorry this was an issue forever ago, while your solution doesn't make very much sense to me as yes they did have steam open, I can confidently say this is just a unity 2022 issue that can be fixed with one line of code
I see you also watch Dapper Dino.
Just to clarify this is online right not just local lobby
How to make this with Lidgren network?
just wanted to ask if it is legal to use spacewar as servers
if you are actually planning on playing your game and having servers you will need to have your own steam application. spacewar is only for testing
Does this also work with fishnet?? since mirror and fishnet are very simular
Probably not since this uses the fizzy steamworks which is specifically an implementation for steam and mirror
it seems like my friends are unable to join the server
How come?
Anyone know how to disconnect from the lobby without breaking the game?