Mdl, Bgl, Xml...

Hi all!
I am opening this new topic because of curiosity and for reason it is good to know where MS is intending to proceed. Arno wrote in another forum, that Manfred Moldenhauer is thinking about creating object BGL, now known ad MDL. So has anybody made some investigation about the difference on currently known BGL structure and the new MDL one? Is only the header of BGL/MDL different or the difference is more deep? I came also on idea that these new MDL files are more or less similar to aircraft MDL files but this is only my speculation. Does anybody have any ideas about this?

Best regards,
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Hi Goran,

The current beta version of SCASM can make placement BGL files in the Fs2004 format, so that means SCASM is an alternative for BGLComp again when making scenery.

But placing of the scenery is not all of course, we also want to make custom objects. The only tool at the moment that can make objects in the new Fs2004 style is GMax. As we all know GMax now makes MDL files for us.

By evaluating the ASM source files of these MDL files I have already gained quite some knowledge about this file format. I have also been discussing this with people like Gerrish and Dick (Rhumbaflappy).
Many of the commands used in the MDL files are still the same, there are only a few really new commands. Mainly dealing with animations and transformations. Most other code is still the same as described in the BGLFP SDK of Fs2002.
But the way these commands are used in the MDL file has a big difference. There are a number of sections in the MDL file and certain commands belong to certain sections. There is for example a Vertices (VERT) section where all points are defined and a Material (MATE) section where all materials are defined. Each of these sections has a small header.

When these MDL files are compared with aircraft MDL files, they are indeed similar. Aircraft MDL files have some additional sections that scenery files don't have (and the scenery engine can't process these either).
When we tried to place an aircraft MDL into the scenery with some XML code we also noticed that nothing showed, so I guess there are some other differences as well :).
 
arno said:
Hi Goran,
Many of the commands used in the MDL files are still the same, there are only a few really new commands. Mainly dealing with animations and transformations. Most other code is still the same as described in the BGLFP SDK of Fs2002.
Nice to hear that although I don't have any good experiences with animations in SCASM; they are rather bad and I just keep away from it. FSDS produced SCASM code using Dwx() et al. instructions can often be dangerous (for example LoadBitmap() changed with these D.x() commands). Did Manfred say anything about this too? Also I have observed nesting TransformMat-TransformEnd instructions can be hazardous, resulting in lack oof object or even FS crash.

arno said:
But the way these commands are used in the MDL file has a big difference. There are a number of sections in the MDL file and certain commands belong to certain sections. There is for example a Vertices (VERT) section where all points are defined and a Material (MATE) section where all materials are defined. Each of these sections has a small header.
VERT, MATE and probably TEXT (don't know ASM well) have adequate SCASM instructions in MaterialList(), VertexList(), TextureList() so they are already known ones. Once I have seen source of the new ASM file and at first glance the only thing I have noticed is the RIFF code in header. That is wha I am asking of difference.

arno said:
When these MDL files are compared with aircraft MDL files, they are indeed similar. Aircraft MDL files have some additional sections that scenery files don't have (and the scenery engine can't process these either).
When we tried to place an aircraft MDL into the scenery with some XML code we also noticed that nothing showed, so I guess there are some other differences as well :).
I am not surprised. Also I always wondered what are real differences between aircraft and object code. Once Louis (the author of FSDS) wrote somewhere, that he made FSDS for scenery objects and somewhere he found how small is the difference between MDL and BGL so FSDS allowed to produce MDLs as well. But I have never seen anything on this subject. But still, since the extension is the same (so much about confusions!) I thought maybe MS is thinking of joining instructions so it would be easier for FS graphical engine (code and maintenance).

Thanks again and I hope at least Rhumba and Gerrish will wrote down their opinions here.
Best regards,
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Hi Goran,

Gorchi said:
Nice to hear that although I don't have any good experiences with animations in SCASM; they are rather bad and I just keep away from it. FSDS produced SCASM code using Dwx() et al. instructions can often be dangerous (for example LoadBitmap() changed with these D.x() commands). Did Manfred say anything about this too? Also I have observed nesting TransformMat-TransformEnd instructions can be hazardous, resulting in lack oof object or even FS crash.
I think if the animations would follow this new format there is no problem anymore. Then they work exactly the same as the GMax animations. This format is very different from the animations that we use now with SCASM (created with FSDS for example).

For transformations the same is true. There is a new command that replaces the TransformMat command. So once this is all implemented in SCASM a lot of the old problems could be solved.

I agree with you that all the code with Dwx etc is not really nice. This code is mainly used because SCASM does not support the wanted commands yet. Only for the animation code you will indeed need it, because some of the animation and translation tables are just written into the BGL file like that.

Gorchi said:
VERT, MATE and probably TEXT (don't know ASM well) have adequate SCASM instructions in MaterialList(), VertexList(), TextureList() so they are already known ones. Once I have seen source of the new ASM file and at first glance the only thing I have noticed is the RIFF code in header. That is wha I am asking of difference.
No, that is not correct. Inside the VERT, MATE, TEXT, etc sections the MaterialList, VertexList and TextureList commands are used. But there is now a sort of header around these commands. These are the headers of the different RIFF sectionds and SCASM does not support these.

The biggest problem is that these headers also have a parameter for the size of the next piece of source code to follow and at the moment this can not be calculated with SCASM (because you have to do calculations with labels defined later in the source).

Gorchi said:
I am not surprised. Also I always wondered what are real differences between aircraft and object code. Once Louis (the author of FSDS) wrote somewhere, that he made FSDS for scenery objects and somewhere he found how small is the difference between MDL and BGL so FSDS allowed to produce MDLs as well. But I have never seen anything on this subject. But still, since the extension is the same (so much about confusions!) I thought maybe MS is thinking of joining instructions so it would be easier for FS graphical engine (code and maintenance).
I think you are right there. They are very similar indeed now. But it seems there are still some differences in the scenery engine and the aircraft engine, so that not all features are supported for both aircraft and scenery. Maybe that will change in the future.
 
Top