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

Fix debugger tab runtime update #301

Merged
merged 1 commit into from
Jan 21, 2024
Merged

Fix debugger tab runtime update #301

merged 1 commit into from
Jan 21, 2024

Conversation

razcore-rad
Copy link
Contributor

@razcore-rad razcore-rad commented Jan 20, 2024

fixes #203
supersedes #204

I left it on as a Draft PR because the realtime update is not ideal as it unregisters & re-registers the entire tree every node change which can be optimized + unit tests added.

Tested with a modified version of the project from #203:
BeehaveBranchBug.zip

2024-01-20_09-21-32.mp4

edit:
I noticed that all I have to do to update the tree is to re-register it, no other necessary unregister/register steps so I amended the last commit.

So what's left is unit testing.

@razcore-rad
Copy link
Contributor Author

OK, I'm actually not entirely sure how to write a test for this since the example with the debugger is actually using an instance of the debugger tab at runtime where we already know register_tree() works so adding a scene where we call functions like this:

# test/debug/debugger_test_scene.gd
func _ready() -> void:
	# [...]
	beehave_tree.get_node("SequenceComposite/MockAction").queue_free()
	await get_tree().create_timer(1).timeout
	beehave_debugger_tab.register_tree(beehave_tree._get_debugger_data(beehave_tree))

Is meaningless.

@razcore-rad razcore-rad marked this pull request as ready for review January 20, 2024 12:36
@bitbrain
Copy link
Owner

Amazing work and nice approach - thanks for your contribution @razcore-rad

@bitbrain bitbrain merged commit c6732bc into bitbrain:godot-4.x Jan 21, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Branches created into the behavior tree at runtime do not show up in the debugger
2 participants