Chapter 3: Sectors, linedefs, vertexes, and fracunits.

See that title? Those are all basic terms you'll need to know. It's really easy. Up at the top, you'll see a toolbar with some buttons. A set of arrows, a set of points, a line, a box, a circle with an arrow, and an eye are all there. Those correspond to the different editing modes. In each mode, you change a different thing. The dots are for vertexes, the line for linedefs, and the box for sectors. Switch to Sectors Mode by clicking the box. Then, in your map window, right click anywhere. Move the mouse around, and you'll see a white line connecting two points. You'll also see a number on the line. Move the mouse downward from your starting point until the number says 256. Then, left click. Move the mouse to the right till you get 256, then left click again. Move up, 256, left click. Then, move the mouse to the left until it says 256, and left click a final time. If you did everything right (Shouldn't be too hard) you'll have a perfect square. Right click for a final time, and you should get a helpful box. There's a lot of (at first) complicated stuff here, so I'll guide you through it step by step.

At the top, you'll see Sector Effects. Leave this at 0 right now. This is for things like death pits and such. Next to that, you'll see Brightness. Put it at 255 if it isn't already. Below that, you'll see Sector Tag. Leave this alone right now. You'll see what it's needed for later. Below that are the really important things. Floor and ceiling height are how high the floor is and how low the ceiling is. Leave these at 0 and 4096. Next to that, you'll see two boxes with pics above them. The one on the left is ceiling flat, the one on the right is floor flat.

*SIDENOTE* Flats are the technical terms for pictures on the floor and ceiling. As a reference, textures are the pictures on the walls.*ENDNOTE*

Set the ceiling flat to F_SKY1 and the floor to FLOOR0_6. You'll notice that one of those is black. Keep that in mind. For now, click okay.

Now, let's try moving some things around. Up at the top, you'll see a sequence of six buttons. One is a four pointed arrow, the next is a set of dots, then a line, then a box, then a circle with an arrow in it, and last, an eye. Click the one that is the line, and you'll enter linedefs mode.

You: Wait, one second. Just what are these linedefs?

Okay then, here you go. In front of you, you see a box. That box is a sector. A sector, you can think of as a room, or better, any part of a room. A sector has individual data for it, including tag, special, brightness, and floor and ceiling heights and flats. A sector is always made of three or more linedefs. A linedef is the border of a sector. Don't think of them as walls, because then you can get confused. Just keep in mind that a sector needs linedefs. As a note, sectors are always closed figures. If you have an open sector, you'll cause errors. Now, other things you should keep in mind. A vertex is a single point. Vertexes are always part of at least two linedefs (Technically, they can be a part of one, but you'll never use that in SRB2). Fracunits, or units as they are more commonly called, are units of measurement. The grid we have is 64 units. That means that between every line is a space of 64 units. Now, this measurement applies in all directions. To give you a sense of this distance, Sonic jumps 96 units, a yellow spring sends you 384, a red spring is 1024, and Tails flying is about 1500. Anyway, that's the basics of objects. There's another kind of object called a Thing, but we'll get to that later.

Anyway, now, click on the line on the right side of the box. It should turn red. Now, click and hold the right mouse button and drag it around. Move it up and to the right so the diagonal lines are at a length of 724. Then, zoom out so you can see everything.

*SIDENOTE* If you really need to see everything, then click the Center View button at the top, to the left of the trees. Its keyboard shortcut is control+space. Really makes things easier *ENDNOTE*

Now, outside our sector, right-click, and move around. Create another square with sides of 256, and set the floor and ceiling to
exactly what the first sector was (4096, F_SKY1, 0, FLOOR0_6).

You: Wait, there's got to be an easier way to identify these things.

There is. The first sector we made was Sector 0. This new one is Sector 1. It keeps counting up like that.

Anyway, time for more cool stuff. Up at the top, click the button with the three dots. You'll enter Vertexes mode. Now, right click and hold the lower left vertex (it's the little dot-zoom in if need be), and drag it onto the upper-right one. You'll see the two vertexes become one.

*WADAUTHOR* In WadAuthor, you'd either need to select both and right click and click "Join Vertexes", or if you were lucky, you could drag them on top of one another, and it would ask you if you wanted to join them. In DoomBuilder, the AutoStitch option (As seen at the status bar at the bottom) will automatically join linedefs and vertexes that get within a certain range. You can turn this on and off by clicking the Stich Vertices button at the top, or the AutoStitch message at the bottom.

Now, at the top, click the button with the box on it. You'll enter Sectors mode. Right click and drag Sector 1 (It's our new triangle) over to where the upper right vertex of Sector 0 is. Move the entire sector so the upper right vertex of Sector 0 is on the upper left vertex of Sector 1. Now, enter Vertex mode, and drag the bottom vertex of Sector 1 over to the left, onto the other vertex on the side of Sector 0. What should happen is that the white line on the right side of Sector 0 will turn grey, meaning that it is two sided. As I said before, a linedef is a boundary for a sector. If you were to test this right now, you'd see no difference between the two sectors.

Now, we want to create a long hallway. Still in Vertex mode, zoom in on the white line at the right of Sector 1, it's the diagonal one. On both sides of the little white line, right click. You'll create two new vertexes on the line.

Now, enter Linedefs mode. Take the new linedef in the middle of those two points, and drag it downward so the line on the left says 1026.

Now, go back to Vertexes mode, and drag the two vertexes on our line apart. The vertex on the left should move one point to the left, the one on the right to the right. The lines should be straight now.
Additionally, take the right vertex, and move it down two points, so it is level with the other vertex. What you should have now is something that looks kinda like a "1". Now, two final parts for this chapter. Enter Things mode, it's the button at the top with the arrowed circle. At the bottom of Sector 1 (Inside the sector, not on a line), right click. You should see something pop up, that if you hover your mouse over it for a little, will say Player 1 Start. Now, right click on the start, and you'll enter a large box. At the right, under flags, make sure that Easy, Medium, and Hard are the only boxes checked. Below that, at the little compass thing, click the button so the line points up. Then click okay.

Now, enter the Configuration (F5 for the lazy), and go to Nodebuilder.

*SIDENOTE* Nodebuilders are basically the clean up crew for the map.
They make sure that everything is all set, and package the map for the game to use.*ENDNOTE*

In this, you'll see quite a few things. What we are going to do is run Zennode on the map everytime we save or test it. To do this, click the drop box to the right, and click Zennode Normal Build. Then, at the other drop box, select "Always Rebuild Nodes".

Now, go to Testing, and click the browse button. Direct DoomBuilder to srb2win.exe, and in the box below that, the one you can actually type in, type in the following:
-file "%F" -warp "%M"

If you want to use anything else, here are some other helpful parameters:

These turn off sounds and music.

Windowed mode

+skin (whatever)
-color (Whatever)
If you like playing as a certain character or color.

If you normally play in Open GL mode, use this.

Anyways, once that's done, make sure the checkbox is clear. Now, click okay, and then, at the map screen, press the button at the top that looks like a green arrow, and away we go