Shailene Woodley stars as the intrepid Tris in the sci-fi adventure "Divergent."Jaap Buitendijk/Summit Entertainment

In the science fiction film "Divergent," opening this week, civilization has once again crumbled, leaving a small outpost of survivors to reckon with an uncertain future. "Divergent" continues a welcome recent trend of films, adapted from young-adult books, that take science fiction seriously. Think "The Hunger Games," "Ender's Game" and the excellent British indie "How I Live Now."

"Divergent" deals with some future technology, but is more in the tradition of social science fiction, which trades in speculation regarding anthropology and sociology. The film is also an allegory of sorts for adolescence itself, with our heroine Tris (Shailene Woodley) trying to individuate within a society that, quite literally, tells her who to be. We take a look at some of the science -- both hard and soft -- behind the science fiction. (Warning: Plot spoilers ahead.)

Ragip Candan/Getty Images

In the rigidly ordered society of "Divergent," teenagers are given a kind of futuristic aptitude test to determine their place in the world. Society is divided into five factions, each corresponding to a personality trait or virtue: Abnegation (selfless), Amity (peaceful), Candor (honest), Dauntless (brave) and Erudite (intelligent). There are no little circles or No. 2 pencils in this test, though. Instead, subjects are given a serum that triggers unconscious dream scenarios, which are then monitored via electrodes and shown onscreen.

Induced hallucinations aren't part of modern standardized testing (yet), but the idea of personality assessment tests goes back to the early 20th century. Swiss psychiatrist Carl Jung used word association games to determine if his patients relied primarily on feeling, intuition, sensation or thinking. During World War I, the U.S. government hired researcher Robert Woodworth to develop a psychological test for Army recruits. The Woodworth Personal Data Sheet is widely considered the first personality test. Today, the Myers-Briggs Type Indicator (MBTI) assessment is the most well-known of several systems.

Tori (Maggie Q) administers both truth serums and tattoos in the futuristic world of "Divergent."Jaap Buitendijk/Summit Entertainment

Speaking of serums, "Divergent" features several pivotal scenes in which subjects are injected with mind-altering drugs to achieve particular effects. In the aptitude test, the serum induces a dream state that is somehow scripted by the administrators. In later scenes, serums are used to make subjects passive and/or highly suggestible, or even controllable by broadcast transmissions. The details are a little vague.

The "truth serum" scenario is an old chestnut in Hollywood and in fiction, but it has a basis in science. Several different kinds of sedative, hypnotic and psychedelic drugs have been used as truth serums, and there are still applications today. Sodium thiopental -- marketed as Sodium Pentathol -- is a barbiturate that inhibits certain higher brain functions, which is thought to prevent lying. That drug, and many others, have been used in interrogations by the United States and other countries, though legal issues are in constant dispute.

The preserved walls of Jerusalem's Old City date back to the 16th century.PhotoStock-Israel/Getty Images

In the film, the ruins of Chicago are surrounded by a giant perimeter fence, hundreds of feet tall, perched on a base wall that's maybe 30 feet tall. The movie doesn't get into details, but the fence portion appears to have some sort of electric or energy component.

Defensive walls have been around as long as cities themselves, dating all the way back to the first large-scale Sumerian and Mesopotamian settlements. Hundreds of towns and cities worldwide still have defensive walls. Most are preserved for historical reasons, but some are still maintained for security. The walls around certain embassy compounds, for instance, essentially function as city walls.

Electric fence technology, by the way, dates back to the late 19th century. Widespread use as livestock fencing began in the United States and New Zealand in the 1930s.

VIDEO: World War Z: The Real Plan for Apocalypse

Ruins are juxtaposed in view of skyscrapers in Sydney, Australia.Lonely Planet/Getty Images

Events in "Divergent" take place 100 years after an unspecified world war. The buildings and skyscrapers in Chicago are still standing, mostly, but several have at least partially collapsed and some have been stripped down to their steel skeletal beams. Images of such derelict urban spaces have become so familiar now that there's even a name for them: ruin porn.

It begs the question: How long will today's skyscrapers last? It's all about maintenance. Several big city skyscrapers today are well over 100 years old, but have been so thoroughly restored and retrofitted over the years that they're essentially new buildings. How long an unmaintained skyscraper would last depends on several factors -- climate, materials, location and engineering techniques. Glass and outer portions would likely deteriorate within decades, but the steel beam superstructures could last for centuries.

'Gravity': Science vs. Fiction

Nicola Tree/Getty Images

In one scene toward the beginning of "Divergent," our heroine Tris visits a futuristic nightclub/tattoo parlor where she is attended to by a sympathetic government worker, Tori (Maggie Q). Tori gives Tris a permanent tattoo by simply placing a cutout of the design directly on the skin, activating a machine, then peeling the pattern back to reveal the new tattoo. Again, the specifics are a little cloudy.

In real life, of course, tattoos aren't so simple -- permanent tattoos, anyway. The basic technology for the modern tattoo hasn't changed much since its invention in the late 1800s. Pigment is injected into skin's dermis layer, just under the epidermis, by way of needle or group of needles in a tattoo gun. There have been some interesting developments in non-traditional tattoos, however. The Programmable Subcutaneous Visible Implant, or PSVI, is a kind of digital tattoo that uses a small LCD display surgically implanted under the skin. You go first.

'World War Z': The Revolt Will Be Fact Checked

Tris and her Dauntless faction friends deal with overcrowding ... the fun way!Jaap Buitendijk/Summit Entertainment

The city of Chicago is an isolated outpost of humanity in "Divergent," walled off and apparently self-sustaining. A few throwaway details suggest that those in the Amity faction work as the city's farmers. Scenes involving the Abnegation and Dauntless factions depict large groups of people living in the city's few remaining habitable areas.

The premise suggests the idea of arcologies -- cities and superstructures designed to house high-density populations, with self-sustaining systems for distributing resources and recycling waste. Arcologies are a staple of futuristic sci-fi, often tied to notions of radical overpopulation and/or the severe reduction of habitable areas on Earth. In real life, the arcology concept is a progressive design principle in modern architecture, already in use by city planners in large urban areas. Architect Paolo Soleri founded the Arizona town and "urban laboratory" of Arcosanti in 1970, designed to be an ongoing experiment in arcology principles.