Posts Tagged ‘dustcloud’

I this post I will teach you how to use two make two things; Dust by using func_dustcloud and Fog by using env_fog_controller.

  • func_dustcloud is a brush entity available in all Source games. It spawns randomly-sized dust particles within its volume. Use the trigger texture with this entity.
  • env_fog_controller is a point entity available in all Source games. It determines the density of aerial fog for the whole map.

func_dushtcloud

To create a dustcloud we first need to select the correct texture, open up the Textures window by selecting the browse button, In Textures use the filter by adding ‘trigger’. Double click the trigger texture to select it.

buy1

 

Now that you have the trigger texture, we move on to creating the a brush. Select the Block Tools and create a template in the area you want the dustcloud to cover. When you have the right click the template and select Create Object or hit Enter.

dustcloud

Resize or reposition the brush if required.

We now need to tie the brush to an entity (func_dustcloud), so select the brush, right click the brush and select Tie to Entity or hit Ctrl + T. The Object properties will show, under the Class dropdownlist search for ‘func_dustcloud’ select it and hit apply.

dustcloud2

Properties you need to take into account are;

  • Name – The name that other entities refer to this entity by.
  • Particle Color – Color of the particles.
  • Start Disable – If set to Yes it will not then create particles when spawned.
  • Pericles per second – Number of particles to spawn, per second.
  • Maximum Particle Speed – Maximum speed that the particles can move after spawning.
  • Maximum Particle Lifetime – Maximum number of second until each particle dies.
  • Minimum Particle Lifetime – Minimum number of seconds until each particle dies.
  • Maximum Visible Distance – Maximum distance at which particles are visible. They fade to translucent at this distance.
  • Frozen – When set, this entity spawns the number of particles in SpawnRate immediately, and then goes inactive.
  • Maximum Particle Size – Maximum size the particles can be
  • Minimum Particle Size – Minimum size the particles can be

There is a lot to take in but the most important are;

  • Name (if you plan to start the cloud to be triggered by a button or event).
  •  Particle Color (To set the color depending on the enviroment).
  • Start Disabled (set to yes so that then you can enable it when there is an event).
  • Maximum Visible Distance (Make sure it is visible from a far).

So in the case of the his post I will duplicate the entity brush and set different properties. Properties I will change are the visible distance, colour and particle per second number.

Brush 1 – Green colour, greater particles per second, with maximum distance of 1024

dustcloud3

Brush 2 – Red, with 40 particles per second and maximum visible distance of 500

dustcloud4

Compile and run the game to see them in-game.

 2014-04-02_00002

2014-04-02_00001

 

env_fog_controller

To add fog into your level, select the Entity Tool and use Objects dropdownlist to search for env_fog_controller. Left click in the world to add the entity. Its position is not necessary (well it has to be inside the skybox).

fog

Double click the entity to open the object properties.

fog2

 

The properties that you need to take into account are;

  • Fog Enable – Enable fog on map load (This is important if you want fog in your level to show).
  • Primary Fog Color – Primary Fog Colour.
  • Secondary Fog Color – Secondary Fog Colour. (Primary will do, but you can set this if you want to use Fog Blend).
  • Fog Blend – This will enable blending between Primary fog colour and secondary fog colour, based on the direction the player is looking.
  • Fog Start – How far from the viewer the fog should start.
  • Fog End – How far from the viewer the scene should be completely fogged.

To set these setting you are required to go back and forth between the editor and game to get the perfect result. If you want a head start, then here are a few hints;

1 – Make sure that you have Fog Enable set to Yes.

2 – Selecting the fog Colour – You don’t want to colour to be left at default colour (which is white) or it will look like this in-game;

2014-04-03_00001

So what you want to do is open the light_environment properties and take the colour value from the brightness and set it as the fog Primary fog Colour.

fog4

 

Do the same with a Ambient and the Secondary Fog Colour. Make sure to set Fog Blend before you Compile and Run the game.

2014-04-03_00003

 

If you think the colours are still slightly briht, then go to the fog colour properties (primary and secondary) and make the colours slightly darker by hitting ‘Pick color‘ and using scroll on the right hand side.

fog5

 

 

3 –  Setting the Fog Start and End – Lowering the Fog Start value will bring the fog closer, while lowering the Fog End will bring the fog density closer.

With Low Fog Start

2014-04-03_00004

With Low Fog End

2014-04-03_00005

 

Setting these properties is dependent on the size of the map. If you have a big map then increase the Fog End value to around 3000 and leave the Fog Start at 500. While if the map is open (a lot of grass, only few buildings) then good idea to lower the Fog Start value to 100, and leave the Fog End at 2000.

Play about with the values to get the best result.