Closed Pathoschild closed 7 years ago
The game's logic for finding tilesheets boils down to this:
path
or object
, it's loaded as-is relative to the Content
folder.Content\Maps
with a seasonal prefix (e.g. spring_outdoorsTileSheet
).Most game maps reference a simple file name (like townInterior
). Only the mines have a folder path (e.g. Mines\mine
).
We can't use this logic in SMAPI because we don't have location info at that point, and modders often have more complex tilesheet paths.
SMAPI checks for an existing relative path match (with and without seasonal prefix) relative to three locations (map file, Content\Maps
, and Content
).
That works for most maps, but fails with workstation-specific paths like ..\..\Steam\Stardew Valley\Content\townInterior.png
.
Keep the logic as-is, and require modders to copy tilesheets into the same folder when editing the map. Detect paths containing ..\
, and show an error saying tilesheets should in or under the map folder.
This keeps the SMAPI logic simple and predictable and avoids path ambiguity, but modders need to copy vanilla tilesheets into the map folder to reference it.
Check four variations (relative path and filename with/without seasonal prefix) relative to three locations (map file, Content\Maps
, and Content
). If the path contains ..\
, disable relative path searches.
Advantages:
Disadvantages:
..\..\Steam\Stardew Valley\Content\Mines\mine.xnb
would match Content\mine.xnb
).We'll go with option A per discussion.
The recommended map editor is Tiled, which correctly uses a relative path if the tilesheet is under the map's folder (otherwise it uses an absolute path). SMAPI should detect if the path is rooted or contains ..\
, and show an appropriate error.
Done in develop
for the upcoming SMAPI 2.0 release.
A modder reported the following error:
Review the rules SMAPI uses to resolve map tilesheets.