katharostech / bevy_retrograde

Plugin pack for making 2D games with Bevy
Other
296 stars 9 forks source link

📊 Task Pool For Blocking Tasks That Works on Web #8

Closed zicklag closed 3 years ago

zicklag commented 3 years ago

Currently, when loading sounds specifically, blocking tasks can freeze the main game and cause drastic visible lags. What we need is a task pool that can be used for running blocking tasks that can use a separate thread on native platforms and on WASM can use a web worker.

zicklag commented 3 years ago

Looks like this isn't feasible: https://users.rust-lang.org/t/how-to-copy-a-type-and-send-it-somewhere-even-if-it-is-a-pointer/58420/2?u=zicklag. 😥

We're just going to have to be concious about pre-loading our assets, providing loading screens, etc. Still, I learned a lot while working on this, which is a plus! 👨‍🎓