SMAPI - Stardew Modding API

SMAPI - Stardew Modding API

971k Downloads

Overhaul content caching

Pathoschild opened this issue ยท 4 comments

commented

SMAPI caches content assets differently than the game, which causes some issues in SDV 1.3:

commented

Some background: the issue is that SMAPI has a centralised content cache with what amounts to garbage collection counters to decide when an asset is no longer needed by any loaded content managers. SDV 1.3 makes content-manager-specific changes to the data it loads in some cases (like adding a field to the festival data), and expects that data not to be propagated to other content managers; but since there's a central cache, it does get propagated. The fix is to overhaul the content core to eliminate the central cache, though mods will have a higher performance impact when they load/edit assets.

commented

Perhaps handle it differently - have a central cache that you then copy things from into per-manager cache's.

That way you get the performance benefit of a central cache, but fix the assumptions SDV makes about having multiple CM's

commented

That's a good idea. I'll need to write logic to clone assets, but fortunately the game only uses a few specific types so that should be easy enough.

commented

Done in develop for the upcoming SMAPI 2.6-beta.9. The cache is fully decentralised for now, but we can add a centralised clone cache if needed later.