A thok barrier is simply an outer sector(s) 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 walls. All official SRB2 levels have them, as do almost all community-made maps.
Contents |
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. On a lesser note, levels without thok barriers traditionally get cold responses from the community, resulting in constant, sometimes unpleasant, calls to make a thok barrier.
First, create a new level in your favorite map editor. Then, make one new rectangle sector. It can be any size; just make it reasonably large, such as 3000 units wide.
800x800 wide sector. Remember that you can always resize this later.64 units, or two gridlines in the default grid, is a good fit.
Inside the inner sector is where your playable area, or the level room is going to be. Inside it, you can put any elements, such as rings or pits. The outer sector is going to be your thok barrier. You can't move into the outer sector or beyond it. Note that the lines, or walls, of the inner sector are the boundaries of where your player can walk. To make the thok barrier effective, lets edit the outer sector's properties!
128.
F_SKY1.
GFZFLR01.
F_SKY1. The floor graphic can be anything.
Great! Were you expecting more steps? That's your basic thok barrier. But let's not celebrate just yet; we have to set up the inner sector, too.
F_SKY1.
4096 units high. Make the floor 0 units high.
F_SKY1.
GFZFLR02.
If you already knew how to set up a simple level, that should be doable. However, a new trick here is to set the inner sector's walls differently.
GFZROCK. The other textures can be left blank.
Congrats! You're done! Now all you need to do is put a Player 1 Start in the inner sector, and maybe some rings and a spring, and then test the level!
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 touch. Otherwise, thok barriers are easy to recognize in map editors; they're a noticeable "outline" that wraps around the level.