User Tools

Site Tools


Sidebar

hpl2:tutorials:level_editor:tutorial_6

Level Editor - Useful tricks (in progress)

While The Basics and Light tutorial are great enough to create atmospheric maps, there are some things that can easily help achieve interesting results.

Billboards

Step by step tutorial. Starting with easy way to setup and control billboards for your map, and continuing to more advanced effects.

First make sure you have read and understood this.


Start off by creating a billboard and a point light and connect the billboard into the point light. This helps you control the color value of every billboard you duplicate from the original connected billboard. Keep all of the billboards colors at 1 value. (That one extra point light in the picture is useless for the first parts)

bb_01.jpg

Then align your billboards properly into your window.

bb_02.jpg

Then tinker with the color of the connected point light and adjust the lenght and width of the billboards. This is the hardest and time consuming part about billboards. Make sure to often check in game because billboards look different there and you can see if they look good from every angle.

bb_03.jpg

That was it for simple billboards, but if you continue, you get to the interesting parts!

To create better looking billboards, not all of them should be of the same color, so create another point light and connect the billboards that you think need different colors to other point lights. For simplicitys sake I keep them connected to only 2 point lights. (Colors changed so you can see better what I did)

bb_04.jpg

Flicker effect

You can create the flickering effect with various methods. First and easiest one would be to use the point lights own flickering settings inside the level editor. Tweak the Off Color and Diffuse Color to suit your liking. Example settings:

bb_05.jpg

Using the level editor only is not as interesting as randomly changing colors of billboards and every light that acts as the windows shine in sync with script.

So next phase would be to set up additional lights to the window, spot light and some ambient point lights in this case. Name them so you can easily track what they are. In this case I named mine like this:

window_light_bright_1 (spot light with gobo, I want this bright)

window_light_bright_2 (point light close to window, bright also)

window_light_dark_1 (large point light)

bb_06.jpg

Then the rest is up to script. Example script for controlling, very simple vers. You can tweak the ideas around alot. Like this one does not change the color of the lights into same color as the billboards.

void FlickerTimer(string &in asTimer) { float ftimer = RandFloat(0.6f,1.6f);
        FadeLightTo("bb_bright", RandFloat(0.2f,0.3f), RandFloat(0.2f,0.35f), RandFloat(0.3f,0.39f), 1, -1, ftimer);
        FadeLightTo("bb_dark", RandFloat(0.15f,0.29f), RandFloat(0.18f,0.35f), RandFloat(0.35f,0.39f), 1, -1, ftimer);
       
        for(int i=0;i<2;i++) FadeLightTo("window_light_bright_"+i, RandFloat(0.55f,0.7f), RandFloat(0.69f,0.8f), RandFloat(0.8f,0.9f), 1, -1, ftimer);
        for(int i=0;i<2;i++) FadeLightTo("window_light_dark_"+i, RandFloat(0.4f,0.5f), RandFloat(0.5f,0.6f), RandFloat(0.6f,0.7f), 1, -1, ftimer);
AddTimer("repeat", ftimer, "FlickerTimer");
}

Then here is the one I used for the demonstration video clip. (Can cause performance issues when done with lots of billboards and particles, I haven't tested…). Minor tweaking, added spawn areas for particles and finetuned the script for long. The script could be done more efficient, if someone can, please edit!

bb_07.jpg

 
void OnStart()
 
 
{
AddTimer("start", 0, "FlickerTimer");
SetPlayerMoveSpeedMul(0.7f);
SetLocalVarInt("EventInt", 1);
for(int i=0;i<3;i++) CreateParticleSystemAtEntityExt("blue_particles", "ps_light_dust_large.ps", "bb_particle_"+i, true, 0.6f, 0.75f, 1.0f, 1, true, 1, 2, 8, 11);
for(int i=0;i<3;i++) CreateParticleSystemAtEntityExt("blue_fog_particles", "ps_area_fog.ps", "fog_particle_"+i, true, 0.6f, 0.75f, 1.0f, 0.8f, true, 1, 2, 8, 11);
 
 
}
hpl2/tutorials/level_editor/tutorial_6.1317818557.txt.gz · Last modified: 2011/10/05 12:42 by khyrpa