Foxhole is a game of rare ambition. It’s a top-down multiplayer war simulator set in a persistent world, and where other games might take that premise and focus on the combat, Foxhole aims to simulate multiple facets of war. Players can help their faction not just in pushing the front line, but by gathering intelligence or resources, ferrying supplies to the front, manufacturing weapons and ammunition, or sabotaging the enemy’s infrastructure behind their lines.

Such efforts play out across “a war that can span several weeks”, Mark Ng, lead designer and studio head at developer Clapfoot, tells us, and on maps that take over an hour to circumnavigate. Filling such a big world with players has been “the biggest technical challenge by far”, he confirms. “Off-the-shelf game engines usually aren’t designed to support more than 100 players per server, and even reaching that number is technically difficult.” Enabling so many players to build “thousands” of structures like sandbag walls, foxholes, and bunkers while keeping the servers stable is an additional challenge.

It hasn’t happened overnight. The story of Foxhole’s time in Early Access is one of continually inching towards the scale that Clapfoot first envisioned, and Ng reckons there’s another year to go before it’s ready to launch into 1.0. The project requires a robust multiplayer engine, with plenty of tolerance for custom tech and iterative development – and Unreal Engine fit the bill.

After powering dozens of multiplayer games large and small for more than 20 years, Unreal’s base networking code has been thoroughly battle-tested, says Ng, “and handles a lot of the nitty gritty details of multiplayer programming.”

These foundations are complemented by “a lot of built-in features to help optimise your networking code and to tailor it to your type of game”, Ng continues. “Foxhole is played from the top-down camera perspective, so there are certain optimisation techniques open to us that wouldn’t be available for a first person shooter game, for example. Unreal has tools that allow us to exploit these optimisations to get more players onto a single server. We are now able to support between 150 and 180 players per server with stable performance, depending on the situation.

“In addition, we have some custom technology that we developed in-house that allows us to stitch these regions together to make up a larger world that can support more than a thousand concurrent players. The open source nature of Unreal made it far easier for us to integrate this custom technology with the game.”

And yet Clapfoot is not a large studio; its days of modest mobile development aren’t long gone. With a relatively small team and an ever-expanding game, they need “really robust tools to author all that content”, Ng says. “Unreal offers a lot of built-in tools that help in crafting a large world, such as a fully featured landscape editor, foliage support, and effects system.” When it came to combining its maps into that one giant mega map, “it turned out that Unreal also had built-in support for level streaming and map stitching, which helped tremendously.”

The game is constantly surprising us in both good and bad ways Mark Ng

Iterations on the technical side are one thing, but Foxhole’s very nature as a sandbox game of such extraordinary scale keeps Clapfoot’s designers on their toes, too – both as they continue to upscale the game, and in responding to the most devilishly unpredictable element of all: players.

“Our main design challenge in Foxhole is in designing a game with lots of player agency, but also one in which players are expected to work together as a large army”, Ng says. “It’s often that we design a feature around all this chaos and players don’t do what we expect them to, which results in us having to go back to the drawing board to try new things. Unreal helps us in this process because it makes it relatively easy to change and tweak gameplay to try different things between updates. This iterative process is essential in solving gameplay problems when you are pioneering an entirely new style of game as we are with Foxhole.”

Unreal Engine’s first release was back in 1998, since when it has become the most-licensed commercial game engine on the market. It has been used to develop thousands of games across dozens of genres, and Ng says this legacy is evident. “It’s easy to recognise that the codebase has shipped with many titles in the past because of the practical ways it handles common gameplay logic. It takes care of a lot of the edge cases in code that you’d otherwise have to resolve yourself, such as all the little nuances of simulating movement in a multiplayer environment. It also goes without saying that the art pipeline and content creation tools, like the level editor, are some of the best in the industry, which allows our artists and designers to be super productive.”

Since we previewed Foxhole upon its Early Access launch, Clapfoot has “added many key features, such as amphibious warfare, ballistic rocket super weapons, and full-fledged urban environments,” as well as combining its maps into one massive theatre. “The game is constantly surprising us in both good and bad ways,” Ng reflects. “Sometimes groups of players pull off incredible feats that we would have never imagined, and at other times due to the sandbox nature of the game they find exploits or ways to grief other players.” Again, its Unreal’s tolerance for iterative development that enables Clapfoot to adapt to its playerbase and put out patches to resolve these issues.

What Unreal has helped Clapfoot to achieve is already hugely impressive. When we first saw Foxhole two years ago, we dared to suggest it may be “the fullest multiplayer war sim yet”. In hindsight that should probably be “the most full multiplayer war sim yet”, but, with the exception of Eve Online, we pretty much stand by the statement.

Foxhole’s vast, complicated, factional wars are already producing some extraordinary stories that are very Eve-like in their human drama; Ng’s favourite “by far” has been the so-called ‘Jade Cove Crisis’, in which a faction tore itself apart over whether to launch a superweapon at a town, losing the war as a result. See this brilliant themed interview for an overview of the crisis, and the community content that it has inspired. If Foxhole is already creating these kinds of stories, imagine the game it’ll be when the devs consider it finished.

Foxhole is in Steam Early Access here. 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 and Clapfoot Games.