Tutorials

quake 2 - prefabs
by BadMonkey of BadMonkey Prefabs

 
 
I get a lot of mail on this subject, so here's a short tutorial.   

The idea of prefabricating things for convenience and speed has been with us for centuries.  I can almost see some ancient craftsman saying "I should just make a ton of these little annoying pieces now, and just use them as I need them" to himself.  Think of a prefab as a building block with a custom shape.  

Using a prefab in level editing provides a world of construction unto itself.  Besides making things like light fixtures and walls, you can make entire rooms and level sections.   An example of this is the testroom I use to build prefabs. It consists of a goodly sized room and a PLAYER_START.  When I want to see my progress or test the entities on a prefab I'm building, I just pop the testroom in and compile.  After I'm done, I can just delete the testroom in one fell swoop. 

Using prefabs for subtraction is another unique aspect. I have a set of generic groups of brushes  that I can use for cliffs and chasms.  I'm working on another set for windows.  You could even make a set of prefab chisels if you wanted to.  The possibilities for subtraction are just about as vast as solid prefabs. 

Different editors have different methods of getting prefabs though.  Worldcraft, for example has a prefab interface while Qoole uses a directory named prefab that can be managed with Explorer.  Check in the help section of whatever editor your using if you have problems. 

Some Tricks and Hints: 

If your editor has a "Texture Lock" capability, use it when you move your prefabs around. 

Always check the entities that make up the prefab once you have it in place.  I usually forget to change the name of some trigger as I'm making a map.  Pay special attention to TEAM values when adding doors (though seeing all of the doors on a level open at once is kind of neat). 

Remember that anything can be a prefab.  If your sick of placing a small health next to a large one a million times, make it a prefab.  

If your editor lets you group your prefabs into categories, make one for whatever map you're working on.  You can do this with some of them by just making a new directory in your "prefab" directory.  I usually do this to get an idea going.  As I'm thinking of the feel of a level, I'll make a few objects and save them there.  It really helps to give a level a consistent feel.

-BadMonkey 

Return to Tutorials Page... 
 
 
 
 
 
 
 
All content © 1998 by Shane 'Fishman' Sherman. This particular tutorial was created by Bryn Mosher and belongs to him. Quake and Quake2 are trademarks of id software. All rights reserved.