The comic-book industry has earned billions over the years with variations on one very simple story: do-gooders helping the oppressed defend themselves. It's a tale that resonates strongly with the medium's fans – especially gay readers, who have often faced oppression in the real world and sought solace in superheroes.

This year, finally, the industry embraced those readers as mainstream publishers offered prominent gay plot lines. Archie Comics' first gay character, Kevin Keller, was married in January; Marvel's X-man Northstar was married in May; and DC Comics reintroduced the Green Lantern as gay in June.

"I think any large industry responds more slowly than the culture it feeds, so I think that the prevailing attitude in society are leading popular culture in that direction, towards acceptance, towards embracing all members of their community," said Jono Jarrett, the co-founder of Geeks Out, a group that celebrates the overlap between geek and LGBTQ culture.

The perceived geekiness of comic book culture can mark readers out as somehow odd - and for young gay people coming to terms with a sexual preference that goes against the mainstream, that can be yet another thing that identifies them as different.

"We're trying to address the sense that if you are a gay geek, you are not doubly doomed, you are doubly awesome," Jarrett said.

For older gay comic-book readers, the gay-centric comic-book plot lines of 2012 were an important step towards mainstream acceptance.

"For 2012 in comics, it was really incredible, but it was also a beginning," Jarret said. "It wasn't: 'Oh thank you, now we're satisfied.' It was: 'Thank you, and 'at last' and 'now what?' And it's great, but this is still the beginning."

Gay comic-book characters have been around for decades, but Archie Comics was the first mainstream book to put gay marriage in its pages – a surprising move for a series that evokes the bobby-socks-and-milkshake imagery of the 1950s.

Jon Goldwater, the co-chief executive of Archie Comics, said that when he first came to the company, he held a meeting to ask the writers to come up with contemporary, out-of-the-box pitches that may not have been acceptable to the previous administration.

Archie Comics writer Dan Parent then approached Goldwater with this pitch: a new character shows up in the all-American Riverdale, USA. Veronica, the comic's resident hottie, falls for but can't nab the new Riverdale resident – because he's not interested in women.

"It was forward-thinking and it was funny and it was natural, and when Dan pitched it to me I said: 'You know what? We have to do it. We absolutely have to do it,'" said Goldwater.

It was also important to Goldwater that Keller wasn't seen as a token character, but a natural part of Archie Comics' Riverdale, USA.

"He's defined by being himself, by being smart, by being a good athlete," Goldwater said of Keller. "Just a kid who enjoys the high-school experience and just happens to be gay."

Seven people unsubscribed from Archie after Keller was introduced, but thousands more signed up, Goldwater said.

Months later, Archie Comics hosted the first gay marriage in mainstream comic books when Keller married his partner, Clay Walker, in the Life with Archie magazine that skews towards slightly older readers and follows the character's lives as adults.

Archie's happy ending: the gay wedding issue sold out.

Marvel, inspired by the legalization of gay marriage in New York, followed shortly after with the marriage of Northstar to his partner, Kyle. Northstar was the first male hero to come out in the Marvel universe; he began his relationship with Kyle in 2009.

Marvel editor Daniel Ketchum, who is gay, was involved with Northstar story since the two characters appeared together in 2009; he said the It Gets Better campaign had also influenced the writers to include a gay marriage storyline.

"I think it was kind of a critical mass of gay discussion in mainstream media, so of course that seized into creators' heads and finds a way into their stories," Ketchum said.

Marvel PR prepared the team behind Northstar's issue for waves of backlash, but Ketchum said he was overwhelmed by positive responses.

The marriage was first announced on The View, and Ketchum said when he returned to his office a half-hour after the episode aired, the first of several emails filling his inbox was from a gay man who said he had wept at his desk when he heard the news.

The man told Ketchum that comic books had helped him get through darker periods in his life and that it meant a lot to see a marriage in the Marvel universe because he and his partner were considering getting married.

"For me, that one email made so much of the experience worth it, where anything anyone else does good or bad pales in comparison of knowing that this is what it's meant to do," Ketchum said. "It's meant to touch hearts and minds and resonate with real-life experience. At their best, I think that's what comic books do."

Token characters disappearing after gay plotlines

Though the response was mostly positive, within the LGBTQ community there were still pangs of dissent when Northstar dropped out of the spotlight after his marriage. Then, when DC Comics announced that one of its main characters was coming out, it was seen as a token move following the success of the other publishers.

Green Lantern as a gay man in DC Comics's Earth 2. Photograph: AP

DC publisher Dan Didio said writer James Robinson had a long-term plan for the character that didn't feel gratuitous.

"We have a dedication to the diversity, and its not just to populate a world and forget about it, it's to make them important members of our cast and story," Didio said.

DC reintroduced the Green Lantern as gay in June. Didio said that when the company's New 52 series was launched, it wanted to reflect the diversity of its audience in its books. There have been multiple Green Lanterns – Didio said it was a great place for the publisher to showcase diversity in a prominent role.

DC has had gay characters before. In 2007, it revealed that Batwoman is a lesbian.

"Our plan was to show her as a person, as a hero, and the fact that she was a lesbian was just an aspect of who she was, but not a defining aspect. Same thing with Alan Scott [the Green Lantern], same thing for these other characters," Didio said.