Grand Thieves & Tomb Raiders
Page 13
Acorn’s computers were both complex and simple. They were complex in that they were teeming with expensive hardware that could connect with teletext readers, printers and robot arms. But they were simple in the way that most computers were – so that all a hardcore user really needed to know how to program was a single chip, the 6502. So when Essex sixth former David Braben received an Acorn Atom as a Christmas present in 1981, his computer shared plenty of DNA with the new BBC Micros that were selling for three times the price. It didn’t come close to the wish list of the BBC’s education department, but it did feature a version of Sophie Wilson’s BASIC and assembler and Steve Furber’s memory design, and it was somewhere in the same league graphically. Braben was resourceful, too: he started tinkering with his machine, adding memory and augmenting the innards. Within a few months, he had rebuilt his Atom until it had become something of a Frankenstein’s BBC Micro.
And with no money to buy games, he had a go at writing his own. The computer came with a comprehensive manual, and the Atom boasted a blossoming programming scene, amply supported by magazines and their type-in listings. He jumped in enthusiastically, recalling, ‘The atmosphere was great and it was very easy to write simple games at the time. Most of the machines fired up in a programming language, like the Atom, so it was really straightforward.’
Even before he had bought his computer, Braben had been fascinated with 3D graphics. The received wisdom at the time was that they couldn’t be done, at least by a novice, but he was a smart teenager on his way to Cambridge, and was convinced that they couldn’t be that hard. Working in BASIC, he started playing with ideas that showed 3D movement, at first drawing a ‘star field’: a sprinkling of dots that rushed past the viewpoint of the screen.
Braben found that his star field barely animated fast enough to deserve the name – the dots were visibly re-plotting, like paint spots being splattered onto canvas. So he abandoned BASIC and learnt to code with assembler to reach right down to the 6502 processor. The effect was dramatic: the dots stormed past, and suddenly there was a sensation of movement. His new skill also opened the door to grander graphics, and soon he had wireframe models of spaceships whizzing around the speckles of light. He knew that he was onto something: by the time Braben went up to Cambridge to study Natural Sciences, he had the workings of a 3D flight game.
Braben and Bell first met in their college dining hall, and they quickly learnt that they were both writing games on Acorn machines. For Braben, with his underpowered, over-stretched Atom, there was a practical advantage to linking up with Bell: ‘He had a BBC Micro and I didn’t!’ Braben showed Bell his embryonic space game, and Bell immediately latched on to it, finding ways to make the graphics run faster and make more than one spaceship appear on screen at any one time. Bell was impressed by the images he had created – this was something that he had never seen in a computer game before.
They started developing it as a team. ‘We each had loads of great ideas and it seemed logical to work together,’ recalls Braben. ‘We discussed how we could make it into the sort of game we would both want to play.’ Shooting and combat were added first: the game let the player fire at spaceships, later destroying them in a blaze of particle effects lifted from Bell’s Free Fall. In itself this was an innovation: although 3D combat had been seen in Atari’s tank game Battlezone, space combat was more fluid and freeform, and excitingly mimicked the dogfights seen in the Star Wars films.
Their creation also mimicked the form of the arcade games. Braben was fond of arcade machines – Defender in particular was a favourite – but the approach didn’t suit their game: destroying ships for its own sake wasn’t enough to be satisfying, and nor was earning points. ‘The banality of having a score felt wrong,’ he says.
Arcades had been designed to keep the turnover of games high. Players were given three lives and a high score to beat for a quick, repetitive fix, designed to encourage another 10p to drop into the machine within a few minutes. Longevity was a product of addictiveness, rather than the content of the game, which had to draw players back, and then throw them off as quickly as possible. To Braben and Bell, this seemed a bizarre design choice in the home environment where there were no coins to collect.
It was boring, too. The score increased, but Braben found the motivation didn’t: it was an abstraction, occasionally incentivised with a reward. ‘Many games at the time had a tradition of an additional “life” every 10,000 score, and something else extra at 15,000,’ he says. Their game might have fallen into this trap, but the two young programmers were unwilling to follow the convention.
It was the early years of Margaret Thatcher’s first government and, as Braben put it, ‘she wasn’t best liked in university circles’. Already the touchstones of her premiership – individualism, entrepreneurship – were becoming apparent, and Braben and Bell, with some sense of the irony of their choice, put these concepts at the heart of their game. Instead of increasing their score by shooting spaceships, players would earn money.
‘The score-as-money was the obvious way forwards,’ says Braben. ‘It seemed appropriately ironic at the time with the whole “greed is good” mantra and the anti-Thatcher protests.’ With this idea set, others naturally followed: that the player could buy more and better weapons; that the points awarded for destroying the ships were payments from an omniscient power. It was decided that the enemy ships should be villainous, and pirates fitted the role. And if they were pirates, what were they pirating? Goods that they could drop once destroyed, which the player could pick up for cash. And if pirates dropped cargo, why not have innocent, unaggressive ships do the same thing? But shooting these ships would be morally wrong, so the player must risk punishment for doing it – by earning the ire of a galactic police force that would send their ships after wrongdoers. The ideas were spun, developed and refined as Braben and Bell created a universe with internal rules, motives and choices.
One decision in particular cemented the tone of the game: the cargo, a reason for pirates and player alike to shoot at other ships, should be available to be bought and sold. The pair developed the idea that players would travel across a galaxy where each star system had different characteristics – there would be industrial, agricultural and anarchic planets. And each type of world would set a different price for different goods. A space pilot could make a fortune buying cheap and selling dear, judging who would pay the best price for the food or minerals he or she had picked up for a song on an impoverished world. Like a fleet of virtual Thatcher’s children, the players could become traders.
But they didn’t have to. Instead, they could hang around wealthy star systems, gunning down trading ships for their cargo and scarpering when the police showed up. Or they could visit dodgy, anarchic planets and kill villains for profit. Or they could shoot at police ships leaving a space station, capture their escape pods and sell them as slaves. And they didn’t have to limit themselves to any one of these scenarios – the gameplay could be mixed and matched at the player’s whim. It was a freedom that ran throughout the game: ‘We wanted the player to be able to choose,’ says Braben.
And gamers were given a vast playground in which to make their choices. They would have thousands of star systems to explore, reaching across hundreds of galaxies. They could name their pilot, whose odyssey would last far longer than a single playing session – as with adventure games, their progress could be saved to tape or disc and picked up later. And as with MUD, pilots would have ranks to note the kills notched up on their consoles. Braben and Bell both appreciated Douglas Adams, and they borrowed the first two levels from his Hitchhiker’s Guide to The Galaxy: Harmless, and Mostly Harmless. The highest level was their own creation, and gave their groundbreaking game its name. Every player started out as Harmless, but after weeks of play and 6,400 kills, a pilot could achieve the very highest accolade: Elite.
The design was all encompassing, the appearance completely immersive, and the universe they were creating was vast. But thr
oughout the development of the game, Braben and Bell’s problem was that they had to show all of this – planets, spaceships, space stations – using the power of a modest 6502 processor. And they had to fit it all into a BBC Micro’s 32 kilobytes of memory.
A layman’s measure of the progress of computing power is to look at the growth in a typical computer’s memory. It’s not an ideal charting tool – only one yardstick amongst dozens – and the division between memory for running programs and storage is often blurred. But nonetheless it makes the rapid advance of the home computer astonishingly plain: a modern PC, or even a smart phone, contains easily a million times the memory found in the machines available in the eighties. For modern systems, memory constraints are still a boundary, but also something of a moveable goal, as a compromise can usually be found somewhere – in the number of colours, the quality of the sound, how blurred a texture looks close up.
But as memory becomes tinier, the choices become harder. Fewer bytes stops meaning a less detailed experience, and starts to cut into what can be done at all. When a computer has only 32 kilobytes to play with, data becomes more and more precious, until eventually each tiny tweak of memory will be carefully planned, designed and tested. It’s not simply a case of doing less with less memory – the challenge is qualitatively different.
The first lesson a BBC Micro developer learnt was that the memory they had to use was already rather smaller than 32 kilobytes. The image held on the screen took up a vast chunk of it: a third, or two-thirds for really high-resolution or colourful graphics. Bell and Braben chose a high-resolution two-colour mode, which immediately bumped their available memory down to 22 kilobytes. And into this, they squeezed eight galaxies, each with hundreds of stars, planets and civilisations.
They used an elegant mathematical technique. Each aspect of a solar system and its society could be represented by a number: its co-ordinates, the prices it charged for goods, its political and economic type, and even, using a lookup table of syllables, its name. And there are some calculation processes that can generate a string of numbers that appear to be random, but are in fact entirely predictable: the same set of numbers is produced every time the routine is run. Combining these two concepts allowed Bell and Braben to create unlimited galactic data from a tiny amount of memory.
Of course, even pseudo-random numbers aren’t always convenient. The co-ordinates produced could leave some stars completely unreachable, so Bell and Braben wrote a program to discard any galaxy where this happened. The prices might also be wildly askew, so an algorithm was written to tie them to the economy of the planet. And the names could throw up some unfortunate combinations. Bell and Braben held a ‘beauty parade’ to weed out obscenities: they decided that it was just about okay to have the planet ‘Arse’ deep in the depths of space, but nothing ruder awaited a blushing space pirate.
The galactic milieu offered players months, or even years of gameplay. They might have had an inkling that such scale wouldn’t have been possible if each element had been handcrafted, but that didn’t need explaining – it only added to the wonder of an unexplored universe.
The visuals, on the other hand, were an unmissable technical marvel. Planets, bright white stars, dogfighting spacecraft and orbiting space stations all rotated and whizzed past as the player’s ship manoeuvred amongst them. It was magnificent, in an absurdly better league than anything else seen on a home computer at the time. The two creators spent eighteen months, working between their university studies, to make Braben’s primitive demonstration into a cockpit’s eye view of a living science fiction universe, and it paid off. Elite looked astonishing.
Under the bonnet, it was, if anything, even more inspired. When Braben had heard that 3D on a home computer wasn’t possible, he wasn’t being misled: it was a slow, cumbersome process to work through the sums required for perspective calculation and rotation, and a home processor, built around simple addition, never seemed up to the job. The most basic building block for 3D graphics required processor-intense ‘floating point’ division, and rotation needed a huge amount of intricate maths to be applied to every single line and dot. Even in machine code, calculating and drawing a typical Elite image using conventional programming would take an achingly long time.
But the pair weren’t conventionally trained programmers. Every program they had written so far had flowed from self-taught puzzle solving, and to bright and motivated science undergraduates, making the impossible happen was another chance to flaunt their skills. And they did: the word ‘optimisation’ wasn’t really in use at the time, but even if it had been, it wouldn’t quite capture Braben and Bell’s catalogue of groundbreaking techniques. Every aspect of maths, hardware and graphics, no matter how fundamental, was challenged.
By far the slowest computational chore was drawing lines on the screen. The BBC Micro’s hardware featured a built-in line drawing routine, but Braben and Bell found that this used a slow technique designed to capture any possible line. So they replaced it with their own: a set of routines that could draw one ‘type’ of line very fast: a short, nearly horizontal line, a long vertical line, and so on. When rendering a scene, the program looked at each line’s length and angle, and chose the fastest method. The speed of the game shot up.
They were using an 8-bit processor, which can use numbers up to 256 quickly, but ties itself in cumbersome knots for anything even slightly higher. So they set the drawing area resolution to be precisely 256 by 256 pixels, so that their drawing routine would always fall within the golden parameters. The draw rate was boosted by a fifth, and it meant that the overall screen could be narrowed – another memory-saving tweak.
And for the frame-rate-killing rotation calculations, the students came up with a cunning trick that used simple estimations to stand in place of precise, time-consuming calculations. For fast-moving scenes like space combat, these pseudo-answers were good enough, but over a few seconds the tiny inaccuracies from these shortcuts piled on top of each other, and ships could start to look ‘wobbly’. The game kept track, and used a full calculation to tidy it all up whenever it found some spare processor time. Overall, it was another speed jump.
When Braben and Bell analysed the rotation calculations for a single spaceship, they found that they were full of repetition – where co-ordinates were mirrored, the same sums were performed twice. Or, in the minds of time-ravenous programmers, half the calculations for symmetrical shapes were ‘free’. All of the ships became symmetrical.
Three-dimensional maths is famously intensive, but one of the reasons it was slow was that it was full of redundant calculations: a typical object might have lots of intricate lines, but most of them would never be seen. Elite’s ships were all deliberately made to be simple to render: like a cube or a block of cheese, every side could either be seen or not, but would never be partially hidden by another part of the ship.
And by figuring out how best to take advantage of this, Bell and Braben hit upon a technique that would become a staple of game technology a decade later. The most time-consuming calculations would be gauged with a vague test before any were undertaken properly, and by the time the whole scene had been assessed, plenty of calculations were found to be unnecessary, or to cancel each other out. For instance, a routine could work out quickly which sides of a ship never needed to be thought about, because they faced away from the screen. This technique is now called ‘lazy evaluation’ – back in 1983 it was simply the routine that made the whole game nearly twice as fast.
They had one final trick. On the BBC Micro, colour came at a cost of either resolution, or memory and speed, and one of the first decisions that a designer needed to make was whether it was worth that trade-off. Not Bell and Braben – they found a way to both have and eat their cake: the spaceship visuals, which needed to be fast and precise, were in hi-res black and white; then two-thirds of the way down the screen, the computer was wrenched out of that mode and into low-res colour ideal for the radar and flight information. It wa
s a handy and quite harmless abuse of the hardware, which still earns them praise from the very highest source: the BBC Micro design team.
‘Elite is the program that couldn’t have been written,’ says Sophie Wilson. ‘David Braben came up with the trick of reprogramming the video controller halfway down the screen, squashing more into the machine than was possible.’
Steve Furber agrees: ‘What David Braben managed to do on a computer with no memory and no computer power – Elite had the BBC design team staggered. It was one of the most astonishing games.’
Bell and Braben were bounding ahead of every game available, but they couldn’t know for sure that there weren’t rivals with similar ideas somewhere in the country, on the verge of publication. They had a couple of scares in 1982: Malcolm Evan’s 3D Monster Maze game sounded like it might be steps ahead of theirs, with its solid walls and lumbering monsters. It was with some relief that they found it to be minimalist and rotationless, using the ZX81’s limitations for atmosphere rather than overcoming them. They also hunted down a demonstration of a rotating 3D house that Acorn itself had put together. It wasn’t as fast as their own 3D models and, they found out, didn’t rely on real-time calculations at all. The Acorn team had created it to show how fast data could be loaded off their new hard drive – after all, no computer could genuinely calculate 3D maths at that speed, could it?
But Elite’s creators were still secretive, and very cautious about approaching publishers. It was 1983, with the game in an advanced, playable state, before they dared show it to anyone outside their narrow circle. Braben had a contact at Thorn EMI, so they started there. The publisher was an almost absurdly stereotypical corporate behemoth: Bell and Braben found themselves presenting their game in a gleaming London office, where music executives were plotting hits on another floor. It was a company that understood the entertainment business; it knew how to make pop stars smile and how to fill record shops with their products.