codecat / godot-tbloader

TrenchBroom Loader for Godot 4. (Alternative to Qodot)
MIT License
233 stars 29 forks source link

Godot crashes when building map files which heavily utilize repeated linked duplicates #39

Open sszczepa opened 1 year ago

sszczepa commented 1 year ago

I've found that Godot crashes when trying to load map files which heavily utilize repeated linked duplicates.

I can replicate this issue by starting a new map file in Trenchbroom, grouping 5 brushes together, and creating a linked duplicate from this group ~300 times (I'm not sure what the exact cut off value is, but this is a safe value to cause the crash).

When trying to build the map in Godot running with the verbose flag, the following error is generated:

Building map res://maps/test01.map Failed method: Control::_clear_size_warning Failed method: CanvasItem::_redraw_callback Failed method: CanvasItem::_redraw_callback

================================================================ Failed method: CanvasItem::_redraw_callback

However, if I select all of the groups in Trenchbroom, right click and select "Ungroup Selected Objects" to break all of the brushes back down, the map will compile fine in Godot.

codecat commented 1 year ago

Can you post a .map file that causes the crash? I managed to make a map file that causes the crash.

I'm not entirely sure why exactly it's crashing yet, but it seems like it might have something to do with the amount of nodes in the scene that is created from having groups. Each group will get its own node.

Maybe it would be nice to have an option that all meshes are grouped into the same root node.