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

Automatically extract asset packs inside ZIP files. #309

Open
drwhut opened this issue Nov 9, 2023 · 0 comments
Open

Automatically extract asset packs inside ZIP files. #309

drwhut opened this issue Nov 9, 2023 · 0 comments
Labels
assets Related to assets or asset packs feature New feature or request
Milestone

Comments

@drwhut
Copy link
Owner

drwhut commented Nov 9, 2023

Is your feature request related to a problem? Please describe.
Since there is currently no central repository for downloading asset packs, players need to manually download them and place them in the correct folder in their Documents - because of this, most asset packs are distributed via ZIP files, the contents of which need to be extracted in order for the game to be able to read them.

Describe the solution you'd like
It would be nice if the extraction step could be skipped when installing new asset packs, and have the game do this step for us.

In terms of the functionality, the game would need to start with the ZIP file in the player's Documents folder, and end up with a folder structure somewhere on the file system for it to scan like all other asset packs. Where the extraction takes place is where the implementation can change, but here's a few ideas:

  • Avoid writing any files onto the filesystem, and perform checksums only in memory. This would reduce clutter, but the ZIP file would need to be read every time the game is launched.
  • Extract the ZIP file and place the contents next to the file. This would automatically position the asset pack in the spot where it can be scanned, but things get complicated if the ZIP file is updated while the folder still exists.
  • Extract the ZIP file into a special folder under the internal user:// directory. A separate system could be developed to track changes in the files, and it would remove clutter from the player's Documents folder, but this is probably the most complex solution.
  • Since files that are scanned in from the Documents folder are copied into the user://assets/ directory anyways, the scanning system could be extended to also read ZIP files and copy them into that location, as well as regular folders.

Describe alternatives you've considered
None.

Additional context
Godot 4.x has a ZIPReader class that is perfect for this issue - however, an equivalent does not exist in Godot 3.x by default (which is what Tabletop Club v0.2.0 is going to use). Luckily, '20kdc' from the community Matrix server has developed a stand-alone script that replicates the ZIPReader API for 3.x, which makes this issue solvable for v0.2.0!

@drwhut drwhut added feature New feature or request assets Related to assets or asset packs labels Nov 9, 2023
@drwhut drwhut added this to the v0.2.0 milestone Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assets Related to assets or asset packs feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant