BGL Meteorological Generator
(BGLMET.EXE)

Had I written this program about four years ago, I am sure it
would have been considered a real gee-whizz type program. But
with the arrival of FS6, FS98, and now with FS2000 just released,
some might wonder why anyone would bring out a utility for FS5.1
at all. Well, some people, myself included, still only have 5.1
and this program is for us/them. I hope all those poor souls out
there still lumbered with FS5.1 get some enjoyment out of this.

BGLMET stands for BGL (as in the scenery file) Meteorological Generator.
Basically BGLMET is a program which allows you to define multiple weather
areas for Flight Sim 5.1.

How does this differ from all the other weather generators for FS 5.1 out
there ? As I said, BGLMET generates MULTIPLE weather areas. Flight sim
natively allows you three areas, BGLMET tops this with a theoretically
unlimited number of weather areas.

Sure, but aren't there are programs out there which already do that using
Flight Shop ? I don't have flight shop, so I don't know for sure. And
because I don't have flight shop, that means that BGLMET works without
flight shop. Not having flight shop I can't say if it works with flight
shop, but I have every reason to believe it will. I do not believe it will
work at all with FS6, FS98, or FS2000 - but those people have had a
plethora of weather generators which do stuff like scour the web for real
time weather. The program is a small concession to poor people like me
still stuck with FS 5.1.

History (aka Why ?)

Well why not ? While doing some scenery design about 12 months ago (if you
were curious, and you know Brisbane like the back of your hand, I was
looking at making a fully functioning MLC building) I decoded most of the
weather engine in flight sim. I then discovered that I spent all this time
decoding the weather engine for nothing, because none of it worked in FS6+.
No MLC building. But as I was decoding the weather areas, the thought did
occur to me that I could make a weather generator using the knowledge I had
gathered, and make one not limited to three areas like flight sim. Thus the
idea was born. I didn't don anything about it for quite some time, and it
was only after someone emailed me about BGLINS and I realised there were
still a few other people out there stuck with FS5.1 that I finally decided
to do something about it finally.

What it don't do (yet)

BGLMET lets you set almost everything that you can set from the flight sim
weather menus. At present the program is like an external version of these
menus. It does not create the weather from METARs, SAOs, winds aloft or any
other type of real world weather format yet. I plan to add the capability
of reading METARs, and hopefully eventually winds aloft, in later versions.
But for now, it just replicates the flight sim weather menus, with the
added twist of setting more than the three areas flight sim limits you to.

How it Works

Flight sim 5.1 natively has three weather areas global, local 1, and local
2. Whenever you are not within the bounds of local 1 or local 2, the
weather of the global area will be in effect. Effectively there is a fourth
weather section, the current weather. What flight sim does is decide on
which of local 1, local 2, or global is active, and then it copies that
weather data into the current weather area. What BGLMET does, with the help
of FSASM, is create a scenery file which hot wires the global weather
definition. Each time you enter into a new weather area, the weather
variables are updated to the new area. It is a little different from flight
sim's local 1 and local 2 weather areas. These are rectangular areas, and
while you are within them their conditions are active. When you leave a
local area, the global weather kicks back in. BGLMET differs a little in
that when you enter a BGLMET weather area, the weather is changed, but when
you leave, it stays set. In fact it stays set until you enter into a new
BGLMET area. When you enter into an area you can change the weather from
within the flight sim menus if you like.

What you Need

To run BGLMET you will need:

1)The latest version of BGLMET (naturally) but since you are reading this
file, I will take a small leap and assume that you already have that.
2)Adam Szofran's FSASM compiler (version 5 or 6).
3)If you are using FSASM version 5, and get an error referring to missing
or undefined macros (such as "IfVarRange3"), then you will also need to
get the FSASM advanced developers kit:
(ftp://ftp.halcyon.com/pub/users/zof/oldstuff/fsadk002.zip)

Just follow the installation instructions for each of these programs, and
then hopefully you will be flying !

Copyright, re-Distribution etc...

The Program and it's documentation is copyright 1999 Andrew Roach. All
rights reserved.

1)This program is FREEWARE and is provided AS IS.
2)No responsibility or liability will be accepted for any damages
resulting to person or equipment resulting from the use of this program
or files produced by it.
3)This program cannot be: a) sold for profit; b) included on compilation
CD-ROMs or any other storage media; or c) uploaded to any service which
charges a download or access fee; without written permission of the
author.
4)All resulting scenery files generated from this program, must remain
FREEWARE, and may not be distributed in any manner which contradicts
the conditions for distribution of the program as outlined in point 3

Subject to the exclusions listed above, the archive containing BGLMET may
be uploaded to BBSs and otherwise redistributed on a FREEWARE basis as long
as the original compressed archive and its contents are not modified in any
way.

If you download this program and intend to use it, I would appreciate it if
you quickly stopped by
http://www.geocities.com/aroach.geo/fltsim/bglmetreg.html to let me know
your using the program. All you have to do is visit the site (it will only
take a few seconds) and that will tick over a counter and let me know how
many people out there are using BGLMET. I will use this to guide me in
future releases/developments.

Setup

Unzip all files in this archive, and insert in your favourite repository
for programs. The BGLMET.INI file must be placed in the same directory as
BGLMET.EXE. An icon file, BGLMET.ICO is included in case you want to set it
up with windows and are looking for a pretty picture.

After copying the files to a suitable directory, it will be necessary to
edit the BGLMET.INI file. Two entries have to be edited for the program to
work. Look for the Compiler section of the INI file, and edit FSASM_Path,
which should point to and include the FSASM executable; and BGL_PATH which
defines the name and location of the scenery file you want to generate:

[Compiler]

FSASM_Path=C:\TT\FLTSIM\FSASM\fsasm.exe
BGL_Path=C:\GAMES\FS5\SCENERY\BGLINS\SCENERY\weather.bgl

Please note: I have the BGL file set permanently for a good
reason - having multiple BGLMET weather files active at the same
time could be hazardous to your frame rate, not to mention
potentially cause database errors. By keeping a constant location
and name for the BGL, then these problems can be avoided.

To make the program fully functional, you will also need to edit the
World_Vis entry in the General section, and point it to your world.vis file
(more details follow).

Other INI Settings

[General]
StartFullScreen=0

Start Full screen BGLMET in FULL SCREEN MODE when set to 1 or in DOS BOX
MODE when set to 0

Windows_3=1

When running under some configurations of Windows 3.+, JPTUI will take a
long time to initialise the screen if the program is STARTED from within a
DOS BOX. To make JPTUI initialise in a timely fashion, if Windows_3 is set
to 1, then when BGLMET is run under windows, it will be forced to
initialise as a full screen dos session, thus by-passing this problem.
After the screen has initialised you can ALT-ENTER to make it run as a dos
box if you choose - the initialisation problem only occurs during start up.

Supress_Some_Warnings_And_Auto_Correct=1

BGLMET does a number of internal checks on the weather conditions you have
nominated. It will check to make sure things like cloud bottoms are less
than their tops etc.. BGLMET can automatically correct some of these errors
(such as incorrect ordering of temperature layers). When
Supress_Some_Warnings_And_Auto_Correct is set to 1, many of the less
problematic errors are automatically corrected. If it is set to 0 then a
warning box will come up giving you the option of auto correcting,
re-editing, or ignoring the error.

World_Vis=c:\games\fs5\scenery\world.vis

World_Vis points to the WORLD.VIS file in your flight sim's root scenery
directory. This is the file which flight sim uses to decide where all of
your scenery files are located. If you don't know where world.vis is, find
the directory that FS5.COM is in, and then look for world.vis in the
SCENERY directory in the FS5.COM directory. For example, if FS5.COM is in
C:\games\fs5 then world.vis will be in the directory C:\games\fs5\scenery.
BGLMET uses the world.vis file to import the airport menu entries from all
of your active BGLs. It only reads world.vis, and as such should never
corrupt it. Don't give it a copy of world.vis, as it also uses the location
of world.vis to access some BGLs which don't appear in the part of
world.vis I use for reading menus.

Load_World_Vis_At_Start=0

When Load_World_Vis_At_Start is set to 0 (the default), the airport menus
will only be loaded into memory if you specifically search for an airport
name, or browse the airport menus from within BGLMET. It is sort of load on
demand if you like, but they will be loaded ONLY ONCE a session, which if
set to 0 will be the first time you try to browse or search for an airport
name. When Load_World_Vis_At_Start is set to 1, then the airport menus are
loaded an initialised at the start of the program. This just increases the
load time a little. If you always will use the airport entries to set
locations, then you might want to set it to 1. If, you usually set the
locations absolutely, setting it to 0 may suit you better.

[Defaults]

The Defaults section contains predefined values for some of the weather
dialogue entries.

range=10000

The range is the radius of the weather area's activation zone. It is
measured in metres, and can be between 1 and 32768 m.

pressure=1020

Barometric pressure default value. Legal values range from 847 to 1185
millibars.

baro_drift=0

Barometer drift 1/0 - on/off.

visibility=64

The visibility/haze factor in statute miles.

[Storms]

The Storms section lets you customise the way storms are generated from the
cloud menu. Flight sim allows you to have three cloud levels - just as long
as the last one is a storm cloud. When you set up a storm (called
cumulonimbus in flight sim) from within flight sim, parameters such as
turbulence and icing are automatically defined, and limits are placed on
acceptable values for turbulence. The settings in the Storms section let
you customise how BGLMET will handle storm generation.

override_limits=0

If override_limits is set to 1, then all the entries in the Storms section
are ignored, and you can set up the storm clouds any which way you like.
Interestingly, flight sim will let you set them up pretty much any way you
like as well. Even though the flight sim weather menu wont let you do some
things such as have a non-turbulent storm cloud, flight sim itself will.
The range checking must be done at the menu level, and therefore BGLMET can
be used to by-pass it. When override_limits is set to 0, the menus in
BGLMET will behave like those in flight sim - presenting you with realistic
limits on how you can set the storms parameters.

max_turbulence=8

Turbulence is measured from 1 to 8, with 1 being none/low and 8 being the
max. max_turbulence sets the upper limit.

min_turbulence=4

Turbulence is measured from 1 to 8, with 1 being none/low and 8 being the
max. min_turbulence sets the lower limit.

turbulence=8

The default value of turbulence to be set in the storm dialogue.

icing=1

Controls if the in cloud icing box is by default check marked (1) or not
(0).

Usage

The program can be either run from under windows or from a DOS prompt.
There are no command line arguments to the program. I have used Jean-Pierre
Delprat's JPTUI text based windowing system
for the user interphase. Anyone who has
tried my BGLINS program should recognise the interphase. Hopefully it is
easy enough and logical to use, but just to set you straight, here is a
quick run down and a menu by menu description of the program.

The MetArea Window

After you dismiss the about screen which comes up on running the program,
the MetArea window will open. It looks a little like this:

The centre of the window has a list of the defined MetAreas. Under this are
six buttons which control the program for the most part.

ADD - will insert a new weather area below the highlighted entry, or if the
last MetArea is highlighted, it will add a new entry to the list. After
clicking on the button, the Edit window will open up.

EDIT - allows you to change some (or all for that matter) of the parameters
of an already defined weather area. After clicking on the button, the Edit
window will open up.

COPY - allows you to create a new MetArea, copying all the weather
information from the area highlighted when selected. All weather sections
apart from the Location window's contents are copied. After clicking on the
button, the Edit window will open up.

DELETE -deletes the current MetArea.

CANCEL - same as quit.

GO - is the same as the generate function in the menus. It has two
functions. Firstly it makes a FSASM (*.FSA) file with the weather
information in it. Next it will attempt to compile it with FSASM. After a
successful compile, it will remove the source file.

The Edit Window

The Edit window is divided into five separate tabs/sub windows, each with a
different theme.


Location Tab

The location tab has all the information about the location of the weather
area. Weather areas are basically circular. Unlike flight sim where the
weather of a weather area is active only while you are in the area, BGLMET
weather areas work a little differently. When you fly into a weather area
the weather is set. It will remain set after you leave the area, and will
stay active until you enter into another weather area which will then reset
the weather.

The Label is an optional label used to identify individual weather areas.
At present it does no more than separate them in the window. Eventually it
may be linked to ICAO codes for METAR importing or something like that. Who
knows ????

The latitude and longitude are entered in decimal degrees, and define the
centre of the weather area.

Weather activation range is basically the radius of the weather area (which
is circular remember). It is measured in metres and ranges from 1 to 32768
m. For people who no-speak-the-metric, metres = feet/3.28.

There are two buttons in the Get Location Frame, namely Browse Airport
Menus, and Search Airport Database. Both of these functions search the
airport menus of your scenery files to get locations, which are then
entered into the latitude, longitude, and label dialogs of the location
window. They both use the same data, only they access it in different ways.
The Browse Airport Menus function will present a list of regions and the
airports located withing them. It is very similar to the "Airports" menu of
flight sim. Search Airport Database is a free text search which goes
through the airports, and returns all matches to the search criteria. The
search is case insensitive.

Clouds Tab

The clouds tab is divided into three sections: Layer 1, Layer 2, and
Storms, each accessed by a sub-tab. Flight sim allows only three cloud
layers, and if you define all three, one has to be defined as a storm. The
BGLMET windows reflect this limitation. Most of the window is pretty
self-evident, but one thing to point out - turbulence of 1 really means no
turbulence. Turbulence is also a decimal, so fractional values between 1
and 8 can be entered.

Winds Tab

Flight sim allows four separate wind layers, three of which can be at
altitude, as long as one is a surface wind. As with the Clouds, the Winds
are set from sub-tabs.

Temperature Tab

Flight sim supports up to four temperature layers. Temperatures are pretty
weird in flight sim, and deciphering how flight sim handled temperatures
was one of the more challenging parts about writing BGLMET, so I will give
you a few tips. While you can have four layers, I would highly recommend
keeping layer one with an altitude of 0 ft. Flight sim will let you do
other stuff, but odd things can happen when its more than 0 ft. Only layer
one should really be 0 ft. Flight sim itself will sort the layers around
and try and make ant 0 ft layer equal to layer one if necessary, this
usually (but not always) works. BGLMET will warn you about doing this, and
will do so itself if you let it.

To turn off a temperature layer, set its altitude to 0 ft. Only layer one
can have an altitude of 0 ft.

Flight sim lets you set temperatures from -75°C to +95°C. I understand that
at altitude -75° is quite expectable, but +95°C ??? Show me a place on
earth with temperatures like that ! I think the world record is 58°C, so
why flight sim lets you go to +95°C I do not know (green house gone mad ?),
but it does. I mean, the av-gas in your tanks would have evaporated by
then, not to mention numerous things on the plane probably melting. BGLMET
will let you set the temperatures this high if you want, but I seriously
doubt you will get any planes airborne at these temperatures.

Vis/Pressure Tab

I probably should have called this the other tab, because it is everything
which does not fit anywhere else. It does have the visibility and pressure
in it, but also day/night temperature variation. Basically I only
discovered how to encode the day/night temp variation after I had written
most of the UI, and I could not be particularly bothered redoing the whole
temperature window to make it fit. Besides, there was room to kill in the
Vis/Pressure tab, so it went here. Only point to make here is that
visibility is measured in statute miles. Why ? Because that is what (for
some odd reason) flight sim natively expects internally. Interestingly it
is the only thing in the entire flight sim engine I have ever seen which
accepts imperial values - even though altitude in the international flying
world is measured in feet, flight sim stores in metres. So why visibility
should be stored as statute miles I do not know. But it is.

Menus

File

Load - loads a BGLMET file into memory.

Save - writes the define weather areas to a file. Suggested extension is
".MET"

Generate has two functions. Firstly it makes a FSASM (*.FSA) file with the
weather information in it. Next it will attempt to compile it with FSASM.

Quit. Do I really have to tell you what this does ?

Edit

Clear removes all waypoints from memory.

Insert/Add will insert a new weather area (MetArea) below the highlighted
entry, or if the last MetArea is highlighted, it will add a new entry to
the list. This is functionally the same as the Add button.

Delete deletes the current MetArea. It is functionally identical to the
Delete button.

Edit allows you to change the details of a MetArea. It is functionally
identical to the Edit button.

Windows

About - pretty self explanatory !

Reset DOS Box will configure the program for running in a DOS WINDOW within
windows. This means using the standard font, and the windows mouse driver.

Reset FULL Screen configures the program for running on a FULL SCREEN under
windows, or as a program run from DOS. In the setup the program uses a
custom font and a graphical mouse driver. This mode is not compatible with
a DOS WINDOW, and if run in a DOS WINDOW will result in garbage displayed
to the screen, and poor (if any) mouse tracking.

Refresh Display will re-draw the screen. Use this option, or its keyboard
equivalent (CTRL-HOME) if the display should become illegible.

Preferences Brings up the preferences dialogue (not implemented yet)

Help is ghosted, and unless a small miracle happens, will stay that way.
Not yet implemented.

Wish List / The Future

I want to add the ability to import the following real world weather
formats eventually:

* METARs - very high priority
* WINDS ALOFT - medium priority
* SAOs - are these used any more ? Low priority.
* TAFs - is there any advantage to TAFs over METARs ? If there is,
someone let me know. Otherwise a low priority.

I don't know if anyone wants it (I don't know if I want it) but I might add
menus to predefine cloud types like in flight sim (i.e. cirrus, altostratus
etc..) At present al the clouds set by BGLMET are effectively of "user
defined" type. If people want this feature, drop me an email letting me
know and I will see what I can do.

Known Bugs and Quirks

Load Error - No DMPI

BGLMET is a 32-bit dos application and requires a DMPI server to be loaded
and operating. If you run the program from under windows there should be
one running. If you run the program from DOS, you may not have one running.
If you should get an error message on start-up reporting that no DMPI
server could be found, it is time for you to get one. The easiest way to do
this is to download CSDMPI3B.ZIP which is a free DMPI server available from
your local SimTel mirror in the
????gnu/djgpp/v2misc/csdpmi3b
directory. What the ????? equals depends on which SimTel Mirror you happen
to visit. For example you could try are:
ftp://ftp.digital.com/pub/micro/pc/simtelnet/gnu/djgpp/v2misc/csdpmi3b.zip

Program slowing down or stopping when run under WIN3.+

This is to do with windows refreshing using JPTUI. With me, 99% of the time
it happens when the program is firs run. Occasionally it will happen (if
memory is low) at other occasions. The quickest way to fix it is to
ALT-ENTER and then ALT-TAB the window to a full screen dos session to fix
it up.

Program Crashes after Load Error

If you ever try to load a file, and get any sort of an error message, if
the computer doesn't crash or lock up once you dismiss the error message, I
strongly recommend you to exit and restart the program. Loading errors
indicate something has gone wrong (they would not be errors otherwise would
they ?), and basically with BGLMET they usually end up being fatal. I have
not tracked down why some result in the computer crashing immediately, and
others crashing minutes later (and still others never), but it is this very
unpredictability which is why I suggest if you get a load error, you just
restart. I have kept them classified as non-fatal errors waiting for a time
when I can fix this one.

dj00001.fsa(13): Fatal error: Undefined record or macro name 'ifvarange'

If you get any errors when FSASM is trying to compile referring to
undefined records or missing macros, if you have installed FSASM 5, make
sure you also install the FSASM advanced developers kit from
ftp://ftp.halcyon.com/pub/users/zof/oldstuff/fsadk002.zip.

Unknown Bugs

Well if I knew what they were, then they would be reported in the Known
Bugs section, wouldn't they ? If you should happen to find a bug with this
program, please send me an email letting me know
what it was, and how it happened. Don't forget to include what version of
flight sim you were running, and what version of FSASM you were using.

Credits

Adam Szofran for his excellent FSASM scenery assembler.

Jean-Pierre Delpra for writing, and help with using, his JPTUI text based
windowing system.

Comments/Suggestion/Feedback

I welcome all your comments about this program, and encourage you to email
me. I wrote this program for myself, but figured that someone else out
there might like it.

All comments to:
aroach@geocities.com

Remember, if you are going to use this program, and would like to see
future upgrades - let me know you use it by stopping off at:
http://www.geocities.com/aroach.geo/fltsim/bglmetreg.html

If you would like to be notified when future versions of BGLMET are
released, just give me your name and email address and hit send, and I will
add you to a list.

Your name: Your Email address:
What is your home town and country ?

And finally, there is my obligatory WEB page. Nothing flight sim like on it
yet, but there are some cute airshow pictures:
http://www.geocities.com/aroach.geo/
http://www.geocities.com/aroach.geo/airshow.html