QodotPlugin / qodot-plugin

(LEGACY) Quake .map support for Godot 3.x
MIT License
960 stars 70 forks source link

Allow option to build and keep all brushes as separate static bodies and meshes #158

Closed Cavlon closed 1 year ago

Cavlon commented 1 year ago

Currently, the entire map is a single combined body but some games would benefit from having each brush as a separate static body and mesh so occlusion culling can be used and different colliders can be differentiated. This will also allow users to specifically change textures and materials in engine so they can use TrenchBroom purely for level design.

TheRektafire commented 1 year ago

You can already do that by breaking up your map into separate brush entities, idk if qodot will crap itself if you don't have any worldspawn brushes but I don't think it will, just make a "room" entity and make each chunk of your map a separate one of those

DeerTears commented 1 year ago

Yeah, Rektafire is right, we already have this. If you select multiple brushes and right click them, you can click "Group Selected Objects": https://trenchbroom.github.io/manual/latest/#groups

In the default Qodot.fgd, there's an entity definition for Trenchbroom groups which separates them into separate StaticBody and MeshInstance nodes. You can even turn some of those grouped brushes into a brush entity and QodotMap will build them as a child body, separate from the group.

There's also func_group, which is a Quake brush entity that exists to group things the same way, but it's more to help with porting maps since it prevents you from assigning another brush entity to brushes in the group.