Between President Barack Obama’s commitment to sending humans to Mars by the 2030s and Elon Musk’s plans to fully colonize the red planet, it’s become increasingly clear that a human is going to land on Mars before the end of this century. Even NASA is bullish on the idea, saying that an Earth-independent colony is possible by 2030. It’s just a matter of who figures out how to get there first. And though the United States has learned a lot about hurtling into space and landing equipment on faraway planets, there are still plenty of logistical challenges left to solve—like how to safely navigate Mars’ treacherous terrain and wind gusts of 55 miles per hour, where to build safe habitats, and, perhaps most importantly for the psychical and psychological health of our future martian brethren, what to eat on Mars.

Scientists already have a fairly good understanding about what to eat in space. Fortunately for current and future space explorers, the quality and variety of food in space has advanced far beyond the applesauce in tubes and sugar tablets with water of John Glenn’s day—and it’s been well-established that humans can swallow food in zero-gravity. There’s even a fairly wide variety of foods available to astronauts, some of which are surprisingly gourmet, like South Korea’s infamous space kimchi in a can.

These space foods are, by necessity, long-lasting and shelf-stable, because missions can last for months. That means they’re preserved either by freeze-drying, like that astronaut ice cream you can get at the gift shop of the National Air and Space Museum, or thermostabilization, like a can of tuna in your own pantry.

Many of these staples, like shelf-stable tortillas, rehydratable vegetables, and peanut butter, will make their way to Mars. But they may have to be reengineered to endure an even longer shelf life. “If you’re talking about a Mars mission, you’re talking about a three year shelf life for food,” estimates Leonard David, award-winning space journalist and author of Mars: Our Future on the Red Planet, a companion book to the new National Geographic TV series called Mars that envisions life in a colony on the red planet.

Vickie L. Kloeris, a senior food scientist at NASA’s Johnson Space Center, puts that number even higher. “The challenge we have for that first mission to Mars is that we know the foods that they eat on the return trip are going to be somewhere between five and seven years old,” she explains in a phone interview. “We have to make sure the food is going to have enough nutrition in it, because food, as it ages, the nutritional content degrades over time.” The challenge, then, is creating food that will last for literally years without losing too much of its nutritional value.

That’s not the only struggle, of course. There are the logistical challenges of bringing enough of these prepackaged foods to feed a whole colony of folks on another planet for months on end. “Water, fuel, food consumption, and just the living quarters themselves,” says David. “That’s a lot of mass that’s got to go 150, 160 million miles away and land on the planet.” Kloeris echoes that concern, adding, “All the supplies for the crew will be pre-positioned on an unmanned cargo vehicle before the crew is launched. They can’t take it all with them. There’s just too much.”

Though there are about 200 different food options sent up with American astronauts on the ISS, the choices will, almost by definition, be more limited than those available here on Earth, and astronauts run the risk of suffering from menu fatigue, of eating the exact same foods for months—or, potentially in the case of a Mars colony, years—at a time. There’s also no real option to cook in microgravity (though astronauts do occasionally get creative with their food, like with breakfast tacos, made by slapping a bunch of freeze-dried and rehydratable ingredients onto a tortilla), which means that the food that’s brought up is the only stuff available.

Menu fatigue sounds like a trivial issue, but it can severely affect astronauts’ health and ability to function, and making sure there’s enough interesting food on Mars is mission critical to ensuring the long-term health of potential Mars explorers. According to researchers at the University of Hawaii, Manoa, who received $1.2 million from NASA to study the psychological and psychosocial factors of this kind of long-term space travel, when astronauts suffer from food fatigue, they, “tire of eating even foods they normally enjoy, and their overall food intake declines, putting them at risk for nutritional deficiency, loss of bone and muscle mass, and reduced physical capabilities.”

The Hawaii Space Exploration Analog and Simulation (HI-SEAS) is a series of experiments designed to address some of these questions, specifically how to keep food from getting boring when you’re stuck in a geodesic dome with five other humans for an extended period of time.

That’s exactly what happened in April 2013, when six researchers embarked on a four-month long simulation of life on Mars, called HI-SEAS Mission 1. This food study was designed “to compare classic astronaut fare of pre-made, prepackaged meals to a new system that allows for combining a limited number of shelf-stable ingredients,” according to a profile of the study in the New Yorker. The so-called terranauts prepared dishes that only used techniques and ingredients that would potentially be available to astronauts on Mars, and they got creative. Recipes included Thai red curry, Tibetan tsampa porridge, so-called “Martian” sweet-and-sour-chicken-and-cabbage soup, and, since it is Hawaii, Spam ‘n Egg Baowiches.

There are certain nutritional considerations, of course. “The problem with shelf-stable ingredients is that they’re usually highly processed and hence lacking fiber,” explains HI-SEAS Commander Angelo Vermeulen in an interview with Astrobiology Magazine. “We enjoy wheat bread, rye crackers, nuts, and dried fruits for example.”

But Vermeulen explains that the ingredients that will become essential aren’t necessarily the obvious ones, and the crew didn’t really suffer from food fatigue, except when it came to the prepackaged foods. “It’s essentially some of the pre-prepared food that we quickly got tired of,” he says. “That Kung Fu chicken always comes back to mind.” 

That’s why the ingredients that will be crucial for a mission to Mars aren’t necessary the most obvious, like better bread or less chewy eggs. “Ingredients that will be essential for future space missions on Mars or the Moon will include spices, herbs and hot sauce,” Vermeulen explains. “But also comfort food such as Nutella, peanut butter and margarine.” These ingredients cut through the monotony of the shelf-stabilized and pre-prepared foods, and providing these much-needed breaks will help stave off menu fatigue.

Other, more high-tech, ways of fighting menu fatigue, besides bringing up a couple jars of Nutella, have been proposed, including 3D printing. 3D printing, also known as additive manufacturing, has been in use on the ISS for several years now. The idea is that bringing the materials needed to 3D print tools as needed is more space-efficient than bringing up every tool that might possibly be needed ever. And 3D printing works in zero-gravity; on 2014, astronauts printed a plastic ratchet wrench that was used for repairs.

Being able to 3D print food would solve several problems: It could theoretically cut down on the sheer volume and mass of food that must be shipped to Mars, and it would also allow for a more interesting and wider variety of food stuffs. Push a button, get a plate of pancakes printed right before your eyes, just like Star Trek.

That’s why, in May 2013, NASA awarded Systems and Materials Research Consultancy a grant to study, “3D printing of foods to determine the capability of this technology to enable nutrient stability and provide a variety of foods from shelf stable ingredients, while minimizing crew time and waste.” This food synthesizer would rehydrate and then layer powdered ingredients—specifically carbs, proteins, and the different nutrients that have been thoroughly dehydrated.

The obvious food to make with this technology, given the layering, is pizza, and Anjan Contractor, the founder of Systems and Materials Research Consultancy, explained to Quartz how the system would work. First the machine would expel and “print” a layer of dough:

which is baked at the same time it’s printed, by a heated plate at the bottom of the printer. Then it lays down a tomato base, ‘which is also stored in a powdered form, and then mixed with water and oil,’ says Contractor. Finally, the pizza is topped with the delicious-sounding ‘protein layer,’ which could come from any source, including animals, milk or plants.

Unfortunately, it seems like 3D-printed space pizza is still a far-off dream—even though you can get 3D-printed pizza here on Earth, as demonstrated in the video uploaded to YouTube by Contractor in 2013, below—and though the concept of printing food in space is still discussed by NASA, it’s only theoretical. Even if 3D printers for food get up and running by 2030, for the foreseeable future, these dishes will be more of a novelty, or a break in the monotony of regular, old space food, than anything else.

That’s also where science is at with growing live plants in space. “What we kind of anticipate for Mars is that...hopefully, they’ll be able to grow and pick and eat some crops like lettuce and cherry tomatoes to add to their packaged food system,” says Kloeris, but adds, “It’s honestly going to be more of a psychological impact to the menu than an actual nutritional impact to the menu, because the volumes are just going to be pretty small.”

Eventually, David imagines a permanent human settlement on Mars with a self-sufficient greenhouse where inhabitants can grow plants and produce their own foods, a planet where all of these technologies can come together to not only allow humans to function but to be comfortable. After all, “We’re talking about not only surviving on Mars but thriving,” says David, “and it’s the thriving part that’s really going to be hard,” and being able to find comfort in food, as we do here on Earth, will play a bigger role in that than we think.