Thok Barrier

From SRB2 Wiki
Jump to: navigation, search
File:Sample-thokbarrier.png
A simple thok barrier wall.

A thok barrier is an outer sector that encloses the whole level. As well as looking more pleasant than normal walls, they also have the very important purpose of stopping the player from walking outside the level boundaries. All official SRB2 levels have them, and every custom-made should have one as well. For a tutorial on how to make a thok barrier, refer to the second chapter of the SRB2 Doom Builder Tutorial.

Purpose

File:Bug-outsidelevel.png
A player walking outside the level.

The main reason behind the thok barrier is that it prevents glitches from happening in the game. Namely, a level without a thok barrier allows the player to speed outside the level, traditionally by thokking as Sonic. Even if they're inside the level, the camera can "leak" outside of the walls if the player is standing close enough to one. Knuckles also can't climb properly on the outermost walls if a thok barrier isn't there.

Structure

A thok barrier is created simply by creating a sector around the whole level and setting its floor and ceiling height to the same value. This creates a solid wall that cannot be stood upon because the ceiling is directly on top of the floor, leaving no room for the character to stand. In outdoor levels, the ceiling flat is set to F_SKY1 to display the chosen sky above the outer walls. Invisible thok barriers can also be created by lowering the floor and ceiling height to the floor height of the contained sector. This can lead to glitches in open levels, however, and should be exercised with caution.

Appearance

If the level is outdoors, one can easily tell if the level has a thok barrier if there is a thin strip of outer wall that the player can't stand upon. Otherwise, thok barriers are easy to recognize in map editors; they're a noticeable "outline" that wraps around the level.

Personal tools