-
-
Notifications
You must be signed in to change notification settings - Fork 75
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
ContentDownloadScene for downloading tar packed song packages #130
Conversation
…ed minifiied SharpZipLib, added ThreadPool ContentDownloadScene downloads a specified tar packaged song pack and unpacks it into PersistentDataPath
UltraStar Play/Assets/Scenes/Options/ContentOptions/ContentDownloadSceneController.cs
Show resolved
Hide resolved
SharpZipLib seems nice. But why not use a download-dependencies script like with the other libs? |
Is Plugins/Threads your own implementation or an external library? I don't understand why it is needed. Does Unity provide no multi-threading? |
Is there a default set for the download url? Is there already such an archive hosted somewhere? |
SharpZipLib only recently changed to MIT and there are still some people who contributed to old code parts but so far did not sign an agreement for the license change. Also, we only need a small part of the lib. Thus, I cut out the classes needed for unpacking tar archives and its dependencies within the lib -> minified. That required updating imports, which would be difficult to do using a download-dependencies-script.
See the license file in that folder, the code is from @AnsisMalins and it is the simplest and easiest solution for managed background tasks and is already done properly. From what I was told, Unity itself does not offer anything for threading. Of course, we could implement a static thread pool again, but we would end up with something like the ThreadPool class which Ansis already coded. The advantage of this ThreadPool class over unmanaged creating Threads is that there is less memory overhead and it simplified managing the threads.
Afaik, a ultrastar archive song packages based content sharing ecosystem so far is only implemented by a my little pony fan community and a russian indie music creators community. The https://github.com/UltraStar-Deluxe/songs collection could be shared like this. At 36c3 I talked with some people from cultural commons collecting society and also from Jamendo, regarding sharing legal content sharing possibilities. |
My hope is that many more communities will start sharing content using song repositories containing tar archive based song packages. How to create a song package: just tar a song folder, upload it somewhere and you are ready. Most archive tools support the tar format - for example 7-Zip. |
What does this PR do?
Adds a new ContentDownloadScene which is accessible from GameOptionsScene.
Users can paste a URI to a song package, see how big the size is and start downloading the file.
During download, a download percentage will be shown, and during unpacking of the tar file, a non-static status message is shown until unpacking of the tar package finished. After unpacking the tar, the temporary tar file will be deleted.
Motivation
It was rather difficult to download and unpack song content into for the game especially on mobile platforms. This addition changes this.
Additional Notes
As a next improvement, the Songs folder in the persistentAppData path should be added to the songs folder setting and then then content should be scanned, so that it is directly available in the game without restarting the game.