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
Hot reloading for external levels #1
Comments
The workaround for this right now is to just hit save twice. |
This seems to be fixed since bevy's changewatcher now accepts a duration. |
Trouv
added a commit
that referenced
this issue
Oct 20, 2023
Related to #1 Since bevy's file changewatcher now accepts a `Duration`, running into the bug caused by level files being temporarily unavailable is either extremely unlikely or impossible with a reasonable duration. So, I think it's safe to remove this caveat from the readme saying that users need to double-save for hot-reloading to work for external levels.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hot reloading for external levels is pretty close, but when you save a level in the LDtk editor, bevy gives this warning without any
AssetEvent
being fired:This is the correct path for the file and it does still exist after save.
The only thing I can think of is that maybe the way LDtk saves these level files is that it deletes the file first then writes to it a millisecond later, and bevy hot-reloading doesn't like that.
However, I looked into the LDtk source code and it looks like it's just using Node.js's
writeFileSync()
function, but maybe I'm missing something.I saw in
notify::poll::PollWatcher
(which bevy seems to use for hot-reloading on linux) that you can set a delay for polling the filesystem, which may resolve the issue most of the time if I set it to like 50 ms or something.I don't think that particular value is controllable from the bevy api though.
Maybe bevy should still be capable of writing AssetEvents in this scenario in the future?
This is probably upstream issue.
The text was updated successfully, but these errors were encountered: