How the innovation of the Infinity Engine brought Baldur's Gate to life

This piece is part of a series of articles that ran in PC Gamer UK issue 326 celebrating Baldur's Gate. For more quality articles about all things PC gaming, you can subscribe now in the UK and the US.  

Baldur’s Gate is powered by the Infinity engine, a bespoke technology created by BioWare specifically for the game. Simple in its exterior, Infinity makes the complexity of Advanced Dungeons & Dragons playable with just a mouse, and makes use of a visual style that boils down to a bunch of animated sprites walking on top of some beautiful paintings. 

Looks can be deceiving. Beneath those simple backdrops was a deep and complicated engine made up of many different tools and technologies. It was hugely advanced and also hugely idiosyncratic, while getting it to work in the way BioWare wanted was, frankly, a nightmare. 

While BioWare itself was not a new studio, the Baldur’s Gate team was almost entirely new to the games industry, with many of its designers coming straight from university. “It was just a bunch of crazy kids going, ‘Let’s just do this thing! How hard can it be?’” explains Trent Oster, formerly senior artist on Baldur’s Gate, and one of the founders of BioWare. “The answer is it’s really hard, [and] really easy to do things in a bad way that makes things slow and makes things horrible.”

Breaking backgrounds

Baldur’s Gate is famous for its use of prerendered isometric backdrops, which enabled BioWare to represent its fantasy world in far more detail than was possible with real-time graphics. But even prerendered, each of those backdrops had a native 5120x3480 resolution—way higher than any computer from 1998 could have rendered without exploding. “Each image of that massive background was cut into a 64x64 tile, and each one of those was mastered down to its own little palette of 256 colours,” Oster explains. “At runtime [Infinity] would load those little 64 bit chunks as it needed them, and it would convert them into a 16-bit colour representation that would then be rendered to the screen.” 

The Infinity Engine would then perform a prototypical version of modern level-streaming, adding new chunks of the background into memory as the player moved forward, and dropping off-screen chunks as they were no longer required. This ‘tile-management’ system was incredibly complicated, requiring a huge amount of work to optimise and necessitating lengthy loading times between screens. 

Also, the dividing of backgrounds in Baldur’s Gate into tiles increased the assets of an already huge game exponentially. “At the time, most games were throwing around 100, 200, 500 in-game assets,” Oster says. “Baldur’s Gate was throwing around 20,000 to 30,000. If you count individual tiles that made up areas, it was into the hundreds of thousands.”

To manage these assets, BioWare’s lead programmer Scott Grieg created a memory management system called Chitin. This worked a little like a slide projector, offering your 4MB PC a tiny window into Baldur’s Gate’s much larger dataset. But problems began to arise when Grieg decided to make Chitin multithreaded. “Chitin wasn’t multithreaded inherently. But partway through development they designed the AI system and the pathfinding system, and part of that design was getting excited about the idea of multithreading,” Oster says. 

In theory, this was a great way of offloading the data Infinity had to crunch through to make the game work. But at the time, multicore processors didn’t exist. “When you actually think through how the data is held in the processor, and how it’s interacted with, what you just engineered is a scenario for countless pipeline stalls,” Oster points out. 

The team tried to alleviate this problem by highlighting certain threads as ‘critical’, which meant they had to complete their processing before any other threads could run. But Baldur’s Gate had over a million lines of code, so many critical threads were not labelled as such, resulting in massive performance headaches. Oster points out that in the code base there are five separate ways players can trigger an area transition. “In many cases, it was code that was almost identical but literally different by one or two parameters.”

Cover-up job

Amongst these core technical issues were dozens of other problems. Baldur’s Gate’s UI is not an overlay, it’s hard-coded into the game. Again, this was done to increase performance. “Baldur’s Gate’s UI is fat to cover up the screen, so you don’t have to render as much of the background,” But this also meant the only way to make a change to the overlay was to do it via the game’s code base. Want to move an icon from the left to the right of the screen? You could potentially break the game. 

All of this meant that BioWare created problems for itself that could only be solved through brute force, testing every line of code, painstakingly clipping out objects in the background so that characters could walk behind walls. “The approach that BioWare took at the time, was, ‘We don’t know the right way to do this, we don’t know how to automate things. Let’s throw humans at the problem, and with enough sweat the problem will go away,’ remembers Oster. 

This, ultimately, is the real story of Baldur’s Gate. The trials of BioWare’s Infinity Engine were not just technical, they were physical, too. “It was a monumental achievement at the time,” Oster concludes.

TOPICS
Contributor

Rick has been fascinated by PC gaming since he was seven years old, when he used to sneak into his dad's home office for covert sessions of Doom. He grew up on a diet of similarly unsuitable games, with favourites including Quake, Thief, Half-Life and Deus Ex. Between 2013 and 2022, Rick was games editor of Custom PC magazine and associated website bit-tech.net. But he's always kept one foot in freelance games journalism, writing for publications like Edge, Eurogamer, the Guardian and, naturally, PC Gamer. While he'll play anything that can be controlled with a keyboard and mouse, he has a particular passion for first-person shooters and immersive sims.

Read more
Baldur's Gate 3
2024 was still the year of Baldur's Gate 3: Why we're all still playing Larian's once-in-a-decade RPG 16 months later
A man shouting while waving his sword in Kingdom Come: Deliverance 2.
Baldur's Gate 3 and Kingdom Come: Deliverance 2 show that the future of RPGs is in games way more ambitious, weird and unexpected than anything Bethesda and BioWare have to offer
Aribeth de Tylmarande in Neverwinter Nights.
23-year-old D&D RPG Neverwinter Nights just got a new update thanks to the 'unpaid software engineers' of its unkillable community
A screenshot from the PC version of Avowed, from Xbox Games Studios
Unreal Engine often gets flak for games running poorly or stuttering, but as Avowed demonstrates, it's really about how devs use it and the pressures of time
Morrigan, the Witch of the Wilds in the Dragon Age serries, shown wielding magic in front of a Darkspawn.
Is this the end of Dragon Age? Veilguard was good, but BioWare needed an all-timer, and I'm nervous about what's next
Wyrdsong concept art
Wyrdsong, the RPG from ex-Bethesda talent, isn't dead—but it's no longer an open world: 'We're down to a skeleton crew'
Latest in Baldur's Gate
Minthara BG3 looking upset
Another round of Baldur's Gate 3 unearthing reveals Minthara can end up living in a sewer, an unused beach ending, and more
Gale, a wizard from Baldur's Gate 3, looks very bloodied and very sad at the player while a celestial midnight blooms behind his depressed mug.
Baldur's Gate 3's stress test update fixes heartbreaking bug that wiped out Honour Mode runs at the last possible moment
Baldur's Gate 3 player character made to resemble Geralt of Rivia from The Witcher.
Wait a minute, Geralt of Rivia actor Doug Cockle was in Baldur's Gate 3 this whole time
Half Orc wearing rare Bhaalist Armor in Baldur's Gate 3 standing in front of Astarion and Karlach
It turns out you can get Baldur's Gate 3's best assassin armor without killing a baby angel elephant and joining a cult, all you have to do is pickpocket a ghost
Gale, a wizard from Baldur's Gate 3, looks very bloodied and very sad at the player while a celestial midnight blooms behind his depressed mug.
Baldur's Gate 3's stress test update has, mercifully, made one of its new OP cantrips halfway balanced again—but it's really still quite good
Withers Big Naturals mod image - Withers with big naturals
Sure, why not, here's a guy beating Baldur's Gate 3 without a race or class at all
Latest in Features
Steel Hunters hands-on
Steel Hunters is like a more tactical Titanfall, but as an extraction shooter it's undermined by boring loot
A close-up photo of an Nvidia RTX 4070, with its heatsink removed, showing the AD104 GPU die and the surrounding Micron GDDR6X VRAM chips
With Nvidia Ace taking up 1 GB of VRAM in Inzoi, Team Green will need to up its memory game if AI NPCs take off in PC gaming
While Waiting
While Waiting is a game all about chugging through life's most mundane tasks with a heaping side order of whimsy
A snakewoman holding a sickle
Magic: The Gathering's Tarkir: Dragonstorm set isn't just about dragons
A screenshot from game Mudborne of a little humanoid frog in a marsh
Five new Steam games you probably missed (March 24, 2025)
Fragpunk
Somebody finally figured out casual Counter-Strike