func-godot / func_godot_plugin

Quake .map support for Godot 4
MIT License
321 stars 18 forks source link

brushes on disabled layers not marked as entities get merged with worldspawn when using TB groups hierarchy #30

Closed azur-wolve closed 1 week ago

azur-wolve commented 2 months ago

when on FuncGodotMapSettings.use_trenchbroom_groups_hierarchy == true

if have a layer disabled on TB and there's geometry that is not marked as entity (ie func_whatever)

such geometry isn't discarded but merged with the worldspawn; it should be

image

that can be problematic because if have a layer "prefabs" with brushes, either standalone or grouped, that have no entity applied

image

then those will get merged on map build with worldspawn, forcing to either not have such layer on TB map, or to not use FuncGodotMapSettings.use_trenchbroom_groups_hierarchy

image

because once merged on the same MeshInstance node can't delete them even deleting nodes manually after every map build is time waste.

RhapsodyInGeek commented 2 months ago

This is a tough one, because of the way brushes and entities are handled. We decided that there are too many questions associated with how to handle Worldspawn split across multiple TrenchBroom layers and so what we settled on is that, since there is only 1 Worldspawn in a map file, there would be only 1 Worldspawn in a built map, so all Worldspawn brushes, regardless of their layer, would be merged out of those layers and into the entity_0_worldspawn.

We also just generally don't recommend using Worldspawn in general to make maps for Godot, due to a number of issues with that practice. It really only exists as a quick option for people to just quickly place a few brushes and build a map, to get started right away with something simple.

I'm not opposed to the goal, but it's a complicated ask. It will likely have to start in GeoGenerator to solve for it, but that is difficult in itself due to how the map file determines layers and layer settings.

RhapsodyInGeek commented 1 week ago

Closing issue due to inactivity and no current plans to implement.

For anyone running into this issue, I recommend either moving your prefabs to a separate map file or converting them into brush entities in order to avoid them building with the rest of the map.

Anyone who absolutely needs FuncGodot to ignore worldspawn brushes on disabled layers is still welcome to submit a PR.