Now you should have a couple of rooms connected by a corridor with walls that look good and a little mood lighting. Remember the first level of Half-Life? Where you got to walk around and interact with the items in the rooms. Each of the areas was pretty much defined by what sort of additions were in the rooms such as desks, lamps or lab tables. Furniture is just as important as good lighting and texture, to give your level realism.
Most of the work in this tutorial will be done using the Object Bar
and inserting items that are already available.
One of the simplest ways to add details is through the use of prefabs. Prefabs are prefabricated objects that are stored in libraries. Let's add a number of prefabs to this level from the prefab library.
- Select Usable Objects from the categories list, and File Cabinet,west from the objects list (the use of entities in prefabs is a bit dated and sometimes pretty useless, as with this usable filing cabinet. If you want the draw to open, then all well and good, but you can't fit anything in it. One way around this is to change its properties to func_breakable and set the properties to spawn something on break.)
- On the lower part of the Objects dialog is the Insert original prefab button. Press this now.
- The prefab is now inserted in your room. Move it around the 2D views until you have it in a position you like. I have placed it in the first room, up against the wall. If you look at the example map you will see that the cabinet is about two units away from each wall but sitting on the floor. This will give it a more realistic lighting profile [and is good practice in cases where the object is not an entity - this way it won't split up the wall]. Move the cabinet hard up against the wall and look at the difference in shadow when you compile the map.
- I have inserted another filing cabinet, a trash can, a black chair and an old desk, north from the random objects category. Note that the trashcan needs to be transformed by 270 on the Z axis so that the push sign aligns with the room and I have also scaled it to 0.7 on all axes.
So now we have some things in our office, here are a few tips. The black chair created by the Prefab factory is a func_pushable
entity. If you leave it free in the room it can be pushed around. If you don't want it to move, then it's a good idea to select it and click to World
. By doing this you won't be able to push it and it won't make a moving sound every time you brush against it. In the second room I have added Modern shelves, south
and Metal shelves
(transformed 180 Z
axis) from the random objects category. (The 'south' modern shelves are bound to a func_door
for some reason, so click to World
unless you actually want the shelves to act as a door.) The metal shelves have four boxes on them. You can adjust the Spawn on Break
properties with the Map -> Entity Report
by selecting the properties of each box. If you choose to spawn any item other than a weapon, ammo for instance, then you will find that if you break the box the ammo will fall through the shelf [this is a bug - it doesn't happen when you build the prefab yourself].
Have fun inserting prefabs. Just remember to check their properties as most of them are designed to function in one way or another. Practice transforming and scaling prefabs, so that they look right. What you're trying to achieve is playability balanced with good looks. There are numerous resource sites that have downloadable prefabs, but use caution and check them before putting them into your maps.
If you have any ideas or suggestions, why not add them to the forum. Part 6: Monsters