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

Improve how large assets (music) are handled #763

Open
IntegratedQuantum opened this issue Nov 1, 2024 · 6 comments
Open

Improve how large assets (music) are handled #763

IntegratedQuantum opened this issue Nov 1, 2024 · 6 comments
Labels
engine enhancement a new feature or improvement experimental a feature or idea that will require lots of experimentation optimization a performance problem that should be addressed or an optimization idea
Milestone

Comments

@IntegratedQuantum
Copy link
Member

There are some problems with the current system:

  • Right now they are redownloaded every time the game is updated using the easy way.
  • Either way they are downloaded before launching the game (→ more waiting for first-time player).
  • For server side assets, they are downloaded from the server (→ unnecessary bandwidth usage on join)
  • For server side assets, they are redownloaded every time (→ not that important, since there are other fixes)

All of them could be solved like this:

  • music is no longer stored in the assets, instead the assets only contain download links to the music
  • music is stored in a global cache, which is checked first before trying to download a song

The disadvantages of this are obvious:

  • addon creators need to host the music somewhere, instead of just bundling them in with the other assets
  • music of these addon would be prone to link rot and are likely to break at some point in the future.

I'm not sure how big of a deal these problems are.
Publicly hosting files like music today is easier than ever and it's often free.
And if there is no community for an addon to fix the link rot, then it doesn't seem like it would be worth caring about anyways.

One possible solution for addons would be to just allow the old behavior using local links with relative file paths.

@ikabod-kee I would like to hear your opinion on this.

@IntegratedQuantum IntegratedQuantum added enhancement a new feature or improvement experimental a feature or idea that will require lots of experimentation optimization a performance problem that should be addressed or an optimization idea engine labels Nov 1, 2024
@IntegratedQuantum IntegratedQuantum added this to the Short-Term Goals milestone Nov 1, 2024
@ikabod-kee
Copy link
Collaborator

I think a good option could be to have a Cubyz updater that updates Cubyz to the latest version, so you don't have to download the game repeatedly. The only reason having this many music files is a problem is because it adds onto compilation time.

@ikabod-kee
Copy link
Collaborator

Which would mean "installing Cubyz" XD

@ikabod-kee
Copy link
Collaborator

For servers assets, a link could work, yeah, but you could also solve this by providing the add-on to the player to pre-install before joining, or compressing the music files.

@IntegratedQuantum
Copy link
Member Author

I think a good option could be to have a Cubyz updater that updates Cubyz to the latest version, so you don't have to download the game repeatedly. The only reason having this many music files is a problem is because it adds onto compilation time.

Yeah that's planned with the launcher, but the launcher should not handle downloading the game assets, because that would make regular development (without the launcher) more difficult.

Furthermore if the launcher downloads the music, then it must happen before the game starts, what I'm suggesting is to download it while the game is already running. Downloading 200 MB can take quite a while on bad connections.

For servers assets, a link could work, yeah, but you could also solve this by providing the add-on to the player to pre-install before joining, or compressing the music files.

Yes, that is an option, but I prefer the per-world asset model that has been established, because it's zero work for the player.
Also note that this doesn't just apply to the server, but any world with these addons. If the world file contains 100 MB of music, then that is going to bloat the saves folder.

@ikabod-kee
Copy link
Collaborator

Shall I give you the music files so you can make a separate repo for them?

@IntegratedQuantum
Copy link
Member Author

No, I think I'll get this done soon anyways.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
engine enhancement a new feature or improvement experimental a feature or idea that will require lots of experimentation optimization a performance problem that should be addressed or an optimization idea
Projects
None yet
Development

No branches or pull requests

2 participants