Automatically invoke `NetworkVariable.OnValueChanged` when spawning
Los mantenedores suelen responder en 3 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 45/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Tranquilo
- Área
- game-dev, networking
Línea de trabajo
Comienza rastreando la sincronización de NetworkVariable durante la creación de NetworkObject, incluida la registración de callbacks en Awake, OnNetworkPreSpawn y OnNetworkSpawn. Reproduce los casos descritos de objetos presentes en la escena, generados dinámicamente, de clientes que se unen tarde y de visibilidad de NetworkHide; se considera terminado cuando los valores sincronizados invocan OnValueChanged y el estado del cliente coincide con el del servidor.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Feedback
When load scene with in-scene placed NetworkObject or dynamically spawn NetworkObject, connected client would spawn the object and NetworkVariable value synced with the server. But the OnValueChanged is not called, even if the value has been synced with the value of server, and is different from the default value that has been set in NetworkBehaviour. The current behavior of skipping OnValueChanged when spawning also doesn't depend on where the OnValueChanged has been registered, in OnNetworkSpawn , OnNetworkPreSpawn or even in Awake.
This caused a lot of problems, because NetworkVariable may be a bool that enable/disable a renderer, or set a shader field through OnValueChanged. Skipping OnValueChanged would make render frame inconsistent with what's intended. This is specially annoying when late-join client starts to spawn all NetworkObject, without OnValueChanged the game states would drastically different from server. The problem also shows up when a previously NetworkHide object become visible again and client respwan the object but with inconsistent states from server.
Suggested Changes
When spawning, all NetworkVariable should be synchronized, and corresponding OnValueChanged should all get called, because clients are supposed to keep the same states as server. The server has likely changed the value of NetworkVariable and have already called the OnValueChanged on server side, so when spawning happens, client need to not only sync all values of NetworkVariable, but also call all OnValueChanged to keep the same states as server.
An intuitive way is to register OnValueChanged in OnNetworkPreSpawn, so that during subsequent spawning any valid callbacks registered will get called.
- Lenguaje dominante
- C#
- Estrellas
- 2.3k
- Forks
- 465
- Merge medio
- 3 d 12 h
- PR fusionados (30 d)
- 39
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Unity-Technologies/com.unity.netcode.gameobjects
-
TimeSyncMessage is sent reliably, so a late one resets the client clock backwards and stalls its NetworkTransformsPosiblemente ocupada @reginaldalfret la tomó hace 8 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 52/100
Unity-Technologies/com.unity.netcode.gameobjects#4249 ·
Los mantenedores suelen responder en 3 días
-
NetworkTransform: half-float base update dropped as out of order when UseUnreliableDeltas is on, so later deltas decode ~2 m offPosiblemente ocupada @NoelStephensUnity la tomó hace 8 días. Abiertoport:3.x-completed priority:medium stat:imported type:bug
Dificultad 4/5 3-5 días Aptitud para principiantes 57/100
Unity-Technologies/com.unity.netcode.gameobjects#4248 ·
Los mantenedores suelen responder en 3 días
-
Tracking type:feature-2.x
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
Unity-Technologies/com.unity.netcode.gameobjects#3870 · 5 comentarios ·
Los mantenedores suelen responder en 3 días
-
Please error, or at least warn, when a managed type is included in INetworkSerializeByMemcpyAbiertoTracking type:feature
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
Unity-Technologies/com.unity.netcode.gameobjects#3830 · 7 comentarios ·
Los mantenedores suelen responder en 3 días
-
priority:medium stat:imported type:feature type:feature-2.x
Dificultad 4/5 3-5 días Aptitud para principiantes 42/100
Unity-Technologies/com.unity.netcode.gameobjects#3706 · 5 comentarios ·
Los mantenedores suelen responder en 3 días
Todos los issues de Unity-Technologies/com.unity.netcode.gameobjects
Issues similares
-
hand-to-AI
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
CactuseSecurity/firewall-orchestrator#5803 ·
Los mantenedores suelen responder en 1 día
-
Typed MINID rejects numeric thresholds with a leading plus sign accepted by Redis and ValkeyAbiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 1 día
-
DXF with empty names failsAbiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 3 días
-
bug python
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
ilia-sokolov/OfficeAgent.NET#89 ·
Los mantenedores suelen responder en 13 días