Skip to content
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

Added a multithreading loading #2522

Merged
merged 2 commits into from
Jan 23, 2025

Conversation

RightSorcerer
Copy link
Contributor

I just replaced load(scene_path) with ResourceLoader.load_threaded_request(scene_path) and placed await in the code. Now, when scenes with characters are loaded, there are no freezes in the main thread. I used a complex custom scene with Spine animations and 4k atlas textures.

I just replaced load(scene_path) with ResourceLoader.load_threaded_request(scene_path) and placed await in the code.
Now, when scenes with characters are loaded, there are no freezes in the main thread.
I used a complex custom scene with Spine animations and 4k atlas textures.
@zaknafean zaknafean self-assigned this Jan 23, 2025
@zaknafean
Copy link
Collaborator

zaknafean commented Jan 23, 2025

Hey just checking the intention here:

image

As I'm currently getting a syntax error, I assume its intended to be similar to the clauses in 'extra data', but wanted to be sure

if character_node.get_child_count() > 0:
		var latest_portrait := character_node.get_child(-1)

		if latest_portrait and latest_portrait.has_method("_set_extra_data"):
			latest_portrait._set_extra_data(extra_data)
	else:
		push_warning("[Dialogic] No portrait found for character node: " + character_node.name)

@RightSorcerer
Copy link
Contributor Author

@zaknafean
I corrected the line and rechecked the functionality, there really was an error, apparently when I transferred from my project to this branch, I did something wrong and this error appeared.
Please test it again.

@zaknafean zaknafean merged commit 7a24c14 into dialogic-godot:main Jan 23, 2025
3 checks passed
@zaknafean
Copy link
Collaborator

Everything seems to be in order, though my projects aren't complicated enough to see a visual benefit consistently. Thanks alot for the contribution! Will unleash this into the rest of the alpha and have a wider audience test through it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants