česky
english
FSBox
Crashbox viewer and creator for GMAX sceneries exported using MakeMDL.
FSBox |
Tutorial |
Images
version 1.3 (10.12.2005) -
fsbox_1v3.zip (3070kB) or
fsbox_1v3nomanual.zip (160kB, without HTML manualu)
- unified data format for importu/export in MAXScript
- crashboxes export by name or by selection
- lowered memory usage
- arguments parsing corrected
- added function for scenery shadows removal
version 1.2 (10.9.2005) - fsbox_1v2.zip - your own crashboxes definition in 3dsmax/gmax, betaversion
version 1.1 (21.7.2005) - fsbox_1v1.zip - added cooperation with 3dsmax/gmax, betaversion
version 1.0 (20.7.2005) - fsbox_1v0.zip
Content:
- Reason of creation
- Basic informations about FSBox
- FSBox possibilities
- What is necessary
- Arguments
- FSBox.ms (MAXScript)
- Graphic representation of FSBox functions
- Crashboxes visualization in FS
- Crashboxes visualization in 3dsmax/gmax
- Your own crashboxes definition in 3dsmax/gmax
- DAT file conversion from old to new version
- Known issues
- Further developement
- Copyright
Reason of creation:
Objects exported from GMAX, expecially those more complex, have inaccurate crashboxes. Therefore you can experience
building crash in FS when you are e.g. 15 meters away from your building. It's extremely annoying when trying to move on airfield with crash detection on.
The reason is technology used by MS so called octtree, explained here (in Czech), as well as imperfection of export application MakeMDL.
Basic informations about FSBox:
FSBox tries to solve this bad situation by showing current crashboxes and possibility to edit them.
Everything is based on BGLC code reading and editing. There's no GUI. Intent was to make simple, purely console application, which can be easily run from batch files.
Except of console there's also script for 3dsmax/gmax, which allows cooperation with these two 3D programs.
FSBox possibilities:
-
Crashboxes visualization in FS. On the basis of input ASM file new ASM file with visualized crashboxes is created.
After compilation to BGL and installation into FS crashboxes are visible.
-
Crashboxes visualization in 3dsmax/gmax.
On the basis of input ASM file new DAT file is created. Crashboxes are visible in 3dsmax/gmax after import via MAXScript.
-
Own crashboxes definition in 3dsmax/gmax. After their export via MAXScript and few other steps crashboxes in FS will be working as you wish.
-
XML file with positional parameters of you crashboxes scenery can be created.
New XML file is created on the base of existing XML of you scenery.
-
FSBox helps with batch BAT file creation. Batch files are used for faster compilation of your ASM files.
-
Except of crashboxes processing you can also edit existing ASM file (scenery) not to cast shadows in FS.
Conditional display of scenery is planned for next FSBox version.
What is necessary:
- fsbox.exe - this program
- fsbox.dat - necessary template for ASM creation
- fsbox.ms - MAXScript for 3dsmax/gmax (all these three files are in installation package)
- bglc_9.exe (bglc.exe) - program for compilation ASM > MDL. Usage is e.g. "bglc_9.exe /mdl crashboxes.asm". Download it with this SDK. Or even better download bglc_9.exe which is more compatible with FS2004. I strongly recommend using bglc_9.exe !!
- bglcomp.exe - program for compilation MDL > BGL with the help of XML file. Usage is e.g. "bglcomp crashboxes.xml". Download here
- bglcomp.xsd - necessary scheme for XML files, included in previous SDK.
It's good to have all files (also ASM files) in one directory. It's also good to move fsbox.ms to the place, where you have scripts - e.g. C:\3dsmax\scripts or c:\gmax\gamepacks\fs2004\scripts.
Arguments:
FSBox.exe is console application, all possible arguments are described here.
fsbox.exe [/i] input [/o output] [/help] [/helpcs ] [/xml [xmlfile]] [/bat [batfile]] [/noshadow] [/maxbox [datfile]] [/noasm]
fsbox.exe [/i] input /patch datfile
fsbox.exe /convert datfile
/i input
Input ASM file with objects you want to process their crashboxes. Note that input file must be e.g. tower.asm, not tower_0.asm. Argument /i is not necessary.
/o output
Output ASM file, which will have visualized crashboxes inside.
If you decide to set output file name, argument /o before name is necessary, otherwise implicit crashboxes.asm will be used.
/help
English help.
/helpcs
Czech help.
/xml xmlfile
Creates XML file with crashboxes position same as original scenery position.
If no name set, filename corresponding to output ASM filename will be selected.
/bat batfile
Creates BAT file for easy compilation.
If no name set, filename corresponding to output ASM filename will be selected.
/maxbox datfile
Creates DAT file with crashboxes description for 3dsmax/gmax MAXScript.
If no name set, filename corresponding to output ASM filename will be selected.
/noasm
ASM file won't be created
/patch datfile
Selected input ASM file will be modified to have crashboxes of your definition. You need DAT file, exported from 3dsmax/gmax MAXScript.
/convert datfile
Converts selected DAT file created by older FSBox version to format compatible with FSBox 1.3
/noshadow
Output ASM file will be edited to cast no shadows in FS.
FSBox.ms (MAXScript):
This is script for 3dsmax and gmax, which gives you posibility to import or export crashboxes.
- Which objects to export.
by selection - selected objects will be exported
by name - all objects with name starting with "crashbox" will be exported
- Select program you are using - it is important, because together with program you also select whether the result of export will be displayed or saved to file. Gmax's MAXScript is not able to create file.
- Set correct scale.
Please pay attention to the scale setting. Value 1.0 is valid if your scale in program is set 1 unit = 1 metr.
If you are using 1 unit = 1 inch, set spinner's value to 0.0254.
I strongly recommend to check whether generated DAT file (or data showed in window od FSBox MAXScript) is right - you will see there some floating point values.
Those are position and dimension of crashbox. If there are values such as -1244, 0, 6542 and you know that your scene is only few beters big, then there is a problem with scale. Set scale to 0.0254 and ty again.
-
import - imports DAT file with crashboxes and shows them as boxes.
export - exports created crashboxes from program (3dsmax/gmax). Your crashboxes will work in FS after few other steps.
help - shows basic help
-
Message with result of import/export.
FSBox v1.3 compatible data imported
FSBox v1.2 or older data imported !!! - data were imported right if file structure was correct. But despite it I suggest to convert this file to FSBox 1.3 version (see argument /convert).
Data exported via clipboard (?) - export from gmax shows this message
Created C:\gmax\airport_crashes.dat - export from 3dsmax shows this message
Graphic representation of FSBox functions
For better understanding of how FSBox works I recommend to familiarize with steps between scenery modelling and display in FS.
File types:
- ASM - scenery source code in BGLC language (a bit like well known assembler). These files are created by export of your scenery from gmax using MakeMDL. Note that you have to have active option Keep Files in MakeMDL (otherwise only MDL will be created).
- MDL - comes up after ASM files compilation using bglc application. Also export from gmax using MakeMDL creates these files.
- XML - positional data of scenery, created by MakeMDL while exporting from gmax
- BGL - comes up after XML and MDL compilation by bglcomp. This format is used in FS.
- DAT - files for data exchange between fsbox.exe and fsbox.ms.
- X - DirectX files, it's possible to put them on input of MakeMDL instead of direct export from gmax.
Rectangles are programs, ellipses are filename extensions, arrows are conversions between file formats (especially compilations).
Crashboxes visualization in FS:
- Create scenery in GMAX and export it using MakeMDL to MDL.
- Do not forget to set "Keep Files" in Options of MakeMDL and click Start.
- You'll get two ASM files - e.g. scenery.asm and scenery_0.asm.
-
Now using FSBox create one ASM file, few examples:
fsbox.exe scenery.asm /o output.asm /xml /bat
reads scenery.asm, result with visualized crashboxes is saved to output.asm, output.xml is created on base of scenery.xml, also output.bat is created
fsbox.exe scenery.asm
reads scenery.asm, result is saved to implicitly named file crashboxes.asm
fsbox.exe scenery.asm /o output.asm /maxbox boxes.dat
reads scenery.asm, creates output.asm and also boxes.dat for 3dsmax/gmax import is created.
- Result is one new ASM file. Compile it to MDL this way:
bglc.exe /mdl scenery.asm
Compile MDL to BGL. First you need to have XML file created (by FSBox of by your self)
bglcomp.exe scenery.xml
Of instead of last two steps use batch BAT file.
- Now you have BGL file, install in FS and test it.
Crashboxes visualization in 3dsmax/gmax:
- Create scenery in GMAX and export it using MakeMDL to MDL.
- Do not forget to set "Keep Files" in Options of MakeMDL and click Start.
- You'll get two ASM files - e.g. scenery.asm and scenery_0.asm.
- Let FSBox create DAT file, where crashboxes are described.
-
fsbox.exe scenery.asm /maxbox
reads scenery.asm, creates crashboxes.dat. Also crashboxes.asm is created
fsbox.exe scenery.asm /maxbox /noasm
does not create ASM file
fsbox.exe scenery.asm /maxbox boxes.dat
reads scenery.asm and creates boxes.dat.
- In 3dsmax/gmax go to menu > MAXScript > Run Script. Search for and run script fsbox.ms
- You'll see script's window. Click import, search for your DAT file and open it.
- Now you should see crashboxes in 3dsmax/gmax. There could be scale problem with boxes - in that case delete these boxes and import them once again with scale set to another value

You should see something like this now.
Your own crashboxes definition in 3dsmax/gmax:
- Firstly you create common boxes. For easier manipulation it's recommended to put them all together by Edit Mesh > Attach.
- Run script fsbox.ms (menu > MAXScript > Run Script)
- Set few export parameters.
export by selection or by name
program 3dsmax or gmax
scale value
- Now click on export in fsbox.ms window.
When exporting in 3dsmax, one DAT file is saved. Default filename is crash_export.dat.
When exporting in gmax, result is not saved but showed (gmax's MAXScript prohibites files saving). It is good to save showed text to text file and name it again e.g. crash_export.dat
It can happen, that instead of line delimiters in "export window" there'll be only bold vertical lines or boxes. For next steps it won't have bad effect.
Fsbox.ms takes all selected or well named objects and divides them into single elements (subobjects) for himself. From box-like envelope of each element one crashbox will be created
Two elements of editable mesh must not share vertex or face, otherwise it will be evaluated as one crashbox, not two or more.
Crashboxes have their walls (faces) aligned with coordinates system of your scene, so rotation of box will affect only size of crashbox, not its orientation !!!
-
Now you need to put together new crashboxes and your original ASM file. You'll do it this way:
fsbox.exe scenery.asm /patch crash_export.dat
crashboxes from crash_export.dat will be written to scenery.asm on corresponding lines.
- Compile edited scenery.asm to BGL and test it in FS.
DAT files conversion from old to new version:
- You recognize old version DAT files by their content, which is alike one of these two.
15.9243,8.57656,26.3459,27.1573,-8.57656,-30.6221
2.63285,2.26066,2.59684,-9.15751,0.0,-5.66402
16.6287,18.2878,19.3323,-47.317,0.0,16.0739
BGL_CRASH_OCTTREE crash_end_1
dw CRASH_FLAG_BUILDING_PLANE
dw 1
real4 -77.6461,0.0,11.8585
real4 23.3186,5.17386,6.64294
dw 1, 1, 1, 1, 1, 1, 1, 1
OCTTREE_NODE 255, 255, 255, 255, 255, 255, 255, 255
crash_end_1 label word
- Conversion can be done this way:
fsbox.exe /convert crashdata.dat
- New DAT file content will look like this one:
; exported from 3dsmax/gmax
; compatible with fsbox version 1.3
32.709499,3.004010,30.690399,-26.942801,0.000000,14.750400
32.574902,1.582980,22.836100,-26.954901,3.011230,18.796801
4.845850,4.215890,12.270100,-13.152900,7.720600,1.213870
0.807644,2.980200,1.043210,-12.136400,11.242300,4.872620
2.860400,2.271490,2.086410,-38.903599,0.000000,4.103980
Known issues:
-
Export from gmax shows "Maximum string length exceeded".
You have too much crashboxes defines, their description can't be shown in script's window.
Nevertheless you can copy their description via clipboard from Listener window (key F11 starts Listener in gmax)
Further developement:
Version 1.3 debug. Conditional scenery display.
Copyright:
Usage and distribution of this utility is for free. Commercial distribution in any form is possible only with written author's acceptance.
If you use FSBox in you scenery, please write me an e-mail (to have at least some feedback).