• Guest Please check out the Help Wanted thread in Ickie's NewsHawks.
    The future of the Outhouse depends on you!
    Help Wanted

A question about CFS2 and gmax

rhumbaflappy

Charter Member
Hi all.

What is the export process you use for CFS2 aircraft?

I ask because I've found I can use a makemdl.cfg file to produce the mdl:

Code:
[Settings]

[Options]
Debug=1
KeepErrorLog=1
Keep=0
Optimize=0
FS8=0
CFS2=1
[Scenery]

If Keep=1, then ASM code is kept... it is not CFS2 code, but FS2002 code. Optimize=1 turns on code optimization. FS8=1 turns on FS2002 compilation, but CFS2 should then be set to 0.

Is this what others have found?

Dick
 
Hi Dick, I use the MakeMDL version 8.0.0.20403 from the fs2002 sdk, I start it with a shortcut containing the following switches on the target line.
Code:
 /cfs2 /fs8- /dll /debug /fullmat /softmat /specularcanopy
(goes after \..\makemdl.exe)
This gives me more options on the MakeMDL options tab.

I also use MDLCommander V1.03 by Doc Moriarty, it is a plug-in that gets inserted in the export chain between FSModelExp.dle and MakeMDL.exe, it enables the capture of raw .x files which can be combined with MakeMDL as a separate process.
When I have my model constructed in GMax including low LOD verions shadow model and VC model, I "export selected" each model saveing and renaming the .x file each time.
Then I run MakeMDL with the shortcut above
On the LOD tab I point it at the saved .x files; LOD values can be tweaked by adjusting the name of the .x file.

modelname_100.x
modelname_50.x
modelname_10.x
modelname_shadow.x
modelname_interior.x

Point MakeMDL to the first .x file and it should fill in the rest automatically,

On the options tab check CFS2 and Keep Files, the assembler will be saved; there Will be a header modelname.asm which will contain the call to a CFS2 model header, there will be an asembler for each sub model.

You don't actualy need the assembler files unless you like hand editing stuff. ( I like comparing bglc* assemblers and scasm files ;-) what a nerd..)
*((MakeMDL contains a version of BGLC))

This is the only way I know of constructing CFS2 style multi LOD models in which each level of detail has its own vertex list.
 
Rhumba,

Simonu,

Absolutely fascinating information. I have been trying to figure out cfs2 lod exporting.

Any other tidbits you fellows want to share?



:salute:

tobob
 
Good CFS2 planes require much more carefull attention to part naming and linking.
Try to build a complete parent child structure. The FS2002MakeMDL sdk explains all this and details all the recognised part names.
Levels of detail are essential for CFS2 because we want to use the planes as AI/multiplayer as well as flying them our selves.
There are two approaches to levels of detail

In FS stock planes the level of detail is per part
In gmax this is done by including LOD_value in parent part names.

So a simple Part structure might look like this
(in the gmax "select by partname" tool, ensure "display tree" is checked or you wont see any structure at all, just a list of part names)

Code:
anyplane
    anyplane_LOD_100
        fuselage
            r_wing
                r_aileron
                r_wingtip
            fuselage_aft
                r_horzontal
                    r_elevator
                vertical
                    rudder
    anyplane_LOD_50
        fuselage
            r_wing
                r_wingtip
            fuselage_aft
                r_horzontal
                    r_elevator
                vertical
                    rudder
    anyplane_LOD_20
        fuselage
            r_wing
            fuselage_aft
    anyplane_LOD_10
        fuselage
What this achieves is the entire structure of LOD models gets drawn from a single Vertex list.
The vertex list gets loaded into the video ram when the model is loaded.

CFS2 stock planes use a different approach
The Models can be consructed in Gmax just the same as above excepting the parent parts do not get LOD_value in their part names. Create a named selection for each level of detail, then instead of exporting the entire LOD model structure in one go, each level of detail is exported separatly using "export selected", This is were capturing the .x file with model commander comes in. I know of no other way to do it. This technique is refered to in the FS2002 MakeMDL SDK as discreet LOD.
The upshot of this I think (but would accept corection from one who knows more) is either
Each level of detail gets its own vertex list
and this makes the model perform better when it is used in formations.
or
since there is a limit on the size of a vertex list that can load in CFS2
(which was built to run on win98)
it also enables LOD modeling to be combined with very detailed models.

This may also explain why there is a slight jump in CFS2 stockers when the LOD changes and a new Vertex list gets loaded to the video ram

Do not bother adding lights to planes for CFS2 they crash the AI engine.

Ive attached the plugins and reference docs, be sure to read and understand the instructions for setting up MDLCommander.
 
to ease the process of capturing the .x files and manualy assembling them in Makemdl
I start by creating a project folder called "export to here"
in this I create a dummy model, (an empty txt file named model.mdl)
* it saves typing in the save as dialog
then I create the parameter file for MDLCommander, a text file named model.par
containing the following
Code:
# these are parameters for exporting my aircraft
# -b       shut up (batch)
# -keep    keeps all intermediate files .asm and such   n.b.  no .asm if +nocompile
# -i       ignore warnings
# -i8-     do not ignore bad triggers (might be important for stock anims)
# -in-     do not ignore bad normals
# -viewlog view logs in case of error (only if -b deactivated)
#-b
-i
-in-
-i8-
-keep
-viewlog
+savexfile
+nocompile

I also add my shortcut to MakeMDL with those switches set in the target.
( note that the MDLCommander installation procedure involves renaming MakeMDL.exe to mkmdl.exe; MDLCommander.exe then gets named makemdl.exe: so my shortcut actualy points to mkmdl.exe in my plugins folder! )
Keep this set up as a template for repeated use in different projects.


Now when I have parts in gmax selected I export selected to my folder.
Export as an aircraft (even if you want a scenery library object)
Opt to overwrite the dummy model.mdl
the files model.x and model.log will appear in the export folder. model.mdl will not have been overwritten. Rename model.x to myplane_LOD_###.x

go back to gmax and repeat with the next lod selection
dont forget to add a shadow model.
and an interior

the sdk says that .x file names do not need LOD_ ### just the value as
myplane _###.x

when I have my .x files collected they could be named thus

myplane_100.x
myplane_066.x
myplane_033.x
myplane_010.x
myplane_shadow.x
myplane_interior.x

now start mkmdl with the shortcut
on the main tab point the choose any of your .x files for input
for the output type in the name for your finished model
model type is aircraft even for library objects
on the LOD tab check every thing is in order
on the options check CFS2
for library objects, check "keep files" to save the bglc assemblers
click start


I select aircraft model for library objects because that way the scale works out right.
I found this out the hard way
I was sure I had done all correctly
but no object could be seen
this went on for days
it was there
just tiny
 
Brilliant!!! :jump:

Thanks for the files and particularly the wealth of information. I have been working on a project for cfs2 but was unsure what the details of the sim were. It may take me a bit to get a hold of it all. I have a few questions...

then I create the parameter file for MDLCommander, a text file named model.par
containing the following

Where does the par file go?

I also add my shortcut to MakeMDL with those switches set in the target.

How do I set the switches in the target shortcut?

go back to gmax and repeat with the next lod selection
dont forget to add a shadow model.
and an interior

Could you explain the shadow model in more detail?

My guess would be that it's a simple silhouette model like a LOD 10, obviously used by the sim to create a shadow of the aircraft. I thought this was automatic for any object?

Tobob
 
Ok I got it. What i did was right click on the shortcut and opened properties. Then add the following code at the end of the target line-

/cfs2 /fs8- /dll /debug /fullmat /softmat /specularcanopy

I wonder if these options work for the fs2004 gamepack?

Also after reading the MDLCommander help I found that the par file goes into the "export to here" folder simonu explained above. I guess I was a bit confused. :confused:

Thanks again simonu!


 
re LODs and shadows,
I think I remember reading that shadows are projected through the lod model that is 1 level less detailed than that showing; this is automatic assuming such a LOD model exists.


sometimes per part LOD models have shadows with parts missing
sometimes shadows of canopy make holes in the shadow !

as you say a version of the LOD 10 model makes a good shadow
setting a shadow model over rides the auto function and speeds up the drawing of the shadow

don't think those switches work on any other version of MakeMDL
I'm sure I would have tried but don't remember,
I do remember some confusion about that, there is no mention of the CFS2 option in the FS2k2MakeMDL sdk
it is mentioned in the fs2k4 sdk but doesn't work with that version ???
 
Back
Top