Flight Unlimited III high resolution terrain processing workshop

noncommercial FU3 support page - just to keep FU3 flying !

BGL2E converts static models from MSFS BGL format to FU3 E format


Differences between the 2 worlds

In the MSFS world static models used in scenery are defined in .bgl files. In the FU3 world models are defined in .bin files each and placed into the scenery using FLED. The position of the models are then stored in .mod files. In both worlds bitmaps are used as texture for the models. Before FU3 .bin files are built using the BSP compiler the model must exist as source in a .e file. One BGL Object can be converted into a FU3 model in E format.

BGL files contains a lot of objects. If the bgl describe a scenery, many objects are repeated so a large part of it is unusable for the FU3 designer. In each object TransformCall, RotatedCall ... define the placement of a part of the model. The part data are placed after the given Label as a Points tabulation, Bitmap reference or RSGBColor and texture polygons or just polygons until Return. After all labels there is a EndA terminating the object. Then a new object begins.

There is another sequence of data defining a FU3 model, first is the tabulation of all material used, assigning a number to it. Bitmap name or RGB value for the solid color and the double side option of the surfaces are set here also. Then the Part Loop is started. Definition of each BGL Label is a part going from BEGIN to END until End Of File. The Part label is set to the corresponding BGL label. First tabulation after BEGIN are the points, then the triangles of the part with the used material and at last the tabulation of texture coordinates. Once added it is not possible to delete a material but uncheck the material when no longer used and it will not be exported to the E file.

MSFS deassembled BGL structure
    
FU3 E structure
; ----------------------------------------
; Object # 142, offset: 0x28930 size: 1188 bytes (0x04A4)
;; Lat: 0004EEBBCh Lon: 004B50782h
; ----------------------------------------
Area( B N46:32:28.53 E006:37:09.93 22 )
        IfVarRange( :  0346 2 5 )
        PerspectiveCall( :L028952 )
        ShadowCall( :L028952 )
        Jump( : )
:L028952
        RefPoint( rel :L02897C  0.25 N46:32:28.54 E006:37:09.93
                V1= 3000 V2= 0 )
        RotatedCall( :L02897E   0   0 340 )
:L02897C
        Return
:L02897E
        TransformCall( :L028A1A 20 0 0
                  0 0000   0 0000   0 0000 )
        TransformCall( :L028B1E 48 28 0
                  0 0000   0 0000   0 0000 )
        TransformCall( :L028B1E 18 28 0
                  0 0000   0 0000   0 0000 )
        TransformCall( :L028B1E -11 28 0
                  0 0000   0 0000   0 0000 )
        Return
:L028A1A
        Points( 0
                  -80    0   -90 ;   0
                   80    0   -90 ;   1
                   80    0    90 ;   2
                  -80    0    90 ;   3
                  -80   28   -90 ;   4
                   80   28   -90 ;   5
                   80   28    90 ;   6
                  -80   28    90 ;   7
        )
        LoadBitmap( 0 6 EF 0 0 0
                lsglbuv.bmp )
        TexPoly( m 0 0 -32767 90
                    0    0     0 ; 0
                    4    0    41 ; 1
                    5  254    41 ; 2
                    1  254     0 ; 3
        )
        TexPoly( m 0 0 32767 90
                    2    0     0 ; 0
                    6    0    41 ; 1
                    7  254    41 ; 2
                    3  254     0 ; 3
        )
        TexPoly( m -32767 0 0 80
                    3    0    41 ; 0
                    7    0    87 ; 1
                    4  254    87 ; 2
                    0  254    41 ; 3
        )
        TexPoly( m 32767 0 0 80
                    1    0    41 ; 0
                    5    0    87 ; 1
                    6  254    87 ; 2
                    2  254    41 ; 3
        )
        RGBSColor(  EF 46 46 46 )
        Poly( m 0 32767 0 28
                4 7 6 5
        )
        Return

:L028B1E
        Points( 8
                  -12    0   -82 ;   8
                   12    0   -82 ;   9
                   12    0    82 ;  10
                  -12    0    82 ;  11
                    6   10   -82 ;  12
                    6   10    82 ;  13
        )
        LoadBitmap( 0 6 EF 0 0 0
                lsglbuv.bmp )
        TexPoly( m 0 0 -32767 82
                    8   18   189 ; 0
                   12   32   206 ; 1
                    9   36   189 ; 2
        )
        TexPoly( m 0 0 32767 82
                   10   18   189 ; 0
                   13   22   206 ; 1
                   11   36   189 ; 2
        )
        LoadBitmap( 0 6 EF 0 0 0
                tole.bmp )
        TexPoly( m -15913 28644 0 6
                   11    0     0 ; 0
                   13    0   103 ; 1
                   12  254   103 ; 2
                    8  254     0 ; 3
        )
        RGBSColor(  EF 87 87 87 )
        Poly( m 0 32767 0 8
                9 10 11 12
        )
        Return
EndA
 
 COMMENT{
// Object:# 142 bgl-asm to E by www.agtim.ch Date: 28 July 2005 00:23:37
}

MATERIALS{
1,"Material",,TMAP "lsglbuv.bmp",100,TRANSP 0;
2,"Material",,TMAP "tole.bmp",100,TRANSP 0;
3,"Material",,TMAP "lsmpha2a.bmp",100,TRANSP 0;
4,"Color",PHONG,RGB 46,46,46,TRANSP 0;
5,"Color",PHONG,RGB 157,116,64,TRANSP 0,DBL;
}

BEGIN "L028A1A"

POINTS{
-60,-90,0
-60,-90,28
100,-90,28
100,-90,0
100,90,0
100,90,28
-60,90,28
-60,90,0
-60,90,0
-60,90,28
-60,-90,28
-60,-90,0
100,-90,0
100,-90,28
100,90,28
100,90,0
}

PARTS{
4,N,0,  1,(0,2,1);
4,N,1,  1,(0,3,2);
4,N,2,  1,(4,6,5);
4,N,3,  1,(4,7,6);
4,N,4,  1,(8,10,9);
4,N,5,  1,(8,11,10);
4,N,6,  1,(12,14,13);
4,N,7,  1,(12,15,14);
}

PART_MAPPINGS{
0,(0.000000,0.000000),(0.992188,0.160156),(0.000000,0.160156);
1,(0.000000,0.000000),(0.992188,0.000000),(0.992188,0.160156);
2,(0.000000,0.000000),(0.992188,0.160156),(0.000000,0.160156);
3,(0.000000,0.000000),(0.992188,0.000000),(0.992188,0.160156);
4,(0.000000,0.160156),(0.992188,0.339844),(0.000000,0.339844);
5,(0.000000,0.160156),(0.992188,0.160156),(0.992188,0.339844);
6,(0.000000,0.160156),(0.992188,0.339844),(0.000000,0.339844);
7,(0.000000,0.160156),(0.992188,0.160156),(0.992188,0.339844);
}

END


BEGIN "L028B1E"

POINTS{
67,-82,28
85,-82,38
91,-82,28
91,82,28
85,82,38
67,82,28
67,82,28
85,82,38
85,-82,38
67,-82,28
91,-82,28
85,-82,38
85,82,38
91,82,28
}

PARTS{
4,N,0,  1,(0,2,1);
4,N,1,  1,(3,5,4);
4,N,2,  2,(6,8,7);
4,N,3,  2,(6,9,8);
4,N,4,  3,(10,12,11);
4,N,5,  3,(10,13,12);
}

PART_MAPPINGS{
0,(0.070313,0.738281),(0.140625,0.738281),(0.125000,0.804688);
1,(0.070313,0.738281),(0.140625,0.738281),(0.085938,0.804688);
2,(0.000000,0.000000),(0.992188,0.402344),(0.000000,0.402344);
3,(0.000000,0.000000),(0.992188,0.000000),(0.992188,0.402344);
4,(0.007813,0.867188),(0.992188,0.949219),(0.007813,0.949219);
5,(0.007813,0.867188),(0.992188,0.867188),(0.992188,0.949219);
}

END
 

Using the BGL2E converter

You can download BGL2E V1.8 676KB right here.

As always backup your files and be aware that
You are using this freeware tool and the tutorial at your own responsibility !

Preparation of the needed files

  1. From the MSFS world you need scenery zips with the bgl and bitmap files.

  2. With BGLAnalyzer available here you must convert the bgl file into a deassembled .sca file.

  3. BGLAnalyzer can output a list of all needed texture bitmap file (bmp, GIF,tga,R8, OAV)

  4. Transform the texture files using the Bitmap2000 tool from here

  5. All bitmap larger than 256x256 must be resized to this maximal size.

  6. Convert the picture to get a valid GIF file using the SanFran or Seattle FU3 Palette.

  7. Process all texture GIFs to mip using MAKEMIP.EXE or Robert's FixMip tool.

  8. Place all mip files in a work folder together with BGL2E.EXE, BGL.EXE, BGLMaker.bat and ModelView.exe from Gideon.

  9. Create a link in this folder pointing to BGLMaker.bat and rename it to "myProcess" (no trailer)

  10. Now you are ready to start your model production

  11. Call BGL2E.EXE and open the sca file by clicking the button "open from BGL".

  12. after a while all usable objects inside the bgl file are displayed as TreeView.

  13. Open the tree (click on +) to see the details of the objects.

  14. Select the wanted object by click on the object item.

  15. Above the Export to E button you will see the object number.

  16. With this valid selection just click on the Export to E button

  17. The file bgl0.e is created and using the link BGLMaker.bat is executed

  18. This will open a command window displaying messages from BSP

  19. If no BSP errors happens the ModelView.exe is started.

  20. In ModelViewer open the file bgl0.bin an take a look to the finished model

  21. move around if you see nothing in the window.

  22. rename the bgl0.bin file as an unique model name xxxxxxx0.bin

  23. Place it with the needed .mip files into the /GEN folder of the FU3 region.

  24. try it out with FLED

    What next ?

    1. If the model size is wrong you must modify the scale in the BGLMaker.bat file

    2. If it crashed, this may happen - select another object.

    3. Modify the object directly in the BGL2E TreeView and Export again

    4. Object number and OK is still a valid selection just click on export

    5. disable Polygon or Labels by uncheck and export again

    6. Modify the Bitmap name to t_anyname.bmp for FU3 transparence texture

    7. Set a RGB (Seattle) or BGR (SanFran) Color

    8. Save your TreeView Object in an archive .b2e for later changes.

    9. uncheck all unwanted object before save

    10. You can flip wrong oriented surfaces

    11. You can add a color material giving 0 0 220 for red and assign this material to a polygon

    12. Repeated parts like the 4 strings of roof windows are defined just once.

    13. Look at the repeated label, changes in the last one will affect all

      Use of the TreeView Items in BGL2E

      1. Reload your work from a b2e archive or from a sca file

      2. The first line is just a file info

      3. The Object item are the top level of a single model, Collapse to uncheck unwanted object and Expand to open the object tree.



      4. Use Check All on / off for a quick setting

      5. The File item with the children from: and to: is the hexadecimal offset of the object inside the sca file



      6. The main item Texture Bitmaps: is indicating the material count and is not editable

      7. The 7 child item of it are the bitmap file name or the RGB / BGR value

      8. The children of each bitmap name are: material number assigned to parts and the bitmap size

      9. The size of RGB / BGR color must be set to 0 or it will be treated as bitmap name and fail



      10. Click on the text of the bitmap name, the material or the size to change it

      11. you can modify the full bitmap name, but for material and size change just the numeric part of the text



      12. Here are material 2 changed to t_tole.bmp, material 3 is changed to a red color and material 4 and 5 are exchanged moving the double side material check with material 4. See results on picture below



      13. Remove a part defined by a Label from the object, just uncheck the Label and the full group is gone.



      14. To add a new Material select the object first the click on Add Material. A new material entry 128 128 128 is created, now change the color to yellow 0 192 192 and set an unknown poly to this material as result you will see it in yellow. Because it is a repeated part L028B1E you must do the changes in the last one found inside the tree. All L028B1E labeled parts are the changed by this single operation.



      15. Now we will flip the roof to the inside, check the material item of Poly L028A1A_4 to flip the side of this Polygon. This will however not work properly for each texture, but can help at wrong oriented faces.



      16. You can activate the double sided texture option for all bitmaps or all colors or both. If this option is unchecked then just the checked material (here material 4) is double sided. With a checked ungrouped option there will be 1 e format part foe each polygon generating very long e files - after BSP compilation the polygon count is about the same as for the grouped form.



      17. Parts are defined by labels as here L028A1A. A Label is a group of polygons textured or solid color. All polygons are moved to the X/Y/Z location of the label. Here all X values are shifted by +20. The name of the polygon are inherited from the label plus a sequnce number at the right.



      18. The roof window are 4 times the same object but moved to another x position



      19. Now we look inside a polygon: First is the material number and the check for surface flip. Next item is the vertex count and then the Points. Each point has X/Y/Z coordinates and the texture parameters, not pixels but % off the bitmap size.



      20. For RGB color polygon this values are set to -1. You can edit all this values, but caution just the numerical part ! A point can be referenced by more than 1 polygon and if you modify the coordinates of such a point then it will be changed in all polygons using this point ID. You can't add or delete points or children items of it. you can hide the full polygon or the full label with all his polygon uncheck the item.


        Links:
        BGLAnalyzer:     BGLAnalyzer v1.3
        Bitmap2000:        Bitmap2000


        under construction last update 30.Aug.2005

        Information: André Meystre
        back to FU3 Terrain Workshop      next to Planes for the Swiss region