Every generation gets the gangster movie it deserves. For mine, it was The Warriors, Walter Hill’s violent New York fantasy of 1979.

It started as a book, one of those cheap paperbacks with an evocative cover. Written by Sol Yurick, who’d been a juvenile investigator at the welfare department, it was a retelling of a war memoir, the Anabasis, by the ancient Greek soldier Xenophon. Finding himself, in the fourth century B.C., stranded with 10,000 mercenaries in Persia after the death of his commander, Cyrus, Xenophon led his men through a thousand miles of hostile territory to the Black Sea. When the Greeks reached the coast, they exulted, “The sea. The sea.” This climactic moment is paralleled in the film a couple millennia later: “When we see the ocean,” notes the leader of the Coney Island Warriors when they reach the Stillwell Avenue subway stop after their own treacherous odyssey through foreign territory, “we figure we’re home.”

“I had conceived of the idea almost as a joke when I was in college,’’ Yurick said later. “I remember saying, ‘How about a gang epic based on the Anabasis?’”

The novel transplants the action to New York City, where every notable gang in town has sent delegates to a conclave in Van Cortlandt Park in the Bronx. There, Cyrus, the charismatic leader of the city’s biggest outfit, gives the sort of speech you’d expect from a would-be messiah. He urges the hoodlums of New York — tens of thousands in all — to rise up and take control. In a thunderous call-and-response, he repeatedly lifts his arms and asks the assembled: “Can you dig it?” (Yes, they can.) But Cyrus is shot before he can finish his speech, gunned down by a little menace named Luther (David Patrick Kelly), who heads up the Rogues. Luther pins the murder on the Warriors, whose leader is lost in the ensuing melee. The rest of the Warriors, not knowing of the accusation, start on their long trek back to Coney Island. (It’s Luther who delivers the film’s immortal line, the singsong taunt, “Warriors, come out to play-ee-ay…”) From there, the story is driven by the most basic human desires: Don’t die. Get home.

Rather than conceiving the film as a realistic portrayal of the criminal underclass, Hill imagined The Warriors as a cartoon, a spangled fantasia.

The film rights were acquired by producer Lawrence Gordon, who, after stowing the project in his drawer for several years — it ripened like a plum — gave it to Walter Hill, a writer and director of the Sam Peckinpah School. Beautiful violence was the favored aesthetic. Hill had directed two features — Hard Times, The Driver) — that were stripped-down works in the mannerist tradition. He was all about camera angle, light, moment.

Hill got the novel right away. On the surface, it was a tale of anguished youth, but it was really about the world at night. And rather than conceiving the film as a realistic portrayal of the criminal underclass, Hill imagined The Warriors as a cartoon, a spangled fantasia that rhymed with other classic teen epics: The Wild One; The Outsiders; early Springsteen ballads, where Spanish Johnny looks on from a fire escape.

The movie announces itself as a dream while introducing the gangs en route to the conclave: the Savage Huns dressed like members of a Chinatown tong; the Electric Eliminators in their gold jackets, like a maniacal bowling team; the High Hats, in red shirts and suspenders; the Boppers, sporting silver vests and matching fedoras, like extras in a Michael Jackson video; the Gramercy Riffs, a battalion of bad asses in orange karate suits. The closest Manhattan ever came to this kind of underworld color was in the late 1800s, when the Plug Uglies stuffed their hats with wool, improvising a sports helmet, but even in those days no gangs wore white face in the way of angry mimes, nor did any dress like the Baseball Furies, who, in the movie, wear Yankee pinstripes, paint their faces, and carry bats. (Another gang — the Punks, who fight the Warriors in the Union Square Subway Station — include at least one member on roller skates, prompting my son’s very sensible question: “Why don’t the Warriors just run up the stairs?”)

The Warriors are the center of the story, which is probably why their colors are more reasonable: jeans and leather vests. We know little about them — this is a movie without backstory. Shit just happens. Each Warrior is defined by a particular trait. There’s the top man, Cleon, who is marked by death and the lieutenant, Swan, who, upon assuming leadership, turns out to be smart and judicious, fighting only when all else has failed. There is the strong and stupid enforcer Ajax, who accuses everyone of “Going f — got,” and the artist, Rembrandt, who tags walls with the Warrior’s “W.” And later, there is the girl, Mercy who plays a role as old as the cinema: the slum angel.

Hill cast mostly unknown actors. Michael Beck as Swan. James Remar as Ajax. Deborah Van Valkenburgh as Mercy. You hadn’t heard of them before, and wouldn’t hear much from them after. Thomas Waites was to be the breakout star — he played Fox, a key character in the story’s first act — but he fizzled before the movie even wrapped. He was difficult on the set — he asked for another trailer — so Hill wrote him out. That’s why, halfway through, Fox gets thrown into the path of an oncoming train; every director’s fantasy.

What makes The Warriors great, a revered film that transcended its pulpy atmospherics, is that at heart it’s about the most basic human unit — the family. If that family is big enough, it will include every kind of personality. Hill shows us these personalities in extremis, life and death situations that call forth loyalty, courage, cowardice. There are fatal flaws — that’s from the Greek. Then, there is the style of the film, the way it was shot and pieced together — this is not the world as it looked to Hollywood, but as a master mythmaker imagined it to look through the eyes of the downtrodden. Rough and fast, gorgeous in the way of certain Robert Frank photos. The subway stations are like islands at night, glowing in a wine dark sea. The police are demons, everywhere and nowhere. The fighting is another kind of dancing — the movie resembles a musical. Now and then, you expect the hoods to break into song, à la West Side Story. The film is all the great epics of juvenile delinquency taken to the extreme. Blackboard Jungle. Angels with Dirty Faces. The Warriors are the Bowery Boys at the end of the time, the city itself emptied of everything but cops and criminals. It is the epitome of 1979: The city is a ruin, the Bronx is on fire, and all you want is to get back to where you started.

Time has added another dimension to the film. You see New York as it was when you were small, a city on the edge of bankruptcy, graffiti-covered, trash-bestrewn.

The Warriors was released on February 9, 1979, in more than 600 theaters. It was a box office hit, but most critics hated it (Ebert gave it two stars; Siskel one). Then came the violence — fights at several theaters and two people were killed: Marvin Kenneth Eller, 19, was shot in the head at a drive-in in Palm Springs, California; Tim Gitchel, 18, was stabbed at a theatre in Oxnard, California. “The movie was very popular with the street gangs, especially young men, a lot of whom had very strong feelings about each other,” Hill said later. “And suddenly they all went to the movies together! They looked across the aisle and there were the guys they didn’t like.” The film was pulled for a time, then reopened with guards posted at the screenings, which served as a PR boon. It gave the movie its dark reputation, its black magic.

When Pauline Kael’s review came out in The New Yorker in March 1979, it was a kind of reclamation project. She was identifying art where others had seen only trash. (Kael attended a late-night showing on Broadway, perhaps hoping to see a fight.) “The Warriors is mesmerizing in its intensity,” she wrote. “It runs from night until dawn, and most of the action is in crisp, bright Day-Glo colors against the terrifying New York blackness; the figures stand out like a jukebox in a dark bar.”

The movie, which had vanished from theaters by the turn of the decade, reappeared on videotape as VCRs proliferated. It’s following has only grown over the decades. In 2005, Rockstar released a video game version for the PlayStation 2 and Xbox, earning $37 million from young wannabe gangsters who could make the epic trip from the Bronx to Coney Island without even leaving the safety of their own rec rooms.

Time has added another dimension to the film. Watching it, you see New York as it was when you were small, a city on the edge of bankruptcy, graffiti-covered, trash-bestrewn. Hill did not mean for this to be his subject. He got it by accident, like a fisherman surprised by the nature of his catch. He went out for shark but came back with New York at its nadir, the city as nightmare.

One of the movie’s other key themes is the fate of utopian dreams. It opens with a warped fantasy: Cyrus’s plan to unite the gangs and usher in a golden age. For a moment, that dream seems close. Then Cyrus is shot. Perhaps it was inevitable; it’s an ancient tale. A version of this story has been told again and again, and, in every version, Cyrus gets shot. Why? Because he failed to reckon with the true nature of the world. Chaos. Evil. Absurdity. If you don’t factor in those who do evil for the simple pleasure of it, you’re doomed. Shortly after shooting Cyrus, Luther is asked why he did it. “No reason,” he says. “I just like doing things like that.”