When the Queen opened the UK's first oil pipeline four decades ago, the North Sea looked like a well that would never run dry.

The first fields had been drilled a decade earlier and the industry boomed as giants like BP and Shell rushed to stake their claim.

Production and profits rose steadily during the seventies, transforming Aberdeen into a bustling oil city.

Arab sheiks and Texans in ten-gallon hats walked the streets with men in boiler suits back from a two-week stretch in the North Sea, where over 100 installations were built in less than a decade.

The price of oil more than doubled when the second energy crisis hit in the late seventies and by the early eighties the UK was exporting more oil than it was importing.

But over the next decade, production slowed and peaked at 137 million tonnes of oil a year in 1999.

The amount of oil extracted from the North Sea has since fallen dramatically - dropping to 39 million tonnes in 2014 - and plummeting production has been accompanied by a slump in oil markets.

The price of a barrel of Brent Crude more than halved from a June 2014 high of $110 to around $30. The downturn has cost more than 70,000 people their jobs in the UK and forced the industry to take drastic steps to stay afloat despite a small improvement in recent months.

But why is the oil industry facing its worst crisis in a generation?

A combination of problems have contributed to the sector's woes in the last two years, from a difficult relationship with the Organization of the Petroleum Exporting Countries (Opec) to Iranian nuclear deals.

Why is the price of oil so low?

As UK oil production has fallen over the last 16 years, the amount produced by other countries has risen. America has seen a boom in shale oil and gas production - better known as "fracking" - and as US production has increased, it has exported more and imported less.

Weak demand from top consumers like China and America has caused a global oversupply which has driven down the price of oil.

Saudi Arabia-dominated oil cartel Opec has resisted pleas to enforce a drop in production and push the price up. Its members control around 40% of the world's oil and include the United Arab Emirates, Libya, Iraq, Iran, Qatar, Nigeria and Venezuela.

The decision to lift sanctions on Iran after it agreed to limit its nuclear programme means another 300,000 barrels of oil are expected to flood the market every day.

Who has benefited from the slump?

While the North Sea suffers, motorists are paying less at the pumps. The cost of petrol and diesel has fallen over the last year - hovering at around £1 a litre - but the value of oil is only one factor in the price of fuel.

Tax and VAT are responsible for the biggest chunk of what you pay for a tank of petrol (around 62%), followed by the price of oil (roughly 33%) and then seller's profit margin (only around 5%).

Oil companies have also used the downturn as an opportunity to tighten their belts and prepare for the future.

The "North Sea bubble" responsible for making Aberdeen the most well-paid place to work in the UK outside London while pushing up house prices to the highest level in Scotland is ready to burst.

Reductions in pay, hours and jobs have helped oil and gas companies stay profitable but have cost thousands of workers their livelihoods. Critics argue that the industry is cutting deeper than necessary.

Who has lost out in the downturn?

Industry body Oil and Gas UK believes as many as 65,000 people lost their jobs in the UK oil sector between January 2014 and September 2015 and thousands more are likely to be made redundant in the near future.

Contractors - oil workers on temporary deals who are often paid higher wages than staff - have been worst hit.

Other industries have also felt the pinch. Fewer people are staying in the Aberdeen's hotels and the number of travellers passing through its airport - which boasts the busiest civilian heliport in the world thanks to the oil industry - has fallen by 7% over the last year.

Taxi drivers say business is down by a third and cafes have been forced to cut their opening hours to stay open.

What does the future hold for the North Sea?

Despite the slump, the oil and gas industry is still worth around £40bn to the UK every year.

Oil and Gas UK believes 2015 saw the first rise in North Sea production for 15 years - albeit only slightly and largely as a result of the new Golden Eagle oil field contributing an extra 18,000 barrels a day.

But the cost of extracting oil is rising and the prospect of having to decommission ageing offshore facilities - some of the oldest platforms are now 40 years old - means companies are being forced to consider their long-term future in the North Sea.

Offshore exploration is expected to fall to its lowest levels since the seventies over the next three years as investment falls by up to £12bn, Oil and Gas UK has predicted.

Cutbacks are likely to save the industry £2bn by the end of 2016, but it is too early to say how the well the industry will weather the storm.