In the new treatment of planes and the 'layer cake' forest, planes will descend into the forest, slowing down and accruing damage as they go. When the altitude descends to 1/4 the forest height (4m above ground for the 16m forest height), the critical 'danger zone' is entered. In the treatment Mike had kindly developed, crossing the 25% height threshold meant certain obliteration. Certainly better than the stock insta-death just by touching even the forest uppermost surface--at any speed. After using this for a while, I began to reason that there should be some chance of survival if the speed could be brought down low enough.
My provisional scheme is this. Upon crossing the 25% forest height threshold, the plane's speed is polled. If 15m/s or less (~30kt), survival is assured. Between 15-40m/s, the probability of destruction is scaled from 0 to 100%. Meaning that at a speed of ~80kt or faster when at the 1/4 forest height level, death is certain. The 50/50 speed threshold for survival is 27.5m/s, or about 55kt. The randomness applied here means that there is always some chance of death even when the speed at height threshold crossing is barely faster than 15m/s.
Note: The use of the boolean bInDangerZone keeps this polling to a single instance, otherwise a variable probability will be calculated upon every tick following.
Does this approach seem reasonable? Any suggestions on a better speed range for consideration?
I ask in part because this scheme does not consider the plane's actual stall speed. If the plane's FM could be queried for the stall speed and put to use, I would consider it.
Another change I made from Mike's scheme involves the consideration of wingspan as a factor in the rate at which a plane will be slowed by tree collisions. His approach treated a longer wingspan as being more rapidly slowed, due to being intercepted by more trees per unit time at given speed. I mulled that over and reasoned than a longer wing typically attends a heavier plane, which has higher inertia as a compensatory factor. And when looking at the real-life results of planes plowing through a wood, it seems that indeed a big, heavy plane is not notably decelerated compared to a small, light plane. And so I apply a constant slowing factor irrespective of wingspan.
This has the knock-on effect of a big plane, with a generally higher stall speed, not having an opportunity to slow down more aggressively and thus entering the 'danger zone' at a higher speed. Hence the thought to consider the plane's actual stall speed as an additional factor in computing the probability of survival.
And so my next question is this. Can a plane's stall speed be queried? I know that the stall condition is computed in AircraftState() from the angle of attack and altitude. But a hard stall speed would be easier to deal with...
Here's the small, relevant part of the overall method showing the code to compute the probability of obliteration upon crossing the 'danger zone' threshold of 1/4 forest height:
if (inForestFactor >= LETHAL_TREE_HEIGHT)
bInDangerZone = false;
if (inForestFactor < LETHAL_TREE_HEIGHT && this.FM.getSpeed() > 15D && !bInDangerZone)
{
if (TrueRandom.nextFloat() < Aircraft.cvt((float) this.FM.getSpeed(), 15F, 40F, 0F, 1F))
{
this.killByForest();
return;
}
bInDangerZone = true;
}