Creating Complete, Repeating Day/Night Cycles
by Wildefire [RADEN staff]

« previous page | PAGE #2:

Lighting Transition Triggers

The triggers you create will do the following things:

1) One trigger will start off the lighting cycle. It will kick the whole thing into motion, firing only once. Once the cycle gets going, it will run quite nicely on its own.

2) These triggers step the ambient lighting downward and upward in small increments. Note the emphasis on the word small. You don't want the lighting changes to be in the player's face. These triggers will repeat as necessary.

Start Cycle Trigger:

1) Trigger Options tab: 
Name: Give it a name that will make it recognizable to you later on if you need to tweak it. Remember, we're making almost 40 triggers here.

House: Civilian.
-Type: 0 (Standard)
-Attached Trigger: <none>
-Disabled box: Leave empty.
-Difficulty Level checkboxes: Leave checked.

2) Events Tab:
-Event 0 (There are no other events for this trigger.)
-Event type: #13 (Elapsed Time)
-Event Parameter Value: any value you want, but you don't want to go much above 200 or you'll end up with a very long period at the map's initial Ambient settings -- much longer than any point in the cycle that follows.


3) Actions Tab:
-Action 0
-Action type: #53 (Enable Trigger)
-Action Parameter Value (Trigger): Leave this blank for now because you don't have a trigger for it to enable yet.
There are no other actions for this trigger.

Lighting Transitions Triggers:

Don't worry. I'm not going to describe all 30+ transitioning triggers here. Here are the elements that will be common to all of them, tab by tab.

Trigger Options tab: 
Name: Something that describes the time of day like afternoon, dusk, etc. Because there will be multiple triggers for each major time period, put a number after the name and number them consecutively until you create a trigger starting the next major time period. This will help enormously if you want to change something in the cycle. And you will. Trust me.

House: Civilian
Type: 2 (repeating)
Disabled checkbox: Checked!!!
Difficulty checkboxes: Leave checked

Events Tab:
-Event 0: (There are no other events for these triggers.)
-Event Type: #13 (Elapsed Time)
-Event Parameter Value: This will vary according to the time of day. Dawn and dusk seem to change more rapidly than other points of the day/night cycle in the real world. I used values ranging from 50 to 300. I'll discuss this further under Timing Your Lighting Cycle.


Actions Tab:
-Action 0:
-Action type: #73 (Set Ambient Light
-Action Parameter Value: This depends on whether the trigger is increasing or decreasing lighting.

The value is a percentage, but is specified without a percent sign. It is always relative to 100 percent. It is not relative to the value you specified for this parameter in the trigger preceding it in the cycle.

In other words, if you're stepping up the lighting by 3 from a previous trigger that specified 84, you enter 87, not 3 (else the map will go totally pitch black). Always remember (or refer back to) the trigger you created previously in the cycle. You don't want to increment or decrement this number by more than 3 to 5 if you want to have your transitions to be barely perceptible. Even at a change of + or -3, you can slightly see the change if you're not busy at the time in the game. If you're busy, you probably won't notice it at all.

If you are making a map that you want to be dimmer than usual throughout the entire cycle (like the one I'm currrently working on), never exceed the maximum lighting value you want for the cycle. For example, I have a maximum lighting value of 75 for my current map. None of the action #73 values exceed it.


Action 1:
-Action type: #53 (Enable Trigger)
-Action Parameter Value: This will be the next trigger in the cycle. Ooops. You haven't created it yet. Leave it blank until after you've created the next trigger. IMPORTANT: So that you don't get yourself all cranky and confused, always go back to the previous trigger and select the trigger you just finished so you won't forget it.

Action 2:
-Action type: #54 (Disable Trigger)
-Action Parameter Value: You want this trigger to disable itself. Remember how you disabled it on the Trigger Options tab (if you were paying attention back there)? We keep our trigger firing sequence nice and tidy by disabling it again. Every trigger enables the next trigger in the sequence in action 1 and disables itself in Action 2. So, we have a nice loop going here with no one firing before they're told to -- like on a well-run firing range. ;-)

IMPORTANT: After creating your first lighting transition trigger, open your Start Transitions trigger and select it as the trigger to be enabled in the trigger action (Enable trigger...).

Examples from Wildefire's Amusement Park map:

The following examples from WFAP will help you give you a clearer idea of what I discussed more generally above. This small segment shows how the sequence is started then continues. The triggers are listed in their firing sequence. Remember that the Ambient value in the Lighting dialog is set to 0.900000 on this map. (It increases to 1.000000 when the lighting cycles around to noon.) Thus the game starts off in rather early afternoon. Usually, I'll give only the specific changes from the general points listed above.

Start Transitions trigger:

-Trigger Options tab: Type 0 (standard); Disabled checkbox unchecked.
-Events tab: Type: Elapsed time; parameter (Number) value: 255
-Action 0: Type: Enable trigger; parameter (Trigger) value: Late Afternoon

Notes: The cycle goes into motion 255 seconds after the start of the game. However, you won't see a lighting transition yet.

Late Afternoon trigger:

-Trigger Options tab: Type 2 (repeating); Disabled checkbox: CHECKED
-Events tab: Type: Elapsed time; Number parameter value: 200

Actions tab:
-Action 0: Type: Set Ambient Light; Parameter (Number) value: 85
-Action 1: Type: Enable Trigger; Parameter (Trigger) value: Late Afternoon 2
-Action 2: Type: Disable Trigger; Parameter (Trigger) value: Late Afternoon

Notes: Here you see your first lighting change, which occurs 455 seconds after the game starts. (Yes, this is longer than it should be. If only I had WFAP to do over again!) Ambient lighting is stepped down from 90 (where it started) to 85 here. 

Ooops, I stepped the lighting down by 5 instead of 3 as I recommended. No wonder this transition is more noticeable. Oh well. Moving on from that little embarrassment... We are now in the loop where each trigger enables the next and disables itself.

Late Afternoon2 trigger:

-Trigger Options tab: same as above
-Events tab: Elapsed time; Parameter (Number) value: 200
-Actions tab (I'll just give the ambient light value for action 73 here. The other actions are similar to the previous trigger.
-Action 0: Parameter (Number) value: 80 (sigh! I stepped it down by 5 again!)

Notes: Elapsed time is the same for the Late Afternoon trigger. The sun still seems to be moving rather slowly.

Late Afternoon3 trigger:

-Trigger Options tab: same as above
-Events tab: Elasped time: Parameter (Number) value: 150

Actions tab: 
-Action 0: Action 73 parameter value: 77 (Whew! I finally started to get this right. We're down by only 3.)

Notes: Note that the timing is starting to compress with the elapsed time. It's getting darker a little faster now.

Timing Your Lighting Cycle:

Why is this so important? Because I want to help you make your map seem realistic in terms of the lighting changes. In the real world, the sun seems to move more rapidly when it's dusk or dawn. (This effect is especially pronounced in the tropics, particularly for nightfall.) OTOH, it seems to stay at darkest night longer. The other extreme is around noon and early afternoon. BTW, this effect seems to vary according to latitude. Hint: You can really experiment with this if your map is set near the equator or near the polar regions. That's for you fellow RA2 obsessive/compulsive mapmakers like me. ;-) Snow maps btw are set in the winter (duuuh!) when days are shorter. You can create shorter daylight periods and longer dark periods to mimic this.

On WFAP, the elapsed time (Event 13) value starts going down as it gets darker throughout the rest of the Late Afternoon triggers and Dusk Triggers. From Dusk5 to Dusk9, it really compresses down to 75. The first Night trigger (which should have been Dusk10, we're down to 50. When we hit full night (Ambient lighting=41) the elapsed time balloons up to 300. If you want to get a fuller idea of how I handled the entire cycle, download WFAP and study the triggers. I admit, I didn't do it perfectly, but I don't think it's that noticeable on the map.

Experiment through extensive play testing to get the right feel for the entire cycle and its various segments. You don't want your complete cycle to be so long that players won't see its entirety unless they play extremely long games. On the other hand, you don't want it to be so short that players feel as if they're on a small moon rotating at an incredible speed.

« previous page | Weather Storm Lighting here »

Download this entire tutorial in a zip file here!

 

The tutorials on this section are copyright© RADEN - cncgames.com, and non of the tutorials on this section may be copied for use on other websites. RADEN is not affiliated with the Final Alert website. Questions? Email here.