MDL Tweaker

I have just added a new feature to the ModelConverterX development release. It is a MDL Tweaker that you can find in the special tools menu.

Let me first explain how this tweaker differs from loading a MDL into ModelConverterX itself. When you import a MDL into ModelConverterX the object is read and stored in an internal representation. ModelConverterX then works with this internal representation when you make changes. In the end this internal representation is exported again to a MDL file.

The MDL Tweaker works differently, it directly manipulates the binary code of the MDL file, without decoding it to an internal representation first. This means that you can for example make small modifications without loosing animations or other elements that are in the MDL file. But it also means you are more restricted in the kind of manipulations you can make.

So what can this new MDL Tweaker do? At the moment it supports the following tweaks:

  • Change MDL name
  • Change MDL GUID
  • Change radius as stored in the MDL file (this is similar to the function of the RADItor tool I made a while ago)
  • Change the bounding box values of the MDL
  • Add a custom shadow model

Below you see a screenshot of the form. After you have made the changes you want, you need to click Save MDL to saves the changes to disk. When you click the Insert custom shadow model button you will get a file selection dialogue where you can select the MDL file that should be used for the shadow model.

I would like to stress that at this moment the tweaker only works for FSX MDL files. I still need to test and adapt it to work with FS2004 MDL files as well. Also at the moment the tool might not be super robust yet, I am still working on that as well.

Custom shadow model

A recent question by Don Grovestine on the FSDeveloper forum made me look more at the shadows of FSX models. As everybody knows, turning on the shadows in FSX can have a considerable influence on the performance. But the FSX MDL format also does allow you to specify a custom model that is used to render the shadow. I did some testing today to determine how big the performance difference can be.

I started by making a rather complex object, with almost 6000 triangles. And I placed many instances of it at my favourite test location. The screenshot below shows how the scene looks with shadows. Without shadows I got a framerate of 22. When I turned on the shadows the framerate dropped to 15.

So next I made a simplified version of the model. Instead of 6000 triangles it uses only 250 triangles. And I inserted this model into my MDL as the shadow model. In this case I got 20 frames for the scene, so that is only a minor performance drop, especially compared to the original drop. The screenshot below shows the result. As you can see the shape of the spheres is less smooth in the shadow now.

In my test scene I placed a lot of objects and the object I  used was rather complex. I am not sure if the performance benefit would be that big for an airport as well. But at least it shows that using a simplified shadow model can help improve the performance.

To insert the shadow model into the MDL, I used an experimental function in ModelConverterX. I will develop it further to make it useful for general usage and then put it on the development release version. Hopefully it should be available in a few days.

First beta Animation Tweaker available

I have just put the first version of the Animation Tweaker in the ModelConverterX development release. You will find it in the Wizards menu. This first version can do two things (or actually it does those two automatically to all files you process with it):

  1. Make FS2004 animations with more than 1024 frames
  2. Update the animation to use local variables

As input to the wizard you should use FSX MDL files. I did test this new function with some test files here, but please let me know if you have issues with your files. It is a first beta, so might be a little buggy.

The CAT is not dead

One of the first tool I made for scenery designers was the Conditional Animation Tool, CAT. The first version of this tool was released in 2003 and I mainly started making it because I grew tired of tweaking animations by hand (and I got tired of explaining people how to tweak them by hand). After the release of FSX, the development on CAT sort of stopped. The new native FSX format does not allow that kind of tweaking and for FS2004 the tool had most needed functionality already.

But since then there is another kind of animation tweak that I made a tutorial about, the tweak to get animations with more than 1024 frames into FS2004. For this tweak there is no tool yet and on the FSDeveloper forum the tweaking required is discussed now and then. I always hoped to make a tool for this tweaking as well one day.

Two weeks ago I got a good idea. Why not use the FSX gamepack to make long animations and then convert them to FS2004 MDL for people using FS2004? That way you can overcome the limitations of the FS2004 gamepack. The only thing you need to do is write the correct ASM code for the long animation. Since ModelConverterX can already convert objects from FSX to FS2004, I thought it would be nice to add this animation functionality as well.

So you can say that there will be a new version of CAT. It is now called the Animation Tweaker and it will be a wizard in ModelConverterX. But the icon will still be the cat you are all familiar with. I have been coding on this new wizard in the last days and I have got the basics working now. I just need to do a little more testing before I include the functionality in the development release as well.

At the moment the wizard does two things:

  1. Make sure that the animation does not use the user variables of FS2004 anymore. By default MS uses usrvar, usrvr2 and usrvr3 to store the frame number of the animation. By using these variables you can get conflicts with other tools or sceneries that also want to use the same variables. That’s why I prefer to make animation using local variables inside the MDL. The wizard will perform this tweak to any animated object you process with it.
  2. Tweak the ASM code to get correctly working animations with more than 1024 frames. This means that no more ASM tweaking is needed to get them working. The only limitation I have found until now is that the total animation can not be more than 32768 frames. But that is around 30 minutes of animation already, I think that should be fine for almost everybody.

In the future I also want to add the original functionality of CAT, so the possibility to apply triggers and conditions to your animation. Since I made this tool 9 years ago I have learned more about how the animations work. So I think by now I can make the conditional animations even more efficient. For example without the problems that CAT has when you have many animations in your object. But I will only start on this part of the Animation Tweaker when the long animations tweak is working.

Just to be clear, let me stress one point. This Animation Tweaker can only export FS2004 MDL files, since that is the only format that allows such animation tweaks. So they can not be used in a FSX MDL file. The tweaker will read FSX MDL files, since they allow you to define longer animations without problems.

Longer FS2004 animations

Remember the limitation in the FS2004 GMax for the length of animations? The tool does not allow us to export animations longer than 1024 frames. This is quite annoying, since that limits your animation length to only 55 seconds. Luckily the FSX gamepack does not have that limitation.

I have written down how to tweak the ASM code to get longer animations. But I’ll be honest, it’s quite complex code and you need to know quite a lot about how the animation code works to make the tweaks. So I can understand that it is not so appealing to many developers.

This morning I woke up with a good idea (why did I not try this before?). What would happen if I would make a long animation in the FSX gamepack and then convert it with ModelConverterX to a FS2004 MDL file? Guess what, the 1024 frames limitation is not completely in MakeMDL, a big part is in the gamepack DLE file. So that means that my new FS2004 MDL files contains all 33334 frames I put in the animation. The only problem I noticed is that the interpolation logic above is still written for 1024 frames. So that part still has to be tweaked. But at least you don’t loose any of the keyframes.

So I think I should add a tool to ModelConverterX that can automatically do the remaining tweaking. If all the keyframes are preserved, that is not so much work anymore in the first place.

It just puzzles me why I only think about this so many years after FSX has been released…

Places multiple instances

I am working on a ModelConverterX update that will include better support for the placement of objects. One thing that will change is that placement information will be read from BGL files. But I am also changing the functionality in ModelConverterX that allows you to place objects. One of the main changes there is that you will be able to place multiple instances of the object, instead of only one at the moment. The screenshot below shows the new object placement form that I am working on. It will still take some time though before this functionality will be in the development release, at the moment it is still too buggy.

Ending the rumours?

It for sure was an interesting week with the new announcements Microsoft made about Flight. Will it end all the rumours that have been going around for a long time already? Let’s see.

The new announcement makes a lot of things more clear. Flight will have an integrated addon market and it is focussed around Hawaii. So those rumours were correct. The fact that it is free is something new. You will get 2 planes and one island of Hawaii for free. If you want more planes or more regions to fly in you can buy them in the market place. The announcements also seem to make clear that it is much more a game than hard core FS users are used to. It seems there are no jet planes included by default for example and the limited region also restrains serious IFR flying it seems.

Is this all bad? Another trend often mentioned is that the average FS users is getting older. Look at events like the FSWeekend in the Netherlands, the audience seems to get more grey hairs every year. So even if Flight seems not to be the “game” for the hard code FS user, it might interest more young people for flight simulation. Some of these might in the end even enlarge the already existing community around FS2004 and FSX.

The integrated market place is also not necessary a bad thing, since it makes it a lot easier for users to find existing addons. It is only a small portion of the people who bought FSX that found the addon communities on the internet. So an integrated market place might even increase sales. But it depends a lot on two things: how open is the platform for addons and what are the conditions of the market place.

For the last one it seems from the current reactions on the internet are that most existing payware addon developers are not happy with the proposed fees for using the Flight market place. And there is no official information at all whether freeware contributions to it will be possible. Although I have seen remarks that the market place would mean the end to freeware as we know it. If that would be the case, I think that would be a very bad move. I think the freeware addon community is the heart of the success of FS. Almost every developer has started in the freeware community, making small contributions to the FS world. So I would go as far as to state that without the freeware community, the payware addon community can not thrive either. So given the information available at the moment, it seems doubtful that the Flight market place will enable the kind of ecosystem of fans and developers that FS2004 and FSX have currently.

The second part is the openness of the platform for addons. I have seen hardly any information on that subject yet. One article mentions there will not be a SDK at all, but that seems hard to believe given the fact that there will be additional content to buy. But even if there would be a public SDK, that does not mean that the platform is also open and flexible enough to let addon developers do their work. For the previous FS versions the default aircraft and scenery were always just OK, but the platform was open enough to allow addon developers to make the great scenery and aircraft that we are all used to now. At this moment it is still unclear Flight can provide such a platform.

So did the announcement stop all rumours? I think not. At least it seems to have started loads of new discussions. Within the existing community Flight does not seem to get a very warm welcome. For me personally, as a (freeware) addon developer, I can say that given the current information it does not sound to me like an interesting platform to make addons and tools for. But who knows Microsoft might surprise us with a superb SDK, a very flexible engine and a market place that also accepts freeware contributions?

And in case I am too optimistic with those thoughts, we always have FSX which is still a great platform. We can still continue to build addons and improve it for years to come. So even if Flight is not our cup of tea, nothing is lost, we still have FSX. And there are also Prepar3D (which has improved the FSX engine) and X-Plane to keep an eye on. I think it will be interesting times ahead for addon developers. With or without Flight…

Follow me

Last week I finished the model of the new railroad bridge near Zwolle for the NL2000 scenery. It was the first bridge model I made with SketchUp and it was an interesting experience. As most modelling tools SketchUp provides a lot of operators and I had not used all of them in my previous objects. One of the tools I have learned to appreciate more with this bridge is the follow me tool. As you can see in the screenshot below the bridge is partly curved and there is also a small side road (of course a bicycle path here in the Netherlands). So how did I make this all?

I started with the main structure of the bridge, that crossed the actual river. I used a photo taken for the side to trace the correct shape of this part of the bridge. Afterwards I extruded it to get the right depth and cloned it to get the other side. Then I drew the railroad between these two structures. Now the follow me tool became useful. Because there is also a big part of the bridge that goes over the floodplains of the river. And these parts where partly curved. Besides that there are slopes for the trains to slowly increase their height above the terrain. For these parts I first drew a (curved) line for the right path and then used the follow me tool to extrude the railroad and the sides of the bridge along that path. To add the side road I also used the follow me tool again. I just drew the contour of it and then “follow me”-ed it along the entire bridge.

At the bottom you can see a screenshot of the finished bridge in the scenery.

Happy 2012!

I would like to wish everybody a happy 2012! Let’s hope this is going to be an interesting year again for FS addon developers. I think the signs are quite good, with Microsoft Flight around the horizon and X-Plane 10 as a promising platform as well. Let’s see where that all goes during this year.

As usual I am also full of ideas for my own tools. I hope to continue the experimentation with scenProc and autogen for example. And also for ModelConverterX there are loads of ideas left on my wishlist and I would like to release a new stable version this year as well, since the latest stable version and the development release are quite far apart now.

But on the other hand I also know that I will have less time to development these tools or spend on FS in general. That’s because 2012 is also going to be a happy year on the more personal point of view. We are expecting our first child in a couple of months. So all together it should become a very interesting year, I would say.