satisfactorymodding / SatisfactoryModLoader

SatisfactoryModLoader is an unofficial tool to load mods for the game Satisfactory.
GNU General Public License v3.0
251 stars 160 forks source link

Resource Extraction Data #200

Open budak7273 opened 12 months ago

budak7273 commented 12 months ago

Allow mods that implement new resources to offer information about the resource's nodes for use by other mods.

Mods define data assets that specify this information

SML BPFL will allow lookup of details from an FGResourceDescriptor class

Interface allows items to supply a data asset to be returned when they are looked up

Base-game items can't be made to implement the interface, so SML will redirect their calls to return data assets that SML defines for these

https://discord.com/channels/555424930502541343/562722670974599227/1124783052971847761

budak7273 commented 12 months ago

Started on resource-extraction-data branch a519908

Th3Fanbus commented 3 months ago

I thought aloud for a bit about this in https://discord.com/channels/555424930502541343/555505343031934979/1218211168401883217 and Robb pointed me to this issue. The wall of text, assembled together:

(About handling modded resource node meshes/materials for a dynamic, mod-aware https://ficsit.app/mod/BuildableResourceNodesRedux extension): Yeah, that's what I'd need to work on:

IMHO, the most optimal way to deal with this would be to "standardize" resource nodes. What I mean is to have a list of resource node types in SML, and have mods register the resource node types they add in the Mod Content Registry. I would also recommend adding some additional information in the registry entries:

This approach contemplates several use-cases:

However, this approach requires making a few concessions:

But I believe the advantages are worth it in the long run:

Addendum:

To be very clear, the only bits I would add to SML would be the API for "resource node descriptors", which boils down to a data structure (see ⁠above for the information it would contain, some fields might need to be sub-structures) and a few functions to manipulate the content registry (e.g. "add resource node descriptor", "get all resource node descriptors"...)

The use-cases listed above would be implemented by other mods. They're use-cases I've considered when drafting this idea in order to make the proposed SML API as general as possible.