A game of Fortnite begins with a gathering and construction phase, in which you and your teammates build high and wide, laying foundations and creating platforms. You do your best to predict the coming challenges and set up measures to counter them. Then comes the horde, but the building work goes on: as your defences start to fail, you’re there to erect new walls, fighting fires even as the battle rages on around you.
There are no zombies in North Carolina, but Fortnite’s development has otherwise been much the same. As the first game made in Unreal Engine 4, Fortnite has been on the vanguard of technical change. Its team have built a bright, bold, co-op shooter, and at the same time faced down the bugs and problems of a new engine so that a generation of Unreal Engine developers don’t have to.
In the beginning, when Unreal Engine 4 needed a game to prove its core systems, Epic looked around. And lo, there in their own headquarters was a colourful crafting, building, and action game named Fortnite.
“Features proven to work over a large period of time in a full game like Fortnite are very stable by the time Unreal Engine 4 users see them,” Epic technical lead Bob Tellez explains. “Fortnite has been the proving ground for many engine features, even beyond core systems, throughout its development. Being at the bleeding edge means we take on the responsibility of not only finding bugs, but also fixing them in many cases.”
Unreal Engine 4 is born
As Fortnite grew, the team at Epic found themselves inventing the scaffolding to support it. At one stage, there was no game launcher – so they had a team of two programmers work on one and ship it out to friends and family.
“It was a proof of concept for actually being capable of performing a self-patch,” senior programmer Leigh Swift says. “It was so many years ago; it’s come a long way.”
As Unreal Engine 4 went free and Unreal Tournament came into being, Epic folded new software into that same proof of concept. Eventually, it became the Epic Games Launcher, the delivery platform for the new, self-publishing Epic – as important to their business as Battle.net has been to Blizzard.
Build it and they will build
Construction in Fortnite feels effortless. Lay a blueprint for a set of stairs and it’s yours to walk on; even as the bricks and timber drift into place around your feet. There’s a breezy magic to it, reminiscent of the classic Snow White scene in which a flock of birds fly in her open window to arrange and water her flowers. But it wasn’t always so.
“We had old iterations that were dramatically slower where a player had to stand still and hammer the pieces into existence,” lead programmer Billy Bramer says. “We used to have a UI that resembled using a spreadsheet just to pick parts.”
At one point, the team considered assigning weights to different piece types – brick staircases, wooden walls, metal roofs, and so on – before deciding they didn’t want players to feel like they needed an engineering degree to put things together.
The final system’s stroke of genius is that it not only leaves out the maths, but deals only in simple shapes. Remove two squares from the centre-bottom of a wall piece, for instance, and the game knows to fill it with a doorway. Similarly, construction takes context into account, so that a stairway automatically curves to meet an existing upper floor – a system prototyped by Bramer and lead level designer David Spalinski.
“From a technical standpoint, allowing players to build nearly anywhere in the level drove the necessity to invest a network dormancy system, as well as substantial work to make AI enemies functional and challenging,” Bramer adds. “Most games aren’t as completely dynamic as Fortnite is.”
Sleeping actors
Let’s dig into that ‘network dormancy’. It’s the term Epic use for their method of keeping track of the state of hundreds of thousands of objects in a generated world. Don’t forget: Fortnite is intended for online multiplayer. Netcode is tricky enough when there’s only shooting to worry about, but Epic have had to synchronise constantly changing levels across the PCs of multiple players.
“A dormant actor does not reflect its state until it is told to do so, and all actors [or objects] in the world are initially dormant, so all clients have an initially synchronised view since they all generate the same world,” Tellez expands.
From there, Fortnite keeps a list of all the actors destroyed, altered, or created in the map, while disregarding those that stay the same. The saves made in bandwidth can then be spent on the shootier parts of the game which, naturally given their history, Epic make the most of.
“There have been a small number of times during development where dormancy broke and the game immediately became unplayable, hitchy, and laggy,” Tellez says. “So we definitely need it to make a game like this.”
In the early years of its development, the Fortnite team worked deep in the bowels of an untested engine, ironing out the kinks in the best way they could: using it to build a real, major project. It’s worked out on both counts. Fortnite is now out in open beta, and Unreal Engine 4 has been a huge success story for Epic. But it’s been tough.
“There used to be an ‘engine rage’ meter on the wall that went from one to ten, with additional entries that went to 15 or so,” lead programmer Jason Bestimt remembers. “When Fortnite took constant changes because everything was in the main branch, I never saw it below 12.”
Fortnite is available through the Epic Games Launcher. Unreal Engine 4 development is now free.
In this sponsored series, we’re looking at how game developers are taking advantage of Unreal Engine 4 to create a new generation of PC games. With thanks to Epic Games.