A woman screams, “He raped me!” One of two men standing near her shouts, “It’s all a big mistake!” Are these men the attackers? Or are they good Samaritans trying to help the woman? I can’t tell for sure. I order them to halt and show me their hands, but they keep yammering at me and won’t stand still. One man, looking out from the screen, begs me to lower my handgun, a 9mm Beretta that fires rubber slugs. My head knows this is just a training simulation, but my heart rate has jumped from 72 to 98. I duck for cover: unlike other simulators, this one has a synchronized “shootback cannon.” If either man pulls a gun and fires in my direction, the cannon, which hangs above the screen, will pelt me with painful .68-caliber nylon balls. An adrenaline rush numbs my arms. My vision narrows. My sweaty index finger slides from the gun’s frame to the trigger–something I don’t recall asking it to do. I’m starting to see why some of the real cops who train on this equipment faint, collapse in fear or quit their law-enforcement jobs.

Police officers face no decision more crucial than when to fire their guns. This year alone fatal shootings by officers in New York, Chicago and Riverside, Calif., sparked bitter controversies, with critics charging the cops were trigger-happy. Police departments have long used cruder simulators to teach officers how to shoot. Some of those training systems also include scenarios like the rape scene. But many cops say the earlier systems’ dependence on gamelike laser guns creates the un-realistic feel of a video arcade, in which the “shots” go in only one direction. Now many departments are buying equipment that tries to teach a higher-order skill: good judgment with weapons during emergencies. The new protocol, developed by Advanced Interactive Systems of Seattle, immerses cops in hostage dramas, robberies, office shootings and other confrontations. As each unfolds, both a human instructor and the AIS software itself use sophisticated “branching” technology to seamlessly change the plot, depending on how well the police officer defuses–or aggravates–the situation. The rape scene, for example, can end with a surrender, a shoot-out or one of several options in between. Sgt. Ed Janik, supervisor of firearms training for the Fairfax County (Va.) Police Department, says the greatest benefits may go to veteran officers. “If they’ve gotten lax over the years,” Janik says, “that cannon reminds them that good use of cover can save their lives.”

After each scene an instructor can break down what unfolded, showing a trainee how he behaved under stress–and, if he fired his gun, whether it was a good decision. When I fire my Beretta at a bad guy on the screen, two high-speed cameras pinpoint the bullet’s path and a red dot instantly appears where my shot hits him. At the same moment, the cannon fires the rapist’s shot at me–but the nylon ball ricochets off the box I’m using as cover. The AIS software computes that the rapist has been hit, and he slumps to the floor. I think the scene is over, and lower the Beretta. Bad move. In a final twist, the rapist leans up from the floor and gets off a second shot, hitting my leg. Instructor Greg Hoover, a former SWAT officer for the LAPD, then replays the scene. He stops the action and, in one corner, displays a smaller window. It was captured by a camera near the screen and shows what I was doing when the bad guy got hit. Hoover uses this snapshot to explain how I could have protected the leg I left exposed.

Another version of the rape scene is a trickier test. Hoover’s colleague Patrick Kennerson toys with the branching software on a computer monitor at the rear of the firing range. This time the other rapist grabs the woman and threatens to kill her. Holding my fire, I shout urgent commands–“Drop the knife! Let her go!” But in a flash, the rapist stabs the victim’s throat. I shoot, but by the time my bullet nails him, he’s dropped the knife and his hands are up. “Shot As He Surrenders!” crows Hoover, imagining a headline that, if I were a real cop, would doom my career. Moments later, though, Hoover reverses himself and scores the shooting as justified. Breaking the action down on playback shows that the rapist took just 12 hundredths of a second to raise his hands. Working backward from when he was hit, Hoover calculates that I had committed to fire before the rapist began his surrender. Bully for me–except that the rape victim is dead because I hesitated to fire when her life was clearly in danger.

Training this intense supposedly helps officers think about how they’ll react in real emergencies. The trainee’s starkest sensation isn’t relief after a justified shooting, but remorse after a deadly mistake. (This hits home when, during one scene, I kill a man who’s holding a cell phone, not the pistol I thought I saw.) If the AIS system does turn out wiser cops, that would justify costs that range from $25,000 for a small system to $200,000 for a trailer that police departments like Chicago’s can haul from station to station. Sgt. Tim Finneran of the Orange County (Calif.) Sheriff’s Department, which bought an earlier version of the AIS technology last year, says the system offers one huge benefit. By giving instructors the option to de-escalate a scene when officers use good commands, the system lets trainees “learn how to react with something other than deadly force.”

Some scenes are devilishly challenging. In one, a crime victim becomes a perpetrator by stabbing her assailant after he’s surrendered; should you shoot her as she lunges at him? And one of AIS’s newest scenarios, School Situations, scarily replicates the noise and chaos that officers who were called to Columbine and other shootings have recounted to Hoover. If nothing else, meeting a gun-wielding 14-year-old in a terrifying movie scene ought to remind most cops that they never want to meet him in real life.