Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by samersamy · Sep 12, 2011 at 01:53 PM · buildwebplayergooglebuild-settings

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

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image ThatsAMorais · Dec 10, 2013 at 05:02 AM 0
Share

Would you $$anonymous$$d marking an answer to this?

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by BerggreenDK · Sep 13, 2011 at 09:08 AM

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

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0
Wiki

Answer by ThatsAMorais · Nov 14, 2013 at 05:31 AM

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.

Comment
Add comment · Show 17 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Abhishek81 · Nov 21, 2013 at 02:41 AM 0
Share

I am using the same structure to update my Unity Web Player content but I am getting 500 server error at appspot.com domain.

avatar image ThatsAMorais Abhishek81 · Nov 21, 2013 at 03:40 AM 0
Share

Hi. Were you commenting on my answer?

What I know about 500 Server error is that it relates to an unhandled exception in your python code. Python being sensitive to whitespace tells me that you should ensure that the tabs are all formatted properly. For example, if you copy-pasted my python code from above, you might get spaces ins$$anonymous$$d of tabs.

avatar image Abhishek81 Abhishek81 · Nov 21, 2013 at 04:27 AM 0
Share

$$anonymous$$y Folder Structure is: /GAEGame

/WebPlayer

WebPlayer.html

WebPlayer.unity3d

app.yaml

favicon.ico

index.yaml

main.py The app.yaml file

 application: gcdc2013-space3d
 version: 1
 runtime: python27
 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.2"

main.py

 from google.appengine.ext.webapp import template
 import webapp2
 import os
 
 class $$anonymous$$ainHandler(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([
     ('/', $$anonymous$$ainHandler)
 ], debug=True)

Is there any modifications i need to do.I have copied index.yaml and favicon.ico from another demo app i created.Any Help will be appreciated

avatar image ThatsAMorais Abhishek81 · Nov 21, 2013 at 07:45 AM 0
Share

Can you confirm that the indentation in your file is exactly what you have pasted here? It appears that the lines starting at

"'greetings':'greetings',"

and going all the way to

"self.response.out..."

needs to be indented to the same level as

"template_values = {"

You know what I am saying? The indentation matters in Python, and parts of what should be in "get" are unindented to the global scope.

Show more comments
avatar image ThatsAMorais · Nov 21, 2013 at 08:38 PM 0
Share

File "/base/data/home/apps/s~gcdc2013-space3d/1.371793060412129756/main.py", line 27, in get self.response.out.write(template.render(path, template_values))

Your error is suggesting that "templates" does not contain "WebPlayer.html". Initially, I can't imagine why it is looking in the templates for this string. Did you forget a comma?

The template is "greetings", not "WebPlayer.html", so that is puzzling and I'll have to see your code. Paste your current code again.

avatar image Abhishek81 · Nov 22, 2013 at 02:18 AM 0
Share

I am updating my code: app.yaml

 application: gcdc2013-space3d
 version: 1
 runtime: python27
 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.2"

main.py

 from google.appengine.ext.webapp import template
 import webapp2
 import os
 
 class $$anonymous$$ainHandler(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([
     ('/', $$anonymous$$ainHandler)
 ], debug=True)
avatar image ThatsAMorais · Nov 22, 2013 at 06:20 AM 0
Share

that last little bit is still looking a little strange. Try changing the "app" line (line 13 - 15) to the following

 app = webapp2.WSGIApplication([('/', $$anonymous$$ainHandler)], debug=True)
avatar image Abhishek81 · Nov 22, 2013 at 07:12 AM 0
Share

Still not working.Some sites have suggested that you can use webapp2/jinja2 templates still trying..

Show more comments

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Distribute terrain in zones 3 Answers

Getting a standalone project to run on a webpage? 0 Answers

Naming web player 1 Answer

Putting game on website 2 Answers

Build in Gradle 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges