Creating Custom Static Meshes In UnrealEd

Created August 2004

For most items in a game, especially decorations (tables, cars, trees, ect...), static meshes are generally the better choice compared to brushes. Given the same exact object (stairs for this tutorial), a static mesh version of it will render faster than a bsp one. That is why 90% of maps are made from static meshes. With the correct planning and zoning, you will have a nicely decorated map, that will have good fps (frames per second).

One note before we begin. Creating static meshes in the editor isn't the best choice. A 3D modeling program will give you better capabilities, control, and a better static mesh. Most of these programs take some time to learn well enough to make a nice static mesh. If you are going to get into mapping, it might be the best option to learn a program that will export a static mesh to UnrealEd. This tutorial is mean for beginners to intermediate map makers who either have no interest in learning 3D modeling or want a better alternative to brushes until they learn a 3D program.

You will be able to make various items using the editor. I have made arches, door frames, and stairs. You could make walls, fences, and so forth. It is up to your imagination and the limitations of what the editor can do. In this example, we are going to do a straight set of stairs that may be used in the average map. The example we are going to use is a linear stair case with 24 stairs using the default settings. These stairs are going to be in between two walls, so you won't be able to see the sides of them.

First, we create a bsp stair case using an additive brushe. I am using the showroom_floor texture from the Garage texture package. Since you won't be able to see the sides of the stairs, there is a lot of extra mass that is originally created. Since the engine won't render the parts that are touching your bsp based walls, it doesn't matter much. But they will create bsp polys and nodes. I then clipped the back of the stairs with the clipping tool, just to clean it up a bit. But when you do this, a zone will be created under the stairs. This is assuming the space where the stairs are going into extends all of the way to the floor.

This is what the stairs look like when the editor originally creates them.

This is what the stairs look like after I clipped them with the clipping tool

Now we can select the stairs and then turn them into a static mesh.  This would be a better choice than the stairs that we just clipped (see the second picture).  But with static meshes, if you can see any part of it, the engine will render the entire thing.  This includes the sides and the underneath part that the player will not be able to see, but the engine will.  In this tutorial we are going to take it a bit further and build it out of sheets to minimize the polys that will be rendered by the engine.

Using Sheets to Build Stairs

We are going to use the bsp based stairs as a model and create our custom static meshes entirely out of sheets.  Go to the Sheet button on the left tool bar.  Right-click it and take a look at the settings.  In case you haven't worked with sheets, I will briefly explain the fields that we will use.  Axis will be what axis the sheet will be created.  (Looking from the Top 2D view)  For the horizontal setting, it would parallel to the floor of your map, like a tile in your kitchen floor.  For the X & Y axis, it will be parallel to a wall in your map.  X axis will be running up and down on your screen, while Y axis will be running left to right.  Height & Width determine how big the sheet will be.  It is best if you know the exact size that you need and create it correctly from the start.

We are now going to create the sheets (make sure your grid is set to 16).  We know that we built a stairway that is 256 units wide.  Each step is 16 units high and 32 deep.  First, let's create the sheet that will be parallel to the floor.  Right click on the sheet button and enter the following: Axis=AX_Horizontal, Height=32, Width=256 and click the Build button.  Find the red builder brush.  If it's off our 16 grid, select it and right click on one of it's corner until it snaps back on the grid. 

Now align the builder brush so it is right next to the bsp stairway and at the same height of the top step.  See the below picture.

With the texture you want to use selected in the texture browser, click the Add button on the left toolbar.  Move the builder brush and build your geometry.  Go into the textured 3D view and find your sheet.  Right click on one of it faces and select Surface Properties.  On the Flags tab, the Two Sided box is check, click on the box twice to clear out that check mark.  One of the faces of the sheet will disappear.  If it's the face facing the floor, your fine, but if not, you will have to rotate the sheet.  Go to the Front 2D view and rotate and reposition it.  You will have to rebuild geometry to see the changes in the 3D view.

Now we will make the front of the step that will run up and down.  Right click on the Sheet button and set the Axis value to AX_YAxis, Height to 16, and Width to 256.  Select the Build button and follow the same steps that we just took for the first brush piece, but place it in the front of the step.

Now that we have our first step created, we will select the two sheets we just created and duplicate them by the Ctril+W key shortcut.  Make sure that the new steps are aligned correctly in the top view and the front/side view.  They tend to move in both directions when you duplicate them.  Once you have all of the steps aligned correctly, rebuild the geometry once more.

Now it's time to take all of the sheet brushes and turn them into a static mesh.  When ever you have any custom static meshes that didn't come with the game, you must provide these with your map.  Select all of the brushes the create our stairs.  Then right-click on the highlighted item and find Convert, then choose To Static Mesh.  A window will  appear with 3 fields.  The Package field will be the name of your static mesh file.  It is customary to choose a name as follows, mapname_T .  This way you and others know it's part of a particular map and the "_T" won't confuse the program/editor with the map file.  Make sure this is the name you want, if you change it later, your map won't know where to find it's custom static meshes.

The Group field can be used as a "group".  Some examples are doors, cars, and plants.  This is to help you organize your static meshes in your package.  The more static meshes you have, the greater the need to keep them organized.  You can leave it blank, but you will have to select the All button on the static mesh browser in order to see it.

The Name field with be the name of the static mesh inside of your package.  Again, this is to help you organize your static meshes.  What ever works for you, is what you should do.  Once you have the fields filled out, click the OK button, you will see a window quickly pop up, do it's converting, then close.  Now that you static mesh package is created, open up the static mesh browser.  Right above the All button their is a field, select this and a list will drop down.  Find your new static mesh package and select it.  Now you can look at your new static mesh.  

But before we continue, you will need to save the new package to your hard drive.  Click on the Save button and a window will appear asking you the name of the file and where to save it.  The name you selected in the Package field will be your file name and it should have already selected the staticmeshes folder.  Click the Save button, now you have your own static mesh package.  Remember:  Every time you change your static mesh package, you need to save the changes.  After the changes, click the Save button, it will ask you to replace the file, select the Yes button.

The static mesh created from the clipped brush stairs is 242 polys.  The stairs creating from the sheets is 96 polys, almost a 66% savings in polys.  Now it is only 146 polys of savings, which doesn't seem much.  But the more you decorate the map, the polys start to add up.  In addition, there are less textures for the engine to display, which can also help things out.

If you place this stairway in your map, you will be able to walk up and down it (though you should create a collision hull to prevent the player from bobbing up and down).  You can shoot at it and it will make bullet holes according to the texture you built it with.  But the one thing it won't do is block karma.  Karma is the interaction of an object and a player after the player dies.  If you were standing on the stairs and died, you would fall straight through them, which isn't realistic.

The editor can create a basic karma box, but it has limitations. A 3D model program can give you more control over creating these boxes.  In the static mesh editor, open up your package and find your static mesh (we are still using the stairs for the tutorial).  Select the Edit menu, then Create Karma collision from bounding box.  You just created a karma box that will surround the entire static mesh in 1 box.  This is where this feature may not work the way it's mean to.  To view this box, select the View menu, then Show Karma Primitives.  You will see a box like this.

The problem with this is two fold.  First, if the person was standing in the middle of the stairs and died, they would actually be "floating" in the air.  Imagine some one being caught in a spider web, I mean a big one like in LOTR: The Return of the King movie.  This looks strange.  Now if the person was standing just outside of the box, either at the bottom or the top of the stairs and were to die, they would bounce off this box and fall down.  This stair way now has an invisible force field, this looks strange too.

In the case of stairs, you will have to use other means of blocking karma.  Since you are going to create a collision hull for the steps (aren't you?), you can use it to block karma (with the correct settings).  For other items, you could use blocking volumes to block karma too (with the correct settings).  If you had a stair way that went up 8 steps, then had a platform, then continued going upwards the other way, you could do the following.  Use the collision hulls to block karma on the steps and create a blocking volume for the middle platform.  (Note: Karma and Collision will be discussed in another tutorial in the Optimizing & Polishing section).

For items like walls and columns, the karma box created by editor will work just fine.  Here is a picture of a column I made using the same techniques, with it's karma box created in the static mesh browser.

You can also create a Simplified collision box with the static mesh browser.  Select the Edit men, then select Create Simplified Collision.  This will create a collision box the same way it will create a karma box.  The collision block will be the part of the static mesh that blocks the player from running through the static mesh.  For most of the static meshes you create using the editor, creating this Simplified Collision won't be needed.  For the stairs, you won't be able to walk up them because the invisible box will block you.  The only time you would need to use this is if you created a static mesh that had some parts sticking out.  Instead of the player getting caught on these parts, they will smoothly hit this box.  (Note: Karma and Collision will be discussed in another tutorial in the Optimizing & Polishing section).

This covers the basic concept of creating the best possible static meshes in the editor.  Try to crease the simplest static mesh that you need to.  If the player can't see, it doesn't need to be there.  If I learn new techniques or if you have some for me, let me know and I will update this tutorial.  The following will be assorted tips, tricks,  & thoughts regarding this subject.

Assorted Tips, Tricks, & Thoughts

*The first time I did this, I created the static mesh from bsp brushes.  After I learned how to use sheets, I would create a map consisting of 1 subtracted brush.  I would insert 1 static mesh that was made from bsp brushes.  I would then build as much as I could using  bsp sheets.  At times, you might need to use a brush for angled sides.  I had a stair that had an angled part that was not possible to do with sheets.  I then create a new updated static mesh (with a different name, but under the same Package name.  I would then insert the new and improved static mesh into the map and delete the old ones.  Once all of them were rebuilt and placed in the map, I would delete the old static meshes from my package to save on file size.  Now that I am more familiar with the process, I will create more of the sheet based static meshes from the start.

*If you are going to use a static mesh created from bsp brushes in your map or use it as a model for a static mesh built from sheets, follow this guideline.  Select a basic color texture, such as blue in the colors.utx package.  Build all of the pieces needed for the static mesh.  Then texture the parts that player will be able to see while in the game.  Convert the brushes to a static mesh.  If you place the static mesh in into your map as it is, the engine will have to render simpler textures.  If you build a more streamline static mesh (using as many sheets as possible), you will know what parts the player needs to see.  This should help in building the simplest possible static mesh and thus, saving polys.

*When you build your lighting, more than likely your static mesh will look too bright.  This normally occurs with custom made meshes in the editor in addition to some of the stock meshes that came with the game.  To change this, select the static mesh and right click and select StaticMeshActorProperties.  Find the Display section and look for m_fLightingScaleFactor.  Change this from 1.000000 to 0.500000.  When you rebuild your lighting, it's brightness should look similar to the other static meshes in your map.  You can always change this number to get the look you need.

*You can create sheets and brushes  using the 2D editor.  In the editor, select Tools, then 2D Shape Editor.  I haven't really used this part of the editor.  I have heard good and not so good things about it.  It might be worth testing to see if you can make a more complex shape.

*Normally, a bigger static mesh will be rendered faster than many smaller static meshes making up the same item.  If the player will be able to see most of the static mesh, make 1 static mesh for the entire item (like our stairs).  For larger items, it may be beneficial to create the static mesh as a few separate pieces.  I made a column/canopy that was roughly 6000 units long.  There are many times when you only see sections of this static mesh.  I finally decided to create the canopy in 3 sections and to create 1 column, which I used over and over.  Having a column to be a single static mesh allowed me to create a Karma box and use that in the game (see the last picture).

*If you want to see the Simplified Collision Boxes in the editor.  Turn them on in the static mesh browser, then go back into the editor to view them.

*Never, ever, ever make any changes to stock packages, in this case, static mesh packages.  Don't add karma boxes or simplified collision boxes.  If you do, you will certainly get a version mismatch the next time you play that map, because it's different that the one the map was built with.

Click here to download a map with the two bsp stairs and the static meshes that were created from them.

Click here to see reasons why you shouldn't make static meshes in the editor.  Now, I would never question her knowledge on mapping, because she knows her stuff.  This tutorial is designed to make simple shaped objects.

Click here to get more information on create static meshes. (rvsmaps.com mirror)

Written by cwv_Odedge

[Home]