How To Make A Steam Multiplayer Game with Netcode (MLAPI)

How To Make A Steam Multiplayer Game with Netcode (MLAPI)

MrRobin

2 года назад

13,558 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Netanel Komm
Netanel Komm - 19.09.2023 16:51

Hey, I hope you're still replying... Im quite of a begginer - where can I find your UI setup, and what you do/call when pressing the buttons, such as start game?
Do you have that uploaded somewhere? Thanks!

I especially need the start game logic, because Im not really sure how to start the game once the players all joined.

Ответить
Revan
Revan - 29.08.2023 00:03

Great Video, thanks for pointing me in the right direction, you saved me atleast a week (and more with the configuration script)

Ответить
Holy Perceval
Holy Perceval - 04.07.2023 01:08

Such high quality video ! Thanks fot everything !

Ответить
Syncronice
Syncronice - 29.06.2023 16:28

Hey, i have a understanding Question. So you are coding/syncin with Netcode for Gameobjects, but you just use Facepunch instat of Steamworks?

Ответить
roki Ni
roki Ni - 03.05.2023 10:29

thanks!!

Ответить
Mudtek
Mudtek - 22.04.2023 22:43

Awesome job man. I may make a video myself on this topic as the information is really sparse. This helped get me in the right direction.

Ответить
FralleNet
FralleNet - 01.02.2023 17:35

I'm getting "Invalid connection" whenever I try to join my hosted game. Is it possible to test this locally somehow? Or do I need a second computer and second steam account?

Ответить
UsmanDev
UsmanDev - 13.01.2023 03:00

Hey I have a question, is this using the steam datagram relay?

Ответить
IsntItYoshi
IsntItYoshi - 05.01.2023 02:33

Why cant i install facepunch, it says the link is invalid

Ответить
Aeris
Aeris - 03.01.2023 08:05

Nice tutorial, also the only one talking about Netcode + Steam(most of the others are made with Mirror). I want to implement a feature where you can share the lobby id to anybody so they can join. Muck has exactly that feature and would like to know how to make it with what we did in the tutorial. Thx for your time! BTW I did the minimal Googling and found nothing so I am pretty lost lol.

Ответить
Ender Elohim
Ender Elohim - 03.01.2023 02:32

So i'm using steamworks net how can i move to facepunch? Do i need to do anything special for it?

Ответить
Fallegon
Fallegon - 01.01.2023 20:38

Anyone else not able to download via the github link? Nothing I've tried works it alwasy comes back with invalid name and downloading the files from their website and sticking the unity folder in my assets folder doesn't work either.

Ответить
Dreami Sover
Dreami Sover - 31.12.2022 14:44

This is a super useful topic, thanks!

Ответить
mbu
mbu - 26.12.2022 18:46

Hey, thanks for the video! Amazing help. Took some time to make it working since I didn't know the lobby doesn't allow you to join with same steam accounts

Ответить
Anthony Stainton
Anthony Stainton - 19.12.2022 08:29

this is literally what I needed lmao

Ответить
GUSRG
GUSRG - 17.12.2022 02:07

Can you provide the example scene you used? (Don't mean the scripts, the actual lobby and the cars)

Ответить
Sebastian K
Sebastian K - 12.12.2022 14:08

What should i do if facepunch does not show up in the NetworkManager for the Transportlayer?

Ответить
Will Croft
Will Croft - 25.11.2022 16:15

So how does one actually link the GameNetworkManager StartHost / StartClient etc method to a button via an addlistener event on a different script? Currently if following this from being redirect from the next video, clicking on the Start Host button will run a default NetworkManager instance, not the one in the GameNetworkManager, regardless on where its attached to. Some example would be helpful.

Ответить
Can't Believe It's Not Bacon
Can't Believe It's Not Bacon - 24.11.2022 14:37

Do you know how to change the maxmembers for a lobby after creation? Using lobby?.MaxMembers = 10 doesn't seem to work and the docs for facepunch don't seem to help either

Ответить
Semyon Khechnev
Semyon Khechnev - 20.11.2022 04:04

Hey
I don't understand. But what acts as a relay? Is that a Steam Datagram Relay?

Ответить
Kilian
Kilian - 11.11.2022 19:09

Thank you so much!

Ответить
3bomb
3bomb - 27.10.2022 06:21

Thank you very much for this, it was a great help.

Ответить
Musab 2
Musab 2 - 23.10.2022 21:33

Is there a specific version for this package?
Puting your link on package Manager didn't work, Unity 2020.3

Ответить
Radish Monster
Radish Monster - 21.10.2022 11:45

Great tutorial, is there an easy way to transition from your lobby scene to the game scene across the network?

Ответить
Just Like The Record
Just Like The Record - 06.10.2022 06:52

I'm able to connect players in a lobby screen, but how do you then "Start Game" and spawn the players in a new scene together? You showed at the end what it looks like, but showed no code. How do I actually spawn the players in the same scene after joining up in a lobby?

Ответить
Sebastian Graves
Sebastian Graves - 05.10.2022 18:35

Hey man, thanks for the help. This gave me the direction I needed. Cheers brother.

Ответить
Yehonatan Tavor
Yehonatan Tavor - 24.09.2022 16:07

hey! i see you only show the code and not how to connect the car and all of that. what should i do to achieve a result similar to yours?

Ответить
Death Defiler
Death Defiler - 20.09.2022 11:00

Love your video! A few questions. Do you know how to show the lobbies already created so random players can join you? Also, do you know how to pick a server you want to use? And finally, do you know how to add a password to join the game? Thanks.

Ответить
The Venusian Sun
The Venusian Sun - 15.09.2022 23:17

A few questions I have about this


Do I only have to run the StartHost(); to start the lobby? or are there extra steps to it?

Is the whole process of running StartClient(); automatic? or are there extra steps to it?

How do I control when the Network Manager's player prefab spawns in?

How do I track how many players are in a lobby at once?

Ответить
MsMaciek
MsMaciek - 14.09.2022 19:39

are there any updates for newer versions of netcode?

Ответить
Mee
Mee - 07.09.2022 06:41

How do get lists of lobbies to join one at random ? This video doesn't cover enough stuff.

Ответить
Gabriel de Souza
Gabriel de Souza - 12.08.2022 07:33

Please, don't record videos in ultrawid, i can't fit it in my monitor...

Ответить
Strixie Lovely
Strixie Lovely - 21.07.2022 20:37

Awesome tutorial, just the right pace and helped me get lobbies setup!
Had a question on sending messages once you're in the lobby, if anyone knows.

Is Netcode For GameObjects' functionality (ie. RPCs and Network Variables) supposed to work through this transport? For example,

[ClientRpc]
UpdatePlayerPositionClientRpc(Vector3 position) {some code}


public NetworkVariable<int> health = new NetworkVariable<int>();

With the UNET transport selected I can assign it an IP/Port, call NetworkManager.Singleton.StartClient(), and RPCs work back and forth.
With Facepunch I assign the targetID to be the steam lobby ID, call NetworkManager.Singleton.StartClient(), but then it only does the RPCs locally.

I see steam has its own P2P messaging system, but would be nice to use the Netcode stuff and have SteamIDs handle NAT. Just wanted to make sure that is a thing before I spend too much time trying to get it to work.

Ответить
Bosko Ivkovic
Bosko Ivkovic - 11.07.2022 14:31

Amazing video easy to implement in my already existing project that was using UNET. Also question, is the Steamworks API that the facepunch repository uses outdated? It seems i can use a lot less steamworks callbacks then usually. For example to get a players username the SteamFriends.GetPersona Doesnt exist and SteamFriends.ActivateGameOverlay also seems to not exist. Any idea?

Ответить
Fantasy Magic
Fantasy Magic - 14.06.2022 18:23

Love your tutorials! But I have one question: How can I join a Host with StartClient(SteamId id) with a button? When i try to add an OnClick event, StartClient wont show up. I know that it needs the paramater SteamId but I dont know further than that ...

Ответить
Partical Studios
Partical Studios - 04.06.2022 11:31

Hey buddy,
I am kinda consufed about something. I want to create server as Premium Only wich players who buy Premium DLC will be able to join the server. How can i make this?

Ответить
Tarodev
Tarodev - 23.05.2022 15:50

Hey brother, good job with the video! You covered a topic which desperately needed covering and you did it well. I appreciate you man.

Ответить
Ponas Makaronas
Ponas Makaronas - 05.03.2022 17:27

VERY GREAT VIDEO I LOVE YOU

Ответить
bobsjobisfob
bobsjobisfob - 18.02.2022 22:17

why are all the comments hidden on this video

Ответить
dotBAIT
dotBAIT - 10.02.2022 13:03

Would you be able to test this on one account and one PC? If so then how?

Ответить
Mike Circle
Mike Circle - 07.02.2022 19:15

Hello, thanks for the great Video!

Maybe I'm missing something, but to make the example fully work on my end, I had to adjust some code:

OnGameLobbyJoinRequested callback is just telling the client that he is invited to join the mentioned lobby, so inside I removed the StartClient(lobby.Id); and instead added code to join the steam lobby:

private void OnGameLobbyJoinRequested(Lobby lobby, SteamId steamId)
{
CurrentLobby = lobby;
CurrentLobby?.Join();
}

This way, the client will join the steam lobby and the currentlobby property is set locally in case it's needed later (I think otherwise it would stay null on client)
After that, OnLobbyEntered will be called automatically on the client (since he has now actually entered the steam lobby) and the
StartClient(lobby.Id);
which is already in your code of OnLobbyEntered will be executed and start the client properly.

Hope this is helpful.

Ответить
Aa Mm
Aa Mm - 05.02.2022 23:30

Thanks, felt like a teamlead was seating next to me and has shared the way to wire all the thing up

Ответить
Bjørn
Bjørn - 21.01.2022 16:10

Seems like my comment disappeared somehow. However. Few notes! For a newb like me it would be great if you could include how to install Facepunch Transport, Facepunch and Unity Netcode via PackageManager. 2nd! You are going WAY too fast. For someone wanting to understand what you are doing you'll have to explain a bit further. This tutorial should have been 1 hour long atleast for what you are trying to cover. It looks like you know alot of things, but to the people watching your tutorial, we might not. 3rd! How did you connect to yourself via steam, how did you create your scene and all your scene elements. How did you set things up? This only covers a 3rd of it. Only code, no install, no unity setup, nothing. It's just so lacking man...

Ответить