fian46/addons-btree

Visualise the BTree activity while the game is running

Closed this issue · 9 comments

I'd like to work on having the btree show the current state of the current node (by colour) for ease of debugging and experimentation.

Do you have any thoughts on how best to send updates from the running game code (runtime.gd) to the tool graphnodes, in order to update the colors? Apparently add_autoload_singleton() can work, but I've not had any luck.

*Great add-on, by the way. It's working nicely for my project.

currently this feature is broken due to bug in Godot engine it self. The EditorInspector class signal is main blocking issue to resolve. I am opening this bug report in Godot main repository. i am hopping Godot still do maintenance release in near future so i can complete this feature.

object_id_selected: Emitted when the Edit button of an Object has been pressed in the inspector.

Silly question, but what's the 'edit' button of an object?

I'm currently using init.gd, func selection_changed() to track if a node with a BTREE is currently selected.

[edited to remove non-related error in my code, which I thought might have been related :) ]

Selection changed to handle tree in local tree. Remote tree need editor inspector

"object_id_selected ( int id )
Emitted when the Edit button of an Object has been pressed in the inspector. This is mainly used in the remote scene tree inspector'

I am not quite sure what this edit button means. Sorry my english is not so good.

If really needed maybe btree can make it own remote scene tree inspector for current running instance. This can eliminate blockage within godot it self. But required heavy net code to send scene tree data and current btree state. This is not ideal since godot already sending the same thing. Plus this lib written in gdscript, debugging maybe harder because the heavy net code operation can fill the entire profiler stack and make things worse.

i am assuming just by selecting the node in remote inspector can return such id ? i am not aware about EDIT button anywhere so... what do you think ?

Screenshot from 2020-09-09 17-10-54

The debugger idea is get the object id, reverse the id to actual BTREE Node by GDSCRIPT function Object instance_from_id(id), get the runtime_tree then animate the color in editor.

closed with #16

I just learned that on old versions of Godot, the Workspace toolbar had an "edit" button (see the first image, just under the "Script" tab: https://docs.godotengine.org/en/2.1/learning/editor/2d_and_3d_keybindings.html), which is no longer there in the current version. Perhaps object_id_selected() is not supposed to do anything anymore.

Too bad i just rewrite custom inspector for it. Its already in my local branch and never pushed.