Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Google Cloud services for a HTML5 game?

I'm developing a HTML5 multiplayer game. Google have been doing a couple of these lately, but haven't released any information on how they made them.

  • I want the connection between the clients and the server to be sockets; not the old long polling hack.

  • The storage should be nosql / google datastore.

  • The framework should be in Python or JS.

Now, I can't use websockets with Google App Engine, which means I have to use Google Compute Engine (GCE). How much of the service should I run on Compute Engine; 100% or only the sockets and the rest of the backend on AppEngine. This seems like a good way to do it, but the GCE is in Europe and App Engine doesn't support this location yet, which means the the GCE have to talk back and forth over the Atlantic.

I could on the other hand develop the whole solution on GCE, but what storage and developer library should I use? I could use the new Google Cloud Datastore, but if I understand it correctly, it's like a low level api for talking the the datastore. I like how ndb is high level with models and takes care for caching. And for the solution, should I use nodejs, django or something else?

like image 603
Jon Ramvi Avatar asked Oct 22 '22 08:10

Jon Ramvi


1 Answers

Running your web frontends on App Engine while managing the websocket connection on Compute Engine, is similar to what Google did for recent Chrome web experiments (see the end of this blog post)

Check out the amazing World Wide Maze Chrome Experiment, developed by the Chrome team in Japan. This game converts any web site of your choice into an interactive, three dimensional maze, navigated remotely via your smartphone. Compute Engine virtual machines run Node.js to manage the game state and synchronization with the mobile device, while Google App Engine hosts the game’s web UI. This application provides an excellent example of the new kinds of rich, high performance back end services enabled by Google Cloud Platform.

You should also be able to create App Engine applications in Europe after filling the following form or signing up for premier account.

Google Cloud Datastore allows you to share you data between App Engine (using NDB if you use Python) and Compute Engine (using the low level API).

You can follow this issue about NDB support for Google Cloud Datastore.

like image 120
proppy Avatar answered Oct 27 '22 11:10

proppy