She saw large windows throughout a modern building, nature outside and avatars of humans and robots chatting.

What appeared before Crystal Dougherty’s eyes wasn’t a figment of her imagination. It was a computer-generated world created by AltspaceVR, a virtual reality software company in Redwood City.

“It’s almost like an adventure. You meet so many different people from so many different cultures. They all have different views about life,” said Dougherty, who lives in Las Vegas and makes friends in virtual reality.

With virtual reality headsets such as the HTC Vive and Oculus Rift being shipped this year, digital places where people can chat and do activities alongside friends, families or new faces are already springing to life online. These digitally constructed worlds resemble spaces that people visit every day — a house, bar, park or even a beach. Others push the boundaries of what exists in real life.

“There’s a big gap between the best electronic communication tool we have and video chat and being in the same room,” said AltspaceVR CEO and founder Eric Romo. “The opportunity for social VR is to be somewhere in between the two, and our guys like to talk about how it’s going to be even better.”

Exploring a jungle maze, throwing discs in a golf course, watching videos and even playing Dungeons & Dragons in a medieval tavern are just some of the activities possible in AltspaceVR.

When Facebook purchased virtual reality startup Oculus for $2 billion in 2014, CEO Mark Zuckerberg laid out a vision for the immersive technology that went beyond gaming and into everyday life. Executives from both companies have talked about a future where people who are miles apart can watch a baby’s first steps, travel to cities throughout the world or interview for a job as if they are physically there by putting on a virtual reality headset.

Still, executives at VR companies acknowledge that social virtual reality won’t become mainstream overnight. Virtual reality headsets can be as expensive as purchasing a new laptop, and some, such as the Oculus Rift, require a high-end computer. Creating avatars and surroundings that are indistinguishable from real life is also a tough feat.

In 2016, an estimated 7.2 million virtual reality headsets will be shipped worldwide, according to SuperData, a research firm in New York. Though the firm found that the majority of Americans have no interest in virtual reality or don’t know what it is, SuperData projects that the industry will grow and that by 2020 about 16 percent of U.S. households will have a virtual reality device. During that year, the virtual reality industry is projected to reach $40.3 billion in revenue worldwide. Social VR is estimated to rake in $2.7 billion in revenue in 2020, up from $8 million in 2016.

To interact in these virtual worlds, people need an avatar, a digital representation of themselves. Dougherty, who has straight, highlighted hair and blue eyes, uses a curvy, dark gray and red robot in AltspaceVR. In real life, she feels anxious when approaching strangers, but in virtual reality she’s outgoing and throws parties.

“I don’t have that feeling of judgment, which makes me really into social VR,” said Dougherty, who uses the Samsung Gear VR.

Humans are wired for virtual travel, said Jim Blascovich, a retired psychology professor at UC Santa Barbara who co-founded the Research Center for Virtual Environments at the college and co-authored the book “Infinite Reality.” While technology takes it to another level, the desire to escape to another world predates virtual reality, and some research shows that people spend almost half their waking hours daydreaming.

And with tech firms still grappling with online harassment, child pornography and other dark sides of the Internet, there will be positive and negative experiences in these worlds where people can quickly alter their digital appearances. “People who seem like normal, outstanding citizens can be total perverts online. One of the things about technology is there’s always the dual use issue,” Blascovich said.

Even before Facebook was founded in 2004, and the media attention around virtual reality returned, tech companies were creating virtual places. In 2003, Linden Lab launched Second Life, an online virtual world where people could create digital representations of themselves, explore different destinations, role play and even purchase land and property. Second Life even has its own currency called the “Linden dollar” exchangeable for U.S. dollars. The virtual world made headlines back then, but with about 1 million users, it never lived up to all the hype.

“The big problem, which is what’s now changing, is the hardware to create that immersion was still the mouse and the screen of a fairly good computer,” said Philip Rosedale, who founded Second Life. “We still didn’t have the ability to fully immerse your senses inside the space.”

Now, with virtual reality hand controllers being released, Rosedale thinks that will change. In 2013, he started a new company called High Fidelity, an open source virtual reality platform that allows people to explore and create their own digital environments and avatars. The software is still being tested, but a Burning Man-inspired carnival, a bright green golf course with foliage overhead and even the inside of an animal cell have already been created. Avatars, some of which resemble people in real life, are levitating, flying and even walking through walls.

“We can literally create another New York City and let everyone move into it, and that’s what we’re going to do,” Rosedale said. “People will start putting up these servers and create these islands rising out of the digital ocean that are places that people can come to.”