Lighting Transitions
by ArgCmdr
First, thanks to Wildefire and Cannis, cause I learned this thanks to
them. And also, this works perfectly on YR, but not on RA2, as the color
tint actions are not accepted. In RA2 use only the Ambient values. And
do not use either actions 71 and 72, they cause slowdowns, and values do
not seem to work correctly.
Lighting transitions were not necessary in TS, as the cycle could be
enabled and disabled from the Multiplayer Menu, though the rate of the
change of light was unchangable. In RA2, this feature is obsolete, lighting
transitions must be created with triggers, and are a good point on several
kinds of maps, mostly Multiplayer, but look good on certain missions, where
time is set at afternoon, and lights change on the same rate the player
approaches the enemy base. Mostly this is a feature used for MP maps as
said, and its not a standard, its just a good point to play a map, say
a nice feature.
The making of the transition can be easy, depending on what you will
to do. Making a real-time transition is tedious, but depends on how many
steps you will put from the beginning to the... beginning again. If you
plan to make a heavy transition, i recommend the equivalence 1 hour = 1
day. And you need 60 steps, 3 per hour, one every twelve minutes (real
time, one every minute) So the first step represents the starting hour
let´s say 12:00 PM (midnight). The next step will happen a minute
later, but will represent 24 minutes. So that when you arrive to step 60,
you will get all the day (24 minutes x 60 steps = day). You can of course
vary the quantity of steps or the equivalence time, that depends on how
the transition will be, if you add more intermediate steps, it will be
more gradual, if you sustract steps it will be abrupt. If you make it last
longer and mantain the step number it will take longer, but changes will
be seen easier, contrary if you mantain number of steps and shorten time,
changes will be noticed but they will be gradual and not abrupt. As you
see you have plenty of choices to go around.
Before starting the hard stuff, a side note. The value of the actions
described here is different from the ones in the lighting section of the
maps, cause these show points, and actions use percentages. So if you want
the ambient to be 0.95 you MUST put 95 as parameter in the correspondant
action.
Let´s take as example the 1 hour = 1 day cycle:
On this example we will use the best numbers for snow theatre, remember
that theses numbers vary for each theatre, so it would be recommendable
that you read FA2´s manual about lighting, you will find the temperate
values there, and check out other tutorial sites, where you will find the
values for the other theatres.
We will use 4 defined points on this example which are midnight, morning,
noon and afternoon. As these are 4 points and we are representing 24 hours,
we will have to set imaginary hours for each point, with the same time
transcurring from point to point (6 hours as 24 hours/4 points). Lets say,
midnight is 0 hs, morning is 6 hs, noon is 12 hs and afternoon is 18 hs.
Now we must calculate the difference between their lighting values (ambient,
blue, red and green). Midnight´s values are different to noon, noon´s
are different to afternoon, and so on. So you must calculate which will
be the rate of change during the transition. If 6 hours must pass, and
we have 24 minutes steps, then we will have 15 steps ((as 6 hours x 60
minutes per hour) / 24 minutes steps = 15 steps per defined point). Then
each defined point has 15 steps to get to the next one. As they are 4 points
and steps are 15 per phase, we have a total of 60 steps, 60 triggers.
As said first we calculate the values, it is undispensible to know which
are the ones corresponding to each point.
Snow´s points are:
Light Type/ Time
|
Morning
|
Noon
|
Afternoon
|
Night
|
Ambient |
0.750000 |
1.000000 |
0.750000 |
0.550000 |
Red |
1.120000 |
0.990000 |
1.060000 |
0.760000 |
Green |
0.800000 |
1.040000 |
1.070000 |
0.740000 |
Blue |
1.330000 |
1.070000 |
1.540000 |
1.180000 |
As we have said, calculate now the difference for each step on the loop.
You have to calculate the 60 steps, beginning by the 1st, at imaginary
hour 0:24. To do this you must simply do the following. Take a value, i.e
Ambient. Night (midnight, the 1st point) is 0.55 and we must calculate
the rate we have to use for all steps to arrive at step 15 at the second
point, morning, at a value of 0.75. Then we have 0.20 points to be shared
on 15 steps (20/15). The formula is quite simple its rate of modify of
value (ambient, red green or blue, in this case ambient) = difference between
points / number of steps.
When calculating this use decimals, and when setting them on the triggers
(remember you must use the 0.1 = 10 conversion on all the values), use
just one, so if the value you got is 0.965, put 96.5. After calculating
the ambient values for this 15 steps, you might want to follow with the
next ambient 15 steps. Don´t get surprised because of the calculations
required to use 1 hour = 1 day. This is actually a very complex method,
and very exact. You might want to use 20 steps instead, don´t worry
if this is too much work, all you have to do is make the calculations for
less steps, and also the trigger number will be much more less. You must
use that formula with all 4 values, and all 60 steps, which you will get
240 values in total.
I will now give you some of the ambient values so that you see if you
understood the formula:
Step on ambient from point 1 to point 2 is = 0.2 (difference between
points) / 15 (nº of steps) Rate is then = 0.013 approximately. Then,
0:24 will have an ambient of 0.563, 0:48 will have an ambient of 0.576,
and so on, adding the rate for each step, until you arrive to the point.
After this you will need to use the correspondant rate, to fit the changes
between point 2 and point 3.
Once you have all values, you must start with the triggers. The names
of each one should mention what emulated time it is, so you get the first
one (first step) named 0:24, the scond one 0:48 and so on. All triggers
must be type 2, repeating. And as side not before explaining how triggers
should be: This cycle is unrealistic, as all periods go on equally. All
lasts 6 hours, while the evening lasts 3 in real world. Again this is an
example, and if you are smart enough, you will figure out that you can
change very easily the timings by enlarging steps or making them smaller,
along with the time between them. You must now change the initial lighting
levels (Edit à Lighting) and set them to the last step of the transition
value´s so that it starts at 0 hs and the first step is 0:24 hs
So, here is what the triggers should be like:
Name: Step Name or Hours it represents
Owner:Civilian
Type: 2
Events:
1- #13 Elapsed Time (Parameter 60, so that it happens after 60 seconds
(1 minute, remember: 1 real minute = 24 minutes = 1 step)
Actions:
1- #73 Set Ambient Fade (Parameter is equal the value you calculated
for the correspondant number of step, in this case for ambient)
2- #142 Retint Red (Parameter is equal the value you calculated for
the correspondant number of step, in this case for red)
3- #143 Retint Green (Parameter is equal the value you calculated for
the correspondant number of step, in this case for green)
4- #144 Retint Blue (Parameter is equal the value you calculated for
the correspondant number of step, in this case for ambient)
5- #53 Enable Trigger (Parameter is the trigger representing the Next
Step)
6- #54 Disable Trigger (Parameter is this same trigger, so that it
disables itself, so that it does not repeat after 60 seconds setting the
same values, and so it can be re-enabled again when needed).
All triggers should be like this. The last one must disable itself as
usual and enable the first one, so that there is a loop created. Remember
again if the value you calculated was 0.95 then you must put 95 as parameter,
as its a percentage, then a x100 factor is added. By creating this 60 triggers
you will get a good transition, though not completely realistic, but at
least values will be exact. You can actually change the starting step by
disabling the current starting step and enabling the one you want to be
the starting step. So if step 1 started the transition and you want step
20 to start it, just disable the trigger corresponding to step 1 and enable
the one corresponding to step 20. Also you need to set the initial lighting
values (Edit à Lighting) equal to the previous start step, so if
transition starts on step 20 the initial lighting values should be the
ones of step 19, but remember you must define them, in this menu, eual
to the results you got from calculations as there is no percentage factor
here.
Finally, as side note, do not confuse ambient with light, as they are
different stuff, light has to do with the brightness of the colors, and
ambient with the quantity of light spotted on the terrain. Also remember
to set special lighting levels for weather storms, and make them equal
to midnight so that day´s storms are dark and night storms are dark
too.