If a giant object looks like it's going to slam into Earth, humanity has a few options: Hammer it with a spacecraft hard enough to knock it off course, blast it with nuclear weapons, tug on it with a gravity tractor, or even slow it down using concentrated sunlight.

We'll have to decide whether to visit it with a scout mission first, or launch a full-scale attack immediately.

Those are a lot of decisions to make under existential duress, which is why a team of MIT researchers have come up with a guide, published February in the journal Acta Astronautica, to help future asteroid deflectors.

In movies, an incoming asteroid is usually a very last-minute shock: a big, deadly rock hurtling right toward Earth like a bullet out of the darkness, with only weeks or days between its discovery and its projected impact. That is a real threat, according to an April 2019 presentation by NASA's Office of Planetary Defense that Live Science attended. But NASA believes that it's spotted most of the largest, deadliest objects that have even a small chance of striking Earth — the so-called planet killers. (Of course, there are probably plenty of smaller rocks — still large enough to kill whole cities — that remain undiscovered.)

Related: Top 10 ways to destroy Earth

Because most of the large objects in Earth's neighborhood are already being closely watched, we'll likely have plenty of warning before one strikes Earth. Astronomers watch these space rocks as they get near Earth to see whether they're likely to cross through one of their "keyholes." Every Earth-threatening asteroid gets closer and further from Earth at different points in its orbit around the sun. And along that path, near Earth, it has keyholes. Those keyholes are regions of space that it has to pass through in order to end up on a collision course during its next approach to our planet..

"A keyhole is like a door — once it's open, the asteroid will impact Earth soon after, with high probability," Sung Wook Paek, lead author of the study and a Samsung engineer who was an MIT graduate student when the paper was written, said in a statement.

Related: This newly discovered asteroid is the second-closest natural object to the Sun

The easiest time to stop an object from hitting Earth is before it hits one of those keyholes, according to the paper. That will keep the object from getting on the route toward an impact in the first place — at which point saving Earth would require far more resources and energy, and involve much more risk.

Paek and his co-authors tossed out most of the more exotic asteroid-deflection schemes out of hand, leaving only nuclear detonation and impactors as serious options. Nuclear detonation is problematic as well, they wrote, because it's uncertain exactly how an asteroid will behave after a nuclear explosion and because political concerns about nuclear weapons could cause problems for the mission.

In the end, they landed on three options for missions that could reasonably be prepared on short notice if a planet-killer asteroid were spotted heading toward a keyhole:

A "type 0" mission where a single, heavy spacecraft was fired at the incoming object, aimed using the best available information about the object's makeup and trajectory to knock it off course.

A "type 1" mission where a scout is launched first and collects close-up data about the asteroid before the main impactor is launched, in order to better aim the shot for maximum effect.

A "type 2" mission where one small impactor is launched at the same time as the scout to knock the object a bit off course. Then all the information from the scout and the first impact are used to fine-tune a second small impact that finishes the job.

The problem with "type 0" missions, the researchers wrote, is that telescopes on Earth can only gather rough information about planet killers, which are still faraway, dim, relatively small objects. Without precise information on the object's mass, velocity, or physical makeup, the impactor mission will have to rely on some imprecise estimates, and has a higher risk of failing to properly knock the incoming object out of its keyhole.

Type 1 missions are more likely to succeed, the researchers wrote, because they can determine the incoming rock's mass and velocity far more precisely. But they also take more time and resources. Type 2 missions are even better, but take yet more time and resources to get underway.

Related: Crash! 10 biggest impact craters on Earth

The researchers developed a method for calculating which mission is best based on two factors: the time between the mission start and the date the planet killer will reach its keyhole, and the difficulty involved in properly diverting the specific planet killer.

Applying those calculations to two well-known planet-killer asteroids in Earth's general neighborhood, Apophis and Bennu, the researchers came up with a complex set of instructions for future asteroid deflectors in the event one of those objects started heading for a keyhole.

Given enough time, they found, type 2 missions were almost always the right way to deflect Bennu. If time was short, though, a quick-and-dirty type 0 mission was the way to go. There were just a handful of instances where type 1 missions made sense.

Apophis was a different, more complicated story. If time was short, a type 1 mission was usually the best option: collect data quickly in order to properly aim the impact. Given more time, type 2 missions were sometimes better, depending how difficult it appeared to be to deflect from its course. There were no situations where a type 0 mission made sense for Apophis.

In both cases, if the time got too short, the researchers found no mission would be successful at diverting the rock.

The differences between the rocks came down to the level of uncertainty about their masses and velocities, as well as how their internal materials would react to an impact.

These same basic principles could be used to study other potential planet killers, and future studies could incorporate other options for deflecting the asteroids, including nuclear weapons, the researchers wrote. The more complex the list of options, the more difficult the calculation gets. Eventually, they wrote, it would be useful to train machine learning algorithms to make decisions based on the exact available data in any planet-killer scenario.

Originally published on Live Science.