Military AI Works • AI wing sweep XML
Page 1 of 1

AI wing sweep XML

Posted: 17 Apr 2018, 20:14
by DC1973
Hi folks,

I'm sorting out the animations for Nick's F-14 to convert to FSX. There are some odd things happening: animations that run correctly in FSDS 3.5.1 are running in reverse in the sim. I've not encountered this before - I've had a look back through the threads and can't see any posts that highlight this issue.

So far, I have the original model in FSDS. Parts are animated fine, but often without parent parts ( especially wing sweep ). I've identified the FSX format XML coding for the wingsweep, which is;

<PartInfo>
<Name>custom_anim_wing_sweep</Name>
<AnimLength>100</AnimLength>
<Animation>
<Parameter>
<Code>
(A:LIGHT NAV, bool)
if{ (A:ENG1 COMBUSTION, bool)
if{ (A:LIGHT STROBE, bool) if{ 0 } els{ 50 } }
els{ 100 }
}
els{ 0 }
</Code>
<Lag>50</Lag>
</Parameter>
</Animation>
</PartInfo>

and I've popped the GUID code at the top of the modeldef.xml in FSX.

I'm not sure what I'm missing here. I'll keep cracking away at it and post if I figure it out, but if anyone has any ideas please do share them! :)

Cheers,
Dean

Re: AI wing sweep XML

Posted: 17 Apr 2018, 21:17
by Firebird
I wrote the xml for the wing sweep and fortunately I found it.

The original code was :-

Code: Select all

<part> 
  <name>anim_wings</name> 
    <animation> 
      <parameter> 
        <code> 
        (A:AIRSPEED MACH, mach) 0.4 &lt; 
        if{ (A:LIGHT STROBE, bool)
        	if{ 30 } 
        	els{ 0 }
        }
        els{ (A:AIRSPEED MACH, mach) 0.75 &gt; 
        	if{ 100 } 
            els{ (A:AIRSPEED MACH, mach) 200 * 50 - }
         } 
        </code> 
        <lag>20</lag> 
      </parameter> 
    </animation> 
</part> 
Was that the code that you were originally running? If so you are saying that it was working backwards in FSX?

Re: AI wing sweep XML

Posted: 17 Apr 2018, 21:26
by DC1973
Hi Steve,

I retrieved the XML from the F-14 wings and it was a MACH code as per the one I posted that was running the wings and glove vane animations. I don't think that the code is the issue as it all makes sense - I think that this is FSDS doing one and messing up the axis, despite the axis all being fine and the part happily parented as it should be.

The code I had seems to ensure that the wings remain swept when the airplane taxies and is shut down, as per the F-14.

Very confusing, but I've heard that FSDS does this from time to time...

Re: AI wing sweep XML

Posted: 17 Apr 2018, 22:59
by Firebird
The code you posted most recently isn't for the wing sweep. That is a 3 position setting rather than the variable sweep of the F-14.

Are you trying a different wing sweep code?

Sorry, if I am being dense here, I am just trying to understand whether the code you posted above mine is the one that you are trying to use for the wing sweep or not.

Re: AI wing sweep XML

Posted: 18 Apr 2018, 08:07
by DC1973
I've tried your code Steve and the result is the same. The code that I posted at the top of the thread was the one attached to Nick's original model on the wings. It does have that three-position sweep animation also, which ties in with the XML.

However I don't think the code is the problem. I think that it's FSDS causing the issue, whereby it seems to "remember" old animation settings even when they've been changed. The axis for the wings is set correctly, and they animate perfectly within FSDS, but once you get the model into MCX the wings have their axis switched 180 degrees and the animation runs in reverse. I'm sure there's a way around it and I'll figure it out in the end.

The other animations applied to the airplane, such as tires and undercarriage all work just fine.

Re: AI wing sweep XML

Posted: 18 Apr 2018, 11:18
by Firebird
OK.
I thought I was sure, but sometimes to just blurt things out w/o checking can bite you in the bum. So, I went back and checked the F-14 in FS9.

The wing sweep is completely variable between M0.4 and M0.75 when it is fully swept back. Now obviously I don't know what model you are testing but I am guessing that if you used the untouched FS9 F-14 model in FSx, with all its flaws you will see it.
It is worth noting that to get it to M0.75 you would have to test on a flight that goes over FL080 so that its speed increases above 250KIAS.
However, something useful did come out of the testing. I remembered that Nick had the wing sweep animation set differently to others because the F-14 always parked with wings swept. In fact it had a parking sweep of 75 degs instead of the in flight 68 degs.
I think Nick animated the 75 degs sweep, but I could be wrong here.
Anyway because of the wing sweep travel, Nick set the 0 frame to fully swept, the 30 frame to fully forward (20 degs) and then frame 100 for fully swept (68 degs).

It maybe that you assumed that the anim was more linear than that or the conversion process didn't cope with it.

Maybe this helps explain what you are seeing, and also explains why the original xml is so different to the one that you quoted up top.

If I can be any help, let me know. Especially if you need my xml explaining.

Re: AI wing sweep XML

Posted: 18 Apr 2018, 17:49
by DC1973
Firebird wrote: 18 Apr 2018, 11:18 If I can be any help, let me know. Especially if you need my xml explaining.

Thanks Steve, I have a basic knowledge of XML coding and am learning fast but much of it is still a foreign language to me :)

I'll post an update once I figure out what the FSDS problem is.

Re: AI wing sweep XML

Posted: 18 Apr 2018, 19:30
by Firebird
Amen to that, Dean.
Using RPN doesn't make life easy that is for sure. I remember it took me a bit of time to get that code right.

Re: AI wing sweep XML

Posted: 19 Apr 2018, 12:34
by DC1973
Just updating the thread here: the problem was indeed with FSDS in that a corrupted animation was blocking the compile in general. Once I located it, things started working better.

I have to create parent parts for all animations on the F-14 but it will be worth it in the long run, as we'll have a source file that works and can be altered as required for use in FSX / P3D in the future and is up to date with all XML added etc. More work than a standard conversion, but a labour of love and all that :)