The drill's scenario was chilling: Terrorists had descended on a cruise ship near a Virginia port, thousands were dead at the Richmond racetrack, bombs were exploding at schools and sarin gas had been reported. In response, Virginia's military bases locked down, standard protocol for the military during Code Red.

Everyone was doing what they were supposed to do. But the organizers of this month's "Determined Promise 2004" terrorist drill quickly realized they had a problem on their hands.

Firetrucks and ambulances at the military bases, which have long-standing mutual aid agreements with the surrounding counties and cities, were locked in, unable to respond to crises outside their gates. Likewise, city emergency crews could not get into the bases to help.

"If they can't go out to help because they are in Code Red, if that's going to be the case, everybody needs to be informed," Gov. Mark R. Warner (D) said this week. "It was clearly one of the issues that bubbled up."

As Virginia nears the third anniversary of the Sept. 11 attacks and closes in on a year since Hurricane Isabel tore a path of devastation across the state, Warner said he is convinced that the state government is better prepared to deal with a disaster.

He said the terrorist drill showed how easily Virginia's emergency apparatus can be overwhelmed by large-scale disasters. As did the real-life case of the Washington area snipers, he said, the exercise demonstrated how difficult it can be for a governor to lead an emergency response while also serving as the chief public information officer.

"You are trying to reassure people to go about their daily lives, but at the same time urge them to be cautious. Go about your daily life, but duck," he said. "And [you are] fighting the urge, which I'm not sure I did successfully, to not get consumed by it."

Last weekend, the state's emergency officials ramped up for the approach of Hurricane Charley. Warner declared a state of emergency and held a conference call with elected leaders in the Hampton Roads area before the storm eventually fizzled.

Charley was no real test for Virginia. State officials said some things have clearly improved since Isabel, when chronic communications problems plagued the disaster response and local communities complained that ice, water and other assistance were late in coming.

This time, every request from a local official was given a tracking number. In the event that Charley had packed a real punch, local officials who still had Internet access could have tracked their requests for emergency help on a central Web site.

"There was much better coordination this time," said William H. Leighty, Warner's chief of staff. "They wanted to know when [the Virginia Department of Transportation] was going to close the tunnels. What time? It was just, really, a palpable difference in the level of crispness and execution."

Unlike a year ago, Virginia's state agencies -- or at least 87 percent of them -- now have "continuity of service plans" on the books. Essentially, the plans describe how the agencies would operate without power or water or if employees couldn't reach them.

Officials said the state has gotten better at playing the expectations game. During Isabel, it took days for ice to reach some areas, prompting panicked cries. This time, state leaders made it clear that ice would be delivered only to places where it was critical, such as hospitals, where essential medicines could spoil.

As Warner's press secretary, Ellen Qualls, put it, during Hurricane Isabel, "we had people who wanted to save their venison in the freezer."

Still, despite the improvements since then, Warner and the state's senior emergency planners said there is room to do better.

When make-believe terrorists attacked the cruise ship during the drill Aug. 5, local officials got into a tangle with the Coast Guard over whether to allow the ship to dock.

That was about 10:15 a.m. But state officials didn't call Leighty to ask for directions until 8 p.m., a delay that he said was improper.

Then there are the real threats on the horizon. Virginia officials are actively planning to safeguard Election Day in the state against terrorism.

In an eerie echo of the "Determined Promise" drill, the Richmond International Raceway is hosting the Chevy Rock & Roll 400 NASCAR Nextel Cup Series race.

The date: Sept. 11.

A group from Camp Pendleton in Virginia Beach portrays terror attack victims on a cruise ship earlier this month.