Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding PhysFS Library to support playing episodes from zip/7z/iso #132

Open
4 tasks
0lhi opened this issue Jun 6, 2021 · 19 comments
Open
4 tasks

Adding PhysFS Library to support playing episodes from zip/7z/iso #132

0lhi opened this issue Jun 6, 2021 · 19 comments
Labels
asset customization Issues related to custom graphics, sounds, asset packs etc. enhancement New quality-of-life feature or request (does not change gameplay)

Comments

@0lhi
Copy link
Collaborator

0lhi commented Jun 6, 2021

A feature that @Wohlstand and I have spoken about in private is to give TheXTech the option to play episodes from archives and image files, which can be done through the PhysFS Library. This would create the following benefits:

  • Reduce disc space usage.
  • Encourage users to keep unaltered copies of episodes on their harddrives, making preservation easier.
  • Potentially, in combination with some modified conversion kit code, allow to play Custom Set Episodes without any prior preparations.
  • Allow TheXTech to get the MD5-Checksum of a whole Episode, which is important for the Netplay feature that is currently in the talks (gonna open a GitHub Discussion on this later today).

For the sake of keeping the Archives unchanged, I suggest that TheXTech should ignore any .sav files that may be stored inside of them.

@0lhi 0lhi added the enhancement New quality-of-life feature or request (does not change gameplay) label Jun 6, 2021
@ChristianSilvermoon
Copy link

Hmm, archive formats can also de-dedupe data afaik, which would be great for episodes that repeatedly use the same assets across several, but not all levels.

@Wohlstand
Copy link
Owner

Wohlstand commented Jun 7, 2021

Hedgewars does use PhysFS a lot, and all custom add-ons were shipped as .hwp files (basically a renamed ZIP archive) which contain some resources that the game can see and re-use

@ChristianSilvermoon
Copy link

Hedgewars does use PhysFS a lot, and all custom add-ons were shipped as .hwp files (basically a renamed ZIP archive) which contain some resources that the game can see and re-use

Could we use .smbxe for Episodes? :P

@Wohlstand
Copy link
Owner

Could we use .smbxe for Episodes? :P

Technically yes, but maybe something also would appear in a head, so, the time will solve this once we'll start this task

@LoveBodhi
Copy link
Contributor

This reminds me "MarioPacker" in SMBX-38A, but they're cracked.

@Wohlstand
Copy link
Owner

Anyway, main goal to just simplify the distribution and make episodes and packages being more portable and the game being more compact. Absolutely no purpose to craft any sort of DRM for episodes which limits the freedom a lot and annoys. However, if episode maker really wants the protection, then the sort of obfuscation would be made that will confuse all guts of episode data making it hard to maintain by human. Manly it's a noob proof protection, hackers will develop the way to deobfucste that easily.

@Wohlstand Wohlstand added this to To do in Wohlstand's works via automation Aug 14, 2021
@Wohlstand Wohlstand moved this from To do to Maybe later in Wohlstand's works Aug 14, 2021
@MECHDRAGON777
Copy link

While I do not currently use TheXTech, I am in support of this as not only does it start on the possibility to play co-op, but also lowers the file size used by episodes and custom levels.

@0lhi
Copy link
Collaborator Author

0lhi commented Nov 27, 2021

@ChristianSilvermoon Could we use .smbxe for Episodes? :P

@Wohlstand Technically yes, but maybe something also would appear in a head, so, the time will solve this once we'll start this task

Instead of anything that directly references Nintendo, I'd rather suggest:

.xte (X-Tech Episode(s))

.xtl (X-Tech Level(s))

.xta (X-Tech Asset Pack)

These formats should be used for stuff that is exclusive for TheXTech, content that works on other branches like Vanilla or X2 should stick with 7z or zip to avoid an artificial access barrier. Maybe we could encourage/enforce a naming convention like:

.wld.7z / .wld.zip (Multi-Branch Episode(s))

.lvl.7z / .lvl.zip (Multi-Branch Level(s))

.pck.7z / .pck.zip (Packed game like Talking Time/Yoshi's Archipelago).

@ChristianSilvermoon
Copy link

@ChristianSilvermoon Could we use .smbxe for Episodes? :P

@Wohlstand Technically yes, but maybe something also would appear in a head, so, the time will solve this once we'll start this task

Instead of anything that directly references Nintendo, I'd rather suggest:

.xte (X-Tech Episode(s))

.xtl (X-Tech Level(s))

.xta (X-Tech Asset Pack)

These formats should be used for stuff that is exclusive for TheXTech, content that works on other branches like Vanilla or X2 should stick with 7z or zip to avoid an artificial access barrier. Maybe we could encourage/enforce a naming convention like:

.wld.7z / .wld.zip (Multi-Branch Episode(s))

.lvl.7z / .lvl.zip (Multi-Branch Level(s))

.pck.7z / .pck.zip (Packed game like Talking Time/Yoshi's Archipelago).

Yeahhh, now that I think about it you're right using .smbx* is not ideal, and your suggested alternatives feel great ^^

I can imagine:

worlds/
├── other-episode.zip
├── princess-cliche.xte
├── super-talking-time-bros-series.xte
├── the-invsasion-2.xte
└── wip-episode

@LoveBodhi
Copy link
Contributor

This make me think ".love" format (LÖVE2D Program)!!

@ChristianSilvermoon
Copy link

Would this also support .tar and .tar.gz files?

@Wohlstand
Copy link
Owner

Would this also support .tar and .tar.gz files?

Would (just need to check out the specification), but tar.gz (not tar) is less effective for random access as this is a seamless compression that requires to decompress of the whole file until it can be used

@Wohlstand Wohlstand moved this from Maybe later (unordered) to Backlog in Wohlstand's works Feb 18, 2022
@ChristianSilvermoon
Copy link

Would this also support .tar and .tar.gz files?

Would (just need to check out the specification), but tar.gz (not tar) is less effective for random access as this is a seamless compression that requires to decompress of the whole file until it can be used

I guess I should've thought of that but I didn't x3
I guess .tar.gz would be rather inefficient for this purpose :P

@0lhi 0lhi added the asset customization Issues related to custom graphics, sounds, asset packs etc. label Mar 9, 2022
@LoveBodhi
Copy link
Contributor

Does work if including password for the archive??

@Wohlstand
Copy link
Owner

Does work if including password for the archive??

That will also mean, password should be provided in certain config file or typed manually on load

@ChristianSilvermoon
Copy link

Does work if including password for the archive??

That will also mean, password should be provided in certain config file or typed manually on load

We do have an onscreen keyboard in game now :P

@0lhi
Copy link
Collaborator Author

0lhi commented Mar 10, 2022

Uhh, does PhysFS support that? It would surprise me a lot.

If it does, I guess, we could make an MD5 based database for Episodes that are encrypted for some reason, so that TheXTech will know the password by default. But, idk how many episodes are affected by that. It seems kinda pointless.

@ChristianSilvermoon
Copy link

Uhh, does PhysFS support that? It would surprise me a lot.

If it does, I guess, we could make an MD5 based database for Episodes that are encrypted for some reason, so that TheXTech will know the password by default. But, idk how many episodes are affected by that. It seems kinda pointless.

ZIP files do support password protection. IDK if PhysFS supports it.

It effects no episodes currently because no episode is played from a password protected ZIP file.

I don't see much utility in password protecting episodes tho, unless we want to keep other people on the same PC from snooping (why would we need to with episodes?) or in case you wanted to keep the episode for certain people only, IE having a previous episode give you the password for its sequel on completion or something.

@poudink
Copy link

poudink commented Nov 15, 2022

I would be very happy to have any sort of archive support, regardless of compression. SMBX episodes being packaged as folders with thousands of files makes them very cumbersome. Transferring them between different drives and devices takes a very long time for one, but really the biggest problem is that with some less efficient file systems like exfat and fat32, episodes end up using a lot more space than they should. This mostly affects platforms that don't support better file systems, like Android, the 3DS or the Switch. As far as I can tell, this is because of cluster size shenanigans, like files only being allowed to be a multiple of 100kb large. When an episode consists of thousands of very tiny files, you can see where the problem lies. An episode that only takes 200MB on my laptop (ext4) can easily take up 700MB on my Switch (fat32) just because of that. Being able to simply load episodes from a tar or an uncompressed zip file would completely fix the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
asset customization Issues related to custom graphics, sounds, asset packs etc. enhancement New quality-of-life feature or request (does not change gameplay)
Projects
Development

No branches or pull requests

6 participants