Comments (9)
A fix for Windows DLLs has been merged in godotengine/godot#80188! Now all three main platforms allow to recompile Rust while the editor is open, which is really nice 😊
In other great news, an initial step towards hot reloading is being worked on in godotengine/godot#80284 🚀
from gdext.
Both
have been merged to Godot master
.
We can consider this very first issue and big blocker resolved! 🚀
There will likely be some follow-up questions and improvements on hot reloading, but these can be addressed separately 🙂
from gdext.
Btw, to reload signals etc from the DLL, it does work to do Project -> Reload current project 👍 I guess it's effectively the same as restarting godot but a bit more convenient. Also closing to project menu and opening the project again works.
from gdext.
The thing is that all GDExtension bindings currently suffer from this issue, so I'd rather not build a Rust-specific workaround.
It would be nice if this were fixed in Godot itself. godotengine/godot-cpp#955 proposes an approach, but priorities have shifted again... I'll try to bring this up again 🙂
from gdext.
On linux I can rebuild the DLL fine but some things are not updated. For example I've seen that I need to restart godot (maybe there is another way to trigger a "refresh"?) when:
- Adding a new type of node and for it to show in the list of available node types.
- Adding a new (
#[func]
) and for it to be known by godot such that I can connect a signal to it.
from gdext.
I am also seeing a very similar behavior on Linux. It makes sense because:
- Each time the game runs, the DLL is read from disk, so if there are changes, the game process will pick it up. But...
- The DLL is read by the godot editor once at startup, and never reloaded, so whatever was there at the time of loading, is what the editor will show.
So, basically, reloading the game changes happens to work on Linux merely by accident. It was not intended in the design GDExtension. That's also why in Windows, the DLL is being locked and never freed, because the process does not expect it to ever change. It is generally a reasonable assumption to make for plugin development, but seriously hampers game development 😕
from gdext.
I can confirm similar behavior on osx as well. I can leave editor open and recompile at will as long as iam not adding new end points essentially. In that case for editor to notice them project reload must be used.
from gdext.
On Windows it is usually possible to move a locked file (so long as it remains on the same disk), which would allow the build to proceed. I no longer use Windows, so I can't confirm whether this would work in this case.
If it does, you only need to move the file every time the editor starts. You could probably attempt to acquire a read lock in build.rs, or powershell, or something and move the file if that fails.
from gdext.
Testing godotengine/godot#80284 and changing only compat things in gdext (https://github.com/LeaoLuciano/gdext/tree/hot-reload), it works (on linux):
hot_reloading.mp4
from gdext.
Related Issues (20)
- Extension class instances constructed in rust cannot be reloaded HOT 1
- `#[derive(GodotClass)]` on tuple structs should fail before other macro failures HOT 4
- `Engine::register_singleton` corrupts object ref count HOT 3
- `GodotClass`: user vs. library items, characteristics and orthogonality
- Improvements with Godot classes for better templating HOT 3
- Make `ScriptInstance.call` and company re-entrant HOT 15
- ScriptLanguageExtension methods can be called from multiple threads HOT 2
- Support using `Base` for initialization in `init` function HOT 7
- Impl `Iterator::size_hint()` for `Dictionary` iterator types HOT 3
- Support every class-registration option that Godot offers HOT 1
- AutoLoaded scenes through an EditorPlugin GodotClass are not added the scene of the editor node tree HOT 7
- Module `convert_error` is private HOT 2
- GDExt panics when two structs from different modules are named the same HOT 1
- `Gd<Self>` return type causes type error when fn annotated with `#[func]` HOT 2
- Implement (or derive) GodotType for godot compatible repr enums HOT 2
- Godot editor crashes when hot reloading gdext library with custom resources HOT 6
- Import Godot docs for builtin types HOT 7
- No recommended way to call `Base<T>` methods from `init` HOT 2
- Single- and multi-threading support for `Callable::from_fn` HOT 1
- `gdext`-based custom resource format tools needs `experimental-threads` feature HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gdext.