Programming & Scripting

View unanswered posts | View active topics


Post a new topicPost a reply
Previous topic | Next topic 

User avatar   Experienced Modder Experienced ModderMember since: 28.07.2011, 12:22Posts: 547Location: Hong Kong, and sometimes mainland China Likes: 1
 

 Post Topic: Vehicle physics - action impulse on a helicopter *VIDEO*
PostPosted 07.03.2012, 14:48 
I'm a bit puzzled by the physics of the standard helicopter vehicle in the FreeSDK. In particular, the dampening effect.

If, using flowgraph, I apply a horizontal action impulse... the helicopter will move sideways/forward forever - there is no dampening effect.VIDEO: http://www.youtube.com/watch?v=RoE2ypBV ... e=youtu.be

If, using an identical FG, I apply a vertical action impulse... the helicopter will move up/down, but slows and then stops after a couple of seconds - there is a dampening effect. VIDEO: http://www.youtube.com/watch?v=uTlsZLxy ... e=youtu.be

I've also tried with the helicopter inside a gravity sphere (so, no engine effect, theoretically) and it works identically to the videos.

I actually like the vertical dampening effect, and I've tried with the vehicle editor, but I haven't found a way to apply a horizontal dampening effect to an action impulse.

So, geniuses, any thoughts? :easter:
Attachments:

ImpulseVehicleFG.jpg



  Beginner BeginnerMember since: 31.12.2011, 10:06Posts: 38 Likes: 0
 

 Post Topic: Re: Vehicle physics - action impulse on a helicopter *VIDEO*
PostPosted 09.03.2012, 13:34 
vertical dampening effect you told is caused by gravity ,not resistance.
other damping effect you want,must add by yourself.
User avatar   Experienced Modder Experienced ModderMember since: 28.07.2011, 12:22Posts: 547Location: Hong Kong, and sometimes mainland China Likes: 1
 

 Post Topic: Re: Vehicle physics - action impulse on a helicopter *VIDEO*
PostPosted 09.03.2012, 13:48 
thanks Oopzloop, but imho it isn't caused by gravity, for a few reasons.

- I tried the helicopter in a gravity sphere, in zero G, it makes no difference
- dampening works exactly the same, both upwards and downwards

:easter:


  Beginner BeginnerMember since: 31.12.2011, 10:06Posts: 38 Likes: 0
 

 Post Topic: Re: Vehicle physics - action impulse on a helicopter *VIDEO*
PostPosted 09.03.2012, 14:09 
seems they have some addition work on it......
User avatar   Trained Modder Trained ModderMember since: 21.10.2011, 07:12Posts: 252Location: USA Likes: 0
 

 Post Topic: Re: Vehicle physics - action impulse on a helicopter *VIDEO*
PostPosted 13.03.2012, 01:42 
Did you ever solve this? I just got into the code a bit more, and I notice there is a limit on the height of the helicopter. So, despite the flownode code, there may be overriding actions to keep it from exceeding the height threshold (in a dampening sort of way).. where as there are no limits to moving horizontally.


-Bryan
http://www.SinisterRainbow.com
Image
See Stickman Thread Here - Updated Regularly (Videos, screenies, infinite system integration, more)
User avatar   Experienced Modder Experienced ModderMember since: 28.07.2011, 12:22Posts: 547Location: Hong Kong, and sometimes mainland China Likes: 1
 

 Post Topic: Re: Vehicle physics - action impulse on a helicopter *VIDEO*
PostPosted 13.03.2012, 08:34 
Quote by SinisterRainbow:
there is a limit on the height of the helicopter.


hiya SR, thanks, but the height limit doesn't seem to be causing it:

because the dampening effect is the same with a downwards impulse. The mystery continues...


User avatar   Trained Modder Trained ModderMember since: 21.10.2011, 07:12Posts: 252Location: USA Likes: 0
 

 Post Topic: Re: Vehicle physics - action impulse on a helicopter *VIDEO*
PostPosted 14.03.2012, 23:05 
I took a quick look at lua to make sure it's not happening there - but the the "VehicleMovementHelicopter.cpp" may have an answer?

Code:
683        float horizDamp = m_velDamp;
684        float vertDamp = 1.0f;


I just looked quick, but m_velDamp is initialized to 0.0f in the constructor and in my look, I only saw it changed in the AI portions of code.

Quote by WhiteNorthStar:
Quote by SinisterRainbow:
there is a limit on the height of the helicopter.


hiya SR, thanks, but the height limit doesn't seem to be causing it:

because the dampening effect is the same with a downwards impulse. The mystery continues...


-Bryan
http://www.SinisterRainbow.com
Image
See Stickman Thread Here - Updated Regularly (Videos, screenies, infinite system integration, more)
User avatar   Experienced Modder Experienced ModderMember since: 28.07.2011, 12:22Posts: 547Location: Hong Kong, and sometimes mainland China Likes: 1
 

 Post Topic: Re: Vehicle physics - action impulse on a helicopter *VIDEO*
PostPosted 15.03.2012, 12:43 
thank you, excellent thinking SR, I thought you had solved it... so I changed m_velDamp to 1.0f (and even replaced it with 1.0f) so that I could get that sweet damping effect in horizontal movement
Code:
683        float horizDamp = 1.0f;
684        float vertDamp = 1.0f;


Nothing changed, so I set everything to 0.0f.

But dammit, still exactly the same horiz and vert movement, both inside and outside a gravity sphere.

Puzzling ?(


User avatar   Trained Modder Trained ModderMember since: 21.10.2011, 07:12Posts: 252Location: USA Likes: 0
 

 Post Topic: Re: Vehicle physics - action impulse on a helicopter *VIDEO*
PostPosted 15.03.2012, 21:45 
hrm.. u tried a couple values I suppose too.. Can you CryLogAlways() the dampening value and the chopper's horiz veloctiy while it executes to see if it's not being overridden..? Did you try setting the vertical to 0.0f to see if it stops dampening? I plan on getting to more vehicle stuff in a few months, if you don't solve it before then I'll check it out more, or if I come across anything I'll be sure to let you know.


-Bryan
http://www.SinisterRainbow.com
Image
See Stickman Thread Here - Updated Regularly (Videos, screenies, infinite system integration, more)
User avatar   Experienced Modder Experienced ModderMember since: 28.07.2011, 12:22Posts: 547Location: Hong Kong, and sometimes mainland China Likes: 1
 

 Post Topic: Re: Vehicle physics - action impulse on a helicopter *VIDEO*
PostPosted 16.03.2012, 05:18 
thanks! yeah, I tried the values of both horiz and vert dampening at 1.0f and 0.0f... but no change in anything.

As you say, it is probably being overridden somewhere. I'm on something else now, but I'll test it one of these days.