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

feat: Introduce bevy_asset_loader #16

Merged
merged 1 commit into from
Jan 26, 2024
Merged

Conversation

lgrossi
Copy link
Collaborator

@lgrossi lgrossi commented Jan 26, 2024

Why?

Asset loading is a complex matter. Because it happens async via bevy assert server, we need to have good control over the availability of the loaded assets. bevy_asset_loader simplifies that for us, providing multiple features when it comes to asset loading: dynamic loading, folder loading, macros, etc.

What?

Currently we have a few types of assets being used in Compass:

  • .dat appearances
  • .json catalog
  • .content.toml config
  • .png images/sprites (in our case, most of them are atlases)

While the first three are trivial and can be easily ported to assets loader crate, the images are a bit more convoluted. To reduce the costs of dealing with thousand of sprites, we use sprite atlases. Although asset loader deals well with atlases, it does increase the loading time and the overall memory usage.

To balance that, we are adding sprites pre-loading as optional behind a feature, while keeping our lazy-loaded sprites as the default.

@lgrossi lgrossi force-pushed the lucas/introduce-asset-loader branch 2 times, most recently from 000c339 to 4706037 Compare January 26, 2024 14:37
bevy_asset_loader simplifies the asset loading flows and allows better control over assets loading time.

We are also adding a new feature that enables asset_loader for the sprite sheets instead of lazy loading.
@lgrossi lgrossi force-pushed the lucas/introduce-asset-loader branch from 4706037 to b2f8d2e Compare January 26, 2024 15:03
@lgrossi lgrossi merged commit ada427f into main Jan 26, 2024
5 checks passed
@lgrossi lgrossi deleted the lucas/introduce-asset-loader branch January 26, 2024 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant