Google Maps – The Game

In about a month, Google is going to release a game on Google+ based on Google Maps and built using WebGL (Sorry IE users).

…there’s a video preview of a new Google Maps for Google+ app – shown below – which uses WebGL and apparently user-location to collect points as you travel around floorplan maps. Full details haven’t been shared, but the game will apparently arrive in February.

Now the video doesn’t show much about the details for the game but navigating a 3d mapping world (using the Google Maps API) in a WebGL application in a browser is pretty awesome.  Plus going inside and outside the buildng?  Sign me up!

Looks like fun to me, but we’ll have to wait a month.

It is a shame about WebGL support not being exactly cross-platform, but with a little work you can get it enabled on any browser.  Cools stuff is on the horizon with 3D web mapping applications.

SketchUp for Game Design

I’ve yet to meet a SketchUp modeler who doesn’t—at least just a little bit—want to work in the video game design industry. I get a stupid grin on my face when I think about how much fun it it would be to make battle tanks and exploding oil drums and secret doors for hidden basements full of zombies. In the gaming world, boring things like gravity and cost take a backseat to novelty and sheer coolness.

But how to turn your SketchUp habit (and job cranking out toilet stall details) into days full of armor design and wandering through bad neighborhoods looking for interesting photo-textures to shoot?


Google SketchUp for Game Design is Robin de Jongh’s newest book; he also wrote SketchUp 7.1 for Architectural Visualization. It presumes that you’re a SketchUp beginner, but then quickly gets on to the good stuff:

  • Finding good resources for photo-textures
  • Using Meshlab to convert your models in useable 3D game assets
  • Working with the Unity 3D game engine (which is widespread, free-or-low-cost middleware for designing game levels)
  • Creating high-quality textures for games
  • Adapting your models for use in video games
  • Authoring custom levels
  • Modeling low-poly game assets (including cars) and selling them online

Robin’s writing is accessible and easy to follow. He packs a lot of information into each page, but manages to keep the tone friendly and even funny at times. While the book’s in black and white, color versions of the images are available from the publisher’s website.

Doodles for Google Apps

 

Since 1998, when the first doodle was released, they have been one of the most loved features of the Google home page. There have been doodles to celebrate all kinds of events, including national holidays, birthdays of artists and scientists, sports competitions, scientific discoveries and even video games! Also, doodles have evolved from simple static images to complex applications, such as the interactive electric guitar used to celebrate the birthday of Les Paul.

Want your company logo to change for selected events or holidays, just like doodles? The Admin Settings API allows domain administrators to write scripts to programmatically change the logo of their Google Apps domain, and Google App Engine offers the ability to configure regularly scheduled tasks, so that those scripts can run automatically every day.

With these two pieces combined, it is pretty easy to implement a complete solution to change the domain logo on a daily basis (assuming the graphic designers have prepared a doodle for each day), as in the following screenshot:

 

Let’s start with a Python App Engine script called doodleapps.py:

import gdata.apps.adminsettings.service
from google.appengine.ext import webapp
from google.appengine.ext.webapp import util
from datetime import date

class DoodleHandler(webapp.RequestHandler):
  # list of available doodles
  DOODLES = {    
    '1-1': 'images/newyearsday.jpg',
    '2-14': 'images/valentinesday.jpg',
    '10-31': 'images/halloween.jpg',
    '12-25': 'images/christmas.jpg'
  }

  # returns the path to the doodle corresponding to the date
  # or None if no doodle is available
  def getHolidayDoodle(self, date):
    key = '%s-%s' % (date.month, date.day)
    if key not in self.DOODLES:
      return None

    return self.DOODLES[key]

  # handles HTTP requests by setting today’s doodle
  def get(self):
    doodle = self.getHolidayDoodle(date.today())
    self.response.out.write(doodle)

    if doodle:
      service = gdata.apps.adminsettings.service.AdminSettingsService()
      // replace domain, email and password with your credentials
      // or change the authorization mechanism to use OAuth
      service.domain = 'MYDOMAIN.COM'
      service.email = 'ADMIN@MYDOMAIN.COM'
      service.password = 'MYPASSWORD'
      service.source = 'DoodleApps'
      service.ProgrammaticLogin()

      # reads the doodle image and update the domain logo
      doodle_bytes = open(doodle, "rb").read()
      service.UpdateDomainLogo(doodle_bytes)

# webapp initialization
def main():
    application = webapp.WSGIApplication([('/', DoodleHandler)],
                                         debug=True)
    util.run_wsgi_app(application)

if __name__ == '__main__':
    main()

The script uses a set of predefined doodles which can be edited to match your list of images or replaced with more sophisticated logic, such as using the Google Calendar API to get the list of holidays in your country.

Every time the script is triggered by an incoming HTTP request, it will check whether a doodle for the date is available and, if there is one, update the domain logo using the Admin Settings API.

In order for this script to be deployed on App Engine, you need to to configure the application by defining a app.yaml file with the following content:

application: doodleapps
version: 1
runtime: python
api_version: 1

handlers:
- url: .*
  script: doodleapps.py

We want the script to run automatically every 24 hours, without the need for the administrator to send a request, so we also have to define another configuration file called cron.yaml:

cron:
- description: daily doodle update
  url: /
  schedule: every 24 hours

Once the application is deployed on App Engine, it will run the script on a daily basis and update the logo.