Overhaul content caching
Pathoschild opened this issue ยท 4 comments
SMAPI caches content assets differently than the game, which causes some issues in SDV 1.3:
- festival issue (484);
- farmer visual bugs (e.g. on the load screen and farmer sprites).
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.
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
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.