What is unitys best practice for offline mode (only 1 player hosting) in a NGO game.
So I dont know what networking manager and all the other network objects do under the hood. But say we are making a coop\solo player mode. When somebody is playing solo we dont want to waste money using relay or extra compute sending out data for network objects or doing extra work. So what is the best practice for running in Offline mode IE (1 single hosting player)?
So far all i do is i swap the network transport from relay to unity transport and just host the game. However i havent found anything on running a netcode for game objects solution offline efficiently.
NetworkManager.Singleton.NetworkConfig.NetworkTransport = unitytransport;
In connection approval all connection requests are denied in offline mode.
There is no such thing as online vs offline. It’s only a matter of disallowing connections. If there aren’t any connections and you use the default transport, nothing about that game session is “online”.
Meaning what? Memory? CPU? Bandwidth? Productivity?
Yes, as i am not sure what happens under the hood so even if its just one person in a hosted game i dont know what else can be turned off to increase performance
Well if the singleplayer offline mode doesn‘t perform well, the online multiplayer mode will be even worse off. As long as that‘s fine no need to concern yourself with offline play performance.
If it’s not the OP’s concern, this is our concern. In “offline single-player mode” - we’d like to guarantee there are no connections going through Relay/UGS. It should “just work” – with no network connections.
You wrote: “In connection approval all connection requests are denied in offline mode.”
I’m not sure how to interpret that statement.
Specifically, what do we have to do inside Unity API, to ensure “offline mode / no-connections”??
The NetworkManager has a connection approval callback where you can write code that either allows or disallows a client to connect via a boolean. If the game is in locally-hosted offline mode you just deny all connection attempts. That’s it.