MercuryWorkshop / celeste-wasm

A mostly-complete port of Celeste (2018) to WebAssembly
https://celeste.r58playz.dev
30 stars 0 forks source link

Dynamically loaded assets and/or lossy compression #1

Open andrigamerita opened 3 months ago

andrigamerita commented 3 months ago

Hi people, first of all congratulations on this port! I'll say you've actually beat me on time, because I had the same idea about a week ago, but didn't actually start anything, and then today I decide to Google "celeste wasm" and magically I see this project appear out of nowhere!

The game runs pretty well even on Firefox, performance-wise, although in general it uses a lot of system memory, and the huge download makes jumping into the game to have fun slow. Loading issues are especially prevalent with the single-file HTML version. I think that this port could be made much more enjoyable by implementing one (or both) of two practices that are pretty standard when creating web games, regarding game assets (music, sfxs, textures, backgrounds, ...):

Let me know if these ideas fit on your roadmap! This porting has so much potential, it's truly the Universal Binary Executable for Celeste, and I think these two improvements would go a long way to making it more accessible and pleasant (even realistically usable on mobile, I predict).

velzie commented 3 months ago

thanks! the download is only for the first time, the assets should get cached in your browser's local storage. we're already using vorbis compression on the sounds and LZ4 for the entire assets bundle. there's definitely more to compress out of the .data files but i don't know how much png/jpg compression would do for the mostly pixel art assets. RE: asset streaming, emscripten FS operations generally cannot be async so the main thread would have to be blocked during chapter loading which would be pretty annoying on slower connections (other option would be to callback js from the game to "predict" when assets would need to be loaded before they are). there's definitely things to be improved though and i'm glad someone's as interested in the project :)