Make adressables great again #1494 - #1500
Open
rohitkulkarni97 wants to merge 252 commits into
Open
rohitkulkarni97 wants to merge 252 commits into
rohitkulkarni97 wants to merge 252 commits into
Conversation
…Creator and DatabaseScriptWriter for consistency in asset management workflow.
…, and Item to use Assets.Get method for improved consistency and clarity
…to use Assets.Get method for improved consistency
…and other places to streamline asset retrieval
…agement consistency
…tepCraftable, and Item to simplify usage of Assets.Get method
…nce to streamline addressable asset handling and improve code clarity
…nstructionHologramManager to utilize WorldObjectAssetReference for improved asset retrieval
…bjectsSO prefabs to enhance asset management
…eferences throughout the codebase for consistency
…proved readability
…AssetReference, and implement IEqualityComparer for improved comparison
…lementation and simplifying equality and hash code methods
…eters in asset creation methods, and removing DatabaseAsset.cs usage.
….Get method instead of DatabaseAsset's Prefab property, Create, Get<T>() & CreateAs<T>(...) functions, and different implicit operators.
…Creator and DatabaseScriptWriter for consistency in asset management workflow.
…, and Item to use Assets.Get method for improved consistency and clarity
…to use Assets.Get method for improved consistency
…and other places to streamline asset retrieval
…agement consistency
…tepCraftable, and Item to simplify usage of Assets.Get method
rohitkulkarni97
had a problem deploying
to
unity_tests
April 23, 2026 15:12 — with
GitHub Actions
Failure
…esDatabase to use new menu hierarchy constants
rohitkulkarni97
had a problem deploying
to
unity_tests
April 28, 2026 03:37 — with
GitHub Actions
Failure
rohitkulkarni97
had a problem deploying
to
unity_tests
April 28, 2026 03:38 — with
GitHub Actions
Failure
rohitkulkarni97
had a problem deploying
to
unity_tests
April 29, 2026 18:21 — with
GitHub Actions
Failure
rohitkulkarni97
had a problem deploying
to
unity_tests
May 1, 2026 19:41 — with
GitHub Actions
Failure
rohitkulkarni97
had a problem deploying
to
unity_tests
May 7, 2026 20:53 — with
GitHub Actions
Failure
henkhooft
pushed a commit
to henkhooft/SS3D
that referenced
this pull request
Jul 22, 2026
Investigated upstream RE-SS3D#1500 ("Make adressables great again", closes RE-SS3D#1494 excessive memory usage) and this fork's actual Addressables usage. Confirmed this fork has the same eager-loading root cause independently of upstream: 21 Addressables groups are configured but only ever used as editor-time metadata via AssetDatabase.LoadAssetsFromAssetGroup(), which copies real Object references into a serialized dictionary. No Addressables.LoadAssetAsync call exists anywhere in the codebase, so every configured asset is still hard-referenced into RAM at load time. Adds 2026-07_addressables-expansion-migration.md scoping a phased migration to async AssetHandle-style loading (planned, no code yet), including a concrete plan to retire the MI/Main HUD/Storage Panel Resources.Load catalogs once migrated. Cross-links it from INDEX.md, TECH_DEBT.md (new §1.15 - §1.14 was taken by a concurrently-landed asset-taxonomy effort), and the data-codegen system map. Split out of the combined addressables+subsystem-bootstrap branch since the two problems have unrelated root causes; the subsystem bootstrap work now lives on its own branch/PR.
CopyValuesToBodyPart ran on a bare instantiated prefab, before NetworkSpawner.Spawn. _bodyLayers is not serialized and is only filled by AddInitialLayers in OnStartServer, which that spawn triggers, so the copy had no body layers and the loop body never executed. Every sustained damage was silently discarded on detach - exactly what the method promises to preserve. Regression introduced on this branch. develop spawns first and then copies, so it was never affected there. A part is severed because its bone layer is destroyed, so a severed limb again reaches the floor carrying roughly half of its maximum damage.
Async organ spawning made the existing wait unsound. WaitUntil(() => Heart && LeftLung && RightLung) is satisfied the instant Instantiate assigns the field, but the network spawn that follows is deferred behind an await, and it is that spawn which runs the organ's own OnStartServer and creates its body layers. The organs were therefore attached into the body before they had any layers. Add BodyPart.IsInitialized, set once a part's layers exist, and gate both the torso and the head on it rather than on the field being non-null. IsSpawned is deliberately not used: it only reports that an ObjectId was assigned, which says nothing about the part having been built. No visible symptom on this branch today - nothing reads an organ's layers early enough to fault. This restores the invariant that a body part is never attached into a body before it has been built.
rohitkulkarni97
temporarily deployed
to
unity_tests
July 28, 2026 17:45 — with
GitHub Actions
Inactive
# Conflicts: # Assets/Content/WorldObjects/Entities/Silicon/EngineeringBorg/EngineeringBorg.prefab # Assets/Content/WorldObjects/Structures/Walls/SteelWall.prefab # Assets/Content/WorldObjects/Structures/Walls/SteelWallReinforced.prefab
This branch was successfully 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.
Summary
This PR replaces the legacy static
Assetslookup/database bootstrap with a scene-owned, async asset system built around GUIDs, catalogs, backend loaders, and disposable asset handles. The configured content path now routes the main SS3D asset databases through Addressables, while the provider/lifecycle layer keeps loaded assets resident only while handles or spawned instances still reference them.It also adds the FishNet-side support required for addressable network prefabs: deterministic GUID-based prefab IDs, runtime registration of loaded addressable prefabs, synchronized client preloading before spawn, and late-join gating so clients do not observe addressable objects before the required prefabs are loaded.
PR checklist
Testing
Automated coverage added/updated:
AssetHandle,AssetProvider,AssetLifecycleTracker,InstanceLifetimeTracker, andNetworkObjectsGenerator.FakeAssetBackendand test assembly access for exercising the internal asset loading flow.Manual validation still needed:
Networking checklist
Changes
Asset System
AssetSubSystemas the startup-owned composition root for asset catalogs, backend initialization, database lookup, load/unload event relays, and the network preload barrier.AssetRequest<T>andAssetHandle<T>as the new async loading API. Handles are ref-counted and disposable; helper guards can tie handle lifetime to Unity objects.AssetProvider,AssetLifecycleTracker, andInstanceLifetimeTrackerto dedupe concurrent loads, track handles and instantiated prefab copies, and unload assets when the last reference is released.IAssetBackend,AddressablesBackend,ResourcesBackend, andAssetBackendType.Assetslookup flow and the separateAssetsInitializationTrigger.Catalogs And Databases
AssetCatalog/AssetDatabaseassets.AddressablesCatalogcontaining the seven configured databases: CraftingRecipes, InteractionIcons, Items, Materials, ParticlesEffects, Sounds, and WorldSpaceUI.Assets/Content/Data/AssetSystem/Databases.ObjectAssetReferenceso references store the asset GUID only, rather than GUID plus database ID.Networked Addressables
NetworkBarrierandPreloadConditionto coordinate loading addressable prefabs across server and clients.NetworkSpawneroverloads for spawning byObjectAssetReference, GUID,GameObject,NetworkObject, orNetworkBehaviourwhile ensuring clients are ready before FishNet spawns.NetworkObjectsasset keyed by deterministic GUID order.NetworkObjectsGenerator, generator settings, andNetworkObjectTrackerso network prefabs can be discovered, assigned stable FishNet prefab IDs, and registered when loaded through Addressables.NetworkBarrierprefab, wired it into the boot scene throughAssetSubSystem, and configured the generated NetworkObjects asset path.Content Migration
Assets/Art/Generated/Icons.AssetDatabaseSettings,AddressablesCatalog,NetworkObjects.asset,PreloadCondition.asset, andNetworkObjectsGeneratorSettings.asset.GenericObjectSoeditor/preprocessor support and stopped generating runtime preview icons inTileResourceLoader; resources now use stored icons with a missing-icon fallback.Gameplay Migration
AssetRequest/AssetHandleand the async network spawning path.InstanceFinder.ServerManager.Spawn(...)call sites that depend on database assets toNetworkSpawner.SpawnAsync(...).Related Issues/PRs
Closes #1494