The download hangar is currently disabled. We're doing our best to bring it back as soon as possible.

Animating Nose Wheel Steering in AI Planes

Discussion, tutorials,hints and tips relating to designing military ai aircraft.
Post Reply
peluso5
Second Lieutenant
Second Lieutenant
Posts: 28
Joined: 09 Jul 2016, 21:15
Version: P3D

Animating Nose Wheel Steering in AI Planes

Post by peluso5 »

Hi.

Can somebody point me to the right direction in animating the nose wheel steering?, I tried animating the part as the FSDS book 4 says, animating in full 360 degrees at 200 frames, but seems that this is not for AI planes, I´m using FSDS and I just need the steps on how to do it, I can animate propellers, flaps, tires, gear, but the nose wheel is giving me a headache.

Thanks in advance for your time and help

Tony
User avatar
John Young
MAIW Developer
MAIW Developer
Posts: 4222
Joined: 12 Jul 2008, 15:15

Re: Animating Nose Wheel Steering in AI Planes

Post by John Young »

It's doable Tony, but tricky and not very precise.

You need a small cube animated like this:

KF:0=far left
KF:100= straight ahead
KF:200=far right

The xml code is this:

<part>
<name>anim_nose_gear_steering</name>
<animation>
<parameter>
<code>
(A:ATTITUDE INDICATOR BANK DEGREES, degrees) -0.1 &lt; (A:VELOCITY BODY Z, knots) 8 &lt; *
if{ 100 }
els{ (A:ATTITUDE INDICATOR BANK DEGREES, degrees) -0.1 &lt; (A:VELOCITY BODY Z, knots) 40 &lt; *
if{ 125 }
els{ (A:ATTITUDE INDICATOR BANK DEGREES, degrees) 0.1 &gt; (A:VELOCITY BODY Z, knots) 8 &lt; *
if{ 200 }
els{ (A:ATTITUDE INDICATOR BANK DEGREES, degrees) 0.1 &gt; (A:VELOCITY BODY Z, knots) 40 &lt; *
if{ 175 }
els{ 150 }
}
}
}
</code>
<lag>20</lag>
</parameter>
</animation>
</part>

The nose leg itself will need it's own name (c_gear) so link this to the cube. The fun starts trying to keep the gear leg straight as it retracts.

You will also need to experiment with the number of degrees in the animation left and right. You can also fine tune to an extent with the lag value. I used it on the Poseidon/Wedgetails and on the 767 derivatives, but haven't used it since. It's not worth the aggravation in my view, particularly on smaller aircraft.

John
User avatar
MIKE JG
MAIW Developer
MAIW Developer
Posts: 10976
Joined: 12 Aug 2006, 02:25
Version: MSFS

Re: Animating Nose Wheel Steering in AI Planes

Post by MIKE JG »

Also seems to not be worth the effort for the small stuff like a fighter. It's barely noticeable on a little aircraft. Much more noticeable on something larger.
-Mike G.

Recovering flight sim addict, constant lurker.

Check out my real life RV-8 build here: RV-8 Builder Log
peluso5
Second Lieutenant
Second Lieutenant
Posts: 28
Joined: 09 Jul 2016, 21:15
Version: P3D

Re: Animating Nose Wheel Steering in AI Planes

Post by peluso5 »

John:

First thanks for your quick response, I will try to explain my problem in my poor English.

My big problem is how to do it in FSDS, I can do the part to work, but only from center to one side, not in both ways, so if the animation goes from center to right, so when the plane turns to the right in FSX, the part turn right.

I need to know where to start the animation; part at the center of the z axis (0 Deg), or 30 deg. right or left and set a keyframe or what, then the next step, rotate to left right, how many deg.

I tried to start the animation at center, at far left, and far right, rotate to the left, rotate to the right, but I get the same result, from center to one side.

Tony
peluso5
Second Lieutenant
Second Lieutenant
Posts: 28
Joined: 09 Jul 2016, 21:15
Version: P3D

Re: Animating Nose Wheel Steering in AI Planes

Post by peluso5 »

Mike:

Thanks for the advise, but I'm not doing just small planes, I have converted some big birds from AIA, AIM, and others for my personal use, and I would like to have that animation in those models.

Tony
User avatar
MIKE JG
MAIW Developer
MAIW Developer
Posts: 10976
Joined: 12 Aug 2006, 02:25
Version: MSFS

Re: Animating Nose Wheel Steering in AI Planes

Post by MIKE JG »

Good to hear!

As far as the animation in FSDS, for my KC/C-135 models, I started the animation at key frame 100 because that is the down and locked ending key frame for the nose gear.

From there I made the rotation 25 degrees to the left at KF100, centered at KF140 and KF160, then 25 degrees to the right at KF200.

Here's the code that made it all work:

<part>
<name>anim_nose_wheel</name>
<animation>
<Parameter>
<code>
(A:LIGHT BEACON,bool) (A:RADIO HEIGHT,feet) 100 &lt; &amp;&amp;
if{ (A:LEFT WHEEL RPM, rpm) (A:RIGHT WHEEL RPM, rpm) - 2 * (A:VELOCITY BODY Z, knots) 5 / / 150 + }
els{ 140 }
</code>
<lag>75</lag>
</Parameter>
</animation>
</part>

Full disclosure here: I have very little idea how this code does what it does, Kevin wrote it and only he can explain it fully but instead of using the attitude indicator as a trigger to move the nosewheel left and right, it looks at the RPM of the left main and right main gear and triggers the animation based off of what those are doing.

IOW if the left main RPM is less than the right main RPM, the airplane is turning left and the left wheel displacement is triggered.

It's still black magic to me but we know this is a working code. I think that coding will even work in FSX but again Kevin will have to verify that.
-Mike G.

Recovering flight sim addict, constant lurker.

Check out my real life RV-8 build here: RV-8 Builder Log
User avatar
John Young
MAIW Developer
MAIW Developer
Posts: 4222
Joined: 12 Jul 2008, 15:15

Re: Animating Nose Wheel Steering in AI Planes

Post by John Young »

Mike's suggestion for allocating KF:0 to 100 for the nose leg raise/lower is a good one and it's one I've used before to try and keep the leg straight when moving.

I've never managed to use the code I posted successfully in FSX unfortunately. Mikes code could work however if it's sandwiched in the FSX top and tail format and has the animation line and GUID in the top (Model info) section of the xml file.

John
User avatar
John Young
MAIW Developer
MAIW Developer
Posts: 4222
Joined: 12 Jul 2008, 15:15

Re: Animating Nose Wheel Steering in AI Planes

Post by John Young »

Mike, I've just been trying your code on the FS9 B-47 nose wheel. It certainly could be more stable, but I'm getting a position flick at KF:100 (25* left). Could you just tell me what position the nose wheel is at KF:0 and KF:99 in your set up please? Is it straight ahead or 25* left?

If I can get this to work properly in FS9, I'll test the code in FSX and post the code block in that format for Tony.

John
User avatar
MIKE JG
MAIW Developer
MAIW Developer
Posts: 10976
Joined: 12 Aug 2006, 02:25
Version: MSFS

Re: Animating Nose Wheel Steering in AI Planes

Post by MIKE JG »

Full credit for that code goes to Kevin, I know very little about how it works.

The animated part (parent polygon that the rest are child parts of) is at 0 degrees rotation at both KF0 and KF99.

Not sure if that helps.
-Mike G.

Recovering flight sim addict, constant lurker.

Check out my real life RV-8 build here: RV-8 Builder Log
User avatar
John Young
MAIW Developer
MAIW Developer
Posts: 4222
Joined: 12 Jul 2008, 15:15

Re: Animating Nose Wheel Steering in AI Planes

Post by John Young »

That's what I thought Mike and that's what I was testing. The aircraft spawns OK with the nose wheel facing forward, but on departure from the spot it gives a 25* flick to the right and back again. The right turn off the parking line is nice and smooth as is the return to straighten up. A left turn of 25* is smooth, but flicks back instantaneously to straighten up.

I don't know if the problem is the transition between KF:99 (0*) and KF:100 (-25*). If Kevin could stop by and explain the code and the key frame settings (0-200) that will probably help. I'm not sure if wheel diameter has any bearing on the code.

John
peluso5
Second Lieutenant
Second Lieutenant
Posts: 28
Joined: 09 Jul 2016, 21:15
Version: P3D

Re: Animating Nose Wheel Steering in AI Planes

Post by peluso5 »

Mike, John:

Thanks for your help, but I think that my problem is not related to how I do it in FSDS, I tried every thing you posted, used different animation codes, different positions of the gear, and always is the same, from center to one side, I found a FSDS source file with animated nose wheel, in FSDS works fine, but as soon as I compile the model, the problem begins.

Tony
User avatar
John Young
MAIW Developer
MAIW Developer
Posts: 4222
Joined: 12 Jul 2008, 15:15

Re: Animating Nose Wheel Steering in AI Planes

Post by John Young »

Tony, is the entry in your FSX modeldef.xml file in FSX format, with the additional line at the top and a unique GUID? The scripts above are in FS9 format. I was hoping to post the FSX script for you once I'd tested it, but I want to get the animation 100% right in FS9 first.

It maybe that it just doesn't work in FSX. That's not unusual. I've never yet made nose wheel steering work in FSX, however untidy it is.

John
User avatar
Weescotty
MAIW Developer
MAIW Developer
Posts: 2770
Joined: 11 Aug 2006, 22:15
Version: FS9
Location: Sydney

Re: Animating Nose Wheel Steering in AI Planes

Post by Weescotty »

Despite all the plaudits, if I remember correctly the code came from fsdeveloper?

Yup it did....
http://www.fsdeveloper.com/forum/thread ... ai.153490/
User avatar
John Young
MAIW Developer
MAIW Developer
Posts: 4222
Joined: 12 Jul 2008, 15:15

Re: Animating Nose Wheel Steering in AI Planes

Post by John Young »

That was a really useful read Kevin and I'm getting much better results now.

I can confirm that the code works for FS9:

<part>
<name>ai_nose_wheel</name>
<animation>
<Parameter>
<Code> (A:LEFT WHEEL RPM, rpm) (A:RIGHT WHEEL RPM, rpm) - 2 * (A:VELOCITY BODY Z, knots) 5 / / 150 +
</Code>
<lag>30</lag>
</Parameter>
</animation>
</part>

KF:0= straight ahead
KF:100 =25* left
KF:140= straight ahead
KF:160= straight ahead
KF:200 25* right

For the very large wheels on the B-47, I found a deflection of only +- 25* was sufficient and a lag value of 30 smoothed things out.

The code also works very well in FSX so long as FSX format is used:

<Animation name="ai_nose_wheel" guid="3abc2ea7-2e71-43bb-b248-0eab72ddbbca" length="200" type="Sim" typeParam2="ai_nose_wheel" typeParam="AutoPlay" />

<PartInfo>
<Name>ai_nose_wheel</Name>
<AnimLength>200</AnimLength>
<Animation>
<Parameter>
<Code> (A:LEFT WHEEL RPM, rpm) (A:RIGHT WHEEL RPM, rpm) - 2 * (A:VELOCITY BODY Z, knots) 5 / / 150 + </Code>
<Lag>30</Lag>
</Parameter>
</Animation>
</PartInfo>

Remember to change the GUID in the top section entry and add the animation tag to the ai_nose_wheel part.

I found I was chasing my tail in earlier efforts. In the Gmax window, the animation between KF:0 and KM:100 would cause the nose leg to retract at a side-ways angle in addition to the usual retraction. This cause the nose wheel to stick out of the side of the fuselage when retracted. I tried several key frames to pull it back, but in the sim that just made things worse. In the end I realised that although the anomaly was showing in Gmax, FS9 and FSX just ignored it and the gear retracted straight up into the bay without any sideways deviation.

Long time coming for me, but I'm glad it worked for both FS9 and FSX in the end.

John
peluso5
Second Lieutenant
Second Lieutenant
Posts: 28
Joined: 09 Jul 2016, 21:15
Version: P3D

Re: Animating Nose Wheel Steering in AI Planes

Post by peluso5 »

John:

Thanks, and yes i I have the right code, and I also have the entry on the top of the xml in fsx format with the unique guid, but still no luck, I tried to do the animation in big planes and also in GA planes but I got the same problem, from center to one side

Tony
User avatar
John Young
MAIW Developer
MAIW Developer
Posts: 4222
Joined: 12 Jul 2008, 15:15

Re: Animating Nose Wheel Steering in AI Planes

Post by John Young »

Tony, have you applied the animation tag for the part? It won't work without it. The full KF range also needs to be specified, ie 0-200, not 100-200.

When you say "centre to one side" is that in the FSDS animation or in FSX? It's the thing that fooled me in Gmax. I was trying to correct something that the sim was ignoring anyway.

If the problem is in FSX could you possibly post a screen shot of the wheel so we can see what's happening please?


John
peluso5
Second Lieutenant
Second Lieutenant
Posts: 28
Joined: 09 Jul 2016, 21:15
Version: P3D

Re: Animating Nose Wheel Steering in AI Planes

Post by peluso5 »

John:

Yes it has the animation tag, yes i begin with KF 0 and set the KF, then 100, 140, 160, 200.

Center to one side in FSX, i took a break on the nose wheel to clear my mind, as soon i finish the models I'm working with i will go back to the nose wheel, and then post a screen shot.

Thanks

Tony
User avatar
MIKE JG
MAIW Developer
MAIW Developer
Posts: 10976
Joined: 12 Aug 2006, 02:25
Version: MSFS

Re: Animating Nose Wheel Steering in AI Planes

Post by MIKE JG »

Can't tell you how many times that taking a break and coming back to something later on did the trick. You'll get it sorted out. Curious to see what you're working on!
-Mike G.

Recovering flight sim addict, constant lurker.

Check out my real life RV-8 build here: RV-8 Builder Log
peluso5
Second Lieutenant
Second Lieutenant
Posts: 28
Joined: 09 Jul 2016, 21:15
Version: P3D

Re: Animating Nose Wheel Steering in AI Planes

Post by peluso5 »

Mike:

That's why I took a break, it really works.

About your curiosity, you and all the members of MAIW will like what the team are doing.
Post Reply