FSXA FS9 -> FSX aircraft model conversion (an experiment)

Heretic

Resource contributor
#1
Ever since finding out about MCX' new animation support, I was intrigued about what can be achieved with it.
So I set out on the monumental task to convert as many of the aircraft models used in my AI traffic as possible.

Why AI?

Because the models are rather simple and the economy of scale should, in theory, benefit performance at larger airports. Also, it provides a way to have DX10 compatible models without investing in a payware AI traffic product.

So with the goal of getting a few more FPS at big airports, I set out.

Loading the model into MCX is no problem, save for the very odd logging-related errors that can be easily dismissed (just click "Continue") without hampering MCX' operation.

Some animations will have to be manually assigned for FSX in the animation manager as MCX doesn't find them in a standard modeldef.xml (supplied by the FSX SDK).
This isn't a huge drawback as I simply cloned and appropriately named the standard animations for these parts in the modeldef, so that MCX is able to automatically assign these animations upon exporting.
I needed to make a choice though, since both propeller and fan animations are labeled "engine" in MCX, so I elected to assign "engine" to the default "N1" animation for jets and do the prop animation assignment by hand.
The "select by name" and "jump to animation list entry by keystroke" functions in MCX' animation manager makes this quite easy.
Assigning "unknown" animations in certain models was a bit harder, as they mostly use custom animation code that (so far) can't be read by MCX. But with the filtered display of model animations, selecting and assigning an appropriate default animation is fairly easy.
Note: Even with an appropriately named modeldef entry, MCX does not automatically assign "unknown" animations during export.
The only thing I could not figure out were "userdefined" animations, as they did not seem to be assigned to any animated parts in MCX. But that could just easily be blindness on my part or model-specific behaviour.

Well, after assigning suitable animations, I've exported a renamed model (and changed the model.cfg accordingly) and checked its filesize of the resulting compiled file. To a big part, it always resulted in a model file a bit smaller than the FS9 one and occasionally in a file a bit larger than before.
On two occasions, I got a free .fx file to boot. I don't know where it came from though.

Anyway, working through 100+ model files and after five to six hours of work, I fired up FSX to check out the result.

My first impression is, that so far and only at an airport, the models look like before, which is good. :D

One drawback, however, that became immediately apparent was due to MCX' lack of visibility tag support, prop planes will not display prop disks when engines are on.
I've used "prop_blurred" as an animation tag for the props, which at least gives me the impression of a moving prop. It's more of an inconsistent rotation animation, but it's better than nothing.

As for model performance, I seem to have gained two FPS at LAX during rush hour operations, depending on the amount of planes in sight. To throw in a number, FPS were between 10 and 24 up from 9 to 20.
At BOS, with naturally less amounts of traffic, FPS seemed to be higher on average, from 15 to 25, up from 12 to 20.
It can be said that generally, full FSX native traffic is no silver bullet compared to FS9 traffic models, but in a low FPS environment, every frame per second counts.

I have not tested LOD functionality so far, but since opening the converted models in MCX also includes the LOD files, I trust MCX' judgement for now.

Switching to DX10, I found that all former FS9 models are now displaying in their fully textured glory.

A note on the textures: Prior to running the model conversion, I've converted all my AI textures to DXT5 DDS textures. Since MCX exports with a -NOBMP or similar sounding flag, it might be that converting AI textures before or after doing the models is a necessity.


By the way:
Converting userspace aircraft, while a very tempting idea, is not feasible at the moment since MCX doesn't read all animations used in the model (yet).



Conclusion:
Although being a time-consuming and partially tedious process, converting AI models into FSX format might be worth it, as long visual performance is more important than eye candy. Especially the missing visibility tag support can be discouraging expecially when converting propeller planes.

This is not the final verdict though, as I haven't tested the models enough. Personally though, I prefer performance over looks and as long as the models don't display any overly whacky behaviour, I will keep them.
Should MCX' capabilities in terms of animations and visibility tags be extended in future versions, I am willing to do the whole process again as the result outweighs the effort required.


As a final note, thanks to Arno for this nifty tool that basically gave me FSX native models without having to do them all from scratch.

Nota bene:
Publishing of models converted without the original creator's consent is strongly discouraged. You *will* get into trouble upon doing so!
Do this for yourself and for yourself only!




Here's a short overview of the pros and cons for those unwilling to read that much text:

+ FSX native models
+ DirectX 10 compatible
+ Basic animations are working
+ LODs (apparently) work
+ Very slight performance improvement at busy airports
+ Moderate effort required for conversion

- Some animations can display buggily
- No support for visibility conditions
- No support for custom coded animations
(- Possibly whacky lightmap behaviour)


And, for good measure: Do not distribute converted models unless you have the original authors' consent!
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#2
Hi,

Thanks for this interesting report.

About the visibility tags, modelconverterx can export them to fsx models. So the problem there is that I haven't added support for them when reading fs2004 models. I should add that to the wish list :).

Same for the custom animations I think. They are not stored by their name in the mdl, that's why they come out as unknown. Instead I should read the conditions for them and insert them in the modeldef so that they can be exported.
 

Heretic

Resource contributor
#3
About the visibility tags, modelconverterx can export them to fsx models. So the problem there is that I haven't added support for them when reading fs2004 models. I should add that to the wish list :).

Same for the custom animations I think. They are not stored by their name in the mdl, that's why they come out as unknown. Instead I should read the conditions for them and insert them in the modeldef so that they can be exported.
Yes! That would make everything more than perfect!

I think the icing on the cake would be (command line) batch support with support for user-defined modeldef.xml files, but that is a bit much too ask.
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#4
Hi,

I think the command line batch function is already somewhere on the wish list.

What do you mean with custom modeldef.xml support? You can set in the options which modeldef.xml is used, or is that not what you mean?
 
#5
Hi
I have found that when the ai FS9 aircraft mdl's are converted to FSX ai aircraft mdl's, their behaviour is odd. They often push back much further than they should and then wonder off like naughty children!! It could be my 'test' traffic bgl, but I don't think so......
Cheers
Jont
 
Last edited:
#6
Hi all
I've been experimenting with this as well, mainly for the potential VC swapping benefits.
For me the biggest problem is animations with unrecognised names, could these be marked with an * or something? It would then be quite easy to manually reassign them. Or perhaps we could have an aliases file that we could easily edit ourselves.
You will still need to edit the .xanim file but this may just be a case of changing the sign of variables to reverse the animation.

Anyway its fantastic progress. Thanks Arno.
 

Heretic

Resource contributor
#7
What do you mean with custom modeldef.xml support? You can set in the options which modeldef.xml is used, or is that not what you mean?
Yes, something like that.



I have found that when the ai FS9 aircraft mdl's are converted to FSX ai aircraft mdl's, their behaviour is odd. They often push back much further than they should and then wonder off like naughty children!! It could be my 'test' traffic bgl, but I don't think so......
Hm. Did you allow the AI traffic to settle for 10,15 minutes?

I found that right after starting a flight, FSX traffic is utter chaos as the traffic engine needs to catch up on the scheduling.
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#8
Hi,

For me the biggest problem is animations with unrecognised names, could these be marked with an * or something? It would then be quite easy to manually reassign them. Or perhaps we could have an aliases file that we could easily edit ourselves.
You will still need to edit the .xanim file but this may just be a case of changing the sign of variables to reverse the animation.
At the moment they are tagged as unknown. I am not sure what adding a star to that would add. If you look in the animation editor all the unknown ones will be lost during export. I think they are not even exported to the xanim file when I can't find a definition for then (would have to double check that too be sure).
 
#9
Hi Arno
Sorry, I was referring to the animations recognised but not listed in modeldef.xml, not the unknown animations. I don't know how to do the cloning trick.
Is there a way to tell in advance which animations (in addition to the unknowns) won't be exported? Or am I misunderstanding this?
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#10
Hi,

I understand now, let me see if I can show them somehow in the animation editor or at least report them during export.
 
#11
Arno, excellent. I'm sure what ever you come up with will be fine. Thanks again.

I've done a bit of experimenting with modeldef_edit.exe so I now know how to clone animations. More interesting are the <Scale> and <Bias> parameters, which if customised may mean the .xanim file doesn't need to be touched. I haven't tested this yet.
Is there an easy way of having both the fs9 original and the new fsx version in the sim next to each other to compare the movements of the control surfaces etc?
 
#14
I've found a model that can be easily converted, the AFS A350 demo. It's a simple model with simple animations.
The VC is very straightforward to convert, just reassign the engine animations. The material of the windows and the panels then needs to be switched to default transparent.
For the external model it's best to have the standard animations cloned. For this model you need spoilers, engines, thrust reversers, tyres and rudder. The flaps need to be reassigned to flap percent key.
Don't forget to change the radius to a sensible number e.g. 30.
Seems to fly ok. Don't know if it would behave as AI.
I think the reason this plane is so straightforward is because the control surface animations are linked to the stick. The Camsim A350 is much more difficult.
 
#16
With some models at least, once you've cloned all the common animations, the only problem that remains is the animation direction of the various control surfaces.
For the YC-14 ,Gloster Javelin(Kazunori Ito) and TSR2 (Kazunori Ito) I reversed the scale of the rudder and "right_ailer" then reassigned the nose gear steering back to "rudder_key" (otherwise it turns the wrong way) to get a fully animated model. (I haven't tested these in fsx much)

For something a bit more difficult I tried the BAe146-300QT V1.1 http://simviation.com/hjg/aircraft/BAe/146QT.htm

For the flaps I had to change the scale to +1 and the Bias to 0, then I had to resort to editing the .xanim file.
The door was missing Keyframe time="0.000", so I just copied Keyframe time="20.000", inserted it and changed it to "0.000" (this problem doesn't show in MCX).
For the roll spoilers that were functioning the wrong way round I just flipped the keyframes, reversing the scale doesn't work as they are 1-way only.
Lastly, I couldn't figure out how to edit the c_wheel animation so it displayed correctly, so I just cheated and copied the relevant keyframes over from the default CRJ. The resulting nosegear is slightly off straight, but ok.
You'll need a spoiler lever gauge, wing spoilers deploy at 90%.
That just leaves the windscreen to fix, which I haven't done yet.
It would be great to be able to make these changes within MCX but the .xanim file isn't difficult to deal with, unlike the .X file.

The log file can be a useful indicator as it tends to stop abruptly (but not always) if it finds an animation it doesn't like.
Don't forget to change the radius to a sensible number.
 
#17
Im interested in how you did this using MCX, I thought one would need the source files in order to convert the model and I am very interested in doing this to all my AI myself but I don't understand how you converted the models using MCX's animation editor?

could somebody please tell me how it is done in a simpler way for me? I am in desperate need of FPS on my system

Thanks:)
 

Heretic

Resource contributor
#18
Assuming you have the FSX SDK installed and know how to use MCX (if not, read up on it), here's how I've done it.


Put this at the end of your modeldef.xml:

Code:
<Animation name="rudder" guid="5433b2a0-0fd9-4180-8f7d-0ba36bf7191d" length="100" type="Sim" typeParam2="rudder" typeParam="AutoPlay" />

    <PartInfo>
        <Name>rudder</Name>
        <AnimLength>100</AnimLength>
        <Animation>
            <Parameter>
                <Sim>
                    <Variable>RUDDER DEFLECTION PCT</Variable>
                    <Units>percent</Units>
                    <Bias>50</Bias>
                </Sim>
            </Parameter>
        </Animation>
    </PartInfo>

<Animation name="l_spoiler" guid="F5D81E0E-0238-43a6-B169-2A7DF682295A" length="100" type="Sim" typeParam2="l_spoiler" typeParam="AutoPlay" />

    <PartInfo>
        <Name>l_spoiler</Name>
        <AnimLength>100</AnimLength>
        <Animation>
            <Parameter>
                <Sim>
                    <Variable>SPOILERS LEFT POSITION</Variable>
                    <Scale>1</Scale>
                    <Units>percent</Units>
                    <Bias>0</Bias>
                </Sim>
            </Parameter>
        </Animation>
    </PartInfo>

<Animation name="r_spoiler" guid="F5D81E0E-0238-43a6-B169-2A7DF682294A" length="100" type="Sim" typeParam2="r_spoiler" typeParam="AutoPlay" />

    <PartInfo>
        <Name>r_spoiler</Name>
        <AnimLength>100</AnimLength>
        <Animation>
            <Parameter>
                <Sim>
                    <Variable>SPOILERS RIGHT POSITION</Variable>
                    <Scale>1</Scale>
                    <Units>percent</Units>
                    <Bias>0</Bias>
                </Sim>
            </Parameter>
        </Animation>
    </PartInfo>

<Animation name="l_pct_trail_edge_flap0" guid="F5D81E0E-0238-43a6-B169-2B1DF682294A" length="100" type="Sim" typeParam2="l_pct_trail_edge_flap0" typeParam="AutoPlay" />

  <PartInfo>
    <Name>l_pct_trail_edge_flap0</Name>
    <AnimLength>100</AnimLength>
    <Animation>
      <Parameter>
        <Sim>
          <Variable>TRAILING EDGE FLAPS RIGHT PERCENT</Variable>
          <Units>percent</Units>
          <Scale>1</Scale>
          <Bias>0</Bias>
        </Sim>
      </Parameter>
    </Animation>
  </PartInfo>
  
<Animation name="r_pct_trail_edge_flap0" guid="F5D81E0E-0238-43a6-B110-2B1DF682294A" length="100" type="Sim" typeParam2="r_pct_trail_edge_flap0" typeParam="AutoPlay" />

  <PartInfo>
    <Name>r_pct_trail_edge_flap0</Name>
    <AnimLength>100</AnimLength>
    <Animation>
      <Parameter>
        <Sim>
          <Variable>TRAILING EDGE FLAPS LEFT PERCENT</Variable>
          <Units>percent</Units>
          <Scale>1</Scale>
          <Bias>0</Bias>
        </Sim>
      </Parameter>
    </Animation>
  </PartInfo>
  
<Animation name="engine0" guid="5A2A3E08-7E67-1111-A3A3-E48388F191B3" length="100" type="Sim" typeParam2="engine0" typeParam="AutoPlay" />

  <PartInfo>
    <Name>engine0</Name>
    <Copy>prop_anim</Copy>
    <AnimLength>100</AnimLength>
    <Animation>
      <Parameter>
        <Code>
           (A:GENERAL ENG RPM:1,degrees per second) (E:ABSOLUTE TIME, second) * 360 % 3.6 /
        </Code>
      </Parameter>
    </Animation>
  </PartInfo>
  
  <Animation name="engine1" guid="5A2A3E08-7E67-2222-A3A3-E48388F191B3" length="100" type="Sim" typeParam2="engine1" typeParam="AutoPlay" />

  <PartInfo>
    <Name>engine1</Name>
    <Copy>prop_anim</Copy>
    <AnimLength>100</AnimLength>
    <Animation>
      <Parameter>
        <Code>
           (A:GENERAL ENG RPM:2,degrees per second) (E:ABSOLUTE TIME, second) * 360 % 3.6 /
        </Code>
      </Parameter>
    </Animation>
  </PartInfo>
  
  <Animation name="engine2" guid="5A2A3E08-7E67-3333-A3A3-E48388F191B3" length="100" type="Sim" typeParam2="engine2" typeParam="AutoPlay" />

  <PartInfo>
    <Name>engine2</Name>
    <Copy>prop_anim</Copy>
    <AnimLength>100</AnimLength>
    <Animation>
      <Parameter>
        <Code>
           (A:GENERAL ENG RPM:3,degrees per second) (E:ABSOLUTE TIME, second) * 360 % 3.6 /
        </Code>
      </Parameter>
    </Animation>
  </PartInfo>
  
  <Animation name="engine3" guid="5A2A3E08-7E67-4444-A3A3-E48388F191B3" length="100" type="Sim" typeParam2="engine3" typeParam="AutoPlay" />

  <PartInfo>
    <Name>engine3</Name>
    <Copy>prop_anim</Copy>
    <AnimLength>100</AnimLength>
    <Animation>
      <Parameter>
        <Code>
           (A:GENERAL ENG RPM:4,degrees per second) (E:ABSOLUTE TIME, second) * 360 % 3.6 /
        </Code>
      </Parameter>
    </Animation>
  </PartInfo>

    <Animation name="thrust_reverser0" guid="18AF77CB-6457-47d5-8A10-2BA619430ACE" length="100" type="Sim" typeParam2="thrust_reverser0" typeParam="AutoPlay" />
    <Animation name="thrust_reverser1" guid="2D50D1B9-ED30-6405-A77A-99AA338D1548" length="100" type="Sim" typeParam2="thrust_reverser1" typeParam="AutoPlay" />
    <Animation name="thrust_reverser2" guid="0C63D8D2-D8A0-Ab43-B786-53176182EBD6" length="100" type="Sim" typeParam2="thrust_reverser2" typeParam="AutoPlay" />
    <Animation name="thrust_reverser3" guid="0868C657-A72C-Dc35-8494-F16356824759" length="100" type="Sim" typeParam2="thrust_reverser3" typeParam="AutoPlay" />

   <PartInfo>
        <Name>thrust_reverser0</Name>
        <Copy>thrust_rev</Copy>
        <Animation>
            <Parameter>
                <Sim>
                    <Variable>TURB ENG REVERSE NOZZLE PERCENT:1</Variable>
                </Sim>
            </Parameter>
        </Animation>
    </PartInfo>

   <PartInfo>
        <Name>thrust_reverser1</Name>
        <Copy>thrust_rev</Copy>
        <Animation>
            <Parameter>
                <Sim>
                    <Variable>TURB ENG REVERSE NOZZLE PERCENT:2</Variable>
                </Sim>
            </Parameter>
        </Animation>
    </PartInfo>
    
       <PartInfo>
        <Name>thrust_reverser2</Name>
        <Copy>thrust_rev</Copy>
        <Animation>
            <Parameter>
                <Sim>
                    <Variable>TURB ENG REVERSE NOZZLE PERCENT:3</Variable>
                </Sim>
            </Parameter>
        </Animation>
    </PartInfo>
    
       <PartInfo>
        <Name>thrust_reverser3</Name>
        <Copy>thrust_rev</Copy>
        <Animation>
            <Parameter>
                <Sim>
                    <Variable>TURB ENG REVERSE NOZZLE PERCENT:4</Variable>
                </Sim>
            </Parameter>
        </Animation>
    </PartInfo>

<Animation name="elevator" guid="60fced03-9a10-49a7-aa82-2b79ab5b63e0" length="100" type="Sim" typeParam2="elevator" typeParam="AutoPlay" />

    <PartInfo>
        <Name>elevator</Name>
        <AnimLength>100</AnimLength>
        <Animation>
            <Parameter>
                <Sim>
                    <Variable>ELEVATOR DEFLECTION PCT</Variable>
                    <Units>percent</Units>
                    <Bias>50</Bias>
                </Sim>
            </Parameter>
        </Animation>
    </PartInfo>

<Animation name="left_ailer" guid="bad53e9a-1958-4b22-90fe-23513d121db5" length="100" type="Sim" typeParam2="left_ailer" typeParam="AutoPlay" />
<Animation name="right_ailer" guid="bad53e9a-1958-4b22-90fe-23513d121db1" length="100" type="Sim" typeParam2="right_ailer" typeParam="AutoPlay" />

    <PartInfo>
        <Name>left_ailer</Name>
        <AnimLength>100</AnimLength>
        <Animation>
            <Parameter>
                <Sim>
                    <Variable>AILERON LEFT DEFLECTION PCT</Variable>
                    <Scale>-1</Scale>
                    <Units>percent</Units>
                    <Bias>50</Bias>
                </Sim>
            </Parameter>
        </Animation>
    </PartInfo>

    <PartInfo>
        <Name>right_ailer</Name>
        <AnimLength>100</AnimLength>
        <Animation>
            <Parameter>
                <Sim>
                    <Variable>AILERON RIGHT DEFLECTION PCT</Variable>
                    <Scale>-1</Scale>
                    <Units>percent</Units>
                    <Bias>50</Bias>
                </Sim>
            </Parameter>
        </Animation>
    </PartInfo>
This will auto-assign animations for jet aircraft upon export from MCX. If you've got a prop plane, you'll need to manually assign a prop animation from the animation manager.

The current basic procedure is:
1. Load model file into MCX.
2. Check if all animations are assigned.
3. Export as FSX native model with a sensible filename as to not overwrite the original model.
4. After export, use Arno's RADitor tool to assign a fitting model radius and bounding box to the exported, FSX native model file.
5. Change the model's model.cfg to point to the exported model.

That should do it.


You will lose any special XML coded animations, visibility conditions and get worse night lighting, but that's a small price to pay for better FPS, right?
 
#19
Hi

I seem to have a problem. I have exported the model as an FSX.MDL file but there are two files one is fsx_aia_747_400d_ge.x which is 4066kb (the original is aia_747_400d_ge.mdl that is 1029kb) and an fsx_aia_747_400d_ge.xanim which is 0kb.

also when exporting the file I got this error:

An error occured during exporting the selected file

Message:
There are multiple root elements. Line 14625, position 2.

StackTrace:
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
at System.Xml.XmlTextReaderImpl.Throw(Int32 pos, String res)
at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace)
at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc)
at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
at System.Xml.XmlDocument.Load(XmlReader reader)
at System.Xml.XmlDocument.Load(String filename)
at ASToFra.Utils.ModelDef.EnsureModelDefLoaded()
at ASToFra.Utils.ModelDef.FindGUID(String name)
at ASToFra.ObjectWriter.XWriter.WriteXANIMFile(String fileName, ObjectModel obj)
at ASToFra.ObjectWriter.XWriter.Write(String fileName, ObjectModel objectModel)
at ASToFra.ObjectWriter.MDLXWriter.Write(String fileName, ObjectModel objectModel)
at ASToFra.ObjectWriter.AllObjectWriter.write(String fileName, ObjectModel objectModel, Int32 filterIndex)
at ASToFra.ModelConverterX.MainWindow.bwExporter_DoWork(Object sender, DoWorkEventArgs e)
what has happened?
 
Last edited:

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#20
Hi,

It seems your modeldef.xml is not valid. The message says you have multiple root elements in there. That's why modelconverterx failed to read it (it shouldn't crash on that though, I should make it more robust).
 
Top