Shadow model

While working on the FSX MDL reader for ModelConverterX I came across something interesting. I had some models that showed up a bit weird to say the least. It turned out that I was reading both their exterior model and their shadow model. But wait, did you say shadow model there?

In the MDL format it is possible to define a special shadow model, with its own vertices, triangles, etc. For complex models this can be used to improve the performance, by using a less complex model for the shadow calculations. In the FS2004 format this was also possible already now that I think of it, but it was not a very accesible option. I am not sure if it is easier to add your own shadow model with the new gamepack, I can’t remember seeing much about it in the SDK. Maybe this can be a nice new feature for ModelConverterX later on.

OpenStreetMap rocks!

I had came across the OpenStreetMap project before, but only when I revisited it earlier this week the reail power of it struck me. Let me start with a little explanation about what OpenStreetMap is. It is a free Wiki world map as their slogan says. I has been created by people collecting GPS tracks and combining that with other copyright free GIS data to get a really free world map. On their website you can browse to all the data in a similar way as Google Maps.

But that is not all, the real powerful thing is that you can also download this data. That is what I took a look at earlier this week. I came across some shapefile version of the data and looked at their OSM XML format. Then I realized that this data could be very useful for FSX as well. Because it does not only contain vector data about roads and railways, but it also contains information about the location of bridges. And not the speak about all the point features that are included. If I would like to put mailboxes for the Netherlands in a scenery I could do that.

So I have started writing a little tool now that will take the OSM XML data and turn that into shapefiles with the correct information for shp2vec. And the tool also writes the XML style ExtrusionBridges for BGLComp. That way I am trying to get better looking rail and road data in FSX now. I am doing the tests on a small scale now (only one country), but I guess there is no limit later to extend it to entire Europe to improve the default FS scenery. And I am sure I will come across some other nice features in the dataset that can be used for FS as well.

Sneak preview

Since I released alpha version 13 of ModelConverterX, I have been working on the next version. For that release I have mainly planned improvements to the usability of the tool. So that means the user interface gets cleaned up a bit, functions are made more logical etc. Another example of the things I am implementing is that the import and export processes will be running on a separate thread, so that the user interface will no longer appear locked up.

But while working on all this, I also realised that the old user intreface was not always very logical. Some functions were hidden quite deep in the menus, requiring quite some mouse clicks to get to. So therefore I decided to change the user interface a bit as well. Below you find a first sneak preview of how it will look now.

As you can see I removed the menus and added all functionality in toolstrips that are more accessible. Also the event log has got its own tab now, instead of being only part of the screen. I have some more ideas on the event log, but I still have to work on that.

Another example of a change is that the different colours of the 3D preview can now be configured by the user. See the screenshot below for an example of those options. And did you also notice that you can now toggle a grid in the preview as well to get a better impression of the size of things?

Finished the next version at last

In the last days I have been working hard on the next release of ModelConverterX, which I put online today. Every time when I thought I had fixed all bugs, some new problem appeared again. But now things seem to work good enough again. I am happy to get this new version online and I hope all the recently added features will be useful to the users.

I am quite excited that I got features like automatic alpha channel detection, conversion of lines into 3D objects and support of effects into the tool now. They had been on my wishlist for quite a while already.

Another big change is how the textures are handled in the tool. I switch to another library to load them, as the previous one had some trouble with the alpha channels. I have now come back to the graphical DLL files made by Martin Wright. I had used them in another tool before already and it seems when trying to read FS texture this library is just the best choice.

After this release I will relax a little bit, but then the next one is planned already. For version 0.5 (to indicate that the tool is more stable) I mainly plan to make the tool easier to use and clean up some aspects. And I also have a small update of the DrawCallMonitor tool planned. Luckily there are enough challenges left to work on…

Example of attached lights and effects

I just added the functionality to create FX effect files to ModelConverterX. This now allows the tool to write new FX files with the correct colour for light points that are used in the converted object. I am not an expert on making effect files, so maybe the FX could be optimized a bit further. Let me know if there are suggestions in this field.

The image to the right shows an object I converted as a test. As you can see it is a chimney and at the top there is a smoke effect file attached. And on the pole there are different lights. In the API code these where made with the Light command, but they are converted to FX files by ModelConverterX for this FSX MDL object.

So now all the main functionality for the next release is working, I just have a few other minor bugs on my todo list. Let’s get back to the source code now…

Attached objects done

This evening I have been able to take one more step on the problem of attached objects. After cleaning up the ModelConverterX code a bit more they are now really working. It is quite cool to be able to attach effect files now to your object and convert those already in the old SCASM macros.

Also for the light points attached to those objects this is good news. I can now read them in and export them to the FSX objects as attached FX files (because the old style light points no longer exist). This is all working now, except that I need to write the FX files themself. I hope that by taking some default FX file and modifying that I should be able to get started on that.

After that problem is solved I have fixed the main new features for the next ModelConverterX release. There are still a few smaller bugs on my list for the next release, but I hope to get the next version out in a few days. And occording to the plans that will be the last alpha version, the tool is getting so stable now that we can start moving in the direction of a “real” release.

Attached effects

Although Adrian Woods has an interesting post about how to add attachpoints to your X file, it still took me most of the evening to get things working. First I probably picked a wrong effect that does not work for scenery, but I also forgot to add the mesh to the X file frame of the attachpoint. Although that mesh is not put into the MDL when compiling with XtoMDL, it still has to be present in the X file.

But after having learned that, I could attach a nice firework show to my object converted with ModelConverterX. Now that this test is working, I can continue adding the attachpoint functionality and attach useful effects (for lights for example). But that is something I will continue working on later this week.

Lines done, but what about effects?

I have made some more progress on ModelConverterX by now. The extrusion of the 2D lines into 3D shapes is working fine and in the options the user can specify the shape he wants to extrude with. That can range from a flat plane (2 vertex circle) to a circle with more vertices so it looks round. Although the last will not always be advised performance wise.

So with that new feature solved, the next one to work on was not hard to find. I now started working on attached objects, for example lights or effects. I have already done the code to read them in from SCASM macros and the next thing to work on is writing the attachpoints to the X file for FSX objects as well. For the lights my plan is to have them being created as effect files, so the tool will have to generate a FX file for the light with the colour the light should have.

Video on the Wiki?

With the increasing amount of video tutotials becoming availalble on the FSDeveloper site and because they are just very useful to explain things, I have been looking at a way to integrate them in the Wiki. So let’s say to be able to play them inside the Wiki as an embedded video. The extensions for MediaWiki that I found for that until now did not really work for me, also due to the forum – Wiki integration we have on the site I guess. If anybody has some good tips or suggestions on implementing such a feature that would be very welcomed.