Skip to content

Suggestion for an user-friendly way to handle Asset Packs #291

Open

Description

@0lhi

Depends on #132.

The current way of handling assets is rather unhandy. I'd like to suggest an approach that easily allows to use multiple assets with just one executable:

1.) Allow to have Asset Packs in form of Archives and ISOs at /assets:

/assets/SMBX.v1.3.6.xta.7z, /assets/Adventures of Demo.v1.3.5.3.xta.7z

/assets/SMBX.v1.3.6.xta.iso, /assets/Adventures of Demo.v1.3.5.3.xta.iso (For systems that can't handle compressed files.)

The filename up to ".v{number}" will be used as an ID. Allows assets to be updated independently from engine.

2.) Make the main asset be determined by gameinfo.ini:

[game]
title="Super Mario Bros. X"
assets="SMBX"

If no gameinfo.ini is at the root, TheXTech will default to the Asset Pack that is the highest in the Alphabet.

3.) Make an /episodes folder as a successor to /worlds

The episodes folder would have folders in them that are named after the Asset Pack IDs to allow for simple sorting:

/episodes/AoD/SuperbDemoSisters/SuperbDemoSisters.wld
/episodes/AoD/The First Adventure.xte.7z
/episodes/SMBX/The Invasion 2.xte.7z
/episodes/SMBX/Return to Dinosaur Island.zip

4.) Allow episodes to have their own gameinfo.ini:

A feature requested by @DerpyBubblez for #139.

For backwards-compatibility, it would be used to determine which asset pack episodes inside the /worlds folder have.

[game]
title="Superb Demo Sisters"
assets="Adventures of Demo"

Episodes without a gameinfo.ini will be sorted to the main asset pack.

5.) Allow to flexibly change the asset pack at the Main Menu

By pressing AltJump/AltRight at the top of the Main Menu, the user can scroll between all asset packs available.

6.) Packed Vanilla Episodes go to the root of /episodes

Packed episodes & episode bundles like Yoshi's Archipelago and STTB1+2 will be placed like:

/episodes/SRW2 Yoshi's Archipelago.zip
/episodes/STTB1+2v1.5.zip

They will be selectable among the other asset packs. Since this is a bit more complicated, it would be more of a long-term thing.

Activity

  1. ChristianSilvermoon commented on Feb 18, 2022

    @ChristianSilvermoon

    I'm not entirely sure point 3 is needed specifically
    I'd instead suggest "Allow storing episodes in sub-directories" in general, so that players can organize their stuff how they prefer.

    For uncompressed packs, I would recommend using tar archives over ISO. Tar Archives can already be handled by preinstalled tools on all major operating systems (Linux, BSD, Mac OS, Windows).

  2. 0lhi commented on Feb 18, 2022

    @0lhi
    CollaboratorAuthor

    Tar Archives can already be handled by preinstalled tools on all major operating systems (Linux, BSD, Mac OS, Windows).

    The major operating Systems aren't the concern here, but fringe platforms like 3DS, Vita, maybe Wii someday. I suggested ISOs because they are supported by PhysFS, while TARs are not, and likely won't be:

    "Other archivers: perhaps tar(.gz|.bz2), RPM, ARJ, etc. These are less
    important, since streaming archives aren't of much value to games (which
    is why zipfiles are king: random access), but it could have uses for, say,
    an installer/updater.
    "

    Unless TARs are supported natively by every Platform that can run TheXTech, ISOs are the way to go here.

  3. ChristianSilvermoon commented on Feb 18, 2022

    @ChristianSilvermoon

    Tar Archives can already be handled by preinstalled tools on all major operating systems (Linux, BSD, Mac OS, Windows).

    The major operating Systems aren't the concern here, but fringe platforms like 3DS, Vita, maybe Wii someday. I suggested ISOs because they are supported by PhysFS, while TARs are not, and likely won't be:

    "Other archivers: perhaps tar(.gz|.bz2), RPM, ARJ, etc. These are less important, since streaming archives aren't of much value to games (which is why zipfiles are king: random access), but it could have uses for, say, an installer/updater."

    Unless TARs are supported natively by every Platform that can run TheXTech, ISOs are the way to go here.

    Ah, I see. I did not know PhysFS didn't support those :P
    Nevermind then XD

  4. added
    asset customization
    on Mar 9, 2022
  5. added this to the Version 1.3.7 (or 1.7 ?) milestone on Jul 31, 2022
  6. ds-sloth commented on Jul 31, 2022

    @ds-sloth
    Collaborator

    Hmm, interesting thought! There is surely a way to integrate this with the config / compat rewrite -- allow the asset root to be set using the episode's config.ini (or whatever it ends up being named). Of course, it will take as long for the engine to switch asset packs as it does to load the game currently, so it should only be done sparingly, but that's fine.

    I'll keep this in mind while working on the config / compat rewrite. How do you want this to interact with gameinfo.ini? Should a different gameinfo.ini be loaded depending on the asset root? Merge with the root one, or replace it?

  7. LoveBodhi commented on Aug 7, 2022

    @LoveBodhi
    Collaborator

    So will there be "Asset Selector"?

  8. ds-sloth commented on Aug 7, 2022

    @ds-sloth
    Collaborator

    Yes, there would be an Asset Selector in the game settings, accessible from within an episode or from the main menu options screen. It would also be possible for episode developers to specify, in order of preference, the asset packs they'd like their episode to use.

    I think I'll be able to implement this quite soon, because I'm beginning active development on the config/compat update while awaiting @Wohlstand's approval to merge multires.

    To respond to the suggestions in #372, I'd strongly caution against adding this information to the lvl or wld files themselves. Much better to put them in the config.ini for episodes or levels as discussed here, so that the user can configure them in the game, switching effortlessly between asset packs in the configured folder. But there are some useful questions raised in that proposal which I'm going to try to summarize here.

    Questions:

    (1) Should gameinfo.ini be reloaded when switching asset root?
    (2) Should asset roots be deep (like the standard assets pack) or shallow (all assets jumbled together)?
    (3) Should we continue to have a default root in the same folder as the executable, or should all assets be contained in the asset packs folder?
    (4) Should it be possible to specify asset packs using an absolute path name instead of just the folder name (like "smbx1.3-txt1.3.6" or "STTB") of an asset pack? This would be an advanced option and not possible to set from within the UI, but it might be useful in certain cases.

  9. LoveBodhi commented on Aug 7, 2022

    @LoveBodhi
    Collaborator

    Will TheXTech SDK have asset handler?

  10. 0lhi commented on Aug 7, 2022

    @0lhi
    CollaboratorAuthor

    (1) Should gameinfo.ini be reloaded when switching asset root?

    @ds-sloth Yes, unless there are reasons against it?

    Gameinfo contains stuff like Character Names, so it should at the very least be partially reloaded.

    (2) Should asset roots be deep (like the standard assets pack) or shallow (all assets jumbled together)?

    Deep would be preferable. I don't mind about shallow as a secondary option, but I don't care for it either. PhysFS can read them both the same.

    (3) Should we continue to have a default root in the same folder as the executable, or should all assets be contained in the asset packs folder?

    Leaning towards keeping a default root, some may only be interested in SMBX so it may be good to keep the previous structure. I don't feel strongly about this either.

    (4) Should it be possible to specify asset packs using an absolute path name instead of just the folder name (like "smbx1.3-txt1.3.6" or "STTB") of an asset pack? This would be an advanced option and not possible to set from within the UI, but it might be useful in certain cases.

    Hmm, what would such cases be?

    I think it would be best to just use the asset pack name as an ID.

    I also don't think that asset packs should be folders, but always a ZIP/7Z or ISO (uncompressed option). That will make it easier to keep things organized.

  11. ds-sloth commented on Aug 7, 2022

    @ds-sloth
    Collaborator

    Thank you for these thoughts and questions @0lhi. I agree with most of them but would like to hear more people's feedback also.

    (1) The only reason against it would be the possible issue of the new gameinfo.ini requesting a different asset root, causing an infinite loop. But we can find smart ways of guarding against this, or simply ignore asset pack requests from gameinfo.ini. Another question is whether we should merge the new gameinfo with the default one, or replace the one in the default directory. I would lean towards replacing because that's cleaner and more similar to how all of the other assets work.

    (3) Let me put this another way, what if a user wanted to never extract any asset packs to the default directory, but instead only added them to the asset pack folder? Would the user have to choose a default asset pack on first boot? Should an empty string for the asset pack refer to the default root? What sort of error handling should the game provide if certain very important assets like the Font or the Touchscreen controller are missing from an asset pack? (Should it look at all the other asset packs to try to find them?)

    I think the comment on folder vs file storage might be better addressed in another issue. We already have ways of mounting packed assets on 3DS, and I believe we're planning to eventually switch all file-based IO to PhysFS to provide similar features for other platforms. But that is a separate improvement and can be made independently of implementing asset pack selection and reloading, right?

  12. 0lhi commented on Aug 7, 2022

    @0lhi
    CollaboratorAuthor

    Let me put this another way, what if a user wanted to never extract any asset packs to the default directory, but instead only added them to the asset pack folder?

    Ahh! In that case, the Asset Pack highest on the Alphabet would be chosen.

    Would the user have to choose a default asset pack on first boot?

    Or yeah, this actually sounds better. On your other points, maybe this should be handled in settings.ini instead of another gameinfo.ini. If the user chooses Default Pack on First Boot, this should defeat all other concerns like infinite loops or missing fonts?

    But that is a separate improvement and can be made independently of implementing asset pack selection and reloading, right?

    I have a hard time interpreting this. How can we implement Asset Pack selections before deciding whether they can be loaded from folders and before adding PhysFS?

    EDIT: If you already want to implement this on 3DS, and then to other systems once PhysFS is added, I have no objections, though I don't be able to provide any detailed feedback. Something I think should be possible is to toggle between Asset Packs at the top of the Main Menu with Alt Run and Alt Jump.

  13. ds-sloth commented on Aug 7, 2022

    @ds-sloth
    Collaborator

    Regarding missing fonts, I guess I was saying, what if the user adds a folder that looks like an asset pack but is actually missing something critical? Should we just treat this as "not an asset pack" whenever the user tries to activate it and display an error?

    My other question was: on first boot, which Asset Pack's font and touchscreen UI should be displayed when asking the user which Asset Pack they want to use? The first alphabetically? Whichever one their cursor is currently on?

    Regarding PhysFS, what I meant was that if/when we implement it, then the subfolders of zips and isos will be indistinguishable from "real" folders. So, from an implementation standpoint it is completely independent to (1) make it possible to load Asset Packs from real folders and (2) add PhysFS so that this can be done with virtual folders as well.

  14. 0lhi commented on Aug 8, 2022

    @0lhi
    CollaboratorAuthor

    Regarding missing fonts, I guess I was saying, what if the user adds a folder that looks like an asset pack but is actually missing something critical? Should we just treat this as "not an asset pack" whenever the user tries to activate it and display an error?

    Ahh! Yes, I think that's a good idea. We want to ensure that Asset Pack designers actually take care of their stuff.

    My other question was: on first boot, which Asset Pack's font and touchscreen UI should be displayed when asking the user which Asset Pack they want to use? The first alphabetically? Whichever one their cursor is currently on?

    Not sure about touchscreen UI at all. For PC, I think it should just display the font of the asset pack that's currently focused.

    Regarding PhysFS, what I meant was that if/when we implement it, then the subfolders of zips and isos will be indistinguishable from "real" folders. So, from an implementation standpoint it is completely independent to (1) make it possible to load Asset Packs from real folders and (2) add PhysFS so that this can be done with virtual folders as well.

    Oh, yeah, I see your point. As long as it stays in a pull request until we make a decision on the folder thing, this sounds good.

  15. P-Star7 commented on Aug 19, 2022

    @P-Star7
    Contributor

    Thoughts on SetupVars being externalized and readable per-asset pack? That would mean less inclusion of npc-n.txt codes and allowing me to fix #105 in the new TheXTech asset pack without having to make a config/compatibility check.

  16. LoveBodhi commented on Mar 31, 2023

    @LoveBodhi
    Collaborator

    Another suggestion: Choose "Skin" per episode like the Mario Kart Wii Deluxe mod.

  17. ChristianSilvermoon commented on Sep 1, 2023

    @ChristianSilvermoon

    Adding a thought, I think asset packs should be allowed to be folders, as it would make editing and developing them a simpler task, where as if they can only be ZIP or ISO files, that would involve repacking them for every little change.

  18. ds-sloth commented on Mar 7, 2024

    @ds-sloth
    Collaborator

    The primary task here was achieved by #717, but I'll leave it open until we also have support for ISO-packed assets.

  19. marked Level/Episode Asset System #372 as a duplicate of this issue on Apr 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    asset customization

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions