As seen on CRIMESPREE CINEMA

Reporting from New York - The novelist Jonathan Ames was rereading works by the pulp writer David Goodis  several years ago when he first got the inspiration for "Bored to Death," the lat est quirky comedy to join HBO's lineup. Intrigued by the character of the hard-boiled detective, he briefly considered posting an ad on Craigslist advertising his services as an investigator.

"I just wanted adventures," he said.

Instead, Ames penned a dark short story about a writer named Jonathan Ames who poses as a detective on Craigslist. After it was published by McSweeney’s, producer Sarah Condon asked him to rework it as a comedy for HBO.

The result -- an eight-episode series that premieres tonight at 9:30 -- reworks the noir of Raymond Chandler into a wry comedy about discontented artists. Jason Schwartzman ("The Darjeeling Limited") plays the fictional Jonathan, a morose Brooklyn writer who drinks too much white wine and puts off work on his second novel. After his girlfriend (Olivia Thirlby) dumps him, Ames poses as a detective online and suddenly finds himself enmeshed in a missing persons case.

"Bored to Death" is the latest Ames work to feature a character that functions as a stand-in for the author, dubbed by the Oregonian "an edgier David Sedaris." "The Alcoholic," Ames' graphic novel that came out last fall, is a semiautobiographical tale about a young writer named Jonathan A.

The Jonathan Ames in "Bored to Death," who inhabits the same Brooklyn world as the writer, "definitely has a lot of my DNA," the real Ames said.

"Like, you know, when he says, 'I'm not good with anger, I go right to depression,' " he said over lemonade at a Boerum Hill café where the staff knows him by name. "But he's also his own person, and Jason brings so much of his spirit and entity to the character."

Schwartzman's sweet-natured and somewhat hapless Jonathan is joined by Zach Galifianakis ("The Hangover"), who plays his fretful friend Ray, a comic book illustrator. Ted Danson rounds out the cast as Jonathan's magazine editor, a bored playboy who relies on Jonathan for adventure and marijuana.

"I think the strength is how funny and vulnerable the actors are, you know?" Ames said. "It's not a mean-spirited show. I don't get off on humor when it's supposed to be about feeling smarter than the people you're watching. Like, 'Oh, look what idiots they are, but we know better.' I'd rather be like, 'Oh my God, that's like me -- maybe a little weirder.'

"The only thing going against the show is me, since my work has never been very commercial or wildly popular," he added. "But these guys are so charming that hopefully they'll overcome whatever non-popular aspect there is to me that could shadow or wreck it."

matea.gold@latimes.com