Update on reading aircraft MDL files

Over the last days I have made good progress again with reading aircraft MDL files. I should directly say that not all of them will import correctly at this moment, but more and more are working. And also setting the conditions to extract a landing gear or set the flaps is working much better now. I will keep debugging the aircraft that do not yet work correctly, but this functionality is almost useful now. It can for example be used to make static aircraft out of old flyable aircraft, a task that is currently usually done using the great tool MDLtoBGL by Trevor de Stigter.

While working on reading the aircraft files I have also fixed some bugs in the code that checks the conditions of variables when reading the object. So also people converting scenery objects should see that this works better now.

Object conditions

From tomorrow the development release of ModelConverterX is able to handle objects with conditions better. When importing objects that have conditions applied you will get the form as shown below. In this form you can specify the value you want each of the variables to have. Using these values the conditions will then be evaluated and the object is imported with these conditions applied. So for example when reading an aircraft MDL you can use this is import it with the landing gear extended or retracted.

At the moment the form is still a bit technical, with all those numbers. But I am planning to replace the variables by a good description in a future version. The same applies to the (possible) values, if the variable only takes a certain number of values I want to add a dropdown box for them in a future versions.

If you do not want to specify the values of these variables while importing your object, there is a workaround as well. In the options you can specify how conditions are handled. By default they are set to UserSpecified, which means you get the form to give the values. But you can also specify that conditions are always seen as true or false. In that case you don’t have to specify any values.

Together with this change to handle object conditions, the development release will also support reading FS98 and FS2000 aircraft MDL files. Below are two screenshots from an aircraft that imports fine (once with gear and flaps extended and once with them retracted). Not all aircraft MDL files import as good as these however. This seems to be caused by some of the conditions in them, that prevent (parts of) the aircraft from importing. This will be improved in future versions as well, it will take a bit more experimentation to determine the meaning of the different variables used in aircraft MDL files.

Reading older aircraft MDL files (at least partly)

The screenshot above shows some success with reading the older aircraft MDL files. In this case it is a CFS2 aircraft (they use the same MDL structure as FS98 and FS2000). This models comes out quite good. Unfortunately not all models load that well. Many of them only show partly or not at all after importing. This seems to be caused by the fact that aircraft MDL files have a lot more conditional display than the scenery objects that ModelConverterX normally reads.

So I will first have to think of a best way to handle these conditions, else it is not possible to read aircraft MDL files usefully. Luckily this was already on the wishlist for other objects as well. I would like to add the ability to switch variables on or off from within ModelConverterX and that you then see the object change. If that is not possible I will probably let the user set the value of all variables used before importing. But the first option would be more powerful of course.

So time to do some thinking and hopefully I can implement this feature soon….

Reading FS98 and FS2000 aircraft MDL files

Just a quick update on this ModelConverterX functionality. It is not finished yet, but I have made some progress last week. I can now read the information from the files, but when testing with some aircraft MDL files I still encounter a lot of BGL opcodes that ModelConverterX does not recognise yet. So I am working on adding those before I put this functionality in the development release. Last four days we were away camping in Luxembourg, so I hope to continue programming on it later this week.

Reading section 9 BGL files

This Monday I already blogged about the new feature for ModelConverterX that allows it to read the old section 9 BGL files. This is the kind of files that tools like FSSC, Airport for Windows or GroundMaker make. I have now finished this reader and it will be available in the development release from tomorrow.

Since Monday I have added support for many additional BGL opcodes, so that most of your BGL files should work fine now. I have used some scenery I made more than 5 years ago for FS2002 (or was it FS2000) to test this function and it seems to be working quite good. If you still find some unsupported opcode, please let me know using the FSDeveloper forum.

This new feature might come in handy if you want to port some scenery you made many years ago and of which you lost the sources and only have the BGL files left. With this feature done I hope to give reading FS98 and FS2000 aircraft a try this weekend….

 

FSDeveloper on your smartphone?

Do you want to access the FSDeveloper forum on your smartphone as well? We have installed a plugin so that you can now use the Tapatalk application for the FSDeveloper forum as well. With the free version of this application you can read the forum and with the paid version you can also post new messages easily from your smartphone. Hopefully this is useful to some users.

Reading non library BGL files

ModelConverterX could already read FS2004 and FSX library BGL files, but using the recent improvements I made for the aircraft MDL reader, I have now added another function that was on my todo list for quite some time. I have added support for reading older section 9 SCASM BGL files. This includes the scenery BGL files made with the FS2002 GMax gamepack, but also the older BGL files made by tools like Airport for Windows, FSSC or GroundMaker. It should now be possible to read objects from such files as well. Not all of the files I tested until now work already, some of them still have many unknown BGL opcode, I will try to continue to add these in the next couple of days.

Aircraft liveries

Today I made some improvements to the aircraft MDL reader of ModelConverterX. It still can’t read all MDL files, but much more of them should work now. This should at least give you an idea of the geometry of these models.

The picture above shows an AI 737-300. Now that the geometry seems OK, the thing that bugged me most was the textures not showing. This is because for aircraft MDL files you can’t just take the main texture folder, they often have different folders for different liveries. So I decided to add support for that as well. At the top, next to the LOD selection, you can now also select which livery for the textures you want to load. Below are some examples of the same aircraft, but with a different livery.

The performance when switching liveries is not yet perfect, it sometimes
takes a few seconds for the preview to refresh. That is something I
hope to improve later on. The changes will be available in the development release of tomorrow.

Some ESP news

Let me just repeat some of the ESP related news that Tim Gregson (Beatle) recently posted on his blog.

ESP is now officially dead, MS has taken the ESP website offline. The SDK pages on the MSDN website are still there though. Tim also reported that he has left MS now and will be working as a consultant for Lockheed Martin on the Prepar3d program (which is what LM is doing with the ESP code they licensed). So good luck with the new job Tim and hopefully we will hear more about Prepar3d in the future.

 

 

Reading aircraft MDL files

This must have been one of the most often requested features for ModelConverterX. And I should directly say that it is not implemented completely yet, but this weekend I started on adding the functionality to read aircraft MDL files from FS2002 and FS2004. Below you can see a screenshot of the default fueltruck MDL that comes with FSX. But in fact it is in the FS2004 aircraft MDL format.

So as you can see this relatively simple object can be imported now, but I should be honest and say that most of the other models I try still fail. This usually happens because some BGL opcode is encountered that ModelConverterX is not aware of yet. So I think some more and better testing is needed before I can put this functionality in the development release.

While working on this feature, I also came across two BGL opcodes that seem to be unknown to the BGLC_9 compiler. These are C9 and CC. Their functionality seems very similar to the VertexList and DrawTriList commands, although some of the parameters are 32 bit, instead of 16 bit long. I do not fully understand yet what the differences are, but hopefully this will also start to make sense soon.