Play addon
BackgroundWorker Node for Godot Engine's itch.io pageResults
Criteria | Rank | Score* | Raw Score |
LOVE | #32 | 3.623 | 3.800 |
Ranked from 10 ratings. Score is adjusted from raw score by the median number of ratings per game in the jam.
GitHub or Gitlab repo
https://github.com/MarioLiebisch/GD-BackgroundWorker
Leave a comment
Log in with itch.io to leave a comment.
Comments
Cool work and I can see it as useful for a lot of people that might not be super comfortable with threads. Great work!
when first loading:
after enabling the plugin everything worked though.
Curious. Not really sure what triggered this, though.
Im just curious what godot will do if we load some big scene without your worker. Will it just freeze for a moment?
This depends how you load it. Godot has a built in way to load something in background, too.
If you use load(), the program will halt/stall until loading is finished. If you use preload(), whatever you try to load will be preprocessed when building and then loaded together with the parent scene/node preloading, and you can use interactive loading provided by Godot's own ResourceLoader class. The latter just requires you to add a bit more code around it.
You could always just use your own thread, too. Depending on what you load, doing it with my node might still cause your program to stall for a moment, because some operations can only be performed on an application's main thread (especially OpenGL stuff).
Overall this whole node is mostly a convenience thing. This doesn't involve anything you couldn't build on your own or do in a slightly different way.
Thanks for detailed response!
"Invalid call. Nonexistent function 'is_alive' in base '_Thread'." upon clicking on the "do some work" button. Yes, the plugin was enabled.
Oh, any chance you're running 3.3 or older? I wasn't aware this is a new feature in 3.4!
I'm running on V3.3.3 yes
Ok I see
Well, will see, I can definitely work around this requirement/dependency for a future post-jam version. Thanks for noticing!