Deploy Unity Web Application to Google App Engine

Hi all,

I am trying to host my game on Google App Engine.
I don know what type of build settings should i use regarding the Web Player (Streamed, Offline Deployment, … ) ???

Any additional precautions or details i should notice, will be appreciated.

Thanks,

Samer Samy

I havent tried to use Google App engine for running Unity, but when you use the Webplayer, the settings you mention (as far as I know) has the following meaning:

  1. Streamed, means that the first scene (can be configured) will be show before the whole file is downloaded to the webplayer. This can speed up some of the feeling + later scenes/levels can load in the back while the game starts up faster.

  2. Offline, generates/copies the UnityObject.js file into the same folder as where you publish instead of linking to the latest online version at Unity servers.

Look for the details here. Google is your friend. I used: “unity3d web publish” to find this link.
http://unity3d.com/support/documentation/Manual/Publishing%20Builds.html

I have used GAE to host a game many times.

My GAE app directory for the given app I’m deploying contains the following…

/GAEGame

   /WebPlayer

         WebPlayer.html

         WebPlayer.unity3d

   app.yaml

   favicon.ico

   index.yaml

   main.py

I like to take the same directory structure and reuse it for other projects which is why I have the “WebPlayer” directory. All that needs doing is to copy it from one of my previous projects to my current project, redeploy the new game’s webplayer to “WebPlayer”


app.yaml:

application: webroleplay          <---- Change this to match your appspot URL
version: 1
runtime: python27                 <---- This is what GAE requires, currently
api_version: 1
threadsafe: yes

handlers:
- url: /favicon\.ico
  static_files: favicon.ico
  upload: favicon\.ico

- url: /WebPlayer\.unity3d
  static_files: WebPlayer/WebPlayer.unity3d
  upload: WebPlayer/WebPlayer\.unity3d

- url: .*
  script: main.app

libraries:
- name: webapp2
  version: "2.5.1"

main.py:

from google.appengine.ext.webapp import template
import webapp2
import os

class MainHandler(webapp2.RequestHandler):
    def get(self):
		
		template_values = {
				'greetings': 'greetings',
				}
		path = os.path.join('WebPlayer', 'WebPlayer.html')
		self.response.out.write(template.render(path, template_values))



app = webapp2.WSGIApplication([('/', MainHandler)],
                              debug=True

Not a plug, but http://webroleplay.appspot.com is one that I have running, now.