Wouldn’t it be great to have a working example that ties it all together? A highly-available, auto-scaling, cloud-based game with interactive mobile clients, a real-time browser display, backend database and compute-intensive services?
We have published a new solutions article that shows how to use Google Cloud Platform services to solve a complex problem in real time and scale during an onslaught of demand. Our example uses free open source (FOSS) technologies, including WebSocket with Node.js, OpenCV and PhantomJS. The article looks into the design of a game called World Wide Maze that lets users turn any website viewed in the Chrome browser into a 3D maze and navigate through the maze using their mobile phone as a tiltable game controller. The game is intended to demonstrate the power of HTML5 and WebGL, and the article takes you behind the scenes to see how the Google Cloud Platform makes it work.
World Wide Maze: Real-time 3D maze game playable with Chrome and mobile devices |
One of the biggest challenges when building a real-time game is handling the persistent connections between the clients and servers. In World Wide Maze, real-time communication from the game controller to the game screen needs to be handled within 200 ms. This real-time communication includes:
- The request from the controller received by the server
- The request routed to the screen from the server
- The maze rendered on the screen, based on the request
The article delves into how World Wide Maze is designed and how it solves the real-time communication challenges. On the server side, World Wide Maze uses a combination of App Engine and Compute Engine. Compute Engine accepts WebSocket connections that are used to implement the bi-directional low latency communication between the controller and the screen. Compute Engine is also used to host the database servers and to build game stages. App Engine accepts HTTP requests, orchestrates Compute Engine instances and connects the clients with available Compute Engine instances.
Read more in the article Real-time Gaming with Node.js + WebSocket on Google Cloud Platform.
- Posted by Jeff Peck, Cloud Solutions Technical Account Manager
0 comments:
Post a Comment