#archived-networking

1 messages · Page 25 of 1

ripe mesa
faint gate
#

Hey Guys! I'm looking for someone who has expeirence with the networking system "Photon Pun 2". I want to implement some features into my multiplayer fps game, but I am having issues with getting the game to do simple things such as ending the game after a set period of time, and spawning the players when a different map is chosen. If anyone wants to help me, you can simply dm me and I will try to give you as much info as I can :)

oak flower
raw stormBOT
real ravine
#

there is no process to kill simplewebserver

sharp axle
real ravine
ripe mesa
#

where is the error you were facing?
@real ravine

real ravine
# ripe mesa

I use the old taskmanager, maybe it doesnt show on it, let me try with that you are using

#

okay, now it is showing even on old one and ctrl+c is working to kill the server on CMD. Maybe I did something wrong at first time. Now it is working properly

sharp axle
#

What do you mean? in NGO, IsServer is still available.

flint harbor
#

Hey guys, anyone else used Photon and had this same issue in the "GetDrawerTypeForType()" function?
I saw here the latest patch note saying they fixed it, so i need to use an older unity version?
https://doc.photonengine.com/quantum/current/getting-started/release-notes/release-notes-2-1

btw i haven't done nothing yet, just imported the custom package photon fusion 2 from their documentation

thin charm
pearl girder
#

How long is it considered rude in this community to repost a question to see if other people might get eyes on it? Looking for insight on this but don't want to annoy people and i don't see anything clearly in the rules regarding it. I have done my research and read all the docs and demos, it's not a question of "how" but "why" that i'm looking for

stiff ridge
austere yacht
#

it’s likely though that in a low activity channel your question was seen and the knowledge is just not readily available in this community

#

I would not expect a question to work like a classified ad for ‚help needed‘

#

So between those things, you judge for yourself. Nobody will haunt you for an honest question that is repeated a few times.

sharp axle
topaz thistle
#

Photon Issue with this followhand script not syncing with other clients on my screen

#

As in on my view the item follows my hand but for others on my screen the item is not and is stuck at its original position

blazing wharf
#

Hi Guys, it would be awesome if you can help me with my questions. It is the first time for me building a multiplayer game and using netcode for gameobjects, i am really confused for now.^^

1.Right now the CreateMap method get called after every change at the list, so after the .clear and after every .Add . Is possible to send it just after the foreach?
2. I get one of two error. Right now it is this one: ObjectDisposedException: The Unity.Collections.NativeList`1[System.Byte] has been deallocated, it is not allowed to access it .If I change something I get the error that I don't use a correct dispose. Can someone tell me what I do wrong?
3. If I want to create this list 5-6 times per second and send it. Is it better to use a NetworkList or an RPC?

I am really happy for every support. Thanks in advance.

zealous seal
#
    public override void OnRoomListUpdate(List<RoomInfo> roomList)
    {
        Debug.Log("OnRoomListUpdate called.");
        if (Time.time >= nextUpdateTime)
        {
            UpdateRoomList(roomList);
            nextUpdateTime = Time.time + timeBetweenUpdates;
        }
    }

    private void UpdateRoomList(List<RoomInfo> roomList)
    {
        foreach (RoomItem item in roomItemsList)
        {
            Destroy(item.gameObject);
        }

        roomItemsList.Clear();

        foreach (RoomInfo room in roomList)
        {
            RoomItem newRoom = Instantiate(roomItemPrefab, _content);
            newRoom.SetRoomName(room.Name);
            roomItemsList.Add(newRoom);
        }
    }
}```

Why is the function `OnRoomListUpdate` not called?
flint harbor
sharp axle
#

You'll need to make sure that there is only one active camera in the scene. Disable any cameras attached to other players besides the local player

sharp axle
#

Yes. Cameras should not be networked

flat zenith
#

Hello,
I'm using UGS multiplay and matchmaking service, with mirror.
I'm facing an issue where the client got an warning message attached in Image.
Here is the code using which I'm starting client and server using mirror

#

The network manager settings.

flat zenith
#

Does anyone have idea about this??

sharp axle
#

The camera should not have a network object.

sharp axle
flat zenith
#

Yes I'm setting ip and port using image 1, and calling server connect from client using image 2

#

In console events tab I got an error see if this helps.... 😕

#

You can do this... Attach the camera initially to player prefab. Then pass its reference. Now you can deatach camera

marsh musk
#

Can someone explain (maybe with an example) how to use connection data events for client connect/disconnect as apposed to the callback contexts?

sharp axle
# marsh musk Can someone explain (maybe with an example) how to use connection data events fo...

It kind of depends whether you are receiving it on the server or the clients.
https://docs-multiplayer.unity3d.com/netcode/current/advanced-topics/connection-events/

When you need to react to connection or disconnection events for yourself or other clients, you can use NetworkManager.OnConnectionEvent as a unified source of information about changes in the network. Connection events are session-mode agnostic and work in both client-server and distributed authority contexts.

marsh musk
#

@sharp axle I've never used events/actions before, so I was wondering what, for example, the equivalent of OnClientConnected Callback would be

marsh musk
#

yes, but how do I actually code it?, like what's the syntax?

#

the documentation only has what the enum and connection event data can be by listing it's options, without an example

#

@sharp axle

sharp axle
# marsh musk yes, but how do I actually code it?, like what's the syntax?

It's the same as the old connection callbacks except there is only one you need now
https://docs-multiplayer.unity3d.com/netcode/current/components/networkmanager/#connection-notification-manager-example

The NetworkManager is a required Netcode for GameObjects component that has all of your project's netcode-related settings. Think of it as the central netcode hub for your netcode-enabled project.

marsh musk
#
NetworkManager.OnConnectionEvent += ClientConnected;

void ClientConnected(ConnectionEventData data)
{
  //do stuff
}

@sharp axle like that?

#

I guess my brain's fried, because I don't know how to get the information out of the event

#

nevermind I got it

sharp axle
marsh musk
#

@sharp axle I have a new question now, when I start as host sometimes it will start the host but not trigger the connection data callback to spawn a player prefab when a client connects (in this case the host's client to its server)

#

can the client connection be subscribed to before StartHost() is called?

sharp axle
marsh musk
#

peer connected for itself?

#

@sharp axle does that mean that the server part and the client part are considered peers to each other dispite being on the same device

sharp axle
marsh musk
#

the host starts fine, but sometimes it doesn't spawn the player prefab when the connection event gets called for client connect

#

I start the host on a button, but I subscribe to the connection data on awake

#

@sharp axle should I subscribe in a different function?

sharp axle
marsh musk
#

...did not work, all i got was the warning that you can't make another host instance while one is running, when I tried pressing the button again after it didn't do anything

#

I also put print logs, they didn't run either, so it must not be subscribed to

sharp axle
marsh musk
#

I did that

#

I just start the host on a button

#

but here's the wierd thing, I can stop playmode, start it again, and do the exact same thing and it spawns the player prefab just fine

#

I tried with and without the singleton instance, no change

#

it always fails first then spawns correctly

#

@sharp axle do network objects that are already in the scene have a OnNetworkSpawn call?

sharp axle
marsh musk
#

Man, wish mine would spawn properly

#

Could it be the editor?

sharp axle
umbral stirrup
#

Hey so I was following a multiplayer tutorial and things already fell apart by step one lmao. I installed the netcode for gameobjects package but I can't add the network manager script to anything for some reason.

#

Like nothing with network in the name is even appearing

sharp axle
umbral stirrup
#

Oh I think my version of unity was just too old

flat zenith
mint anvil
#

If i get/read a network variable .value , does this send a request / impact networking performance (asking because i do that every second on hundreds of units in my game)

sharp axle
marsh musk
#

I need some help syncing server/client data, specifically network lists and player names

so the set player name server rpc is called from the player when it spawns

[ServerRpc(RequireOwnership = false)]
    public void SetPlayerNameServerRpc(ulong id)
    {
        Players.Insert((int)id, "Player " + (id + 1));
        UpdatePlayerNamesServerRpc();
    }

    [ServerRpc(RequireOwnership = false)]
    void UpdatePlayerNamesServerRpc()
    {
        foreach (var client in NetworkManager.Singleton.ConnectedClientsList)
        {
            var playerObject = client.PlayerObject;
            if (playerObject != null)
            {
                var player = playerObject.GetComponentInChildren<CarNetworkVariables>();
                if (player != null)
                {
                    player.playerName.text = Players[(int)client.ClientId].ToString();
                }
            }
        }
    }

The player names sync on the host but not on the clients, despite changing each client's own text element

marsh musk
#

Can the server not change individual client's game objects?

sharp axle
marsh musk
#

I synced it client side by subscribing to the network list's OnListChanged event

#

I guess I sort of forgot that clients will sync themselves reguardless of it they are the current owned client

#

How do I remove clients from the network manager list, like when I disconnect a client, then add a new one, it treats it as if the previous client is still there

#

the client id just keeps going up

sharp axle
marsh musk
#

ok

topaz thistle
#

When players join the game after its been created rather than it being created and everyone connecting at once, it dosent sync the weapons

#

I recieve an error here on line 176, Object not set to an instance of an object

stray moth
#

Hello there has anyone here used multiplayer play mode in the unity 6 prieview, when i make a 2nd instance of the editor i cannot maximize it.It says like its minimized

sharp axle
stray moth
#

Parrelsync is killing me over here

opal dust
#

Hello, I have a NetworkManager component setup in my main scene with the player prefab I want to spawn. Everything works fine when running as a host but when connecting as a client the player prefab doesn't spawn. Can't find much documentation and I had assumed that the NetworkManager would spawn the player prefab when connecting as a client or host. Do I have to setup my own RPCs to spawn my player on the server and client when a new client connects? If so are there any resources on how to spawn a network object on both the client and server because again I've done some googling but can't find any useful documentation

topaz thistle
#

i believe its happening because the player joins late to the photon room

sharp axle
#

The player object will spawn automatically if set in the network manager. make sure the client is set to connect to the IP of the host

stray moth
#

@sharp axle Thanks it worked perfectly

#

But from the looks of it my player 2 editor is still bugged but i can use 3 and 4

#

for some reason

teal cedar
#

Is fish net good for fast paced FPS shooter?

stray moth
#

Im using fishnet right now

#

really good in my opinion

stray moth
#

Completely free

#

Called Multiplay

teal cedar
teal cedar
#

I think NGO lacks important things like client side prediction

teal cedar
stray moth
#

I dmed you

sharp axle
teal cedar
#

Target game: FPS fast paced shooter

sharp axle
# teal cedar What would you recommend? Fishnet or NGO?

I am all in on NGO, adding physics rollback (if you even need it) is doable. Fishnet seems fine too. I don't know what they have locked behind the paid version though. If you already know DOTS or are willing to learn then check out Netcode for Entities. It also has full client prediction built in.

teal cedar
teal cedar
#

Because I currently have client network transform

sharp axle
#

But it lets the clients move with no lag

teal cedar
#

So it's suitable for FPS shooters?

sharp axle
ripe mesa
ripe mesa
#

A lot of VR Shooter Titles has been using it

teal cedar
#

I will explore their features

ripe mesa
teal cedar
ripe mesa
#

Fishnet feature-wise is better than Mirror. However Fishnet is actually banned from the unity discord.
Fishnet author is a manipulative person, better to avoid it

ripe mesa
#

do you know BR200?

teal cedar
#

It's an asset right?

ripe mesa
#

yea, its made using fusion

patent glen
#

How i can make Mobile contols in Simple Fps Fusion 2 sample project..
I try with joystick pack and simple input buttons

ripe mesa
#

@teal cedar

Fun fact from fishnet: I got banned from their discord server without notification because I publish a udemy course teaching other netcode tutorial.

Like how anti-competitive you could be

teal cedar
ripe mesa
#

If you easily posted another netcode benchmark number that is better than fishnet, your message will be removed

old mural
#

Where can I go to learn more about advanced multiplayer techniques? E.g. how do I coordinate many host servers to provide a seamless massive world, like WoW? How do I design a game like Helldivers that has thousands if not hundreds of thousands of instances per party of 4 — how do I handle spinning up and spinning down servers?

The more advanced stuff like that.

dry maple
#

I've not played Helldivers, is it client-auth? Do you see cheaters regularly?

sharp axle
#

I don't know if I can post links but you can find a load of info at gamenetcode.com

old mural
# sharp axle I don't know if I can post links but you can find a load of info at gamenetcode....

You’re allowed to post links but yea let me check out if that website has kinda what I’m looking for.

“Your server hosting provider would handle spinning up new servers as needed” The tricky part is telling the server hosting provider when to spin up new servers, and how to handle spinning them down, if you understand what I’m saying. That’s the piece I’d like some patterns or manuals on how to make.

sharp axle
old mural
sharp axle
old mural
sharp axle
#

There aren't enough MMOs made for there to be patterns

lyric thunder
#

(using photon pun 2) any idea why instead of joining a private room, i just join a random instead?

teal cedar
#

Are there any reliable benchmark tests of unity networking solutions (mirror, fishnet, photon fusion...)

#

Because every benchmark test I found is heavily biased

sharp axle
marsh musk
#

Im trying to detect when the host disconnects from the cient, but this code gets called on the host before it leaves, but not on the client

void Connection(NetworkManager networkManager, ConnectionEventData data)
    {
      if (data.EventType == ConnectionEvent.ClientDisconnected && data.ClientId == 0)
        {
            print("host left");
            ResetGame();
        }
}

this is being called by subscribing to the NetworkManager.Singleton.OnConnectionEvent

marsh musk
#

So in other words, how do I get the client to detect when the server goes down

sharp axle
marsh musk
#

how do I get the server id from the client when shuts down then?

#

peer disconnected?

sharp axle
marsh musk
#

ok so... how do i get when the server shuts down rather than a client id

sharp axle
marsh musk
#

so something like this?

if (IsClient && data.EventType == ConnectionEvent.PeerDisconnected && data.ClientId == 0)
{
  ResetGame();
}
sharp axle
#

No, just ClientDisconnected and no need to check for clientid there either

marsh musk
#

but how will the clients know if its the server/host or just another client, without specifying?

sharp axle
#

ClientDisconnected is always local for the clients

#

If it's another client it will be peer disconnected

marsh musk
#

but the server won't be local for any client other than the host

#

I need this to run on clients to detect when the server/host shuts down/disconnects, so it wouldn't be a client disconnected would it?

#

because that would be local right?

sharp axle
#

Yes When the server shuts down the clients will all get sent the client disconnect event.

marsh musk
#

through connection events or OnClientDisconnected?

old mural
# sharp axle There aren't enough MMOs made for there to be patterns

Can’t stop thinking about this response… So in your world, how many games of a genre (like mmorpg) have to be created before someone realizes there are patterns for the genre?

Are patterns from one genre (like oRPGs) applicable to other genres? Why or why not?

https://en.m.wikipedia.org/wiki/List_of_massively_multiplayer_online_role-playing_games

This is a selected list of massively multiplayer online role-playing games (MMORPGs).
MMORPGs are large multi-user games that take place in perpetual online worlds with a great number of other players. In most MMORPGs each player controls an avatar that interacts with other players, completes tasks to gain experience, and acquires items. MMORPG...

sharp axle
old mural
visual cypress
ripe mesa
#

I also do not promote any preferred network at all. I give network based on their needs

#

yk punfish is a manipulative guy

visual cypress
#

yes you seem to not like them I dont care about that. do you have proof of what you said

visual cypress
#

If you dont have proof Im inclined to believe you were properly banned.

ripe mesa
#

i have no proof whatsoever, because I dont do anything

visual cypress
#

Alright let me tell you how I and possibly others see it then

#

you are saying they banned you for making a tutorial or something of another network, but you have no proof of this. they say youre banned for intentionally spreading misinformation. If you are unable to proof what you said its more likely you were in factual banned for misinformation.

ripe mesa
#

they say youre banned for intentionally spreading misinformation
do they proof of this tho?

Its like both of us dont have anyproof. but punfish create a promising story of it

#

@visual cypress You are spreading misinformation, where is the proof you dont spread misinformation?

#

thats like it

#

This is what real misinformation looks like

#

He turns a condition where he is losing by creating a fake scenario, where the feature doesnt exist at all

#

how you can more manipulaitve be

visual cypress
# ripe mesa > they say youre banned for intentionally spreading misinformation do they proof...

I didnt really see anything on their server talking bad of you. I also see you talking about other networks but no one seems to care. You are saying you were banned for making a tutorial which just sounds ridiculous. They have a bunch of content creators in their server for all parts of Unity. You are very apparently upset about something and will say anything to make them look bad. Be the bigger person and just stop.

ripe mesa
#

You are saying you were banned for making a tutorial which just sounds ridiculous
To be exact, I made a udemy course teaching Netick in Unity.

Netick and Fishnet seems had a beef in the past. and somehow I also got dragged into the problem

#

Pretty much everybody who has relation with Netick is banned

visual cypress
#

I wonder why...

ripe mesa
#

Do you even know the story of fishnet?

regal delta
#

It's not a story the Jedi would tell you...

ripe mesa
#

🙈

blissful jay
#

dude, the fishnet dev is banned in this server for creating fake accounts

#

imagine defending him 😰

#

@haughty heart sorry to bother you, is unity going to take action against Fishnet developer?

why is their asset still up in the asset store?

visual cypress
#

Let me guess you are also banned from their discord.

#

You do not need to tag me please

solar turtle
blissful jay
#

please inform yourself about what you are trying to discuss

visual cypress
#

I dont even know what you are trying to discuss

blissful jay
visual cypress
#

Id expect some sort of proof with all these claims. and why are you sending me unsolicited pictures?

blissful jay
#

change the subject, nice

visual cypress
#

You just did it again. I dont have any proof though. But everyone should take my word for it because you dont like me.

blissful jay
#

and see what he's doing there

visual cypress
#

How can you not have proof of something that happened on the internet??

blissful jay
#

he wouldn't be banned if he was innocent

visual cypress
#

Im surprised your hateful group isnt prosecuted for slander.

blissful jay
#

no one ever got banned for creating promotion fake accounts ever, except for him

visual cypress
#

YOU ARE BANNED! LOL!!!

blissful jay
visual cypress
#

I guess if you dont have haters you arent doing something right

blissful jay
#

let me tell the mods about you

blissful jay
visual cypress
#

Photon is banned?

blissful jay
#

people who do things the right way won't be banned

as simple as that

umbral stirrup
#

Hey I'm having a bit of trouble understanding how to make things work client side. Like I've got a camera which follows some inputs that preexists in the scene and it works fine for the host but it doesn't work at all for the client despite existing in the scene prior and its transform isn't networked so it should be different on both sides.

sharp axle
umbral stirrup
#

The camera doesn't spawn in, it already exists and the players sends it a reference to them when they spawn in.

visual cypress
#

@blissful jayI will dm you if thats okay

blissful jay
#

For mods reading this, this account @visual cypress never sent a msg in this server

This account interacted today for the first time to defend FishNet, the networking solution asset made by the notorious developer who makes fake accounts to promote his product.

Therefore it's very very likely this is an alt account of FirstGearGames/Punish(FishNet author)

haughty heart
#

No, Unity won't be removing their asset from the store unless they violate the stores policies in some way. The fact that the owner makes fake accounts is weird, and the original owner was banned for specific reasons, but that's all.

#

If someone wants to argue the use of Fishnet, they're free to do so as long as it doesn't turn into a shouting match.

blissful jay
haughty heart
#

You can report their account from their publisher page on the store, then. We have no authority over that, here.

blissful jay
#

the asset store team is under-staffed

haughty heart
#

Well, you can only wait then. We aren't the asset store team.

visual cypress
#

Anyone try bobsis tutorials?

umbral stirrup
#

Hey so for some reason the characters aren't appearing on the client side despite the fact that they have their transform and network object. It was working like I minute ago and I didn't do anything to change it I have no idea why it isn't working now T_T

sharp axle
umbral stirrup
#

No

sharp axle
# umbral stirrup No

How are your players getting spawned? And are you seeing any errors in the console?

umbral stirrup
#

When the camera controller for the character is added to the scene as the network player object it sends a server rpc to tell a script which only exists on the server side to spawn the player. There's no errors on the host side but a ton client side.

sharp axle
# umbral stirrup

You might need to restart the client. Or remove and re add the player prefab from the network prefab list

umbral stirrup
#

Oh removing and readding it from the prefab list fixed it, thanks!

ripe mesa
#

could be another alt

#

Shipwreck still has the healthy mindset about netcodes

#

and he got good humour too

ripe mesa
ripe mesa
#

but only Unity & Netick

ripe mesa
#

Im so certain that is fishnet alt

#

because of his timezone

old mural
#

@ripe mesa that discussion is off topic for this channel.

<@&502884371011731486> can someone review above conversation(s)? It’s starting to get a little creepy, but at the very least it’s not on the topic of multiplayer game dev.

old mural
#

Thanks!

haughty heart
#

We don't need to start witchhunting accounts. We are all aware of these alt accounts, we don't need to make it a big investigation.

#

And yes, please keep these channels specifically for Networking questions.

old mural
#

Can anyone help me understand the tradeoffs between have one “game session” per game server process versus having many game sessions per game server process?

I’m using “game session” to mean a game that players can connect to. I’m using “game server process” to mean literally an instance of a game server (I run mine in containers which are packed onto VMs based on expected CPU/memory/network traffic metrics expectations of my game server). One game session per game server process means the entire “purpose” of a game server is to be host to players for one round of something, like a FPV deathmatch, and then be thrown away.

My initial tradeoff summary:
one game session per game server process

  • simpler from netcode perspective; can always expect clean starting state
  • expected that game server process is terminated at the end of a match; no addition cleanup code required
  • harder from infrastructure perspective; game server process(es) must be spun up and ready (yes still true if using 3rd party hosting solution)
  • worst case players need to wait for game server spin up time (mitigated by maintaining fleet of idle game servers, at the trade of burning $ on idle compute time)

Many game sessions per game server process

  • harder from netcode perspective: must have C# code that resets the game world on the server between matches
  • Mixed on infrastructure; one still has to maintain a fleet of game server processes
  • player’s perspective probably doesn’t change but are probably not going to have to wait for game server startup.

I feel like I’m missing more pros/cons to decide which way to go, hence why I’m reaching out. Thanks for sharing any/all thoughts. Ask if I’m not being clear about what I’m asking

sacred schooner
#

I would go with whatever is easier for you to implement and iterate on focusing on making the game playable and fun, because otherwise there's a very slim chance of having more than 20 players actively playing at once. If you get it running like that and want to keep supporting the game and you see more players coming in that's when I would begin worrying about costs, performance, waiting times etc.

#

So many times people want to fixate on a random complexity in their games only to slow down in progress and eventually abandon the project altogheter, or miss the fun in their game so there's no one to ejoy that amazing efficiency and low-cost custom networking solution...

dry maple
# old mural Can anyone help me understand the tradeoffs between have one “game session” per ...

Many game "sessions" per a single server process only works for relatively simple games with few (less than 10) players per session.

Because most of Unity is single-threaded, and thus this won't scale beyond x number of sessions per game process.

However, there is an important advantage to it. You only have one Unity Game Engine overhead for all those game sessions. Since each Unity engine process has its own overhead, which is x amout of mem usage in addition to multiple threads, which all use your CPU time.

Running multiple Unity game processes (one session per process) would exhaust your CPU and RAM way faster than several game instances per process (with multiple of those too).

Now, when it comes to the netcode difficulty of this, it depends on which networking solutions you use. Most if not all networking solutions are not designed with this in mind, which makes it very annoying to work with.

However, Photon Fusion and Netick (my networking solution) are built with this in mind. In Netick, by default, your game instance runs in something we call a sandbox. A sandbox is an instance of the game, which can be a server or a client. And you can very easily run more than one sandbox together, in the same Unity process.

https://netick.net/docs/2/articles/sandboxing.html

visual cypress
#

Whats an updated ngo tutorial?

#

Can someone thats here to learn networking and not fixated on their own networks products please provide their best ngo tutorials?

dry maple
# dry maple Many game "sessions" per a single server process only works for relatively simpl...

One important thing to take care of when doing multiple instances per process, is to never lag the process.

So all instances of the game should always be ready. Even going as far as having all player prefabs being spawned already, if not pooled.

Because you don't want another in-process server to cause another in-process server that already has a session running in it to lag.

Loading scenes async is good but not good enough. It still can cause a bit of lag due to GC. But in the end, it all depends on the specific game you want to build. For fast-paced games with client-side prediction, this is kinda a must for a quality game experience.

umbral stirrup
#

Can you share the output if a render texture across a network? Like of each player has a render texture you can see what they're seeing?

upbeat marsh
dry maple
#

Impractical imo.

dry maple
upbeat marsh
#

i'm hoping to find a peer to peer networking solution that has host migration (if host disconnects, someone else takes over as host) ... security isn't a priority for my particular game (local boardgame with multiplayer)

#

just don't want to pay for dedicated server hosting

#

and people will task switch (etc) between their turns, and possibly no one will be connected at all

dry maple
#

You can use a high-level transport like LiteNetLib.

upbeat marsh
#

i already coded something that works, but have the rest of the game programmed using the Boss Room sample as a base, and having a hard time integrating my working host migration prototype into the boss room sample ... i surgically removed the part where the lobby is shutting down, and the parts where it disconnects the clients when the host disconnects, but for some reason the lobby shuts down after a while 😦

#

i've spent a few days trying to figure out why the lobby seems to shutdown

dry maple
upbeat marsh
#

my prototype with host migrations works perfectly lol ... i wonder if we should just redo the project on top of that

umbral stirrup
dry maple
umbral stirrup
#

I'm using unity relay but I'll look into those

upbeat marsh
#

i'm using unity lobby + relay/transport, was trying to avoid game server hosting

visual cypress
upbeat marsh
# visual cypress Are you using ngo? Im trying to find updated tutorials if you have any ideas ple...

oh, i just used the Unity documentation for the most part, i don't really know the best practices for it apart from that ... my code is a gigantic mess 🤓
https://docs-multiplayer.unity3d.com/netcode/1.8.1/advanced-topics/message-system/rpc/

Any process can communicate with any other process by sending an RPC. Starting in version 1.8, the Rpc attribute encompasses Server to Client Rpcs, Client to Server Rpcs, and Client to Client Rpcs.

#

yes, using NGO, but just RPC calls, not stuff like networktransform, etc

dry maple
#

But if you want server-auth gameplay, then probably a bad idea.

upbeat marsh
visual cypress
upbeat marsh
visual cypress
#

I will check that and if too much maybe try bobsis fishnet videos. He has a lot and theyre recent too. Thank you for reply.

dry maple
# umbral stirrup Thanks!

BTW, video streaming is very bandwidth expensive and too overkill for this problem.

A better solution to your problem is to sync data that lets you re-create the UI of other players.

This would be several orders of magnitude cheaper in bandwidth usage.

old mural
# dry maple One important thing to take care of when doing multiple instances per process, i...

Thanks for the responses. Good points. Fixed cost of cpu/memory per unity is a consideration. Not sure how much impact unity being single threaded would be really but obviously more players being handled by a game server process would possibly stretch per frame calculations higher and higher. As long as the game server under load can stay under the per-frame performance budget, all should be fine right?

Python is single threaded, and so is JS, and they can do fine with many concurrent requests, is pretty much my reference. In Unity I can use techniques like performing long calculations over many frames (aka coroutines), and other techniques.

You bring up what I know as “noisy neighbor” problems. You know, limited resource contention like if one container requests more CPU/MEM of its host, taking away from other containers. The interesting thing with multiple game sessions per game server process is that it adds another place for noisy neighbor that would need to be considered; other game sessions. E.g. if a malicious game client spams network packets to the game server, a poorly coded game server may allow its CPU/memory usage to increase, or if a game spawns in many game objects whose deletion causes the GC to run. Any other dimensions to sketch out on this point?

I don’t understand why the game server would need to 100% guarantee to have the right scene loaded before a player connects, or the bit(s) about sync versus sync loading. That part of your words didn’t quite make sense to me, so I’m probably not understanding something (sorry!). In my mind it’s still fine to have players all connect to a game server and only once everyone is in, to send the signal to game clients to load in the level (sync or async, just implementation details), if I wanted to. Actually right now I just have player game clients load into the desired scene and have a loading screen overlay while waiting for everyone to have joined before letting them play.

dry maple
# old mural Thanks for the responses. Good points. Fixed cost of cpu/memory per unity is a c...

As long as the game server under load can stay under the per-frame performance budget, all should be fine right?

Yes, but that's the problem. Even a little bit of a GC stall can cause the server to miss the tick deadline, which can cause rubber-banding in the clients. I am talking about server-auth gameplay with Client-Side-Prediction. Though even for client-auth, you will see other players lagging not yours due to interpolation buffer running out when the server misses the tick deadline.

, or if a game spawns in many game objects whose deletion causes the GC to run.

This is easy to deal with. Only the server is allowed to spawn network objects. Have a cap on how many objects can exist at once, of each type, etc.

I don’t understand why the game server would need to 100% guarantee to have the right scene loaded before a player connects, or the bit(s) about sync versus sync loading.

Yea, this one depends, as I said. I was thinking of a game where you would join mid-game and straight into the action. For games where everyone needs to be ready before the game starts, then it's fine. But again, you don't want another in-process server instance that is switching scenes to cause lag to other in-process instances that are in the middle of the game. Remember, all gameplay logic runs in the main thread. Async scene switching causes GC, which can cause a stall causing the lag problem.

#

Though I wonder, what type of game are you intending on building?

#

Maybe a client-auth approach that is P2P-like is a better fit.

old mural
# dry maple ` As long as the game server under load can stay under the per-frame performance...

To then refine the calculation: a game server should stay under budget included the worst case if the GC runs. I can appreciate how considering worst case frame when GC is running puts a sizable burden on available resources with GC on other active game sessions.

To think more “out loud” object pooling allows for predictable considerations for CPU/MEM resources, in part. N instances of the game scene means N * (resource requirements per scene) (+ the overhead of starting a unity process to server as a single game server instance). That can help especially during capacity planning (or as I like to call it, stuffing that VM full of running container instances).

I suppose I now realize another difference between the two styles: many game sessions per game server means more stable container runtime; one game session per game server means more of a churn of container resources. Aka game server instance startup time is = startup of container + start up of game server process + total time until 3rd party network service provider can distribute available game sessions to players (through game clients, lol). I mean, it’s not a huge cost but still one to be considered between the two styles.

Many game sessions per game server also means considering, um, veterinarian services to running game server instances. Perhaps a neutrino hits a data center in the perfect spot to kill a server process; how I handle this case needs to be considered. Actually still true for single/single, but it feels less so since a container’s lifecycle is so limited in the many/single case.

Thanks for helping to sketch this all out.

old mural
dry maple
old mural
# dry maple Maybe a client-auth approach that is P2P-like is a better fit.

Destiny apparently has multiple classes of game services that are either P2P run (one player is host), and others more trusted operations are handled under client/server authority.

For my games, yes. Server auth is a requirement. Server runs physics, and it has to be accurate for everybody. High reaction gameplay is not a requirement, so things being a little slower is fine.

dry maple
dry maple
old mural
dry maple
old mural
#

Giving all this a good think over.

umbral stirrup
#

Shouldn't this set the text for this textmeshpro to the newdistance value on all the clients as well? It only sets the text on the host for some reason.

sharp axle
visual cypress
sharp axle
crystal prairie
#

Hey can I make a game that use hotspot to make a multiplayer game

#

Please share a tutorial

blissful jay
sharp axle
ripe mesa
#

Fishnet Alt

vestal bronze
#

Good morning you lovely people!

I am trying to send a smart switch signal to trigger a unity event and vise versa. Anyone got an idea where to start or what to use? I am completely lost 😵‍💫

vestal bronze
#

UPDATE: okay so I read into UnityWebRequest and it seems to be the thing I am looking for. Issue now is that I am struggleing to find the right method as I am just calling the url without trying to get or set a different value.

old mural
# vestal bronze Good morning you lovely people! I am trying to send a smart switch signal to tr...

I’m assuming “smart switch” means a physical IoT button; I’m also going to assume there is a service built backend for the button. If I’m right, share the make/model so perhaps I can more accurately advise. If I’m wrong, sorry!

Given we’re in networking channel, I’m also going to assume it’s for a server/client multiplayer model; you have one game server hosting a game session for players, who are playing through game clients.

To integrate a smart button into your experience, you’ll have to decide who pressed the button/toggles the switch. Is it a player, or is it some game administrator? If it’s an admin, presumably it’s to change the state of the game server. If it’s a player, you’ll just have to lay the plumbing so the client makes an RPC call onto the server so that the server knows about the physical interaction. Great.

But how does a client or server know about the physical interaction? That’s where you’ll have to figure out if the game client or server needs to ask the IoT service (aka pull), or if the IoT service can tell the client/server about the push (push). Pull or push, there are techniques to be mindful of.

To pull info, the simplest version is to poll at some regular interval (say 30 seconds) to see about a state change. Is the game client or is the game server polling the IoT service? You can provide more secrets (like API keys) for a game server since you can trust it more; if there are secret values to handle then the game clients scenario becomes more complicated.

If the IoT service supports pushing state changes, then you’ll need to set up whatever you need to in order to “catch” the update. I’ve often seen this using webhooks.

Hope this kinda clears some things up, presuming my assumption of what you’re trying to do is accurate

sharp axle
vestal bronze
#

You can probably tell that I am kinda new to this sorta stuff. So sorry if my question was unclear 😅
Im gonna go a bit more into detail. Basically its a Shelly smart plug that can be triggered by calling this URL http://[IPADRESS]/relay/0?turn=toggle. What I used to test before was a Application.OpenURL but thats not really what I want since it actually opens a browser window outside the game. What I am struggling with is the fact that I only seem to find GET and POST methods for UnityWebRequest which I dont really need. I just need to call this URL for it to toggle the switch, not change any values with POST

old mural
old mural
sharp axle
vestal bronze
marsh musk
#

When the server shuts down, I load the menu scene for the clients again, but when I do, there becomes two network managers under don't destroy on load, I thought that because it's a singleton, that it would only have one instance, do I have to deal with the multiple instances, like is it initial, or should be destroying the copy of itself.

BTW I used regular scene manager since the server should have been shutdown, is it still supposed to be the network manager scene manager?

blazing pelican
#

Hi, I'm making a unity (unity 6 preview) WebGL multiplayer game and I wanted to avoid servers and instead have one player act as the host. I noticed that Unity Transport doesn't support WebGL as a server but only as a client. Is there a way around this? Would Relay allow a webgl to act as a host? Or do I need to switch to using dedicated servers? Thanks for any help

blazing pelican
old mural
# marsh musk When the server shuts down, I load the menu scene for the clients again, but whe...
  1. This is kinda funny that we’re talking about multiple singletons. Thanks
  2. A part of a singleton implementation on top of MonoBehaviour is to add in logic to either delete the game object or disable the component if it detects another instance of a singleton exists.

Are you using additive scenes? Maybe it’s best to have game clients restart at the menu scene if so? Or some other scene. The idea is to “hard reset” to a known state on game server disconnect.

marsh musk
#

@old mural I connect the host and clients like normal, but when the host disconnects, I send the clients back to the menu, with the scene manager load scene function, when I do the network manager just adds another network manager, since it's on don't destroy on load, but I assumed it would destroy the instance already in the scene that's present the first time, instead it just keeps two network manager objects in don't destroy on load

sharp axle
old mural
# marsh musk <@1085217901784617141> I connect the host and clients like normal, but when the ...

Hehe. Full disclosure: I avoid singletons (but respect all singleton action by anyone else). What @sharp axle just said is exactly what to do. I categorize that is “cleaning up singletons.” Heck, maybe even before you redirect game clients back to the menu maybe the scene that loads the network manager destroys it before redirect. I think that might be cleaner, than having your main menu clean up possible resources from other things. But whatever works!

I myself just prefer to kinda think of scenes as the unit of “thing” that maintains more complex things. If I need a game system in a scene I just pull in a prefab of that game system into the scene, and only have one of those as a creative decision. I think it’s simple but everyone has their own preferred way of making things work.

clear gull
#

what is this

marsh musk
#

@sharp axle what is a bootstrap?

sharp axle
# marsh musk <@86985386886201344> what is a bootstrap?

Just a completely empty scene with only your managers and/or Singletons in it. And a single script that will load the main menu in Start(). Make that the 1st scene in your game and will never have to worry about duplicates

#

Downside is that you always have to test from that bootstrap scene. There are some editor tricks you can pull to always load the bootstrap scene when you hit play from wherever.

half elbow
tacit merlin
#

hey we're looking for a music artist for an upcomming GameJam (starting tomorrow 9 pm and lasts 10 days). We're making a industrial horror game o/

sharp axle
fringe imp
#

on my client network transform, when in game, interpolate gets turned on with no option to turn off. I have it unchecked. Any Ideas?

old mural
fringe imp
gusty thicket
#

Hey ! what do you recommend for a MMORPG (max 100 players online) between "Photon Fusion" and "Unity Netcode" ?

old mural
# gusty thicket Hey ! what do you recommend for a MMORPG (max 100 players online) between "Photo...

Photon fusion, UNET (Unity’s old netcode library), Mirror, or NGO (netcode for game objects, Unity’s new netcode library) all kinda have similar advise, since they’re all netcode libraries with very, very similar concepts…

Send only what is necessary; try to limit what commands/RPCs/variables need to be synced to the bare minimum. Limit the range each where a player would need to see other players (dubbed interest management in mirror).

Talking past the netcode now- since mmorpg game servers are long running processes, make sure that players joining/leaving doesn’t cause a memory leak or anything.

old mural
# gusty thicket Hey ! what do you recommend for a MMORPG (max 100 players online) between "Photo...

Tagging in @dry maple in case they have some helpful insight for MMORPGs in terms of netcode library but more importantly different game server topologies to set one up.

E.g. does only one game server maintain one persistent mmorpg world, or does it make more sense to have different game servers maintain different regions of the world, and game clients are passed between game servers when traversing between regions? That’s kinda the curiosity I have of like how people actually set up an mmorpg solution…

gusty thicket
#

For now, i really want do most simple , so one server for now but maybe later , we will add more

sharp axle
#

It really depends on what you mean by MMO. Fortnite can handle 100 players. and Valhiem is a persistent world. Neither I would call an MMO

old mural
gusty thicket
old mural
gusty thicket
old mural
gusty thicket
#

Sorry but when it's work at the first time blobdance

gusty thicket
#
using UnityEngine;
using UnityEngine.SceneManagement;
using Fusion;

private NetworkRunner _runner;

async void StartGame(GameMode mode)
{
    // Create the Fusion runner and let it know that we will be providing user input
    _runner = gameObject.AddComponent<NetworkRunner>();
    _runner.ProvideInput = true;

    // Create the NetworkSceneInfo from the current scene
    var scene = SceneRef.FromIndex(SceneManager.GetActiveScene().buildIndex);
    var sceneInfo = new NetworkSceneInfo();
    if (scene.IsValid) {
        sceneInfo.AddSceneRef(scene, LoadSceneMode.Additive);
    }

    // Start or join (depends on gamemode) a session with a specific name
    await _runner.StartGame(new StartGameArgs()
    {
        GameMode = mode,
        SessionName = "TestRoom",
        Scene = scene,
        SceneManager = gameObject.AddComponent<NetworkSceneManagerDefault>()
    });
}

private void OnGUI()
{
  if (_runner == null)
  {
    if (GUI.Button(new Rect(0,0,200,40), "Host"))
    {
        StartGame(GameMode.Host);
    }
    if (GUI.Button(new Rect(0,40,200,40), "Join"))
    {
        StartGame(GameMode.Client);
    }
  }
}

public class BasicSpawner : MonoBehaviour, INetworkRunnerCallbacks
{
  public void OnPlayerJoined(NetworkRunner runner, PlayerRef player) { }
  public void OnPlayerLeft(NetworkRunner runner, PlayerRef player) { }
  public void OnInput(NetworkRunner runner, NetworkInput input) { }
  public void OnInputMissing(NetworkRunner runner, PlayerRef player, NetworkInput input) { }
  public void OnShutdown(NetworkRunner runner, ShutdownReason shutdownReason) { }
  public void OnConnectedToServer(NetworkRunner runner) { }
  public void OnDisconnectedFromServer(NetworkRunner runner, NetDisconnectReason reason) { }
  public void OnConnectRequest(NetworkRunner runner, NetworkRunnerCallbackArgs.ConnectRequest request, byte[] token) { }
  public void OnConnectFailed(NetworkRunner runner, NetAddress remoteAddress, NetConnectFailedReason reason) { }
  public void OnUserSimulationMessage(NetworkRunner runner, SimulationMessagePtr message) { }
  public void OnSessionListUpdated(NetworkRunner runner, List<SessionInfo> sessionList) { }
  public void OnCustomAuthenticationResponse(NetworkRunner runner, Dictionary<string, object> data) { }
  public void OnHostMigration(NetworkRunner runner, HostMigrationToken hostMigrationToken) { }
  public void OnSceneLoadDone(NetworkRunner runner) { }
  public void OnSceneLoadStart(NetworkRunner runner) { }
  public void OnObjectExitAOI(NetworkRunner runner, NetworkObject obj, PlayerRef player){ }
  public void OnObjectEnterAOI(NetworkRunner runner, NetworkObject obj, PlayerRef player){ }
  public void OnReliableDataReceived(NetworkRunner runner, PlayerRef player, ReliableKey key, ArraySegment<byte> data){ }
  public void OnReliableDataProgress(NetworkRunner runner, PlayerRef player, ReliableKey key, float progress){ }
}

I have this error :

Assets\BasicSpawner.cs(30,1): error CS0106: The modifier 'private' is not valid for this item
#

Someone know why ?

sharp axle
blissful jay
#

this chart is written by the fishnet developer named punfish(firstgeargames) who is banned in this server for creating fake accounts

probably this chart is filled with fake information as that's what punfish is known for

i suggest to use either one of these:

Unity NGO,

MIRROR

or

PHOTON FUSION

#

i use photon fusion, and consider it to be the best, and there are benchmarks show that

ruby glen
#

who are you

sharp axle
#

I would say that Photon probably has the biggest userbase. It can get pricy but there are tons of resources which is good and bad. There is lot of outdated tutorials out there for all of these frameworks. I'm biased towards Unity's NGO. But you can check the pinned message here for more resources

blissful jay
#

are you one of the punfish other alts?

ruby glen
#

Ive seen a lot of praise for Fishnet and have seen mirror isnt as popular. I was in the mirror server for awhile and I agree it wasnt active.

blissful jay
#

in this server

ruby glen
#

please leave me alone

blissful jay
#

and others

#

because of fake accounts

you probably saw the fake accounts praising it

#

lol

#

there are no games successful games in the fishnet netcode

ruby glen
#

@sharp axlesince you use unitys program have you tried Fishnet?

blissful jay
#

even though it is out for 4 years

#

it's shovelware full of bugs and stolen code

sharp axle
blissful jay
sharp axle
#

I don't think of them at all. They aren't worth the effort

ruby glen
#

I saw on the chart a few were paid but im not sure I need those features. It says the price is only a few dollars anyway if I really did. I know thats not free free like I said but thats cheap enough to consider imo

blissful jay
ruby glen
#

im feeling you are bias

blissful jay
ruby glen
#

its always aggressive ones that are the problem

blissful jay
sharp axle
blissful jay
#

i think we might need to call the mods

ruby glen
blissful jay
#

how can you trust someone like that

ruby glen
#

how do you message mods

blissful jay
#

i see you have no msgs in any other server, and you joined today

ruby glen
#

<@&502884371011731486> @blissful jay has been harassing me since I joined and I asked them to stop

blissful jay
#

to talk about fishnet

#

this is punish(firstgeargams) alt

#

social engineering, playing the victim

#

you are trying to git rid of me using another alt account because i am exposing you,

hopefully the mods are smart to understand that, since they know about your ways

I checked the Fishnet server, this account is in there and he has no msgs in there EVER.

ruby glen
#

im going to take a break and hope youre gone when I get back

old mural
#

Yea go with photon or mirror. Mirror is a really active community and it’s open source. Probably your best bet IMO. Otherwise if you have money to burn go with photon or if you want to stay with Unity, NGO.

oak flower
#

@ruby glen

Ive seen a lot of praise for Fishnet and have seen mirror isnt as popular. I was in the mirror server for awhile and I agree it wasnt active.
Removing your chart.
Don't spread misinformation here, thanks.
Mirror server is quite active and has daily updates log.

ruby glen
#

im not sure what you mean. mirror did not seem as active as other servers im in. to me the community is not that active that is how I perceive it. why is the chart not allowed? if something was wrong with it wouldnt it be removed off the forums? thats where I found it

blissful jay
#

i have noticed that there are a couple of users in the fishnet server who try to talk each day in there to make it look more "Active"

the punfish is known to pay people from poor countries to do random things for him

#

like here

old mural
blissful jay
#

he also probably pay people like this account to spam this server

#

sometimes i have seen that the fake accounts use weak language

ruby glen
#

is this even the unity discord?

haughty heart
#

Can you both stop bickering. This channel is for asking and answering questions. We don't need to debates.

blissful jay
ruby glen
#

I didnt even start anything and i asked shipwreck many times to leave me alone.

old mural
#

zzz

haughty heart
ruby glen
#

and this was the first rule I saw when coming in. funny
• Engaging in harassment, abuse, discrimination, name-calling, or other personal attacks.

blissful jay
ruby glen
blissful jay
#

sorry if it's annoying

haughty heart
#

As I said before, we're aware the developer of the asset has alt accounts, but we're not going to investigate every claim.

distant bolt
ruby glen
#

move on from what?

#

what did i even do?

#

nevermind forget it

#

i dont know what half those things mean so i will trust you on it being cool.

white torrent
#

I'm experimenting with building a hazelight studios-like split screen multiplayer game just for fun. How do you guys think i should handle the cameras?

Give each player prefab a camera and try to log it in a list and modify the rect of each of them - What I'm currently trying to do, to no avail atm. I'm using cinemachine and one camera just standby's when i try to get both on the same screen

Try to create a dummy (local) camera and sync it to the other player's position, this looks doable. But how would i get the second player's UI then? or the inputs on screen

sharp axle
white torrent
#

a story game meant for two players in coop split screen over the network

blissful jay
#

It Takes Two

old mural
# white torrent I'm experimenting with building a hazelight studios-like split screen multiplaye...
  1. Set Up Split-Screen

To create a split-screen effect, you can use Unity’s camera rect property to define what portion of the screen each camera should render:

Assign Camera Rectangles: Select the first camera and set its Rect property (in the Camera component) to (0, 0, 0.5, 1) for the left half of the screen. For the second camera, set it to (0.5, 0, 0.5, 1) for the right half.

I haven't made split screen multiplayer before. I do see there is a "viewport rect" that takes in coordinates between 0 and 1.

I think the idea is to have two main cameras, one on the top half and the bottom half. Then I'm assuming two cinemachine cameras, each assigned to a different main camera.

I'm going to try this out myself.

white torrent
#

i just can't get it to work over the network

#

locally i tried with the input system manager's join system

sharp axle
#

You wouldn't use the input system for this unless using local multiplayer

white torrent
#

I kinda have this setup already, it's just that the client camera keeps "taking control" of both

sharp axle
#

You'll need to make sure that only the local player camera is accepting inputs

old mural
# white torrent i just can't get it to work over the network

Sorry about being slow...

What does it mean to want to do "split screen" over the network? Is there two game clients for the two players, each that renders out it's own split screen? E.g. player 2 is on the bottom of the screen and on game client for player 2, they control that... But they see everything player 1 is doing on the top of their screen?

white torrent
#

and it kinda mixes and matches together too. like if player 1 is going through an important moment his screen takes more screen space than the other one

old mural
white torrent
old mural
white torrent
#

this is where i got, as you can see i get two cameras but they are either both on one player or both on the other. this is the code for this contraption:

private void OnClientConnection(NetworkManager manager, ConnectionEventData data)
{
    if (data.EventType == 0)
    {
        if (networkManager.IsHost) { 
        playerCameras.Add(networkManager.ConnectedClientsList[(int)data.ClientId].PlayerObject.GetComponentInChildren<Camera>());
        }
    }
}

 void Update()
 {
     secondScreenWidth = 1f - cameraBalance;
     if (networkManager.IsServer) {
         DoSplitScreen();
     }
 }

void DoSplitScreen()
{
    if (playerCameras.Count < 2) return;
    Debug.Log("Split screen should be working.");
    playerCameras[0].rect = new Rect
    {
        xMin = 0f,
        yMin = 0f,
        xMax = cameraBalance,
        yMax = 1f

    };
    playerCameras[1].rect = new Rect
    {
        xMin = cameraBalance,
        yMin = 0f,
        xMax = 1f,
        yMax = 1f

    };
}
#

oops my bad

sharp axle
ripe mesa
#

@ruby glen @visual cypress
Im so sure this is fishnet alts

#

@blissful jay you agree?

blissful jay
ripe mesa
#

👋 Hi

haughty heart
white torrent
#

hlapi beef is crazy

ripe mesa
#

I undestand, I dont start a debate. just making sure people are not being fooled by alts

haughty heart
#

And I'm telling you to stop dredging it up so it doesn't become a debate every time. Move on, block them if they're bothering you. Thanks.

white torrent
#

I'm building a two player co-op game. Does it make sense to build it with server authoritativity in mind? I'm not worried about cheating at all, but i've heard about some desync issues. I don't really get what would get "desynced", so it's a bit hard to imagine, but i'm guessing i could build most of the game giving the authority to the client and give it to the server where needed. Just don't really know where i'd use it (?)

strange jungle
white torrent
strange jungle
#

basically the server should simulate evrything related to the game state and send it to the clients so everything is synced

woven jacinth
#

Anyone have recomendations for a networking solution? I'm not sure which to choose between fishnet, fusion, mirror, or netcode. If it helps, my game idea is a fast paced fps with 2-8 players.

austere yacht
uncut basin
#

hey yall , im trying to use [ClientCallBack] but it isnt working (i am using unityEngine.Networking) was it changed because i cant find a changelog

ripe mesa
#

fusion has made br200, a highly competitive shooter

#

while we dont have anything battle tested for fishnet

zealous seal
#

!code

raw stormBOT
zealous seal
old mural
#

https://youtu.be/_Cu97mr7zcM

Does anyone know how one might implement a server/client visualization (“what the server sees” vs “what the client sees”) for hithoxes like in this video @ 2m35s?

I imagine it’d have something to do with timestamps. E.g. player shoots and the timestamp of their interaction is sent to the server, and the coordinates/other state for the red “what the server sees” hitbox is sent back to the client where the client can position both red and blue character hitboxes.

VALORANT’s technical director, Dave Heironymus, and technical engineering lead, David Straily, know the pain of bad servers getting in the way of landing clean shots. Here’s what we’re doing to keep VALORANT’s netcode and server infrastructure sharp so that you’re in control of each engagement.

Learn more at:
https://PlayVALORANT.com

Follow ...

▶ Play video
old mural
sharp axle
hollow sentinel
#

does anyone have any good resoureces to learn how to do steam multiplayer? I want to learn basic p2p where player one hosts the lobby, then additional players can join in the lobby and play whatever mission is happening. Im also down to learn it in a non-steam related way if its better or easier

old mural
sharp axle
#

well server prediction in their case. normally the client is running ahead of the server

sharp axle
old mural
hollow sentinel
old mural
sharp axle
hollow sentinel
# sharp axle I use Unity Netcode, But Photon and the other are just as good and have been aro...

https://www.youtube.com/watch?v=3yuBOB3VrCk&ab_channel=CodeMonkey this? is this p2p that will be compatible with steam freinds list joining down the line?

#

i need the players to not need to port forward or anything like that

#

just join eachother and have networking handled

sharp axle
hollow sentinel
#

oh where can I find this 6hr tutorial? and by basics what do you mean, where could I learn them? thanks for help

sharp axle
# hollow sentinel oh where can I find this 6hr tutorial? and by basics what do you mean, where cou...

💬 Here is the Multiplayer Course! I really hope both of these FREE courses help you in your game dev journey! Hit the Like button!
🌍 Course Website with Downloadable Project Files, FAQ https://cmonkey.co/freemultiplayercourse
🎮 Play the game on Steam! https://cmonkey.co/kitchenchaosmultiplayer
❤ IF you can afford it you can get the paid ad-free ...

▶ Play video
hollow sentinel
#

cheers legend

zealous seal
dry maple
# old mural https://youtu.be/_Cu97mr7zcM Does anyone know how one might implement a server/...

You need to have a history buffer to store past positions/rotations of each player. (I wrote a short article of how to implement lag-comp hit detection in Unity Multiplayer Server if you are interested in that).

Then you can append each client's input with the snapshots ticks that it was seeing at the time of the shooting in addition to the alpha, to recreate the view of the client later in the server.

But, this actually won't work with the default Unity animator, it won't be accurate enough. Because we can't control precisely how the animation is played in it.

So you must implement your own animation system using the Playable API to have perfect tick-accurate animations.

Then all you have to do to be able to make a visualization like that is to make a copy of the skeleton of the character with only the Hitboxes/Colliders, and draw them using Gizmos.DrawCube/DrawSphere.

You make a copy of the current state of the character (present time in the server).
And also a copy of the lag-comp state of the character (client past time).

old mural
dry maple
zealous seal
old mural
zealous seal
old mural
# zealous seal Yes is this function, and what is superclass?

The superclass is the class that you based your own “CreateAndJoinRooms” class on. It basically says “I want all the code included in the superclass plus what I write myself.”

Long story short: open up the MonoBehaviourPunCallbacks class and look for when it executes the “OnRoomListUpdate” function. That’ll may give you a better idea when it gets called.

dry maple
white torrent
dry maple
white torrent
dry maple
white torrent
#

i can and should just do that server side right?

dry maple
white torrent
dry maple
#

It would be helpful to know what type of game/genre are you making.

#

If it's an FPS, and you just want to throw a grenade, you can do that client-sided and it will be fine.

white torrent
#

kind of like hazelight studios games

white torrent
dry maple
#

I played it locally on split-screen, don't know how it behaves over the network.

#

But I would use CSP with a game like that, for sure. Just in case one of the minigames need accurate interactions.

white torrent
white torrent
dry maple
#

One of the coop players will act as a host/server, so you should just do it server-auth from the start.

white torrent
dry maple
#

You probably want to use a solution built with CSP in mind, like Photon Fusion, or Netick (my free networking solution).

white torrent
white torrent
white torrent
#

idk about switching api. i was using fishnet for another project and had the worst experience cause there were near to zero tutorials at the time. ngo is very similar but I'm having a better time already

dry maple
#

You just add NetworkRigidbody to your character, and use AddForce, and you are done. Mostly.

white torrent
dry maple
white torrent
dry maple
white torrent
#

How would i go about synchronizing a list of cameras in ngo? i need my client to parse through all the connected players' cameras and to do so i tried having the server do the logic and then sending an rpc with the parsed cameras to the clients, but that doesn't work since Cameras are not serializable in ngo

half elbow
white torrent
#

(as the client)

half elbow
#

why do you need every client's cam?

white torrent
half elbow
#

gotcha

white torrent
#

i got it server side, just not client side

half elbow
#

well while Cameras are not serializable in ngo,you can pass a networkobjectreference, here's how to pass an object:

    [ServerRpc(RequireOwnership = false)]
    public void SendObjectServerRpc(NetworkObjectReference objectreference)
    {
        SendObjectClientRpc(objectreference);
    }

    [ClientRpc]
    public void SendObjectClientRpc(NetworkObjectReference objectreference)
    {
        if (objectreference.TryGet(out NetworkObject object))
        {
        //here you can do whatever you want with the object for example
        object.getcomponent<camera>().bla bla bla
        }
    }
sacred schooner
#

you can do that, or have the same list of all cameras locally, and have the code for them run only on the target computer, that's how you do almost anything. All networkPrefabs as well as all networkBehaviour objects will be replicated across clients, so you would need to store the same list of "local" cameras and act on them as needed, only verifying who runs the code under what condition

#

I always like to imagine the world being identical on both clients initially, and you picking who knows about which changes, so other players' positions etc. Anything else will, by default, stay the same if not explicitly changed

white torrent
#

can't get how to update to 2.0.0 where it's not like this anymore

sacred schooner
#

gotcha, I didn't dig too much into direct netwrokObject id values, but if they're identical across clinets (I would assume so, otherwise how would they keep track of anything lol), you can pass around those as strings. So send an id, and look for it on the target client. Ideally, if you do it often, or want more security, map those camera components to those id

#

id's directly, and you'll get O(1) time of getting them by ID, so basically like if you did it locally

white torrent
#

i didnt even know that was a thing

sacred schooner
#

it should be, not sure how accessible it is for outside scripts, but there should be this id field for each networkObject component, the one you have to put at the root of an object for networkbehaviors under it to work

#

I would be surprised if that wasn't the solution under the hood at least, because you can't rely on the scene hierarchy or names to replicate any change reliably

#

yup, here you go, they mention serializing networkobject references as well as globalobjecthashId here: https://docs-multiplayer.unity3d.com/netcode/current/basics/networkobject/

A NetworkObject is a GameObject with a NetworkObject component and at least one NetworkBehaviour component, which enables the GameObject to respond to and interact with netcode. NetworkObjects are session-mode agnostic and used in both client-server and distributed authority contexts.

#

that should do it for you then

sharp axle
white torrent
white torrent
white torrent
#

idk if i should try having a network variable or just loop through each client everytime one spawns

sharp axle
sacred schooner
#

yup, that sounds reasonable, you can expand it later to not contain the camera component reference directly, but some intermediate script responsible for more things if needed as well

sacred schooner
#

Not sure if you can serialize the camera component directly in a networkvariable like that though, sounds like going full circle on the issue, no?

sharp axle
#

Ah, you're right.

sacred schooner
#

If you were to explain what do you need that for im sure we can skip the serializing of components directly anyway, sounds like a design flaw

white torrent
#

sure

#

let me explain

sacred schooner
#

you most likely want to just tell the correct client to do something with their camera

#

but might be wrong, so go ahead

white torrent
#

not really, as i stated i'm trying to build a 2 player split screen networked game. Never done anything like this before, but to have the split screen happen i have a split screen manager that should take in both client's cameras and then set them to their respective sizes. Got this to work on the host side, not on client side

sacred schooner
#

oh so the issue occurs when the 2nd client joins, and the 1st client has to know about the newly spawned camera to adjust it via the manager?

white torrent
#

the issue occurs when the second client ( so not the host) joins and has no idea of the other player's camera

#

cause i parse that into a list at the spawn of the respective client

#

i'm trying most of all to learn the mindset of networking coding

sharp axle
#

Use the Player Object's OnNetworkSpawn() to add its camera to the split screen manager

sacred schooner
#

oh alright, so no need to do anything via the network then, you can have network onclientconnected callback on it, or let the camera manager (singleton probably, right?) know "hey, i spawned, here's the camera component ref" locally on the onnetworkspawn

white torrent
sharp axle
sacred schooner
#

yeah, you don't need to send anything via the network, once a player joins it's playerprefab is spawned across all clients, you can let the local screen manager know you spawned and pass the camera as an argument, have the manager remember the reference then

white torrent
#

as of right now i have (in my splitScreenManager) this code

private void OnClientConnection(NetworkManager manager, ConnectionEventData data)
    {
        if (data.EventType == 0)
        {
            if (networkManager.IsHost) {
                playerCameras.Add(networkManager.ConnectedClientsList[(int)data.ClientId].PlayerObject.GetComponentInChildren<Camera>());
            }
        }
      
    }
``` should i change approach completely?
sacred schooner
#

this looks kinda devious not gonna lie

white torrent
#

XDD

#

i'm trying

sharp axle
sacred schooner
#

you just overshot with the complexity a bit i think that's all, you send information across the network only if its neccessary, that here is not one of those

#

Follow what otaku here says, the OnNetworkSpawn() will run across all clients once an object is fully instantiated from a prefab and "ready for action", that's when you let anyone that needs to know you're here

white torrent
#

so i'll just use each client's onNetworkSpawn and have them send their cameras/objs to a local splitscreenmanager that handles stuff separately

sharp axle
#

Now you will need to Find the reference to playerCameras if its not a Singleton. The player object will have no idea what that is when it spawns

sacred schooner
#

yes sir, cameras is something you pretty much always handle locally, unless you do some cutscene or need all player cameras to look at something at once, otherwise all local code. I guess cutscenes and similar can also be handled locally with a simple RPC with some custom cutscene or action ID, much less overhead anyway

sharp axle
#

You could also fire off an event that the playerCameras can listen for. If you're feeling fancy

white torrent
white torrent
sacred schooner
#

yeah I get it. Especially if you wanna go down the mixed-authority route, I have a dumb issue now where putting a few extra non-network classes and singletons at once into my code completely broke clients connecting to each-other and the server. Fun times.... fun times

sharp axle
#

I try to avoid Singletons like the plague. Especially in Networking

sacred schooner
#

I guess you shouldn't jump the shark and always use VCS, I now basically take baby steps to see when it all went down the shithole

sacred schooner
white torrent
sharp axle
white torrent
#

yeah i've been using events too

#

built a little event manager to make it easier

sacred schooner
#

serialize references, and enforce some top-down hierarchy, but Singletons are king when it comes to just getting things going

white torrent
sharp axle
white torrent
white torrent
# sharp axle You can. But I wouldn't. It needs to be on a network object and those get respaw...

Sorry for the constant pings. This'll be the last one.
I made my cameraBalance float attribute a networkvariable, it's a public variable so i tried changing it in the inspector and it doesn't look like it syncs with the client. Am I using it wrong?
The onValueChanged event doesn't look to fire either,

public class splitScreenManager : NetworkBehaviour
{
    public static splitScreenManager instance { get; private set; }
    public NetworkVariable<float> cameraBalance = new NetworkVariable<float>(0.5f);
    
    public override void OnNetworkSpawn()
{
    base.OnNetworkSpawn();
    cameraBalance.OnValueChanged += cameraBalanceChanger;
    
}
//here i just tried copy pasting what i had in update to see if it worked but nothing, not even the Debug.Log fires
private void cameraBalanceChanger(float previousValue, float newValue)
{
    if (playerCameras.Count < 2) return;
    Debug.Log("Split screen should be working.");
    playerCameras[0].rect = new Rect
    {
        xMin = 0f,
        yMin = 0f,
        xMax = Mathf.Lerp(previousValue, newValue, 0.2f),
        yMax = 1f

    };
    playerCameras[1].rect = new Rect
    {
        xMin = Mathf.Lerp(previousValue, newValue, 0.2f),
        yMin = 0f,
        xMax = 1f,
        yMax = 1f
    };
}
sharp axle
white torrent
# sharp axle Where is `playerCameras` getting set here?

i just copied the code necessary to give you context. playercameras gets his cameras from a script on the player, like we said. When the code snippet that is in cameraBalanceChanger was in Update, it worked perfectly both on client and server, so i don't think it's that

sharp axle
white torrent
white torrent
sharp axle
white torrent
#

lemme try and remove the instance manager for the singleton

#

nothing

white torrent
sharp axle
#

tried switching from onnetworkspawn() to

zealous seal
#

!code

raw stormBOT
zealous seal
weak plinth
#

Hey, does anyone here know how to do correctly BackfillTickets update on dedicated server when players leave and join the server?

Everything is working fine on my server except this backfillticket update.

backfillticket approval is called in coroutine once per second and creation is done on server start.

Here is image with error so if anyone can help it would be really nice.

brisk chasm
#

how does things like pun sync for example objects and variables in scripts across clients. like how do the know what objects are the same between clients and what script it should put the variable in?

ripe mesa
#

or PhotonView

sharp axle
#

Backfill ticket

violet tapir
#

Can somebody tell me why nothing happens when the client with the id 1 presses on that game object?

#

I am only starting with Netcode maybe I have a wrong idea how all that stuff works

zealous seal
sharp axle
violet tapir
#

thanks, do you now how to fix it? I found the problem already, but I dont now how to fix it

sharp axle
# violet tapir thanks, do you now how to fix it? I found the problem already, but I dont now ho...

The easiest way is to use the new [RPC] so you don't even need duplicate functions
https://docs-multiplayer.unity3d.com/netcode/current/advanced-topics/message-system/rpc/

Any process can communicate with any other process by sending a remote procedure call (RPC). As of Netcode for GameObjects version 1.8.0, the Rpc attribute encompasses server to client RPCs, client to server RPCs, and client to client RPCs. The Rpc attribute is session-mode agnostic and can be used in both client-server and distributed authority...

violet tapir
#

thanks

upbeat pine
#

Im lost

#

how could I fix this

#

im unable to insert my player prefab into my network manager

sharp axle
# upbeat pine

sounds like the prefab list scriptable object might be missing or somehow corrupted

blissful jay
# upbeat pine

go to the fishnet developer discord server, he's not here because he's banned here so you won't get good help asking questions about it here

upbeat pine
#

they told me to upgrade fishnet

blissful jay
blissful jay
#

@old mural you had a perfect reply, why did you delete it my man

old mural
blissful jay
old mural
upbeat pine
#

I've tried to upgrade my fishnet and it resulted in more exceptions. Now i get :

Assets\FishNet\Runtime\Generated\Component\Utility\DefaultScene.cs(39,26): error CS0104: 'Scene' is an ambiguous reference between 'FishNet.Utility.SceneAttribute' and 'GameKit.Dependencies.Utilities.Types.SceneAttribute'

#

im a bit confused by how I can eliminate this problem

blissful jay
old mural
upbeat pine
#

so do you think I should just scrap fishnet and move on completely

upbeat pine
#

fuck

#

thats gonna take so long

#

oh well

old mural
sharp axle
upbeat pine
upbeat pine
blissful jay
# upbeat pine is fishnet really that bad?

yes, it's also maintained by a dishonest and deceptive individual who's a master of fraudulent marketing (making fake accounts that spam different servers to promote his shovelware)

we recommend avoiding using fishnet, and instead use a more battle-tested system like NGO, mirror, or fusion.

upbeat pine
#

well this is certainly a rabbit hole

#

what would you say is best

blissful jay
upbeat pine
#

NGO, mirror or fusion

blissful jay
#

Fusion 100%

upbeat pine
#

why

blissful jay
#

it's way way better than anything else out there

blissful jay
#

used in games played by millions of gamers around the globe

#

it's not free, that's the only problem with it

upbeat pine
#

I see

blissful jay
#

But, if you calculate the cost, it's only 1% of your game revenue

#

steam already steals 30%

blissful jay
#

I think you meant PUN, that is no longer supported by the photon team.

sharp axle
#

None of them are all that different from each other. Just various flavors for the same concepts of RPCs and Network Variables

blissful jay
#

also UNET didn't invent RPCs

#

it's a concept from webdev

blissful jay
#

you will be delighted

sharp axle
#

I have not. too expensive for my blood

blissful jay
#

it's not

#

the photon calculates that in average they only take less than 1% of your game revenue

#

if you publish in steam

#

steam takes 30%

#

for nothing other than hosting your game

old mural
blissful jay
#

Fusion is original

sharp axle
#

Mirror was the continuation of UNET

old mural
# blissful jay Fusion is original

Negative; photon fusion. This is the talk where the photon devs say they forked UNET: https://m.youtube.com/watch?v=Y1my5bKhKJY

This talk discusses the important trade offs in developing multiplayer games, such as server vs client authority, local determinism vs state serialisation, rollbacks, and other known and proven mechanisms.

For more information on Unite Europe and future Unite events visit this page. https://unite.unity.com/

Christof Wegmann - Exit Games

▶ Play video
blissful jay
#

LOL

#

they probs are talking about PUN

#

the classic photon solution which is no longer supported

old mural
blissful jay
#

it's a whole new netcode lib

#

called Photon Fusion

#

your information needs an upgrade, lol

old mural
blissful jay
#

so of course it's not inspired by unet

#

@old mural

the punfish/fishnet dev was bothering fholm (the inventor of fusion) everyday to teach him how to write client-side prediction

you can find all that stuff in the mirror watercooler channel

ripe mesa
#

Evilotaku has tried fusion once i think

#

But just a small attempt

ripe mesa
sacred schooner
#

No one cares about it, but I think many people will end up in the same spot as me... I found the culprit after at least 3h wasted... The issue went away once I enabled a PlayerInteractor script... a Monobehavior script attached to the PlayerPrefab

Disabling it again after connecting successfully at least once did not cause the issue to occur again... this is mindblowing, these inconsistent errors without clear explanations were the reason I was about to give up within the next 10 minutes. Make sure your networkPrefabs list is correct and play around with your player prefab components/scripts and just pray it fixes the issue

sharp axle
ripe mesa
sharp axle
ripe mesa
sharp axle
#

Dunno. Definitely wasn't me though.

ripe mesa
teal cedar
#

What do you think about fishnet?

sharp axle
ripe mesa
#

yeah scroll up I guess, and try to search the word with "fish", there are alot of information there

teal cedar
#

But what about Fishnet itself?

ripe mesa
#

there are alot of better netcode over it

#

also the license

#

on fishnet is sussy

teal cedar
ripe mesa
#

you are trying to build fps game right?

teal cedar
teal cedar
#

NGO is not currently suitable for that

ripe mesa
#

Fusion is still top tier for shooters.

90% Big Studios use Fusion

#

pretty much 2023 to 2024, unity, large-scale multiplayer in steam uses either fusion or quantum

teal cedar
#

It's true that there are no big games made with Fishnet

#

Or I'm not aware of them

ripe mesa
teal cedar
teal cedar
ripe mesa
#

fishnet: custom license -> sus
fusion: made by exitGames trusted for decades
mirror: true open source -> zero cost

another consideration is, It's feature, which feature you need and you dont need.

newbies goes for fishnet because they fall over the marketing trick

#

fishnet "Evolved Networking Solution", how convincing it is?

#

however, professionals tend to research whats the catch using this solution

#

and ended up using fusion instead

teal cedar
ripe mesa
#

its up to you.

I also got my programming job thanks to fusion

#

huge demand, compared to fnet

#

Fusion > Quantum > Mirror

That is from my research for game programming jobs market availability

teal cedar
frozen wind
#

Hello, someone know how to make websocket with Unity WebGL builds ?
I tried a lot of differents things but none of them can connect to a local TCP server with TLS

dry maple
frozen wind
#

The problem is that i have a pretty big code base for my server written in raw TCP in C#, i just want something to be able to connect to the server like another tcp client would do

dry maple
sharp axle
ripe mesa
#

@trvlonesurvivr fps game 2

ripe mesa
#

FNet License

waxen quest
#

I cannot able to Host on Webgl.

I used wss in RelayServerData but it gave error as Invalid Connection type, use dtls or UDP.

#

I use Unity Lobby, Relay and NGO together

waxen quest
waxen quest
ripe mesa
#

it seems, its the lates then

ripe mesa
waxen quest
#

It seems stable, just wondering why the package manager didn't had it's update since v1.4.1

ripe mesa
#

update = could be a new feature

sharp axle
old mural
#

Any advice on what “multiplayer infrastructure services” (not 100% sure on terminology) is the easiest to integrate with and supports a local development story (more later)? Note: not netcode library, I already have a netcode library I like a lot.

I’m using gamelift but I think I’m finally ready to accept that it doesn’t have a good local development story. I can run my game server process inside of Unity editor, but it takes 1-4 minutes before it actually shows up in GameLift as available for players. This feature is “gamelift anywhere.” Anyways, I used up a lot of time realizing the time delay is a thing. Given I want to iterate on my netcode and see changes frequently when I’m in the flow, whatever system I integrate with needs to immediately show state changes when I’m running my game server inside Unity editor.

Yes there are workarounds but I’d work on my project instead of coming up with clever workarounds to gamelift.

ripe mesa
#

is it csgo/valorant/overwatch style (on-demand) ? or MMO (persistence-server)

#

multiplayer infrastructure services
the better term is, game server hosting infra

sharp axle
old mural
old mural
# sharp axle You can normally just run the server locally. But if you need your changed deplo...

Yes I’m running my game server locally in my Unity editor. The idea is to integrate with a 3rd party service to get game server information to game clients.

No I don’t need a CI/CD process for local development.

Yes I need whatever 3rd party to “see” the game server process immediately after whatever game server setup ritual is complete. That’s all I need to iterate quickly.

ripe mesa
old mural
# ripe mesa thats a traditional matchmaking then, join by ip?

Not only IP, but host name and port depending on transport

For local dev it’s obviously localhost. My transport defaults to 7777 but is configurable via CLI.

Workarounds I’ve already implemented: (1) add a button to connect directly, skipping 3rd party integration (2) add an API endpoint who game clients interact with instead of the service directly, and allow the endpoint to echo back overridden host name and port, skipping the 3rd party integration.

sharp axle
#

I don't know of any matchmaking service that will hook into your locally running server. You could bypass matchmaking for your test server and just have players connect directly to its IP

old mural
ripe mesa
#

Im hella confused what do you needs tbh

old mural
# ripe mesa Im hella confused what do you needs tbh

Thanks for the honesty. I’ll try again…

What I want: I want support local development by running my game server in my Unity editor. I want whatever 3rd party service to “see” my game server process immediately after registering it.

I want my game client build (also running locally) to query the matchmaking service, and for the matchmaking to return the host/port of my local game server, so it can then use the info to connect to my game server running inside my Unity editor

#

Gamelift already supports this behavior, it just takes 1-4 minutes before gamelift “sees” my game server to be able to respond to the game client query.

In reality, when I click my workaround button to connect directly to localhost on my game client, it can connect. It’s just gamelift as the 3rd party matchmaking service takes forever to see it.

Instead of coming up with a workaround, I’d rather integrate with a service that’s faster.

ripe mesa
#

Unity Lobby would be enough I guess? @sharp axle

sharp axle
#

I dunno how gamelift does it. But I would just have a Test Server button on the clients that will connect directly to the IP of you locally running server

#

That would require the least amount of changing your code

old mural
#

@ripe mesa @sharp axle wait, so when you are making a brand new multiplayer project how do you guys develop it locally? I mean after you guys install your netcode library, configure it, and essentially are able to have a blank game client build and a blank game server? Assuming you’re going to integrate with a 3rd party service for matchmaking.

Just direct connection, and kick the integration work until the game is 100% complete?

old mural
ripe mesa
#

you dont want the extra bloats or extra process to slow down your CORE multiplayer game development, such as cloud, authentication.

fluid walrus
#

using photon here and the lobby system there doesn't have any of the delay it sounds like you're experiencing, so this hasn't been an issue for us

sharp axle
#

If its dedicated server I just run locally. I'll use Unity Lobby/Relay for remote play tests

ripe mesa
#

I want support local development by running my game server in my Unity editor. I want whatever 3rd party service to “see” my game server process immediately after registering it.
I reprhased this as, "I want to start server in my game editor and I want my game server to be exposed to the internet, so clients can browse it"

old mural
ripe mesa
#

is it?

ripe mesa
#

thats unity lobby

#

or you can use EOS which is 100% free but more difficult to integrate

sharp axle
#

Yea. have the server start a lobby and the clients can search for it

#

add the connection info to the lobby data and anyone who joins the lobby can connect

ripe mesa
#

or, create your own using REST API

old mural
#

@sharp axle I’m hoping to understand more about your flow. Talk to me about how you handle your UI during the initial local development period…

For my game client, I present the main menu. I have “create a room” and “join a room” buttons. The user isn’t expected to type in host name or port information; that’s handled in code.

So how do you handle the case of connecting directly

sharp axle
#

I use Unity Relay to avoid port forwarding nonsense

fluid walrus
#

you usually want a relay for the real game anyway, so i've always preferred not to add special direct connect method for development if possible

#

just in case it behaves differently!

old mural
sharp axle
ripe mesa
#

@old mural hasnt said anything about using dedicated server or client-hosted

old mural
old mural
ripe mesa
#

then lobby is all you need

old mural
#

Cool. Thanks all for patience and effort understanding my questions/context.

I’ll try to integrate with some of Unity’s matchmaking features and then photons’. Hopefully they play well even though I’m not using either’s respective netcode library!

sharp axle
old mural
# sharp axle Just for clarity. Unity Matchmaking service requires a dedicated server build to...

Omg hahaha. Bros…

I’m actually now extremely curious how other game devs approach developing a multiplayer game locally.

I try to follow the id software “just make the finished software” approach so I don’t like making a special case for local dev in my game server code or game client code. But I still want to iterate quickly and frequently.

Packaging up and uploading my game server to production takes too much time when I want to test something.

Sounds like @sharp axle you just make an exception for local dev, pushing off integration for later.

sharp axle
old mural
#

Actually, never mind forget it. I feel like I’m eating crazy pills for wanting what I’m describing, which is weird because in all other types of software development this is exactly how it works.

old mural
sharp axle
#

Unfortunately there is no way to test Unity Services locally or offline. Azure Playfab as a docker container you can to test somethings locally. Other services might have other ways

old mural
ripe mesa
#

it seems you are overseeing stuffs

old mural
ripe mesa
old mural
# ripe mesa what I meant is, you are expecting overkilled stuff that should be simple

I see. I will admit I can be particular about things; the crux of my “issue” is that I don’t want to make local dev an exception case in either my game client code or game server code. But I also came up with workarounds I described earlier to keep development moving along.

I’m only asking because I’m curious if anyone else understands and has advice.

ripe mesa
#

no worries

proud schooner
#

Hello all you uber networking people 🙂 I have a question. Im working on an mmorpg, yes I know mmorpg's are not for single developers but I am. I have set up the player, a world, some mobs with ai, animations, a city, some flying stuff etc. Now the question is, I want to implement a SERVER / CLIENT based system so the main server will hold the brunt of the game and the clients will connect to the SERVER gameworld. Should I scratch the project and start over using networking from the very get go or is it not too hard to convert everything to networking, ALSO, do I need to use Entities (never done networking before) or should I use some other solution such as mirror or netcode for objects? I enticipate around 300 to 500 CCU's per server. It's a science fiction game in line with Everquest hehe. Thank you for any pointers, advice.

ripe mesa
sharp axle
proud schooner
#

@sharp axle yes that is my thought exactly. I will work towards say 10 to 20 players but my concern is, if I get more players is there a way to re-right the networking for more players or not hehe. Never really worked in game networking only some minor mobile and desktop projects.

sharp axle
proud schooner
#

@sharp axle Yes been reading about that. I was planning on loading only the parts of the world that is used or has players on it. I was looking at Mirror as Entities is more for very advanced coders but was worried that in the future if I get more players Mirror might not be able to handle the packets whereas Entities is supported by Unity made by Unity and should work more smoothly I guess but having spent now close to a month learning Entities, man it is not easy to implement. Browsed over Mirror and it looks very user friendly for people like me hehe

#

Also Netcode for entities doesnt look like it can handle graphics that well but Unity 6 I think is more suited for it.

sharp axle
old mural
sharp axle
tame slate
#

Anyone have experience pairing together Relay + UTP + Mirror? Running in to a deadend problem and looking for some help..

tame slate
#

Unity Transport Package

tame slate
#

Basically my problem is I can host, allow client connections and play a full game no problem the first time through

#

But after stopping the server

#

going back to a main menu scene

tame slate
#

I'm always getting random errors that are almost impossible to trace. Usually something to do with Relay or the samples Transport.

#

It's leading me to believe there's something in the sample's code that isn't being cleared from memory that is messing with by subsequent games and their connection.

#

Because if I shut down the application/stop play mode and restart it, the first game works perfectly fine again.

sharp axle
tame slate
#

I remove the NetworkManager from DontDestroyOnLoad when the game scene is loaded. So it gets destroyed when going back to the main menu.

#

I've also tried destroying it manually to ensure this is not the case.

sharp axle
tame slate
#

Basically the only error message I get, and things sometimes still don't work even if this doesn't fire.

sharp axle
final olive
#

Guys who easier to make online game unreal or unity?

sharp axle
final olive
lament hatch
#

Not sure what I did because it was working perfectly before, but when testing creating and joining Unity relays on two separate devices (my desktop PC and my laptop), the client is disconnecting immediately. But when I use ParrelSync on my Desktop, the connection sustains. I have a pretty complex lobby/relay setup but I even created a very basic script that does the bare minimum of simply creating a relay for the host and joining it with the client, and the client is still disconnecting immediately. I've tried turning on and off Connection Approval in the Network Manager inspector and no change.

I did notice however that if I put a debug log in my approval check method, it fires it when the host creates the relay, but not when the client joins.
It should be firing when a client joins, because when connecting with ParrelSync, which sustains the connection correctly, this debug log fires when the client joins.

Are there any obvious things I might be overlooking? I can share my basic relay script if needed.
Also, my unity transport is pretty much default settings besides changing the protocol to relay.

dry maple
# final olive Guys who easier to make online game unreal or unity?

5 years ago, the answer would be Unreal.

But now there are new solutions for Unity that are better than anything in Unreal in terms of everything that matters:

  • Ease of Use
  • Bandwidth
  • Simulation Quality
  • CPU performance

It's an outdated idea that Unreal is better for multiplayer games. Maybe when you restrict it to official built-in solutions, then yes that's true, Unreal default networking is better than NGO.

lament hatch
teal cedar
dry maple
teal cedar
teal cedar
dry maple
teal cedar
dry maple
#

For that to change, they must be re-written.

teal cedar
dry maple
# teal cedar Okay, I understand

https://en.wikipedia.org/wiki/Data-oriented_design

Modern computers are pretty fast when you design your code to take advantage of things like CPU cache.

Solutions that internally use classes everywhere are not cache-efficient. Which can be a problem as you have more objects and more players.

In computing, data-oriented design is a program optimization approach motivated by efficient usage of the CPU cache, often used in video game development. The approach is to focus on the data layout, separating and sorting fields according to when they are needed, and to think about transformations of data. Proponents include Mike Acton, Scott M...

sharp axle
#

For reference, DOTS is data oriented design taken to the extreme

dry maple
lament hatch
sharp axle
lament hatch
#

no errors

#

that's what's making it so difficult to debug lol

#

the main logs i'm getting as the client are
-[Netcode] Connected
-[Netcode] Disconnected Event From 0
-[Netcode] Shutdown
-[Netcode] ShutdownInternal
-[Netcode] NetworkConnectionManager.Shutdown() -> IsListening && NetworkTransport != null -> NetworkTransport.Shutdown()

#

I almost wanna say its like a firewall issue because it works perfectly when using ParrelSync, but isn't Lobby supposed to be firewall friendly? I disabled my firewalls to try an attempt and it still didnt work. So I dont think its firewall related

sharp axle
lament hatch
#

let me double check i have no VPNs on

#

I wanna say i tried both without a vpn and with one to see if there was a difference and got nothing

lament hatch
#

what do you mean?

tame slate
#

Android, iOS, Windows?

lament hatch
#

windows

spring galleon
#

Hey guys. I wrote some network code for my my air hockey game. The client always runs the server/host code when instantiated. How do I fix this?

tame slate
lament hatch
tame slate
#

Have you tried two builds on the same machine?

#

Or just build and editor

lament hatch
#

Let me try that now. Can i just run the exe twice? i've actually never done that before

tame slate
#

Yep! You can open as many as you want. That's why I asked about platform

#

Best to use that for most of your testing anyway. It recreates the most realistic environment in comparison to editor testing with Parrel Sync.

sharp axle
sharp axle
lament hatch
# tame slate Or just build and editor

Alright, so I tried 2 actual builds side by side on my desktop and they worked. But when I try 2 builds on my laptop, it doesnt work lol. So the outlier is definitely my laptop

tame slate
#

Definintely odd.

#

is it a big scene? Lots to load in, lots of NetworkObjects, lots of initialization?

lament hatch
#

its my main menu, pretty simple

#

and not even spawning anything in

tame slate
#

And there's no errors if you try to connect your laptop editor as a client?

#

just the warning/info logs about Connection -> Disconnect -> Shutdown?

lament hatch
#

Yeah, it's only the warning/info logs. no errors at all

sharp axle
#

You can try turning off the firewall on the laptop in windows. really shouldn't matter though

tame slate
lament hatch
#

I'm gonna try to get a friend to test it out on his pc with mine in a bit

#

hopefully it's just my laptop acting weird

#

will keep everyone updated lol

sharp axle
#

when in doubt turn it off and back on again

lament hatch
#

I restarted both systems a few times at this point but still nothing

tame slate
lament hatch
#

true

spring galleon
#

I even tried isServer

tame slate
sharp axle
spring galleon
tame slate
#

Do us a favor and put Debug.Log(IsServer); in Start() and tell us what it prints out for the client

#

cause this isn't adding up lol

sharp axle
runic silo
#

are there any resources on unnamed messages other than the unity docs?

sharp axle
#

I guess the only other resource would be the source code itself in the package or on github

drowsy terrace
#

does anyone have a suggestion for a good solution to stream a unity camera between two devices over a local network ? we looked at unity render streaming but the problem is it needs an external signaling server, which we cannot have in our local environment...

drowsy terrace
#

I thought webrtc was relying on a signalling server as well?

spring galleon
spring galleon
#

But now I realize that client is not allowing me to move the player paddle. It has a simple click to drag function that works on the host.

tame slate
tame slate
#

I haven’t used Netcode for GameObjects in quite a while but I believe it’s called ClientNetworkTransform

tame slate
spring galleon
tame slate
sharp axle
spring galleon
#

Okay got it!

tame slate
sharp axle
#

fewer steps? it doesn't really matter either way

spring galleon
#

I actually don't mind, really

final laurel
sharp axle
final laurel
#

probably will not connect

#

it will fail to connect to unity services

#

that's why I'm wondering if that's some way to install the service locally idk

sharp axle
#

There is not

final laurel
#

I can techically develop my own transport for that, right? Not that it's too simple but it should be possible

sharp axle
final laurel
#

Yeah, I'd like to have a deeper understanding of how it works

#

I was just googling and it looks like the distributed authority feature is quite new and is still in experimental state, guess I'll not have precise information so soon

sharp axle
final laurel
#

I have been used to photon PUN for so long and I've always used distributed authority in my VR applications

#

I guess I'll have to migrate from PUN to fusion instead of netcode

#

I hate that they started to require Industries Circle membership ($500) for industrial projects

#

I tried fishnet (which looks great) but it only supports client/server archtecture

ripe mesa
final laurel
ripe mesa
#

but they are unpopular

final laurel
#

I guess it's not viable then