-
Notifications
You must be signed in to change notification settings - Fork 45
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
[PROPOSAL] Write reload logic in cpp #257
Comments
I agree on this one. But for me we should rely on engine implementation and avoid creating our own |
But does godot have a file watching functionality? |
I back this, although I advise against using a third party library - hopefully godot provide something in a platform agnostic way. This exist https://docs.godotengine.org/en/stable/classes/class_editorfilesystem.html - although I'm not sure if it will serve our requirement. |
I definitely agree. I wouldn't want a third party lib for this. This was just an implementation example if we have to do it ourselves in the end |
I don't think we can use this. As our buildLock file is not a imported resource. It resides in the tmp dir. Also i would not change this. I think this is a far more stable location than the project dir |
It looks to me that C# is using a timer node for this: https://github.com/godotengine/godot/blob/8f7f5846397297fff6e8a08f89bc60ce658699cc/modules/mono/editor/GodotTools/GodotTools/HotReloadAssemblyWatcher.cs Searching the godot source didn't yield in any watching functionality so far. |
I'm pretty sure that Godot got some thread running in the editor to check if a file in the project was changed recently: |
This issue is postponed until https://github.com/utopia-rise/godot-kotlin-jvm/milestone/9 is done |
Currently we have the bootstrap class which handles file system changes and reloads classes accordingly.
It basically is the sole reason why we have to ship the
godot-bootstrap.jar
alongside the engine executable.I propose that we implement this filewatching and reloading logic completely in cpp. Looking at the impl of some other cpp filewatching libs (like https://github.com/apetrone/simplefilewatcher/) we should be able to to this kind of filewatching ourselves pretty easily as well even if we have to implement it platform specific. Maybe even godot has some platform independent way of watching filesystem changes.
Also now that we use a buildLock file instead of watching the
build
dir directly, the file watching logic is greatly simplified.So we would in fact only need to watch one file which further simplifies things a lot.
This would pave the way for better/simpler editor builds and would completely remove the need for two jar files as we could pack everything into one jar. Which would also simplify export targets like android a lot.
The text was updated successfully, but these errors were encountered: