Gordon Hayward couldn't get the image out of his head. Lying in bed at night, the All-Star would close his eyes and try to lull his mind to sleep, but he would see it anyway: his left foot gruesomely bent sideways, the wrong way. Most nightmares are figments of the brain's imagination. But for Hayward, this horror story was real.

"You lay awake, you can't fall asleep," Hayward tells B/R Mag, looking back at the first sleepless nights following his traumatic injury in the Boston Celtics' season opener.

Plenty of players have suffered major injuries, but few have had it play out in gruesome fashion in front of a national audience. A total of 6.7 million people watched the Cavs-Celtics game, nearly double the audience of last season's opener on TNT. This past year, more people have searched for Hayward in Google than any NBA player. Even LeBron.

But injuries like Hayward's are often felt most acutely not in the bones but in the brain. Hayward opened up about that on his personal website, admitting in a Nov. 1 blog post that his "thoughts started to go to a very dark place." This was the part of the rehab that many warned him about—the mental scarring and daily psychological struggle to keep going.

How do you get over that? For Hayward, the prescription could be found in, of all things, video games. "It helps you turn your mind off from constantly thinking about the injury," Hayward says now.

Talk to other players who've been through this—Kevin Ware, Shaun Livingston and Paul George—and they'll say the mental aspect was the cruelest part. Hayward distracts his brain and fills it with positive associations. He pings his childhood friends and Utah buddies alike, rallying them to play Destiny 2 with him late at night. And in those moments, he isn't Gordon Hayward, the guy whose foot went sideways in front of the world.

Video Play Button Videos you might like

Hayward may be onto something. Perhaps the most effective way to get over the mental wounds is to go to an alternate world. Believe it or not, the secret to rehabbing from a traumatic injury might lie in video games and virtual reality.

The Celtics are secretly trying to find out.

Chris Pizzello/Associated Press/Associated Press

Livingston still sees it. Over a decade has gone by since a 21-year-old Livingston landed awkwardly on his left leg during a game against the Charlotte Bobcats, dislocating his kneecap and rupturing just about every tendon in the knee joint. But even after his two championship runs with the Golden State Warriors, the daily reminders won't let him forget that image of his deformed knee.

There are uplifting reminders, to be sure. Adoring fans at arenas around the world thank him for inspiring their own rehabilitations and congratulate him on his journey into the NBA's circle of champions. Those are the good ones.

But injuries like Hayward's often rip open an emotional wound. Seconds after Hayward went down, Livingston's phone inevitably blew up with the news and photos of the injury. But the Golden State guard couldn't bring himself to watch the clip.

"I don't watch those plays anymore," Livingston told B/R Mag. "The eyes are the windows into the soul. It's just a mental standpoint about not putting that stuff into your head."

Livingston can relate to the road ahead for Hayward. Indeed, the physical pain can be torturous at times, but Livingston is quick to point out that the loneliness and emotional disconnect can be just as overwhelming.

In his case, his knee rehab forced him to be away from the Los Angeles Clippers for good; the organization let his contract run out even though it drafted him No. 4 overall. Twenty months would pass before Livingston played on an NBA court again.

"It's like a basketball death," Livingston says. "Life just goes on without you. Being out of sight, out of mind, that's the hardest part. It's the same way if you were to pass away. Life will keep on going."

To replace the hours he spent in the gym, Livingston picked up new hobbies to occupy his mind. There was no virtual reality, no FaceTime to see loved ones in a pinch nor any video games that allowed him to interact with teammates on the road. He leaned on his family to keep him in a positive state of mind.

"The mental side is the most important side," Livingston says. "Your thoughts, the people around you, your self-esteem, how do you feel—all the cliches and all the proverbs. If you believe you can do it, you will. Our human nature allows us to have fear, have doubt to creep in, that just comes with the territory."

Livingston became an avid reader, starting and finishing entire books in one day to keep his mind from going to the darkness. He obsessively read about former NFL running back Willis McGahee, who went through a similarly graphic injury. Livingston visited Hollywood sets while films were being made to get away, taking advantage of his proximity to the epicenter of the film industry.

"The unfortunate part of it is the reality that [the Celtics] have got to keep playing," Livingston says of Hayward's situation. "The league still has games. Contracts are still in order. It's just part of it. The sooner that you accept that reality, the easier it is to attack the rehab."

There were days when Livingston didn't want to get out of bed. Wanted to take the day off. But his friend Art Jones knocked on his door every morning and didn't stop pounding until Livingston got up.

"Gordon can overcome it," Livingston says. "He can get back to the same player he was with the right team around him—which I know he'll have—and the right mindset. There's definitely no stopping him. This won't stop him. I know he's going to get through it. But my line is open."

Kevin Ware was watching when Hayward fell, and, like Livingston's, Ware's phone wouldn't stop buzzing. He was reliving it.

"Here we go again," Ware said to himself.

After contesting a shot during the 2013 NCAA tournament's Elite Eight, Ware suffered a compound fracture in his leg that left his broken bone protruding through his flesh. Millions at home watched. His teammates on the court sobbed.

Louisville would go on to win the championship and ceremoniously cut down the net. Knowing Ware couldn't climb the ladder, the team had the hoop lowered so Ware could take part. It meant the world to him.

"It was pretty cool," Ware says. "It was a blessing being in that situation, but I'd rather be playing of course. I don't really pride myself off of being the guy who broke his leg, the guy who couldn't play in the national championship."

Chris O'Meara/Associated Press

For months, Ware rehabbed his injury and fought off the mental temptations to hang it up for good. To Ware, there wasn't a low point in rehab because "personally, every day was a low point."

But here's the thing. The psychological trauma wasn't only his. Ware hadn't fully comprehended the profound effect his injury had on his teammates until he made his return to the practice court about seven months later. The game was shockingly easy to Ware, like he somehow picked up a superpower during his rehab. Ware would drive to the basket untouched. He would run the offense with almost no ball pressure from his teammates. He seemed to operate in space much more than he ever had in a game for Louisville.

And then it hit him. Perhaps he wasn't the only one who was traumatized by the injury. Ware realized that his teammates may be taking it easy on him.

"It was tough," Ware says of his on-court experience with teammates. "Not just the players, the coaches too."

Ware believes his team was soft on him, subconsciously being less physical for fear of re-injuring his leg. The same teammates and coaches who were rooting him on during his rehab suddenly felt distant to him.

"I didn't think I deserved to be babied because I put in the hard work that they saw me do," Ware says.

But he doesn't blame them.

"They did a complete 180, but it's understandable," Ware says. "I felt kind of alone, alone from everybody."

Needing a fresh start, Ware decided to transfer, enrolling at Georgia State in 2014 to play with R.J. Hunter, whom the Boston Celtics drafted after that season.

"It was time for me to go," Ware says. "Definitely time for me to go."

That decision was a homecoming of sorts for the Atlanta native. He spent more time with his mother, who helped him pull through a rehab filled with Netflix (Ware marathoned through the entire seasons of Breaking Bad and Sons of Anarchy).

And the hard work paid off. Ware reached the NCAA tournament again in 2015. Georgia State, a No. 14 seed, upset third-seeded Baylor in the first round. And he fulfilled his dream of playing pro ball. Now, as he suits up for Larissas Faros of the Greek Basket League, he offers a message for Hayward: "Just look at guys like myself and Paul George who came back from the same thing. It's doable."

If Hayward is addicted to competition, Multiple Marble Madness is a drug he can't quit.

It's a game that Hayward and his longtime trainer, Jason Smeathers, invented last month to break up the mind-numbing monotony of ankle rehab. Here's how it works: spread out 17 marbles on a towel on the floor and when the timer starts, pick up each marble with your toes and drop it into a box as quickly as possible.

The first time Hayward attempted this rehab task was the day he had his cast removed. Knowing Hayward's insatiable need for competition, Smeathers busted out a timer on his phone. How quickly could Hayward get those 17 marbles into the box using his injured foot?

First, Hayward tried it with his right foot, the good one. Thirty-nine seconds. Smeathers wrote it down in his notepad. And with his left? That took longer, much longer. Four minutes and 57 seconds, to be exact. Hayward promised he'd shave seconds off his time every single day and vowed to get it under 30 seconds come playoff time.

Multiple Marble Madness is one of two games that Hayward has added to his daily ritual. The other? That's called the Celtics Chair Challenge, which he plays with Celtics staffers and requires taking up to five shots from half court while sitting in a chair. To add some juice to the game, Hayward decided each shot would cost $1. The first to hit the shot wins the pot.

AP Photo

Curious about Hayward's new personal record in Multiple Marble Madness?

That's 32.6 seconds. Almost 10 times as fast as his first try.

Everything is a competition in Hayward's life. He spends one to two hours a day playing Destiny 2 as soon as his young daughters go to bed at night.

"Since I'm not allowed to compete right now with the Celtics, video games is where I can get my competition in," Hayward says.

It's a hobby the Celtics are eager to leverage for his health. In December, the team decided to incorporate video games into his rehab and open up competitions with his teammates and staff. They're in the exploratory stage.

"Virtual-reality stuff," president of basketball operations Danny Ainge says. "We're trying to figure out a way to do some video games that can actually be of benefit to his basketball play."

The Celtics are tight-lipped about Hayward's video game "project,'' as he and Celtics head coach Brad Stevens call it. The team signed non-disclosure agreements with a video game company and is prohibited from speaking about the particulars.

Rather than chuckle at Hayward's hobby, Stevens embraces video games as a tool for learning. He didn't always think that way. But five years ago, he read a book called Now You See It by Duke professor Cathy Davidson. It details how brain science and technology will transform the 21st century. After reading it, Stevens changed his entire outlook on gamers, including his 12- and eight-year-old kids who play "all day long."

"It's maddening, right?" Stevens says. "But there's also great value, because they're building skill. They're building grit. They're figuring out what they like to accomplish. It's like a community.''

For Hayward, this unique kinship with Stevens, a primary reason he chose the Celtics in free agency this past summer, is paying off.

"He knows I'm passionate about it," Hayward says of Stevens' video game collaboration. "He's trying to keep me distracted from just always thinking about the injury."

Felipe Dana/Associated Press

Dr. Michael Casale wanted to help Derrick Rose.

As a Chicago native and lifelong Bulls fan, it was tough for Casale to see the former MVP struggle in his recovery from an ACL injury. This was March 2013, 10 months after Rose underwent surgery on his left knee. Reports then came out that doctors had medically cleared Rose to play with about 20 games remaining in the regular season.

But instead of returning to his team in a playoff run, Rose couldn't get over the psychological hurdle of trusting his knee.

"I'm feeling good," Rose told reporters after being cleared by doctors. "But if I'm still not feeling right, I don't mind missing this year."

Rose ended up sitting out the remaining games and watched the Bulls lose in the conference semifinals to the Miami Heat. A medically cleared player sitting out voluntarily? Fans routinely questioned Rose's heart.

But not Casale. To Casale—a cognitive neuroscientist and chief science officer at StriVR labs, a virtual-reality training company that works with at least three NBA teams—this had nothing to do with Rose's competitive fire or being "soft." His brain was likely just as injured as his knee.

"It's not a matter of hard work or wanting to succeed," Casale says of Rose. "As a scientist, I think about how, for an MVP to back off like that, his injury must have caused so much mental trauma. The neuroscience part of me comes out and starts to think about, as far as the brain rewiring, it must be so unbelievably impactful to have that one moment change the way you think about yourself and your environment."

Casale's job with StriVR is to think about these problems and try to come up with workable solutions for teams. He has studied and explored ways that virtual reality can alleviate symptoms associated with post-traumatic stress disorder and similar afflictions. Rather than suppressing traumatic experiences, new research shows that revisiting or "provoking" those moments can help alleviate PTSD symptoms and behavior.

Virtual reality has already hit the NBA. Last season, StriVR worked with athletes such as Detroit Pistons center Andre Drummond and Washington Wizards center Ian Mahinmi to improve free-throw shooting simply by having them watch themselves make free throws in VR.

But it can help players recover from traumatic injury as well. For instance, Minnesota Vikings quarterback Teddy Bridgewater used StriVR to help him experience team practices and run through the playbook when he wasn't allowed to practice. Jeremy Bailenson is the co-founder of StriVR, founding director of Stanford University's Virtual Human Interaction Lab and author of Experience on Demand: What Virtual Reality Is, How It Works, and What It Can Do. In the book, he discusses his work revitalizing Arizona Cardinals quarterback Carson Palmer's career with virtual reality.

Hayward told B/R Mag he has mixed feelings about VR. He sees the potential, but he's more focused on video games that simulate battle and mirror team play like basketball. In its current state, VR caters to football players who can simulate standing in the pocket, but a stationary perspective isn't as lifelike for basketball players who are almost always on the move.

"It's not really there yet," Hayward says of VR, "at least not competitively where you go against other players. That's my favorite type of video game."

Casale agrees that VR isn't on the same playing field from a gaming standpoint as Destiny 2 or NBA 2K. But VR has shown the ability to help identify triggers that provoke stressful reactions. Coaches, therapists and trainers can then use that sensory information to better control those negative reactions. This sort of therapy is not uncommon for those with PTSD.

Can it work for NBA athletes? Casale thinks we're not far away. For example, in VR, the Celtics could put Hayward courtside and have him experience a game while measuring his heart and sweat rate. They can see what he's looking at when he's getting stressed. Perhaps it's when he sees a stretcher? Or maybe every time a player launches into the air during a layup? Or maybe it's a certain sound that creates anxiety?

The NBA is still searching for answers to improving the mental side of injury recovery. In late November, Rose abruptly left the Cavs for two weeks, citing frustration with injuries. In an interview with The Undefeated, Rose says he is taking a different approach than in 2013.

"I'm good," Rose says. "A lot of people think I'm depressed because of what I'm going through. It's the total opposite. I learned from my mistakes three or four years ago when I put myself into a shell."

LeBron James isn't taking the psychological aspect lightly.

"We want him to be as great as he can be off the floor first before he even thinks about being on the floor," James told reporters.

Chris Szagola/Associated Press

Gordon Hayward's iPad holds 500 clips of Paul George playing basketball.

His trainer (Smeathers) and Boston video coordinators put them there. None of the clips come from pre-injury George. All show George's play following his return to the NBA after a horrific incident while playing with Team USA in 2014, in which he landed on the stanchion in Las Vegas and snapped his leg. As fate would have it, Hayward witnessed that firsthand just a few feet away on the Team USA bench. Hayward watches these clips every day for positive reinforcement, a reminder that he can do this, a reassurance of what's possible.

Hayward and George's careers are woven together like cloth. They were drafted in the same class. Hayward went No. 9. and George No. 10 … to Hayward's hometown Indiana Pacers. They were born fewer than two months apart and play the same position with almost identical all-around games. They even signed with the same agency coming out of college.

"Paul and I have been close since the beginning," Hayward says. "From the get-go, there were all kinds of things that made our paths continually cross. But I never thought we'd have an injury like the ones we had. It's kind of weird that it happened to both of us."

So maybe it isn't so surprising they'd find themselves lifting each other up from devastating injuries that happened in front of a national audience.

Seconds after watching Hayward's injury, George fought off the nausea, grabbed his phone and texted his former Team USA teammate. They talked later that night on the phone. George emphasized the mental side during his constant texting to Hayward.

George's message: It's OK to feel down.

"With the nature of the injury, there's going to be rough days and good days," George says. "Some days, I felt really good and I felt like I was ready to turn that corner. And then right after that, next day, I felt like I was back at square one. There was pain in the leg again. It was hard to walk, hard to move. It felt like I wasn't progressing like the previous day. That was the rough patch mentally."

They've been in constant communication since. Hayward tries to watch George from afar. For a while, Hayward couldn't bring himself to watch games because it hurt too much to see where he wasn't. This hits people differently. George used to watch clips of himself on YouTube for inspiration, proof in times of doubt that he was capable of playing at a high level.

But letting go is half the battle.

"The toughest part about it and what people don't understand is you have an expectation of where you've been and the level you've played at your whole career," George says. "And you want to get back to that so fast, but you've got to be mindful that you're coming back to a new league. New players. Different teams. Different schemes. It's a whole different game he's coming back to."

Life moves on without you. All those feelings creep back up, those pangs of failure and urges to try to somehow turn back time.

"It's tough," George says. "You can't play the game like you once played it. It's a toll on us that people just don't understand."

So how did George get over it?

He laughs, knowing Hayward is right there with him again.

"Video games."

Tom Haberstroh has covered the NBA full time since 2010, and joined B/R Mag after seven years with ESPN as an NBA insider and analytics expert. Haberstroh is also a co-founder of Spotlight Media Ventures and regularly hosts The Basketball Friends podcast for the Leverage The Chat multimedia network. Follow him on Twitter: @tomhaberstroh.

Click here to get B/R Mag on the go in the new B/R app for more sports storytelling worth your time, wherever you are.