Monday, May 11, 2009

Realtime Particles

Jason Busby's video tutorials that comes with the Unreal Tournament 3 Collector's Edition does a pretty good job explaining about realtime particles in Unreal Editor. So, I won't really be going into this area except to highlight some important pointers (via screencapture) just as a reminder about the kinds of parameters one should roughly have to make the particles work nicely.

Start by right-clicking on the Generic Browser and create New ParticleSystem.

This will be the package you will be saving it to.

Next, Unreal Editor will open up Cascade, the realtime particle editor within Unreal.

Upon creating New ParticleSpriteEmitter, you are presented with a very basic particle effect with 3 basic functions. Right-click to add more and more features to it as per requirement. Remember, only add stuff that makes a difference to the look/behaviour of the particle. Any small and unnoticeable effects should be avoided to keep things light and processor-friendly.

If you open up Envy_Effects.upk from the Effects folder, you will find many ready-to-use neat effects.

The final list of attributes for a sparks effects should have roughly these in the stack.

Some effects like collision may not show up in the Cascade preview so check if it is working in-game.

Thursday, May 7, 2009

Making a SkyDome






Making a skydome couldn't be easier. Just make a half sphere and add a sky texture to it! You can examine the skydome in Unreal. Remember to "cup" the dome so there are no "leaks" in the level.

Skybox vs SkyDome

You may have come across some games using either of these to simulate a sky or some even use both (as in Unreal). So which one to use and when?

Back in the early days of 3D computer games, polygons were expensive and every face took up precious processing power. Hence, a skybox was the best way to go then. However, there are problems with skyboxes.

1. They look "boxy" if textures are not done properly
2. The perspective looks screwed up (hey, it's a box okay!)
3. Totally unsuitable for games with flying vehicles/creatures as the higher you fly, the more obvious the sky looks fake.

Nowadays, computing power is way better and a skydome hardly makes a dent on processing power. It has significantly more faces but the advantages are:

1. Everything the skybox screwed up on

So, that means sky boxes are useless now right? Not true. Skyboxes still are useful. Remember, every resource we squeeze performance out of, frees more resources to add to other things... better AI, bigger textures, more animation, etc.

So in conclusion, you will probably use a skybox if say, you are in a limited viewing area (eg. in an enclosed building but can see the sky through windows) or you are outdoors but are blocked by fences.

Making Swimmable Water

Making water that you can sink into and swim in is easy enough. First, you need to have an area designated for water to be in.


In my example, I simply hold down the Ctrl key and depress a hole in my terrain.


In the Generic Browser, I open up UN_SimpleMeshes.upk and choose a simple plane as the water surface.



Rotate, Scale and Move the plane to the correct place.


Choose or create your own liquid material. Here I simply chose one that was way too reflective but never mind... it's just for illustration purposes.


Access the properties of the StaticMesh water and turn off Collision so your character can sink into the water and also, there is no need for all that fancy lighting setups in water so disable them.


With your red builder brush, create an area that will become the water volume. Place it right underneath the water plane. Right click on the Volume icon and choose UTWaterVolume.


If you move away the red builder brush, you will find a light purple brush in its place. That's the UTWaterVolume. You can basically swim in the water already.


So go ahead and try it!


Once inside the water, you notice a problem... it feels like there is no water as the water has no colour tint, depth-of-field, or any other water distortion effects.


So make a bigger red builder brush. The difference between the water volume and the bigger red builder brush's volume, will solve the problems I mentioned earlier.


Once again, right-click on the Volume icon and this time, choose PostProcessVolume.


You will notice two different purple volumes.


Access the properties of the second volume and you should be able to change it's colour tint and other features.


Here I accidentally created a sepia water! Chinese tea anyone?


Done! You have swimmable water! Of course, choosing a better water material can give you better results. Study the water materials, some of them have nice transition effects so it looks more natural as in this one here.

Monday, May 4, 2009

Making a Terrain

Terrains in Unreal Editor can be made in two ways. One is via realtime mesh editing and the other is via heightmaps (or both). This tutorial will only cover the first option.


Start by carving out a really, really big level to put you terrain in.


In your Generic Browser, go to the Actor Classes tab and choose Info->Terrain


You should be getting this green terrain icon.


I was stumped for a whole day on why I couldn't see the terrain mesh. Googling for an answer yielded no results. Then I tried hitting "G" for game mode on the editor. Presto! It showed in Game Mode.

Before assigning materials to your terrain, always remember to SAVE YOUR LEVEL FIRST.


Next, click on the Terrain Editing Mode and it should open up the Unreal TerrainEdit dialog box.


Open up and existing material to assign to your terrain (or create one from scratch). Right-click and assign "New Terrain Setup Layer from material(auto-create)".


The first entry is to define the Terrain Material.


The second entry is to define the Terrain Texture.


This is how it looks like.


Press F4 or double-click on the icon to access the Terrain Properties. Alter the numbers so you have a nice subdivision to work with. Also, bMorphingEnabled allows the level to have LOD and bMorphingGradientsEnabled allows Materials LOD (Please correct me if I am wrong).


Make sure you are in Paint Mode and the brush has some strength settings. Proceed to paint. You need to hold down the Ctrl key and left mouse to elevate, right mouse to depress the terrain.


To make your terrain more complex, we can add a second layer of materials. I chose a snow material to be more obvious.


Go ahead and paint the second layer.


Finally, add a light in the scene. Increase the visibility by increasing the Drawscale and Radius.


Don't forget to BuildAll. Test the level... Done!