Monday, March 30, 2009

Making your first level


Making levels in a FPS engine can be done in two ways; and Additive mode and a Subtractive mode. In the Half Life 2 Engine, you made levels by adding them in (somewhat like you do in a 3D modeling program). In Unreal 2004, you had to subtract your levels out. Think of it as though you have a solid mass when you start out and you need to "carve" out your levels as you go. The advantage of this method is that there will be lesser chance of getting "holes" in your level thus lesser chance of your level crashing.

In Unreal Editor 3, you have the choice of doing either way:



Go to Edit-> New and choose the Subtractive option for starters. It's easier to start in Subtractive mode. Later I will show you how you can convert to the more optimization-friendly Additive mode and you may notice some performance improvements (especially if you level is quite complicated).


You will be faced with a 4 viewport interface not unlike most 3D packages. If the Generic Browser is on, just close that for now. We won't be needing it just yet. Right mouse click on square cube and you will be faced with a dialog box asking you for the dimensions of the cube. If you are familiar with 3DSMax, this way of working may seem rather odd and counter intuitive. Just bear with it for now and you will soon get used to it. Now may be a good time to introduce what is called the Builder Brush. The Builder Brush is that red box you see in the diagram. It shows the intention of what you wish to create. Until you commit to creating it, it will just remain an intention. Click on the Build button to confirm the dimensions of your brush.


 

To commit to creating that brush, click on the Subtract button. Now observe what happens to the perspective viewport. If you mode is a) Lit, you will see a black screen but notice the blue line (compare a with c) no longer cuts through the red box. That means you have successfully carved out a level. You just cannot see it because you have no lights assigned to the level. If your mode is b) Unlit, you will see the level with lots of chequered boxes as textures. Either way, you need to add a light to the level.


To add a light to the level, simply hold down the "L" key and click on anywhere on the BSP (eg. the floor). A light icon will pop up.


 

Compare the Unlit Mode view and the Lit Mode view:




Next, you need to Compile the level before you can play it realtime. So hit the compile button. Don't worry about the error messages for now.


You are almost ready to playtest the level. Click on the floor, it should turn light purple. Right click and select "Play from Here".



 

And you should end up with your very first playable level. Congratulations!

Introduction to Modding

So you are interested in game modding but don't know where to begin? Want to make your own levels but got totally lost with what you read so far? Then let me introduce you to the world of modding and let me simplify it as much as possible and I will try not to repeat what has been said and done (unless it is essential that you go through these steps). Basically, when I started to mess around with modding, I couldn't go very far because fragments of information were everywhere and worse still, some tutorials tells you (logically) how to do things but when you try it, you only get frustrated because none of what was said could be done! This is my attempt to document what I know, point you to places you can go for more detailed information on certain subjects and hopefully be comprehensive enough yet simple enough to follow and serve as a rough guide to get you to what you want to achieve. So here goes!

The tool of choice is Unreal Editor 3 which comes shipped with Unreal3. The Limited Edition version also comes with Jason Buzzby's excellent video tutorials. However, certain aspects of modding were not covered which left me scratching my head and pulling my hair on how to achieve things like Importing and customizing your own characters, Importing and modifying features for a custom-made weapon or even to alter gameplay.

So without further ado, on with the intro. As far as level creation on FPS (First Person Shooters) games are concerned, generally you can make 3 basic types of levels:

1. BSP (Binary Space Partitioning)
2. Static Mesh
3. Terrain

BSP Levels
BSPs are relatively very simple primitives created within the game editor itself. It is extremely low polygon, has its own set of built-in optimization and accomodates lightmaps baking without the need for the user to manually do it themselves. As a result, BSPs are fast to create, compile and run. They can also do automatic culling and other optimization calculations which speed up their performance. Ideal objects for BSPs would include walls, ceilings and floors, simple boxes and staircases.

Static Mesh
Static Mesh fills up the void where BSPs cannot accomodate. Some objects are simply impossible to make using BSPs for example, a complex organic statue. In comes static meshes which are created in an external 3D package such as 3DSMax and then imported into the engine. One disadvantage of static meshes is that they do not light up as nicely compared to BSP lightmaps. You can compensate in a way by adding vertex lighting but the results may vary.

Terrain
Terrain is a special feature that can be created within most level editors. It contains height depth information and is relatively easy to use. It is preferable to use terrain as opposed to making a terrain and importing it as a static mesh (usually) for optimization and avoiding "holes" in your level issues. NOTE: I will explain in more detail what these "holes" are later. Just know that any "holes" will cause your level to crash of fail to even compile.

Well, that's it for starters. Hopefully, with this basic knowledge, you are better able to appreciate when to use what when you go ahead and create your levels. Happy modding!