Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ParentAnalyzer #155

Open
Noggog opened this issue Oct 6, 2024 · 4 comments
Open

ParentAnalyzer #155

Noggog opened this issue Oct 6, 2024 · 4 comments
Labels
engine A feature for the analyzer engine itself

Comments

@Noggog
Copy link
Member

Noggog commented Oct 6, 2024

For Cells/Worldspaces that want to analyze their contents, this would label the various subtypes they're interested in to help facilitate FieldsOfInterest calls

@Noggog Noggog added the engine A feature for the analyzer engine itself label Oct 6, 2024
@Elscrux
Copy link
Member

Elscrux commented Oct 6, 2024

An example of this would be ICellGetter and Temporary + Persistent references? Wouldn't this be something where we would just have two fields of interest? I don't quite understand why this case would be special.
One thing thing about nested structures like cells or dialog responses are that they need to look at the whole load order when being evaluated. Their parent record always have an override but the nested records like placed records or dialogue response can do various things like adding a new record, modifying or deleting an existing one and so on. But what we would be interested in is the combined result that the game would see in the end. I don't think something like that has an easy way to be resolved yet, right? Basically analyzers like these would want the winning overrides under a specific parent.

@Noggog
Copy link
Member Author

Noggog commented Oct 6, 2024

It's for the engine. From an analyzer dev standpoint, they can of course mark by hand all the fields of Interest.

But for the engine, how does it know what placed objects were resolved/interacted with to watch? For contextual analyzers resolving other records, this will do it #152 where when a user queries for a record, the engine knows to watch it for changes.

But for a Cell/Worldspace/Other.. there's no link cache involved, the PlacedObjects are just nested underneath it on a list. How does the engine know when one was accessed or of interest?


This would be an analyzer with any customizations needed to help facilitate that better ^

So complications of the the "additive" nature of placed objects, how do we mark what placed objects we're interested in, etc. These challenges would be chipped at by this more specialized patcher type.

It might offer in its params the "complete" placed objects list, for ex, so the users dont need to build it themselves. Or other similar features.

@Elscrux
Copy link
Member

Elscrux commented Oct 7, 2024

I see that changes couldn't be tracked via the link cache for nested records. But in case an analyzer accesses a certain nested record like placed objects under a cell, wouldn't it be possible to say cell => cell.Persistent and add that to the tracked records this way?

Though what happens if we're starting off in some other record like IFactionGetter but then we're resolving a cell and we're accessing the placed objects inside that? I don't think this specific ParentAnalyzer design would help with that as we're not looking at the nested records of the one we're focusing on here (Faction) but a subrecord (placed object) of a related record (cell). Only a sophisticated design to mark fields of interest would really be able to cover all these things while also keeping the amount of special kinds of analyzers down that analyzer devs would have to choose between.

Continuing the example from above, when we're checking faction records but require info from certain cells and the placed objects inside. Then we can maybe register with something like this:

builder
    .RegisterChange<IFactionGetter>(faction => faction.X)
    .RegisterChange<ICellGetter>(cell => cell.Persistent)

Changes in the factions are tracked as well as changes in the persistent placed objects in cells that were resolved via link cache.

Let me know if this makes sense to you or if I'm not seeing your point!

@Noggog
Copy link
Member Author

Noggog commented Oct 7, 2024

responded over in #153

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
engine A feature for the analyzer engine itself
Projects
None yet
Development

No branches or pull requests

2 participants