com.unity.netcode.gameobjects icon indicating copy to clipboard operation
com.unity.netcode.gameobjects copied to clipboard

Why is everything hard-wired?

Open LightStriker opened this issue 1 year ago • 1 comments

Feedback Everything is hidden behind internal methods and fields. If we don't fit within the expected pattern, then we have to fight against everything, doing reflection call and so on. Right now, Netcode is less flexible than UNet.

Suggested Changes Every pieces of Netcode should be self-contained and never call other pieces by themselves. We should assemble those pieces by ourselves or have the possibility to do it. For example, the NetworkSceneManager should NEVER be called automatically. We should call it when it's the right moment.

LightStriker avatar Dec 01 '23 20:12 LightStriker

@LightStriker Other than when a client first connects and needs to be synchronized with all of the scenes and spawned objects, when is a NetworkSceneManager method automatically called?

The only other time a method within NetworkSceneManager is invoked is when active scene synchronization (i.e. when the server changes the active scene the clients follow suit) is enabled and the server changes its currently active scene. But that requires you to set that option and is not set by default.

There are some inherent elements that just need to be handled automatically, but that is due to a required order of operations regarding spawning and despawning as well as ownership and parenting notifications.

You can always disable scene management and handle all of the synchronization yourself and if you wanted you can use custom messages and build out your own framework.

NetworkUpdateLoop provides you with a way to inject updates during specific points in time during a frame, and you can always fork from the repository and make any kind of adjustments you desire.

If you provide us with a list of things that you feel need to be more flexible, please do provide it and we will definitely take it/them into consideration.

NoelStephensUnity avatar Dec 01 '23 22:12 NoelStephensUnity