godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.01k stars 21.17k forks source link

EditorDebuggerRemoteObject in Inspector shows wrong object id #96378

Open jinyangcruise opened 2 months ago

jinyangcruise commented 2 months ago

Tested versions

System information

Windows 11, Vulkan API 1.3.205 - Forward+ - Using Vulkan Device #0: NVIDIA - NVIDIA GeForce RTX 3060 Ti

Issue description

When debugging, the stack object's id is wrong.

As below, the id in the Inspector should be 9223372080660088240, not -9223371993049463376

屏幕截图 2024-08-31 181717

I notice there is a difference between two files: https://github.com/godotengine/godot/blob/61598c5c88d95b96811d386cb20d714c35f4c6d7/editor/debugger/editor_debugger_inspector.cpp#L69-L75

https://github.com/godotengine/godot/blob/61598c5c88d95b96811d386cb20d714c35f4c6d7/editor/editor_properties.cpp#L1331-L1349

I guess it should be modified to:

 String EditorDebuggerRemoteObject::get_title() { 
    if (remote_object_id.is_valid()) { 
        //return vformat(TTR("Remote %s:"), String(type_name)) + " " + itos(remote_object_id); 
        return vformat(TTR("Remote %s:"), String(type_name)) + " " + uitos(remote_object_id); 
    } else { 
        return "<null>"; 
    } 
 } 

Furthermore, this method get_remote_object_id also give a wrong id (eg. -9223371993049463376) in gdscript:https://github.com/godotengine/godot/blob/61598c5c88d95b96811d386cb20d714c35f4c6d7/editor/debugger/editor_debugger_inspector.h#L51

Steps to reproduce

NA

Minimal reproduction project (MRP)

NA

jinyangcruise commented 2 months ago

update: Object id in tooltip when debugging also have the same problem.

屏幕截图 2024-09-01 091750
jinyangcruise commented 2 months ago

update: I made a MRP for this issue.

I'm confused which object id is correct or both are correct? The negative object id can be successfully used to get the object by instance_from_id in the MRP.

屏幕截图 2024-09-01 101313 屏幕截图 2024-09-01 101230 test_debug2.zip

jinyangcruise commented 2 months ago

I made a plugin whenever we click the stacked object when debugging, the inspector will add a lable to show the object's class_name. but the object id suddenlly become invalid, I don't know why.

屏幕截图 2024-09-01 102642

test_debug_with_plugin.zip