"Glasshouse" happened by accident, through a collision of unexpected intersections. But it was a happy accident, in the end.
Rewind to 2003. I'm still working on the last stories that went into "Accelerando", still unsure what comes next, and (I think) working on "The Clan Corporate". To distract myself from going mad hitting magazine deadlines (I'm writing 3-4 magazine articles a month to keep the wolf from the door, for novels at this point only amount to about 50% of my income) I'm fitfully poking at a colony of Sims. (It's amazing how much fun the Sims are, once you chuck the suburban dream narrative out of the window and start getting into surreal architecture, shark pools, and walling your virtual victims up in dungeons.)
And then a book by one of my favourite SF writers is announced—a new title by John Varley. As it happens, I've been waiting about seven years for "Steeltown Blues", the third in the trilogy of Eight Worlds novels that started with "Steel Beach" and "The Golden Globe". So when it transpires that he's written a book about time-traveling mammoths instead, I'm ... well, I'm about as pissed off as those Charles Stross fans who keep bugging me for a third Eschaton novel.
Varley's "Eight Worlds" universe was one of the most interesting and innovative deep space SF settings of the 1970s and 1980s; he tackled the whole bioengineering-rather-than-terraforming nexus way before it became popular, and asked questions about the meaning of identity and gender in a future where biology was as mutable as clothing is today. Sometimes he got things wrong, very wrong indeed (there's something to be said for the assertion that in the seventies everyone was a bit creepy), but sometimes he hit the nail square on the head, at a point when everyone else was trying to invent the screwdriver.
This was also the early 21st century. Post-9/11 security state, post Iraq invasion. Abu Ghraib was in the news. I was reading up on the psychology of abuse, coercion, and obedience to authority: on the work of Stanley Milgram and Philip Zimbardo's Stanford Prison Study. These experiments suggested that atrocities are in many ways situational: rather than arising from the behaviour of corrupt individuals, phenomena like the prisoner abuse at Abu Ghraib happened because the environment itself is inherently corrupting and most people will obey what they perceive to be lawful instructions emanating from a legitimate source of authority even if those instructions are themselves illegal or inappropriate.
(With hindsight I should also have read up on Altemeyer's theory of authoritarian followers, but I didn't know about it at the time.)
So. One rainy Tuesday afternoon in April 2004, I am sitting in the splendid main hall of "The Standing Order" in Edinburgh (a pub in the Grade A listed interior of a former bank headquarters), moaning about the lack of a new Eight Worlds novel in the direction of a friend, when a weird idea inserts itself into my head: why don't I write one?
And then another weird idea dogpiles the first: why not take the Stanford Prison Study protocol and apply it to gender roles among a bunch of posthumans who'd be at home in an Eight Worlds type environment—one in which physiology and gender and biology are mutable? What happens if you pin them down at random, frozen in one form or another, and give them incentives to conform to arbitrary roles, as a way of interrogating the assumptions and stupidities we take for granted?
Of course, this was such a juicy chew-toy that working on it was inevitable. I shambled home, wrote up some notes, and resolved to sit on it for six or nine months, until I was due to write another novel. And then ... then ... I managed to hold it back for almost ten days.
The first draft of "Glasshouse" poured out in 21 days flat, ran to 91,000 words, and was terrible. Or rather, the first two thirds worked okay; then it ran right off the rails. You do not emit the equivalent of a 260 page novel in three weeks of non-stop insanity without suffering some damage, and with 20/20 hindsight I overran my initial creative vision. I had a flawed hero/ine, Robin/Reeve, waking up in the classic white room setting with faceless enemies trying to kill him—enemies rendered even more ominous by Robin's awareness of having undergone memory excision surgery. The Glasshouse is presented to him as a refuge, but in reality it's a snare and a trap: the Stanford Prison Study in space, with a three year duration and oppressive flaws he doesn't recognize at first. For one thing, it's a Panopticon, a Benthamite tool of universal surveillance. And for another: the Glasshouse was the prototypical military prison in Aldershot, England, an ominous resonance which, alas, I didn't make clear enough in the novel (it was entirely deliberate but seems to have been missed by most readers).
But what was going on? Why was Robin on the run, and from who? It took me a bit longer—and a major redraft, ditching everything after the first 60,000 words and writing another 60,000 words of fresh material to finish the novel—to work out the background; the Censorship wars, Curious Yellow, Robin's own past as a war criminal no better than the odious administrators of the prison experiment. To realize that if you have a posthuman polity of immortals, then the only thing they can reasonably fight over is their memory of the past ("he who controls the past controls the present; he who controls the present controls the future", as George Orwell put it) and the only way you can rehabilitate their past crimes is to project them so far into the future that they are no longer relevant.
And so I ended up with a novel narrated in the first person present tense by the ultimate unreliable narrator (if your first person narrator is murdered two thirds of the way through the story then it's a fair clue that nothing in the story should be taken at face value, right?). Who in turn thinks they're being injected into a prison designed to rehabilitate war criminals, on a mission to expose the administrators' complicity in atrocities ... except that the narrator has a remarkably dodgy background, and indeed fits all the criteria for being incarcerated there himself. And nothing is what it seems, in this panopticon, and indeed our hero/ine may be the worst villain in the plot—or alternatively an innocent in search of redemption: as are they all, hopeful monsters on a one-way journey into a future where their sins can be forgotten.
Final notes ...
Firstly: yes, I have plans for a sequel (provisionally titled "Ghost Engine") set 200 years later, when the slower-than-light colony ship harboring the Glasshouse arrives at its destination to discover that the Censorship Wars are still in fact continuing. It's a coming-of-age story and a loss-of-innocence story. But it's probably not going to get written, because I'm told "Glasshouse" is my slowest-selling SF novel in the US market, and a sequel wouldn't justify much of an advance. So writing this one is on the back-burner until such time as I win the lottery.
Secondly: accidentally burping up a spare novel in 2004 really helped. It meant I had a spare book in the can when, a year later, a family member was taken critically ill—and then I lost six months' of working time while getting my hypertension meds adjusted. (That brain-fogging experience sucked, and took a long time to get over.) Alas, I don't knock out novels in three weeks very often—it's a once or twice a decade thing, and leaves me wrung out like a dish-rag. So by late 2006 the ace in the hole was spent, probably never to be replaced. But it saved me from a gap year in the publishing schedule along the way.