Saturday, 11 February 2012

Next-Gen Cloud vs. Console

The recent announcement of GFACE - a social media network with cloud support, backed by Crytek - demonstrates that the concept of "gaming over IP" is likely to gain further traction as viable competition to both current and next-gen consoles. OnLive is out now with a full service, Gaikai is set to follow suit this year, and while there's a strong argument that these emerging technologies are not really a match for the local console experience, it's only fair to remember that these are first-gen technological products. They will improve, and even in the here-and-now they do work, even if the experience is quantifiably sub-optimal compared to local gaming.

The question is, to what extent can cloud gaming services improve? Much has been made of the fact that even with ultra-fast fibre-optic networks, latency will always be an issue. Similarly, lossless video quality requires so much bandwidth (720p60 is well over 100 megabytes per second) that it's not going to be viable on gaming services. Given that video will always be compressed, to what extent can picture quality - which varies dramatically from one instant to the next - get better?

In this article we'll be tackling both of these issues, presenting the argument that improvements to internet infrastructure combined with optimising the current latency pipeline could well be enough to bridge the gap between cloud services and what you might call a standard console experience.

The picture quality issue is perhaps the easier aspect to address. At the moment the standard appears to be to transmit a 720p video stream at 60 frames per second using around 5mbps of bandwidth. Having worked extensively with h.264 video - the same system used by OnLive and Gaikai - that seems to be a very low level of bandwidth for a 60FPS stream, and it's safe to say that this encoding technique performs extremely poorly with certain games: playing titles such as Warhammer 40,000: Space Marine on OnLive is a pretty hideous experience all told. The bottom line is that the more motion and colour in play, the more bandwidth is required to sustain quality. In short, some games will look great, others will look terrible.

A bit of an exclusive! The same game - Assassin's Creed: Brotherhood - running on the same connection but on two cloud services. Click on the images for lossless comparison images from OnLive and Gaikai. In addition to higher image quality, the Gaikai game is obviously running with higher quality settings engaged (note the implementation of anti-aliasing).

Improvements in compression technology can help of course. While both OnLive and Gaikai use h.264 compression, the encoders behind them at the datacentres are very, very different. The recent addition of Assassin's Creed: Brotherhood on Gaikai gives us an excellent opportunity to compare the two cloud gaming services in terms of picture quality. Gaikai's use of the widely acclaimed x264 encoder, used by YouTube and Facebook amongst a multitude of others demonstrates that at the same approximate levels of bandwidth, image quality gains can be seen.

Of course one has to consider that Gaikai operates from many more data centers around the world than OnLive, therefore is closer to gamers in many locations. Longer distances not only introduce more latency, they also increase the chance of data errors which cause image quality degradation. Gaikai currently also only serves demos to gamers which makes it possible that the cloud gaming ads on various pages that serve demos from the Gaikai cloud gaming network only show up for gamers that have better internet connections and are closer to Gaikai data centers.

OnLive on the other hand currently offers a full cloud gaming platform that has to serve video streams of game sessions 24/7 for all gamers who use OnLive, be it for playing demos or full games that people bought on the service. The OnLive cloud gaming platform also includes features like the Arena where you spectate live video streams of others playing games, Brag Clips which at any time record the last 10 seconds of your gaming session, group voice chat, player profiles, achievements, friends lists, etc. OnLive is basically a fully featured console service being video streamed to devices like PCs, Macs, TVs, tablets and smartphones, from the cloud. And OnLive achieves this with a dramatically lower count of data centers, which are therefore way bigger than Gaikai's. Because OnLive has to serve all gamers using their service and they have less servers, they are usualy farther away from the gamers and this can introduce a lower quality picture. OnLive also serves gamers with lower bitrate connections, down to 0.5 Mbps on smartphones.

Similarly, the introduction of Crytek into the cloud scene is intriguing. Previously the company has revealed some of its thoughts on optimising video compression by integrating it into the game itself, allocating bandwidth according to the most important elements of the scene rather than treating the frame as a simple 2D image to be compressed and beamed over the internet. In short, the game engine knows more about the make-up of the scene than an external compressor, so in theory it could do a better job of encoding it.

However, at the end of the day, I suspect that this is a problem that will simply be overcome by brute-force alone. As infrastructure radically improves, so the available bandwidth will increase and the cost of utilising it will be forced down. If OnLive works at 5 Mbps - albeit with plenty of issues - imagine what could be done by upping that to 10 Mbps. With BT recently announcing 330 Mbps trials in the UK, and arch-competitor Virgin already offering end-users a 120 Mbps product, why stop there? Why not go up to 20 Mbps or even beyond?

Both OnLive and Gaikai have demonstrated utilising this extra bandwidth for 1080p and stereoscopic 3D support, but I would suggest that employing it to improve image quality is perhaps a better way forward. To illustrate, here's an excerpt of what I would deem to be pretty challenging video, encoded using x264 (the same technology behind Gaikai) at 5, 10, 15 and 20 Mbps. While the actual encoding settings won't be identical to what Gaikai is using, it does demonstrate the basic problem and the effectiveness of the brute-force solution. At its heart, video compression is all about using data efficiently to describe the difference between frames. On a basic, fundamental level, the more bandwidth available, the more accurately the changes can be rendered from one image to the next.

The nature of video compression is such that the more bandwidth you give to the encoding process, the higher the video quality. These shots aren't representative of either OnLive or Gaikai but they do serve to demonstrate that the higher the bitrate, the more detail is preserved in the encoding process - but there is a law of diminishing returns the more bandwidth you use. Here we compare 5, 10 and 20 Mbps encodes with the lossless original shot.

So if we're looking at a combination of better encoders and more bandwidth to overcome the image quality issues, what about the response issue? Latency will always be the key challenge with cloud-based services - the speed of light is a bit of a pain in the arse in that regard - but even in this regard we could see tangible improvements in the coming years. Let's take a look at how latency is tackled in the here and now and factor in potential elements that could see this improved.

The current methodology we've seen with OnLive in making games playable over the cloud is pretty straightforward: even without factoring in the internet, all games have their own internal latency - the so-called input lag. This varies from title to title, depending on how they are programmed, but to give a couple of examples, we've measured Call of Duty: Modern Warfare 3 (60FPS) on Xbox 360 as having a 50ms latency from button press to resulting on-screen action, whereas Battlefield 3 (30FPS) on the same console seems to be in the region of 116ms.

The theory is that by running a console 30FPS game at twice the frame-rate - OnLive targets 720p60, remember - input latency is significantly reduced. For the sake of argument, let's say that 50ms is shaved off the response time. That's enough time to encode a frame, decode it and also take a bite into the transmission time over the internet. That's the theory, so how does it stand up in practise? This is very easy to test: measure OnLive latency, and compare it with the PC and Xbox 360 versions. The PC metric gives us the base latency of the game itself (the same code is used with OnLive remember), while the Xbox 360 figure represents the target latency in providing a console-like response.

The tests were carried out on a 50mbps Virgin fibre optic connection with no other traffic running on the line at the time, and we chose areas where the game was operating at its highest frame-rate - in short, as close to best-case conditions as we could manage. On other connections we were quite alarmed at how variable this measurement could be, and we were also quite startled at the variance caused by drops in game performance, server-side. Inconsistency appears to exaggerate the impact of lag.

Regardless, in these tests, the difference between PC and OnLive is in the region of 83 to 116ms, but the gap closes when compared to the console versions. In our experience, it's usually playable but it's noticeably laggy - to varying degrees. We've also noticed on a number of tests that there's something of a latency threshold around the 150ms level - if you're below that, typically control isn't flagged as an issue but if you're above it, people do complain. Bulletstorm on console comes in at around 133ms and there are few complaints about its response level. Compare and contrast with Killzone 2 at 150ms, which turned into something of a major issue (though perhaps because frame-rate drops did have a further impact on response).

At its best, OnLive dances around the threshold - noticeable but not an enormous issue. At its worst, it's well over it and unsatisfactory. Improving this is the key challenge. For a start, lowering latency as much as possible within the game itself will claw back precious milliseconds - something we've discussed already in the Optimising for the Cloud article. Perhaps if cloud gaming gains traction, this will become more of a focus during development.

Similarly, ensuring a solid 60FPS will help, meaning that cloud providers will actually have to deliver in that regard: OnLive proves to be rather variable in that regard and the more drops from 60FPS there are, the higher the latency. In essence then, developers need to be more mindful of the target platform, or else the platform itself needs more powerful hardware.

Secondly, the deployment of more datacentres closer to the client is an obvious move. David Perry has been talking a lot recently about ultra-low latencies between his various locations and Gaikai datacentres - specifically 8ms between his home and what we'll assume is the Californian server, and even as low as 5ms between his London hotel and the local Gaikai facility. Right now, OnLive UK is actually serviced by a facility in Luxembourg. Typically the further afield the datacentre, the higher the latency and the more opportunity there is for packet loss, so being more local has obvious advantages. Player-side, as infrastructure is upgraded more towards fibre, latency should also decrease there too.

But can any more be done? Gaikai's association with LG in getting their service available via Smart TVs may present further opportunities. Connect up an Xbox 360 to an HDTV and even in "Game" mode - which disables a lot of the set's lag-inducing post-processing - you can still be looking at latencies of 50ms just from beaming a digital signal from the console and getting it displayed on the screen. Even when measuring latencies on fast gaming PC monitors - with an advertised 8ms lag - the actual end-to-end measurements we're getting can be up to 33ms. Bearing in mind how much the cloud services can achieve in the same time period, this is remarkably inefficient and obviously another vector of attack that Gaikai could use in bridging the gap between console and cloud latency levels. If you're already integrated into the TV itself, why not try to make the most of it?

I would suggest that the kind of experience console users enjoy now with Call of Duty: Modern Warfare 3 - in all its 60FPS, ultra-low latency glory - simply cannot be achieved with a cloud gaming service. But an additional 50-83ms gives us the same kind of response that we get from console FPS titles like Borderlands, Battlefield 3Killzone 3 and Bulletstorm: all eminently playable, and none of which have been criticised for being too laggy. At the moment it's theory, but relentless march of technological innovation has a habit of turning this into palpable fact sooner rather than later.

It's almost three years now since Richard Leadbetter wrote Why OnLive Can't Possibly Work, and it's interesting to look back and see the points being made that were eventually born out (latency, picture quality) in subsequent analysis, but how fundamentally, despite the very significant, quantifiable drawbacks, it is actually playable.

In the here and now, we are being asked to take the hit in fidelity and response in favour of a more convenient experience. Going forward, can we both have our cake and eat it with a service that captures the essence of the modern day console experience, and perhaps even exceeds it by using more powerful PC hardware, server-side? With next-gen consoles the best part of two or even three years ahead of us, it'll be interesting to see if the cloud-based engineering breakthroughs and infrastructure improvements can arrive before new local hardware gains the kind of critical mass Xbox 360 and PS3 enjoy now.


No comments:

Post a comment