-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Implement live reloading in GDExtension #4437
Comments
Live reloading is a complicated thing to implement, especially when native libraries are involved. Live++ is one of the most popular solutions out there, but it's proprietary. There don't seem to be any actively developed open source alternatives to Live++. |
related to: godotengine/godot-cpp#638 @Calinou I was looking for this some days ago and found this: https://github.com/3DExtended/HotReload |
Maybe this is of interest, Casey Muratori shows how to do Hot Reload in C/C++ in this early Handmade Hero stream: https://hero.handmade.network/episode/code/day022/#208 Not a one-stop solution like Live++ appears to be but it shows the basic approach. |
Just see the live++ in Unreal Engine, it's totally a mess. |
Hot Reload was implemented in godotengine/godot#80284 / godotengine/godot-cpp#1200. So this can be closed |
Describe the project you are working on
Working on a GDExtension binding for BeefLang.
Describe the problem or limitation you are having in your project
As far I can tell GDExtension DLLs can only be reloaded by restarting the editor, or making a copy of the DLL and editing the .gdextension file to point to it (not sure if the latter unloads the original DLL). While restarting the editor doesn't take long, it adds up over time. Imagine developing a large extension and having to restart 100s or 1000s of times. In general I think any improvements on iteration time are invaluable in game dev.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Automatically reload extension DLLs when changes to them are detected.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Windows locks native DLLs on load. A common way plugin systems get around this is to make a copy of the DLL and load that, then watch the original for changes to detect recompilation. I'm not very familiar with Godots codebase though, so I don't know if there are other complications with implementing this.
If this enhancement will not be used often, can it be worked around with a few lines of script?
I could add a post compile script for my DLL that copies it to the extension directory with a unique name then edits the .gdextension file to point to it (the workaround I mentioned above). Kinda hacky though.
Is there a reason why this should be core and not an add-on in the asset library?
This would improve iteration time of GDExtension significantly and shouldn't interfere with other features.
The text was updated successfully, but these errors were encountered: