Sign in to follow this  
rhumbaflappy

BGLComp, Library Objects, and MDL

Recommended Posts

Hi all.The new format for Objects in FS9 is based on the MDL format and is a RIFF structure.BGLXML 0.30, by Alessandro G. Antonini can be used to extract the MDLs of the various object BGLs.For example, in the asiascenery folder, there is a small bgl named "Beijing.bgl"This BGL contains the ModelData for the Forbidden City, the MDL code, and a placement code. If I want to place the Forbidden City in Delavan Wisconsin, this code format won't allow me to place it there, as the Library GUID is "hidden" in the BGL... "Beijing.bgl" is not an object library, even though it contains the ModelData. Object Libraries must contain ONLY ModelData code ( and the MDLs )... no placement code. This is what locks a GUID to a small area.By extracting the MDL and XML code, we can reuse the MDL and it's textures to make new XML code.The best way to reuse the MDL and texture code is to create new Object Libraries:<?xml version="1.0"?>This code reuses the extracted MDL ( and reuses the same GUID ), to make a library object BGL. The Library BGL now contains the MDL code.Here's the placement BGL for the new Library Object:<?xml version="1.0"?>Note that you need to search the MDL for the right bitmaps with a hex editor ( search for 'bmp' ), and place them in a 'texture' folder twinned to the 'scenery' folder. This code doesn't contain the MDL code... it only calls it.If you desire to force a MDL to be placed ONLY locally ( as most of the default objects are in FS9 ) then mimic this code:<?xml version="1.0"?>Note the Modeldata is coded first, followed by the placement. Now this code is like the original, in that it contains the MDL code AND places it immediately. I believe the GUID is also then "local" and the numbers could be reused in other local applications... not that I recommend that, but that there should be no need for worry about the GUID number locally.So this is how MDL code is contained within a BGL, if you do not desire to make a separate library BGL, and wish the object to be local.Dick

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Hi DickCan you use any .mdl file eg from cfs2?or are they different?regards Sly

Share this post


Link to post
Share on other sites

Hi Sly.The format is different from all previous MDL files. :(We need to wait for the FS9 MakeMDL SDK to get the Gmax plugin we'll need to make our own MDLs...Once we understand the file structure, it may be possible to convert older MDLs as FS9 scenery MDLs.The new way of doing this will force FSDS, EOD, etc... to play "catch up" in order to conform to the new object MDL format. Microsoft doesn't appear to be too enthusiastic about non-Gmax created scenery objects. I don't expect them to divulge any object secrets. And I don't expect them to be too supportive of any "tweaks" we may need to use for the Gmax objects... such as conditional appearance parameters. These need to be in the MDL, as BGLComp just places objects or creates libraries... with no conditional elements like time of day, or wind direction, or always facing aircraft....Dick

Share this post


Link to post
Share on other sites

Hi Dick Thanks for quick reply .......confirmed my worst fears lolThe reason for my query was that I am desperate to get a WW2 Carrier into FS9 (CV8 Hornet)....landable.The CFS2 model works fine as a flyable aircraft (which is acceptable) but try as I might a can't get a hard deck in place. The carrier always sits on top of the invisible landing surface......Any ideas/ suggestions... for my purposes the carrier would be static ie game paused on a seperate machine via LANRelative newb I'm afraidRegards Sly`

Share this post


Link to post
Share on other sites

Hi Sly.If the carrier is to be static, then you could perhaps make a landable surface with an invisible XML runway or as a SCASM-coded zero-height advanced building. Either method can create a hard, suspended surface in space.Dick

Share this post


Link to post
Share on other sites

Hi Dick.. First, Thanks for your well wishes, re my recent surgery. In following your 'incessant nagging' about needing to do all the exercising to strengthen the old cardiovaxcular system, I've already gotten about 70% of "manifold pressure" back and am now at the point where I can again start paying proper attention to your researach announcements again.IMHO, You are the most respected contributor to this art and this thread is a perfect example of that. It appears to me that with the info here and a new (reliable) MDL.sdk, that scenery designers (could) soon be 'rolling their own' objects in a new and better way.One thing that worries me though is the fact that we're always going to be 'at the mercy of an imperfect union' between the 3DSM people and MS -- and I don't see any way around that unless an open source modeling program and game patch could be developed that would always work with MSFS; Some dream, Right?Enough whining! We go with what we've got until something better can be done.Thanks for your hard work in finding these breakthroughs...J.R

Share this post


Link to post
Share on other sites

Hi J.R.I'm glad your ticker is good for another 100,000 miles. :)Looking forward to my first heart surgery. I've made libraries of all the "locked" objects in the default BGLs... but I need to think out the problem if I post them as freeware to the various file libraries. I don't know if MS would be offended, amused, or unmoved by my "freeing' their MDLs.I do like the idea of being able to place their objects wherever I want. And MS did include a "LibraryObjects.xls" that lists many objects we couldn't access otherwise. So, maybe they wanted me to free the objects. Or maybe it is a bug that needs fixing. An example is the "Cairo.bgl"... the default is an object library, but the objects are locked to a small geographic location. They aren't locked as the above example is, but use a different means of restricting them in the Library code. Extracting the MDL files, and recompiling them as "Cairo_Library.bgl" now frees the objects to be placed anywhere. My 'C:Program FilesMicrosoft GamesFlight Simulator 9SceneryAfriscenery' folder now has "Cairo.bgl" and "Cairo_Library.BGL" and "OB9AFRI0.BGL" and "OB9AFRI0_Library.BGL"... the GUIDs are redundant, but it doesn't affect the sim at all, and placing the new libraries with their source BGLs lets them share the textures properly.http://forums.avsim.net/user_files/62824.jpgRest and exercise... rest and exercise... rest and exercise... Dick

Share this post


Link to post
Share on other sites

I believe the main reason that the files include a geographic limitation is to restrict the number of files that must kept open by the application. The more files that must be opened, the more memory required, and the greater the potential for poor performance. "Freeing" the models may result in poor performance, depending on how many you decide to do.

Share this post


Link to post
Share on other sites

Hi t.I don't think that would have anything to do with this. We're talking only a few dozen files... perhaps 20Mb in size ( less than some addon meshes ).On my system, there is zero fps hit or drag on system performance. I have the complete 'unlocked' set of Library objects active right now... redundantly along side the default ( restricted ) library BGLs ( sharing the same GUIDs for the objects ).( As you can see from the frames/sec in the jpeg... 169.7 )MS didn't seem concerned about FPS hits when it introduced vector autogen and placed thousands of telephone poles near detailed airports.Who knows why MS would restrict them to a small geographic location? Perhaps because nobody told them not to to that!There is no good reason for copy of the Sphinx to be in a farmer's field in Wisconsin, but it shouldn't concern MS at all if I would like it there.Dick

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this