University scientists have designed a unique computer software package to help avert such tragedies as the Heysel Stadium disaster, the recent bomb explosion in Atlanta, or even the Estonia sinking.
Academics at the University of Greenwich in London have developed a model called Exodus that simulates crises such as fires or aircraft crashes and examines the way victims try to escape.
It is the first such safety model to look at how psychology affects individuals' chances of survival.
Building-Exodus, which has taken seven years and more than Pounds 750,000 to develop, will go on sale next month and could prove a goldmine for the university.
Spin-offs such as Maritime-Exodus designed for ferries, Rail-Exodus for rail accidents and Offshore-Exodus for Piper Alpha-type disasters are already planned.
Users must first input the design of the building, which could be a cinema, public library, school, office or open space such as a park or football stadium.
Next they must describe the number and type of people inside it. The model includes 22 different human characteristics, ranging from age, gender and weight to more intangible qualities such as patience, drive, energy and agility.
Third, the users set the scenario, specifying the kind of disaster envisaged, whether exits have become inaccessible, doors need unlocking or toxic fumes are spreading through the building.
Finally, the customers press the "play" button, sit back and watch the disaster unfold in an electronic mock-up of their own building. They receive a bird's-eye view of events, watching computer graphics of their staff scurrying about looking for a way to escape.
Some small companies may choose to programme the characteristics of individual staff members into the model, including how patient or energetic each person is.
Most are likely to build up a generalised picture of their workforce, stating merely the male/female ratio, age breakdown and proportion of disabled people and relying on standard models for the other characteristics. In either case Edwin Galea, who heads a team of researchers at Greenwich, suggest trying out a number of situations and staff make-ups to cover the range of possible outcomes. An element of chance is already built in to the computer programme.
As the disaster is played out, the computer operator can select any one person to find out their reactions so far.
By using a mouse to click on the chosen icon, they can discover how long they have been trying to get out, note whether they are suffering from the effects of fumes and see an illuminated trail of their escape-route.
They can even find out what went wrong for people who have died.
The Greenwich team have drawn on a database of interviews with air crash survivors held by America's National Transportion Safety Board to find out what kind of people are most likely to escape.
This has been backed up with research by behavioural psychologists at Cranfield University, Bedford, using live subjects.
By offering Pounds 5 to the first successful escapers, they identified what sort of people lacked the drive to reach safety.
Professor Galea said: "From the studies we have done it appears young males are more likely to win this financial bonus. Accident statistics on aircraft also show it is young males who are more likely to survive.
"Familiarity with the structure is important too. For example not everyone will use the closest exit because not everyone will know where it is."
He hopes the programme will be used by architects and engineers to design safer buildings, by inspectors checking how far particular buildings comply with safety regulations and by managers designing evacuation routes and safety training.
The Greenwich team has already set up partnerships with European distributors of the software and has received inquiries from supermarkets, libraries, local education authorities and airports both in this country and abroad.