Repository navigation
Conversation
MTT-16737) - get_object returns each NetworkBehaviour's NetworkVariable and NetworkList values as the peer sees them, with nested behaviours' child paths. --behaviour filters to one type; --variables false gives the short form. - audit checks in-scene NetworkObjects for GlobalObjectIdHash 0 and takes --scope scenes. - Saving a scene assigns ids that NetworkObjects added before the scene's first save are missing, and saves again, so they spawn. Found in the hack-day agent runs: agents read NetworkVariables with script eval, and one game's match never started because its in-scene NetworkObject was saved with id 0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jy-vivox
force-pushed
the
feat/mtt-16737-hackday-netcode-frictions
branch
from
November 25, 2026 21:45
063b5af to
572b741
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose of this PR
Fixes NGO frictions found in the hack-day agent runs, so agents don't need
script evalor workarounds that the build-multiplayer-game skill has to explain.get_objectreturns NetworkVariable values. Agents read game state (phase, score, timers) by writingscript evalcode.get_objectnow returns each NetworkBehaviour'sNetworkVariableandNetworkListvalues as the peer sees them: enums as names, vectors, quaternions and colours as arrays, structs as their fields, fixed strings as text, object and behaviour references as ids, and collections capped at 32 items with the full count. A variable the client can't read says why instead of failing the call. Nested behaviours carry their child path.--behaviourfilters to one type and--variables falsegives the previous short form.NetworkObjectwas added to a scene built byscript evalbefore the scene's first save.OnValidatedoesn't assignGlobalObjectIdHashuntil the scene has a path, and the later revalidation doesn't mark the scene dirty, so the save kept 0. AsceneSavedhook now assigns missing ids in the saved scene and saves again, with a re-entrancy guard, and does nothing in play mode.auditchecks scenes. It reportsIN_SCENE_ID_MISSINGfor in-scene NetworkObjects with id 0, andSCENE_NOT_SAVEDfor NetworkObjects in a scene that has never been saved.--scope scenesruns only these checks.Trade-off: reading values uses reflection on the
Valueproperty and onGetEnumerator.NetworkList<T>has a publicGetEnumeratorbut doesn't implementIEnumerable. This runs only when the CLI asks for one object.Jira ticket
MTT-16737 (sub-task of MTT-16728)
Changelog
com.unity.netcode.gameobjects
netcode.gameobjects get_objectreturns each NetworkBehaviour'sNetworkVariableandNetworkListvalues as the peer sees them, and the child path of nested behaviours.--behaviourlimits the values to one behaviour type, and--variables falsegives the previous short form.netcode.gameobjects auditchecks in-scene NetworkObjects for a missing network id (GlobalObjectIdHash0), and takes--scope scenesto run only that check.NetworkObjectadded to a scene before the scene was first saved, for example by an editor script, was saved with aGlobalObjectIdHashof 0 and never spawned. Saving the scene now assigns the missing id and saves it again.Documentation
get_objectandauditrows ofDocumentation~/unity-cli-commands.md.Testing & QA (How your changes can be verified during release Playtest)
Functional Testing
Manual testing :
Manual testing doneThese checks ran in a live 6000.7.0b10 Editor driven through the
unityCLI, with Unity Netcode 7.2.0.script eval, adding a NetworkObject before the first save. The id was 0 before the save and non-zero after, both in memory and in the.unityfile, and the scene wasn't left dirty.audit --scope scenesis clean for that scene and warnsSCENE_NOT_SAVEDfor an unsaved scene.IN_SCENE_ID_MISSINGwith the object's name, and the next save writes the id back.get_objectreturned correct values for an enum, a struct, a FixedString64Bytes, a Vector3, an owner-read int, and a 40-item NetworkList (32 shown,count: 40,truncated: true). The--behaviourand--variables falseoptions behave as described.Automated tests:
Covered by existing automated testsCovered by new automated tests:FormatValue_TurnsValuesIntoPlainData,RunningHost_GetObjectReturnsNetworkVariableValues,InSceneNetworkObject_GetsItsIdOnSave_AndAuditReportsMissingIds, and the updated wire table inNetcodeGameObjectsCliCommandsTests.On 6000.7.0b10 the full NGO edit-mode suite passed: 1444 passed, 1 skipped, 0 failed.
Does the change require QA team to:
Review automated tests?Execute manual tests?Provide feedback about the PR?Up-port
Not needed. The CLI commands exist only in 3.x, and this targets
develop-3.x.x.Backports
Not needed: the CLI commands are specific to NGO 3.x.
Companion PRs under MTT-16728: Unity Netcode
netcode.ghost set(MTT-16738) https://github.cds.internal.unity3d.com/unity/unity/pull/141076 and the build-multiplayer-game skill (MTT-16729) https://github.cds.internal.unity3d.com/unity/skills/pull/293.🤖 Generated with Claude Code