ChrisViral / RealChute

Realistic parachutes for KSP
47 stars 38 forks source link

Auto Bailout / Ejection Seats for EVA Parachutes #24

Closed sumghai closed 4 months ago

sumghai commented 9 years ago

This is a blue-sky/distant-future idea I had, which I'm documenting here so that it doesn't get buried in the forums thread.

Automatic Bailout

23 currently describes the EVA Parachute feature, where a user manually controls a Kerbalnaut climb out of a pod hatch, let go of the hatch ladder, and deploy his/her personal parachute.

Something that could be extremely convenient (especially in OHSHITSHITABORT scenarios or with pods crewed by multiple Kerbals) is the ability to semi-automate this process, in which triggering the appropriate right-click context UI button or an action group would cause all the Kerbals in the pod to automatically jump out and inflate their chutes with no further user intervention.

From an algorithmic perspective:

  1. User triggers auto bailout feature through UI button / action group
  2. Spawn a Kerbal in airlock collider (in IVA skin)
  3. Force Kerbal to automatically let go of airlock ladder
  4. Deploy Kerbal's personal parachute
  5. Wait 1 second
  6. Repeat steps 2 to 5 for each Kerbal until entire crew of that pod has bailed out

    Ejection Seats

An extension of this aforementioned feature would be to implement actual ejector seats as an optional means of bailout. The reason for having two distinct methods is because:

One of the key issues with implementing ejector seats in KSP is that the airlock transform (where the Kerbal spawns no EVA) is not neccessarily in a sensible location/orientation for ejector seat operation; as such, a convenient means of specifying an alternative EVA spawn transform is required, one which would not require extensive rework of stock or mod crew pods.

The proposed solution is to add parameters to specify a location and orientation relative to the root transform of the pod (x,y,z coordinates plus rotation vector); if ejector seats are enabled, then the auto-bailout feature would use this programmically-specified transform as the new place to spawn the ejecting Kerbal.

Ow, my head!

If the craft is inverted or there is an obstruction over the cockpit canopy, the ejecting Kerbal might slam into debris / the ground.

A safe distance (in meters) along the ejection transform could be specified - i.e. if the ground or obstruction is detected within this distance, bailout is not possible.

(ASIDE: In the case of inverted flight, some real-life ejection seats like the Zvezda K-93 are gyro-stabilized, and actually able to right itself in mid-air after ejecting upside-down; but that's really pushing the limits of what we can do for RealChutes)

Bringing It Altogether

Despite the differences between ejection methods, I believe we can combine them into a single PartModule that can handle both cases:


MODULE {
        name = RealChuteBailout
        ejectorSeatModel = path/to/ejectorseat/model   // optional variable, defaults to false (in which case ejector seat functionality is disabled, and the Kerbal simply falls off the hatch with the bailout EVA chute)
                                                       // we won't bother with alternative seat textures, as they would imply different seat models anyway
        ejectionStartPosition = 1.0, 1.0, 0.0          // optional variable, the starting position in meters relative to the pod's own orientation that the Kerbal in the ejector seat will spawn
        ejectionVector = 0.0, 1.0, 0.0                 // optional variable, the direction the Kerbal in the ejector seat will fly out
        ejectionForce = 100                            // self-explanatory
        ejectionObstructionCheck = 20                  // optional variable, the minimum distance in meters from ejectionStartPosition along ejectionVector that must not be obstructed by terrain or other parts before ejection is allowed, defaults to false (in which case the Kerbal will get ejected even if there is an obstruction)

        (other parameters for determining chute diameter, deployment speeds, the usual, yada yada...)
}

I know this is going to be a huge undertaking, but the reason I proposed this as part of RealChutes instead of spinning it off as its own plugin is so that one doesn't unnecessarily duplicate code (specifically, the parachute code).

If you like, I can figure out flowcharts / pseudocode to make the development process easier.

TedThompson commented 9 years ago

Don't forget mods as you consider this. Tantares and other Vostok pods come to mind as candidates for ejector seats.

Also I find in most circumstances hitting EVA in flight results in a free falling kerbal as he/she can't hold on. Otherwise I'd use KAS and load a chute for the kerbal to "grab" on EVA!

Just $0.02 from a non coding RealChutes user.

Sent from my iPhone

On Mar 10, 2015, at 4:47 PM, Robin Chang notifications@github.com wrote:

This is a blue-sky/distant-future idea I had, which I'm documenting here so that it doesn't get buried in the forums thread.

Automatic Bailout

23 currently describes the EVA Parachute feature, where a user manually controls a Kerbalnaut climb out of a pod hatch, let go of the hatch ladder, and deploy his/her personal parachute.

Something that could be extremely convenient (especially in OHSHITSHITABORT scenarios or with pods crewed by multiple Kerbals) is the ability to semi-automate this process, in which triggering the appropriate right-click context UI button or an action group would cause all the Kerbals in the pod to automatically jump out and inflate their chutes with no further user intervention.

From an algorithmic perspective:

User triggers auto bailout feature through UI button / action group Spawn a Kerbal in airlock collider (in IVA skin) Force Kerbal to automatically let go of airlock ladder Deploy Kerbal's personal parachute Wait 1 second Repeat steps 2 to 5 for each Kerbal until entire crew of that pod has bailed out Ejection Seats

An extension of this aforementioned feature would be to implement actual ejector seats as an optional means of bailout. The reason for having two distinct methods is because:

Only some crew pods (e.g. Mk1 Inline and Bahamuto's Mk2 Lightning) are depicted as having bubble canopies that permit the use of ejector seats; other pods (e.g. Mk1-2 Pod and Mk3 Cockpit) have hatches located far from Kerbal seats, making ejection seats infeasible compared to the default let-go-of-hatch bailout.

Ejector seats can launch the crew to a safe distance from a disintergrating aircraft

Which way do I eject?

One of the key issues with implementing ejector seats in KSP is that the airlock transform (where the Kerbal spawns no EVA) is not neccessarily in a sensible location/orientation for ejector seat operation; as such, a convenient means of specifying an alternative EVA spawn transform is required, one which would not require extensive rework of stock or mod crew pods.

The proposed solution is to add parameters to specify a location and orientation relative to the root transform of the pod (x,y,z coordinates plus rotation vector); if ejector seats are enabled, then the auto-bailout feature would use this programmically-specified transform as the new place to spawn the ejecting Kerbal.

Ow, my head!

If the craft is inverted or there is an obstruction over the cockpit canopy, the ejecting Kerbal might slam into debris / the ground.

A safe distance (in meters) along the ejection transform could be specified - i.e. if the ground or obstruction is detected within this distance, bailout is not possible.

(ASIDE: In the case of inverted flight, some real-life ejection seats like the Zvezda K-93 are gyro-stabilized, and actually able to right itself in mid-air after ejecting upside-down; but that's really pushing the limits of what we can do for RealChutes)

Bringing It Altogether

Despite the differences between ejection methods, I believe we can combine them into a single PartModule that can handle both cases:

MODULE { name = RealChuteBailout ejectorSeatModel = path/to/ejectorseat/model // optional variable, defaults to false (in which case ejector seat functionality is disabled, and the Kerbal simply falls off the hatch with the bailout EVA chute) // we won't bother with alternative seat textures, as they would imply different seat models anyway ejectionStartPosition = 1.0, 1.0, 0.0 // optional variable, the starting position in meters relative to the pod's own orientation that the Kerbal in the ejector seat will spawn ejectionVector = 0.0, 1.0, 0.0 // optional variable, the direction the Kerbal in the ejector seat will fly out ejectionForce = 100 // self-explanatory ejectionObstructionCheck = 20 // optional variable, the minimum distance in meters from ejectionStartPosition along ejectionVector that must not be obstructed by terrain or other parts before ejection is allowed, defaults to false (in which case the Kerbal will get ejected even if there is an obstruction)

    (other parameters for determining chute diameter, deployment speeds, the usual, yada yada...)

}

I know this is going to be a huge undertaking, but the reason I proposed this as part of RealChutes instead of spinning it off as its own plugin is so that one doesn't unnecessarily duplicate code (specifically, the parachute code).

If you like, I can figure out flowcharts / pseudocode to make the development process easier.

— Reply to this email directly or view it on GitHub.

sumghai commented 9 years ago

@TedThompson:

Don't forget mods as you consider this. Tantares and other Vostok pods come to mind as candidates for ejector seats.

I'm aware of those as well.

This is why I'm proposing CFG-defined values for the ejection transform, so that mod makers won't have to modify their pod models to support the ejection feature.

Also I find in most circumstances hitting EVA in flight results in a free falling kerbal as he/she can't hold on. Otherwise I'd use KAS and load a chute for the kerbal to "grab" on EVA!

The original feature (#23) won't use KAS, but something coded into RealChute.

TedThompson commented 9 years ago

I am very much looking forward to that! I will finally be able to do a proper Vostok mission! ^_^

Sent from my iPhone

The original feature (#23) won't use KAS, but something coded into RealChute.

— Reply to this email directly or view it on GitHub.

ChrisViral commented 9 years ago

Mind be worth mentioning that this is very very far off. There is a loooooot of features I believe are much more important to implement before anything else. This stays on the table, but it's very low priority by the moment.

TedThompson commented 9 years ago

Ejection seats or parachutes for kerbals?

I can live without the ejection seats. But I am very interested in kerbals spawning with chutes on them in atmospheres.

Sent from my iPhone

On Mar 11, 2015, at 11:18 AM, Christophe Savard notifications@github.com wrote:

Mind be worth mentioning that this is very very far off. There is a loooooot of features I believe are much more important to implement before anything else. This stays on the table, but it's very low priority by the moment.

— Reply to this email directly or view it on GitHub.

ChrisViral commented 9 years ago

EVA chutes are the main feature for the next update.

sumghai commented 9 years ago

@StupidChris:

EVA chutes are the main feature for the next update.

Correct. This is described in #23

Everything else here in #24 is just blue-sky stuff I'm documenting so I don't forget.