Skip to content

IPC for the retrieval and monitoring of a CollectionCache's ResolvedFiles. (Effective Changes)#539

Open
CordeliaMist wants to merge 4 commits intoxivdev:masterfrom
CordeliaMist:collection-cache-tracking
Open

IPC for the retrieval and monitoring of a CollectionCache's ResolvedFiles. (Effective Changes)#539
CordeliaMist wants to merge 4 commits intoxivdev:masterfrom
CordeliaMist:collection-cache-tracking

Conversation

@CordeliaMist
Copy link

CollectionCache in Penumbra maintains a MetaCache and a ResolvedFiles dictionary, representing the final, conflict-resolved state of all active file replacements for a collection.
This includes the effective replacements from only the selected options of enabled mods, with all mod conflicts and priorities resolved.

This PR exposes this data via IPC by adding:

  • A method to retrieve a collection’s current ResolvedFiles
  • An event triggered when a CollectionCache's ResolvedFiles change. (Passing which collection had the change, what mod changed it, the gamepath, old replacement path, and new replacement path)

Current approaches used to obtain effective changes for an actor involve monitoring GameObjectResourceResolved, GetGameObjectResourcePaths, ResolvePlayerPaths, and ModSettingChanged. However this introduces complications when:

  • Tracking by collection instead of individual actors
  • Handling non-player collections (e.g. pets, minions, .pcp-assigned objects)
  • Accessing replacements that have not yet been triggered by resource loading
  • Dealing with auto-reloads, glamour reapply, or mod toggles causing redundant update checks

This new IPC will clear the ambiguity of the above, while providing benefits such as:

  • Having direct access to all ResolvedFiles (including transient paths), even if not yet loaded by an any actors in the collection.
  • Explicit add/remove notifications when resolved files change.
  • No need to reverse-resolve paths, can simply check against monitored caches
  • ResolvedFiles updates handle any changes from mod toggles, reloads, and priority changes for us.

Additional IPC methods could be added in the future to expose grouped views of this data, such as:
Dictionary<string GamePath, (string ResolvedPath, string ModName)>
Dictionary<string ModName, Dictionary<string GamePath, string ResolvedPath>>
But I was not sure if you had any preference for how they should be formatted in the return call, so left it out for now.
However, including these would allow subscribers to group resolved files in a collection by mod, letting them know which .avfx or .paps are related to a specific transient path.

I have tested these changes locally and they fire when they should. Additionally the IPCTester behaves as expected.
Of note, the IPCTester will not track any changes you make in your mods tab due to the way the IPCTester subscribes and unsubscribes from methods. (This same issue occurs with the tester tracking the last called ModSettingChanged event)

@CordeliaMist CordeliaMist changed the title Implement IPC for the retrieval and monitoring of a CollectionCache's ResolvedFiles. (Effective Changes) IPC for the retrieval and monitoring of a CollectionCache's ResolvedFiles. (Effective Changes) Dec 30, 2025
@Ottermandias
Copy link
Collaborator

These are some deep internals of Penumbras functionality.
I think it would be a really bad idea exposing those via IPC and locking myself into maintaining this IPC functionality. There isn't really a reason why this should be exposed.
Your idea of using this to fetch transient resources incurs a lot of unnecessary transmitted data.

I am currently strongly against merging this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants