WiseWind: Wind

From Valve Developer Community
Jump to: navigation, search

This tutorial was originally created by wisemx.

Ported from SDKnuts.net to VDC by: Peter [AGHL] 08:19, 16 Feb 2008 (PST)

Wind Effects

This project illustrates two methods for creating the illusion of environmental wind in your maps.

Note:An additional method that I’m not going to cover in this project is Rotor Wash. The effect you see in HL2 when Air ships are close to power lines.

The two methods used in this project are:

  1. env_wind - an entity to control wind in the map.
  2. trigger_wind - a trigger volume that pushes physics objects that touch it.

I’ve also used a func_dustcloud for the trigger_wind, for effect.

Note:func_dustcloud is a brush based entity that spawns a translucent dust cloud within its volume. The volume is determined by the size of the brush you create but be careful as these do tax in-game performance.
Note:Another way to simulate the force of strong winds is with Env_physexplosion. If the no-damage flag is set the explosion won't be visible but it will apply force to any physics objects within its radius. If the force is set low it can be sued to gently nudge physics objects, like lights, wires or debris.

env_wind is only used once in HL2. In d3_citadel_01 as you come out of the tunnel and can see the Citadel. The wires you see swaying in front of you at the end of that tunnel are randomly pushed by a env_wind.

trigger_wind is used in the beginning of HL2, in d1_trainstation_01 as you step off the Train and see some trash blowing across the cement. It’s also used in d2_prison_03 for the large fan you have to sneak past in the air vents.

In this project the trigger_wind is used to blow a dust cloud. The env_wind is used to randomly sway the power lines.

Both of these methods have advantages.

  • trigger_wind is a brush based volume so you have more control over the area it effects. It can also be enabled and disabled as needed.
  • env_wind is easy to place in your map and it can be directed but you can’t turn it on and off unless you kill the entity.

The power lines in this project are created with move_rope and keyframe_rope entities.

I’ve used a logic_timer to control the trigger_wind, func_dustcloud and an ambient_generic. The logic_timer is set to use random time.

These are the properties I used for each entity in this project.

Swaying Wires

Class: logic_timer

  • Start disabled: No
  • Use Random time: Yes
  • Min Random Interval: 6
  • Max Random Interval: 12
  • Outputs: (see image)
WiseWind01.png

Class: env_wind

  • Pitch Yaw Roll: Use the Point At tool for this.
  • Min normal speed: 30
  • Max normal speed: 80
  • Min gust speed: 100
  • Max gust speed: 150
  • Min gust delay: 10
  • Max gust delay: 20
  • Max gust dir change: 30

Classes: move_rope and keyframe_rope:

  • Speed: 64
  • Slack: 140
  • Type: Rope
  • Subdivision: 3
  • Barbed: No
  • Width: 3
  • Texture scale: 1
  • Collide with world: No
  • Start dangling: No
  • Breakable: No
  • Rope material: cable/cable.vmt
  • Position Interpolator: 2

A Dust Cloud

Class: trigger_wind

  • Name: windtrigger01
  • Start disabled: Yes
  • Pitch Yaw Roll: Use the Point At tool for this.
  • Speed: 120
  • Speed Noise: 0
  • Direction Noise: 20
  • Hold Time: 0
  • Hold Noise: 0
  • Flags:
  • Everything, Checked

Class: func_dustcloud

  • Name: DustCloud1
  • Start disabled: Yes
  • Particle color: 168 141 123
  • Particle per second: 30
  • Max particle speed: 13
  • Min particle lifetime: 3
  • Max particle lifetime: 5
  • Max visible distance: 750
  • Frozen: No
  • Alpha: 30
  • Min particle size: 5
  • Max particle size: 50

Sound

Class: ambient_generic

  • Name: WindSound
  • Sound Name: ambient/wind/windgust_strong.wav
  • Volume: 8

Setup and Final Result

In the images below you can see the volume created by the brush based entities and the placement of the env_wind. The black arrow shows the direction of both wind entities. the other image is a shot from HL2 of the combine effect.

See Also