Back to tutorial index page
Detail and Structural brushes, laying out the level (including triggers and traps) and adding geometry to the map.
Please note that this section of the series is long and contains much information. If you are a novice mapper take your time and work through the concepts discussed slowly and carefully.
Before we begin, please read Bill Brook's Hint Brushes and Spog's Q3map explanation that covers vis in more detail. These concepts are vital if you are to be able to map effectively and efficiently. Even if you have trouble understanding the concepts described in these 2 links refer back to them often during the time it take you to work through this tutorial until their significance has become apparent.
N.B. Since the advent of the skip shader the use of the hint brush has altered slightly from the method described in Bill Brook's superb tutorial. Exactly how the approach has altered will be covered later but rest assured the important points made regarding where to apply the brushes and why, continue to remain valid.
We will now return to the simple box map we made in the first tutorial.
Detail and structural brushes, so what exactly are they and how should we use them? Structural brushes are solid, they block vis and seal the world off from the void, detail brushes are solid in game, but as far as the compiler and game are concerned they do not block vis, nor can they seal the world off from the void. To make a brush detail, select it and press Ctrl m, to make a detail brush structural select it the press Ctrl shift s. By default all brushes are structural. Why should we worry about all this? Well, a complicated map could take a long time to compile vis. We can shorten the time it takes by making all the outer brushes that touch the void structural, and everything else that isn't needed for blocking vis into detail. If we make our rooms and corridors out of nicely rectangular structural brushes applying hint brushes is also much easier as the splits created by the hint brushes are not effected by detail brushes.
Below are two images of the room we are going to build, one shows the geometry with detail brushes, models and patches all turned on, the second shows the room with everything but structural brushes filtered off.
N.B. toggle details on and off Ctrl d
toggle structural on and off shift Ctrl d
toggle patches on and off Ctrl p
Remember how in the first tutorial it was stressed how brushes shouldn't over lap? Well, with detail and structural brushes we can or even must break that rule! Here is another shot of the same room with detail and structural brushes both turned on. See how the caulk structural brushes are drawn on top of the detail brushes in many places? This doesn't matter, caulk isn't drawn in game.
Examine the corridor below. The complex shape is all detail brushes. Buried in the walls and floor are simplified caulk structural brushes brushes. Vis only considers the simplified brushes. Because the caulk brushes are never drawn it is not necessary to worry about t-junction errors either. Structural brushes made from caulk can be slapped down quickly. Only the detail brushes with textured faces, or structural brushes with textured faces need to be optimised in the way discussed in tutorial 2.
It is important that the caulk brushes do not stick out into the world, if they do and can be seen in game they may create visual distortion.
Having talked about how we are going to build now lets talk about what. The next stage in the building of our map is to come up with a layout. Deciding a layout depends on many things. In this case theme will not be an issue. In order to make the process as straight forward as possible I'm going for standard id Gothic, although later we will be using some custom textures and shaders. There are certain factors in layout we can not ignore. The level must be built with vis blocking in mind from the out set. The scale must be correct, average corridors would be 192 units in height and width. Let the texture sets be your guide, wall top and bottom trims are 32 or 64 units high, wall textures are 128 units high. The level must be playable for humans and bots. The level must be appealing and attractive whilst running smoothly and fun to play. Leading on from fun to play, there must be a high degree of connectivity between areas, with out losing control of vis. The classic Death Match level forms a closed circuit, whilst a CTF map consists of 2 normally identical bases with all routes in and out leading through a central 'choke point'.
The brief for this level was to design a Death Match level that could easily be turned into a CTF map later. Hmmm. Not exactly mutually compatible, but lets get started!
To avoid problems later on it is vital to rough out a layout first. This is normally textured, roughly lit and items placed. Then the level is compiled and played. This is known as an alpha build. Problems can be identified and corrected before details have been added and fiddly brush work begun. This is what we are going to do next.
Lets get to it then! The following are some in game shots from the alpha build. Fig.1 is the room we created in the first tutorial with some slight alteration that we can come to in a moment.
Fig.2 below is another shot of our first room. I dropped the centre of the floor area because I had an idea about a shallow pool of water there. The holes in the floor at the top and bottom of the image give access up from the lower areas.
Fig.3 below is a shot of the lower area. I thought the lower areas could both be turned into natural rock, at least in part, as if our Gothic structure were built into or on a bed of rock. I liked the idea of natural organic rock and worked stone in contrast as well. You can't see it from this shot but there is an exit via jump pad up to the centre area (the first room we made) via the square holes shown in fig. 2 and 1. There is a lower area on both sides of the map. As only one side of the map has a 'base' at the moment, the exit from one room will be provided by teleporter and will most likely contain a power up you will need to make a special trip to grab. Both rooms will have a swirling fog death pit.
Fig.4 shows a view out over what I called the base area. As I had to come up with a level that would suit CTF as well as Death Match the second area I built off of the first area would double as a flag base. The door way in the centre of the back wall leads down to the lower area pictured in Fig. 3. The trough in the floor is there to be filled up with lava flowing beneath some grates.
Below in fig.5 is another view of our base room, access is from corridors on each side of the area that lead to the centre area and also with some difficulty, via the drop from the centre area and up from the lowest level. At the moment avoiding the jump pad in the drop down to the lower level is difficult but that can be worked in. Plenty of opportunity for split level game play here. Remember to think in 3 dimensions when planning a level, back/forward, right/left and up/down! The first time I actually walked about in this room I realised the ceiling was far too low, so had to adjust the head clearance!
One of the corridors connecting the base to the centre area is shown if fig.6. Note the right angled kink in the middle, a classic vis blocking design.
To alpha layout is included in the sample map .pk3, along with all the custom media used in the levels.
If you open the map file and have a look around you will see many diamond shaped objects floating around in the air. These are point light ents (short for entities). Light ents act as sources of light. In Q3 light can be emitted from surfaces, such as skies, flames or textured brushes through the use of shader scripts (more on that later). The alternative method of applying light to your level is through light ents. Perhaps alternative is the wrong word as in fact in nearly all cases levels are lit with a mix of shader based lighting and light ents. We have already used the entity menu in order to place an info_player_deathmatch in the level. Right click in the 2d window to bring up the entity menu once again. Scroll down to Light and select. A new light ent will appear along with a little box asking you to enter a value. As a rule of thumb lower values tend to be better in enclosed spaces, by lower I mean anything from 10 to 100. Higher numbers are fine but be careful. If lights are too bright textures become washed out and ugly, also if you place lights too close to walls, ceiling or floors this can result in spotting, where an obvious 'pool' of light appears with no apparent source. The value of lights can be adjusted at a latter date by selecting the ent and pressing n to bring up the entity editing window. In the main window look for the word (or key) 'light'. To the right of light is a number value. Click on light and you will see the word light appear in the key text box and a number value appears in the value text box. Change the number and enter. GTK 1.4 shows the radius of emitted lights when a light ent is selected. This is quite a useful new tool, although not on a par with the real time lighting of Doom 3 in GTK 1.5. To change the colour of light emitted from a light ent, select it and press k. A colour chart will appear. Click on the colour you want and then OK. The ent should have changed colour. A word of warning, strong, highly coloured lighting looks terrible. Use coloured lights with care, to emphasis light emitted from flame for example, but let subtlety be your guide.
The other points of interest in the alpha build are jump pads, teleporter and the pits of death. Lets look at each in turn.
Firstly Jump Pads. In order to move from a lower level to a higher level quickly in Q3A jump pads are often used instead of stairs. To make a jump pad a trigger is needed to push the player into the air and a target is needed to indicate the direction of the push. Fig.7 shows the trigger. Select the common texture folder, then click on the yellow and white trigger texture. Draw out a brush from the trigger texture that sits on and above the floor, then with the brush still selected drop the entity menu (right click in the 2d window). Scroll down to trigger, then select trigger_push. Deselect. Your brush is now a trigger_push entity. The jump pad now requires a target. Some where in the 2d window, with nothing selected right click above the trigger brush. Scroll down to target and select target_position. Oddly enough, don't use target_push. This entity will still work, but will cause the game to look for a missing sound file. The green cube shown selected in fig.8 should now appear.
Finally we have to link the 2 entities. Select the trigger first then select the target without deselecting the trigger. Press Ctrl and K, or drop the selection menu and select 'connect entities'. A line should now be joining the trigger brush to the target entity. Deselect. That was the easy part. The hardest part of making a jump pad is moving the target so that the player lands neatly in the correct place and adjusting the trigger so that the push begins at the right moment. Having got a jump pad that works well for the human players it then needs to be tweaked for bot (computer controlled players) play, but thats a whole new topic. For the sake of realism make sure you place a jump pad texture or model underneath the trigger brush.
Next let make a teleporter. Teleporters are useful for moving player around a level where otherwise a physical route isn't possible to avoid dead-ends or for strategic reasons. Examine fig.9. Ignore the trigger brush on the floor, that's part of the death pit. The trigger brush we need is the selected one. Draw out a brush made from the common/trigger texture and then drop the entity menu once again. This time select trigger_teleport. Deselect. Go to the part of the map you would like the player directed to and right click above that area.
Scroll down to misc and select misc_teleporter_dest. A flat orange cube should appear like the one pictured in fig.10. Just as with the info_player_deathmatch entity, you can press n to adjust the angle at which the player will appear facing. Deselect the entity. Return to the trigger brush and select it, travel back to your target ent and select that as well. Press Ctrl and K and a line should now join the 2 entities. Place a teleporter shader or model (don't worry if you don't know how, we will cover this topic later)inside the trigger and move the target around, and you finished.
Sometimes you may want to include a trap in your level. Be careful not to over use traps, most multiplayer game players find falling into swirling pits of toxic fog, or tumbling into space, rather annoying. That said a well placed trap can make powerful items much more dangerous to obtain or deliberately slow down play for strategic reasons. To make a death pit, complete with screaming sounds (like the fog pits or dropping into space), use the following method.
To kill the player we are going to draw out a brush made out of common/trigger (in my sample map the brush is 64 units deep), drop the entity menu and select trigger/trigger_hurt. Press n to bring up the entity window. In key box type dmg, in the value box type 9999, then enter and Esc. (Shown in fig.11)
Somewhere above the trgger_hurt draw out another trigger brush, this time select trigger_multiple from the entity list. Deselect the brush and any where close by it in the 2d window drop the entity list. Scroll to target then target speaker. A green cube should appear, then hit n. The entity window appears and type noise in the key box and *falling1.wav in the value (shown in fig.12). Enter and Esc. Deselect the ent. Select the trigger, then the speaker, then hit Ctrl and k. A line should now link the trigger and target.
We need to make sure that if the player falls into the pit they are going to stay there and meet a sticky end. At the very top of our pit draw out another brush from the trigger texture and convert it to a trigger_multiple(fig.14). Right click in the 2d window to bring up the entity list again, this time select target and then target_remove_powerups (fig.13). Link the two entities in the same fashion as above, make sure you select the trigger before the target.
Finally, we need to ensure items don't get left at the bottom of the pit (or space). Open the common texture folder and select the blue and white nodrop texture. Stick a large nodrop textured brush all over the bottom of the pit and the problem of dropped items will disappear(fig.15). The only thing left to do is to stick a fog brush in the hole so that players know not to fall in. From textures select sfx, then select hellfog. Fill the entire pit, stopping a little way from the top, with a brush made from the fog texture. Don't worry if your fog passes through some solid brushes and make sure the sides and bottom of the brush are buried inside the surrounding floor and walls brushes. Fog must only have one side that a player can enter through, otherwise when we come to compile our level the compiler will spit warnings at us.
Lets talk about the changes I've made our original room(fig.16 and figs 1 and 2)
The main body of the room remains the same rectangular shape. The central floor area has dropped as I'd thought about having a sunken floor area with a water splash there. I've added areas on each side of the room behind the side walls. The player will never be able to get there but I like geometry that goes into spaces players can not. To me this gives a sort of realism to a level, the illusion of a world outside the arena. The top of the room has extended upwards considerably in order to accommodate the structures I have in mind. When building in a vertical direction, especially if the area is to be surrounded in sky, always bear in mind if it would be possible to see that area from another. There is a horrid sky bug in Q3 that causes visual anomalies (partially rendered geometry) if one area surrounded by sky is viewed through another sky textured brush. If you are lucky enough that the two areas are in different bsp splits and never considered visible from each other then the problem does not arise, but it's better to be safe than sorry. The two ends of the map will both have twin corridors linking to base areas in the CTF version, for FFA, only one end will have corridors. Again, the area above the corridors extends back from the room to allow room for some decorative architecture. The two holes in the floor give access up from the areas below, and with some difficulty, access down from this area.
Time to play our map. The main thing left to do for the alpha test is to throw some items around. Items are placed in the map in the same manner as the info_player_deathmatch ent we added earlier. Right click in the 2d window over the area you want to insert your item. Select the item from the entity menu. Hit n to bring up the entity editing window if you want to adjust the angle or any other of the entity's properties. Various keys and values can be set, depending on the entity in question. In the entity editing window information and notes are given for each entity, regarding what can be added or changed. Apart from changing the angles of the player spawn-points the only change I made to the basic items was to team the Mega Health with the Quad Damage. In this way one item will spawn, after it has been taken the next item will appear. This is done by giving both item the key team and then the same value, in this case, 1. Both items are then placed in there spawning position.
Placing items is something of an art. More powerful items should be placed in such a way as to make there collection more difficult or more dangerous. Health must be sufficient but not over done, the same applies to ammo and armour. Avoid placing powerful weapons, armour and health in a cluster. Players should move around and be given little opportunity to camp, encouraging good circulation in a map assists with good bot play too. Try to avoid placing ammo to close to its weapon. More powerful weapons could maybe have ammo limited to ensure better balance. Try to balance areas/routes around the level to ensure that equal advantage and disadvantage can be found in any direction. Don't think you have to include all the weapons and power ups, only use those that seem appropriate to the level. Lastly, if possible try to play the alpha level with some real folks. Bot play is going to be poor at this stage. Although the alpha build will give some indication of how bots cope navigating the map, much is still to be done in this department. In the alpha stage we are looking at layout and scale, connectivity and flow and item placement and game-play.
Our sample map lacks in the layout department. This design fault is intentional as the level needs to be simple, and because of the requirement to be able to convert it to a CTF level fairly easily. Time to move on then!
Lets start to add some architecture!
Figure 17 to 19 above show examples of the type of gothic architecture that we are going to add to the level. Inspiration can come from other maps, real life, research or your imagination. It's a good idea to carry a sketch pad to scribble down ideas when they come, or a camera to capture some object or place.
In the case of this map, we are sticking with id-style gothic architecture that the standard texture sets fit so well. Let's begin with the courtyard walls.
Flat walls are boring. Try to avoid large flat areas, where textures obviously repeat. Take the scale from the texture sets, a base border of 32 units, a wall of 128 units and a top border of 32 units, gives us a 192 unit high barrier. The selected wall section in fig.20 above is the template for the wall that surrounds the courtyard area. We could have made it 192 units high and with a flat, vertical surface. That would have been boring. The base border is angled, as is the upper brick section, resulting in a much more interesting shape. The angled brushes are created by clipping brushes into the required shapes, as previously discussed. As before, all brushes are made from the common/caulk texture and then textured on the visible faces. All of these internal details are turned into 'detail' brushes by pressing Ctrl and m whilst they are selected.
Figure 21 above shows how the wall sections can be fitted at the corners. Joints should be mitred to ensure the best results. You can select a group of brushes and clip across them all to ensure uniform cuts. Keep the grid as high as possible to minimise imprecise cutting. Note: if you make a wrong cut, Ctrl and z undoes the action. Some other important clipping shortcuts are Shift and Enter which reverses the cut selection and Ctrl and Enter which selects both sides of the cut.
Figures 22 and 23 below show how verts should line up between the curved patch that makes the arch and the surrounding brush work. Remember brushes should meet at corners and vertices of patches should meet the vertices of the brushes they touch, otherwise 'sparklies', or t-junction errors will occur in game.
Figure 24 below shows how a concentric trim has been added to the bevel cap. Trims help add solidity to a level. Edges become more defined which can create a 'finished' look to geometry. On architecture that players interact with trims can help visual assessment of 3d space. The bevel cap has been vertex edited to reduce it by 8 units in height and width. Don't forget to re-naturalise the cap texture. The trim texture should be selected, a brush drawn out and turned into a simple patch mesh. Adjust the size of the mesh so that it is more or less the same length as the breadth of the cap and 8 units wide. Vertex edit the mesh as shown below, in order to bend it around the cap (which in fig.24 is also selected for the purpose of the screen shot). Make sure the texture is orientated to face outwards, Ctrl i, if it is not. Naturalise the texture on the patch and you're done. See fig.25.
Sometimes when you add patch trims even though vertices align perfectly in the editor, in game holes or tears appear when the geometry is rendered. These are known as LOD (Level of Detail) cracks. These errors are caused by the Q3 code itself in the way it calculates the drawing of curves. Small LOD cracks can be stitched by the game, but some will be quite visible. Luckily there is a solution. Through the use of Ydnar's mighty Q3map2 it is possible to convert compiled .map files into .ase model files. As models are rendered differently by Q3, they do not suffer LOD cracking. Fig.26 and Fig.27 show 2 areas where .ase models have been used to solve this problem. Fig.26 shows an endcap with patch mesh trim that cracked, Fig.27 shows a group of vertex edited square cylinders that also exhibited this problem. I should point out that using square cylinders can be expensive in tris. Often other geometry gets embedded inside part of a cylinder or square cylinder, wasting tris. Z-fighting will tend not to occur in game as the player can not see inside the cylinders. Using 4 (or more or less) patch meshes to do the same job as a square cylinder would be much less wasteful in valuable tris, as the patches could be edited so that no overdraw occurs. In certain places I would choose a square cylinder over patches as in spite of their problems when drawn in game they have a lovely smooth and rounded appearance to their edges, which patches do not have.
How are .ase models created then? Well, it's not that complicated. Select the geometry you want to convert into a model. Copy it. Save the map and open a new map. Paste the copied geometry into the new map. Slap a caulk box around the geometry and throw in an info_player_deathmatch entity. Select the entire map and move it so that the centre of the geometry is somewhere close to 0, 0, 0 on the grid. This is necessary as the model control point is always created at 0,0,0. If you don't move the geometry the result can cause a leak if you insert a model into a map with it's control point in the void.
Save the map, with an appropriate name, I normally use something like mymap_tallarchase. Open Quake toolkit or Q3map2 toolz, or what ever front end compiler you use. Compile with:
bsp -meta -patchmeta -subdivisions 6
Then compile the new .bsp (not the .map!) with:
You have now created your first .ase model. I normally move the model into a mymapname folder inside the models/mapobjects/ folder.
Open your original map and delete the old geometry. Insert the model by dropping the entity menu and selecting misc_model. In the window that pops up, change the file type from .md3 to .ase, then select your model. Move the model into position. You can rotate it in any direction (using the angle keys in the entity editing window, and/or by setting the key angles with a value n,n,n for pitch, roll and yaw. GTK 1.5 will allow you to free rotate models around any axis), just as with an .md3, this is the other benefit of creating and using models. It is not normally a good idea to rotate brush or patch work, but with models there is no problem. All map models are non-solid. You will need to place a playerclip brush over the top of them to make models solid, or weapclip if you want weapon impacts as well. Cut the clip brushes into more or less the correct shape, but don't be overly fussy. Try to keep clipping simple. It is possible to auto-clip models by setting a key of spawnflags and a value of 6, however I strongly recommend NOT going down that route as the load placed upon your CPU increases hugely once weapons start getting fired into your models. If you want explosions, use simple weapclip brushes. You will need to set the key spawnflags and a value of 4. This will allow your model to be lightmapped (cast and receive shadows), it's also often a good idea to set a key of _lightmapscale and a value of 0.125. This sets a high resolution lightmap on the model, resulting in much sharper shadows.