When Steven Spielberg's second world war drama Saving Private Ryan was released last year, some critics commented that, despite its subject matter, it was "really" a Vietnam movie. As the argument went, Spielberg's attempt to re-imagine the possibility of a "just war" displayed a naive and facile nostalgia for a pre-Vietnam age - a mythical time before America, as the cliche goes, "lost its innocence".

You could say that war films must always be about the loss of innocence, for the simple reason that no one ever knows what a war is like until they've been through one - or until they've seen a war film. War films, you could argue, are rarely effective unless they take their audience through the same traumatic process that their characters experience: from peace, through trepidation, to shock, loss and the sense of a world irrevocably changed. Every war film needs on some level to give the impression that the combat it depicts must surely be the grimmest of all; it can't afford to leave us feeling that its battles are only relatively traumatic.

Hence the gradual inflation in war cinema, from relatively contemplative first world war stories such as La Grande Illusion and All Quiet on the Western Front to Hollywood's often mythically tinged Vietnam cycle. Recently, both the realistic and the apocalyptic strains have achieved new sophistication. The first half-hour of Saving Private Ryan made elaborate use of film grain and camera movement to evoke a quasi-Sensurround impression of the Normandy landings, while Terrence Malick's The Thin Red Line reached new mystical excesses in its portrayal of war as a descent from a balmy Edenic state.

The question of whether a war film works may, in the end, be a purely aesthetic one - the question of whether some wars are more cinematic than others. First world war films are obliged to deal with drab stretches of mud under grey skies, and the unpromising business of watching and waiting. The Trench - the first film directed by the novelist and screenwriter William Boyd - is old-fashioned in its dogged acceptance of these limitations, its evocation of dead time and life before the battle. But it, too, structures itself on the matter of innocence lost: as Boyd has put it, "The flower of that volunteer army was killed and wounded, and after that, nothing was really the same again."

What need not be part of the equation, however, is the audience's innocence: a reasonably educated viewer of any war film is watching in the ironic light of historical knowledge. Watching The Trench, we know from the start what awaits its heroes, but then there's little else left for the film to tell us. These men, waiting in their dug-out in the summer of 1916, are all marked for death; we can only watch them respond to the waiting. If Boyd's film succeeds at all, it's in making that wait as painful and often as dull as it is for his characters.

The Trench is set in a trench on the Somme front, as a British platoon awaits the order to advance. The film aims for tightly packed claustrophobia: everything happens in the cramped warren over three days. But Boyd never quite manages to make us feel what it was like, only to see it: the camera is too static and detached, and we're obviously on a neatly ordered sound stage. Hollywood has the time and the finance to experiment with movement and texture in a way that low-budget Europeans can't; the answer might have been to make the most of the theatricality. But The Trench feels theatrical by default, rather than by design.

The film is marred above all by Boyd's selection of representative types: the naive young volunteer; the swaggering Cockney tough, who is of course the first to panic; the chinless, sensitive lieutenant who reads Tennyson by lamplight. Too transparently, the backbone of the platoon is the sergeant, whose bark conceals a tender solicitude and whose moral fibre is measured a little too neatly against the lieutenant's by his teetotalism.

The Trench tells us much that we already knew about the Somme - that it was a bloody, ill-prepared business, and that the troops had to swallow a lot of hollow rhetoric from above. The film's lamest moment is when a colonel turns up to film a bit of morale-raising PR. "We'll see you in the flickers yet, sir!" enthuses a sycophantic orderly. "Over my dead body," replies the officer. It's the sort of line that an experienced ironist like Boyd should have scrubbed out at first draft.

What saves the film is some strong acting, although the only character to become entirely individual is Daniel Craig's sergeant, who has the most memorable scenes: impassively treading a man's head into muddy water, or showing surprise and hurt when a man turns down the offer of his wife's strawberry jam. The film's worst mistake is to take us over the top into green fields at the end, as if Boyd too was finally bored with the trench's enclosure. There's a terrible bathos in the closing freeze-frames, as each brave, handsome youth dies in turn. Boyd too bluntly underlines his point about the end of innocence, and it's here that he's learnt the worst lessons from the Vietnam cycle.

"The Trench" (15) is on general release nationwide