Jump to content


- - - - -

BGL lights - flashing wrong


  • Please log in to reply
7 replies to this topic

#1 Fredneck

Fredneck

    Passenger

  • New Members
  • Pip
  • 6 posts

Posted 11 June 2007 - 08:42 AM

I posted this on FSDeveloper as well but wanted to see if anyone here had a solution to help...

Here's an issue that came up while doing my threshold strobes. I did the pair for runway 05 and they work fine (actually have 4 strobes on one unit and they seems to work fine, bright enough, timed very close to real life, etc...now, the same gmax model, rotated to match the runway, exported as a DIFFERENT model name, placed in a different XML file creates a bad effect....

Rwy 05 is the close end of the runway in this picture. Rwy 23 is from the other end ->> The threshold lights for rwy 23 are not both on at the same time, they WIG and WAG! How can this be? They are both from the same .mdl file (tweaked to match the rwy 05 end lights, but they are blinking on a different timeframe...same frequency, but shouldnt they all be on at the same time and all off at the same time?

Posted ImagePosted Image

Things I've checked:
1. The code for each light seems to be identical.
2. I placed the same lights in other locations on this airport and other airports and it has the same effect.
3. I've re-exported the lights from gmax and still the same effect.

Is there, maybe, a limit to the number of these lights, or something limit that I have crossed that would affect this? So far, the two light units each with 4 BGL lights (for brightness) on rwy 5 (working) and the two units each with 4 BGL lights on rwy 23 (not working) are the only LIGHT_STROBE lights I used- total 16 lights. My taxi and runway end and edge lights are all BGL LIGHT_NAV non-blinking lights..

Your help is appreciated...

#2 Fredneck

Fredneck

    Passenger

  • New Members
  • Pip
  • 6 posts

Posted 11 June 2007 - 06:05 PM

Solved. I had originally created the strobe light unit as a model so I could place each unit box individually at each end of each runway...this obviously didn't work. So, I created Working pairs spread apart by the distance I needed and placed the PAIRS as a MDL library object, inserted at the correct locations at the end of each runway, rotated in XML to point the correct direction. I guess because the units were in pairs, they had to "play nice together...". It works fine now.

By the way, I had also tried combining the lights under one IFMSK statement in the 0_asm file with no luck.

#3 mobisone

mobisone

    Commercial Pilot

  • Members
  • PipPipPipPipPip
  • 1,934 posts
  • Location:ALASKA

Posted 13 June 2007 - 02:14 AM

could you show the process on how these are made?

AFCAD lighting does not work at all when you try to apply them to a gmax model im working on,
Ahem* The Super Carrier.

#4 Fredneck

Fredneck

    Passenger

  • New Members
  • Pip
  • 6 posts

Posted 13 June 2007 - 12:33 PM

Let me try...I've never been asked for a "tutorial" before  :lol: If there are better methods out there, I hope someone comes forth and corrects my ways.

First, using Gmax with the FS2004 gamepack, create the actual gmax object that will show your light unit; I modelled it after a real-life style of strobe light used for REIL (Runway end identification light).
Posted Image

Then, attach the lights. I wanted the strobe to be bright when they flashed, so I used 4 individual strobe lights. To make the each light, add a small box, size doesn't matter really, that will represent the light. I placed them in a diamond pattern so the light looks larger (and brighter) at a distance, instead of just a dot of blinking light.
Posted Image

The next step is to make the 4 small boxes act as lights, not just objects. To do this, you create a new Material with the name LIGHT_STROBE_something, where “something is and ending to the name specific to the object…I just called it LIGHT_STROBE1 – the important part is starting the material name as LIGHT_STROBE! Go to the Diffuse color box in the middle of the Material Editor and choose a color for your lights. Keep in mind that the color you choose does not have to be the final color of your lights in the simulator; its only for your reference, really. You can change the color later.  Assign the material to each of the 4 small boxes. - Don't forget to texture your actual light box!
Posted Image

Next, export the entire model, light box and all of the lights to a .mdl file, choose a name…let's call it REILstrobe.mdl. Check Keep Files and you should get a mdl, asm and 0_asm file out of the export. Open the REILstrobe_0.asm file and look for something similar to this:

REILstrobe_MasterScale_2 label BGLCODE

    IFMSK       nolgt_1, dict_0_g_lightStates, LIGHT_STROBE_MASK
    VAR_BASE_OVERRIDE VAR_BASE_GLOBAL
    IFMSK       nolgt_1, beacnt, 00002h
    BGL_LIGHT LIGHT_STROBE, 0.199, 0.417, -0.157, 40, 0.60, 0.40, 0FFFFFFFFh, 0.000000, 0.000000, 1.000000 ; source poly num = 1
    nolgt_1       label BGLCODE

    IFMSK       nolgt_2, dict_0_g_lightStates, LIGHT_STROBE_MASK
    VAR_BASE_OVERRIDE VAR_BASE_GLOBAL
    IFMSK       nolgt_2, beacnt, 00002h
    BGL_LIGHT LIGHT_STROBE, 0.199, 0.611, -0.157, 40, 0.60, 0.40, 0FFFFFFFFh, 0.000000, 0.000000, 1.000000 ; source poly num = 2
    nolgt_2       label BGLCODE

    IFMSK       nolgt_3, dict_0_g_lightStates, LIGHT_STROBE_MASK
    VAR_BASE_OVERRIDE VAR_BASE_GLOBAL
    IFMSK       nolgt_3, beacnt, 00002h
    BGL_LIGHT LIGHT_STROBE, 0.232, 0.516, -0.208, 40, 0.60, 0.40, 0FFFFFFFFh, 0.000000, 0.000000, 1.000000 ; source poly num = 3
    nolgt_3       label BGLCODE

    IFMSK       nolgt_4, dict_0_g_lightStates, LIGHT_STROBE_MASK
    VAR_BASE_OVERRIDE VAR_BASE_GLOBAL
    IFMSK       nolgt_4, beacnt, 00002h
    BGL_LIGHT LIGHT_STROBE, 0.156, 0.516, -0.102, 40, 0.60, 0.40, 0FFFFFFFFh, 0.000000, 0.000000, 1.000000 ; source poly num = 4
    nolgt_4       label BGLCODE
    BGL_RETURN

You need to modify the code as this, see text in red…add a ; in front of the IFMSK lines as shown – not all of them, just the ones with the dict_0_g_lightStates in them, to make them ineffective. This change alone should make your lights work and function, but you'll notice that they will blink slowly. To speed up the frequency of the flashing, change the code in BLUE. 00002h becomes 09999h, making the strobes flash at about 1 per second.

REILSTROBE05_MasterScale_2 label BGLCODE

    ;IFMSK       nolgt_1, dict_0_g_lightStates, LIGHT_STROBE_MASK    VAR_BASE_OVERRIDE VAR_BASE_GLOBAL
    IFMSK       nolgt_1, beacnt, 09999h
    BGL_LIGHT LIGHT_STROBE, 0.199, 0.417, -0.157, 40, 0.60, 0.40, 0FFFFFFFFh, 0.000000, 0.000000, 1.000000 ; source poly num = 1
    nolgt_1       label BGLCODE

   ;IFMSK       nolgt_2, dict_0_g_lightStates, LIGHT_STROBE_MASK    VAR_BASE_OVERRIDE VAR_BASE_GLOBAL
    IFMSK       nolgt_2, beacnt, 09999h
    BGL_LIGHT LIGHT_STROBE, 0.199, 0.611, -0.157, 40, 0.60, 0.40, 0FFFFFFFFh, 0.000000, 0.000000, 1.000000 ; source poly num = 2
    nolgt_2       label BGLCODE

    ;IFMSK       nolgt_3, dict_0_g_lightStates, LIGHT_STROBE_MASK
    VAR_BASE_OVERRIDE VAR_BASE_GLOBAL
    IFMSK       nolgt_3, beacnt, 09999h
    BGL_LIGHT LIGHT_STROBE, 0.232, 0.516, -0.208, 40, 0.60, 0.40, 0FFFFFFFFh, 0.000000, 0.000000, 1.000000 ; source poly num = 3
    nolgt_3       label BGLCODE

    ;IFMSK       nolgt_4, dict_0_g_lightStates, LIGHT_STROBE_MASK
    VAR_BASE_OVERRIDE VAR_BASE_GLOBAL
    IFMSK       nolgt_4, beacnt, 09999h
    BGL_LIGHT LIGHT_STROBE, 0.156, 0.516, -0.102, 40, 0.60, 0.40, 0FFFFFFFFh, 0.000000, 0.000000, 1.000000 ; source poly num = 4
    nolgt_4       label BGLCODE
    BGL_RETURN

Save the file and then run the REILstrobe.asm (not the _0.asm file) thru the BGLC9 compiler. You should get a BGL file as output. Delete the REILstrobe.mdl file and then rename the REILstrobe.bgl to REILstrobe.mdl.

Open up the XML file and place the mdl file at the lat/long you want it and then run the XML thru bglcomp compiler to get a new REILstrobe.bgl file. Put the .bgl file into your scenery folder and you should be good to go.

Now, the only thing I missed was my end solution to my original problem. I had to place the units in pairs for them to blink together, I'm not sure why that is...to get them in pairs, you'll need to do that in Gmax before you export and then just tweak the _0.asm file the same way, just with 8 individual changes, instead of 4 as shown above.

Here is the end result of my lights...you'll see they are pretty bright, even in the day time.
Posted Image

Hope this helps! Again, if someone sees something that could have been done differently, post it here and maybe I can learn something too!

#5 mobisone

mobisone

    Commercial Pilot

  • Members
  • PipPipPipPipPip
  • 1,934 posts
  • Location:ALASKA

Posted 19 June 2007 - 03:53 PM

what effect did you use for the lights that run the length of the runway?  >>the white lights

#6 Fredneck

Fredneck

    Passenger

  • New Members
  • Pip
  • 6 posts

Posted 20 June 2007 - 07:03 AM

No effects were used in my lighting. What I mean is that the lights are not using the *.fx file types for any of the final results. I use the BGL lights for my airport lighting.

I used BGL styles lights for :
1) the runway strobes (use the LIGHT_STROBE_<some name> method)
2) the runway end (the red/green lights) - use the LIGHT_NAV_<some name> method on the material, like in my "tutorial
3) runway edge lighting (use the LIGHT_NAV_<some name> method)
4) Miscellaneous obstruction beacons on antennas and such (use LIGHT_NAV_<some name> method)

Some things to remember: You need to keep some other factors in mind when doing lights.
Direction:
a) If you want lights that are seen all around, then the tutorial above is very similar to the method you should use for these type of lights...they don't specify any particular direction. The light strobes (no 1 and the tutorial) are meant to be omni-directional meaning seen from all directions so just adding the lights to your model will make them visible all around the airport.
:lol: If, on the other hand, you need a light only visible from a certain direction (like PAPI lights) then you need to add one or more separation planes to limit the plane of vision for the lights. The runway end lights and edge lights are set up to be viewed all around but depending on the angle at which you view them, the color will vary. For example, the runway end lights are green when on approach to the runway and are red if you cross them and look back...which means that when looking at a runway on approach, you'll see green lights at the close end of the runway and red at the far end. The runway edge lights are generally white. On runways with medium intensity or high intensity runway lighting (check your airport information sources for this information), there will be "caution" lighting at the far ends of the runways - you land and will see yellow lights instead of white toward the end of your landing to warn you the runway is ending. The rule as I understand it is, the last 2000 feet or 1/2 of the runway, whichever is less, will have these lights. The light itself is a single pole with a lense that is white on the one side and yellow on the other. You need to use a separation plane to separate the planes of view so you see the yellow or white depending on the direction you are looking at them. Look around on this forum or on fsdeveloper.com for more information about separation planes.

Color:
The color of the lights can vary and can be set by you....in your gmax model, when you set the LIGHT_NAV_some name> material on your object light, the color you set in the Diffuse area is only for reference and may not be final color you use. When you tweak the _0.asm code you can change the color to whatever you want; you just need to know the color and find the hexidecimal coding for it....for example, white is 0FFFFFFFFh. There are websites out there that will give you a color chart of the coding to use for different colors...I recommend find one or more of these charts and playing with the colors to see what works best for you for different situations and types of lights - hint, adding more than one light on top of each other and having mixed colors on the lights will cause the light colors to blend with each other - found that out when I did't have a good sep plane on my end lighting, green and red make yellow!

Again, anyone - feel free to correct me on anything I post here. I am new to this as well but have been learning and using these methods for my own projects.

#7 Pilot_recruit

Pilot_recruit

    Private Pilot - IFR

  • Members
  • PipPipPipPip
  • 740 posts
  • Location:Viet Nam

Posted 08 February 2009 - 10:29 PM

Hi Fredneck, thanks for the useful tutorial ^^"
I'm on my way with the light .
I have a question, what kind of BGL light do you use for "rapid approach light" ??? A strobe light ???

#8 flyhalf

flyhalf

    Orville Reincarnate

  • Moderator
  • PipPipPipPipPipPipPip
  • 7,567 posts
  • Location:Sydney, Australia

Posted 09 February 2009 - 03:29 AM

Any of you guys found how to make the BGL light PAPI's any brighter eg visible from more than say 3 miles?