The Star Trek franchise created such a fully-realized world that many of us feel like we've actually traveled to the 23rd and 24th centuries. But building that world was a messy, weird process. If you want to know what the creators were really thinking when they wrote your favorite TV show or movie, there’s a new two-volume set of books that’s full of inside secrets. Some are inspirational, some are just depressing.

The Fifty-Year Mission: The Complete, Uncensored, Unauthorized Oral History of Star Trek (UK), edited by Mark Altman and Edward Gross, is exactly what it sounds like. It’s the oral history of the franchise, from its earliest gleamings in 1964 to Star Trek Beyond in 2016. The two volumes, clocking in at over 1,700 pages, are overstuffed and prone to clutter and repetition, but they also have some fascinatingly honest assessments of Trek’s history from the people who were there.

You’ll find out about the various failed attempts to bring the original series back in the 1970s, including the notorious movie called The God Thing. But probably the most fascinating part of the first volume is the account of the chaos behind the scenes of Star Trek: The Motion Picture, which went into production with no finished script, as Gene Roddenberry kept trying to wrest control away from the film’s actual writer. (And Spock wasn’t in the film until very late in the process, because it was originally written as the pilot for a new, Spock-less, TV show.)

In the second volume, you'll meet dozens of writers who crashed and burned on Star Trek: The Next Generation, thanks in part to the bizarre behavior of Gene Roddenberry’s attorney, Leonard Maizlish, who tried to take control over the show’s scripts and other creative decisions. The first two years of TNG were apparently an orgy of bridge-burning, in which formerly devoted Star Trek creators like Dorothy Fontana and David Gerrold became disillusioned with the franchise, and at last only Miami Vice’s Maurice Hurley is left standing, before exiting the show himself.

We get some fascinating stories from the actors, too. Alexander Siddig El Fadil explains how he decided to play up Dr. Bashir’s sexual chemistry with Andrew Robinson’s Garak on Deep Space Nine, instead of the flirtation with Terry Farrell’s Jadzia Dax that the writers had tried to make happen. Then there were absurd battles over whether Avery Brooks, playing Sisko, would be allowed to shave his head and grow his goatee.

The section on Voyager is where it gets really intense. Apparently nobody wanted to create a new Star Trek show so soon, but Paramount insisted--a similar thing happened with Enterprise. And Kate Mulgrew, who played Voyager's Captain Janeway, was so offended that they added the sexy Seven of Nine to her show that she spent years torturing actor Jeri Ryan (who was dating showrunner Brannon Braga at the time.)

In the section about Enterprise, the final TV show to air up until now, the main theme is one of creative exhaustion. Braga and Trek supremo Rick Berman wanted to do something different than the other Star Treks, but inevitably fell into the same old patterns, especially after Paramount shot down their more ambitious plans.

There are also exhaustive sections on all the Star Trek films, including a post-mortem on the failure of Star Trek V, and a lot of soul-searching about Insurrection. Even Into Darkness is singled out for scorn, though not by anyone directly involved with the movie. Bryan Fuller (showrunner for the 2017 series Star Trek: Discovery) comes in to explain all the ways that film went wrong.

The two volumes are divided not chronologically, but instead into The Original Series and its sequel movies, and then everything else. There’s a decent amount of jumping around in time, because we learn all about 1991’s The Undiscovered Country, and then jump back to 1986 for the creation of Star Trek: TNG. Similarly, we cover the end of Deep Space Nine before jumping back to the launch of Voyager.

But having one volume about the Shatner/Nimoy era, and one volume about TNG and beyond, actually creates an interesting dynamic. Volume I is all about Star Trek as underdog: the first series, in the 1960s, is constantly living under the spectre of the gun (sorry) as it barely escapes cancellation again and again. Even the mostly successful TOS movies come across as embattled. After the expensive first film failed to win any hearts, the other five movies with the original crew were done cheaply, with constant penny-pinching and a sense that the series had an expiration date. (Especially after Star Trek V, a sixth film was by no means guaranteed.)

And then Volume II is mostly about Star Trek as juggernaut, as TNG becomes a hit show right off the bat in spite of creative struggles. The franchise that barely scraped by for its first 20 years becomes a phenomenon, and cranks out an astonishing 624 episodes of television. This becomes a story of over-reaching, as one hit show spawns three spin-offs and four movies. The cracks start to appear as Insurrection falls flat and Voyager gets stuck trying to be a copy of TNG. And then a final TNG movie, Nemesis, inadvertently makes the argument for Star Trek to take a long nap, an argument which Enterprise reinforces.

So the two volumes provide an interesting contrast: Star Trek rising up from 1960s obscurity to 1980s movie popularity; and Star Trek falling from late 1980s domination to early 2000s obsolescence.

Along the way, there are two constants: ego and idealism. A lot of the most painful parts of The 50 Year Mission involve finding out that your creative heroes could be total assholes, capable of everything from sexual harassment to willful sabotage. Every era of Star Trek saw battles for creative control that were motivated, in large part, by egomania and the kind of self-importance that would make the godlike Q blush. And yet at the same time, almost everybody working on Star Trek believed, to some extent, in its vision of a better future where people overcome selfishness and hatred, and some of the most fascinating parts involve people twisting themselves into knots coming up with stories about more evolved humans.

The 50 Year Mission is probably not for the casual reader. It’s just too overstuffed, and you get the sense that the editors included every stray remark they heard, including some from people who weren’t even there. But there are two groups of people who will find these two volumes irresistible: Star Trek junkies who want to know the inside dirt, and aspiring television writers and critics who want a unique glimpse at the inner workings of one of the all-time great series.