-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Improve stuttering when starting a timeline #17
base: main
Are you sure you want to change the base?
Conversation
Dialog won't start until the theme images are loaded
I have found an issue with the multi-threaded portrait image loading that I'm not exactly sure how to fix. I will occasionally get the following errors when playing a timeline, and I think it's when there is a character join event (with a portrait specified) directly followed by a text event with the same character and portrait. The portraits still load properly when running through the editor and in debug builds, but in release builds this error results in texture corruption issues. I'm thinking it might be caused by multiple threads trying to load the same resource at once? Admittedly I'm not super familiar with multi-threading best practices, but maybe this could be solved with a mutex/thread lock of some kind. |
- Emit signals from 'Portrait.gd' slightly differently - Use mutexes to lock texture assignments
Texture assignment issues should be fixed with the latest commit, hopefully thread-safe now. I am using these changes in my game currently with no issues. |
I found and fixed some more issues that happened when the theme took too long to load. I updated my testing project textures (textbox, portraits) to be 8K pngs so that it takes my PC a proper half second to load them, and I think I've finally ironed everything out... This threading stuff got much more involved than I intended, so I'm willing to put those changes in a separate PR if the reviewers want. Or if it's just too messy/risky to be meddling in core logic like this I can just maintain my own fork - no hard feelings, just let me know. |
This PR addresses some causes of stuttering that happens when starting a timeline. Changes include:
DialogNode.tscn
or whatever node the user has chosen. This allowsResourceLoader
to have a cached version in memory so it doesn't have to load it from the disk every time. The cache is created during theDialogic.preload()
call (Optional, includes a setting to enable & pick cached scene).timeline-xxxx.json
). It seems like this may have been a simple oversight originally, but it was causing every timeline to be loaded from the disk for me because I was using custom resources with an exported value that used the custom timeline selector.My changes seem to work fine in my use/testing, but I haven't tested it extensively with very many use cases. I tested on Windows/Linux/Web builds, Godot 3.5.3, i7-11700KF, RX6800XT.