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.

Improved LOD Creator functionality

Over the last days I worked on the ModelConverterX LOD Creator tool. My first aim was to add another algorithm to calculate the LODs. And besides that I also improved the user interface a bit.

On the right you see a screenshot of the new user interface and since the manual is not yet updated, I will give a brief overview of the changes here.

The selection box at the top right allows you to choose between the different algorithms that are available. At the moment you can choose either vertex clustering or quadratic based error. The last one is the algorithm that was used in the previous version of ModelConverterX and it has not changed in this new update. I hope to improve that algorithm more later on. Below the algorithm selection box you see the different parameters that you can set for each of them.

The remaining changes in the user interface are mainly the buttons on the bottom left. They allow you to remove a LOD, rename a LOD or add an empty LOD. New is the import LOD button which allows you to load another file and that object will then be used for the LOD number indicated next to the button. This should allow people to make for example LODs with SketchUp. By saving them all to different files, you can combine them in one MDL using this tool.

Then to the new algorithm. What vertex clustering basically does is collapse all vertices that are within the same cell of a 3D grid. The resulting vertex position depends on the weight of the original vertices. In the implementation into ModelConverterX you can give vertices a weight based on:

  • The area of the polygons that the vertex is a part of. This means that vertices that are part of a big polygon will have more influence on the new shape. In the properties you can set the influence of the area at a value between 0 and 1. Where 0 means no additional weight and 1 means the maximum additional weight.
  • The angle between the polygons that the vertex is a part of. The idea behind this weight is that polygons on the outside of the object are more likely to have sharp edges. By given them more weight the overall silhouette will be preserved better. This parameter also has a range between 0 and 1.
  • Ground clamping. This gives an additional weight to vertices that are on or below the ground. This is to ensure that you building does not float in the lower LODs.

The two remaining parameters of the algorithm are grid size and floating cells. The first one is quite obvious and determines how big the cells are, within which the vertices are collapsed. The second allows you to choose between uniform fixed cells and floating cells. According to the literature the last option should give better results in general, although I have already seen that it does not apply to every object.

So I hope you enjoy these new LOD functionalities and if you want to see them in action have a look at this demonstration video.

scenery.org

Ever since I started making scenery for Flight Simulator, you could get almost any tool you wanted using scenery.org. That site provided a great overview of tools and tutorials for scenery designers. Sadly last week the site went offline.

This did not come as a huge surprise, since the owner Tom Gregor had already indicated before that running the site was becoming to expensive. After this message the FSDeveloper admins already contacted Tom Gregor to see if we assist in some way. We do have his permission to keep the tools and tutorials alive on FSDeveloper and we also have a backup of all the related files. But before we can put them online again, we need to get permissions from the authors of these tools and tutorials as well. So we are working on that now.

A big thanks to Tom Gregor for running this site for all those years. And we’ll do our best to keep as much of the knowledge it contained available.