WHEN a hit play is made into a film, the cast is invariably switched out for more famous film counterparts. Thus Mary Louise Parker is traded for Gwyneth Paltrow ("Proof") or Meg Ryan ("Prelude to a Kiss"), Kathy Bates and F. Murray Abraham for Michelle Pfeiffer and Al Pacino ("Frankie and Johnny in the Claire de Lune"), and everyone else for Meryl Streep ("Plenty," "Marvin's Room," "Dancing at Lughnasa").

But a funny thing happened to London's hit play "The History Boys" on the way to the multiplex: Its cast of 12 relative unknowns remained defiantly intact.

"The History Boys," opening Tuesday, tells the story of eight surprisingly gifted high school lads who do so well on their final exams that they are candidates for Oxford and Cambridge, the best colleges in the country. They study for the college entrance exams under the tutelage of two very different teachers. One, Hector (Richard Griffiths) is a passionate and eccentric devotee of the classics. The other, Irwin (Stephen Campbell Moore) is all about flash and edginess, the tricks needed to wow the college examiners. As the two teachers battle for the boys' allegiance, they reveal their own flawed humanity.

Written by Alan Bennett, a British national institution since his days with the comedy troupe Beyond the Fringe, the play was staged at London's National Theatre by director Nicholas Hytner to great acclaim and a slew of awards. The play is packed with the kind of witty, literate dialogue and emotional depth that actors kill for and that audiences cheer.

Not that any of this was particularly evident to all of the history boys upon first reading.

"I didn't get it," said actor Dominic Cooper, who was in town recently with Hytner and a few other cast members to promote the film. Cooper, 25, plays a rakish student named Dakin. "I found it momentarily funny in sections, but quite frankly the whole script went right over my head." He laughed. "But I really wanted to do it."

He wasn't the only one who needed an explanation. Rehearsal time was extended solely for the purpose of tutoring the young men in the subjects that are bandied about in the play. "We had a seminar for two weeks for the boys," said Griffiths. "It was a wonderful crash course in history and literature. If only they'd had this in school, Nick and Alan and I could have compressed four years of education into one term."

During rehearsals, Hytner didn't consider its potential as a movie. (He and Bennett had made a film of a previous stage collaboration which was retitled "The Madness of King George" for U.S. release in 1994.) But once the show went up, "it became very clear that these were 12 people that audiences really wanted to spend time with," Hytner said.

He and Bennett started working on plans to make a film without mentioning anything to anyone until it was a fait accompli. But the cast heard rumblings. "When the rumors of the film started, we were all saying, 'Well, they might keep Richard, but we'll be recast, definitely,' " said Samuel Barnett, 23, who plays the sensitive Posner.

Hytner, however, said there was never any question of recasting: "They so jelled as a company, and they loved what they were doing," he said.

After a year of working together, the actors knew their characters to the marrow, and their comfort with each other easily conveyed a group of boys who had known each other since childhood.

"We wanted it to be a sensible commercial proposition for somebody, and we understood that we were offering nothing in the way of headline names, so we made it for [about $3.8 million] and everyone was very happy," Hytner said. (The film was financed by DNA Films and BBC Two Films, and distributed by Fox Searchlight Pictures.)

The transition to film prompted a few modifications by the actors, but not necessarily the ones they expected. "I thought it was going to be all about bringing it down and doing nothing for the camera, that's the cliché about camera acting I'd heard about," said Barnett. "But in fact what happened was that by bringing it down, you actually increase the emotional intensity."

Once acclimated, the actors relished the chance to play for each other rather than an audience. "You can do more because you don't have to project it," said Cooper. "You can see in the eyes of the actor so you immediately know what's going on."

Hytner added, "I'll risk saying that I think it's harder to include a thousand people in an intimate conversation on a nightly basis than it is to have an intimate conversation in front of a camera. What the stage version demands technically, emotionally, and imaginatively is quite considerable. It's a liberation then, to be able to just sit across the table and do it for each other."

After the six-week film shoot was completed, the cast went on to conquer Broadway in April. The show played a run that ended last month, and garnered six Tonys, including best leading actor (Griffiths), best featured actress (Frances de la Tour, who played fellow teacher Mrs. Lintott), best direction and best play.

After their unexpected 2 1/2 -year ride, the actors' affection for each other is palpable. "I was spoiled rotten," said De la Tour of her experience with the cast. "I can't even begin to tell you the things they said to me in the wings. They were really very, very naughty. And I kept saying, 'Now look, if I was old enough to be your mother, that would be fine, perhaps, but actually I'm older than that.' They were the cheekiest — I just love them."

As for the risk of not switching to stars for the film, it's now looking like a conservative decision. The film opened in Britain on Oct. 13, and has handily made back its original investment and then some. The cast members are co-owners of the film with Bennett and Hytner.

"We've already had what we initially were paid doubled, just by what we've done with it so far," Hytner said, "so it worked."