Is there a way to run Netcode for GameObjects in Distributed Authority topology without unity's backend multiplayer services?
Upon checking, it seems as though, to even get a host/server running, I've to swap NetworkManager.StartHost() for this: var session = await MultiplayerService.Instance.CreateOrJoinSessionAsync(sessionId, options)
https://docs.unity.com/ugs/en-us/manual/mps-sdk/manual/create-session
And based off the documentations it seems to apply by calling CreatOrJoinSessionAsync, this will indeed b e communicating with unity's backend.
So I'm wondering if there are any other alternate function where it'll allow to create a host without unity's backend in Distributed Authority topology?
#Is there a way to run Netcode for GameObjects in Distributed Authority topology without unity's svc?
1 messages · Page 1 of 1 (latest)
By simply changing the network topology option in NetworkManager and not changing any of my server-client code i get this error:
[Session-Owner Sender=0] [Topology Mismatch] Transport detected an issue with the topology (ClientServer | DistributedAuthority) usage or setting! Disconnecting from session.
UnityEngine.Debug:LogError (object)
Unity.Netcode.NetworkLog:LogErrorServerLocal (string,ulong) (at ./Library/PackageCache/com.unity.netcode.gameobjects@bd2a018756ed/Runtime/Logging/NetworkLog.cs:128)
Unity.Netcode.NetworkLog:LogServer (string,Unity.Netcode.NetworkLog/LogType) (at ./Library/PackageCache/com.unity.netcode.gameobjects@bd2a018756ed/Runtime/Logging/NetworkLog.cs:94)
Unity.Netcode.NetworkLog:LogErrorServer (string) (at ./Library/PackageCache/com.unity.netcode.gameobjects@bd2a018756ed/Runtime/Logging/NetworkLog.cs:58)
Unity.Netcode.NetworkManager:UpdateTopology () (at ./Library/PackageCache/com.unity.netcode.gameobjects@bd2a018756ed/Runtime/Core/NetworkManager.cs:319)
Unity.Netcode.NetworkManager:NetworkUpdate (Unity.Netcode.NetworkUpdateStage) (at ./Library/PackageCache/com.unity.netcode.gameobjects@bd2a018756ed/Runtime/Core/NetworkManager.cs:338)
Unity.Netcode.NetworkUpdateLoop:RunNetworkUpdateStage (Unity.Netcode.NetworkUpdateStage) (at ./Library/PackageCache/com.unity.netcode.gameobjects@bd2a018756ed/Runtime/Core/NetworkUpdateLoop.cs:191)
Unity.Netcode.NetworkUpdateLoop/NetworkEarlyUpdate/<>c:<CreateLoopSystem>b__0_0 () (at ./Library/PackageCache/com.unity.netcode.gameobjects@bd2a018756ed/Runtime/Core/NetworkUpdateLoop.cs:214)
Hence I'm assuming NetworkManage.StartHost() should not be used with Distributed Authority.
No, DA is a Unity Service just like Relay
It can only be used through the Multiplayer Services sessions
There is a way, but ⚠️ it's not intended, and it's probably not a good idea, but it works. I have a game that uses DS over LAN. While host migration does not work, you still get client authority over objects and all the other features DS offers.
To do so, I use the regular Unity Transport instead of the Distributed Authority Transport. I can then call StartHost or StartClient normally after configuring the transport normally.
The project is up on github if you'd like to reference it. I also have an extremely janky way of switching between using LAN and Multiplayer Services in 'NetcodeManagement'
https://github.com/anaglyphs/lasertag
What features actually work with this setup? It's not really distributed authority since the DA servers are what handles distribution. I guess client spawning might be the only thing that works
ownership transfer and automatic distribution also work. i can have different clients handle different aspects of the game