for Half-Life 2 » Scenery and Setting
updated Sat Dec 25th 2004 at 4:37pm
1 fave
1 rating
45725 views
Environmental effects
updated Sat Dec 25th 2004 at 4:37pm
1 fave
1 rating
45725 views
by Leperous (view all articles)

1 rating / 5 stars

This is not meant to be an 'in-depth' tutorial telling you how to do everything step-by-step: it assumes that you have a basic knowledge of using entities in Hammer (there is plenty of entity help built into the editor which you can use to guide you) and a modicum of intelligence.
To make it so that you are "dazzled" when you look at the sun in the sky, make an env_sun entity either in your level or in the 3D skybox (it doesn't matter which).
Obviously it should be lined up with the sun that's drawn onto the skybox you are using, and there are two ways to do this. One is to set the angles, which is quite hard to do correctly, and the other is to simply make it shine "relative" to another entity. Make an info_target with a name of target_sun, and specify the env_sun's viewer entity to be target_sun (either by typing it in manually or clicking on the pipette icon). Move the info_target so that the position of the sun relative to it is where it will appear in game relative to you and the skybox. To tweak this, you can try placing the info_target inside the 'head' of your info_player_start entity and see where the sun is located in your skybox by loading up your level.
This effect is achieved easily by making a brush covered in the particle/rain or particle/snow texture, and turning it into a func_precipitation entity; the properties are easy to work out. Also, rain and snow will fall about 128 units below the bottom of the entity, and will not go through ceilings.
A dust cloud, as seen in the map "DE Dust", can be made with the func_dustcloud brush entity (use it on a solid covered in the nodraw texture). Use a non-invisible "standard" texture, otherwise it may not be visible in game, and set the various properties. Note that particles per second values shouldn't exceed 100 or so- keep it to about 50- and set the maximum visible distance so that anyone in the area can see the dust.
As with making a dust cloud, but use the func_dustmotes entity on a square brush covered in NODRAW to create "specks" of dust floating about that reflect sunlight. This effect is best used in a dark room with small light sources and glowing sprites; see how the CS:S map Dust2 uses them.
There are two ways to handle fog- with a sky_camera if you are using a 3D skybox, or with an env_fog_controller point entity. Set fog enable to yes, fog blend to yes (it seems to look a bit better in-game), and specify the other fields- unless your map is meant to be foggy, then you will want to increase the fog start and fog end properties by quite a lot, especially in a dry, sunny level- otherwise you will want a low fog start value.
If you want fog in a single room, use the func_smokevolume entity- the default settings world quite well for 'normal' fog.
A brush covered in the FOG placed in your level will do nothing.
Sun
To make it so that you are "dazzled" when you look at the sun in the sky, make an env_sun entity either in your level or in the 3D skybox (it doesn't matter which).
Obviously it should be lined up with the sun that's drawn onto the skybox you are using, and there are two ways to do this. One is to set the angles, which is quite hard to do correctly, and the other is to simply make it shine "relative" to another entity. Make an info_target with a name of target_sun, and specify the env_sun's viewer entity to be target_sun (either by typing it in manually or clicking on the pipette icon). Move the info_target so that the position of the sun relative to it is where it will appear in game relative to you and the skybox. To tweak this, you can try placing the info_target inside the 'head' of your info_player_start entity and see where the sun is located in your skybox by loading up your level.

Rain & Snow
This effect is achieved easily by making a brush covered in the particle/rain or particle/snow texture, and turning it into a func_precipitation entity; the properties are easy to work out. Also, rain and snow will fall about 128 units below the bottom of the entity, and will not go through ceilings.
Dust
A dust cloud, as seen in the map "DE Dust", can be made with the func_dustcloud brush entity (use it on a solid covered in the nodraw texture). Use a non-invisible "standard" texture, otherwise it may not be visible in game, and set the various properties. Note that particles per second values shouldn't exceed 100 or so- keep it to about 50- and set the maximum visible distance so that anyone in the area can see the dust.

Dust motes
As with making a dust cloud, but use the func_dustmotes entity on a square brush covered in NODRAW to create "specks" of dust floating about that reflect sunlight. This effect is best used in a dark room with small light sources and glowing sprites; see how the CS:S map Dust2 uses them.

Fog
There are two ways to handle fog- with a sky_camera if you are using a 3D skybox, or with an env_fog_controller point entity. Set fog enable to yes, fog blend to yes (it seems to look a bit better in-game), and specify the other fields- unless your map is meant to be foggy, then you will want to increase the fog start and fog end properties by quite a lot, especially in a dry, sunny level- otherwise you will want a low fog start value.
If you want fog in a single room, use the func_smokevolume entity- the default settings world quite well for 'normal' fog.
A brush covered in the FOG placed in your level will do nothing.