A room piece is the smallest element of a level. It's a bundle of data around a mesh file representing the behavior of that mesh when used in a level. room piece data is defined in level set files found in media/levelsets.
A typical piece will looks something like this:
[PIECE] <STRING>NAME:floor_blank_01 <BOOL>PRERENDER:False <BOOL>POSTRENDER:False <BOOL>RENDERSHADOW:False <BOOL>NEVERBAKE:False <INTEGER>RENDERORDER:0 <INTEGER64>GUID:-5748022380252687905 <FLOAT>HORIZONTALSNAP:4 <FLOAT>VERTICALSNAP:1.375 <FLOAT>VERTICALSNAP:2.75 <FLOAT>VERTICALSNAP:5.5 <FLOAT>ROTATESNAP:90 <STRING>FILE:media/levelsets/catacomb/catacomb_floor_blank_01.mesh <STRING>FILE:media/levelsets/catacomb/catacomb_floor_blank_02.mesh <STRING>FILE:media/levelsets/catacomb/catacomb_floor_blank_03.mesh <STRING>FILE:media/levelsets/catacomb/catacomb_floor_blank_04.mesh <STRING>FILE:media/levelsets/catacomb/catacomb_floor_blank_05.mesh <STRING>FILE:media/levelsets/catacomb/catacomb_floor_blank_06.mesh <STRING>FILE:media/levelsets/catacomb/catacomb_floor_blank_07.mesh <STRING>COLLISIONFILE:media/levelsets/catacomb/catacomb_floor_blank_01_collision.mesh <STRING>TAG:TILESET [/PIECE]
- (STRING) - The collision mesh to use for the room piece. If there are multiple visual meshes which need distinct collision, there must be an equal number of collision files specified as visual meshes and the collision/visual meshes need to be listed in the same order. The same collision mesh can be specified for multiple variations, but the number of items must match
- (STRING) - The visual mesh of the room piece. If multiple files are listed, one will be chosen at random each time a layout with this room piece is rolled.
- (BOOL) - If true, the piece will select a mesh variation when created in the editor, but not re-roll the choice when loading the layout.
- (INTEGER64) - The id of the room piece.
- (FLOAT) - A horizontal (X,Z) snap value for this piece. You can list as many as you want.
- (BOOL) - Room piece is just collision, no visual.
- (STRING) - The name of the room piece (for human-readability)
- (BOOL) - If true, this type of piece will never be baked (see section on baking below)
- (BOOL) - If true, Editor Brushes are able to place objects on this room piece. (Editor Only)
- (BOOL) - If true, the piece renders as a shadow.
- (INTEGER) - Specifies into which static geometry bucket to the room piece gets baked. The lower the order, the earlier the geometry bucket (0-5: 0 renders first, 5 renders last).
- (FLOAT) - A rotational snap value (degrees) for this piece. You can list as many as you want.
- (BOOL) - If true, the piece is scalable in the editor.
- (STRING) - An organizational tag used by the Room Piece Palette
- (FLOAT) - A horizontal (y) snap value for this piece. You can list as many as you want.
Room Piece Baking
As pieces are loaded during a level load, most piece will be "baked" into one of several "buckets" of static geometry. The RENDERORDER property room piece data control which bucket the piece is placed into. Room piece that need to move, or are animated cannot be baked into static geometry.