Danger Zone

What its really like to work on Xbox One X

By 31st October 2017 No Comments

Danger Zone has been enhanced specifically to take advantage of the power of the Xbox One X. The marketing spiel for the Xbox One X describes it as “the world’s most powerful games console”, promising to herald in the, long promised, era of 4K gaming. Does the hardware live up to the hype and did it allow us to deliver a true 4K game?

At Three Fields Entertainment we were lucky enough to receive early development hardware from our friends at Microsoft many months ago and have been working since then on ways to use all this extra power to make the definitive version of Danger Zone.

In short, yes! The Xbox One X is, without doubt, the most powerful games console in the world. For the first time we have been able to add two, user-selectable, performance modes to one of our games: “Best Quality” and “Best Performance”. “Best Quality” not only renders the game at an incredibly crisp native 4K but also manages to add dynamic shadows while still maintaining a steady 30Hz frame rate. “Best Performance” renders the game at 1080p to achieve a super fast 60Hz frame rate while still having GPU performance left over to draw our HUD and text at a sharp 4K resolution. The vastly improved hard drive also slashes our already short load times to be almost non-existent.

In case you can’t tell I’m a big fan of the hardware. It wasn’t all plain sailing though and getting here took a lot of hard and painstaking optimization effort to squeeze out the best possible results.


Delivering Native 4K

Unboxing our first Xbox One X development kit all those months ago was an exciting day but even more exciting was the prospect of getting Danger Zone up and running on it to see what we could expect to achieve. We received our hardware not long after we had begun development on Danger Zone on the Xbox One and were already deep in the process of optimizing our physics CPU cost, rendering calls and GPU performance to target 900p at a solid 30Hz. Having heard all about the performance boosts that we could expect from the Xbox One X from Microsoft I wasn’t 100% confident that scaling up to native 4K from 900p would be achievable. I thought we would have to compromise with an upscaling solution, such as checkerboard rendering to deliver a reconstructed 4K image. Like any new hardware we had teething problems getting Danger Zone up and running for the first time. Thanks to our friends at Epic and the amazing Unreal Engine we got over these hurdles relatively quickly and soon had an Xbox One X version of Danger Zone. Our efforts were rewarded with the first native 4K console game any of us had ever seen – the sharpness of the visual really blew us away. Unfortunately the game was not rendering 4K at an acceptable frame rate. Having read about 4K gaming being around the corner for a few years and having just seen what Danger Zone would look like at 4K on a games console, anything other than delivering native 4K felt like it would be a real let down. We re-doubled our efforts to find the performance so we could get there.

By the point we had completed all our optimization for the Xbox One version of the game the native 4K target seemed a lot closer. Our biggest problem was transparency. Transparency is the ability to see through something to what is behind it. Glass and smoke (which we have a lot of in a game about cars crashing) need to be rendered using transparency to look right in game. Unfortunately transparent pixels are expensive for the GPU to render – not only do you have to render the transparent thing but also the thing behind it too, requiring the pixel to be drawn twice. It gets worse when you have transparent things overlapping one another which then require pixels to be drawn many times for each overlapping transparent thing. Things get worse still when you start having complex effects like lighting transparent smoke (which you can see on our start line) adding even more GPU cost per pixel drawn. With more than 4x as many pixels to draw as our Xbox One version the GPU was not managing to hit the native 4K we so desperately wanted to achieve at a consistent frame rate. A lot of hard work and some clever smoke (*groan*) and mirrors tuning to get the best effect for the cheapest render cost later and we were in touching distance of the target. The final GPU push for Xbox One performance got us over the edge and we had a native 4K game.

Where the raw grunt and clever architecture of the console really did help was on the render side. Sadly we were unable to have dynamic shadows in the Xbox One version of Danger Zone. The CPU cost of dispatching the data to draw them to the GPU was simply too high. The faster memory and simpler hardware architecture of the Xbox One X meant that this cost was dramatically reduced. As a result in addition to running at native 4K we were able to turn on dynamic shadows while still hitting a constant 30Hz framerate.

Translucent smoke fills the screen overlapping a lot of other translucent effects and cracked transparent glass

Translucent smoke fills the screen overlapping a multiple other translucent effects and cracked transparent glass. A fiery nightmare vision of hell for a graphics programmer, “wow” for anyone else.


Having taken full advantage of the GPU grunt and clever hardware architecture it seemed a shame that we weren’t really making full use of the additional CPU horsepower at our disposal. Not wanting to rest on our laurels we set about seeing if we could run Danger Zone at 60Hz. We knew that we could comfortably run at 60Hz on the GPU if we rendered at 1080p, since there would be 4 times less to draw. We had also already done all the optimization work to always run the physics simulation at 60Hz, regardless of frame rate, as this gave such a significantly better game experience. Running some profiles we were still some way off a 60Hz CPU performance. The main culprit turned out to be quite counter-intuitive.

From all our experience and all the advice we had received from expert help and talks at conferences the accepted way of making things run fast on modern console hardware is to go as parallel as possible. Specifically this means keeping as many of the cores on as many of the CPUs doing work for you a the same time as possible. A great visual metaphor from Danny Chen at Microsoft was his daughter’s toy box. When she put her toys away they would only just fit in – there were lots of gaps between toys but at least the lid would close, although sadly there was no space for new toys. When Danny cleaned up, being a king of efficiency, he managed to squeeze everything in with no gaps. Now not only did the lid close but there was space for even more toys. In the case of a video game there is only a fixed amount of time each frame to get all our CPU work done, represented by the space in the toy box. If we can efficiently pack our CPU work in leaving no gaps on any CPU core then we can do more work in the same amount of time resulting in better frame rates or more features running at the same frame rate. We had taken this to heart in Danger Zone and thought we had made great use of packing in our physics-based animation, which allows our car wheels to turn and the doors, trunks and hoods of the vehicles to flap when they are hit. We had made it hugely parallel, distributing the work for the physics animation of all of the up to 140 cars we were simulating per level across all of the available CPU cores. Our performance profiles looked great – they showed we had packed work across all the CPUs, we felt very pleased with ourselves. Unfortunately on closer inspection things were not so great. The performance cost of dispatching all this parallel work and collating the results vastly outweighed the rather simple calculations (generally a small amount of rotation) that actually needed to be done. On top of this a bug in all this complicated code was actually preventing cars that were no longer driving or crashing being removed from the physics simulation costing us even more CPU time for no obvious benefit. Replacing all this complicated parallel code with a simple once a frame loop over all the vehicles to update their physics animation made our total physics cost much cheaper and freed up a lot of CPU time to allow us to get to 60Hz. Lesson learned – challenge all assumptions and really interrogate all performance captures, just because they look great it doesn’t mean they are.

Doors flap and unhinge as cars crash

Doors, trunks and hoods pop open and unhinge as cars explode and crash

We are incredibly proud of what we have achieved with Danger Zone on the great Xbox One X hardware that Microsoft has produced. The Danger Zone Xbox One X enhancements is now live for all owners of Danger Zone. In addition to beautiful 4K visuals and super-smooth 60Hz frame rate the update also adds 6 new bonus levels and gives players the chance to drive the pick up truck.

Happy downloading.

Buy Danger Zone for Xbox One X herelogo_xboxonex





Psst! To be the first to hear our news sign up to our Fan and Press Mailing lists here. We guarantee we will always tell you our news first before we put it out on social media.