c172p-team / c172p

A high detailed version of the Cessna 172P aircraft for FlightGear
GNU General Public License v2.0
80 stars 43 forks source link

Break wing inflight (+ gears on ground) due to excessive forces #134

Closed wlbragg closed 9 years ago

wlbragg commented 9 years ago

This is one I really want to do. We have the modeled effect and the consequent FDM effect in place. I need the force calculations from the FDM?

dany93 commented 9 years ago

@wlbragg, Yes, not what I "want", but what I "mean". Nothing left beyond the strut = Tip "gone" = Half of the wing. I guess that's the easier from what you have already done, and it is enough to see what happened.

wlbragg commented 9 years ago

We're on the same page!

"not what I "want"" I understand your explanation of not "wanting", as in a potential order or demand. I use the term "want" interchangeable with "mean", (probably my poor English skills even though it is my native language), I would never take anything coming from you as anything other that simply trying to convey an idea. No worries! It's a good idea and let's see if we can make it happen.

wlbragg commented 9 years ago

Something like this? bwing1 bwing2 bwing3

wlbragg commented 9 years ago

I guess it will take at least 4 new wings in the damage model.

I think we will need logic for the following

left broken, right no damage left broken, right damaged right broken, left no damage right broken, left damaged

The pictures are of right broken, left damaged.

Do we also want both wings broken (as in both wings missing)?

dany93 commented 9 years ago

Very nice. Sure, people will be amused!

Do we also want both wings broken (as in both wings missing)?

Yes.

I didn't realize it took one model per combination. I believed each part was independent. We already have "left damaged", "right damaged", "both damaged". With both wings broken it will be complete, this is the more important which is still lacking. In case you would prefer limiting the number of combinations, if one wing is broken, that is not important to see the other as being damaged or not damaged.

Which makes:

or, more clearly,

onox commented 9 years ago

Why not make each side independent?

dany93 commented 9 years ago

Taking into account the problems with the floats and amphibious, I don't know if wlbragg has enough time to do important changes. But yes, it would be more flexible and easy to use.

wkitty42 commented 9 years ago

i like the pics... if there's enough time to get it in, go for it... but don't push it if there's too much other stuff to get done...

i kinda thought like @dany93 about the combinations... i know that some other (airliner) craft have wing flexure in their models... that requires that the wings be in multiple parts... if these wings are split into three parts, top center from strut to strut, left side wing and right side wing, then the bent up damage, bent down damage, folded down to the ground damage and completely broken off may be easier to do... maybe even two pieces for the left and right sides making 5 in total...

i don't know how complicated that would be for keeping them joined when undamaged and flying, though... this idea would probably be best for the next release after 3.6 but as i say above (and i keep saying) if it can be done in time and be working well, go for it... those of you doing the modeling and coding know what's involved better than others of us :wink: :+1: i just wish i could really contribute more but that'll have to come later as time goes...

wlbragg commented 9 years ago

"Why not make each side independent?" I'd have to think about this one. Something tells me this would be a lot of work? Maybe not, but just the modeling alone would take me quite a while. Issues would be, unless we used (cut up) existing wings all the lights pos might change slightly (that is considerable work, verifying it all in MP, potential major overhaul to the logic involved. It just seems like it would be really major, but it might not be that bad if we think it through. I would wait till next cycle to entertain it.

I'll immediately add both broken.

Do you see left or right broken without damage to the other side?

dany93 commented 9 years ago

Do you see left or right broken without damage to the other side?

Yes, if possible (sorry...). This is the case when the aircraft starts spinning and falling down. The remaining wing can be left (seen) as normal, no matter either it is partially damaged or not.

onox commented 9 years ago

@wlbragg Can you get this done before the feature freeze deadline? Or should we postpone it for 3.8?

wlbragg commented 9 years ago

I think so, I already have the both broken (I think). How many days left?

onox commented 9 years ago

17th of June is the deadline for new features. See https://github.com/Juanvvc/c172p-detailed/milestones

wlbragg commented 9 years ago

Yes, I can get the broken done.

wkitty42 commented 9 years ago

i was going to say 7 days left if you wanted to target the 12th as @gilbertohasnofb is doing with his scenery stuff... that'll give the core guys some time to check it over before the feature freeze... bug fixes can still be handled and submitted after the freeze, though... at least that's my understanding...

onox commented 9 years ago

But feature freeze of fgdata is on the 17th. All we have to do is promise not to sneak in any new features after that data.

wkitty42 commented 9 years ago

true but better to have a bit of a buffer than none and overrun :wink:

wlbragg commented 9 years ago

I made major progress on this tonight. I think I have all five wing models finished and the "both wings broke" coded in and ready to go.

All that is left is to code the following four.

left damaged, right broken left undamaged, right broken right damaged, left broken right undamaged, left broken

Should have it pushed for a pull requests by late tomorrow night.

bothbroke

dany93 commented 9 years ago

left damaged, right broken right damaged, left broken

Are these really necessary? When (only) one wing is broken, I think that merely seeing the other one as not broken is enough. Damaged or intact is not important, I would use "intact = not damaged" model for the other wing in both cases. You save two wing models. See my message https://github.com/Juanvvc/c172p-detailed/issues/134#issuecomment-109261002 (the "more clearly" list, edited later)

wlbragg commented 9 years ago

Necessary no, but their done and I figured that you would normally damage and then break a wing (in that order). So I thought it best that we have it both ways. I think for the most part the logic is already in place so if you damage a wing or both and keep applying force then they will eventually break. Or you could have the instance where you go right from good to broke, I guess.

If it proves to be too much we can remove any we decide is unnecessary.

dany93 commented 9 years ago

Yes, we can have instances where one is only damaged and the other broken. If you have already done them, it is not too much and not an inconvenience, only best. I said this only to save you some time.

wlbragg commented 9 years ago

This is going to need some tuning I think. It appears the wing breaking is fairly easy and I think need to be harder.

Here are the parameters we will have to work with.

Everything as it is now and some new additions we will have to work with.

You originally created two wing damage properties wing-damage/left-wing and right-wing.

You used basically two damage amounts to control damaged or broken in FDM, where damaged is < 1 and broken = 1 wing-damage = 1 triggers wing broken (complete loss of control) and broken wing animation wing-damage < 1 is the amount applied to loss of control and will trigger damage animation

I originally used contacts[4]/broken contacts[5]/broken and crash (this was for collapsed wings) to control animation

I added a new property to help with animation and nasal control, it is wing-both/broken

Each one of these has an alias for animation control local and over MP

So we now have 6 alias we will use to control animations crash = /fdm/jsbsim/crash wing_left_broken = /fdm/jsbsim/contact/unit[4]/broken wing_right_broken = /fdm/jsbsim/contact/unit[5]/broken wing_both_broken = /fdm/jsbsim/wing-both/broken wing_left_damaged = /fdm/jsbsim/wing-damage/left-wing wing_right_damaged = /fdm/jsbsim/wing-damage/right-wing

and we have 6 properties we will use to control nasal and FDM /fdm/jsbsim/crash /fdm/jsbsim/contact/unit[4]/broken /fdm/jsbsim/contact/unit[5]/broken /fdm/jsbsim/wing-both/broken /fdm/jsbsim/wing-damage/left-wing /fdm/jsbsim/wing-damage/right-wing

We may need a little bit of adjustment in how we use them on both FDM/nasal and animation now that we have this complete set of conditions.

Right now I'm finishing up getting all the light animation logic, wing animation logic and wing nasal logic to a point where it is at least correct (but maybe not adjusted perfectly), at which point I'll push to a branch, then I really could use some help fine tuning the damage logic in physics.nas to get it exactly how we want it.

dany93 commented 9 years ago

I do not see wing_both_damaged wing_both/damaged (that was your model with increased diedra, used for both wings broken if I remember well)

It appears the wing breaking is fairly easy and I think need to be harder.

If a wing has touched the ground, even not violently, the aircraft no longer takes off.

wlbragg commented 9 years ago

We don't have a wings-both-damaged, we use "wing-left-damaged and wing-right-damaged" for both.

The animation logic is taking a bit longer than I anticipated, I am doing a bit of refactoring in an effort to get rid of a bunch of extra model part (like I did a while back with gear and propeller). Hopefully I'll push a pull request tonight (in the next couple hours).

wkitty42 commented 9 years ago

@wlbragg yo are doing good, man! don't rush things... it only leads to misteaks :wink:

wlbragg commented 9 years ago

We can close this now if there are no other issues to discuss.

onox commented 9 years ago

I have issues with it unfortunately :cry: See PR #262

onox commented 9 years ago

@wlbragg There's one small issue with the landing light if the left wing has been torn off; it's still visible:

fgfs-screen-025

Also verify that the ALS landing light is no longer visible. Make sure to test this on the runway itself, otherwise you won't see the ALS landing light anyway. You can edit Systems/als-lights.xml for this.

onox commented 9 years ago

I just tried to pull the yoke back hard and the wings broke away in air:

fgfs-screen-026

IMO that should not have happened. The wing should be damaged (bended a little), but not completely torn off :confused:

dany93 commented 9 years ago

https://github.com/Juanvvc/c172p-detailed/issues/134#issuecomment-100706694

V > 180 kt and symmetric flight ==> both wings damaged (degraded lift)

g > 4.4 and flight asymmetry ==> one wing damaged (can still fly, degraded) g > 5.5 and flight asymmetry ==> one wing broken g > 6.6 both wings broken

We can do what we want, but who can say IRL? With these features, we are more in the estimation for the game than in realism... I am not able to affirm that a very short but brutal over-g (here > 1.5 x specs) do not break one or both wings.

wlbragg commented 9 years ago

"You can edit Systems/als-lights.xml for this." Do you know if this will take aliases? EDIT: It doesn't! You did not set up an alias for ALS landing light in MP? EDIT: I guess this is internal viewing only anyway, not visible via MP to others!

wlbragg commented 9 years ago

" landing light if the left wing has been torn off; it's still visible:" I have this fixed already, will PR shortly, after I fix ALS landing and taxi light for the same issue.

onox commented 9 years ago

@Juanvvc @gilbertohasnofb What do you guys think of the over-g?

wlbragg commented 9 years ago

It's not helpful, but I was going to tell you to quite abusing you plane! :)

I think that is the same thing I was a little concerned about. Strictly going by feel (no real quantifiable data), it seems that at the point of total wing destruction (broken wings) it should only be damaged wings, and that the "broken wings" bar should be somewhat higher. I know we don't have much (if any) data covering this but you just don't hear about or see 172's with their wings gone. So it needs to be the most extreme cases, maybe we should limit it to certain conditions. One example of a condition where you loose say one or both wings flat or spiral spin = true and less than 200' AGL That might be one condition where we can loose a wing or two. This is meant to be just an example.

onox commented 9 years ago

Maybe we can first try to just increase the g limits?

What about 4 g + 40% = 5.6 g to damage a wing if it was non-damaged/non-broken. After that, a lower g limit to go from wing damaged to wing torn off. If the wing is non-damaged/non-broken and then gets a high g (something > 7 maybe?) it goes from non-damaged to wing torn off.

Wing collapses if hitting the ground with a high, but not too high g?

wlbragg commented 9 years ago

Agreed, we can fine tune it in the next cycle if we choose.

onox commented 9 years ago

@wlbragg Shall I close this issue? We can create a separate issue with the 3.6 release milestone for tuning the g limits.

wlbragg commented 9 years ago

OK