godot-tbloader icon indicating copy to clipboard operation
godot-tbloader copied to clipboard

Crash when building map when TBLoader is the scene root

Open MortimerMcMire opened this issue 3 years ago • 9 comments
trafficstars

Godot 4 alpha 12 and Godot 4 alpha 14 both crash when building the default Trenchbroom map (single untextured block). Default TBLoader node settings

MortimerMcMire avatar Aug 24 '22 01:08 MortimerMcMire

Hmm the latest version worked fine for me with Alpha 14, but I will try again.

codecat avatar Aug 24 '22 09:08 codecat

Is this on Windows? Or on Mac/Linux? And which version of TBLoader are you using?

codecat avatar Aug 24 '22 09:08 codecat

Windows, using 0.1.1 -I opened Alpha 14 in a brand new project -Installed 0.1.1 from the asset store -Closed and reopened Godot, then enabled TBLoader -Put a single TBLoader node in my tree and set the map to the default Trenchbroom map. (No other options were changed) -Clicked Build Meshes

The window hangs for a few seconds and then Godot crashes. Maybe there's a step in there I'm missing

MortimerMcMire avatar Aug 24 '22 14:08 MortimerMcMire

I just followed the exact steps you wrote, and it works for me:

image

Can you post the exact .map file you are using? Perhaps there's some differences there.

codecat avatar Aug 24 '22 14:08 codecat

Sure, this is just the default cube output from TB

// Game: Godot // Format: Standard // entity 0 { "classname" "worldspawn" // brush 0 { ( -64 -64 -16 ) ( -64 -63 -16 ) ( -64 -64 -15 ) __TB_empty 0 0 0 1 1 ( -64 -64 -16 ) ( -64 -64 -15 ) ( -63 -64 -16 ) __TB_empty 0 0 0 1 1 ( -64 -64 -16 ) ( -63 -64 -16 ) ( -64 -63 -16 ) __TB_empty 0 0 0 1 1 ( 64 64 16 ) ( 64 65 16 ) ( 65 64 16 ) __TB_empty 0 0 0 1 1 ( 64 64 16 ) ( 65 64 16 ) ( 64 64 17 ) __TB_empty 0 0 0 1 1 ( 64 64 16 ) ( 64 64 17 ) ( 64 65 16 ) __TB_empty 0 0 0 1 1 } }

MortimerMcMire avatar Aug 24 '22 16:08 MortimerMcMire

Yeah that's the exact same file as I have :(

Are you able to compile TBLoader manually (in debug mode) and attach a debugger?

codecat avatar Aug 24 '22 20:08 codecat

Exception thrown: read access violation. <args_0> was 0x8.

stack trace

 	tbloader.windows.x86_64.dll!godot::internal::_call_native_mb_no_ret<void *>(void * const mb, void * instance, void * const & <args_0>) Line 67	C++
 	tbloader.windows.x86_64.dll!godot::Node::set_owner(godot::Node * owner) Line 243	C++
 	tbloader.windows.x86_64.dll!Builder::build_worldspawn(int idx, LMEntity & ent) Line 76	C++
	tbloader.windows.x86_64.dll!Builder::build_entity(int idx, LMEntity & ent, const godot::String & classname) Line 121	C++
 	tbloader.windows.x86_64.dll!Builder::build_map() Line 64	C++
 	tbloader.windows.x86_64.dll!TBLoader::build_meshes() Line 153	C++
 	tbloader.windows.x86_64.dll!godot::call_with_variant_args_helper<TBLoader>(TBLoader * p_instance, void(TBLoader::*)() p_method, const godot::Variant * * p_args, GDNativeCallError & r_error, IndexSequence<> __formal) Line 221	C++
 	tbloader.windows.x86_64.dll!godot::call_with_variant_args_dv<TBLoader>(TBLoader * p_instance, void(TBLoader::*)() p_method, void * const * p_args, int p_argcount, GDNativeCallError & r_error, const std::vector<godot::Variant,std::allocator<godot::Variant>> & default_values) Line 290	C++
 	tbloader.windows.x86_64.dll!godot::MethodBindT<TBLoader>::call(void * p_instance, void * const * p_args, const __int64 p_argument_count, GDNativeCallError & r_error) Line 309	C++
 	tbloader.windows.x86_64.dll!godot::MethodBind::bind_call(void * p_method_userdata, void * p_instance, void * const * p_args, const __int64 p_argument_count, void * r_return, GDNativeCallError * r_error) Line 111	C++
 	[External Code]	

as far as I can tell its attempting to set owner to null which godot doesn't like

MortimerMcMire avatar Aug 25 '22 00:08 MortimerMcMire

I apologize if you've been spending time on this, but I found the error. I did some detective work and studied your screenshot. You can't have TBLoader as the root node in a scene when you Build Meshes - it has to be a child of a Node3D, or you crash.

MortimerMcMire avatar Aug 25 '22 16:08 MortimerMcMire

Oh, interesting! Thanks for checking this. I might be able to fix this though! So I'll re-open this issue for now.

codecat avatar Aug 25 '22 16:08 codecat