Google Game Showcases WebRTC Communications

Google’s Cube Slam game makes use of WebRTC, a browser technology that enables video chat without plug-ins

Google has been working on WebRTC projects for some time, but now the search giant has included it in an experimental video game that will allow players to see, hear and communicate with each other using only a web browser.

And even if video games aren’t your style, the technology used in the Cube Slam game, which is a Google Chrome Experiment project, could find their way into many other business and consumer uses in the future.

Chrome Experiment

“Cube Slam is a Chrome Experiment built with WebRTC, an open web technology that lets you communicate in real-time in the browser (and in this case, play an old-school arcade game with your friends) without downloading and installing any plug-ins,” wrote Justin Uberti, a Google software engineer, in a 12 June post on the Google Chromium Blog. “Cube Slam uses getUserMedia to access your webcam and microphone (with your permission, of course), RTCPeerConnection to stream your video to a friend and RTCDataChannel to transfer the bits that keep the gameplay in sync.”

Google-Logo-On-WallThe Cube Slam game is the first large-scale application to use RTCDataChannel, which sends the data over the RTCPeerConnection peer-to-peer link, wrote Uberti.

“RTCDataChannel sends data securely, and supports an ‘unreliable’ mode for cases where you want high performance but don’t care about every single packet making it across the network. In cases like games where low delay often matters more than perfect delivery, this ensures that a single stray packet doesn’t slow down the whole app.”

The beauty of WebRTC is that in the future, as its development continues, “we’re looking forward to the day when you can have a Cube Slam face-off against your friends on any browser and any device”, wrote Uberti.

Today, RTCDataChannelsupports unreliable mode in desktop Chrome, he wrote, while WebRTC will also be available on Chrome for Android later this year. Users can try it now by selecting “Enable webRTC Android” in chrome://flags, he wrote.

Webified communications

Phil Edholm, principal analyst at PKE Consulting, and the host of the upcoming WebRTC Conference and Expo in Atlanta from 27 to 29 June, told eWEEK that the wow factor of WebRTC is its ability to allow easier online communications between multiple people at once.

“WebRTC is the webification of communications,” said Edholm. “Today, communications are done by servers that talk to each other so people can talk to each other. WebRTC gives direct interaction through the URL that you point to with your browser. That means that literally communications can become part of everything on the web.”

By providing users with WebRTC-enabled web browsers, they’ll be able to communicate easier with others for gaming, video chat, business communications and more, he said, all without having to download, install and configure additional applications.

“It is a change because communications is no longer this separate thing. It becomes part of the application, part of the experience. It can generate new things we haven’t even thought of yet.”

WebRTC communications can include video, data and audio components.

“The thing that made the web work and created this innovation is that any user with any devices can go to any website and they don’t have to download the site,” said Edholm. “They can just use it. You don’t have to download something to make a site work. That’s what WebRTC does.”

The Cube Slam video game lets users play face-to-face against their friends by simply using a WebRTC-enabled browser, wrote Clem Wright, of the Google Creative Lab, in a 12 June post on the Google Chrome Blog. Players can quickly join the game with friends anywhere in the world just by sharing a link.

Chrome technology

“To win Cube Slam, hit the cube against your friend’s screen three times until the screen explodes,” wrote Wright. “Shields, obstacles and gravity fields change with every new level, and you can unlock power-ups, including fireballs, lasers, multi-balls, mirrored controls, bulletproof shields, fog, ghost balls, time bombs, resized paddles, extra lives and death balls – though you might want to avoid the death balls. If none of your friends are online, you can always play against Bob the Bear and see what level you can reach. If you install the Cube Slam app, you can even play Bob when you’re offline.”

Inside the game, its graphics are rendered in WebGL and CSS 3D, and its soundtrack is delivered dynamically through Web Audio, wrote Wright.

WebRTC, which enables the two-person game, is available on desktop Chrome and Chrome OS, and will be available on mobile later this year.

In May, Google released two other video games, Roll It and Racer, as part of its ongoing Chrome Experiments projects.

Chrome Experiments began in 2009, when Google unleashed the project as a showcase for creative web experiments for its Chrome web browser. The projects come from people around the world. Most of the experiments are built with the HTML5, Canvas, SVG and WebGL.

The idea, according to Experiments, is to try new things and see how they go. In February, Google announced its first-ever capabilities for its Chrome browser to conduct video chats with Mozilla Firefox browsers using WebRTC, without any plug-ins. The development had been in the works since the fall of 2012 using WebRTC technologies.

High-definition video

WebRTC was used for the project because it delivers high-quality voice, high-definition (HD) video and low-delay communication to web browsers.

WebRTC capabilities were first added to the Chrome browser in July 2012 as part of Chrome 21 with the inclusion of a new getUserMedia API that allowed users to grant web apps access to cameras and microphones without a plug-in.

The getUserMedia API was the first step in WebRTC, which is a real-time communications standard that aims to allow high-quality video and audio communication on the web.

Are you a Google expert? Take our quiz!

Originally published on eWeek.