Description
this is a tracking issue for integrating atelier-assets into bevy
I've been working with "resident asset-expert" @kabergstrom for awhile now to figure out the future of the Bevy asset system. @kabergstrom built atelier-assets, which has basically everything a pro-grade engine needs from an asset system. While learning atelier, I decided to explore the space for a bit by experimenting with directly expanding the current bevy_asset
with the features we were interested in. After much discussion about adopting atelier-assets vs expanding the current system, we agreed that atelier was the best long term bet. We merged a subset of my "bevy asset rework" in #693, just to unblock scenarios like GLTF loading and to prepare the way for an atelier migration.
Changes required for a merge
That being said, atelier needs a few features before it can be a drop in replacement for the current system. Atelier support shouldn't be merged until it has the following features:
- A
bevy_asset
integration layer- This should be something like the current
AssetServer
,Assets<T>
, andHandle<T>
. Zero-api breakage is a nice-to-have, but I'm cool with breaking apis if they are significant improvements or they significantly improve the integration clarity / complexity.
- This should be something like the current
- All current Bevy AssetLoaders ported to Atelier Assets
- Loading assets via their paths (Added support for Indirect handles & reworked Loader APIs amethyst/distill#64)
- Wasm publishing support (likely via pack files)
- Currently, the only way to publish a game with the tools atelier provides is to host a daemon server in a separate process from the game. Wasm (and potentially other future platforms) can't host an in-process daemon server. We need some way to publish games on platforms like wasm. @kabergstrom is planning on adding "packfile" loading, which would drop imported assets into a "packfile" which could then be directly loaded (without a daemon server). This should make WASM support easier, but its also just a nice way to package an app on any platform.
- Android publishing support (likely via pack files, but a daemon server might also work)
- iOS publishing support (likely via pack files, but a daemon server might also work)
- Bevy Task Features
- Support for spawn_local and !Send + !Sync futures (Support for !Send tasks #1216)
- file and TCP IO, maybe with async-fs+async-net?
- for web, probably want websocket support for Daemon connectivity
Given that Bevy's current asset system works for most current platforms/user-facing scenarios, I don't want to merge Atelier until we are sure it won't significantly block progress on things like building out platform support or publishing games.
Changes that are "nice to have"
There are also some "nice to have" items that I won't necessarily block a merge on, but should be addressed as soon as possible:
- Reduce the number of dependencies used by atelier as much as possible / cutting clean compile time
- This should include removing large or unnecessary dependencies, but it will also include aligning dependency versions as much as possible. I'm leaving this open-ended because theres a lot to discuss here and plenty of details that need to be handled on a case-by-case basis. For example, Atelier currently uses Tokio, which does introduce a decent amount of dependencies. But Bevy currently doesn't have anything that handles "async io", so theres no way out of adding new dependencies there. We will evaluate all of the options in that space and pick the one that fits our constraints the best.
Changes without any time pressure
And then there are some fun things that have no particular timeline and will likely just get spun off into their own issues:
- Wasm asset hot-reloading via something like websockets or WebRTC