Floor over floor
A floor over floor (FOF), or 3D block, is a platform that can be both stood upon and walked underneath. Due to the nature of the Doom engine, a normal sector has only one floor and ceiling, but SRB2 builds upon Doom Legacy's FOF support to allow the creation of the multi-leveled environments that are essential in platform gaming.
|Control sector settings|
|Ceiling height||Top of FOF|
|Ceiling flat||Flat on the top of the FOF|
|Floor height||Bottom of FOF|
|Floor flat||Flat on the bottom of the FOF|
|Light level||(Shadowcasting FOFs only) Light is applied below the FOF|
|Control linedef settings|
|Middle texture||Texture used for the sides of the FOF|
FOFs are added to sectors by employing special linedef effects, such as linedef type 100 (FOF: Solid, Opaque, Shadowcasting). The special linedef should be tagged to the sector that the FOF is to be created in, and should be part of a control sector whose floor and ceiling heights specify respectively the heights of the top and bottom of the FOF. The floor and ceiling flats of the control sector will be rendered respectively on the top and bottom of the FOF, and the middle texture of the front sidedef of the control linedef will be rendered on all visible edges of the FOF.
An FOF's ceiling height should be above or equal to that of its floor height – if the ceiling height is found to be below the floor height on map load, SRB2 will automatically flip these around to be correct, but will still display an error message in the console. However, if an FOF is given a negative height at runtime, this will cause the collision and rendering of the FOF to immediately change to height 0, but the FOF will still be tangible.
Other uses of FOFs
In addition to creating multi-leveled platforms, FOFs can be employed to achieve a variety of other effects.
Most important of these is the creation of water. If the FOF effect is a water type—for example, linedef type 120—then, rather than extra floors and ceilings being created at the heights specified by the control sector, the region between these heights within the target sector will be filled with water. Slime and lava are also created in this fashion, simply by setting the control sector's special effect to damage the player. To achieve the tinted coloring of water as used in the official game, a colormap (linedef type 606) must also be tagged to the control sector.
Several special effects influence the player only when the character is within a certain area of a sector. Wind effects are notable examples. This is achieved by creating an invisible, intangible FOF. The player cannot see the boundary of this region, but will only experience any tagged effects upon entering it.
Control linedef flags
- If the No Sonic, No Tails, or No Knuckles flags are selected, the FOF will not appear for Sonic, Tails, or Knuckles, respectively.
- If the Slope Skew flag is selected, a solid FOF blocks only the player.
- If the No Midtexture Skew flag is selected, a solid FOF blocks all Objects except the player.
- If the Transfer Line flag is selected, the FOF checks each linedef of the control sector separately for special attributes. This can be used to make multi-property FOFs that can have different textures, effects and flags for each side.
- Example WAD: ex_ld100_fofsolidopaqueshadow.wad
- This example WAD can be played in any gametype. It uses
MAP01, replacing Greenflower Zone Act 1.
- This example WAD shows how a simple shadowcasting FOF (linedef type 100) is constructed.