The Parts and Whole: Func Group

From The DarkMod Wiki
Jump to navigationJump to search

by Geep 2022, based on posts by Spooks

Introduction

Wish you could name a grouping of one or more worldspawn items (i.e., brushes and patches), for convenience in DR? That's what func_group is for.

First, set a global spawnarg "moveFuncGroups 1" (i.e., on any piece of worldspawn that will NOT be converted to func_group). Then:

  • Select your worldspawn objects of interest
  • Begin the conversion with:
    • In DR 3.0+, RMB and "Convert to Entity..."
    • In earlier versions of DR, RMB and "Convert to func_static". Then, in the Entity Inspector, use the "Choose Entity Class..." button
  • Choose the classname "func_group", found under "Internal", not "Funcs"
  • Give the group a name
  • Don’t bother giving the func_group any additional spawnargs (because it’s useless; func_group entities will not spawn)

During DMAP, the group members are turned back into worldspawn!

Be aware that early Doom/Quake editors used "func_group" with a different meaning, like the current DR Group feature.

Use Case

Adapted from a forum thread by Spooks

The biggest advantage is func_static-like naming flexibility in the editor.

Suppose you have four different brushes as an ensemble, and want to clone them 100 times around the map while still being able to select each one of those 100 ensembles, particularly by name. Drawbacks to other methods are:

  • With Layers. The Layers viewer offers only a flat view (not hierarchal or folder-based), and 100 Layers is unmanageable.
  • With Selection Sets. Also unwieldy with 100 items, but even worse, since you have to go through a typed list and there's no way to delete an individual selection set. And sets don’t persist across sessions
  • By Export of the Ensemble as a Reusable Model. This is similar to func_group in some regards. Before export, you first have to convert the brushes from worldspawn into entities. And turning imported instances back to worldspawn later, besides losing the naming, can have problems (e.g., with grid alignment; but see the cautions with func_group as well).

Another perceived advantage of func_group is as a method to drastically decrease entity counts inflated by architectural pieces, allowing for a lot more leeway when it comes to modular building. But the expanded entity limit in TDM 2.10 means that careful management of entity count is no longer required. Still, entities have a drawcall penalty compared to worldspawn, so there may be performance benefits.

Cautions

Because the func_group name is not retained after DMAP, you can’t usefully reference it at run time, e.g., as a target or in a TDM script function.

Be careful about moving a func_group, because it will not be constrained by the grid, and so when DMAP’d back to worldspawn, may be off-grid and thus prone to causing rendering anomalies.

In DR’s Filters, a func_group will be treated as just another entity. Thus, it will disappear with the "All entities" filter. If you are using that filter to visualize where your sealing worldspawn is, you may be misled, overlooking worldspawn converted during compilation from func_group.

See Also

The Parts and Whole: Overview