| NOTE:
Before tackling this tutorial, I highly suggest you read the following
tutorial I wrote: Basic
Lighting Techniques Everything you need to know to get just the
right light setting in your maps!
Lamp Posts: What
are they?
NOTE:
This is the third in a series of tutorials on the subject of lighting.
In this tutorial we will discuss the types and properties of the
"Lamp Posts". These structures can be an unusually good tool
in enhancing your map and they can also cause so much trouble that the
end user will curse the day you were born.
Note:
You can download this tutorial in Microsoft Word format here.
Identification
and Properties:
Mathias Wagner (Matze)
has given the CnC community map editors for several Command and
Conquer series games. These include Final Sun, Final Alert1, Final
Alert 2, and most recently Final Alert2~Yuri. All of these editors are
similar in basic functions and features. There are however differences
in the structures list that is available to the map maker. The ones
that we are concerned with in this tutorial are the Lamp posts that
are disabled in FA2 and FA2~YR.
To enable these
"hidden" lamp posts you need to open the Final Alert 2~Yuri
directory and navigate to the FAData file. Open the file in a text
editor such as Wordpad or Editpad and scroll down to the subsection
[IgnoreRa2]. Keep scrolling until you find the lampost section, it
will be down the list starting at #34, it will appear like the
following:
; things only FinalAlert will ignore
; these are usually all dummies and leftovers from TS
[IgnoreRA2]
**
**
34=REDLAMP
35=GRENLAMP
36=BLUELAMP
37=YELWLAMP
38=PURPLAMP
39=INORANLAMP
;40=NEGLAMP ; NEGLAMP added again, invisible in game
41=NEGRED
42=TSTLAMP
You will notice that
#40 has a semi colon in front of the string, this enables it in the
editor, or in simpler language ..you can use it. By employing the same
process to the other lamps you can again gain access to them from the
structures list in the editor. If you are using Final Sun or Final
Alert 1 then these are already available to you and this step is not
needed.
The Lamp Posts that
are available to you (including the ones disabled
in FA2 and FA2~YR) and actually emit or absorb light are as follows:
Note* the numerical designations are from the RA2md ini file(Yuri)
[BuildingTypes]
33=REDLAMP
34=GRENLAMP
35=BLUELAMP
36=YELWLAMP
37=PURPLAMP
38=INORANLAMP
39=INGRNLMP
40=INREDLMP
41=INBLULMP
49=INGALITE
50=INYELWLAMP
51=INPURPLAMP
52=NEGLAMP
53=NEGRED
260=TEMMORLAMP
261=TEMDAYLAMP
262=TEMDUSLAMP
263=TEMNITLAMP
264=SNOMORLAMP
265=SNODAYLAMP
266=SNODUSLAMP
267=SNONITLAMP
NOTE:
There are also two other lamps listed in the building list of the ini
files, the GALITE and the TSTLAMP
This is the original
ini subsection for the GALITE from the Tiberian Sun game, from it all
the other lights were cloned . This is the Momma lite.
; Light post
[GALITE]
Name=Light Post
Image=GALITE
Strength=600
Armor=wood
Owner=GDI,NOD
Cost=200
TechLevel=-1 ; changed from 12
Nominal=yes
Sight=0
Points=30
Power=0
Crewed=NO
Explosion=TWLT070,S_BANG48,S_BRNL58,S_CLSN58,S_TUMU60
MaxDebris=1
LightVisibility=5000
LightIntensity=0.2
LightRedTint=0.05
LightGreenTint=0.05
LightBlueTint=0.01
ThreatPosed=0 ; This value MUST be 0 for all building addons
DamageParticleSystems=SparkSys,LGSparkSys
AlphaImage=NONE
Powered=true
The parameters are
identical to the other games with the exception of the houses and the
extra entry, AIBuildThis=no, in the Red Alert2 games. Notice the
subsections:
LightVisibility=5000
LightIntensity=0.2
LightRedTint=0.05
LightGreenTint=0.05
LightBlueTint=0.01
These are the default
settings. These parameters allow for the natural lighting that you
observe if you do nothing with the tint values from the lighting
editor. GALITE is NOT available to you from the editor without editing
the ini. It doesn't need to be in that respect either, as it's
counterpart, the INGALITE is the invisible version of the same lamp, with
exception that it is an Alpha Lamp, and it is available for use.
Alpha Lamps:
If the GALITE was the
momma then the TSTLAMP is the daddy. This lamp is referred to as the
Alpha Light Post. Speculation leads me to believe that this is the
first lamp introduced into the CnC games, as it has no lighting
properties and of course it's name.
The ini section for this lamp is as follows:
; Light post
[TSTLAMP]
Name=AlphaLightPost
Image=GALITE
Strength=600
Armor=wood
TechLevel=-1
Nominal=yes
Sight=0
Points=30
Power=0
Crewed=no ; why would we want guys to come out of the lightpost?
Explosion=TWLT070,S_BANG48,S_BRNL58,S_CLSN58,S_TUMU60
MaxDebris=1
ThreatPosed=0 ; This value MUST be 0 for all building addons
DamageParticleSystems=SparkSys
Insignificant=yes
AlphaImage=ALPHATST
Notice the last entry
in the [TSTLAMP] section, AlphaImage=, by studying the ini files we
note that some of the Lamp Posts specifically state AlphaImage=NONE.
This is of some importance when choosing which lamp to employ in your
map. The Alpha image Lamp Posts, or the ones that do not state
AlphaImage=NONE, cause the game to lag substantially more than the the
ones that do not have the Alpha image. You will need to take this into
account when making your map, as this will affect what triggers you
will use and how many. It will also affect gameplay. Let give you an
example...You have created a beautiful map, the detail is the absolute
peak of perfection, the cliffs are random and well made, the sound
effects are just right, you have installed a Day/ Night Loop and a set
of random action triggers that enable a weather storm /ion storm at
different waypoints. You have also placed several of the Alpha lamps
around the arena ..some in the ore/tiberian fields, some near the
water, and a few scattered close to the base for enhancement.
You fire up the game
and things seem to be going okey, you did notice that when the game
first started that there was a thirty second period of time that it
lagged, but that cleared up. You are in the heat of battle, lots of
action going on, tanks stalking and shooting at each other, aircraft
on the go, infantry buckeling down ,and then it happens........the
game begins to lag, it gets slower and slower until finally it
freezes!!.. You can't do anything!! Your cursur moves but that is it.
You can't even [Alt][Tab] out of the game. This has occured in all
likely hood because of what I call "ALPHA OVERLOAD".
As I have stated in
other tutorials "Moderation in all things". The number of
Alpha Lamps that you have placed in the scenario (map) add to the
other things that cause lag only in a more dramtic way. Things that
cause lag are animations, triggers that call up animations and
lighting changes, to some extent the number of triggers , the size of
the map, the amount of territory that is revealed, etc., etc., etc. As
you can see the more that is in the map the more it will lag.
I recently created a
map with many Alpha Lamp posts on it and managed thru much ini editing
to get my Day/Night Loop in the map without any appreciable lag.
Granted it did lag for the first fifteen seconds or so but that is to
expected, as it was a large map with a lot of lighting effects and
Alpha image Lamp posts incorporated in it.. This in itself was quite
an achievement, however, no other triggers other than the Day/Night
Loop could be used and absolutely no sound effects (another huge
generator of lag). You might say "Gee RV, what's wrong with
that". The problem is, that I was not able to fully enhance the
map the way I had planned to from the beginning. I had planned to turn
the Lamp's off when the ambient light level's reached a certain point
and then on, when they were on the way up. Because of the "Alpha
overload' this was not possible.
Another property that
I have observed when using the Alpha's, the lower the intensity and visibility
that is used for each, the lower the lag factor seems to be. So by
using the absolute minimum intensity and visibility that you need for
your map you can keep this to a low level.
The intensity and
visibility can be lowered by altering the LightVisibility= and
LightIntensity= parameters to a lower value.
The Alpha Lamps are as follows:
[NEGLAMP]
[INGALITE]
[NEGRED]
[YELWLAMP]
[INYELWLAMP]
[INPURPLAMP]
[INORANLAMP]
[INGRNLMP]
[INREDLMP]
[INBLULMP]
[TEMMORLAMP]
[TEMDAYLAMP]
[TEMDUSLAMP]
[TEMNITLAMP]
[SNOMORLAMP]
[SNODAYLAMP]
[SNODUSLAMP]
[SNONITLAMP]
Visible Lamp
Posts:
This leaves only a
few Lamp Posts that do not cause any appreciable lag. They are:
[REDLAMP]
[GRENLAMP]
[BLUELAMP]
[PURPLAMP]The GALITE also, understandably so, is not an Alpha Lamp.
So it would seem that
if we employ these four Lamp posts and just these four Lamp posts that
we would be on solid ground wouldn't it? Unfortunately this is not the
case. There are several items that must be taken into account when
using these or any of the others for that matter. Ambient
recalculation is the first thing to take into account. Whenever any
ambient changes take affect or are intergrated with the normal ambient
levels then the game engine will recalculate these changes in order to
come up with a constant that it can use in order to speed up or slow
down the game. It does this in an attempt to keep the game stable at
15fps (frames per second).
Experimenting:
Here is a simple
experiment you can do to observe this in action. Make a simple, small
(50x50), flat map for 2 players. Separate the map with a river running
from one side to the other, diagonally of course, and create a reveal
trigger in order to see the whole map. . Now place 1 or 2 REDLAMPS on
both sides and save the map as a multiplayer and name it simply
"TEST". Start the game and select your map. After the game
starts have your units walk into the Red light. Did you notice that
they slow down when they enter and that they speed back up after only
a short time? Did you also notice that they did not slow down as they
left the Red light? That slow down period is when the game is
recalculating and adjusting the fps. Now leave the game and edit the
map. Place enough lamps on the map so that it will be saturated with
red light and appear to be the planet Mars. Start up the game again
and observe that the map is totally red and that there is no lag!!
This is because the ambient rate and change are stable and there is no
reason to recalculate beyond the norm. Now delete all of the Lamp
posts except two. Paste this ini change into your test map and save
it.
[REDLAMP]
LightVisibility=950
LightIntensity=0.005
Start up the game and
you will find two "spotlight" type red areas. Run your units
into these areas and you will note that they do not slow down when
entering the area. Bearing this in mind it should be apparent the need
to limit the intensity and visibility of the Lamp Posts to the minimum
required for any particular enhancement.
This brings us to the
other thing to be taken into account when using these lamps, I stated
in a previous tutorial that using these particular Lamp Posts serves
no purpose, let me qualify that here.
- 1: The
visible lamp posts are in the wrong pallet and look funny in the
RA2 games. This is because it is really a Tiberian Sun structure.
- 2: If used
judiciously, the Alpha lamp posts can be used without any
appreciable lag.
- 3: It is
quite easy to give the visible lamp propeties to another more
suitable structure in RA2.
Now, all that being
said , I suppose you can hide them in the trees or behind a cliff.
Negative Lamp
Posts:
There are two lamp posts
that would upon first glance appear to be disfunctional. They are the
NEGLAMP and the NEGRED Lamp Posts. The ini entry for the NEGLAMP is as
follows:
; Black Light post
[NEGLAMP]
Name=Negative Light Post
Image=GALITE
Strength=1000
Armor=wood
TechLevel=-1
InvisibleInGame=yes
Nominal=yes
Sight=0
Points=30
Power=0
Crewed=no Explosion=TWLT070,S_BANG48,S_BRNL58,S_CLSN58,S_TUMU60
MaxDebris=3
LightVisibility=3500
LightIntensity=-0.15
LightRedTint=0.03
LightGreenTint=0.04
LightBlueTint=0.04
ThreatPosed=0 ; This value MUST be 0 for all building addons
DamageParticleSystems=SparkSys,LGSparkSys
Insignificant=yes
After studying the [NEGLAMP] parameters and truncated comments it can
be seen that this Lamp Post is quite different from the others
discussed in the "Alpha Lamps" section of this tutorial.
First off, in the
truncated comment above the UIName we see that the programmers call
this the "Black Light post". Looking at the "LightIntensity="
parameter it is noted that the entry is a negative(-) one!! So, using
our reasoning power we can deduce that this light is not really Black
Light but, actually absorbs light from the surrounding tiles giving
the appearance of a severely shadowed, or darkened area.
By editing the
entries it is possible to enlarge or shrink the area affected by
altering the LightVisibility= entry. The higher the number the larger
the area, the inverse would true by lowering the number.
The LightIntensity=
entry determines how dark, or how much light is allowed to shine in
the area. Editing this entry will alter the shading, by moving the
benchmark further in the negative direction the darker the area will
become, again the inverse would be true by moving the bench mark
closer to the positive direction.
The other negative
lamp at the map makers disposal is the NEGRED. The ini entries for
this are as follows:
; Light post
[NEGRED]
Name=Negative Red Light
Image=GALITE
Insignificant=yes
Strength=6000
Armor=wood
TechLevel=-1
Nominal=yes
Sight=0
Points=30
Power=0
Crewed=yes
Explosion=TWLT070,S_BANG48,S_BRNL58,S_CLSN58,S_TUMU60
MaxDebris=1
LightVisibility=4000
LightIntensity=-0.05
LightRedTint=-1.5
LightGreenTint=0.01
LightBlueTint=0.01
ThreatPosed=0 ; This value MUST be 0 for all building addons
DamageParticleSystems=SparkSys,LGSparkSys,P
By studying the
properties of this Lamp post we notice that it is quite similar to the
NEGLAMP with one very critical exception...."LightRedTint="
is a negative number also. Not only does this structure absorb light ,
it absorbs a large amount of the red spectrum.
Again by editing the
properties we can control the amount of light, as well as the amount
of red light absorbed. By moving the LightRedTint= parameter further
in the negative direction we can eliminate the red tint even more. We
can limit the effect by moving the benchmark in the positive
direction.
It should also be
noted that both the Negative lamps are Alpha types and therfore their
use should be judicous and well thought out.
Theater/Time
Dependant Lamp Posts:
There are two types of
Lamp posts that are designed for particular theaters in mind, these
are the Temp and the Snow Lamp post types. Four seperate lamps for
each theater, one for each quarter of the day..night, morning, dusk,
and broad daylight. All are alpha lamps and each has its own separate
uses.
There are only two
types of these Lamps because they were designed for use in the
Tiberian Sun game as that genre has only two theaters, Snow and
Temperate.
The following are the
Lamp Posts for the Temperate Theater:
[TEMMORLAMP] is the morning Lamp Post
[TEMDAYLAMP] is the broad daylight Lamp Post
[TEMDUSLAMP] is the dusk Lamp Post
[TEMNITLAMP] is the night Lamp Pos
The Morning Lamp and
the Dusk Lamp are identical with the exception of their UINames. I
suspect that this allowed Westwood to place two lamps down in the same
map and have different setting for each via ini editing. Primarily
these Lamps were used to light up the starting areas in Night maps and
also to offset the level shadows in the canyon regions of a typical
Tiberian Sun map. The Temperate Lamps are quite lovely with a slight
green/yellow tint that really looks very nice in a jungle type map for
RA2. The use of one TEMPNITLAMP will more than light up the starting
area of any night map and may even need to toned down a bit.
The following are
the Lamp Posts for the Snow Theater:
[SNOMORLAMP] is the
morning Lamp Post
[SNODAYLAMP] is the broad daylight Lamp Post
[SNODUSLAMP] is the dusk Lamp Post
[SNONITLAMP] is the night Lmap Post
If you study the
parameter s for the Snow Lamp posts you will notice that the entries
for the the blue tint is quite low and in some instances is even a
negative!! Look at the example of the Morning Lamp Post:
; Invisible Light
post
[SNOMORLAMP]
Name=InvisibleSnowMorningLamp
Selectable=no
InvisibleInGame=yes
Insignificant=yes
Image=GALITE
Strength=6000
Armor=wood
TechLevel=-1
Nominal=yes
Sight=0
Points=30
Power=0
Crewed=yes
Explosion=TWLT070,S_BANG48,S_BRNL58,S_CLSN58,S_TUMU60
LightVisibility=3500
LightIntensity=0.01
LightRedTint=0.3
LightGreenTint=0.4
LightBlueTint=-0.1
DamageParticleSystems=SparkSys,LGSparkSys
Powered=true
The entry for the
LightBlueTint is -0.1. This will "suck" the blue out of the
RGB code for the snow, causing it to be white, really white.
The parameter for the
Dusk Lamp Post takes it even deeper with a setting of -0.2.
The Night Lamp Post
does have an entry of 0.05, this coupled with a low ambient setting
has a very nice effect in Tiberian Sun. However in RA2 I would add
even more blue tint as the snow differs greatly between the two games.
We have now covered
all the Lamp Posts that are available in the games. Remember to use
them judiciously (sparingly), and to edit them to reasonable levels.
Do not use them in the ultimate n00b sin.....writing your name! If I
find the game lags because I am forced to read your name...then into
the bin it goes and I will indeed remember your name, but I will never
see your work again =)
Check
out RVMECH's Basic
Lighting Tutorial!
|