This is it, thought Koichi Hayashida as he heard the ear-splitting creaks of the building as it began to wrench apart. I could die.

Hayashida, a game director at Nintendo's Tokyo development studio, had been in the middle of a presentation, explaining the Super Mario design philosophy to a group of external game developers.

Nintendo typically didn't do much outsourcing on the Mario games. But Super Mario 3D Land was on a rather tight development schedule; there was a mandate to get it on shelves for the all-important holiday season to boost the sales of the Nintendo 3DS. One of the outside teams enlisted to get it done was Brownie Brown, a Nintendo subsidiary also located in Tokyo. This was their first trip over to the Mario team's office.

Working with outsiders was a new and challenging experience for Hayashida. Nintendo's game design philosophy was second nature to his team. How was he going to get Brownie Brown on the same page? He decided to show them the first level of the last game he'd directed, Super Mario Galaxy 2, explaining why enemies and obstacles were placed just so. He tried to impart to the Brownie Brown members some of the helpful insights that Mario creator Shigeru Miyamoto had shared with him during his nearly 20 years at Nintendo, in the hopes that they'd be able to work in harmony alongside his team and get the all-important new game done.

The day was March 11, 2011. At 2:45 p.m., a 9.0 magnitude earthquake struck a few miles off the coast, the biggest tremor to ever hit Japan.

"I heard this horrible sound inside the walls, like something breaking.""We were used to getting tremors in our Tokyo office, of course," Hayashida said. But this one was different. First, they felt a quake that was bigger than usual, but not entirely out of the ordinary for Japan. But then they felt a second, even bigger, tremor.

"When the second one happened we knew it was definitely different," he said. "All of us had received training ever since we were kids in elementary school, to get under our desks whenever there is a very big earthquake. But this was so shocking that for a moment we weren't sure what to do." Eventually, some of the people in the conference room had the presence of mind to get underneath the desks, and Hayashida followed suit.

That's when he heard it, he said, "this horrible sound inside the walls, like something breaking." Hayashida, up on the fifth floor conference room, thought the building was going to come down. As it turned out, although a few light fixtures had fallen down and some of the air ducts had broken apart, Nintendo's Tokyo office was still standing. But the ordeal had just begun. A devastating tsunami and a nuclear plant meltdown were still to come.

The Brownie Brown staff members lived near their offices in Kichijoji, clear across town from Nintendo's building in Asakusabashi. But the trains had all shut down following the quake. They had to walk seven hours back home.

Nintendo's main headquarters was located in Kyoto, about three hours away by bullet train. Some of the Tokyo staff had been visiting the main branch that day, and couldn't get home for a week.As the magnitude of the damage became known and the nuclear scares worsened, Nintendo wasn't sure if it would be able to continue development in Tokyo at all.

"We were concerned about radiation and power outages, and there were lots of large aftershocks," Hayashida said. "Every time we left the house, there was this question of, are we in danger of radiation? So I didn't leave the house very much. Of course, there was nothing to do at home."

Super Mario 3D Land.

Image:Nintendo

Without his work, Hayashida didn't know what to do with himself. Away from Nintendo, he was cut off from the people he spent most of his life with. In Japan, you might work with someone for decades and never see them socially, drawing a bright-line distinction between company life and private time. Hayashida and his team had never even exchanged their private contact information.

"Normally at work we don't share our personal email addresses with our colleagues," he said, "but we realized it would be kind of scary if we didn't know how to contact each other." Hayashida risked the slight breach of etiquette and shared his email with the Super Mario team, giving them the opportunity to join in. One developer set up a web forum where they could chat.

The Tokyo office stayed closed for about a week. Around that time, Hayashida found the inspiration to keep going.

Close to his apartment, work was still progressing on a new Tokyo landmark – a tall broadcast and observation tower called Tokyo Sky Tree, which when finished would be the tallest structure in all of Japan and the second tallest in the world.

"When I heard that construction had resumed on this building immediately after the earthquake despite the fact that people had said it was really swaying a lot back and forth during the earthquake, that really had an impact on me," Hayashida said. "I realized that people were going on with their lives and their routine. And I thought to myself... maybe we could get back to work."

With the team reassembled at the Tokyo office, Hayashida addressed them after the game's producer had spoken. Construction had resumed on Sky Tree, he said. "They're building again. They're doing what they do. Doing what we do is our best possible contribution."

Hayashida encouraged his team to communicate more, to band closer together. The office was already set up so that programmers, designers and all sorts of different people sat scattered amongst each other, so that they could see each other's work and talk about it.

"Once we had the earthquake I think that we started to encourage each other... to try and work with each other in a slightly new way," he said.

Taking that idea further, the team started gathering in the common area all at once to sit and playtest Super Mario 3D Land's levels as they came together.

"It felt like playing games at our friends' house when we were kids," he said in a Game Developers Conference lecture earlier this month.

Nintendo released Super Mario 3D Land on November 3 in Japan to universal acclaim; in January it became the first 3DS game to sell over 5 million copies worldwide. The office building in Asakusabashi had largely suffered cosmetic damage, and the team is still working there today.

For some survivors of the quake, a fun videogame was just what they needed to lift their spirits.

"This game has been like a light finally shining into what has been such a depressing time," read one Japanese fan's comment, which Hayashida shared at GDC. "I feel like this game has given me the power to go on living. It's something like a miracle."